|
Lines 160-193
Link Here
|
| 160 |
} |
160 |
} |
| 161 |
} |
161 |
} |
| 162 |
public void checkComment() { |
162 |
public void checkComment() { |
| 163 |
// discard obsolete comments while inside methods or fields initializer (see bug 74369) |
163 |
super.checkComment(); |
| 164 |
if (!(this.diet && this.dietInt==0) && this.scanner.commentPtr >= 0) { |
|
|
| 165 |
flushCommentsDefinedPriorTo(this.endStatementPosition); |
| 166 |
} |
| 167 |
|
| 168 |
int lastComment = this.scanner.commentPtr; |
| 169 |
|
| 170 |
if (this.modifiersSourceStart >= 0) { |
| 171 |
// eliminate comments located after modifierSourceStart if positionned |
| 172 |
while (lastComment >= 0 && Math.abs(this.scanner.commentStarts[lastComment]) > this.modifiersSourceStart) lastComment--; |
| 173 |
} |
| 174 |
if (lastComment >= 0) { |
| 175 |
// consider all remaining leading comments to be part of current declaration |
| 176 |
this.modifiersSourceStart = Math.abs(this.scanner.commentStarts[0]); |
| 177 |
|
| 178 |
// check deprecation in last comment if javadoc (can be followed by non-javadoc comments which are simply ignored) |
| 179 |
while (lastComment >= 0 && this.scanner.commentStops[lastComment] < 0) lastComment--; // non javadoc comment have negative end positions |
| 180 |
if (lastComment >= 0 && this.javadocParser != null) { |
| 181 |
int commentEnd = this.scanner.commentStops[lastComment] - 1; //stop is one over, |
| 182 |
// do not report problem before last parsed comment while recovering code... |
| 183 |
this.javadocParser.reportProblems = this.currentElement == null || commentEnd > this.lastJavadocEnd; |
| 184 |
if (this.javadocParser.checkDeprecation(lastComment)) { |
| 185 |
checkAndSetModifiers(ClassFileConstants.AccDeprecated); |
| 186 |
} |
| 187 |
this.javadoc = this.javadocParser.docComment; // null if check javadoc is not activated |
| 188 |
if (currentElement == null) this.lastJavadocEnd = commentEnd; |
| 189 |
} |
| 190 |
} |
| 191 |
|
164 |
|
| 192 |
if (this.reportReferenceInfo && this.javadocParser.checkDocComment && this.javadoc != null) { |
165 |
if (this.reportReferenceInfo && this.javadocParser.checkDocComment && this.javadoc != null) { |
| 193 |
// Report reference info in javadoc comment @throws/@exception tags |
166 |
// Report reference info in javadoc comment @throws/@exception tags |