Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptff2004-09-20 04:53:08 -0400
committerptff2004-09-20 04:53:08 -0400
commit8fb60f4c484e856b6beac62999dbbd0025b7ddbd (patch)
tree4f3141f4aa05c8342131ddc30703bd14afff99d1
parent654b2ed9c0f2c24211066f7d0d10f93738b76ee7 (diff)
downloadeclipse.jdt.core-8fb60f4c484e856b6beac62999dbbd0025b7ddbd.tar.gz
eclipse.jdt.core-8fb60f4c484e856b6beac62999dbbd0025b7ddbd.tar.xz
eclipse.jdt.core-8fb60f4c484e856b6beac62999dbbd0025b7ddbd.zip
73112, 71267, 73551
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java32
1 files changed, 5 insertions, 27 deletions
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
index 99427d8661..7d6be42cb1 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
@@ -1027,6 +1027,8 @@ public SearchMatch newDeclarationMatch(
return new MethodDeclarationMatch(element, accuracy, offset, length, participant, resource);
case IJavaElement.LOCAL_VARIABLE:
return new LocalVariableDeclarationMatch(element, accuracy, offset, length, participant, resource);
+ case IJavaElement.PACKAGE_DECLARATION:
+ return new PackageDeclarationMatch(element, accuracy, offset, length, participant, resource);
default:
return null;
}
@@ -1407,32 +1409,6 @@ protected void reportMatching(CompilationUnitDeclaration unit, boolean mustResol
? unit.scope.getTypeOrPackage(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length))
: unit.scope.getTypeOrPackage(importRef.tokens);
this.patternLocator.matchLevelAndReportImportRef(importRef, binding, this);
- } else {
- if (node instanceof JavadocSingleTypeReference) {
- // special case for javadoc single type reference
- JavadocSingleTypeReference singleRef = (JavadocSingleTypeReference) node;
- if (singleRef.packageBinding != null) {
- char[][] tokens = new char[][] { singleRef.token };
- long[] positions = new long[] { (((long) singleRef.sourceStart) << 32) + singleRef.sourceEnd };
- int tagStart = singleRef.tagSourceStart;
- int tagEnd = singleRef.tagSourceEnd;
- JavadocImportReference importRef = new JavadocImportReference(tokens, positions, tagStart, tagEnd);
- this.patternLocator.matchLevelAndReportImportRef(importRef, singleRef.packageBinding, this);
- continue;
- }
- } else if (node instanceof JavadocQualifiedTypeReference) {
- // special case for javadoc qualified type reference
- JavadocQualifiedTypeReference qualifRef = (JavadocQualifiedTypeReference) node;
- if (qualifRef.packageBinding != null) {
- char[][] tokens = qualifRef.tokens;
- long[] positions = qualifRef.sourcePositions;
- int tagStart = qualifRef.tagSourceStart;
- int tagEnd = qualifRef.tagSourceEnd;
- JavadocImportReference importRef = new JavadocImportReference(tokens, positions, tagStart, tagEnd);
- this.patternLocator.matchLevelAndReportImportRef(importRef, qualifRef.packageBinding, this);
- continue;
- }
- }
}
nodeSet.addMatch(node, this.patternLocator.resolveLevel(node));
}
@@ -1498,7 +1474,9 @@ protected void reportMatching(FieldDeclaration field, TypeDeclaration type, IJav
}
if (typeInHierarchy) {
- ASTNode[] nodes = nodeSet.matchingNodes(field.declarationSourceStart, field.declarationSourceEnd);
+ // limit scan to end part position for multiple fields declaration (see bug 73112)
+ int end = field.endPart2Position==0 ? field.declarationSourceEnd : field.endPart2Position;
+ ASTNode[] nodes = nodeSet.matchingNodes(field.declarationSourceStart, end);
if (nodes != null) {
if ((this.matchContainer & PatternLocator.FIELD_CONTAINER) == 0) {
for (int i = 0, l = nodes.length; i < l; i++)

Back to the top