diff options
author | Andrey Loskutov | 2017-12-08 15:41:43 +0000 |
---|---|---|
committer | Andrey Loskutov | 2017-12-08 15:41:43 +0000 |
commit | 00395bbb8cd24cf6c51633da243a63bd1d069c87 (patch) | |
tree | 3e9dabffc8df420840a299bad91a19907b0765e2 /org.eclipse.jdt.core/codeassist | |
parent | a678984d7982779ed3c443a9f934da63ceb684dd (diff) | |
download | eclipse.jdt.core-00395bbb8cd24cf6c51633da243a63bd1d069c87.tar.gz eclipse.jdt.core-00395bbb8cd24cf6c51633da243a63bd1d069c87.tar.xz eclipse.jdt.core-00395bbb8cd24cf6c51633da243a63bd1d069c87.zip |
Bug 528108 - Add @Override to jdt.core
No manual changes, simply executed Cleanup -> Add missing overrides on
all jdt.core sources.
Change-Id: I5fe226042039905f7d29327038742c2d6a152611
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.jdt.core/codeassist')
94 files changed, 815 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionElementNotifier.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionElementNotifier.java index 99427f5627..663d4872c8 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionElementNotifier.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionElementNotifier.java @@ -71,6 +71,7 @@ public class CompletionElementNotifier extends SourceElementNotifier { return new char[][][] {argumentTypes, argumentNames}; } + @Override protected char[][] getInterfaceNames(TypeDeclaration typeDeclaration) { char[][] interfaceNames = null; int superInterfacesLength = 0; @@ -108,6 +109,7 @@ public class CompletionElementNotifier extends SourceElementNotifier { return interfaceNames; } + @Override protected char[] getSuperclassName(TypeDeclaration typeDeclaration) { TypeReference superclass = typeDeclaration.superclass; @@ -117,6 +119,7 @@ public class CompletionElementNotifier extends SourceElementNotifier { return superclass != null ? CharOperation.concatWith(superclass.getParameterizedTypeName(), '.') : null; } + @Override protected char[][] getThrownExceptions(AbstractMethodDeclaration methodDeclaration) { char[][] thrownExceptionTypes = null; TypeReference[] thrownExceptions = methodDeclaration.thrownExceptions; @@ -142,6 +145,7 @@ public class CompletionElementNotifier extends SourceElementNotifier { return thrownExceptionTypes; } + @Override protected char[][] getTypeParameterBounds(TypeParameter typeParameter) { TypeReference firstBound = typeParameter.type; TypeReference[] otherBounds = typeParameter.bounds; @@ -182,6 +186,7 @@ public class CompletionElementNotifier extends SourceElementNotifier { return typeParameterBounds; } + @Override protected void notifySourceElementRequestor(AbstractMethodDeclaration methodDeclaration, TypeDeclaration declaringType, ImportReference currentPackage) { if (methodDeclaration instanceof CompletionOnMethodReturnType) return; if (methodDeclaration instanceof CompletionOnMethodTypeParameter) return; @@ -189,16 +194,19 @@ public class CompletionElementNotifier extends SourceElementNotifier { super.notifySourceElementRequestor(methodDeclaration, declaringType, currentPackage); } + @Override public void notifySourceElementRequestor(CompilationUnitDeclaration parsedUnit, int sourceStart, int sourceEnd, boolean reportReference, HashtableOfObjectToInt sourceEndsMap, Map nodesToCategoriesMap) { super.notifySourceElementRequestor(parsedUnit, sourceStart, sourceEnd, reportReference, sourceEndsMap, nodesToCategoriesMap); } + @Override protected void notifySourceElementRequestor(FieldDeclaration fieldDeclaration, TypeDeclaration declaringType) { if (fieldDeclaration instanceof CompletionOnFieldType) return; if (fieldDeclaration instanceof CompletionOnFieldName) return; super.notifySourceElementRequestor(fieldDeclaration, declaringType); } + @Override protected void notifySourceElementRequestor(ImportReference importReference, boolean isPackage) { if (importReference instanceof CompletionOnKeyword2) return; if (importReference instanceof CompletionOnImportReference || @@ -209,6 +217,7 @@ public class CompletionElementNotifier extends SourceElementNotifier { super.notifySourceElementRequestor(importReference, isPackage); } + @Override protected void notifySourceElementRequestor(TypeDeclaration typeDeclaration, boolean notifyTypePresence, TypeDeclaration declaringType, ImportReference currentPackage) { if (typeDeclaration instanceof CompletionOnAnnotationOfType) return; super.notifySourceElementRequestor(typeDeclaration, notifyTypePresence, declaringType, currentPackage); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java index b738fe7509..786cfc9332 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java @@ -292,6 +292,7 @@ public final class CompletionEngine this.accessibility = accessibility; } + @Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append('{'); @@ -326,6 +327,7 @@ public final class CompletionEngine this.accessibility = accessibility; } + @Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append('{'); @@ -394,6 +396,7 @@ public final class CompletionEngine return pb; } + @Override public CategorizedProblem createProblem( char[] originatingFileName, int problemId, @@ -419,6 +422,7 @@ public final class CompletionEngine columnNumber), originatingFileName, severity, start); } + @Override public CategorizedProblem createProblem( char[] originatingFileName, int problemId, @@ -789,20 +793,35 @@ public final class CompletionEngine static final char[] THROWS = "throws".toCharArray(); //$NON-NLS-1$ static InvocationSite FakeInvocationSite = new InvocationSite(){ + @Override public TypeBinding[] genericTypeArguments() { return null; } + @Override public boolean isSuperAccess(){ return false; } + @Override public boolean isTypeAccess(){ return false; } + @Override public void setActualReceiverType(ReferenceBinding receiverType) {/* empty */} + @Override public void setDepth(int depth){/* empty */} + @Override public void setFieldIndex(int depth){/* empty */} + @Override public int sourceEnd() { return 0; } + @Override public int sourceStart() { return 0; } + @Override public TypeBinding invocationTargetType() { return null; } + @Override public boolean receiverIsImplicitThis() { return false; } + @Override public InferenceContext18 freshInferenceContext(Scope scope) { return null; } + @Override public ExpressionContext getExpressionContext() { return ExpressionContext.VANILLA_CONTEXT; } + @Override public boolean isQualifiedSuper() { return false; } + @Override public boolean checkingPotentialCompatibility() { return false; } + @Override public void acceptPotentiallyCompatibleMethods(MethodBinding[] methods) {/* ignore */} }; @@ -858,6 +877,7 @@ public final class CompletionEngine this.monitor = monitor; } + @Override public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { if (!CharOperation.equals(sourceUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { // do not accept package-info.java as a type for completion engine @@ -869,6 +889,7 @@ public final class CompletionEngine } } + @Override public void acceptConstructor( int modifiers, char[] simpleTypeName, @@ -1290,6 +1311,7 @@ public final class CompletionEngine * Module names are in the form "a.b.c". * The default module is represented by an empty array. */ + @Override public void acceptModule(char[] moduleName) { if (this.knownModules.containsKey(moduleName)) return; if (CharOperation.equals(moduleName, this.moduleDeclaration.moduleName)) return; @@ -1326,6 +1348,7 @@ public final class CompletionEngine * Package names are in the form "a.b.c". * The default package is represented by an empty array. */ + @Override public void acceptPackage(char[] packageName) { if (this.knownPkgs.containsKey(packageName)) return; @@ -1382,6 +1405,7 @@ public final class CompletionEngine * Nested type names are in the qualified form "A.I". * The default package is represented by an empty array. */ + @Override public void acceptType( char[] packageName, char[] simpleTypeName, @@ -5598,6 +5622,7 @@ public final class CompletionEngine MissingTypesGuesser missingTypesConverter = new MissingTypesGuesser(this); MissingTypesGuesser.GuessedTypeRequestor substitutionRequestor = new MissingTypesGuesser.GuessedTypeRequestor() { + @Override public void accept( TypeBinding guessedType, Binding[] missingElements, @@ -7809,6 +7834,7 @@ public final class CompletionEngine MissingTypesGuesser missingTypesConverter = new MissingTypesGuesser(this); MissingTypesGuesser.GuessedTypeRequestor substitutionRequestor = new MissingTypesGuesser.GuessedTypeRequestor() { + @Override public void accept( TypeBinding guessedType, Binding[] missingElements, @@ -9831,6 +9857,7 @@ public final class CompletionEngine MissingTypesGuesser missingTypesConverter = new MissingTypesGuesser(this); MissingTypesGuesser.GuessedTypeRequestor substitutionRequestor = new MissingTypesGuesser.GuessedTypeRequestor() { + @Override public void accept( TypeBinding guessedType, Binding[] missingElements, @@ -10198,6 +10225,7 @@ public final class CompletionEngine MissingTypesGuesser missingTypesConverter = new MissingTypesGuesser(this); MissingTypesGuesser.GuessedTypeRequestor substitutionRequestor = new MissingTypesGuesser.GuessedTypeRequestor() { + @Override public void accept( TypeBinding guessedType, Binding[] missingElements, @@ -10232,6 +10260,7 @@ public final class CompletionEngine MissingTypesGuesser missingTypesConverter = new MissingTypesGuesser(this); MissingTypesGuesser.GuessedTypeRequestor substitutionRequestor = new MissingTypesGuesser.GuessedTypeRequestor() { + @Override public void accept( TypeBinding guessedType, Binding[] missingElements, @@ -11775,6 +11804,7 @@ public final class CompletionEngine UnresolvedReferenceNameFinder.UnresolvedReferenceNameRequestor nameRequestor = new UnresolvedReferenceNameFinder.UnresolvedReferenceNameRequestor() { + @Override public void acceptName(char[] name) { CompletionEngine.this.acceptUnresolvedName(name); proposedNames.add(name); @@ -11843,6 +11873,7 @@ public final class CompletionEngine UnresolvedReferenceNameFinder.UnresolvedReferenceNameRequestor nameRequestor = new UnresolvedReferenceNameFinder.UnresolvedReferenceNameRequestor() { + @Override public void acceptName(char[] name) { CompletionEngine.this.acceptUnresolvedName(name); proposedNames.add(name); @@ -12032,6 +12063,7 @@ public final class CompletionEngine UnresolvedReferenceNameFinder.UnresolvedReferenceNameRequestor nameRequestor = new UnresolvedReferenceNameFinder.UnresolvedReferenceNameRequestor() { + @Override public void acceptName(char[] name) { int relevance = computeBaseRelevance(); relevance += computeRelevanceForInterestingProposal(); @@ -12178,20 +12210,24 @@ public final class CompletionEngine } } + @Override public void acceptNameWithoutPrefixAndSuffix(char[] name,int reusedCharacters) { accept(name, 0, reusedCharacters); } + @Override public void acceptNameWithPrefix(char[] name, boolean isFirstPrefix, int reusedCharacters) { accept(name, isFirstPrefix ? R_NAME_FIRST_PREFIX : R_NAME_PREFIX, reusedCharacters); } + @Override public void acceptNameWithPrefixAndSuffix(char[] name, boolean isFirstPrefix, boolean isFirstSuffix, int reusedCharacters) { accept( name, (isFirstPrefix ? R_NAME_FIRST_PREFIX : R_NAME_PREFIX) + (isFirstSuffix ? R_NAME_FIRST_SUFFIX : R_NAME_SUFFIX), reusedCharacters); } + @Override public void acceptNameWithSuffix(char[] name, boolean isFirstSuffix, int reusedCharacters) { accept(name, isFirstSuffix ? R_NAME_FIRST_SUFFIX : R_NAME_SUFFIX, reusedCharacters); } @@ -12685,6 +12721,7 @@ public final class CompletionEngine return this.noCacheNameEnvironment; } + @Override public AssistParser getParser() { return this.parser; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionRequestorWrapper.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionRequestorWrapper.java index 62af4a3cff..91bfab2cee 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionRequestorWrapper.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionRequestorWrapper.java @@ -30,6 +30,7 @@ public class CompletionRequestorWrapper extends CompletionRequestor { this.requestor = requestor; } + @Override public void accept(CompletionProposal proposal) { InternalCompletionProposal internalCompletionProposal = (InternalCompletionProposal) proposal; switch(internalCompletionProposal.getKind()) { @@ -312,6 +313,7 @@ public class CompletionRequestorWrapper extends CompletionRequestor { } } + @Override public void completionFailure(IProblem problem) { this.requestor.acceptError(problem); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionUnitStructureRequestor.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionUnitStructureRequestor.java index 93287da5d1..1ea6ddd460 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionUnitStructureRequestor.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionUnitStructureRequestor.java @@ -79,10 +79,12 @@ public class CompletionUnitStructureRequestor extends CompilationUnitStructureRe this.elementWithProblemCache = elementWithProblemCache; } + @Override protected Annotation createAnnotation(JavaElement parent, String name) { return new AssistAnnotation(parent, name, this.newElements); } + @Override protected SourceField createField(JavaElement parent, FieldInfo fieldInfo) { String fieldName = JavaModelManager.getJavaModelManager().intern(new String(fieldInfo.name)); AssistSourceField field = new AssistSourceField(parent, fieldName, this.bindingCache, this.newElements); @@ -95,18 +97,22 @@ public class CompletionUnitStructureRequestor extends CompilationUnitStructureRe return field; } + @Override protected ImportContainer createImportContainer(ICompilationUnit parent) { return new AssistImportContainer((CompilationUnit)parent, this.newElements); } + @Override protected ImportDeclaration createImportDeclaration(ImportContainer parent, String name, boolean onDemand) { return new AssistImportDeclaration(parent, name, onDemand, this.newElements); } + @Override protected Initializer createInitializer(JavaElement parent) { return new AssistInitializer(parent, 1, this.bindingCache, this.newElements); } + @Override protected SourceMethod createMethodHandle(JavaElement parent, MethodInfo methodInfo) { String selector = JavaModelManager.getJavaModelManager().intern(new String(methodInfo.name)); String[] parameterTypeSigs = convertTypeNamesToSigs(methodInfo.parameterTypes); @@ -120,10 +126,12 @@ public class CompletionUnitStructureRequestor extends CompilationUnitStructureRe return method; } + @Override protected PackageDeclaration createPackageDeclaration(JavaElement parent, String name) { return new AssistPackageDeclaration((CompilationUnit) parent, name, this.newElements); } + @Override protected SourceType createTypeHandle(JavaElement parent, TypeInfo typeInfo) { String nameString= new String(typeInfo.name); AssistSourceType type = new AssistSourceType(parent, nameString, this.bindingCache, this.newElements); @@ -136,10 +144,12 @@ public class CompletionUnitStructureRequestor extends CompilationUnitStructureRe return type; } + @Override protected TypeParameter createTypeParameter(JavaElement parent, String name) { return new AssistTypeParameter(parent, name, this.newElements); } + @Override protected IAnnotation acceptAnnotation( org.eclipse.jdt.internal.compiler.ast.Annotation annotation, AnnotatableInfo parentInfo, @@ -153,6 +163,7 @@ public class CompletionUnitStructureRequestor extends CompilationUnitStructureRe return super.acceptAnnotation(annotation, parentInfo, parentHandle); } + @Override protected Object getMemberValue( org.eclipse.jdt.internal.core.MemberValuePair memberValuePair, Expression expression) { @@ -165,6 +176,7 @@ public class CompletionUnitStructureRequestor extends CompilationUnitStructureRe } return super.getMemberValue(memberValuePair, expression); } + @Override protected IMemberValuePair[] getMemberValuePairs(MemberValuePair[] memberValuePairs) { int membersLength = memberValuePairs.length; int membersCount = 0; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java index bba8d78a6c..48b34e4e13 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java @@ -144,6 +144,7 @@ public class InternalCompletionContext extends CompletionContext { * * @since 3.4 */ + @Override public IJavaElement getEnclosingElement() { if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$ @@ -162,6 +163,7 @@ public class InternalCompletionContext extends CompletionContext { * * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public char[][] getExpectedTypesKeys() { return this.expectedTypesKeys; } @@ -176,6 +178,7 @@ public class InternalCompletionContext extends CompletionContext { * * @see Signature */ + @Override public char[][] getExpectedTypesSignatures() { return this.expectedTypesSignatures; } @@ -187,6 +190,7 @@ public class InternalCompletionContext extends CompletionContext { * @return offset position in the source file buffer * @since 3.2 */ + @Override public int getOffset() { return this.offset; } @@ -202,6 +206,7 @@ public class InternalCompletionContext extends CompletionContext { * @return completed token or <code>null</code> * @since 3.2 */ + @Override public char[] getToken() { return this.token; } @@ -217,6 +222,7 @@ public class InternalCompletionContext extends CompletionContext { * @since 3.2 */ // TODO (david) https://bugs.eclipse.org/bugs/show_bug.cgi?id=132558 + @Override public int getTokenEnd() { return this.tokenEnd; } @@ -236,6 +242,7 @@ public class InternalCompletionContext extends CompletionContext { * or possibly a kind unknown to the caller * @since 3.2 */ + @Override public int getTokenKind() { return this.tokenKind; } @@ -257,6 +264,7 @@ public class InternalCompletionContext extends CompletionContext { * * @since 3.4 */ + @Override public int getTokenLocation() { return this.tokenLocation; } @@ -275,6 +283,7 @@ public class InternalCompletionContext extends CompletionContext { * @return character index of token start position (inclusive) * @since 3.2 */ + @Override public int getTokenStart() { return this.tokenStart; } @@ -316,6 +325,7 @@ public class InternalCompletionContext extends CompletionContext { * * @since 3.4 */ + @Override public IJavaElement[] getVisibleElements(String typeSignature) { if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$ @@ -332,6 +342,7 @@ public class InternalCompletionContext extends CompletionContext { * * @since 3.4 */ + @Override public boolean isExtended() { return this.isExtended; } @@ -342,6 +353,7 @@ public class InternalCompletionContext extends CompletionContext { * @return boolean true if completion takes place in a javadoc comment, false otherwise. * @since 3.2 */ + @Override public boolean isInJavadoc() { return this.javadoc != 0; } @@ -361,6 +373,7 @@ public class InternalCompletionContext extends CompletionContext { * @return boolean true if completion takes place in formal reference of a javadoc tag, false otherwise. * @since 3.2 */ + @Override public boolean isInJavadocFormalReference() { return (this.javadoc & CompletionOnJavadoc.FORMAL_REFERENCE) != 0; } @@ -371,6 +384,7 @@ public class InternalCompletionContext extends CompletionContext { * @return boolean true if completion takes place in a text area of a javadoc comment, false otherwise. * @since 3.2 */ + @Override public boolean isInJavadocText() { return (this.javadoc & CompletionOnJavadoc.TEXT) != 0; } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java index 2cb39bee42..a0a7b163a8 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java @@ -495,6 +495,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.3 */ + @Override public int getAdditionalFlags() { return this.additionalFlags; } @@ -514,6 +515,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.3 */ + @Override public void setAdditionalFlags(int additionalFlags) { this.additionalFlags = additionalFlags; } @@ -532,6 +534,7 @@ public class InternalCompletionProposal extends CompletionProposal { * declared on this class, or possibly a kind unknown * to the caller */ + @Override public int getKind() { return this.completionKind; } @@ -546,6 +549,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @see ICodeAssist#codeComplete(int,CompletionRequestor) */ // TODO (david) https://bugs.eclipse.org/bugs/show_bug.cgi?id=132558 + @Override public int getCompletionLocation() { return this.completionLocation; } @@ -563,6 +567,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @return character index of token start position (inclusive) */ + @Override public int getTokenStart() { return this.tokenStart; } @@ -576,6 +581,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @return character index of token end position (exclusive) */ + @Override public int getTokenEnd() { return this.tokenEnd; } @@ -596,6 +602,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @param startIndex character index of token start position (inclusive) * @param endIndex character index of token end position (exclusive) */ + @Override public void setTokenRange(int startIndex, int endIndex) { if (startIndex < 0 || endIndex < startIndex) { throw new IllegalArgumentException(); @@ -615,6 +622,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @return the completion string */ + @Override public char[] getCompletion() { if(this.completionKind == METHOD_DECLARATION) { findParameterNames(null); @@ -664,6 +672,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @param completion the completion string */ + @Override public void setCompletion(char[] completion) { this.completion = completion; } @@ -689,6 +698,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @return replacement start position (inclusive) */ + @Override public int getReplaceStart() { return this.replaceStart; } @@ -703,6 +713,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @return replacement end position (exclusive) */ + @Override public int getReplaceEnd() { return this.replaceEnd; } @@ -725,6 +736,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @param startIndex character index of replacement start position (inclusive) * @param endIndex character index of replacement end position (exclusive) */ + @Override public void setReplaceRange(int startIndex, int endIndex) { if (startIndex < 0 || endIndex < startIndex) { throw new IllegalArgumentException(); @@ -738,6 +750,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @return relevance rating of this proposal; ratings are positive; higher means better */ + @Override public int getRelevance() { return this.relevance; } @@ -754,6 +767,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @param rating relevance rating of this proposal; ratings are positive; higher means better */ + @Override public void setRelevance(int rating) { if (rating <= 0) { throw new IllegalArgumentException(); @@ -805,6 +819,7 @@ public class InternalCompletionProposal extends CompletionProposal { * on the kind of completion), or <code>null</code> if none * @see Signature */ + @Override public char[] getDeclarationSignature() { return this.declarationSignature; } @@ -831,6 +846,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, IProgressMonitor) * @since 3.1 */ + @Override public char[] getDeclarationKey() { return this.declarationKey; } @@ -849,6 +865,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @param signature the type or package or module(1.9) signature, or * <code>null</code> if none */ + @Override public void setDeclarationSignature(char[] signature) { this.declarationSignature = signature; } @@ -868,6 +885,7 @@ public class InternalCompletionProposal extends CompletionProposal { * <code>null</code> if none * @since 3.1 */ + @Override public void setDeclarationKey(char[] key) { this.declarationKey = key; } @@ -902,6 +920,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @return the keyword, field, method, local variable, or member * name, or <code>null</code> if none */ + @Override public char[] getName() { return this.name; } @@ -922,6 +941,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @param name the keyword, field, method, local variable, * or member name, or <code>null</code> if none */ + @Override public void setName(char[] name) { this.name = name; } @@ -1009,6 +1029,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @return the signature, or <code>null</code> if none * @see Signature */ + @Override public char[] getSignature() { return this.signature; } @@ -1035,6 +1056,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, IProgressMonitor) * @since 3.1 */ + @Override public char[] getKey() { return this.key; } @@ -1257,6 +1279,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @param signature the signature, or <code>null</code> if none */ + @Override public void setSignature(char[] signature) { this.signature = signature; } @@ -1275,6 +1298,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @param key the key, or <code>null</code> if none * @since 3.1 */ + @Override public void setKey(char[] key) { this.key = key; } @@ -1341,6 +1365,7 @@ public class InternalCompletionProposal extends CompletionProposal { * <code>Flags.AccDefault</code> if none * @see Flags */ + @Override public int getFlags() { return this.flags; } @@ -1358,6 +1383,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @param flags the modifier flags, or * <code>Flags.AccDefault</code> if none */ + @Override public void setFlags(int flags) { this.flags = flags; } @@ -1416,6 +1442,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.3 */ + @Override public CompletionProposal[] getRequiredProposals() { return this.requiredProposals; } @@ -1435,6 +1462,7 @@ public class InternalCompletionProposal extends CompletionProposal { * <code>null</code> if none * @since 3.3 */ + @Override public void setRequiredProposals(CompletionProposal[] proposals) { this.requiredProposals = proposals; } @@ -1456,6 +1484,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @return the parameter names, or <code>null</code> if none * or not available or not relevant */ + @Override public char[][] findParameterNames(IProgressMonitor monitor) { if (!this.parameterNamesComputed) { this.parameterNamesComputed = true; @@ -1561,6 +1590,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @param parameterNames the parameter names, or <code>null</code> if none */ + @Override public void setParameterNames(char[][] parameterNames) { this.parameterNames = parameterNames; this.parameterNamesComputed = true; @@ -1586,6 +1616,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.1 */ + @Override public int getAccessibility() { return this.accessibility; } @@ -1608,6 +1639,7 @@ public class InternalCompletionProposal extends CompletionProposal { * @return <code>true</code> if the proposal is a constructor. * @since 3.1 */ + @Override public boolean isConstructor() { return this.isConstructor; } @@ -1639,6 +1671,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.4 */ + @Override public char[] getReceiverSignature() { return this.receiverSignature; } @@ -1663,6 +1696,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.4 */ + @Override public int getReceiverStart() { return this.receiverStart; } @@ -1686,6 +1720,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.4 */ + @Override public int getReceiverEnd() { return this.receiverEnd; } @@ -1706,6 +1741,7 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.4 */ + @Override public void setReceiverSignature(char[] signature) { this.receiverSignature = signature; } @@ -1724,11 +1760,13 @@ public class InternalCompletionProposal extends CompletionProposal { * * @since 3.4 */ + @Override public void setReceiverRange(int startIndex, int endIndex) { this.receiverStart = startIndex; this.receiverEnd = endIndex; } + @Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append('['); @@ -1851,6 +1889,7 @@ public class InternalCompletionProposal extends CompletionProposal { return buffer.toString(); } + @Override public boolean canUseDiamond(CompletionContext coreContext) { if (this.getKind() != CONSTRUCTOR_INVOCATION) return false; if (coreContext instanceof InternalCompletionContext) { diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java index 3d56dc89d7..bfa2ed2b40 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java @@ -70,6 +70,7 @@ import org.eclipse.jdt.internal.core.util.Util; @SuppressWarnings({"rawtypes", "unchecked"}) public class InternalExtendedCompletionContext { private static Util.BindingsToNodesMap EmptyNodeMap = new Util.BindingsToNodesMap() { + @Override public ASTNode get(Binding binding) { return null; } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java index 16dcd1ee01..5f8d051d3b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java @@ -78,71 +78,85 @@ public class MissingTypesGuesser extends ASTVisitor { this.firstCall = false; } + @Override public boolean visit(SingleTypeReference singleTypeReference, BlockScope scope) { this.cleanUp(singleTypeReference); return true; } + @Override public boolean visit(SingleTypeReference singleTypeReference, ClassScope scope) { this.cleanUp(singleTypeReference); return true; } + @Override public boolean visit(Wildcard wildcard, BlockScope scope) { this.cleanUp(wildcard); return true; } + @Override public boolean visit(Wildcard wildcard, ClassScope scope) { this.cleanUp(wildcard); return true; } + @Override public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) { this.cleanUp(arrayTypeReference); return true; } + @Override public boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope) { this.cleanUp(arrayTypeReference); return true; } + @Override public boolean visit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, BlockScope scope) { this.cleanUp(parameterizedSingleTypeReference); return true; } + @Override public boolean visit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, ClassScope scope) { this.cleanUp(parameterizedSingleTypeReference); return true; } + @Override public boolean visit(QualifiedTypeReference qualifiedTypeReference, BlockScope scope) { this.cleanUp(qualifiedTypeReference); return true; } + @Override public boolean visit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope) { this.cleanUp(qualifiedTypeReference); return true; } + @Override public boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope) { this.cleanUp(arrayQualifiedTypeReference); return true; } + @Override public boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, ClassScope scope) { this.cleanUp(arrayQualifiedTypeReference); return true; } + @Override public boolean visit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, BlockScope scope) { this.cleanUp(parameterizedQualifiedTypeReference); return true; } + @Override public boolean visit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, ClassScope scope) { this.cleanUp(parameterizedQualifiedTypeReference); return true; @@ -463,6 +477,7 @@ public class MissingTypesGuesser extends ASTVisitor { isQualified ? CharOperation.concatWith(missingTypeName, '.') : null; final ArrayList results = new ArrayList(); ISearchRequestor storage = new ISearchRequestor() { + @Override public void acceptConstructor( int modifiers, char[] simpleTypeName, @@ -481,9 +496,11 @@ public class MissingTypesGuesser extends ASTVisitor { public void acceptModule(char[] moduleName) { // TODO Auto-generated method stub } + @Override public void acceptPackage(char[] packageName) { // package aren't searched } + @Override public void acceptType( char[] packageName, char[] typeName, diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java index 3ede784df6..af88d090a0 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java @@ -161,6 +161,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { this.importReferences = importReferences; } + @Override public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) { if (enclosingTypeNames != null && enclosingTypeNames.length > 0) return; @@ -303,6 +304,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { this.compilerOptions, new DefaultProblemFactory(Locale.getDefault())) { + @Override public CategorizedProblem createProblem( char[] fileName, int problemId, @@ -336,6 +338,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { this.owner = owner; } + @Override public void acceptConstructor( int modifiers, char[] simpleTypeName, @@ -351,6 +354,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { // constructors aren't searched } + @Override public void acceptType(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, int modifiers, AccessRestriction accessRestriction) { char[] typeName = enclosingTypeNames == null ? simpleTypeName : @@ -469,6 +473,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { * Package names are in the form "a.b.c". * The default package is represented by an empty array. */ + @Override public void acceptPackage(char[] packageName) { // implementation of interface method } @@ -835,33 +840,42 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { try { IProgressMonitor progressMonitor = new IProgressMonitor() { boolean isCanceled = false; + @Override public void beginTask(String name, int totalWork) { // implements interface method } + @Override public void done() { // implements interface method } + @Override public void internalWorked(double work) { // implements interface method } + @Override public boolean isCanceled() { return this.isCanceled; } + @Override public void setCanceled(boolean value) { this.isCanceled = value; } + @Override public void setTaskName(String name) { // implements interface method } + @Override public void subTask(String name) { // implements interface method } + @Override public void worked(int work) { // implements interface method } }; TypeNameMatchRequestor typeNameMatchRequestor = new TypeNameMatchRequestor() { + @Override public void acceptTypeNameMatch(TypeNameMatch match) { if (SelectionEngine.this.requestor instanceof SelectionRequestor) { SelectionEngine.this.noProposal = false; @@ -900,6 +914,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { } } + @Override public AssistParser getParser() { return this.parser; } @@ -1399,6 +1414,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { if (assistIdentifier == null) return; class Visitor extends ASTVisitor { + @Override public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope scope) { if (constructorDeclaration.selector == assistIdentifier){ if (constructorDeclaration.binding != null) { @@ -1411,24 +1427,28 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { } return true; } + @Override public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) { if (fieldDeclaration.name == assistIdentifier){ throw new SelectionNodeFound(fieldDeclaration.binding); } return true; } + @Override public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) { if (localTypeDeclaration.name == assistIdentifier) { throw new SelectionNodeFound(localTypeDeclaration.binding); } return true; } + @Override public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) { if (memberTypeDeclaration.name == assistIdentifier) { throw new SelectionNodeFound(memberTypeDeclaration.binding); } return true; } + @Override public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) { if (methodDeclaration.selector == assistIdentifier){ if (methodDeclaration.binding != null) { @@ -1441,18 +1461,21 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { } return true; } + @Override public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) { if (typeDeclaration.name == assistIdentifier) { throw new SelectionNodeFound(typeDeclaration.binding); } return true; } + @Override public boolean visit(TypeParameter typeParameter, BlockScope scope) { if (typeParameter.name == assistIdentifier) { throw new SelectionNodeFound(typeParameter.binding); } return true; } + @Override public boolean visit(TypeParameter typeParameter, ClassScope scope) { if (typeParameter.name == assistIdentifier) { throw new SelectionNodeFound(typeParameter.binding); @@ -1808,6 +1831,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { ReferenceBinding type= method.declaringClass; final SelectionRequestor requestor1 = (SelectionRequestor) this.requestor; return new InheritDocVisitor() { + @Override public Object visit(ReferenceBinding currType) throws JavaModelException { MethodBinding overridden = findOverriddenMethodInType(currType, method); if (overridden == null) @@ -1860,9 +1884,11 @@ public final class SelectionEngine extends Engine implements ISearchRequestor { */ static abstract class InheritDocVisitor { public static final Object STOP_BRANCH= new Object() { + @Override public String toString() { return "STOP_BRANCH"; } //$NON-NLS-1$ }; public static final Object CONTINUE= new Object() { + @Override public String toString() { return "CONTINUE"; } //$NON-NLS-1$ }; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java index be5d34d7c7..c0f16f5f44 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java @@ -60,6 +60,7 @@ public class ThrownExceptionFinder extends ASTVisitor { } } + @Override public void endVisit(MessageSend messageSend, BlockScope scope) { if (messageSend.binding != null) { endVisitMethodInvocation(messageSend.binding); @@ -67,6 +68,7 @@ public class ThrownExceptionFinder extends ASTVisitor { super.endVisit(messageSend, scope); } + @Override public void endVisit(AllocationExpression allocationExpression, BlockScope scope) { if (allocationExpression.binding != null) { endVisitMethodInvocation(allocationExpression.binding); @@ -74,6 +76,7 @@ public class ThrownExceptionFinder extends ASTVisitor { super.endVisit(allocationExpression, scope); } + @Override public void endVisit(ThrowStatement throwStatement, BlockScope scope) { acceptException((ReferenceBinding)throwStatement.exception.resolvedType); super.endVisit(throwStatement, scope); @@ -124,14 +127,17 @@ public class ThrownExceptionFinder extends ASTVisitor { this.discouragedExceptions.asArray(allDiscouragedExceptions); return allDiscouragedExceptions; } + @Override public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) { return visitType(typeDeclaration); } + @Override public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) { return visitType(memberTypeDeclaration); } + @Override public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) { return visitType(localTypeDeclaration); } @@ -140,6 +146,7 @@ public class ThrownExceptionFinder extends ASTVisitor { return false; } + @Override public boolean visit(TryStatement tryStatement, BlockScope scope) { this.exceptionsStack.push(this.thrownExceptions); SimpleSet exceptionSet = new SimpleSet(); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java index c96ef3e6fd..c008d21ee1 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java @@ -288,6 +288,7 @@ public class UnresolvedReferenceNameFinder extends ASTVisitor { return null; } + @Override public boolean visit(Block block, BlockScope blockScope) { ASTNode enclosingDeclaration = getEnclosingDeclaration(); removeLocals(block.statements, enclosingDeclaration.sourceStart, block.sourceEnd); @@ -295,6 +296,7 @@ public class UnresolvedReferenceNameFinder extends ASTVisitor { return true; } + @Override public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope classScope) { if (((constructorDeclaration.bits & ASTNode.IsDefaultConstructor) == 0) && !constructorDeclaration.isClinit()) { removeLocals( @@ -310,16 +312,19 @@ public class UnresolvedReferenceNameFinder extends ASTVisitor { return true; } + @Override public boolean visit(FieldDeclaration fieldDeclaration, MethodScope methodScope) { pushParent(fieldDeclaration); return true; } + @Override public boolean visit(Initializer initializer, MethodScope methodScope) { pushParent(initializer); return true; } + @Override public boolean visit(MethodDeclaration methodDeclaration, ClassScope classScope) { removeLocals( methodDeclaration.arguments, @@ -333,30 +338,36 @@ public class UnresolvedReferenceNameFinder extends ASTVisitor { return true; } + @Override public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope blockScope) { removeFields(localTypeDeclaration); pushParent(localTypeDeclaration); return true; } + @Override public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope classScope) { removeFields(memberTypeDeclaration); pushParent(memberTypeDeclaration); return true; } + @Override public void endVisit(Block block, BlockScope blockScope) { popParent(); } + @Override public void endVisit(Argument argument, BlockScope blockScope) { endVisitRemoved(argument.declarationSourceStart, argument.sourceEnd); } + @Override public void endVisit(Argument argument, ClassScope classScope) { endVisitRemoved(argument.declarationSourceStart, argument.sourceEnd); } + @Override public void endVisit(ConstructorDeclaration constructorDeclaration, ClassScope classScope) { if (((constructorDeclaration.bits & ASTNode.IsDefaultConstructor) == 0) && !constructorDeclaration.isClinit()) { endVisitPreserved(constructorDeclaration.bodyStart, constructorDeclaration.bodyEnd); @@ -364,21 +375,25 @@ public class UnresolvedReferenceNameFinder extends ASTVisitor { popParent(); } + @Override public void endVisit(FieldDeclaration fieldDeclaration, MethodScope methodScope) { endVisitRemoved(fieldDeclaration.declarationSourceStart, fieldDeclaration.sourceEnd); endVisitPreserved(fieldDeclaration.sourceEnd, fieldDeclaration.declarationEnd); popParent(); } + @Override public void endVisit(Initializer initializer, MethodScope methodScope) { endVisitPreserved(initializer.bodyStart, initializer.bodyEnd); popParent(); } + @Override public void endVisit(LocalDeclaration localDeclaration, BlockScope blockScope) { endVisitRemoved(localDeclaration.declarationSourceStart, localDeclaration.sourceEnd); } + @Override public void endVisit(MethodDeclaration methodDeclaration, ClassScope classScope) { endVisitPreserved( methodDeclaration.bodyStart, @@ -386,11 +401,13 @@ public class UnresolvedReferenceNameFinder extends ASTVisitor { popParent(); } + @Override public void endVisit(TypeDeclaration typeDeclaration, BlockScope blockScope) { endVisitRemoved(typeDeclaration.sourceStart, typeDeclaration.declarationSourceEnd); popParent(); } + @Override public void endVisit(TypeDeclaration typeDeclaration, ClassScope classScope) { endVisitRemoved(typeDeclaration.sourceStart, typeDeclaration.declarationSourceEnd); popParent(); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/AssistNodeParentAnnotationArrayInitializer.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/AssistNodeParentAnnotationArrayInitializer.java index f24f7815ef..18b1d3509c 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/AssistNodeParentAnnotationArrayInitializer.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/AssistNodeParentAnnotationArrayInitializer.java @@ -21,6 +21,7 @@ public class AssistNodeParentAnnotationArrayInitializer extends ASTNode { this.name = name; } + @Override public StringBuffer print(int indent, StringBuffer output) { output.append("<AssistNodeParentAnnotationArrayInitializer:"); //$NON-NLS-1$ output.append('@'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadoc.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadoc.java index 28f124c509..10e3feb328 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadoc.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadoc.java @@ -93,6 +93,7 @@ public class CompletionJavadoc extends Javadoc { /* * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer) */ + @Override public StringBuffer print(int indent, StringBuffer output) { printIndent(indent, output).append("/**\n"); //$NON-NLS-1$ boolean nodePrinted = false; @@ -150,6 +151,7 @@ public class CompletionJavadoc extends Javadoc { * * @throws CompletionNodeFound */ + @Override public void resolve(ClassScope scope) { super.resolve(scope); internalResolve(scope); @@ -161,6 +163,7 @@ public class CompletionJavadoc extends Javadoc { * * @throws CompletionNodeFound */ + @Override public void resolve(CompilationUnitScope scope) { internalResolve(scope); } @@ -171,6 +174,7 @@ public class CompletionJavadoc extends Javadoc { * * @throws CompletionNodeFound */ + @Override public void resolve(MethodScope scope) { super.resolve(scope); internalResolve(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java index fb0ac97188..556b6d0bba 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java @@ -64,6 +64,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Do not parse comment if completion location is not included. */ + @Override public boolean checkDeprecation(int commentPtr) { boolean isDeprecated = false; @@ -93,6 +94,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Replace stored Javadoc node with specific completion one. */ + @Override protected boolean commentParse() { this.docComment = new CompletionJavadoc(this.javadocStart, this.javadocEnd); this.firstTagPosition = 1; // bug 429340: completion parser needs to parse the whole comment @@ -102,6 +104,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Create argument expression. If it includes completion location, create and store completion node. */ + @Override protected Object createArgumentReference(char[] name, int dim, boolean isVarargs, Object typeRef, long[] dimPositions, long argNamePos) throws InvalidInputException { // Create argument as we may need it after char[] argName = name==null ? CharOperation.NO_CHAR : name; @@ -130,6 +133,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Create field reference. If it includes completion location, create and store completion node. */ + @Override protected Object createFieldReference(Object receiver) throws InvalidInputException { int refStart = (int) (this.identifierPositionStack[0] >>> 32); int refEnd = (int) this.identifierPositionStack[0]; @@ -157,6 +161,7 @@ public class CompletionJavadocParser extends JavadocParser { * If so, create method reference and store it. * Otherwise return null as we do not need this reference. */ + @Override protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException { int memberPtr = this.identifierLengthStack[0] - 1; // may be > 0 for inner class constructor reference int refStart = (int) (this.identifierPositionStack[memberPtr] >>> 32); @@ -189,6 +194,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Create type reference. If it includes completion location, create and store completion node. */ + @Override protected Object createTypeReference(int primitiveToken) { // Need to create type ref in case it was needed by members int nbIdentifiers = this.identifierLengthStack[this.identifierLengthPtr]; @@ -312,6 +318,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Parse argument in @see tag method reference */ + @Override protected Object parseArguments(Object receiver) throws InvalidInputException { if (this.tagSourceStart>this.cursorLocation) { @@ -458,6 +465,7 @@ public class CompletionJavadocParser extends JavadocParser { throw new InvalidInputException(); } + @Override protected boolean parseParam() throws InvalidInputException { int startPosition = this.index; int endPosition = this.index; @@ -538,6 +546,7 @@ public class CompletionJavadocParser extends JavadocParser { /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseReference() */ + @Override protected boolean parseReference() throws InvalidInputException { boolean completed = this.completionNode != null; boolean valid = super.parseReference(); @@ -550,6 +559,7 @@ public class CompletionJavadocParser extends JavadocParser { /*(non-Javadoc) * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseTag(int) */ + @Override protected boolean parseTag(int previousPosition) throws InvalidInputException { int startPosition = this.inlineTagStarted ? this.inlineTagStart : previousPosition; boolean newLine = !this.lineStarted; @@ -576,6 +586,7 @@ public class CompletionJavadocParser extends JavadocParser { /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseThrows() */ + @Override protected boolean parseThrows() { try { Object typeRef = parseQualifiedName(true); @@ -592,6 +603,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Push param name reference. If it includes completion location, create and store completion node. */ + @Override protected boolean pushParamName(boolean isTypeParam) { if (super.pushParamName(isTypeParam)) { Expression expression = (Expression) this.astStack[this.astPtr]; @@ -617,6 +629,7 @@ public class CompletionJavadocParser extends JavadocParser { * * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#pushText(int, int) */ + @Override protected void pushText(int start, int end) { if (start <= this.cursorLocation && this.cursorLocation <= end) { this.scanner.resetTo(start, end); @@ -785,6 +798,7 @@ public class CompletionJavadocParser extends JavadocParser { /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#readToken() */ + @Override protected int readToken() throws InvalidInputException { int token = super.readToken(); if (token == TerminalTokens.TokenNameIdentifier && this.scanner.currentPosition == this.scanner.startPosition) { @@ -797,6 +811,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Recover syntax on invalid qualified name. */ + @Override protected Object syntaxRecoverQualifiedName(int primitiveToken) throws InvalidInputException { if (this.cursorLocation == ((int)this.identifierPositionStack[this.identifierPtr])) { // special case of completion just before the dot. @@ -898,6 +913,7 @@ public class CompletionJavadocParser extends JavadocParser { /* * Store completion node into doc comment. */ + @Override protected void updateDocComment() { super.updateDocComment(); if (this.completionNode instanceof Expression) { @@ -910,6 +926,7 @@ public class CompletionJavadocParser extends JavadocParser { /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#verifySpaceOrEndComment() */ + @Override protected boolean verifySpaceOrEndComment() { CompletionScanner completionScanner = (CompletionScanner) this.scanner; if (completionScanner.completionIdentifier != null && completionScanner.completedIdentifierStart <= this.cursorLocation && this.cursorLocation <= completionScanner.completedIdentifierEnd) { diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java index 8418693e1b..4e9ce09907 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java @@ -38,99 +38,131 @@ public class CompletionNodeDetector extends ASTVisitor { public ASTNode getCompletionNodeParent() { return this.parent; } + @Override public void endVisit(AllocationExpression allocationExpression, BlockScope scope) { endVisit(allocationExpression); } + @Override public void endVisit(AND_AND_Expression and_and_Expression, BlockScope scope) { endVisit(and_and_Expression); } + @Override public void endVisit(ArrayAllocationExpression arrayAllocationExpression, BlockScope scope) { endVisit(arrayAllocationExpression); } + @Override public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) { endVisit(arrayInitializer); } + @Override public void endVisit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope) { endVisit(arrayQualifiedTypeReference); } + @Override public void endVisit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, ClassScope scope) { endVisit(arrayQualifiedTypeReference); } + @Override public void endVisit(ArrayReference arrayReference, BlockScope scope) { endVisit(arrayReference); } + @Override public void endVisit(ArrayTypeReference arrayTypeReference, BlockScope scope) { endVisit(arrayTypeReference); } + @Override public void endVisit(ArrayTypeReference arrayTypeReference, ClassScope scope) { endVisit(arrayTypeReference); } + @Override public void endVisit(Assignment assignment, BlockScope scope) { endVisit(assignment); } + @Override public void endVisit(BinaryExpression binaryExpression, BlockScope scope) { endVisit(binaryExpression); } + @Override public void endVisit(CastExpression castExpression, BlockScope scope) { endVisit(castExpression); } + @Override public void endVisit(CompoundAssignment compoundAssignment, BlockScope scope) { endVisit(compoundAssignment); } + @Override public void endVisit(ConditionalExpression conditionalExpression, BlockScope scope) { endVisit(conditionalExpression); } + @Override public void endVisit(EqualExpression equalExpression, BlockScope scope) { endVisit(equalExpression); } + @Override public void endVisit(ExplicitConstructorCall explicitConstructor, BlockScope scope) { endVisit(explicitConstructor); } + @Override public void endVisit(FieldReference fieldReference, BlockScope scope) { endVisit(fieldReference); } + @Override public void endVisit(InstanceOfExpression instanceOfExpression, BlockScope scope) { endVisit(instanceOfExpression); } + @Override public void endVisit(MessageSend messageSend, BlockScope scope) { endVisit(messageSend); } + @Override public void endVisit(OR_OR_Expression or_or_Expression, BlockScope scope) { endVisit(or_or_Expression); } + @Override public void endVisit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, BlockScope scope) { endVisit(parameterizedQualifiedTypeReference); } + @Override public void endVisit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, ClassScope scope) { endVisit(parameterizedQualifiedTypeReference); } + @Override public void endVisit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, BlockScope scope) { endVisit(parameterizedSingleTypeReference); } + @Override public void endVisit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, ClassScope scope) { endVisit(parameterizedSingleTypeReference); } + @Override public void endVisit(PostfixExpression postfixExpression, BlockScope scope) { endVisit(postfixExpression); } + @Override public void endVisit(PrefixExpression prefixExpression, BlockScope scope) { endVisit(prefixExpression); } + @Override public void endVisit(QualifiedAllocationExpression qualifiedAllocationExpression, BlockScope scope) { endVisit(qualifiedAllocationExpression); } + @Override public void endVisit(QualifiedNameReference qualifiedNameReference, BlockScope scope) { endVisit(qualifiedNameReference); } + @Override public void endVisit(QualifiedSuperReference qualifiedSuperReference, BlockScope scope) { endVisit(qualifiedSuperReference); } + @Override public void endVisit(QualifiedThisReference qualifiedThisReference, BlockScope scope) { endVisit(qualifiedThisReference); } + @Override public void endVisit(QualifiedTypeReference qualifiedTypeReference, BlockScope scope) { endVisit(qualifiedTypeReference); } + @Override public void endVisit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope) { endVisit(qualifiedTypeReference); } @@ -138,126 +170,166 @@ public class CompletionNodeDetector extends ASTVisitor { public void endVisit(ReferenceExpression referenceExpression, BlockScope blockScope) { endVisit(referenceExpression); } + @Override public void endVisit(SingleNameReference singleNameReference, BlockScope scope) { endVisit(singleNameReference); } + @Override public void endVisit(SingleTypeReference singleTypeReference, BlockScope scope) { endVisit(singleTypeReference); } + @Override public void endVisit(SingleTypeReference singleTypeReference, ClassScope scope) { endVisit(singleTypeReference); } + @Override public void endVisit(SuperReference superReference, BlockScope scope) { endVisit(superReference); } + @Override public void endVisit(ThisReference thisReference, BlockScope scope) { endVisit(thisReference); } + @Override public void endVisit(UnaryExpression unaryExpression, BlockScope scope) { endVisit(unaryExpression); } + @Override public void endVisit(MemberValuePair pair, BlockScope scope) { endVisit(pair); } public void endVisit(MemberValuePair pair, CompilationUnitScope scope) { endVisit(pair); } + @Override public void endVisit(LambdaExpression lambda, BlockScope scope) { endVisit(lambda); } + @Override public boolean visit(AllocationExpression allocationExpression, BlockScope scope) { return this.visit(allocationExpression); } + @Override public boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope) { return this.visit(and_and_Expression); } + @Override public boolean visit(ArrayAllocationExpression arrayAllocationExpression, BlockScope scope) { return this.visit(arrayAllocationExpression); } + @Override public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) { return this.visit(arrayInitializer); } + @Override public boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope) { return this.visit(arrayQualifiedTypeReference); } + @Override public boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, ClassScope scope) { return this.visit(arrayQualifiedTypeReference); } + @Override public boolean visit(ArrayReference arrayReference, BlockScope scope) { return this.visit(arrayReference); } + @Override public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) { return this.visit(arrayTypeReference); } + @Override public boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope) { return this.visit(arrayTypeReference); } + @Override public boolean visit(Assignment assignment, BlockScope scope) { return this.visit(assignment); } + @Override public boolean visit(BinaryExpression binaryExpression, BlockScope scope) { return this.visit(binaryExpression); } + @Override public boolean visit(CastExpression castExpression, BlockScope scope) { return this.visit(castExpression); } + @Override public boolean visit(CompoundAssignment compoundAssignment, BlockScope scope) { return this.visit(compoundAssignment); } + @Override public boolean visit(ConditionalExpression conditionalExpression, BlockScope scope) { return this.visit(conditionalExpression); } + @Override public boolean visit(EqualExpression equalExpression, BlockScope scope) { return this.visit(equalExpression); } + @Override public boolean visit(ExplicitConstructorCall explicitConstructor, BlockScope scope) { return this.visit(explicitConstructor); } + @Override public boolean visit(FieldReference fieldReference, BlockScope scope) { return this.visit(fieldReference); } + @Override public boolean visit(InstanceOfExpression instanceOfExpression, BlockScope scope) { return this.visit(instanceOfExpression); } + @Override public boolean visit(MessageSend messageSend, BlockScope scope) { return this.visit(messageSend); } + @Override public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) { return this.visit(or_or_Expression); } + @Override public boolean visit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, BlockScope scope) { return this.visit(parameterizedQualifiedTypeReference); } + @Override public boolean visit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, ClassScope scope) { return this.visit(parameterizedQualifiedTypeReference); } + @Override public boolean visit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, BlockScope scope) { return this.visit(parameterizedSingleTypeReference); } + @Override public boolean visit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, ClassScope scope) { return this.visit(parameterizedSingleTypeReference); } + @Override public boolean visit(PostfixExpression postfixExpression, BlockScope scope) { return this.visit(postfixExpression); } + @Override public boolean visit(PrefixExpression prefixExpression, BlockScope scope) { return this.visit(prefixExpression); } + @Override public boolean visit(QualifiedAllocationExpression qualifiedAllocationExpression, BlockScope scope) { return this.visit(qualifiedAllocationExpression); } + @Override public boolean visit(QualifiedNameReference qualifiedNameReference, BlockScope scope) { return this.visit(qualifiedNameReference); } + @Override public boolean visit(QualifiedSuperReference qualifiedSuperReference, BlockScope scope) { return this.visit(qualifiedSuperReference); } + @Override public boolean visit(QualifiedThisReference qualifiedThisReference, BlockScope scope) { return this.visit(qualifiedThisReference); } + @Override public boolean visit(QualifiedTypeReference qualifiedTypeReference, BlockScope scope) { return this.visit(qualifiedTypeReference); } + @Override public boolean visit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope) { return this.visit(qualifiedTypeReference); } @@ -265,27 +337,35 @@ public class CompletionNodeDetector extends ASTVisitor { public boolean visit(ReferenceExpression referenceExpression, BlockScope blockScope) { return this.visit(referenceExpression); } + @Override public boolean visit(SingleNameReference singleNameReference, BlockScope scope) { return this.visit(singleNameReference); } + @Override public boolean visit(SingleTypeReference singleTypeReference, BlockScope scope) { return this.visit(singleTypeReference); } + @Override public boolean visit(SingleTypeReference singleTypeReference, ClassScope scope) { return this.visit(singleTypeReference); } + @Override public boolean visit(StringLiteral stringLiteral, BlockScope scope) { return this.visit(stringLiteral); } + @Override public boolean visit(SuperReference superReference, BlockScope scope) { return this.visit(superReference); } + @Override public boolean visit(ThisReference thisReference, BlockScope scope) { return this.visit(thisReference); } + @Override public boolean visit(UnaryExpression unaryExpression, BlockScope scope) { return this.visit(unaryExpression); } + @Override public boolean visit(MemberValuePair pair, BlockScope scope) { return this.visit(pair); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationMemberValuePair.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationMemberValuePair.java index 6496eff719..a68fb550fd 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationMemberValuePair.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationMemberValuePair.java @@ -24,6 +24,7 @@ public class CompletionOnAnnotationMemberValuePair extends NormalAnnotation { this.completedMemberValuePair = completedMemberValuePair; } + @Override public TypeBinding resolveType(BlockScope scope) { super.resolveType(scope); @@ -34,6 +35,7 @@ public class CompletionOnAnnotationMemberValuePair extends NormalAnnotation { } } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append('@'); this.type.printExpression(0, output); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationOfType.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationOfType.java index cfae076842..49aa88e31b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationOfType.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationOfType.java @@ -29,6 +29,7 @@ public class CompletionOnAnnotationOfType extends TypeDeclaration { this.annotations = new Annotation[]{annotation}; } + @Override public StringBuffer print(int indent, StringBuffer output) { return this.annotations[0].print(indent, output); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnArgumentName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnArgumentName.java index c5a71545ed..d078fbb8c2 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnArgumentName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnArgumentName.java @@ -32,12 +32,14 @@ public class CompletionOnArgumentName extends Argument { this.realName = name; } + @Override public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { super.bind(scope, typeBinding, used); throw new CompletionNodeFound(this, scope); } + @Override public StringBuffer print(int indent, StringBuffer output) { printIndent(indent, output); @@ -51,6 +53,7 @@ public class CompletionOnArgumentName extends Argument { return output.append('>'); } + @Override public void resolve(BlockScope scope) { super.resolve(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnBranchStatementLabel.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnBranchStatementLabel.java index 1c940d5ceb..c628c75932 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnBranchStatementLabel.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnBranchStatementLabel.java @@ -28,15 +28,18 @@ public class CompletionOnBranchStatementLabel extends BranchStatement { this.possibleLabels = possibleLabels; } + @Override public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { // Is never called return null; } + @Override public void resolve(BlockScope scope) { throw new CompletionNodeFound(this, scope); } + @Override public StringBuffer printStatement(int indent, StringBuffer output) { printIndent(indent, output); if(this.kind == CONTINUE) { diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java index e7c1266a20..a66e614a65 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java @@ -45,12 +45,14 @@ public class CompletionOnClassLiteralAccess extends ClassLiteralAccess { this.classStart = (int) (pos >>> 32); } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnClassLiteralAccess:"); //$NON-NLS-1$ return this.type.print(0, output).append('.').append(this.completionIdentifier).append('>'); } + @Override public TypeBinding resolveType(BlockScope scope) { if (super.resolveType(scope) == null) diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java index f2df9b761f..f285fffbda 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java @@ -41,6 +41,7 @@ public class CompletionOnExplicitConstructorCall extends ExplicitConstructorCall super(accessMode); } + @Override public StringBuffer printStatement(int tab, StringBuffer output) { printIndent(tab, output); @@ -60,6 +61,7 @@ public class CompletionOnExplicitConstructorCall extends ExplicitConstructorCall return output.append(")>;"); //$NON-NLS-1$ } + @Override public void resolve(BlockScope scope) { ReferenceBinding receiverType = scope.enclosingSourceType(); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java index 0f8ff294f2..d1e1bf0a18 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java @@ -37,6 +37,7 @@ public class CompletionOnExportReference extends ExportsStatement { public CompletionOnExportReference(ImportReference ref) { super(ref, null); } + @Override public StringBuffer print(int indent, StringBuffer output) { printIndent(indent, output).append("<CompleteOnExport:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldName.java index ed687da02e..63e5395876 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldName.java @@ -22,6 +22,7 @@ public class CompletionOnFieldName extends FieldDeclaration { this.realName = name; } + @Override public StringBuffer printStatement(int tab, StringBuffer output) { printIndent(tab, output).append("<CompleteOnFieldName:"); //$NON-NLS-1$ @@ -34,6 +35,7 @@ public class CompletionOnFieldName extends FieldDeclaration { return output.append(">;"); //$NON-NLS-1$ } + @Override public void resolve(MethodScope initializationScope) { super.resolve(initializationScope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldType.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldType.java index 811104979d..2771f5283b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldType.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldType.java @@ -49,6 +49,7 @@ public CompletionOnFieldType(TypeReference type, boolean isLocalVariable){ } } +@Override public StringBuffer printStatement(int tab, StringBuffer output) { return this.type.print(tab, output).append(';'); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.java index ea94bc09d5..92e21efc83 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.java @@ -39,6 +39,7 @@ public class CompletionOnImportReference extends ImportReference { public CompletionOnImportReference(char[][] tokens , long[] positions, int modifiers) { super(tokens, positions, false, modifiers); } +@Override public StringBuffer print(int indent, StringBuffer output, boolean withOnDemand) { printIndent(indent, output).append("<CompleteOnImport:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.java index c2c1c4d943..1e801150a1 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.java @@ -34,6 +34,7 @@ public class CompletionOnJavadocAllocationExpression extends JavadocAllocationEx /** * @param flags The completionFlags to set. */ + @Override public void addCompletionFlags(int flags) { this.completionFlags |= flags; } @@ -59,6 +60,7 @@ public class CompletionOnJavadocAllocationExpression extends JavadocAllocationEx * * @return int Flags of the javadoc completion node. */ + @Override public int getCompletionFlags() { return this.completionFlags; } @@ -66,6 +68,7 @@ public class CompletionOnJavadocAllocationExpression extends JavadocAllocationEx /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.AllocationExpression#printExpression(int, java.lang.StringBuffer) */ + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnJavadocAllocationExpression:"); //$NON-NLS-1$ super.printExpression(indent, output); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.java index 4576958560..5e606d1610 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.java @@ -53,6 +53,7 @@ public class CompletionOnJavadocFieldReference extends JavadocFieldReference imp /** * @param flags The completionFlags to set. */ + @Override public void addCompletionFlags(int flags) { this.completionFlags |= flags; } @@ -78,6 +79,7 @@ public class CompletionOnJavadocFieldReference extends JavadocFieldReference imp * * @return int Flags of the javadoc completion node. */ + @Override public int getCompletionFlags() { return this.completionFlags; } @@ -85,6 +87,7 @@ public class CompletionOnJavadocFieldReference extends JavadocFieldReference imp /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.JavadocFieldReference#internalResolveType(org.eclipse.jdt.internal.compiler.lookup.Scope) */ + @Override protected TypeBinding internalResolveType(Scope scope) { if (this.token != null) { @@ -105,6 +108,7 @@ public class CompletionOnJavadocFieldReference extends JavadocFieldReference imp /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.JavadocFieldReference#printExpression(int, java.lang.StringBuffer) */ + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnJavadocFieldReference:"); //$NON-NLS-1$ super.printExpression(indent, output); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.java index 133c34b3c5..a56b66287a 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.java @@ -33,6 +33,7 @@ public class CompletionOnJavadocMessageSend extends JavadocMessageSend implement /** * @param flags The completionFlags to set. */ + @Override public void addCompletionFlags(int flags) { this.completionFlags |= flags; } @@ -58,6 +59,7 @@ public class CompletionOnJavadocMessageSend extends JavadocMessageSend implement * * @return int Flags of the javadoc completion node. */ + @Override public int getCompletionFlags() { return this.completionFlags; } @@ -65,6 +67,7 @@ public class CompletionOnJavadocMessageSend extends JavadocMessageSend implement /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.JavadocMessageSend#printExpression(int, java.lang.StringBuffer) */ + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnJavadocMessageSend:"); //$NON-NLS-1$ super.printExpression(indent, output); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.java index d5723ee81a..7576ab45c5 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.java @@ -30,6 +30,7 @@ public class CompletionOnJavadocParamNameReference extends JavadocSingleNameRefe /** * @param flags The completionFlags to set. */ + @Override public void addCompletionFlags(int flags) { this.completionFlags |= flags; } @@ -39,6 +40,7 @@ public class CompletionOnJavadocParamNameReference extends JavadocSingleNameRefe * * @return int Flags of the javadoc completion node. */ + @Override public int getCompletionFlags() { return this.completionFlags; } @@ -46,6 +48,7 @@ public class CompletionOnJavadocParamNameReference extends JavadocSingleNameRefe /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.AllocationExpression#printExpression(int, java.lang.StringBuffer) */ + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompletionOnJavadocParamNameReference:"); //$NON-NLS-1$ if (this.token != null) super.printExpression(indent, output); @@ -55,6 +58,7 @@ public class CompletionOnJavadocParamNameReference extends JavadocSingleNameRefe /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.SingleNameReference#reportError(org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ + @Override public TypeBinding reportError(BlockScope scope) { return null; } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java index f6e4a31707..10dc02c1bb 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java @@ -30,6 +30,7 @@ public class CompletionOnJavadocQualifiedTypeReference extends JavadocQualifiedT /** * @param flags The completionFlags to set. */ + @Override public void addCompletionFlags(int flags) { this.completionFlags |= flags; } @@ -55,12 +56,14 @@ public class CompletionOnJavadocQualifiedTypeReference extends JavadocQualifiedT * * @return int Flags of the javadoc completion node. */ + @Override public int getCompletionFlags() { return this.completionFlags; } /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference#printExpression(int, java.lang.StringBuffer) */ + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompletionOnJavadocQualifiedTypeReference:"); //$NON-NLS-1$ super.printExpression(indent, output); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.java index 113b419c1f..46e4f25525 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.java @@ -26,6 +26,7 @@ public class CompletionOnJavadocSingleTypeReference extends JavadocSingleTypeRef /** * @param flags The completionFlags to set. */ + @Override public void addCompletionFlags(int flags) { this.completionFlags |= flags; } @@ -51,6 +52,7 @@ public class CompletionOnJavadocSingleTypeReference extends JavadocSingleTypeRef * * @return int Flags of the javadoc completion node. */ + @Override public int getCompletionFlags() { return this.completionFlags; } @@ -58,6 +60,7 @@ public class CompletionOnJavadocSingleTypeReference extends JavadocSingleTypeRef /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.SingleTypeReference#printExpression(int, java.lang.StringBuffer) */ + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompletionOnJavadocSingleTypeReference:"); //$NON-NLS-1$ super.printExpression(indent, output); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java index afaa1d94c9..4fb5394ca4 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java @@ -33,6 +33,7 @@ public class CompletionOnJavadocTag extends JavadocSingleNameReference implement /** * @param flags The completionFlags to set. */ + @Override public void addCompletionFlags(int flags) { this.completionFlags |= flags; } @@ -42,6 +43,7 @@ public class CompletionOnJavadocTag extends JavadocSingleNameReference implement * * @return int Flags of the javadoc completion node. */ + @Override public int getCompletionFlags() { return this.completionFlags; } @@ -49,6 +51,7 @@ public class CompletionOnJavadocTag extends JavadocSingleNameReference implement /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.AllocationExpression#printExpression(int, java.lang.StringBuffer) */ + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnJavadocTag:"); //$NON-NLS-1$ output.append('@'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTypeParamReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTypeParamReference.java index 2ae2acfe72..620221fcf7 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTypeParamReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTypeParamReference.java @@ -29,6 +29,7 @@ public class CompletionOnJavadocTypeParamReference extends JavadocSingleTypeRefe /** * @param flags The completionFlags to set. */ + @Override public void addCompletionFlags(int flags) { this.completionFlags |= flags; } @@ -38,6 +39,7 @@ public class CompletionOnJavadocTypeParamReference extends JavadocSingleTypeRefe * * @return int Flags of the javadoc completion node. */ + @Override public int getCompletionFlags() { return this.completionFlags; } @@ -45,6 +47,7 @@ public class CompletionOnJavadocTypeParamReference extends JavadocSingleTypeRefe /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.AllocationExpression#printExpression(int, java.lang.StringBuffer) */ + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompletionOnJavadocTypeParamReference:"); //$NON-NLS-1$ if (this.token != null) super.printExpression(indent, output); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.java index 7bd912530c..6371f17f93 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.java @@ -24,18 +24,23 @@ public class CompletionOnKeyword1 extends SingleTypeReference implements Complet super(token, pos); this.possibleKeywords = possibleKeywords; } + @Override public char[] getToken() { return this.token; } + @Override public char[][] getPossibleKeywords() { return this.possibleKeywords; } + @Override public void aboutToResolve(Scope scope) { getTypeBinding(scope); } + @Override protected TypeBinding getTypeBinding(Scope scope) { throw new CompletionNodeFound(this, scope); } + @Override public StringBuffer printExpression(int indent, StringBuffer output){ return output.append("<CompleteOnKeyword:").append(this.token).append('>'); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.java index 017f200673..6ad6762eef 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.java @@ -21,12 +21,15 @@ public class CompletionOnKeyword2 extends ImportReference implements CompletionO this.token = token; this.possibleKeywords = possibleKeywords; } + @Override public char[] getToken() { return this.token; } + @Override public char[][] getPossibleKeywords() { return this.possibleKeywords; } + @Override public StringBuffer print(int indent, StringBuffer output, boolean withOnDemand) { return printIndent(indent, output).append("<CompleteOnKeyword:").append(this.token).append('>'); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.java index bd91db2b58..2f0d982edd 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.java @@ -26,19 +26,23 @@ public class CompletionOnKeyword3 extends SingleNameReference implements Complet this.possibleKeywords = possibleKeywords; this.tryOrCatch = afterTryOrCatch; } + @Override public char[] getToken() { return this.token; } + @Override public char[][] getPossibleKeywords() { return this.possibleKeywords; } public boolean afterTryOrCatch() { return this.tryOrCatch; } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { return output.append("<CompleteOnKeyword:").append(this.token).append('>'); //$NON-NLS-1$ } + @Override public TypeBinding resolveType(BlockScope scope) { throw new CompletionNodeFound(this, scope); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.java index f59f03d5e9..e98b654ede 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.java @@ -25,12 +25,14 @@ public class CompletionOnLocalName extends LocalDeclaration { this.realName = name; } + @Override public void resolve(BlockScope scope) { super.resolve(scope); throw new CompletionNodeFound(this, scope); } + @Override public StringBuffer printAsExpression(int indent, StringBuffer output) { printIndent(indent, output); output.append("<CompleteOnLocalName:"); //$NON-NLS-1$ @@ -43,6 +45,7 @@ public class CompletionOnLocalName extends LocalDeclaration { return output.append('>'); } + @Override public StringBuffer printStatement(int indent, StringBuffer output) { printAsExpression(indent, output); return output.append(';'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMarkerAnnotationName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMarkerAnnotationName.java index a802d93bfb..6f523a75ff 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMarkerAnnotationName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMarkerAnnotationName.java @@ -22,6 +22,7 @@ public class CompletionOnMarkerAnnotationName extends MarkerAnnotation { super(type, sourceStart); } + @Override public TypeBinding resolveType(BlockScope scope) { if(this.type instanceof QualifiedTypeReference) { QualifiedTypeReference qualifiedTypeReference = (QualifiedTypeReference) this.type; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java index 2736ddda9d..b96e8e4abb 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java @@ -45,12 +45,14 @@ public class CompletionOnMemberAccess extends FieldReference { this.isInsideAnnotation = isInsideAnnotation; } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnMemberAccess:"); //$NON-NLS-1$ return super.printExpression(0, output).append('>'); } + @Override public TypeBinding resolveType(BlockScope scope) { this.actualReceiverType = this.receiver.resolveType(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.java index 913afd6f1a..e1d58258c8 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.java @@ -30,6 +30,7 @@ public class CompletionOnMemberValueName extends MemberValuePair { super(token, sourceStart, sourceEnd, null); } + @Override public StringBuffer print(int indent, StringBuffer output) { output.append("<CompleteOnAttributeName:"); //$NON-NLS-1$ output.append(this.name); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java index 7a573a4167..92de1cd3c7 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java @@ -38,6 +38,7 @@ import org.eclipse.jdt.internal.compiler.lookup.*; public class CompletionOnMessageSend extends MessageSend { + @Override public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; if (this.arguments != null) { @@ -58,6 +59,7 @@ public class CompletionOnMessageSend extends MessageSend { throw new CompletionNodeFound(this, this.actualReceiverType, scope); } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnMessageSend:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java index 107fee3441..234555a84e 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java @@ -24,6 +24,7 @@ public class CompletionOnMessageSendName extends MessageSend { this.nameSourcePosition = end; } + @Override public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; @@ -47,6 +48,7 @@ public class CompletionOnMessageSendName extends MessageSend { throw new CompletionNodeFound(this, this.actualReceiverType, scope); } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnMessageSendName:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodName.java index 43ad896bad..144f919bff 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodName.java @@ -21,6 +21,7 @@ public class CompletionOnMethodName extends MethodDeclaration { super(compilationResult); } + @Override public StringBuffer print(int indent, StringBuffer output) { printIndent(indent, output); @@ -45,6 +46,7 @@ public class CompletionOnMethodName extends MethodDeclaration { return output.append('>'); } + @Override public void resolve(ClassScope upperScope) { super.resolve(upperScope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodReturnType.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodReturnType.java index 9e4509b1d6..1df9154a98 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodReturnType.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodReturnType.java @@ -22,10 +22,12 @@ public class CompletionOnMethodReturnType extends MethodDeclaration { this.sourceEnd = returnType.sourceEnd; } + @Override public void resolveStatements() { throw new CompletionNodeFound(this, this.scope); } + @Override public StringBuffer print(int tab, StringBuffer output) { return this.returnType.print(tab, output); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodTypeParameter.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodTypeParameter.java index 7d0b289527..b2dbc80766 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodTypeParameter.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodTypeParameter.java @@ -24,10 +24,12 @@ public class CompletionOnMethodTypeParameter extends MethodDeclaration { this.sourceEnd = typeParameters[typeParameters.length - 1].sourceEnd; } + @Override public void resolveStatements() { throw new CompletionNodeFound(this, this.scope); } + @Override public StringBuffer print(int tab, StringBuffer output) { printIndent(tab, output); output.append('<'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java index 7ccea8c491..f08f3da5b3 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java @@ -24,6 +24,7 @@ public class CompletionOnModuleReference extends ModuleReference { super(tokens, sourcePositions); } + @Override public ModuleBinding resolve(Scope scope) { super.resolve(scope); // if (this.binding != null) { @@ -32,6 +33,7 @@ public class CompletionOnModuleReference extends ModuleReference { throw new CompletionNodeFound(); //} } + @Override public StringBuffer print(int indent, StringBuffer output) { printIndent(indent, output).append("<CompleteOnModuleReference:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.java index 1364ced1dc..4acee1514a 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.java @@ -39,6 +39,7 @@ public class CompletionOnPackageReference extends ImportReference { public CompletionOnPackageReference(char[][] tokens , long[] positions) { super(tokens, positions, false, ClassFileConstants.AccDefault); } +@Override public StringBuffer print(int indent, StringBuffer output, boolean withOnDemand) { printIndent(indent, output).append("<CompleteOnPackage:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageVisibilityReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageVisibilityReference.java index aad83580e3..742fdf7876 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageVisibilityReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageVisibilityReference.java @@ -42,6 +42,7 @@ public class CompletionOnPackageVisibilityReference extends CompletionOnImportRe this.pkgName = new String(CharOperation.concatWith(ident, '.')); } + @Override public StringBuffer print(int indent, StringBuffer output) { printIndent(indent, output).append("<CompleteOnPackageVisibilityReference:"); //$NON-NLS-1$ output.append(this.pkgName); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java index 7a9f66e746..dc5f4acddc 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java @@ -78,16 +78,19 @@ public class CompletionOnParameterizedQualifiedTypeReference extends Parameteriz return this.kind == K_CLASS || this.kind == K_INTERFACE; } + @Override public TypeBinding resolveType(BlockScope scope, boolean checkBounds, int location) { super.resolveType(scope, checkBounds, location); throw new CompletionNodeFound(this, this.resolvedType, scope); } + @Override public TypeBinding resolveType(ClassScope scope, int location) { super.resolveType(scope, location); throw new CompletionNodeFound(this, this.resolvedType, scope); } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { switch (this.kind) { case K_CLASS : diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java index 99bb9cc889..538a491b59 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java @@ -38,6 +38,7 @@ import org.eclipse.jdt.internal.compiler.ast.*; import org.eclipse.jdt.internal.compiler.lookup.*; public class CompletionOnQualifiedAllocationExpression extends QualifiedAllocationExpression { +@Override public TypeBinding resolveType(BlockScope scope) { this.argumentTypes = Binding.NO_PARAMETERS; if (this.arguments != null) { @@ -95,6 +96,7 @@ public TypeBinding resolveType(BlockScope scope) { throw new CompletionNodeFound(this, this.resolvedType, scope); } +@Override public StringBuffer printExpression(int indent, StringBuffer output) { if (this.enclosingInstance == null) output.append("<CompleteOnAllocationExpression:" ); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java index 9c793bd425..482c23af6e 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java @@ -44,6 +44,7 @@ public CompletionOnQualifiedNameReference(char[][] previousIdentifiers, char[] c this.completionIdentifier = completionIdentifier; this.isInsideAnnotationAttribute = isInsideAnnotationAttribute; } +@Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnName:"); //$NON-NLS-1$ @@ -54,6 +55,7 @@ public StringBuffer printExpression(int indent, StringBuffer output) { output.append(this.completionIdentifier).append('>'); return output; } +@Override public TypeBinding resolveType(BlockScope scope) { // it can be a package, type, member type, local variable or field this.binding = scope.getBinding(this.tokens, this); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java index 6e4507d40e..a4148da47b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java @@ -46,15 +46,18 @@ public CompletionOnQualifiedTypeReference(char[][] previousIdentifiers, char[] c this.completionIdentifier = completionIdentifier; this.kind = kind; } +@Override public void aboutToResolve(Scope scope) { getTypeBinding(scope); } /* * No expansion of the completion reference into an array one */ +@Override public TypeReference augmentTypeWithAdditionalDimensions(int additionalDimensions, Annotation[][] additionalAnnotations, boolean isVarargs) { return this; } +@Override protected TypeBinding getTypeBinding(Scope scope) { // it can be a package, type or member type Binding binding = scope.parent.getTypeOrPackage(this.tokens); // step up from the ClassScope @@ -88,6 +91,7 @@ public boolean isSuperType(){ public void setKind(int kind) { this.kind = kind; } +@Override public StringBuffer printExpression(int indent, StringBuffer output) { switch (this.kind) { case K_CLASS : diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.java index 6ea8e35114..e2eebe28f7 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.java @@ -52,12 +52,14 @@ public class CompletionOnSingleNameReference extends SingleNameReference { this.isInsideAnnotationAttribute = isInsideAnnotationAttribute; } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompleteOnName:"); //$NON-NLS-1$ return super.printExpression(0, output).append('>'); } + @Override public TypeBinding resolveType(BlockScope scope) { if(scope instanceof MethodScope) { throw new CompletionNodeFound(this, scope, ((MethodScope)scope).insideTypeAnnotation); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java index 96c0083618..b49de1dcd5 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java @@ -46,15 +46,18 @@ public CompletionOnSingleTypeReference(char[] source, long pos, int kind) { this.isCompletionNode = true; this.kind = kind; } +@Override public void aboutToResolve(Scope scope) { getTypeBinding(scope); } /* * No expansion of the completion reference into an array one */ +@Override public TypeReference augmentTypeWithAdditionalDimensions(int additionalDimensions, Annotation[][] additionalAnnotations, boolean isVarargs) { return this; } +@Override protected TypeBinding getTypeBinding(Scope scope) { if (this.fieldTypeCompletionNode != null) { throw new CompletionNodeFound(this.fieldTypeCompletionNode, scope); @@ -77,6 +80,7 @@ public boolean isException(){ public boolean isSuperType(){ return this.kind == K_CLASS || this.kind == K_INTERFACE; } +@Override public StringBuffer printExpression(int indent, StringBuffer output){ switch (this.kind) { case K_CLASS : @@ -94,6 +98,7 @@ public StringBuffer printExpression(int indent, StringBuffer output){ } return output.append(this.token).append('>'); } +@Override public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) { if (this.fieldTypeCompletionNode != null) { throw new CompletionNodeFound(this.fieldTypeCompletionNode, scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnStringLiteral.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnStringLiteral.java index 4f98b25490..e6c0828b15 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnStringLiteral.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnStringLiteral.java @@ -47,13 +47,16 @@ public class CompletionOnStringLiteral extends StringLiteral { this.contentStart = cs; this.contentEnd = ce; } + @Override public TypeBinding resolveType(ClassScope scope) { throw new CompletionNodeFound(this, null, scope); } + @Override public TypeBinding resolveType(BlockScope scope) { throw new CompletionNodeFound(this, null, scope); } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<CompletionOnString:"); //$NON-NLS-1$ output = super.printExpression(indent, output); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java index 19c0549577..b880001c85 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java @@ -234,6 +234,7 @@ public void stopRecordingIdentifiers() { this.record = true; this.skipRecord = false; } +@Override public char[] assistIdentifier(){ return ((CompletionScanner)this.scanner).completionIdentifier; } @@ -656,6 +657,7 @@ protected void attachOrphanCompletionNode(){ } } } +@Override public Object becomeSimpleParser() { CompletionScanner completionScanner = (CompletionScanner)this.scanner; int[] parserState = new int[] {this.cursorLocation, completionScanner.cursorLocation}; @@ -1337,12 +1339,15 @@ private void buildMoreTryStatementCompletionContext(TypeReference exceptionRef) this.currentElement = this.currentElement.add(exceptionRef, 0); } } +@Override public int bodyEnd(AbstractMethodDeclaration method){ return this.cursorLocation; } +@Override public int bodyEnd(Initializer initializer){ return this.cursorLocation; } +@Override protected void checkAndSetModifiers(int flag) { super.checkAndSetModifiers(flag); @@ -1350,6 +1355,7 @@ protected void checkAndSetModifiers(int flag) { this.hasUnusedModifiers = true; } } +@Override protected void consumePushCombineModifiers() { super.consumePushCombineModifiers(); @@ -2198,25 +2204,31 @@ public void completionIdentifierCheck(){ if (checkLabelStatement()) return; if (checkNameCompletion()) return; } +@Override protected void consumeArrayCreationExpressionWithInitializer() { super.consumeArrayCreationExpressionWithInitializer(); popElement(K_ARRAY_CREATION); } +@Override protected void consumeArrayCreationExpressionWithoutInitializer() { super.consumeArrayCreationExpressionWithoutInitializer(); popElement(K_ARRAY_CREATION); } +@Override protected void consumeArrayCreationHeader() { // nothing to do } +@Override protected void consumeAssignment() { popElement(K_ASSISGNMENT_OPERATOR); super.consumeAssignment(); } +@Override protected void consumeAssignmentOperator(int pos) { super.consumeAssignmentOperator(pos); pushOnElementStack(K_ASSISGNMENT_OPERATOR, pos); } +@Override protected void consumeBinaryExpression(int op) { super.consumeBinaryExpression(op); popElement(K_BINARY_OPERATOR); @@ -2228,6 +2240,7 @@ protected void consumeBinaryExpression(int op) { } } } +@Override protected void consumeBinaryExpressionWithName(int op) { super.consumeBinaryExpressionWithName(op); popElement(K_BINARY_OPERATOR); @@ -2239,12 +2252,14 @@ protected void consumeBinaryExpressionWithName(int op) { } } } +@Override protected void consumeCaseLabel() { super.consumeCaseLabel(); if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) != K_SWITCH_LABEL) { pushOnElementStack(K_SWITCH_LABEL); } } +@Override protected void consumeCastExpressionWithPrimitiveType() { popElement(K_CAST_STATEMENT); @@ -2257,6 +2272,7 @@ protected void consumeCastExpressionWithPrimitiveType() { cast.sourceStart = castType.sourceStart - 1; cast.sourceEnd = exp.sourceEnd; } +@Override protected void consumeCastExpressionWithGenericsArray() { popElement(K_CAST_STATEMENT); @@ -2270,6 +2286,7 @@ protected void consumeCastExpressionWithGenericsArray() { cast.sourceEnd = exp.sourceEnd; } +@Override protected void consumeCastExpressionWithQualifiedGenericsArray() { popElement(K_CAST_STATEMENT); @@ -2282,6 +2299,7 @@ protected void consumeCastExpressionWithQualifiedGenericsArray() { cast.sourceStart = castType.sourceStart - 1; cast.sourceEnd = exp.sourceEnd; } +@Override protected void consumeCastExpressionWithNameArray() { // CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus popElement(K_CAST_STATEMENT); @@ -2295,10 +2313,12 @@ protected void consumeCastExpressionWithNameArray() { cast.sourceStart = castType.sourceStart - 1; cast.sourceEnd = exp.sourceEnd; } +@Override protected void consumeCastExpressionLL1() { popElement(K_CAST_STATEMENT); super.consumeCastExpressionLL1(); } +@Override protected void consumeCatchFormalParameter() { if (this.indexOfAssistIdentifier() < 0) { super.consumeCatchFormalParameter(); @@ -2343,11 +2363,13 @@ protected void consumeCatchFormalParameter() { this.listLength++; } } +@Override protected void consumeClassBodyDeclaration() { popElement(K_BLOCK_DELIMITER); super.consumeClassBodyDeclaration(); this.pendingAnnotation = null; // the pending annotation cannot be attached to next nodes } +@Override protected void consumeClassBodyopt() { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); @@ -2356,6 +2378,7 @@ protected void consumeClassBodyopt() { /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.parser.Parser#consumeClassDeclaration() */ +@Override protected void consumeClassDeclaration() { if (this.astPtr >= 0) { int length = this.astLengthStack[this.astLengthPtr]; @@ -2372,6 +2395,7 @@ protected void consumeClassDeclaration() { } super.consumeClassDeclaration(); } +@Override protected void consumeClassHeaderName1() { super.consumeClassHeaderName1(); this.hasUnusedModifiers = false; @@ -2382,6 +2406,7 @@ protected void consumeClassHeaderName1() { classHeaderExtendsOrImplements(false); } +@Override protected void consumeClassHeaderExtends() { pushOnElementStack(K_NEXT_TYPEREF_IS_CLASS); super.consumeClassHeaderExtends(); @@ -2420,6 +2445,7 @@ protected void consumeClassHeaderExtends() { } } } +@Override protected void consumeClassHeaderImplements() { super.consumeClassHeaderImplements(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -2435,11 +2461,13 @@ protected void consumeClassHeaderImplements() { } } } +@Override protected void consumeClassInstanceCreationExpressionName() { super.consumeClassInstanceCreationExpressionName(); this.invocationType = QUALIFIED_ALLOCATION; this.qualifier = this.expressionPtr; } +@Override protected void consumeClassTypeElt() { pushOnElementStack(K_NEXT_TYPEREF_IS_EXCEPTION); super.consumeClassTypeElt(); @@ -2449,6 +2477,7 @@ protected void consumeClassTypeElt() { /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.parser.Parser#consumeCompilationUnit() */ +@Override protected void consumeCompilationUnit() { this.javadoc = null; checkComment(); @@ -2466,22 +2495,27 @@ protected void consumeCompilationUnit() { } super.consumeCompilationUnit(); } +@Override protected void consumeConditionalExpression(int op) { popElement(K_CONDITIONAL_OPERATOR); super.consumeConditionalExpression(op); } +@Override protected void consumeConditionalExpressionWithName(int op) { popElement(K_CONDITIONAL_OPERATOR); super.consumeConditionalExpressionWithName(op); } +@Override protected void consumeConstructorBody() { popElement(K_BLOCK_DELIMITER); super.consumeConstructorBody(); } +@Override protected void consumeConstructorHeader() { super.consumeConstructorHeader(); pushOnElementStack(K_BLOCK_DELIMITER); } +@Override protected void consumeConstructorHeaderName() { /* no need to take action if not inside assist identifiers */ @@ -2513,6 +2547,7 @@ protected void consumeConstructorHeaderName() { pushOnGenericsLengthStack(0); // handle type arguments this.restartRecovery = true; } +@Override protected void consumeConstructorHeaderNameWithTypeParameters() { long selectorSourcePositions = this.identifierPositionStack[this.identifierPtr]; int selectorSourceEnd = (int) selectorSourcePositions; @@ -2530,6 +2565,7 @@ protected void consumeConstructorHeaderNameWithTypeParameters() { this.sourceEnds.put(this.astStack[this.astPtr], selectorSourceEnd); } } +@Override protected void consumeDefaultLabel() { super.consumeDefaultLabel(); if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SWITCH_LABEL) { @@ -2537,10 +2573,12 @@ protected void consumeDefaultLabel() { } pushOnElementStack(K_SWITCH_LABEL, DEFAULT); } +@Override protected void consumeDimWithOrWithOutExpr() { // DimWithOrWithOutExpr ::= '[' ']' pushOnExpressionStack(null); } +@Override protected void consumeEmptyStatement() { super.consumeEmptyStatement(); /* Sneak in the assist node. The reason we can't do that when we see the assist node is that @@ -2560,6 +2598,7 @@ protected void consumeBlockStatement() { this.shouldStackAssistNode = false; } } +@Override protected void consumeEnhancedForStatement() { super.consumeEnhancedForStatement(); @@ -2567,6 +2606,7 @@ protected void consumeEnhancedForStatement() { popElement(K_CONTROL_STATEMENT_DELIMITER); } } +@Override protected void consumeEnhancedForStatementHeaderInit(boolean hasModifiers) { super.consumeEnhancedForStatementHeaderInit(hasModifiers); this.hasUnusedModifiers = false; @@ -2575,11 +2615,13 @@ protected void consumeEnhancedForStatementHeaderInit(boolean hasModifiers) { this.pendingAnnotation = null; } } +@Override protected void consumeEnterAnonymousClassBody(boolean qualified) { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); super.consumeEnterAnonymousClassBody(qualified); } +@Override protected void consumeEnterVariable() { this.identifierPtr--; this.identifierLengthPtr--; @@ -2652,6 +2694,7 @@ protected void consumeEnterVariable() { } } } +@Override protected void consumeEnumConstantHeaderName() { if (this.currentElement != null) { if (!(this.currentElement instanceof RecoveredType @@ -2667,6 +2710,7 @@ protected void consumeEnumConstantHeaderName() { this.pendingAnnotation = null; } } +@Override protected void consumeEnumConstantNoClassBody() { super.consumeEnumConstantNoClassBody(); if ((this.currentToken == TokenNameCOMMA || this.currentToken == TokenNameSEMICOLON) @@ -2676,6 +2720,7 @@ protected void consumeEnumConstantNoClassBody() { } } } +@Override protected void consumeEnumConstantWithClassBody() { super.consumeEnumConstantWithClassBody(); if ((this.currentToken == TokenNameCOMMA || this.currentToken == TokenNameSEMICOLON) @@ -2685,6 +2730,7 @@ protected void consumeEnumConstantWithClassBody() { } } } +@Override protected void consumeEnumHeaderName() { super.consumeEnumHeaderName(); this.hasUnusedModifiers = false; @@ -2693,6 +2739,7 @@ protected void consumeEnumHeaderName() { this.pendingAnnotation = null; } } +@Override protected void consumeEnumHeaderNameWithTypeParameters() { super.consumeEnumHeaderNameWithTypeParameters(); if (this.pendingAnnotation != null) { @@ -2700,6 +2747,7 @@ protected void consumeEnumHeaderNameWithTypeParameters() { this.pendingAnnotation = null; } } +@Override protected void consumeEqualityExpression(int op) { super.consumeEqualityExpression(op); popElement(K_BINARY_OPERATOR); @@ -2709,6 +2757,7 @@ protected void consumeEqualityExpression(int op) { this.assistNodeParent = exp; } } +@Override protected void consumeEqualityExpressionWithName(int op) { super.consumeEqualityExpressionWithName(op); popElement(K_BINARY_OPERATOR); @@ -2718,6 +2767,7 @@ protected void consumeEqualityExpressionWithName(int op) { this.assistNodeParent = exp; } } +@Override protected void consumeExitVariableWithInitialization() { super.consumeExitVariableWithInitialization(); if ((this.currentToken == TokenNameCOMMA || this.currentToken == TokenNameSEMICOLON) @@ -2741,6 +2791,7 @@ protected void consumeExitVariableWithInitialization() { } } } +@Override protected void consumeExitVariableWithoutInitialization() { // ExitVariableWithoutInitialization ::= $empty // do nothing by default @@ -2752,6 +2803,7 @@ protected void consumeExitVariableWithoutInitialization() { } } } +@Override protected void consumeExplicitConstructorInvocation(int flag, int recFlag) { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); @@ -2762,6 +2814,7 @@ protected void consumeExplicitConstructorInvocation(int flag, int recFlag) { * If the cursor location is on the field access, then create a * CompletionOnMemberAccess instead. */ +@Override protected void consumeFieldAccess(boolean isSuperAccess) { // FieldAccess ::= Primary '.' 'Identifier' // FieldAccess ::= 'super' '.' 'Identifier' @@ -2776,12 +2829,14 @@ protected void consumeFieldAccess(boolean isSuperAccess) { pushCompletionOnMemberAccessOnExpressionStack(isSuperAccess); } } +@Override protected void consumeForceNoDiet() { super.consumeForceNoDiet(); if (isInsideMethod()) { pushOnElementStack(K_LOCAL_INITIALIZER_DELIMITER); } } +@Override protected void consumeFormalParameter(boolean isVarArgs) { this.invocationType = NO_RECEIVER; @@ -2868,6 +2923,7 @@ protected void consumeFormalParameter(boolean isVarArgs) { this.listLength++; } } +@Override protected void consumeGenericTypeWithDiamond() { super.consumeGenericTypeWithDiamond(); // we need to pop the <> of the diamond from the stack. @@ -2876,6 +2932,7 @@ protected void consumeGenericTypeWithDiamond() { popElement(K_BINARY_OPERATOR); // pop > popElement(K_BINARY_OPERATOR); // pop < } +@Override protected void consumeStatementFor() { super.consumeStatementFor(); @@ -2883,6 +2940,7 @@ protected void consumeStatementFor() { popElement(K_CONTROL_STATEMENT_DELIMITER); } } +@Override protected void consumeStatementIfNoElse() { super.consumeStatementIfNoElse(); @@ -2890,6 +2948,7 @@ protected void consumeStatementIfNoElse() { popElement(K_CONTROL_STATEMENT_DELIMITER); } } +@Override protected void consumeStatementIfWithElse() { super.consumeStatementIfWithElse(); @@ -2897,6 +2956,7 @@ protected void consumeStatementIfWithElse() { popElement(K_CONTROL_STATEMENT_DELIMITER); } } +@Override protected void consumeInsideCastExpression() { TypeReference[] bounds = null; int additionalBoundsLength = this.genericsLengthStack[this.genericsLengthPtr--]; @@ -2934,6 +2994,7 @@ protected void consumeInsideCastExpression() { pushOnElementStack(K_CAST_STATEMENT); } +@Override protected void consumeInsideCastExpressionLL1() { if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_CAST) { popElement(K_PARAMETERIZED_CAST); @@ -2957,6 +3018,7 @@ protected void consumeInsideCastExpressionLL1() { } pushOnElementStack(K_CAST_STATEMENT); } +@Override protected void consumeInsideCastExpressionLL1WithBounds() { if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_CAST) { popElement(K_PARAMETERIZED_CAST); @@ -2983,6 +3045,7 @@ protected void consumeInsideCastExpressionLL1WithBounds() { } pushOnElementStack(K_CAST_STATEMENT); } +@Override protected void consumeInsideCastExpressionWithQualifiedGenerics() { popElement(K_PARAMETERIZED_CAST); @@ -3014,6 +3077,7 @@ protected void consumeInsideCastExpressionWithQualifiedGenerics() { pushOnElementStack(K_CAST_STATEMENT); } +@Override protected void consumeInstanceOfExpression() { super.consumeInstanceOfExpression(); popElement(K_BINARY_OPERATOR); @@ -3027,6 +3091,7 @@ protected void consumeInstanceOfExpression() { this.assistNodeParent = exp; } } +@Override protected void consumeInstanceOfExpressionWithName() { super.consumeInstanceOfExpressionWithName(); popElement(K_BINARY_OPERATOR); @@ -3036,6 +3101,7 @@ protected void consumeInstanceOfExpressionWithName() { this.assistNodeParent = exp; } } +@Override protected void consumeInterfaceHeaderName1() { super.consumeInterfaceHeaderName1(); this.hasUnusedModifiers = false; @@ -3045,45 +3111,54 @@ protected void consumeInterfaceHeaderName1() { } classHeaderExtendsOrImplements(true); } +@Override protected void consumeInterfaceHeaderExtends() { super.consumeInterfaceHeaderExtends(); popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeInterfaceType() { pushOnElementStack(K_NEXT_TYPEREF_IS_INTERFACE); super.consumeInterfaceType(); popElement(K_NEXT_TYPEREF_IS_INTERFACE); } +@Override protected void consumeMethodInvocationName() { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); super.consumeMethodInvocationName(); } +@Override protected void consumeMethodInvocationNameWithTypeArguments() { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); super.consumeMethodInvocationNameWithTypeArguments(); } +@Override protected void consumeMethodInvocationPrimary() { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); super.consumeMethodInvocationPrimary(); } +@Override protected void consumeMethodInvocationPrimaryWithTypeArguments() { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); super.consumeMethodInvocationPrimaryWithTypeArguments(); } +@Override protected void consumeMethodInvocationSuper() { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); super.consumeMethodInvocationSuper(); } +@Override protected void consumeMethodInvocationSuperWithTypeArguments() { popElement(K_SELECTOR_QUALIFIER); popElement(K_SELECTOR_INVOCATION_TYPE); super.consumeMethodInvocationSuperWithTypeArguments(); } +@Override protected void consumeMethodHeaderName(boolean isAnnotationMethod) { if(this.indexOfAssistIdentifier() < 0) { this.identifierPtr--; @@ -3218,6 +3293,7 @@ protected void consumeMethodHeaderName(boolean isAnnotationMethod) { } } } +@Override protected void consumeMethodHeaderNameWithTypeParameters( boolean isAnnotationMethod) { long selectorSourcePositions = this.identifierPositionStack[this.identifierPtr]; int selectorSourceEnd = (int) selectorSourcePositions; @@ -3231,6 +3307,7 @@ protected void consumeMethodHeaderNameWithTypeParameters( boolean isAnnotationMe this.pendingAnnotation = null; } } +@Override protected void consumeMethodHeaderRightParen() { super.consumeMethodHeaderRightParen(); @@ -3264,6 +3341,7 @@ protected void consumeMethodHeaderRightParen() { } } } +@Override protected void consumeMethodHeaderExtendedDims() { super.consumeMethodHeaderExtendedDims(); @@ -3295,6 +3373,7 @@ protected void consumeMethodHeaderExtendedDims() { } } } +@Override protected void consumeAnnotationAsModifier() { super.consumeAnnotationAsModifier(); @@ -3302,6 +3381,7 @@ protected void consumeAnnotationAsModifier() { this.hasUnusedModifiers = true; } } +@Override protected void consumeAdditionalBound() { super.consumeAdditionalBound(); ASTNode node = this.genericsStack[this.genericsPtr]; @@ -3311,6 +3391,7 @@ protected void consumeAdditionalBound() { ((CompletionOnQualifiedTypeReference) node).setKind(CompletionOnQualifiedTypeReference.K_INTERFACE); } } +@Override protected void consumeAdditionalBound1() { super.consumeAdditionalBound1(); ASTNode node = this.genericsStack[this.genericsPtr]; @@ -3320,6 +3401,7 @@ protected void consumeAdditionalBound1() { ((CompletionOnQualifiedTypeReference) node).setKind(CompletionOnQualifiedTypeReference.K_INTERFACE); } } +@Override protected void consumeAnnotationName() { int index; @@ -3377,6 +3459,7 @@ protected void consumeAnnotationName() { this.pushOnElementStack(K_BETWEEN_ANNOTATION_NAME_AND_RPAREN, LPAREN_NOT_CONSUMED | ANNOTATION_NAME_COMPLETION); } +@Override protected void consumeAnnotationTypeDeclarationHeaderName() { super.consumeAnnotationTypeDeclarationHeaderName(); this.hasUnusedModifiers = false; @@ -3385,6 +3468,7 @@ protected void consumeAnnotationTypeDeclarationHeaderName() { this.pendingAnnotation = null; } } +@Override protected void consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() { super.consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters(); this.hasUnusedModifiers = false; @@ -3393,6 +3477,7 @@ protected void consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() { this.pendingAnnotation = null; } } +@Override protected void consumeLabel() { super.consumeLabel(); pushOnLabelStack(this.identifierStack[this.identifierPtr]); @@ -3405,6 +3490,7 @@ protected void consumeLambdaExpression() { if (this.assistNode == null || !(this.assistNode.sourceStart >= expression.sourceStart && this.assistNode.sourceEnd <= expression.sourceEnd)) popElement(K_LAMBDA_EXPRESSION_DELIMITER); } +@Override protected void consumeMarkerAnnotation(boolean isTypeAnnotation) { if (this.topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BETWEEN_ANNOTATION_NAME_AND_RPAREN && (this.topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER) & ANNOTATION_NAME_COMPLETION) != 0 ) { @@ -3415,6 +3501,7 @@ protected void consumeMarkerAnnotation(boolean isTypeAnnotation) { super.consumeMarkerAnnotation(isTypeAnnotation); } } +@Override protected void consumeMemberValuePair() { /* check if current awaiting identifier is the completion identifier */ if (this.indexOfAssistIdentifier() < 0){ @@ -3443,6 +3530,7 @@ protected void consumeMemberValuePair() { this.restartRecovery = true; } +@Override protected void consumeMemberValueAsName() { if ((indexOfAssistIdentifier()) < 0) { super.consumeMemberValueAsName(); @@ -3454,42 +3542,51 @@ protected void consumeMemberValueAsName() { } } } +@Override protected void consumeMethodBody() { popElement(K_BLOCK_DELIMITER); super.consumeMethodBody(); } +@Override protected void consumeMethodHeader() { super.consumeMethodHeader(); pushOnElementStack(K_BLOCK_DELIMITER); } +@Override protected void consumeMethodDeclaration(boolean isNotAbstract, boolean isDefaultMethod) { if (!isNotAbstract) { popElement(K_BLOCK_DELIMITER); } super.consumeMethodDeclaration(isNotAbstract, isDefaultMethod); } +@Override protected void consumeModifiers() { super.consumeModifiers(); // save from stack values this.lastModifiersStart = this.intStack[this.intPtr]; this.lastModifiers = this.intStack[this.intPtr-1]; } +@Override protected void consumeModuleHeader() { super.consumeModuleHeader(); } +@Override protected void consumeProvidesInterface() { super.consumeProvidesInterface(); pushOnElementStack(K_AFTER_NAME_IN_PROVIDES_STATEMENT); } +@Override protected void consumeProvidesStatement() { super.consumeProvidesStatement(); popElement(K_INSIDE_PROVIDES_STATEMENT); } +@Override protected void consumeWithClause() { super.consumeWithClause(); popElement(K_AFTER_WITH_IN_PROVIDES_STATEMENT); } +@Override protected void consumeReferenceType() { if (this.identifierLengthStack[this.identifierLengthPtr] > 1) { // reducing a qualified name // potential receiver is being poped, so reset potential receiver @@ -3498,25 +3595,30 @@ protected void consumeReferenceType() { } super.consumeReferenceType(); } +@Override protected void consumeRequiresStatement() { super.consumeRequiresStatement(); popElement(K_INSIDE_REQUIRES_STATEMENT); } +@Override protected void consumeRestoreDiet() { super.consumeRestoreDiet(); if (isInsideMethod()) { popElement(K_LOCAL_INITIALIZER_DELIMITER); } } +@Override protected void consumeExportsStatement() { super.consumeExportsStatement(); popElement(K_AFTER_PACKAGE_IN_PACKAGE_VISIBILITY_STATEMENT); popElement(K_INSIDE_EXPORTS_STATEMENT); } +@Override protected void consumeSinglePkgName() { super.consumeSinglePkgName(); pushOnElementStack(K_AFTER_PACKAGE_IN_PACKAGE_VISIBILITY_STATEMENT); } +@Override protected void consumeSingleMemberAnnotation(boolean isTypeAnnotation) { if (this.topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BETWEEN_ANNOTATION_NAME_AND_RPAREN && (this.topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER) & ANNOTATION_NAME_COMPLETION) != 0 ) { @@ -3527,14 +3629,17 @@ protected void consumeSingleMemberAnnotation(boolean isTypeAnnotation) { super.consumeSingleMemberAnnotation(isTypeAnnotation); } } +@Override protected void consumeSingleStaticImportDeclarationName() { super.consumeSingleStaticImportDeclarationName(); this.pendingAnnotation = null; // the pending annotation cannot be attached to next nodes } +@Override protected void consumeSingleTypeImportDeclarationName() { super.consumeSingleTypeImportDeclarationName(); this.pendingAnnotation = null; // the pending annotation cannot be attached to next nodes } +@Override protected void consumeStatementBreakWithLabel() { super.consumeStatementBreakWithLabel(); if (this.record) { @@ -3545,10 +3650,12 @@ protected void consumeStatementBreakWithLabel() { } } +@Override protected void consumeStatementLabel() { popElement(K_LABEL); super.consumeStatementLabel(); } +@Override protected void consumeStatementSwitch() { super.consumeStatementSwitch(); if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SWITCH_LABEL) { @@ -3556,24 +3663,29 @@ protected void consumeStatementSwitch() { popElement(K_BLOCK_DELIMITER); } } +@Override protected void consumeStatementWhile() { super.consumeStatementWhile(); if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_CONTROL_STATEMENT_DELIMITER) { popElement(K_CONTROL_STATEMENT_DELIMITER); } } +@Override protected void consumeStaticImportOnDemandDeclarationName() { super.consumeStaticImportOnDemandDeclarationName(); this.pendingAnnotation = null; // the pending annotation cannot be attached to next nodes } +@Override protected void consumeStaticInitializer() { super.consumeStaticInitializer(); this.pendingAnnotation = null; // the pending annotation cannot be attached to next nodes } +@Override protected void consumeNestedMethod() { super.consumeNestedMethod(); if(!(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BLOCK_DELIMITER)) pushOnElementStack(K_BLOCK_DELIMITER); } +@Override protected void consumeNormalAnnotation(boolean isTypeAnnotation) { if (this.topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BETWEEN_ANNOTATION_NAME_AND_RPAREN && (this.topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER) & ANNOTATION_NAME_COMPLETION) != 0 ) { @@ -3601,6 +3713,7 @@ protected void consumeNormalAnnotation(boolean isTypeAnnotation) { super.consumeNormalAnnotation(isTypeAnnotation); } } +@Override protected void consumePackageDeclarationName() { super.consumePackageDeclarationName(); if (this.pendingAnnotation != null) { @@ -3608,6 +3721,7 @@ protected void consumePackageDeclarationName() { this.pendingAnnotation = null; } } +@Override protected void consumePackageDeclarationNameWithModifiers() { super.consumePackageDeclarationNameWithModifiers(); if (this.pendingAnnotation != null) { @@ -3615,6 +3729,7 @@ protected void consumePackageDeclarationNameWithModifiers() { this.pendingAnnotation = null; } } +@Override protected void consumePrimaryNoNewArrayName() { // this is class literal access, so reset potential receiver this.invocationType = NO_RECEIVER; @@ -3622,6 +3737,7 @@ protected void consumePrimaryNoNewArrayName() { super.consumePrimaryNoNewArrayName(); } +@Override protected void consumeQualifiedSuperReceiver() { // this is class literal access, so reset potential receiver this.invocationType = NO_RECEIVER; @@ -3629,6 +3745,7 @@ protected void consumeQualifiedSuperReceiver() { super.consumeQualifiedSuperReceiver(); } +@Override protected void consumePrimaryNoNewArrayNameThis() { // this is class literal access, so reset potential receiver this.invocationType = NO_RECEIVER; @@ -3636,6 +3753,7 @@ protected void consumePrimaryNoNewArrayNameThis() { super.consumePrimaryNoNewArrayNameThis(); } +@Override protected void consumePushPosition() { super.consumePushPosition(); if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BINARY_OPERATOR) { @@ -3644,6 +3762,7 @@ protected void consumePushPosition() { pushOnElementStack(K_UNARY_OPERATOR, info); } } +@Override protected void consumeToken(int token) { if(this.isFirst) { super.consumeToken(token); @@ -4210,18 +4329,22 @@ protected void consumeToken(int token) { } } } +@Override protected void consumeInvocationExpression() { // on error, a message send's error reductions will take the expression path rather than the statement path since that is a dead end. super.consumeInvocationExpression(); triggerRecoveryUponLambdaClosure(this.expressionStack[this.expressionPtr], false); } +@Override protected void consumeReferenceExpression(ReferenceExpression referenceExpression) { this.inReferenceExpression = false; super.consumeReferenceExpression(referenceExpression); } +@Override protected void consumeOnlySynchronized() { super.consumeOnlySynchronized(); this.hasUnusedModifiers = false; } +@Override protected void consumeOnlyTypeArguments() { super.consumeOnlyTypeArguments(); popElement(K_BINARY_OPERATOR); @@ -4232,10 +4355,12 @@ protected void consumeOnlyTypeArguments() { popElement(K_PARAMETERIZED_ALLOCATION); } } +@Override protected void consumeOnlyTypeArgumentsForCastExpression() { super.consumeOnlyTypeArgumentsForCastExpression(); pushOnElementStack(K_PARAMETERIZED_CAST); } +@Override protected void consumeOpenFakeBlock() { super.consumeOpenFakeBlock(); pushOnElementStack(K_BLOCK_DELIMITER); @@ -4246,51 +4371,63 @@ protected void consumeOpensStatement() { popElement(K_AFTER_PACKAGE_IN_PACKAGE_VISIBILITY_STATEMENT); popElement(K_INSIDE_OPENS_STATEMENT); } +@Override protected void consumeRightParen() { super.consumeRightParen(); } +@Override protected void consumeReferenceType1() { super.consumeReferenceType1(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeReferenceType2() { super.consumeReferenceType2(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeReferenceType3() { super.consumeReferenceType3(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeTypeArgumentReferenceType1() { super.consumeTypeArgumentReferenceType1(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeTypeArgumentReferenceType2() { super.consumeTypeArgumentReferenceType2(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeTypeArguments() { super.consumeTypeArguments(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeTypeHeaderNameWithTypeParameters() { super.consumeTypeHeaderNameWithTypeParameters(); TypeDeclaration typeDecl = (TypeDeclaration)this.astStack[this.astPtr]; classHeaderExtendsOrImplements((typeDecl.modifiers & ClassFileConstants.AccInterface) != 0); } +@Override protected void consumeTypeImportOnDemandDeclarationName() { super.consumeTypeImportOnDemandDeclarationName(); this.pendingAnnotation = null; // the pending annotation cannot be attached to next nodes } +@Override protected void consumeImportDeclaration() { super.consumeImportDeclaration(); popElement(K_INSIDE_IMPORT_STATEMENT); } +@Override protected void consumeTypeParameters() { super.consumeTypeParameters(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeTypeParameterHeader() { super.consumeTypeParameterHeader(); TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr]; @@ -4320,10 +4457,12 @@ protected void consumeTypeParameterHeader() { this.assistNode = typeParameter.type; this.lastCheckPoint = typeParameter.type.sourceEnd + 1; } +@Override protected void consumeTypeParameter1() { super.consumeTypeParameter1(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeTypeParameterWithExtends() { super.consumeTypeParameterWithExtends(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -4333,6 +4472,7 @@ protected void consumeTypeParameterWithExtends() { } popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeTypeParameterWithExtendsAndBounds() { super.consumeTypeParameterWithExtendsAndBounds(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -4342,6 +4482,7 @@ protected void consumeTypeParameterWithExtendsAndBounds() { } popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeTypeParameter1WithExtends() { super.consumeTypeParameter1WithExtends(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -4351,6 +4492,7 @@ protected void consumeTypeParameter1WithExtends() { } popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeTypeParameter1WithExtendsAndBounds() { super.consumeTypeParameter1WithExtendsAndBounds(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -4360,21 +4502,25 @@ protected void consumeTypeParameter1WithExtendsAndBounds() { } popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeUnionType() { pushOnElementStack(K_NEXT_TYPEREF_IS_EXCEPTION); super.consumeUnionType(); popElement(K_NEXT_TYPEREF_IS_EXCEPTION); } +@Override protected void consumeUnionTypeAsClassType() { pushOnElementStack(K_NEXT_TYPEREF_IS_EXCEPTION); super.consumeUnionTypeAsClassType(); popElement(K_NEXT_TYPEREF_IS_EXCEPTION); } +@Override protected void consumeUsesStatement() { super.consumeUsesStatement(); popElement(K_INSIDE_USES_STATEMENT); } +@Override protected void consumeWildcard() { super.consumeWildcard(); if (assistIdentifier() == null && this.currentToken == TokenNameIdentifier) { // Test below copied from CompletionScanner.getCurrentIdentifierSource() @@ -4402,18 +4548,22 @@ protected void consumeWildcard() { this.assistNode = wildcard.bound; this.lastCheckPoint = wildcard.bound.sourceEnd + 1; } +@Override protected void consumeWildcard1() { super.consumeWildcard1(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeWildcard2() { super.consumeWildcard2(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeWildcard3() { super.consumeWildcard3(); popElement(K_BINARY_OPERATOR); } +@Override protected void consumeWildcardBoundsExtends() { super.consumeWildcardBoundsExtends(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -4423,6 +4573,7 @@ protected void consumeWildcardBoundsExtends() { } popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeWildcardBounds1Extends() { super.consumeWildcardBounds1Extends(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -4432,6 +4583,7 @@ protected void consumeWildcardBounds1Extends() { } popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeWildcardBounds2Extends() { super.consumeWildcardBounds2Extends(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -4441,6 +4593,7 @@ protected void consumeWildcardBounds2Extends() { } popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeWildcardBounds3Extends() { super.consumeWildcardBounds3Extends(); if (this.assistNode != null && this.assistNodeParent == null) { @@ -4450,6 +4603,7 @@ protected void consumeWildcardBounds3Extends() { } popElement(K_EXTENDS_KEYWORD); } +@Override protected void consumeUnaryExpression(int op) { super.consumeUnaryExpression(op); popElement(K_UNARY_OPERATOR); @@ -4461,6 +4615,7 @@ protected void consumeUnaryExpression(int op) { } } } +@Override protected void consumeUnaryExpression(int op, boolean post) { super.consumeUnaryExpression(op, post); popElement(K_UNARY_OPERATOR); @@ -4472,6 +4627,7 @@ protected void consumeUnaryExpression(int op, boolean post) { } } } +@Override public MethodDeclaration convertToMethodDeclaration(ConstructorDeclaration c, CompilationResult compilationResult) { MethodDeclaration methodDeclaration = super.convertToMethodDeclaration(c, compilationResult); if (this.sourceEnds != null) { @@ -4481,9 +4637,11 @@ public MethodDeclaration convertToMethodDeclaration(ConstructorDeclaration c, Co } return methodDeclaration; } +@Override public ImportReference createAssistPackageVisibilityReference(char[][] tokens, long[] positions){ return new CompletionOnPackageVisibilityReference(tokens, positions); } +@Override public ImportReference createAssistImportReference(char[][] tokens, long[] positions, int mod){ return new CompletionOnImportReference(tokens, positions, mod); } @@ -4509,9 +4667,11 @@ public ModuleDeclaration createAssistModuleDeclaration(CompilationResult compila long[] positions) { return new CompletionOnModuleDeclaration(compilationResult, tokens, positions); } +@Override public ImportReference createAssistPackageReference(char[][] tokens, long[] positions){ return new CompletionOnPackageReference(tokens, positions); } +@Override public NameReference createQualifiedAssistNameReference(char[][] previousIdentifiers, char[] assistName, long[] positions){ return new CompletionOnQualifiedNameReference( previousIdentifiers, @@ -4527,6 +4687,7 @@ private TypeReference checkAndCreateModuleQualifiedAssistTypeReference(char[][] } return new CompletionOnQualifiedTypeReference(previousIdentifiers, assistName, positions); } +@Override public TypeReference createQualifiedAssistTypeReference(char[][] previousIdentifiers, char[] assistName, long[] positions){ switch (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER)) { case K_NEXT_TYPEREF_IS_EXCEPTION : @@ -4556,6 +4717,7 @@ public TypeReference createQualifiedAssistTypeReference(char[][] previousIdentif positions); } } +@Override public TypeReference createParameterizedQualifiedAssistTypeReference(char[][] previousIdentifiers, TypeReference[][] typeArguments, char[] assistName, TypeReference[] assistTypeArguments, long[] positions) { boolean isParameterized = false; for (int i = 0; i < typeArguments.length; i++) { @@ -4599,6 +4761,7 @@ public TypeReference createParameterizedQualifiedAssistTypeReference(char[][] pr } } } +@Override public NameReference createSingleAssistNameReference(char[] assistName, long position) { int kind = topKnownElementKind(COMPLETION_OR_ASSIST_PARSER); if(!isInsideMethod()) { @@ -4721,6 +4884,7 @@ private TypeReference checkAndCreateModuleSingleAssistTypeReference(char[] assis } return new CompletionOnSingleTypeReference(assistName,position); } +@Override public TypeReference createSingleAssistTypeReference(char[] assistName, long position) { switch (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER)) { case K_NEXT_TYPEREF_IS_EXCEPTION : @@ -4735,9 +4899,11 @@ public TypeReference createSingleAssistTypeReference(char[] assistName, long pos return checkAndCreateModuleSingleAssistTypeReference(assistName, position); } } +@Override public TypeReference createParameterizedSingleAssistTypeReference(TypeReference[] typeArguments, char[] assistName, long position) { return createSingleAssistTypeReference(assistName, position); } +@Override protected StringLiteral createStringLiteral(char[] token, int start, int end, int lineNumber) { if (start <= this.cursorLocation && this.cursorLocation <= end){ char[] source = this.scanner.source; @@ -4796,6 +4962,7 @@ protected StringLiteral createStringLiteral(char[] token, int start, int end, in } return super.createStringLiteral(token, start, end, lineNumber); } +@Override protected TypeReference augmentTypeWithAdditionalDimensions(TypeReference typeRef, int additionalDimensions, Annotation[][] additionalAnnotations, boolean isVarargs) { if (this.assistNode == typeRef) { return typeRef; @@ -4817,6 +4984,7 @@ public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, Compila /* * Flush parser/scanner state regarding to code assist */ +@Override public void flushAssistState() { super.flushAssistState(); @@ -4828,6 +4996,7 @@ public void flushAssistState() { completionScanner.completedIdentifierEnd = -1; } +@Override protected TypeReference getTypeReferenceForGenericType(int dim, int identifierLength, int numberOfIdentifiers) { TypeReference ref = super.getTypeReferenceForGenericType(dim, identifierLength, numberOfIdentifiers); // in completion case we might have encountered the assist node before really parsing @@ -4863,6 +5032,7 @@ protected TypeReference getTypeReferenceForGenericType(int dim, int identifierLe return ref; } +@Override protected NameReference getUnspecifiedReference(boolean rejectTypeAnnotations) { NameReference nameReference = super.getUnspecifiedReference(rejectTypeAnnotations); if (this.record) { @@ -4870,6 +5040,7 @@ protected NameReference getUnspecifiedReference(boolean rejectTypeAnnotations) { } return nameReference; } +@Override protected NameReference getUnspecifiedReferenceOptimized() { if (this.identifierLengthStack[this.identifierLengthPtr] > 1) { // reducing a qualified name // potential receiver is being poped, so reset potential receiver @@ -4887,20 +5058,24 @@ private boolean isAlreadyPotentialName(int identifierStart) { return identifierStart <= this.potentialVariableNameEnds[this.potentialVariableNamesPtr]; } +@Override protected int indexOfAssistIdentifier(boolean useGenericsStack) { if (this.record) return -1; // when names are recorded there is no assist identifier return super.indexOfAssistIdentifier(useGenericsStack); } +@Override public void initialize() { super.initialize(); this.labelPtr = -1; initializeForBlockStatements(); } +@Override public void initialize(boolean parsingCompilationUnit) { super.initialize(parsingCompilationUnit); this.labelPtr = -1; initializeForBlockStatements(); } +@Override public void copyState(Parser from) { super.copyState(from); @@ -4933,6 +5108,7 @@ private void initializeForBlockStatements() { } } } +@Override public void initializeScanner(){ this.scanner = new CompletionScanner(this.options.sourceLevel); } @@ -5044,6 +5220,7 @@ protected boolean isInsideReturn(){ } return false; } +@Override public ReferenceExpression newReferenceExpression() { char[] selector = this.identifierStack[this.identifierPtr]; if (selector != assistIdentifier()){ @@ -5061,6 +5238,7 @@ public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit, Compilation completionScanner.cursorLocation = cursorLoc; return this.parse(sourceUnit, compilationResult); } +@Override public void parseBlockStatements( ConstructorDeclaration cd, CompilationUnitDeclaration unit) { @@ -5141,6 +5319,7 @@ protected void popUntilCompletedAnnotationIfNecessary() { /* * Prepares the state of the parser to go for BlockStatements. */ +@Override protected void prepareForBlockStatements() { this.nestedMethod[this.nestedType = 0] = 1; this.variablesCounter[this.nestedType] = 0; @@ -5201,6 +5380,7 @@ private void recordReference(NameReference nameReference) { addPotentialName(token, nameReference.sourceStart, nameReference.sourceEnd); } } +@Override public void recoveryExitFromVariable() { if(this.currentElement != null && this.currentElement instanceof RecoveredLocalVariable) { RecoveredElement oldElement = this.currentElement; @@ -5224,6 +5404,7 @@ public void recoveryExitFromVariable() { super.recoveryExitFromVariable(); } } +@Override public void recoveryTokenCheck() { RecoveredElement oldElement = this.currentElement; switch (this.currentToken) { @@ -5268,6 +5449,7 @@ public void recoveryTokenCheck() { } } +@Override protected CompletionParser createSnapShotParser() { return new CompletionParser(this.problemReporter, this.storeSourceEnds); } @@ -5275,6 +5457,7 @@ protected CompletionParser createSnapShotParser() { * Reset internal state after completion is over */ +@Override public void reset() { super.reset(); this.cursorLocation = 0; @@ -5290,6 +5473,7 @@ public void resetAfterCompletion() { this.cursorLocation = 0; flushAssistState(); } +@Override public void restoreAssistParser(Object parserState) { int[] state = (int[]) parserState; @@ -5316,6 +5500,7 @@ protected int resumeOnSyntaxError() { * Move checkpoint location, reset internal stacks and * decide which grammar goal is activated. */ +@Override protected int resumeAfterRecovery() { this.hasUnusedModifiers = false; if (this.assistNode != null) { @@ -5378,10 +5563,12 @@ protected int resumeAfterRecovery() { } return super.resumeAfterRecovery(); } +@Override public void setAssistIdentifier(char[] assistIdent){ ((CompletionScanner)this.scanner).completionIdentifier = assistIdent; } +@Override protected void shouldStackAssistNode() { this.shouldStackAssistNode = true; } @@ -5391,6 +5578,7 @@ protected boolean assistNodeNeedsStacking() { return this.shouldStackAssistNode; } +@Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("elementKindStack : int[] = {"); //$NON-NLS-1$ @@ -5410,6 +5598,7 @@ public String toString() { /* * Update recovery state based on current parser/scanner state */ +@Override protected void updateRecoveryState() { /* expose parser state to recovery state */ @@ -5443,6 +5632,7 @@ protected void updateRecoveryState() { recoveryExitFromVariable(); } +@Override protected LocalDeclaration createLocalDeclaration(char[] assistName, int sourceStart, int sourceEnd) { if (this.indexOfAssistIdentifier() < 0) { return super.createLocalDeclaration(assistName, sourceStart, sourceEnd); @@ -5454,10 +5644,12 @@ protected LocalDeclaration createLocalDeclaration(char[] assistName, int sourceS } } +@Override protected JavadocParser createJavadocParser() { return new CompletionJavadocParser(this); } +@Override protected FieldDeclaration createFieldDeclaration(char[] assistName, int sourceStart, int sourceEnd) { if (this.indexOfAssistIdentifier() < 0 || (this.currentElement instanceof RecoveredUnit && ((RecoveredUnit)this.currentElement).typeCount == 0)) { return super.createFieldDeclaration(assistName, sourceStart, sourceEnd); @@ -5485,6 +5677,7 @@ private boolean stackHasInstanceOfExpression(Object[] stackToSearch, int startIn } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=292087 +@Override protected boolean isInsideArrayInitializer(){ int i = this.elementPtr; if (i > -1 && this.elementKindStack[i] == K_ARRAY_INITIALIZER) { diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java index 3724e869a0..15ca18604c 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java @@ -52,6 +52,7 @@ public CompletionScanner(long sourceLevel) { null/*taskPriorities*/, true/*taskCaseSensitive*/); } +@Override protected boolean isAtAssistIdentifier() { if (this.cursorLocation < this.startPosition && this.currentPosition == this.startPosition) { // fake empty identifier got issued return true; @@ -66,6 +67,7 @@ protected boolean isAtAssistIdentifier() { * on an identifier prefix. * */ +@Override public char[] getCurrentIdentifierSource() { if (this.completionIdentifier == null){ @@ -93,6 +95,7 @@ public char[] getCurrentIdentifierSource() { return super.getCurrentIdentifierSource(); } +@Override public char[] getCurrentTokenSourceString() { if (this.completionIdentifier == null){ if (this.cursorLocation+1 >= this.startPosition && this.cursorLocation < this.currentPosition){ @@ -112,6 +115,7 @@ public char[] getCurrentTokenSourceString() { } return super.getCurrentTokenSourceString(); } +@Override protected int getNextToken0() throws InvalidInputException { this.wasAcr = false; @@ -864,6 +868,7 @@ protected int getNextToken0() throws InvalidInputException { } return TokenNameEOF; } +@Override public final void getNextUnicodeChar() throws InvalidInputException { int temp = this.currentPosition; // the \ is already read super.getNextUnicodeChar(); @@ -874,6 +879,7 @@ public final void getNextUnicodeChar() throws InvalidInputException { throw new InvalidCursorLocation(InvalidCursorLocation.NO_COMPLETION_INSIDE_UNICODE); } } +@Override protected boolean isFirstTag() { return getNextChar('d') && @@ -894,6 +900,7 @@ public final void jumpOverBlock() { // * In case we actually read a keyword, but the cursor is located inside, // * we pretend we read an identifier. // */ +@Override public int scanIdentifierOrKeyword() { int id = super.scanIdentifierOrKeyword(); @@ -914,6 +921,7 @@ public int scanIdentifierOrKeyword() { return id; } +@Override public int scanNumber(boolean dotPrefix) throws InvalidInputException { int token = super.scanNumber(dotPrefix); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistAnnotation.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistAnnotation.java index f2d7c4b65d..7c98846c55 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistAnnotation.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistAnnotation.java @@ -25,6 +25,7 @@ public class AssistAnnotation extends Annotation { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistCompilationUnit.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistCompilationUnit.java index 6390fbbc91..115ab6c232 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistCompilationUnit.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistCompilationUnit.java @@ -33,22 +33,27 @@ public class AssistCompilationUnit extends CompilationUnit { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } + @Override public IImportContainer getImportContainer() { return new AssistImportContainer(this, this.infoCache); } + @Override public IPackageDeclaration getPackageDeclaration(String pkg) { return new AssistPackageDeclaration(this, pkg, this.infoCache); } + @Override public IType getType(String typeName) { return new AssistSourceType(this, typeName, this.bindingCache, this.infoCache); } + @Override public boolean hasChildren() throws JavaModelException { JavaElementInfo info = (JavaElementInfo)this.infoCache.get(this); return info.getChildren().length > 0; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistImportContainer.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistImportContainer.java index 47f0469ca8..fa94e2fe07 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistImportContainer.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistImportContainer.java @@ -26,10 +26,12 @@ public class AssistImportContainer extends ImportContainer { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } + @Override protected IImportDeclaration getImport(String importName, boolean isOnDemand) { return new AssistImportDeclaration(this, importName, isOnDemand, this.infoCache); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistImportDeclaration.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistImportDeclaration.java index 1b1aef938b..8e020c8e09 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistImportDeclaration.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistImportDeclaration.java @@ -25,6 +25,7 @@ public class AssistImportDeclaration extends ImportDeclaration { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistInitializer.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistInitializer.java index 831b139fb5..c440d05335 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistInitializer.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistInitializer.java @@ -28,10 +28,12 @@ public class AssistInitializer extends Initializer { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } + @Override public IType getType(String typeName, int count) { AssistSourceType type = new AssistSourceType(this, typeName, this.bindingCache, this.infoCache); type.occurrenceCount = count; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistPackageDeclaration.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistPackageDeclaration.java index a3e7cc6468..425790fc44 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistPackageDeclaration.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistPackageDeclaration.java @@ -26,10 +26,12 @@ public class AssistPackageDeclaration extends PackageDeclaration { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } + @Override public IAnnotation getAnnotation(String name) { return new AssistAnnotation(this, name, this.infoCache); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java index a6887a1656..d6ff6c7bc5 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java @@ -129,6 +129,7 @@ public AssistParser(ProblemReporter problemReporter) { public abstract char[] assistIdentifier(); +@Override public void copyState(Parser from) { super.copyState(from); @@ -178,6 +179,7 @@ public int bodyEnd(Initializer initializer){ * Build initial recovery state. * Recovery state is inferred from the current state of the parser (reduced node stack). */ +@Override public RecoveredElement buildInitialRecoveryState(){ /* recovery in unit structure */ if (this.referenceContext instanceof CompilationUnitDeclaration){ @@ -388,30 +390,37 @@ private void initModuleInfo(RecoveredElement element) { } } } +@Override protected void consumeAnnotationTypeDeclarationHeader() { super.consumeAnnotationTypeDeclarationHeader(); pushOnElementStack(K_TYPE_DELIMITER); } +@Override protected void consumeClassBodyDeclaration() { popElement(K_METHOD_DELIMITER); super.consumeClassBodyDeclaration(); } +@Override protected void consumeClassBodyopt() { super.consumeClassBodyopt(); popElement(K_SELECTOR); } +@Override protected void consumeClassHeader() { super.consumeClassHeader(); pushOnElementStack(K_TYPE_DELIMITER); } +@Override protected void consumeConstructorBody() { super.consumeConstructorBody(); popElement(K_METHOD_DELIMITER); } +@Override protected void consumeConstructorHeader() { super.consumeConstructorHeader(); pushOnElementStack(K_METHOD_DELIMITER); } +@Override protected void consumeEnhancedForStatementHeaderInit(boolean hasModifiers) { super.consumeEnhancedForStatementHeaderInit(hasModifiers); @@ -421,15 +430,18 @@ protected void consumeEnhancedForStatementHeaderInit(boolean hasModifiers) { this.currentElement = this.currentElement.add(localDecl, 0); } } +@Override protected void consumeEnterAnonymousClassBody(boolean qualified) { super.consumeEnterAnonymousClassBody(qualified); popElement(K_SELECTOR); pushOnElementStack(K_TYPE_DELIMITER); } +@Override protected void consumeEnterMemberValue() { super.consumeEnterMemberValue(); pushOnElementStack(K_ATTRIBUTE_VALUE_DELIMITER, this.identifierPtr); } +@Override protected void consumeEnumConstantHeader() { if(this.currentToken == TokenNameLBRACE) { popElement(K_ENUM_CONSTANT_DELIMITER); @@ -441,29 +453,35 @@ protected void consumeEnumConstantHeader() { if (triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true) && this.currentElement != null) this.restartRecovery = true; } +@Override protected void consumeEnumConstantHeaderName() { super.consumeEnumConstantHeaderName(); pushOnElementStack(K_ENUM_CONSTANT_DELIMITER); } +@Override protected void consumeEnumConstantWithClassBody() { popElement(K_TYPE_DELIMITER); popElement(K_FIELD_INITIALIZER_DELIMITER); popElement(K_ENUM_CONSTANT_DELIMITER); super.consumeEnumConstantWithClassBody(); } +@Override protected void consumeEnumConstantNoClassBody() { popElement(K_ENUM_CONSTANT_DELIMITER); super.consumeEnumConstantNoClassBody(); } +@Override protected void consumeEnumHeader() { super.consumeEnumHeader(); pushOnElementStack(K_TYPE_DELIMITER); } +@Override protected void consumeExitMemberValue() { super.consumeExitMemberValue(); popElement(K_ATTRIBUTE_VALUE_DELIMITER); } +@Override protected void consumeExplicitConstructorInvocation(int flag, int recFlag) { super.consumeExplicitConstructorInvocation(flag, recFlag); popElement(K_SELECTOR); @@ -596,20 +614,24 @@ protected ASTNode enclosingNode() { return null; } +@Override protected boolean isAssistParser() { return true; } +@Override protected void consumeBlockStatement() { super.consumeBlockStatement(); if (triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true) && this.currentElement != null) this.restartRecovery = true; } +@Override protected void consumeBlockStatements() { super.consumeBlockStatements(); if (triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true) && this.currentElement != null) { this.restartRecovery = true; } } +@Override protected void consumeFieldDeclaration() { super.consumeFieldDeclaration(); if (triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true)) { @@ -619,6 +641,7 @@ protected void consumeFieldDeclaration() { this.restartRecovery = true; } } +@Override protected void consumeForceNoDiet() { super.consumeForceNoDiet(); // if we are not in a method (i.e. we are not in a local variable initializer) @@ -637,6 +660,7 @@ protected void consumeForceNoDiet() { } } +@Override protected void consumeInterfaceHeader() { super.consumeInterfaceHeader(); pushOnElementStack(K_TYPE_DELIMITER); @@ -647,20 +671,24 @@ protected void consumeNestedLambda() { LambdaExpression lexp = (LambdaExpression) this.astStack[this.astPtr]; pushOnElementStack(K_LAMBDA_EXPRESSION_DELIMITER, EXPRESSION_BODY, lexp); } +@Override protected void consumeMethodBody() { super.consumeMethodBody(); popElement(K_METHOD_DELIMITER); } +@Override protected void consumeMethodDeclaration(boolean isNotAbstract, boolean isDefaultMethod) { if (!isNotAbstract) { popElement(K_METHOD_DELIMITER); } super.consumeMethodDeclaration(isNotAbstract, isDefaultMethod); } +@Override protected void consumeMethodHeader() { super.consumeMethodHeader(); pushOnElementStack(K_METHOD_DELIMITER); } +@Override protected void consumeMethodInvocationName() { super.consumeMethodInvocationName(); popElement(K_SELECTOR); @@ -669,6 +697,7 @@ protected void consumeMethodInvocationName() { this.lastCheckPoint = messageSend.sourceEnd + 1; } } +@Override protected void consumeMethodInvocationNameWithTypeArguments() { super.consumeMethodInvocationNameWithTypeArguments(); popElement(K_SELECTOR); @@ -677,6 +706,7 @@ protected void consumeMethodInvocationNameWithTypeArguments() { this.lastCheckPoint = messageSend.sourceEnd + 1; } } +@Override protected void consumeMethodInvocationPrimary() { super.consumeMethodInvocationPrimary(); popElement(K_SELECTOR); @@ -685,6 +715,7 @@ protected void consumeMethodInvocationPrimary() { this.lastCheckPoint = messageSend.sourceEnd + 1; } } +@Override protected void consumeMethodInvocationPrimaryWithTypeArguments() { super.consumeMethodInvocationPrimaryWithTypeArguments(); popElement(K_SELECTOR); @@ -693,6 +724,7 @@ protected void consumeMethodInvocationPrimaryWithTypeArguments() { this.lastCheckPoint = messageSend.sourceEnd + 1; } } +@Override protected void consumeMethodInvocationSuper() { super.consumeMethodInvocationSuper(); popElement(K_SELECTOR); @@ -701,6 +733,7 @@ protected void consumeMethodInvocationSuper() { this.lastCheckPoint = messageSend.sourceEnd + 1; } } +@Override protected void consumeMethodInvocationSuperWithTypeArguments() { super.consumeMethodInvocationSuperWithTypeArguments(); popElement(K_SELECTOR); @@ -709,6 +742,7 @@ protected void consumeMethodInvocationSuperWithTypeArguments() { this.lastCheckPoint = messageSend.sourceEnd + 1; } } +@Override protected void consumeModuleHeader() { pushOnElementStack(K_MODULE_INFO_DELIMITER); // ModuleHeader ::= 'module' Name @@ -756,14 +790,17 @@ protected void consumeModuleHeader() { } } +@Override protected void consumeModuleDeclaration() { super.consumeModuleDeclaration(); popElement(K_MODULE_INFO_DELIMITER); } +@Override protected void consumeNestedMethod() { super.consumeNestedMethod(); if(!isInsideMethod()) pushOnElementStack(K_METHOD_DELIMITER); } +@Override protected void consumeOpenBlock() { // OpenBlock ::= $empty super.consumeOpenBlock(); @@ -806,6 +843,7 @@ protected void consumeOpenFakeBlock() { } this.blockStarts[this.realBlockPtr] = -this.scanner.startPosition; } +@Override protected void consumePackageDeclarationName() { // PackageDeclarationName ::= 'package' Name /* build an ImportRef build from the last name @@ -854,6 +892,7 @@ protected void consumePackageDeclarationName() { this.restartRecovery = true; // used to avoid branching back into the regular automaton } } +@Override protected void consumePackageDeclarationNameWithModifiers() { // PackageDeclarationName ::= Modifiers 'package' PushRealModifiers Name /* build an ImportRef build from the last name @@ -913,6 +952,7 @@ protected void consumePackageDeclarationNameWithModifiers() { this.restartRecovery = true; // used to avoid branching back into the regular automaton } } +@Override protected void consumeRestoreDiet() { super.consumeRestoreDiet(); // if we are not in a method (i.e. we were not in a local variable initializer) @@ -922,6 +962,7 @@ protected void consumeRestoreDiet() { popElement(K_FIELD_INITIALIZER_DELIMITER); } } +@Override protected void consumeSingleStaticImportDeclarationName() { // SingleTypeImportDeclarationName ::= 'import' 'static' Name /* push an ImportRef build from the last name @@ -973,6 +1014,7 @@ protected void consumeSingleStaticImportDeclarationName() { this.restartRecovery = true; // used to avoid branching back into the regular automaton } } +@Override protected void consumeSinglePkgName() { int index; /* no need to take action if not inside assist identifiers */ @@ -1007,6 +1049,7 @@ protected void consumeSinglePkgName() { reference.declarationSourceEnd = (int) positions[length-1]; } } +@Override protected void consumeSingleTargetModuleName() { int index; /* no need to take action if not inside assist identifiers */ @@ -1031,6 +1074,7 @@ protected void consumeSingleTargetModuleName() { } } +@Override protected void consumeSingleRequiresModuleName() { int index = indexOfAssistIdentifier(); @@ -1071,6 +1115,7 @@ protected void consumeSingleRequiresModuleName() { } +@Override protected void consumeSingleTypeImportDeclarationName() { // SingleTypeImportDeclarationName ::= 'import' Name /* push an ImportRef build from the last name @@ -1122,6 +1167,7 @@ protected void consumeSingleTypeImportDeclarationName() { this.restartRecovery = true; // used to avoid branching back into the regular automaton } } +@Override protected void consumeStaticImportOnDemandDeclarationName() { // TypeImportOnDemandDeclarationName ::= 'import' 'static' Name '.' '*' /* push an ImportRef build from the last name @@ -1176,10 +1222,12 @@ protected void consumeStaticImportOnDemandDeclarationName() { this.restartRecovery = true; // used to avoid branching back into the regular automaton } } +@Override protected void consumeStaticInitializer() { super.consumeStaticInitializer(); popElement(K_METHOD_DELIMITER); } +@Override protected void consumeStaticOnly() { super.consumeStaticOnly(); pushOnElementStack(K_METHOD_DELIMITER); @@ -1198,6 +1246,7 @@ private void adjustBracket(int token) { break; } } +@Override protected void consumeToken(int token) { super.consumeToken(token); @@ -1253,6 +1302,7 @@ protected void consumeToken(int token) { this.previousIdentifierPtr = this.identifierPtr; } } +@Override protected void consumeTypeImportOnDemandDeclarationName() { // TypeImportOnDemandDeclarationName ::= 'import' Name '.' '*' /* push an ImportRef build from the last name @@ -1341,6 +1391,7 @@ protected void flushElementStack() { /* * Build specific type reference nodes in case the cursor is located inside the type reference */ +@Override protected TypeReference getTypeReference(int dim) { int index; @@ -1497,6 +1548,7 @@ protected TypeReference getAssistTypeReferenceForGenericType(int dim, int identi * qualified name reference, then create a CompletionOnQualifiedNameReference * instead. */ +@Override protected NameReference getUnspecifiedReferenceOptimized() { int completionIndex; @@ -1538,18 +1590,22 @@ protected NameReference getUnspecifiedReferenceOptimized() { this.lastCheckPoint = reference.sourceEnd + 1; return reference; } +@Override public void goForBlockStatementsopt() { super.goForBlockStatementsopt(); this.isFirst = true; } +@Override public void goForHeaders(){ super.goForHeaders(); this.isFirst = true; } +@Override public void goForCompilationUnit(){ super.goForCompilationUnit(); this.isFirst = true; } +@Override public void goForBlockStatementsOrCatchHeader() { super.goForBlockStatementsOrCatchHeader(); this.isFirst = true; @@ -1607,6 +1663,7 @@ protected int indexOfAssistIdentifier(boolean useGenericsStack){ // none of the awaiting identifiers is the completion one return -1; } +@Override public void initialize() { super.initialize(); flushAssistState(); @@ -1614,6 +1671,7 @@ public void initialize() { this.previousIdentifierPtr = -1; this.bracketDepth = 0; } +@Override public void initialize(boolean parsingCompilationUnit) { super.initialize(parsingCompilationUnit); flushAssistState(); @@ -1621,6 +1679,7 @@ public void initialize(boolean parsingCompilationUnit) { this.previousIdentifierPtr = -1; this.bracketDepth = 0; } +@Override public abstract void initializeScanner(); protected boolean isIndirectlyInsideFieldInitialization(){ int i = this.elementPtr; @@ -1649,6 +1708,7 @@ protected boolean isIndirectlyInsideMethod(){ } return false; } +@Override protected boolean isIndirectlyInsideLambdaExpression(){ int i = this.elementPtr; while (i > -1) { @@ -2009,6 +2069,7 @@ protected void popUntilElement(int kind){ /* * Prepares the state of the parser to go for BlockStatements. */ +@Override protected void prepareForBlockStatements() { this.nestedMethod[this.nestedType = 0] = 1; this.variablesCounter[this.nestedType] = 0; @@ -2079,6 +2140,7 @@ protected void pushOnElementStack(int kind, int info, Object objectInfo){ this.elementInfoStack[this.elementPtr] = info; this.elementObjectInfoStack[this.elementPtr] = objectInfo; } +@Override public void recoveryExitFromVariable() { if(this.currentElement != null && this.currentElement instanceof RecoveredField && !(this.currentElement instanceof RecoveredInitializer)) { @@ -2091,6 +2153,7 @@ public void recoveryExitFromVariable() { super.recoveryExitFromVariable(); } } +@Override public void recoveryTokenCheck() { RecoveredElement oldElement = this.currentElement; switch (this.currentToken) { @@ -2213,6 +2276,7 @@ protected int fallBackToSpringForward(Statement unused) { * Move checkpoint location, reset internal stacks and * decide which grammar goal is activated. */ +@Override protected int resumeAfterRecovery() { if (requireExtendedRecovery()) { if (this.unstackedAct == ERROR_ACTION) { diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.java index 7d60fa14c0..4ff9275e2b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.java @@ -34,6 +34,7 @@ public class AssistSourceField extends ResolvedSourceField { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } @@ -41,6 +42,7 @@ public class AssistSourceField extends ResolvedSourceField { /* (non-Javadoc) * @see org.eclipse.jdt.internal.core.SourceField#getKey() */ + @Override public String getKey() { if (this.uniqueKey == null) { Binding binding = (Binding) this.bindingCache.get(this); @@ -60,19 +62,23 @@ public class AssistSourceField extends ResolvedSourceField { return this.uniqueKey; } + @Override public boolean isResolved() { getKey(); return this.isResolved; } + @Override protected void toStringInfo(int tab, StringBuffer buffer, Object info,boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo && isResolved()); } + @Override public IAnnotation getAnnotation(String annotationName) { return new AssistAnnotation(this, annotationName, this.infoCache); } + @Override public IType getType(String typeName, int count) { AssistSourceType type = new AssistSourceType(this, typeName, this.bindingCache, this.infoCache); type.occurrenceCount = count; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.java index c84cbb74b4..d7c41e4351 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.java @@ -35,6 +35,7 @@ public class AssistSourceMethod extends ResolvedSourceMethod { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } @@ -42,6 +43,7 @@ public class AssistSourceMethod extends ResolvedSourceMethod { /* (non-Javadoc) * @see org.eclipse.jdt.internal.core.SourceMethod#getKey() */ + @Override public String getKey() { if (this.uniqueKey == null) { Binding binding = (Binding) this.bindingCache.get(this); @@ -61,25 +63,30 @@ public class AssistSourceMethod extends ResolvedSourceMethod { return this.uniqueKey; } + @Override public boolean isResolved() { getKey(); return this.isResolved; } + @Override protected void toStringInfo(int tab, StringBuffer buffer, Object info,boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo && isResolved()); } + @Override public IAnnotation getAnnotation(String annotationName) { return new AssistAnnotation(this, annotationName, this.infoCache); } + @Override public IType getType(String typeName, int count) { AssistSourceType type = new AssistSourceType(this, typeName, this.bindingCache, this.infoCache); type.occurrenceCount = count; return type; } + @Override public ITypeParameter getTypeParameter(String typeParameterName) { return new AssistTypeParameter(this, typeParameterName, this.infoCache); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.java index 8c324d9a31..1b79085c7d 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.java @@ -38,10 +38,12 @@ public class AssistSourceType extends ResolvedSourceType { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } + @Override public String getFullyQualifiedParameterizedName() throws JavaModelException { if (isResolved()) { return getFullyQualifiedParameterizedName(getFullyQualifiedName('.'), this.getKey()); @@ -52,6 +54,7 @@ public class AssistSourceType extends ResolvedSourceType { /* (non-Javadoc) * @see org.eclipse.jdt.internal.core.SourceType#getKey() */ + @Override public String getKey() { if (this.uniqueKey == null) { Binding binding = (Binding) this.bindingCache.get(this); @@ -71,41 +74,50 @@ public class AssistSourceType extends ResolvedSourceType { return this.uniqueKey; } + @Override public boolean isResolved() { getKey(); return this.isResolved; } + @Override protected void toStringInfo(int tab, StringBuffer buffer, Object info,boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo && isResolved()); } + @Override public IAnnotation getAnnotation(String annotationName) { return new AssistAnnotation(this, annotationName, this.infoCache); } + @Override public IField getField(String fieldName) { return new AssistSourceField(this, fieldName, this.bindingCache, this.infoCache); } + @Override public IInitializer getInitializer(int count) { return new AssistInitializer(this, count, this.bindingCache, this.infoCache); } + @Override public IMethod getMethod(String selector, String[] parameterTypeSignatures) { return new AssistSourceMethod(this, selector, parameterTypeSignatures, this.bindingCache, this.infoCache); } + @Override public IType getType(String typeName) { return new AssistSourceType(this, typeName, this.bindingCache, this.infoCache); } + @Override public IType getType(String typeName, int count) { AssistSourceType type = new AssistSourceType(this, typeName, this.bindingCache, this.infoCache); type.occurrenceCount = count; return type; } + @Override public ITypeParameter getTypeParameter(String typeParameterName) { return new AssistTypeParameter(this, typeParameterName, this.infoCache); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistTypeParameter.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistTypeParameter.java index 938a634182..5fa122bc59 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistTypeParameter.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistTypeParameter.java @@ -25,6 +25,7 @@ public class AssistTypeParameter extends TypeParameter { this.infoCache = infoCache; } + @Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { return this.infoCache.get(this); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java index 94faf8283a..250b4acb07 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java @@ -61,6 +61,7 @@ public abstract class Engine implements ITypeRequestor { /** * Add an additional binary type */ + @Override public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) { this.lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding, accessRestriction); } @@ -68,6 +69,7 @@ public abstract class Engine implements ITypeRequestor { /** * Add an additional compilation unit. */ + @Override public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit); @@ -87,6 +89,7 @@ public abstract class Engine implements ITypeRequestor { * Add additional source types (the first one is the requested type, the rest is formed by the * secondary types defined in the same compilation unit). */ + @Override public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding, AccessRestriction accessRestriction) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=479656 // In case of the requested type not being a member type (i.e. not being a top level type) diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.java index 211bc1a4da..22853a59ad 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.java @@ -32,6 +32,7 @@ public class SelectionJavadoc extends Javadoc { /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.Javadoc#print(int, java.lang.StringBuffer) */ + @Override public StringBuffer print(int indent, StringBuffer output) { super.print(indent, output); if (this.selectedNode != null) { @@ -127,6 +128,7 @@ public class SelectionJavadoc extends Javadoc { * * @throws SelectionNodeFound */ + @Override public void resolve(ClassScope scope) { internalResolve(scope); } @@ -137,6 +139,7 @@ public class SelectionJavadoc extends Javadoc { * * @throws SelectionNodeFound */ + @Override public void resolve(MethodScope scope) { internalResolve(scope); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java index 7c8fb62ad0..bec08fd88b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java @@ -39,6 +39,7 @@ public class SelectionJavadocParser extends JavadocParser { /* * Do not parse comment if selection is not included. */ + @Override public boolean checkDeprecation(int commentPtr) { this.selectionStart = ((SelectionParser)this.sourceParser).selectionStart; this.selectionEnd = ((SelectionParser)this.sourceParser).selectionEnd; @@ -58,6 +59,7 @@ public class SelectionJavadocParser extends JavadocParser { /* * Replace stored Javadoc node with specific selection one. */ + @Override protected boolean commentParse() { this.docComment = new SelectionJavadoc(this.javadocStart, this.javadocEnd); return super.commentParse(); @@ -66,6 +68,7 @@ public class SelectionJavadocParser extends JavadocParser { /* * Create argument expression and store it if it includes selection. */ + @Override protected Object createArgumentReference(char[] name, int dim, boolean isVarargs, Object typeRef, long[] dimPositions, long argNamePos) throws InvalidInputException { // Create argument as we may need it after Expression expression = (Expression) super.createArgumentReference(name, dim, isVarargs, typeRef, dimPositions, argNamePos); @@ -87,6 +90,7 @@ public class SelectionJavadocParser extends JavadocParser { * If so, create field reference, store it and abort comment parse. * Otherwise return null as we do not need this reference. */ + @Override protected Object createFieldReference(Object receiver) throws InvalidInputException { int start = (int) (this.identifierPositionStack[0] >>> 32); int end = (int) this.identifierPositionStack[0]; @@ -105,6 +109,7 @@ public class SelectionJavadocParser extends JavadocParser { * If so, create field reference, store it and abort comment parse. * Otherwise return null as we do not need this reference. */ + @Override protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException { int memberPtr = this.identifierLengthStack[0] - 1; // may be > 0 for inner class constructor reference int start = (int) (this.identifierPositionStack[memberPtr] >>> 32); @@ -124,6 +129,7 @@ public class SelectionJavadocParser extends JavadocParser { * If so, store it and abort comment parse. * Otherwise return null as we do not need this reference. */ + @Override protected Object createTypeReference(int primitiveToken) { // Need to create type ref in case it was needed by members TypeReference typeRef = (TypeReference) super.createTypeReference(primitiveToken); @@ -168,6 +174,7 @@ public class SelectionJavadocParser extends JavadocParser { * Push param reference and verify if it includes selection. * If so, store it and abort comment parse. */ + @Override protected boolean pushParamName(boolean isTypeParam) { if (super.pushParamName(isTypeParam)) { Expression expression = (Expression) this.astStack[this.astPtr--]; @@ -186,6 +193,7 @@ public class SelectionJavadocParser extends JavadocParser { /* * Store selected node into doc comment. */ + @Override protected void updateDocComment() { if (this.selectedNode instanceof Expression) { ((SelectionJavadoc) this.docComment).selectedNode = (Expression) this.selectedNode; @@ -197,6 +205,7 @@ public class SelectionJavadocParser extends JavadocParser { /* * Sets a flag to denote that selection has taken place on an inheritDoc tag */ + @Override protected void parseInheritDocTag() { if (this.tagSourceStart == this.selectionStart && this.tagSourceEnd == this.selectionEnd) this.inheritDocTagSelected = true; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java index 060585d665..6a5afd3558 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java @@ -28,12 +28,14 @@ public class SelectionOnArgumentName extends Argument { public SelectionOnArgumentName(char[] name , long posNom , TypeReference tr , int modifiers, boolean typeElided){ super(name, posNom, tr, modifiers, typeElided); } + @Override public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { super.bind(scope, typeBinding, used); throw new SelectionNodeFound(this.binding); } + @Override public StringBuffer print(int indent, StringBuffer output) { printIndent(indent, output); @@ -47,12 +49,14 @@ public class SelectionOnArgumentName extends Argument { return output.append('>'); } + @Override public void resolve(BlockScope scope) { super.resolve(scope); throw new SelectionNodeFound(this.binding); } + @Override public TypeBinding resolveForCatch(BlockScope scope) { super.resolveForCatch(scope); throw new SelectionNodeFound(this.binding); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java index a8a574073b..0ef38fb011 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java @@ -39,6 +39,7 @@ public class SelectionOnExplicitConstructorCall extends ExplicitConstructorCall super(accessMode); } + @Override public StringBuffer printStatement(int tab, StringBuffer output) { printIndent(tab, output); @@ -58,6 +59,7 @@ public class SelectionOnExplicitConstructorCall extends ExplicitConstructorCall return output.append(")>;"); //$NON-NLS-1$ } + @Override public void resolve(BlockScope scope) { super.resolve(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.java index 4e75655b15..64464081c9 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.java @@ -41,12 +41,14 @@ public class SelectionOnFieldReference extends FieldReference { super(source, pos); } + @Override public StringBuffer printExpression(int indent, StringBuffer output){ output.append("<SelectionOnFieldReference:"); //$NON-NLS-1$ return super.printExpression(0, output).append('>'); } + @Override public TypeBinding resolveType(BlockScope scope) { super.resolveType(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.java index a4838b0998..0e26de0c99 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.java @@ -22,6 +22,7 @@ public class SelectionOnFieldType extends FieldDeclaration { this.type = type; this.name = CharOperation.NO_CHAR; } + @Override public StringBuffer printStatement(int tab, StringBuffer output) { return this.type.print(tab, output).append(';'); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java index 10dcce34fd..8829332e6d 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java @@ -36,6 +36,7 @@ public class SelectionOnImportReference extends ImportReference { public SelectionOnImportReference(char[][] tokens , long[] positions, int modifiers) { super(tokens, positions, false, modifiers); } +@Override public StringBuffer print(int indent, StringBuffer output, boolean withOnDemand) { printIndent(indent, output).append("<SelectOnImport:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java index fbf92c45d8..79ec1e3fe5 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java @@ -20,12 +20,14 @@ public class SelectionOnLocalName extends LocalDeclaration{ super(name, sourceStart, sourceEnd); } + @Override public void resolve(BlockScope scope) { super.resolve(scope); throw new SelectionNodeFound(this.binding); } + @Override public StringBuffer printAsExpression(int indent, StringBuffer output) { printIndent(indent, output); output.append("<SelectionOnLocalName:"); //$NON-NLS-1$ @@ -38,6 +40,7 @@ public class SelectionOnLocalName extends LocalDeclaration{ return output.append('>'); } + @Override public StringBuffer printStatement(int indent, StringBuffer output) { printAsExpression(indent, output); return output.append(';'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.java index 71b3ce23a3..04a9846ac0 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.java @@ -76,6 +76,7 @@ public class SelectionOnMessageSend extends MessageSend { return methodBinding; } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<SelectOnMessageSend:"); //$NON-NLS-1$ @@ -90,6 +91,7 @@ public class SelectionOnMessageSend extends MessageSend { return output.append(")>"); //$NON-NLS-1$ } + @Override public TypeBinding resolveType(BlockScope scope) { TypeBinding type = super.resolveType(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java index 500f7c72d2..e394f6ff37 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java @@ -21,6 +21,7 @@ public class SelectionOnModuleReference extends ModuleReference { super(tokens, sourcePositions); } + @Override public ModuleBinding resolve(Scope scope) { ModuleBinding resolvedBinding = super.resolve(scope); if (resolvedBinding != null) { @@ -30,6 +31,7 @@ public class SelectionOnModuleReference extends ModuleReference { } } + @Override public StringBuffer print(int tab, StringBuffer output) { printIndent(tab, output).append("<SelectOnModuleReference:"); //$NON-NLS-1$ for (int i = 0; i < this.tokens.length; i++) { diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.java index b703dc3f0a..4e7cd64c92 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.java @@ -22,6 +22,7 @@ public class SelectionOnNameOfMemberValuePair extends MemberValuePair { super(token, sourceStart, sourceEnd, value); } + @Override public StringBuffer print(int indent, StringBuffer output) { output.append("<SelectOnName:"); //$NON-NLS-1$ output.append(this.name); @@ -29,6 +30,7 @@ public class SelectionOnNameOfMemberValuePair extends MemberValuePair { return output; } + @Override public void resolveTypeExpecting(BlockScope scope, TypeBinding requiredType) { super.resolveTypeExpecting(scope, requiredType); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java index 1457479114..b093270866 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java @@ -36,6 +36,7 @@ public class SelectionOnPackageReference extends ImportReference { public SelectionOnPackageReference(char[][] tokens , long[] positions) { super(tokens, positions, false, ClassFileConstants.AccDefault); } +@Override public StringBuffer print(int tab, StringBuffer output, boolean withOnDemand) { printIndent(tab, output).append("<SelectOnPackage:"); //$NON-NLS-1$ for (int i = 0; i < this.tokens.length; i++) { diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageVisibilityReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageVisibilityReference.java index a452b1301f..8c33e9515f 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageVisibilityReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageVisibilityReference.java @@ -34,6 +34,7 @@ public class SelectionOnPackageVisibilityReference extends ImportReference { super(tokens, positions, false, 0); } + @Override public StringBuffer print(int indent, StringBuffer output) { printIndent(indent, output).append("<SelectOnPackageVisibility:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedQualifiedTypeReference.java index ffe9b99e65..ffa416fbf6 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedQualifiedTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedQualifiedTypeReference.java @@ -31,6 +31,7 @@ public class SelectionOnParameterizedQualifiedTypeReference extends Parameterize this.typeArguments[length] = assistTypeArguments; } + @Override public TypeBinding resolveType(BlockScope scope, boolean checkBounds, int location) { super.resolveType(scope, checkBounds, location); //// removed unnecessary code to solve bug 94653 @@ -41,6 +42,7 @@ public class SelectionOnParameterizedQualifiedTypeReference extends Parameterize throw new SelectionNodeFound(this.resolvedType); } + @Override public TypeBinding resolveType(ClassScope scope, int location) { super.resolveType(scope, location); //// removed unnecessary code to solve bug 94653 @@ -51,6 +53,7 @@ public class SelectionOnParameterizedQualifiedTypeReference extends Parameterize throw new SelectionNodeFound(this.resolvedType); } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<SelectOnType:");//$NON-NLS-1$ int length = this.tokens.length; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedSingleTypeReference.java index 7be0d7a20e..91135f631d 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedSingleTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedSingleTypeReference.java @@ -23,16 +23,19 @@ public class SelectionOnParameterizedSingleTypeReference extends ParameterizedSi super(name, typeArguments, 0, pos); } + @Override public TypeBinding resolveType(BlockScope scope, boolean checkBounds, int location) { super.resolveType(scope, checkBounds, location); throw new SelectionNodeFound(this.resolvedType); } + @Override public TypeBinding resolveType(ClassScope scope, int location) { super.resolveType(scope, location); throw new SelectionNodeFound(this.resolvedType); } + @Override public StringBuffer printExpression(int indent, StringBuffer output){ output.append("<SelectOnType:");//$NON-NLS-1$ output.append(this.token); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java index 356be9424c..bc4dd09b7b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java @@ -50,6 +50,7 @@ public class SelectionOnQualifiedAllocationExpression extends QualifiedAllocatio super(anonymous); } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { if (this.enclosingInstance == null) output.append("<SelectOnAllocationExpression:"); //$NON-NLS-1$ @@ -59,6 +60,7 @@ public class SelectionOnQualifiedAllocationExpression extends QualifiedAllocatio return super.printExpression(indent, output).append('>'); } + @Override public TypeBinding resolveType(BlockScope scope) { super.resolveType(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java index 931710f143..76cb007a66 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java @@ -50,6 +50,7 @@ public SelectionOnQualifiedNameReference(char[][] previousIdentifiers, char[] se (int) (positions[0] >>> 32), (int) positions[positions.length - 1]); } +@Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<SelectOnName:"); //$NON-NLS-1$ @@ -59,6 +60,7 @@ public StringBuffer printExpression(int indent, StringBuffer output) { } return output.append('>'); } +@Override public TypeBinding resolveType(BlockScope scope) { // it can be a package, type, member type, local variable or field this.binding = scope.getBinding(this.tokens, this); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.java index e2277ec6ca..145242c536 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.java @@ -42,12 +42,14 @@ public class SelectionOnQualifiedSuperReference extends QualifiedSuperReference public SelectionOnQualifiedSuperReference(TypeReference name, int pos, int sourceEnd) { super(name, pos, sourceEnd); } +@Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<SelectOnQualifiedSuper:"); //$NON-NLS-1$ return super.printExpression(0, output).append('>'); } +@Override public TypeBinding resolveType(BlockScope scope) { TypeBinding binding = super.resolveType(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java index 75d7a0dcc8..341a814101 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java @@ -37,9 +37,11 @@ public SelectionOnQualifiedTypeReference(char[][] previousIdentifiers, char[] se CharOperation.arrayConcat(previousIdentifiers, selectionIdentifier), positions); } +@Override public void aboutToResolve(Scope scope) { getTypeBinding(scope.parent); // step up from the ClassScope } +@Override protected TypeBinding getTypeBinding(Scope scope) { // it can be a package, type or member type Binding binding = scope.getTypeOrPackage(this.tokens); @@ -61,6 +63,7 @@ protected TypeBinding getTypeBinding(Scope scope) { throw new SelectionNodeFound(binding); } +@Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<SelectOnType:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java index 5b2f8003f8..49f1a28244 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java @@ -25,6 +25,7 @@ public class SelectionOnReferenceExpressionName extends ReferenceExpression { super(scanner); } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<SelectionOnReferenceExpressionName:"); //$NON-NLS-1$ super.printExpression(indent, output); @@ -32,15 +33,18 @@ public class SelectionOnReferenceExpressionName extends ReferenceExpression { } // See SelectionScanner#scanIdentifierOrKeyword + @Override public boolean isConstructorReference() { return CharOperation.equals(this.selector, "new".toCharArray()); //$NON-NLS-1$ } // See SelectionScanner#scanIdentifierOrKeyword + @Override public boolean isMethodReference() { return !CharOperation.equals(this.selector, "new".toCharArray()); //$NON-NLS-1$ } + @Override public TypeBinding resolveType(BlockScope scope) { TypeBinding type = super.resolveType(scope); if (type == null || type instanceof ProblemReferenceBinding || type instanceof PolyTypeBinding) diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java index 369851e2cd..53d7b02c87 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java @@ -43,6 +43,7 @@ public class SelectionOnSingleNameReference extends SingleNameReference { public SelectionOnSingleNameReference(char[] source, long pos) { super(source, pos); } +@Override public TypeBinding resolveType(BlockScope scope) { if (this.actualReceiverType != null) { this.binding = scope.getField(this.actualReceiverType, this.token, this); @@ -76,6 +77,7 @@ public TypeBinding resolveType(BlockScope scope) { throw new SelectionNodeFound(this.binding); } +@Override public StringBuffer printExpression(int indent, StringBuffer output) { output.append("<SelectOnName:"); //$NON-NLS-1$ return super.printExpression(0, output).append('>'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java index 8109489c04..5c1290a506 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java @@ -35,9 +35,11 @@ public class SelectionOnSingleTypeReference extends SingleTypeReference { public SelectionOnSingleTypeReference(char[] source, long pos) { super(source, pos); } +@Override public void aboutToResolve(Scope scope) { getTypeBinding(scope.parent); // step up from the ClassScope } +@Override protected TypeBinding getTypeBinding(Scope scope) { // it can be a package, type or member type Binding binding = scope.getTypeOrPackage(new char[][] {this.token}); @@ -55,10 +57,12 @@ protected TypeBinding getTypeBinding(Scope scope) { } throw new SelectionNodeFound(binding); } +@Override public StringBuffer printExpression(int indent, StringBuffer output) { return output.append("<SelectOnType:").append(this.token).append('>');//$NON-NLS-1$ } +@Override public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) { super.resolveTypeEnclosing(scope, enclosingType); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java index 17a1aec9bd..b66d441f7a 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java @@ -42,11 +42,13 @@ public class SelectionOnSuperReference extends SuperReference { public SelectionOnSuperReference(int pos, int sourceEnd) { super(pos, sourceEnd); } +@Override public StringBuffer printExpression(int indent, StringBuffer output){ output.append("<SelectOnSuper:"); //$NON-NLS-1$ return super.printExpression(0, output).append('>'); } +@Override public TypeBinding resolveType(BlockScope scope) { TypeBinding binding = super.resolveType(scope); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java index 03e8737abd..1254f6a056 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java @@ -90,6 +90,7 @@ public SelectionParser(ProblemReporter problemReporter) { super(problemReporter); this.javadocParser.checkDocComment = true; } +@Override public char[] assistIdentifier(){ return ((SelectionScanner)this.scanner).selectionIdentifier; } @@ -217,6 +218,7 @@ private boolean checkRecoveredType() { } return false; } +@Override protected void classInstanceCreation(boolean hasClassBody) { // ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt @@ -278,6 +280,7 @@ protected void classInstanceCreation(boolean hasClassBody) { super.classInstanceCreation(hasClassBody); } } +@Override protected void consumeArrayCreationExpressionWithoutInitializer() { // ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs // ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs @@ -293,6 +296,7 @@ protected void consumeArrayCreationExpressionWithoutInitializer() { this.isOrphanCompletionNode = true; } } +@Override protected void consumeArrayCreationExpressionWithInitializer() { // ArrayCreationWithArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer @@ -307,30 +311,37 @@ protected void consumeArrayCreationExpressionWithInitializer() { this.isOrphanCompletionNode = true; } } +@Override protected void consumeCastExpressionLL1() { popElement(K_CAST_STATEMENT); super.consumeCastExpressionLL1(); } +@Override protected void consumeCastExpressionLL1WithBounds() { popElement(K_CAST_STATEMENT); super.consumeCastExpressionLL1WithBounds(); } +@Override protected void consumeCastExpressionWithGenericsArray() { popElement(K_CAST_STATEMENT); super.consumeCastExpressionWithGenericsArray(); } +@Override protected void consumeCastExpressionWithNameArray() { popElement(K_CAST_STATEMENT); super.consumeCastExpressionWithNameArray(); } +@Override protected void consumeCastExpressionWithPrimitiveType() { popElement(K_CAST_STATEMENT); super.consumeCastExpressionWithPrimitiveType(); } +@Override protected void consumeCastExpressionWithQualifiedGenericsArray() { popElement(K_CAST_STATEMENT); super.consumeCastExpressionWithQualifiedGenericsArray(); } +@Override protected void consumeCatchFormalParameter() { if (this.indexOfAssistIdentifier() < 0) { super.consumeCatchFormalParameter(); @@ -387,6 +398,7 @@ protected void consumeCatchFormalParameter() { this.listLength++; } } +@Override protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() { // ClassInstanceCreationExpression ::= Primary '.' 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt // ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt @@ -452,6 +464,7 @@ protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments( this.expressionStack[this.expressionPtr] = qae; qae.sourceStart = qae.enclosingInstance.sourceStart; } +@Override protected void consumeClassInstanceCreationExpressionWithTypeArguments() { // ClassInstanceCreationExpression ::= 'new' TypeArguments ClassType '(' ArgumentListopt ')' ClassBodyopt AllocationExpression alloc; @@ -509,6 +522,7 @@ protected void consumeClassInstanceCreationExpressionWithTypeArguments() { super.consumeClassInstanceCreationExpressionWithTypeArguments(); } } +@Override protected void consumeEnterAnonymousClassBody(boolean qualified) { // EnterAnonymousClassBody ::= $empty @@ -580,6 +594,7 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) { this.lastIgnoredToken = -1; } } +@Override protected void consumeEnterVariable() { // EnterVariable ::= $empty // do nothing by default @@ -596,6 +611,7 @@ protected void consumeEnterVariable() { } } +@Override protected void consumeExitVariableWithInitialization() { super.consumeExitVariableWithInitialization(); @@ -610,6 +626,7 @@ protected void consumeExitVariableWithInitialization() { triggerRecoveryUponLambdaClosure(variable, false); } +@Override protected void consumeFieldAccess(boolean isSuperAccess) { // FieldAccess ::= Primary '.' 'Identifier' // FieldAccess ::= 'super' '.' 'Identifier' @@ -641,6 +658,7 @@ protected void consumeFieldAccess(boolean isSuperAccess) { } this.isOrphanCompletionNode = true; } +@Override protected void consumeFormalParameter(boolean isVarArgs) { if (this.indexOfAssistIdentifier() < 0) { super.consumeFormalParameter(isVarArgs); @@ -734,22 +752,27 @@ protected void consumeFormalParameter(boolean isVarArgs) { this.listLength++; } } +@Override protected void consumeInsideCastExpression() { super.consumeInsideCastExpression(); pushOnElementStack(K_CAST_STATEMENT); } +@Override protected void consumeInsideCastExpressionLL1() { super.consumeInsideCastExpressionLL1(); pushOnElementStack(K_CAST_STATEMENT); } +@Override protected void consumeInsideCastExpressionLL1WithBounds() { super.consumeInsideCastExpressionLL1WithBounds(); pushOnElementStack(K_CAST_STATEMENT); } +@Override protected void consumeInsideCastExpressionWithQualifiedGenerics() { super.consumeInsideCastExpressionWithQualifiedGenerics(); pushOnElementStack(K_CAST_STATEMENT); } +@Override protected void consumeInstanceOfExpression() { if (indexOfAssistIdentifier() < 0) { super.consumeInstanceOfExpression(); @@ -760,6 +783,7 @@ protected void consumeInstanceOfExpression() { this.lastIgnoredToken = -1; } } +@Override protected void consumeInstanceOfExpressionWithName() { if (indexOfAssistIdentifier() < 0) { super.consumeInstanceOfExpressionWithName(); @@ -797,6 +821,7 @@ protected void consumeReferenceExpression(ReferenceExpression referenceExpressio super.consumeReferenceExpression(referenceExpression); } +@Override protected void consumeLocalVariableDeclarationStatement() { super.consumeLocalVariableDeclarationStatement(); @@ -813,18 +838,21 @@ protected void consumeLocalVariableDeclarationStatement() { this.restartRecovery = true; } } +@Override protected void consumeAssignment() { super.consumeAssignment(); if (this.selectionNodeFound) { this.restartRecovery = true; } } +@Override protected void consumeBlockStatement() { super.consumeBlockStatement(); if (this.selectionNodeFound) { this.restartRecovery = true; } } +@Override protected void consumeMarkerAnnotation(boolean isTypeAnnotation) { int index; @@ -876,6 +904,7 @@ protected void consumeMarkerAnnotation(boolean isTypeAnnotation) { pushOnExpressionStack(markerAnnotation); } } +@Override protected void consumeMemberValuePair() { if (this.indexOfAssistIdentifier() < 0) { super.consumeMemberValuePair(); @@ -897,6 +926,7 @@ protected void consumeMemberValuePair() { } +@Override protected void consumeMethodInvocationName() { // MethodInvocation ::= Name '(' ArgumentListopt ')' @@ -945,10 +975,12 @@ protected void consumeMethodInvocationName() { this.lastIgnoredToken = -1; } else { pushOnExpressionStack(new Expression(){ + @Override public TypeBinding resolveType(BlockScope scope) { constructorCall.resolve(scope); return null; } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { return output; } @@ -958,6 +990,7 @@ protected void consumeMethodInvocationName() { this.lastCheckPoint = constructorCall.sourceEnd + 1; this.isOrphanCompletionNode = true; } +@Override protected void consumeMethodInvocationPrimary() { //optimize the push/pop //MethodInvocation ::= Primary '.' 'Identifier' '(' ArgumentListopt ')' @@ -994,10 +1027,12 @@ protected void consumeMethodInvocationPrimary() { this.lastIgnoredToken = -1; } else { pushOnExpressionStack(new Expression(){ + @Override public TypeBinding resolveType(BlockScope scope) { constructorCall.resolve(scope); return null; } + @Override public StringBuffer printExpression(int indent, StringBuffer output) { return output; } @@ -1008,6 +1043,7 @@ protected void consumeMethodInvocationPrimary() { this.lastCheckPoint = constructorCall.sourceEnd + 1; this.isOrphanCompletionNode = true; } +@Override protected void consumeNormalAnnotation(boolean isTypeAnnotation) { int index; @@ -1067,6 +1103,7 @@ protected void consumeNormalAnnotation(boolean isTypeAnnotation) { pushOnExpressionStack(normalAnnotation); } } +@Override protected void consumeSingleMemberAnnotation(boolean isTypeAnnotation) { int index; @@ -1120,6 +1157,7 @@ protected void consumeSingleMemberAnnotation(boolean isTypeAnnotation) { pushOnExpressionStack(singleMemberAnnotation); } } +@Override protected void consumeStaticImportOnDemandDeclarationName() { // TypeImportOnDemandDeclarationName ::= 'import' 'static' Name '.' '*' /* push an ImportRef build from the last name @@ -1174,6 +1212,7 @@ protected void consumeStaticImportOnDemandDeclarationName() { this.restartRecovery = true; // used to avoid branching back into the regular automaton } } +@Override protected void consumeToken(int token) { super.consumeToken(token); @@ -1203,6 +1242,7 @@ protected void consumeToken(int token) { } } } +@Override protected void consumeTypeImportOnDemandDeclarationName() { // TypeImportOnDemandDeclarationName ::= 'import' Name '.' '*' /* push an ImportRef build from the last name @@ -1257,12 +1297,15 @@ protected void consumeTypeImportOnDemandDeclarationName() { this.restartRecovery = true; // used to avoid branching back into the regular automaton } } +@Override protected SelectionParser createSnapShotParser() { return new SelectionParser(this.problemReporter); } +@Override public ImportReference createAssistPackageVisibilityReference(char[][] tokens, long[] positions){ return new SelectionOnPackageVisibilityReference(tokens, positions); } +@Override public ImportReference createAssistImportReference(char[][] tokens, long[] positions, int mod){ return new SelectionOnImportReference(tokens, positions, mod); } @@ -1271,12 +1314,15 @@ public ModuleDeclaration createAssistModuleDeclaration(CompilationResult compila long[] positions) { return new SelectionOnModuleDeclaration(compilationResult, tokens, positions); } +@Override public ImportReference createAssistPackageReference(char[][] tokens, long[] positions){ return new SelectionOnPackageReference(tokens, positions); } +@Override protected JavadocParser createJavadocParser() { return new SelectionJavadocParser(this); } +@Override protected LocalDeclaration createLocalDeclaration(char[] assistName,int sourceStart,int sourceEnd) { if (this.indexOfAssistIdentifier() < 0) { return super.createLocalDeclaration(assistName, sourceStart, sourceEnd); @@ -1287,29 +1333,35 @@ protected LocalDeclaration createLocalDeclaration(char[] assistName,int sourceSt return local; } } +@Override public NameReference createQualifiedAssistNameReference(char[][] previousIdentifiers, char[] assistName, long[] positions){ return new SelectionOnQualifiedNameReference( previousIdentifiers, assistName, positions); } +@Override public TypeReference createQualifiedAssistTypeReference(char[][] previousIdentifiers, char[] assistName, long[] positions){ return new SelectionOnQualifiedTypeReference( previousIdentifiers, assistName, positions); } +@Override public TypeReference createParameterizedQualifiedAssistTypeReference( char[][] tokens, TypeReference[][] typeArguments, char[] assistname, TypeReference[] assistTypeArguments, long[] positions) { return new SelectionOnParameterizedQualifiedTypeReference(tokens, assistname, typeArguments, assistTypeArguments, positions); } +@Override public NameReference createSingleAssistNameReference(char[] assistName, long position) { return new SelectionOnSingleNameReference(assistName, position); } +@Override public TypeReference createSingleAssistTypeReference(char[] assistName, long position) { return new SelectionOnSingleTypeReference(assistName, position); } +@Override public TypeReference createParameterizedSingleAssistTypeReference(TypeReference[] typeArguments, char[] assistName, long position) { return new SelectionOnParameterizedSingleTypeReference(assistName, typeArguments, position); } @@ -1323,6 +1375,7 @@ public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, Compila selectionScanner.selectionEnd = end; return this.dietParse(sourceUnit, compilationResult); } +@Override protected NameReference getUnspecifiedReference(boolean rejectTypeAnnotations) { /* build a (unspecified) NameReference which may be qualified*/ @@ -1405,6 +1458,7 @@ protected NameReference getUnspecifiedReference(boolean rejectTypeAnnotations) { * qualified name reference, then create a CompletionOnQualifiedNameReference * instead. */ +@Override protected NameReference getUnspecifiedReferenceOptimized() { int index = indexOfAssistIdentifier(); @@ -1419,9 +1473,11 @@ protected NameReference getUnspecifiedReferenceOptimized() { } return reference; } +@Override public void initializeScanner(){ this.scanner = new SelectionScanner(this.options.sourceLevel); } +@Override public ReferenceExpression newReferenceExpression() { char[] selector = this.identifierStack[this.identifierPtr]; if (selector != assistIdentifier()){ @@ -1431,6 +1487,7 @@ public ReferenceExpression newReferenceExpression() { this.assistNode = referenceExpression; return referenceExpression; } +@Override protected MessageSend newMessageSend() { // '(' ArgumentListopt ')' // the arguments are on the expression stack @@ -1461,6 +1518,7 @@ protected MessageSend newMessageSend() { this.isOrphanCompletionNode = true; return messageSend; } +@Override protected MessageSend newMessageSendWithTypeArguments() { char[] selector = this.identifierStack[this.identifierPtr]; if (selector != assistIdentifier()){ @@ -1488,6 +1546,7 @@ protected MessageSend newMessageSendWithTypeArguments() { this.isOrphanCompletionNode = true; return messageSend; } +@Override public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit, CompilationResult compilationResult, int start, int end) { if (end == -1) return super.parse(sourceUnit, compilationResult, start, end); @@ -1508,6 +1567,7 @@ public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit, Compilation * Move checkpoint location, reset internal stacks and * decide which grammar goal is activated. */ +@Override protected int resumeAfterRecovery() { /* if reached assist node inside method body, but still inside nested type, @@ -1540,12 +1600,14 @@ protected int resumeAfterRecovery() { public void selectionIdentifierCheck(){ if (checkRecoveredType()) return; } +@Override public void setAssistIdentifier(char[] assistIdent){ ((SelectionScanner)this.scanner).selectionIdentifier = assistIdent; } /* * Update recovery state based on current parser/scanner state */ +@Override protected void updateRecoveryState() { /* expose parser state to recovery state */ @@ -1567,6 +1629,7 @@ protected void updateRecoveryState() { */ recoveryTokenCheck(); } +@Override protected Argument typeElidedArgument() { char[] selector = this.identifierStack[this.identifierPtr]; if (selector != assistIdentifier()){ @@ -1587,6 +1650,7 @@ protected Argument typeElidedArgument() { this.assistNode = argument; return argument; } +@Override public String toString() { String s = Util.EMPTY_STRING; s = s + "elementKindStack : int[] = {"; //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java index d08e534e9f..ea7d7caf61 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java @@ -32,10 +32,12 @@ public SelectionScanner(long sourceLevel) { super(false /*comment*/, false /*whitespace*/, false /*nls*/, sourceLevel, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); } +@Override protected boolean isAtAssistIdentifier() { return this.selectionStart == this.startPosition && this.selectionEnd == this.currentPosition - 1; } +@Override public char[] getCurrentIdentifierSource() { if (this.selectionIdentifier == null){ @@ -56,6 +58,7 @@ public char[] getCurrentIdentifierSource() { * In case we actually read a keyword which corresponds to the selected * range, we pretend we read an identifier. */ +@Override public int scanIdentifierOrKeyword() { int id = super.scanIdentifierOrKeyword(); |