Link Here
|
42 |
public void checkComment() { |
42 |
public void checkComment() { |
43 |
|
43 |
|
44 |
// discard obsolete comments while inside methods or fields initializer (see bug 74369) |
44 |
// discard obsolete comments while inside methods or fields initializer (see bug 74369) |
45 |
if (!(this.diet && this.dietInt==0) && this.scanner.commentPtr >= 0) { |
45 |
if (this.nestedMethod[this.nestedType] != 0 && this.scanner.commentPtr >= 0) { |
46 |
flushCommentsDefinedPriorTo(this.endStatementPosition); |
46 |
flushComments(); |
|
|
47 |
return; |
47 |
} |
48 |
} |
48 |
boolean deprecated = false; |
49 |
boolean deprecated = false; |
49 |
boolean checkDeprecated = false; |
50 |
boolean checkDeprecated = false; |
Link Here
|
141 |
} |
142 |
} |
142 |
return unit; |
143 |
return unit; |
143 |
} |
144 |
} |
144 |
|
145 |
public void flushComments() { |
|
|
146 |
final int lastCommentIndex = this.scanner.commentPtr; |
147 |
if (lastCommentIndex < 0) return; // no comment |
148 |
pushOnCommentsStack(0, lastCommentIndex); // store comment before flushing them |
149 |
this.scanner.commentPtr = -1; |
150 |
} |
145 |
/* (non-Javadoc) |
151 |
/* (non-Javadoc) |
146 |
* Save all source comments currently stored before flushing them. |
152 |
* Save all source comments currently stored before flushing them. |
147 |
* @see org.eclipse.jdt.internal.compiler.parser.Parser#flushCommentsDefinedPriorTo(int) |
153 |
* @see org.eclipse.jdt.internal.compiler.parser.Parser#flushCommentsDefinedPriorTo(int) |