Lines 1110-1120
Link Here
|
1110 |
|
1110 |
|
1111 |
if (this.modifiersSourceStart >= 0) { |
1111 |
if (this.modifiersSourceStart >= 0) { |
1112 |
// eliminate comments located after modifierSourceStart if positionned |
1112 |
// eliminate comments located after modifierSourceStart if positionned |
1113 |
while (lastComment >= 0 && this.scanner.commentStarts[lastComment] > this.modifiersSourceStart) lastComment--; |
1113 |
while (lastComment >= 0) { |
|
|
1114 |
int commentSourceStart = this.scanner.commentStarts[lastComment]; |
1115 |
if (commentSourceStart < 0) commentSourceStart = -commentSourceStart; |
1116 |
if (commentSourceStart <= this.modifiersSourceStart) break; |
1117 |
lastComment--; |
1118 |
} |
1114 |
} |
1119 |
} |
1115 |
if (lastComment >= 0) { |
1120 |
if (lastComment >= 0) { |
1116 |
// consider all remaining leading comments to be part of current declaration |
1121 |
// consider all remaining leading comments to be part of current declaration |
1117 |
this.modifiersSourceStart = this.scanner.commentStarts[0]; |
1122 |
this.modifiersSourceStart = this.scanner.commentStarts[0]; |
|
|
1123 |
if (this.modifiersSourceStart < 0) this.modifiersSourceStart = -this.modifiersSourceStart; |
1118 |
|
1124 |
|
1119 |
// check deprecation in last comment if javadoc (can be followed by non-javadoc comments which are simply ignored) |
1125 |
// check deprecation in last comment if javadoc (can be followed by non-javadoc comments which are simply ignored) |
1120 |
while (lastComment >= 0 && this.scanner.commentStops[lastComment] < 0) lastComment--; // non javadoc comment have negative end positions |
1126 |
while (lastComment >= 0 && this.scanner.commentStops[lastComment] < 0) lastComment--; // non javadoc comment have negative end positions |
Lines 8050-8055
Link Here
|
8050 |
int iComment = this.scanner.commentPtr; |
8056 |
int iComment = this.scanner.commentPtr; |
8051 |
for (; iComment >= 0; iComment--) { |
8057 |
for (; iComment >= 0; iComment--) { |
8052 |
int commentStart = this.scanner.commentStarts[iComment]; |
8058 |
int commentStart = this.scanner.commentStarts[iComment]; |
|
|
8059 |
if (commentStart < 0) commentStart = -commentStart; |
8053 |
// ignore comments before start |
8060 |
// ignore comments before start |
8054 |
if (commentStart < sourceStart) continue; |
8061 |
if (commentStart < sourceStart) continue; |
8055 |
// ignore comments after end |
8062 |
// ignore comments after end |
Lines 8472-8480
Link Here
|
8472 |
public int[] getJavaDocPositions() { |
8479 |
public int[] getJavaDocPositions() { |
8473 |
|
8480 |
|
8474 |
int javadocCount = 0; |
8481 |
int javadocCount = 0; |
8475 |
for (int i = 0, max = this.scanner.commentPtr; i <= max; i++){ |
8482 |
int max = this.scanner.commentPtr; |
8476 |
// javadoc only (non javadoc comment have negative end positions.) |
8483 |
for (int i = 0; i <= max; i++){ |
8477 |
if (this.scanner.commentStops[i] > 0){ |
8484 |
// javadoc only (non javadoc comment have negative start and/or end positions.) |
|
|
8485 |
if (this.scanner.commentStarts[i] >= 0 && this.scanner.commentStops[i] > 0) { |
8478 |
javadocCount++; |
8486 |
javadocCount++; |
8479 |
} |
8487 |
} |
8480 |
} |
8488 |
} |
Lines 8482-8492
Link Here
|
8482 |
|
8490 |
|
8483 |
int[] positions = new int[2*javadocCount]; |
8491 |
int[] positions = new int[2*javadocCount]; |
8484 |
int index = 0; |
8492 |
int index = 0; |
8485 |
for (int i = 0, max = this.scanner.commentPtr; i <= max; i++){ |
8493 |
for (int i = 0; i <= max; i++){ |
8486 |
// javadoc only (non javadoc comment have negative end positions.) |
8494 |
// javadoc only (non javadoc comment have negative start and/or end positions.) |
8487 |
if (this.scanner.commentStops[i] > 0){ |
8495 |
int commentStart = this.scanner.commentStarts[i]; |
8488 |
positions[index++] = this.scanner.commentStarts[i]; |
8496 |
if (commentStart >= 0) { |
8489 |
positions[index++] = this.scanner.commentStops[i]-1; //stop is one over |
8497 |
int commentStop = this.scanner.commentStops[i]; |
|
|
8498 |
if (commentStop > 0){ |
8499 |
positions[index++] = commentStart; |
8500 |
positions[index++] = commentStop-1; //stop is one over |
8501 |
} |
8490 |
} |
8502 |
} |
8491 |
} |
8503 |
} |
8492 |
return positions; |
8504 |
return positions; |