Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/codeassist/org/eclipse/jdt')
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java766
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.java38
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java16
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java24
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java100
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java12
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExportReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java6
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java116
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java70
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java14
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleReference.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java6
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java16
37 files changed, 632 insertions, 632 deletions
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 7bc7af39b..e212ea304 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
@@ -282,7 +282,7 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.util.TypeAnalyzer;
public final class CompletionEngine
extends Engine
implements ISearchRequestor, TypeConstants , TerminalTokens , RelevanceConstants, SuffixConstants {
-
+
private static class AcceptedConstructor {
public int modifiers;
public char[] simpleTypeName;
@@ -297,9 +297,9 @@ public final class CompletionEngine
public boolean proposeType = false;
public boolean proposeConstructor = false;
public char[] fullyQualifiedName = null;
-
+
public boolean mustBeQualified = false;
-
+
public AcceptedConstructor(
int modifiers,
char[] simpleTypeName,
@@ -334,7 +334,7 @@ public final class CompletionEngine
return buffer.toString();
}
}
-
+
private static class AcceptedType {
public char[] packageName;
public char[] simpleTypeName;
@@ -371,7 +371,7 @@ public final class CompletionEngine
return buffer.toString();
}
}
-
+
public class CompletionProblemFactory extends DefaultProblemFactory {
private int lastErrorStart;
@@ -487,7 +487,7 @@ public final class CompletionEngine
this.checkProblems = false;
}
}
-
+
//{ObjectTeams: prefixes for callout-to-field:
private static final char[] SET = "set".toCharArray(); //$NON-NLS-1$
@@ -602,7 +602,7 @@ public final class CompletionEngine
result = CharOperation.replaceOnCopy(result, '/', '.');
return result;
}
-
+
private static char[] getTypeName(TypeReference typeReference) {
char[] typeName = CharOperation.concatWith(typeReference.getTypeName(), '.');
int dims = typeReference.dimensions();
@@ -615,10 +615,10 @@ public final class CompletionEngine
typeName[k+1] = ']';
}
}
-
+
return typeName;
}
-
+
private static boolean hasStaticMemberTypes(ReferenceBinding typeBinding, SourceTypeBinding invocationType, CompilationUnitScope unitScope) {
ReferenceBinding[] memberTypes = typeBinding.memberTypes();
int length = memberTypes == null ? 0 : memberTypes.length;
@@ -629,18 +629,18 @@ public final class CompletionEngine
} else if(invocationType == null && !memberType.canBeSeenBy(unitScope.fPackage)) {
continue next;
}
-
+
if ((memberType.modifiers & ClassFileConstants.AccStatic) != 0) {
return true;
}
}
return false;
}
-
+
private static boolean hasMemberTypesInEnclosingScope(SourceTypeBinding typeBinding, Scope scope) {
ReferenceBinding[] memberTypes = typeBinding.memberTypes();
int length = memberTypes == null ? 0 : memberTypes.length;
-
+
if (length > 0) {
MethodScope methodScope = scope.methodScope();
if (methodScope != null && !methodScope.isStatic) {
@@ -656,16 +656,16 @@ public final class CompletionEngine
}
return false;
}
-
+
public HashtableOfObject typeCache;
public int openedBinaryTypes; // used during InternalCompletionProposal#findConstructorParameterNames()
-
+
public static boolean DEBUG = false;
public static boolean PERF = false;
-
+
private static final char[] KNOWN_TYPE_WITH_UNKNOWN_CONSTRUCTORS = new char[]{};
private static final char[] KNOWN_TYPE_WITH_KNOWN_CONSTRUCTORS = new char[]{};
-
+
private static final char[] ARG = "arg".toCharArray(); //$NON-NLS-1$
private static final char[] ARG0 = "arg0".toCharArray(); //$NON-NLS-1$
private static final char[] ARG1 = "arg1".toCharArray(); //$NON-NLS-1$
@@ -675,12 +675,12 @@ public final class CompletionEngine
private static final char[][] ARGS2 = new char[][]{ARG0, ARG1};
private static final char[][] ARGS3 = new char[][]{ARG0, ARG1, ARG2};
private static final char[][] ARGS4 = new char[][]{ARG0, ARG1, ARG2, ARG3};
-
+
private final static int CHECK_CANCEL_FREQUENCY = 50;
-
+
// temporary constants to quickly disabled polish features if necessary
public final static boolean NO_TYPE_COMPLETION_ON_EMPTY_TOKEN = false;
-
+
private final static char[] ERROR_PATTERN = "*error*".toCharArray(); //$NON-NLS-1$
private final static char[] EXCEPTION_PATTERN = "*exception*".toCharArray(); //$NON-NLS-1$
private final static char[] SEMICOLON = new char[] { ';' };
@@ -696,11 +696,11 @@ public final class CompletionEngine
private final static char[] BASE = "base".toCharArray(); //$NON-NLS-1$
// SH}
private final static char[] DEFAULT_CONSTRUCTOR_SIGNATURE = "()V".toCharArray(); //$NON-NLS-1$
-
+
private final static char[] DOT = ".".toCharArray(); //$NON-NLS-1$
private final static char[] VARARGS = "...".toCharArray(); //$NON-NLS-1$
-
+
private final static char[] IMPORT = "import".toCharArray(); //$NON-NLS-1$
private final static char[] STATIC = "static".toCharArray(); //$NON-NLS-1$
private final static char[] ON_DEMAND = ".*".toCharArray(); //$NON-NLS-1$
@@ -710,11 +710,11 @@ public final class CompletionEngine
createTypeSignature(CharOperation.concatWith(JAVA_LANG, '.'), OBJECT);
private final static char[] JAVA_LANG_NAME =
CharOperation.concatWith(JAVA_LANG, '.');
-
+
private final static int NONE = 0;
private final static int SUPERTYPE = 1;
private final static int SUBTYPE = 2;
-
+
int expectedTypesPtr = -1;
TypeBinding[] expectedTypes = new TypeBinding[1];
int expectedTypesFilter;
@@ -726,9 +726,9 @@ public final class CompletionEngine
int forbbidenBindingsPtr = -1;
Binding[] forbbidenBindings = new Binding[1];
int uninterestingBindingsFilter; // only set when completing on an exception type
-
+
ImportBinding[] favoriteReferenceBindings;
-
+
boolean assistNodeIsClass;
boolean assistNodeIsEnum;
boolean assistNodeIsException;
@@ -742,9 +742,9 @@ public final class CompletionEngine
boolean assistNodeCanBeSingleMemberAnnotation = false;
boolean assistNodeIsInsideCase = false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346
boolean assistNodeIsString = false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343476
-
+
long targetedElement;
-
+
//{ObjectTeams:
private AbstractMethodMappingDeclaration currentMethodMapping;
private char seperator= 0; // char that should be inserted before the completion
@@ -782,7 +782,7 @@ public final class CompletionEngine
HashtableOfObject knownModules = new HashtableOfObject(10);
HashtableOfObject knownPkgs = new HashtableOfObject(10);
HashtableOfObject knownTypes = new HashtableOfObject(10);
-
+
/*
static final char[][] mainDeclarations =
new char[][] {
@@ -831,7 +831,7 @@ public final class CompletionEngine
BASE_TYPE_NAMES_WITHOUT_VOID[i] = BASE_TYPES[i].simpleName;
}
}
-
+
static final char[] classField = "class".toCharArray(); //$NON-NLS-1$
static final char[] lengthField = "length".toCharArray(); //$NON-NLS-1$
static final char[] cloneMethod = "clone".toCharArray(); //$NON-NLS-1$
@@ -873,7 +873,7 @@ public final class CompletionEngine
private int foundTypesCount;
private ObjectVector acceptedTypes;
-
+
private int foundConstructorsCount;
private ObjectVector acceptedConstructors;
@@ -922,7 +922,7 @@ public final class CompletionEngine
this.owner = owner;
this.monitor = monitor;
}
-
+
@Override
public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) {
if (!CharOperation.equals(sourceUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) {
@@ -934,7 +934,7 @@ public final class CompletionEngine
super.accept(sourceUnit, accessRestriction);
}
}
-
+
@Override
public void acceptConstructor(
int modifiers,
@@ -948,13 +948,13 @@ public final class CompletionEngine
int extraFlags,
String path,
AccessRestriction accessRestriction) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((this.foundConstructorsCount % (CHECK_CANCEL_FREQUENCY)) == 0) checkCancel();
this.foundConstructorsCount++;
-
+
if ((typeModifiers & ClassFileConstants.AccEnum) != 0) return;
-
+
if (this.options.checkDeprecation && (typeModifiers & ClassFileConstants.AccDeprecated) != 0) return;
if (this.options.checkVisibility) {
@@ -964,7 +964,7 @@ public final class CompletionEngine
if (this.currentPackageName == null) {
initializePackageCache();
}
-
+
if(!CharOperation.equals(packageName, this.currentPackageName)) return;
}
}
@@ -986,7 +986,7 @@ public final class CompletionEngine
break;
}
}
-
+
if(this.acceptedConstructors == null) {
this.acceptedConstructors = new ObjectVector();
}
@@ -1003,31 +1003,31 @@ public final class CompletionEngine
extraFlags,
accessibility));
}
-
+
private void acceptConstructors(Scope scope) {
final boolean DEFER_QUALIFIED_PROPOSALS = false;
-
+
this.checkCancel();
-
+
if(this.acceptedConstructors == null) return;
int length = this.acceptedConstructors.size();
if(length == 0) return;
-
+
HashtableOfObject onDemandFound = new HashtableOfObject();
-
+
ArrayList deferredProposals = null;
if (DEFER_QUALIFIED_PROPOSALS) {
deferredProposals = new ArrayList();
}
-
+
try {
next : for (int i = 0; i < length; i++) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((i % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
-
+
AcceptedConstructor acceptedConstructor = (AcceptedConstructor)this.acceptedConstructors.elementAt(i);
final int typeModifiers = acceptedConstructor.typeModifiers;
final char[] packageName = acceptedConstructor.packageName;
@@ -1039,11 +1039,11 @@ public final class CompletionEngine
final char[][] parameterNames = acceptedConstructor.parameterNames;
final int extraFlags = acceptedConstructor.extraFlags;
final int accessibility = acceptedConstructor.accessibility;
-
+
boolean proposeType = hasArrayTypeAsExpectedSuperTypes() || (extraFlags & ExtraFlags.HasNonPrivateStaticMemberTypes) != 0;
-
+
char[] fullyQualifiedName = CharOperation.concat(packageName, simpleTypeName, '.');
-
+
Object knownTypeKind = this.knownTypes.get(fullyQualifiedName);
if (knownTypeKind != null) {
if (knownTypeKind == KNOWN_TYPE_WITH_KNOWN_CONSTRUCTORS) {
@@ -1055,9 +1055,9 @@ public final class CompletionEngine
} else {
this.knownTypes.put(fullyQualifiedName, KNOWN_TYPE_WITH_UNKNOWN_CONSTRUCTORS);
}
-
+
boolean proposeConstructor = true;
-
+
if (this.options.checkVisibility) {
if((modifiers & ClassFileConstants.AccPublic) == 0) {
if((modifiers & ClassFileConstants.AccPrivate) != 0) {
@@ -1067,9 +1067,9 @@ public final class CompletionEngine
if (this.currentPackageName == null) {
initializePackageCache();
}
-
+
if(!CharOperation.equals(packageName, this.currentPackageName)) {
-
+
if((typeModifiers & ClassFileConstants.AccAbstract) == 0 ||
(modifiers & ClassFileConstants.AccProtected) == 0) {
if (!proposeType) continue next;
@@ -1079,16 +1079,16 @@ public final class CompletionEngine
}
}
}
-
+
acceptedConstructor.fullyQualifiedName = fullyQualifiedName;
acceptedConstructor.proposeType = proposeType;
acceptedConstructor.proposeConstructor = proposeConstructor;
-
-
+
+
if(!this.importCachesInitialized) {
initializeImportCaches();
}
-
+
for (int j = 0; j < this.importCacheCount; j++) {
char[][] importName = this.importsCache[j];
if(CharOperation.equals(simpleTypeName, importName[0])) {
@@ -1103,7 +1103,7 @@ public final class CompletionEngine
!CharOperation.equals(fullyQualifiedName, importName[1]),
scope);
}
-
+
if (proposeConstructor && !Flags.isEnum(typeModifiers)) {
boolean isQualified = !CharOperation.equals(fullyQualifiedName, importName[1]);
if (!isQualified) {
@@ -1148,7 +1148,7 @@ public final class CompletionEngine
false,
scope);
}
-
+
if (proposeConstructor && !Flags.isEnum(typeModifiers)) {
proposeConstructor(
simpleTypeName,
@@ -1231,7 +1231,7 @@ public final class CompletionEngine
true,
scope);
}
-
+
if (proposeConstructor && !Flags.isEnum(typeModifiers)) {
acceptedConstructor.mustBeQualified = true;
if (DEFER_QUALIFIED_PROPOSALS) {
@@ -1242,15 +1242,15 @@ public final class CompletionEngine
}
}
}
-
+
char[][] keys = onDemandFound.keyTable;
Object[] values = onDemandFound.valueTable;
int max = keys.length;
for (int i = 0; i < max; i++) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((i % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
-
+
if(keys[i] != null) {
AcceptedConstructor value = (AcceptedConstructor) values[i];
if(value != null) {
@@ -1287,7 +1287,7 @@ public final class CompletionEngine
value.mustBeQualified,
scope);
}
-
+
if (value.proposeConstructor && !Flags.isEnum(value.modifiers)) {
if (!value.mustBeQualified) {
proposeConstructor(
@@ -1316,16 +1316,16 @@ public final class CompletionEngine
}
}
}
-
+
if (DEFER_QUALIFIED_PROPOSALS) {
int size = deferredProposals.size();
for (int i = 0; i < size; i++) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((i % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
-
+
AcceptedConstructor deferredProposal = (AcceptedConstructor)deferredProposals.get(i);
-
+
if (deferredProposal.proposeConstructor) {
proposeConstructor(
deferredProposal.simpleTypeName,
@@ -1349,7 +1349,7 @@ public final class CompletionEngine
this.acceptedTypes = null; // reset
}
}
-
+
/**
* One result of the search consists of a new module.
*
@@ -1384,7 +1384,7 @@ public final class CompletionEngine
this.printDebug(proposal);
}
}
-
+
}
@Override
@@ -1393,7 +1393,7 @@ public final class CompletionEngine
if (this.knownPkgs.containsKey(packageName)) return;
if (!isValidPackageName(packageName)) return;
-
+
if (this.skipDefaultPackage &&
CharOperation.equals(packageName, CharOperation.NO_CHAR))
return;
@@ -1443,11 +1443,11 @@ public final class CompletionEngine
char[][] enclosingTypeNames,
int modifiers,
AccessRestriction accessRestriction) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((this.foundTypesCount % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
this.foundTypesCount++;
-
+
if (this.options.checkDeprecation && (modifiers & ClassFileConstants.AccDeprecated) != 0) return;
if (this.assistNodeIsExtendedType && (modifiers & ClassFileConstants.AccFinal) != 0) return;
if (this.assistNodeIsExtendedType && (modifiers & ExtraCompilerModifiers.AccRecord) != 0) return;
@@ -1479,7 +1479,7 @@ public final class CompletionEngine
break;
}
}
-
+
if (isForbidden(packageName, simpleTypeName, enclosingTypeNames)) {
return;
}
@@ -1492,7 +1492,7 @@ public final class CompletionEngine
private void acceptTypes(Scope scope) {
this.checkCancel();
-
+
if(this.acceptedTypes == null) return;
int length = this.acceptedTypes.size();
@@ -1500,20 +1500,20 @@ public final class CompletionEngine
if(length == 0) return;
HashtableOfObject onDemandFound = new HashtableOfObject();
-
+
try {
next : for (int i = 0; i < length; i++) {
-
+
// does not check cancellation for every types to avoid performance loss
if ((i % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
-
+
AcceptedType acceptedType = (AcceptedType)this.acceptedTypes.elementAt(i);
char[] packageName = acceptedType.packageName;
char[] simpleTypeName = acceptedType.simpleTypeName;
char[][] enclosingTypeNames = acceptedType.enclosingTypeNames;
int modifiers = acceptedType.modifiers;
int accessibility = acceptedType.accessibility;
-
+
char[] typeName;
char[] flatEnclosingTypeNames;
if(enclosingTypeNames == null || enclosingTypeNames.length == 0) {
@@ -1524,18 +1524,18 @@ public final class CompletionEngine
typeName = CharOperation.concat(flatEnclosingTypeNames, simpleTypeName, '.');
}
char[] fullyQualifiedName = CharOperation.concat(packageName, typeName, '.');
-
+
if (this.knownTypes.containsKey(fullyQualifiedName)) continue next;
-
+
this.knownTypes.put(fullyQualifiedName, KNOWN_TYPE_WITH_UNKNOWN_CONSTRUCTORS);
-
+
if (this.resolvingImports) {
if(this.compilerOptions.complianceLevel >= ClassFileConstants.JDK1_4 && packageName.length == 0) {
continue next; // import of default package is forbidden when compliance is 1.4 or higher
}
-
+
char[] completionName = this.insideQualifiedReference ? simpleTypeName : fullyQualifiedName;
-
+
if(this.resolvingStaticImports) {
if(enclosingTypeNames == null || enclosingTypeNames.length == 0) {
completionName = CharOperation.concat(completionName, new char[] { '.' });
@@ -1547,13 +1547,13 @@ public final class CompletionEngine
} else {
completionName = appendUnlessNextToken(completionName, new char[] {';'}, TerminalTokens.TokenNameSEMICOLON);
}
-
+
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
relevance += computeRelevanceForInterestingProposal(packageName, fullyQualifiedName);
relevance += computeRelevanceForRestrictions(accessibility);
relevance += computeRelevanceForCaseMatching(this.completionToken, simpleTypeName);
-
+
this.noProposal = false;
if(!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
createTypeProposal(packageName, typeName, modifiers, accessibility, completionName, relevance);
@@ -1562,7 +1562,7 @@ public final class CompletionEngine
if(!this.importCachesInitialized) {
initializeImportCaches();
}
-
+
for (int j = 0; j < this.importCacheCount; j++) {
char[][] importName = this.importsCache[j];
if(CharOperation.equals(typeName, importName[0])) {
@@ -1578,8 +1578,8 @@ public final class CompletionEngine
continue next;
}
}
-
-
+
+
if ((enclosingTypeNames == null || enclosingTypeNames.length == 0 ) && CharOperation.equals(this.currentPackageName, packageName)) {
proposeType(
packageName,
@@ -1593,15 +1593,15 @@ public final class CompletionEngine
continue next;
} else {
char[] fullyQualifiedEnclosingTypeOrPackageName = null;
-
+
AcceptedType foundType = null;
if((foundType = (AcceptedType)onDemandFound.get(simpleTypeName)) == null) {
for (int j = 0; j < this.onDemandImportCacheCount; j++) {
ImportBinding importBinding = this.onDemandImportsCache[j];
-
+
char[][] importName = importBinding.compoundName;
char[] importFlatName = CharOperation.concatWith(importName, '.');
-
+
if(fullyQualifiedEnclosingTypeOrPackageName == null) {
if(enclosingTypeNames != null && enclosingTypeNames.length != 0) {
fullyQualifiedEnclosingTypeOrPackageName =
@@ -1637,10 +1637,10 @@ public final class CompletionEngine
} else if(!foundType.mustBeQualified){
done : for (int j = 0; j < this.onDemandImportCacheCount; j++) {
ImportBinding importBinding = this.onDemandImportsCache[j];
-
+
char[][] importName = importBinding.compoundName;
char[] importFlatName = CharOperation.concatWith(importName, '.');
-
+
if(fullyQualifiedEnclosingTypeOrPackageName == null) {
if(enclosingTypeNames != null && enclosingTypeNames.length != 0) {
fullyQualifiedEnclosingTypeOrPackageName =
@@ -1678,7 +1678,7 @@ public final class CompletionEngine
}
}
}
-
+
char[][] keys = onDemandFound.keyTable;
Object[] values = onDemandFound.valueTable;
int max = keys.length;
@@ -1703,7 +1703,7 @@ public final class CompletionEngine
this.acceptedTypes = null; // reset
}
}
-
+
private char[] appendUnlessNextToken(char[] completionName, char[] suffix, int nextToken) {
if (this.source == null)
return CharOperation.concat(completionName, suffix);
@@ -2132,7 +2132,7 @@ public final class CompletionEngine
this.source = sourceUnit.getContents();
this.checkCancel();
-
+
// for now until we can change the UI.
CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit);
CompilationUnitDeclaration parsedUnit = this.parser.dietParse(sourceUnit, result, this.actualCompletionPosition);
@@ -2154,7 +2154,7 @@ public final class CompletionEngine
if(!this.requestor.isIgnored(CompletionProposal.MODULE_DECLARATION)) {
proposeModuleName(parsedUnit);
}
- debugPrintf();
+ debugPrintf();
return;
}
if (this.moduleDeclaration instanceof CompletionOnKeywordModuleDeclaration) {
@@ -2702,7 +2702,7 @@ public final class CompletionEngine
this.requestor.endReporting();
}
}
-
+
private void completionOnBranchStatementLabel(ASTNode astNode) {
if (!this.requestor.isIgnored(CompletionProposal.LABEL_REF)) {
CompletionOnBranchStatementLabel label = (CompletionOnBranchStatementLabel) astNode;
@@ -2710,7 +2710,7 @@ public final class CompletionEngine
findLabels(this.completionToken, label.possibleLabels);
}
}
-
+
private void completionOnClassLiteralAccess(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.FIELD_REF)) {
CompletionOnClassLiteralAccess access = (CompletionOnClassLiteralAccess) astNode;
@@ -2726,7 +2726,7 @@ public final class CompletionEngine
false);
}
}
-
+
private void completionOnExplicitConstructorCall(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) {
setSourceAndTokenRange(astNode.sourceStart, astNode.sourceEnd, false);
@@ -2744,7 +2744,7 @@ public final class CompletionEngine
false);
}
}
-
+
private void completionOnFieldName(ASTNode astNode, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) {
CompletionOnFieldName field = (CompletionOnFieldName) astNode;
@@ -2757,18 +2757,18 @@ public final class CompletionEngine
this.completionToken = field.realName;
-
+
int kind =
- (field.modifiers & ClassFileConstants.AccStatic) == 0 ?
+ (field.modifiers & ClassFileConstants.AccStatic) == 0 ?
InternalNamingConventions.VK_INSTANCE_FIELD :
- (field.modifiers & ClassFileConstants.AccFinal) == 0 ?
+ (field.modifiers & ClassFileConstants.AccFinal) == 0 ?
InternalNamingConventions.VK_STATIC_FIELD :
InternalNamingConventions.VK_STATIC_FINAL_FIELD;
-
+
findVariableNames(field.realName, field.type, excludeNames, null, kind);
}
}
-
+
private void completionOnFieldType(ASTNode astNode, Scope scope) {
CompletionOnFieldType field = (CompletionOnFieldType) astNode;
CompletionOnSingleTypeReference type = (CompletionOnSingleTypeReference) field.type;
@@ -2808,7 +2808,7 @@ public final class CompletionEngine
//TODO
private void completionOnJavadocAllocationExpression(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
// setSourceRange(astNode.sourceStart, astNode.sourceEnd, false);
-
+
CompletionOnJavadocAllocationExpression allocExpression = (CompletionOnJavadocAllocationExpression) astNode;
this.javadocTagPosition = allocExpression.tagSourceStart;
int rangeStart = astNode.sourceStart;
@@ -3022,14 +3022,14 @@ public final class CompletionEngine
findJavadocParamNames(paramRef.token, paramRef.missingParams, true);
}
}
-
+
private void completionOnKeyword(ASTNode astNode) {
if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
CompletionOnKeyword keyword = (CompletionOnKeyword)astNode;
findKeywords(keyword.getToken(), keyword.getPossibleKeywords(), false, false);
}
}
-
+
private void completionOnLocalOrArgumentName(ASTNode astNode, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) {
LocalDeclaration variable = (LocalDeclaration) astNode;
@@ -3062,7 +3062,7 @@ public final class CompletionEngine
findVariableNames(this.completionToken, variable.type, discouragedNames, forbiddenNames, kind);
}
}
-
+
private void completionOnMarkerAnnotationName(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
CompletionOnMarkerAnnotationName annot = (CompletionOnMarkerAnnotationName) astNode;
@@ -3149,7 +3149,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnMemberAccess(ASTNode astNode, ASTNode enclosingNode, Binding qualifiedBinding,
Scope scope, boolean insideTypeAnnotation) {
this.insideQualifiedReference = true;
@@ -3208,9 +3208,9 @@ public final class CompletionEngine
-1);
if (!superCall) {
-
+
checkCancel();
-
+
findFieldsAndMethodsFromCastedReceiver(
enclosingNode,
qualifiedBinding,
@@ -3224,7 +3224,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnMemberValueName(ASTNode astNode, ASTNode astNodeParent, Scope scope,
boolean insideTypeAnnotation) {
CompletionOnMemberValueName memberValuePair = (CompletionOnMemberValueName) astNode;
@@ -3274,7 +3274,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnMessageSend(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
setSourceAndTokenRange(astNode.sourceStart, astNode.sourceEnd, false);
@@ -3286,9 +3286,9 @@ public final class CompletionEngine
ObjectVector methodsFound = new ObjectVector();
findImplicitMessageSends(this.completionToken, argTypes, scope, messageSend, scope, methodsFound);
-
+
checkCancel();
-
+
findLocalMethodsFromStaticImports(
this.completionToken,
scope,
@@ -3322,7 +3322,7 @@ public final class CompletionEngine
-1);
}
}
-
+
private void completionOnMessageSendName(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) {
CompletionOnMessageSendName messageSend = (CompletionOnMessageSendName) astNode;
@@ -3374,7 +3374,7 @@ public final class CompletionEngine
this.insideQualifiedReference = true;
this.completionToken = referenceExpression.selector;
boolean onlyStatic = false;
-
+
TypeBinding receiverType = (TypeBinding) qualifiedBinding;
if (receiverType != null && receiverType instanceof ReferenceBinding) {
setSourceAndTokenRange(referenceExpression.nameSourceStart, referenceExpression.sourceEnd);
@@ -3407,7 +3407,7 @@ public final class CompletionEngine
}
}
-
+
private void completionOnMethodName(ASTNode astNode, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) {
CompletionOnMethodName method = (CompletionOnMethodName) astNode;
@@ -3422,18 +3422,18 @@ public final class CompletionEngine
this.completionToken = method.selector;
-
+
int kind =
- (method.modifiers & ClassFileConstants.AccStatic) == 0 ?
+ (method.modifiers & ClassFileConstants.AccStatic) == 0 ?
InternalNamingConventions.VK_INSTANCE_FIELD :
- (method.modifiers & ClassFileConstants.AccFinal) == 0 ?
+ (method.modifiers & ClassFileConstants.AccFinal) == 0 ?
InternalNamingConventions.VK_STATIC_FIELD :
InternalNamingConventions.VK_STATIC_FINAL_FIELD;
-
+
findVariableNames(this.completionToken, method.returnType, excludeNames, null, kind);
}
}
-
+
private void completionOnMethodReturnType(ASTNode astNode, Scope scope) {
CompletionOnMethodReturnType method = (CompletionOnMethodReturnType) astNode;
SingleTypeReference type = (CompletionOnSingleTypeReference) method.returnType;
@@ -3464,7 +3464,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnParameterizedQualifiedTypeReference(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding, Scope scope) {
if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
CompletionOnParameterizedQualifiedTypeReference ref = (CompletionOnParameterizedQualifiedTypeReference) astNode;
@@ -3503,9 +3503,9 @@ public final class CompletionEngine
(BlockScope)scope,
typesFound);
}
-
+
checkCancel();
-
+
findMemberTypes(
this.completionToken,
(ReferenceBinding) qualifiedBinding,
@@ -3528,7 +3528,7 @@ public final class CompletionEngine
return false;
if (astNodeParent instanceof TypeDeclaration) {
TypeDeclaration typeDeclaration = (TypeDeclaration) astNodeParent;
- return (typeDeclaration.superclass == astNode);
+ return (typeDeclaration.superclass == astNode);
} else if (astNodeParent instanceof TypeParameter) {
TypeParameter typeParameter = (TypeParameter) astNodeParent;
return (typeParameter.type == astNode);
@@ -3538,7 +3538,7 @@ public final class CompletionEngine
}
return false;
}
-
+
private boolean assistNodeIsInterfaceExcludingAnnotation(ASTNode astNode, ASTNode astNodeParent) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310423, don't propose annotations for implements.
if (astNodeParent == null)
@@ -3554,9 +3554,9 @@ public final class CompletionEngine
}
return false;
}
-
+
private boolean assistNodeIsInsideCase(ASTNode astNode, ASTNode astNodeParent) {
- // To find whether we're completing inside the case expression in a
+ // To find whether we're completing inside the case expression in a
// switch case construct (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346)
if (astNodeParent instanceof SwitchStatement) {
CaseStatement[] cases = ((SwitchStatement) astNodeParent).cases;
@@ -3578,7 +3578,7 @@ public final class CompletionEngine
TypeBinding[] argTypes = computeTypes(allocExpression.arguments);
ReferenceBinding ref = (ReferenceBinding) qualifiedBinding;
-
+
if (ref.problemId() == ProblemReasons.NotFound) {
findConstructorsFromMissingType(
allocExpression.type,
@@ -3600,9 +3600,9 @@ public final class CompletionEngine
null,
false);
}
-
+
checkCancel();
-
+
if (!this.requestor.isIgnored(CompletionProposal.ANONYMOUS_CLASS_DECLARATION)
&& !ref.isFinal()
&& !ref.isEnum()){
@@ -3618,7 +3618,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnQualifiedNameReference(ASTNode astNode, ASTNode enclosingNode, Binding qualifiedBinding,
Scope scope, boolean insideTypeAnnotation) {
this.insideQualifiedReference = true;
@@ -3626,7 +3626,7 @@ public final class CompletionEngine
(CompletionOnQualifiedNameReference) astNode;
this.completionToken = ref.completionIdentifier;
long completionPosition = ref.sourcePositions[ref.sourcePositions.length - 1];
-
+
if (qualifiedBinding.problemId() == ProblemReasons.NotFound) {
setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition);
// complete field members with missing fields type
@@ -3644,9 +3644,9 @@ public final class CompletionEngine
boolean foundSomeFields = findFieldsAndMethodsFromMissingFieldType(ref.tokens[0], scope, ref, insideTypeAnnotation);
if (!foundSomeFields) {
-
+
checkCancel();
-
+
findMembersFromMissingType(
ref.tokens[0],
ref.sourcePositions[0],
@@ -3681,7 +3681,7 @@ public final class CompletionEngine
null,
-1,
-1);
-
+
checkCancel();
findFieldsAndMethodsFromCastedReceiver(
@@ -3755,7 +3755,7 @@ public final class CompletionEngine
findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope);
}
}
-
+
private void completionOnQualifiedTypeReference(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding,
Scope scope) {
this.insideQualifiedReference = true;
@@ -3770,7 +3770,7 @@ public final class CompletionEngine
this.assistNodeIsSuperType = ref.isSuperType();
this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent);
this.assistNodeIsInterfaceExcludingAnnotation = assistNodeIsInterfaceExcludingAnnotation(astNode, astNodeParent);
-
+
this.completionToken = ref.completionIdentifier;
long completionPosition = ref.sourcePositions[ref.tokens.length];
@@ -3800,7 +3800,7 @@ public final class CompletionEngine
(BlockScope)scope,
typesFound);
}
-
+
checkCancel();
findMemberTypes(
@@ -3824,7 +3824,7 @@ public final class CompletionEngine
findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope);
}
}
-
+
private void completionOnProvidesInterfacesQualifiedTypeReference(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding, Scope scope) {
// TODO: Filter the results wrt accessibility and add relevance to the results.
completionOnQualifiedTypeReference(astNode, astNodeParent, qualifiedBinding, scope);
@@ -3877,9 +3877,9 @@ public final class CompletionEngine
(BlockScope)scope,
alreadyDefinedName);
}
-
+
checkCancel();
-
+
findVariablesAndMethods(
this.completionToken,
scope,
@@ -3887,13 +3887,13 @@ public final class CompletionEngine
scope,
insideTypeAnnotation,
singleNameReference.isInsideAnnotationAttribute);
-
+
//{ObjectTeams: following analyses don't apply to base/tsuper calls:
if (isBaseAccess(singleNameReference) || isTSuperAccess(singleNameReference))
return;
// SH}
checkCancel();
-
+
// can be the start of a qualified type name
findTypesAndPackages(this.completionToken, scope, true, false, new ObjectVector());
if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
@@ -3914,7 +3914,7 @@ public final class CompletionEngine
}
}
}
-
+
private void completionOnSingleTypeReference(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding, Scope scope) {
CompletionOnSingleTypeReference singleRef = (CompletionOnSingleTypeReference) astNode;
@@ -3931,7 +3931,7 @@ public final class CompletionEngine
this.assistNodeIsSuperType = singleRef.isSuperType();
this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent);
this.assistNodeIsInterfaceExcludingAnnotation = assistNodeIsInterfaceExcludingAnnotation(astNode, astNodeParent);
-
+
// can be the start of a qualified type name
if (qualifiedBinding == null) {
if (this.completionToken.length == 0 &&
@@ -3950,9 +3950,9 @@ public final class CompletionEngine
(BlockScope)scope,
typesFound);
}
-
+
checkCancel();
-
+
findTypesAndPackages(this.completionToken, scope, this.assistNodeIsConstructor, false, typesFound);
}
} else if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
@@ -4328,13 +4328,13 @@ public final class CompletionEngine
// completing inside the diamond
if (this.parser.enclosingNode instanceof AbstractVariableDeclaration) {
AbstractVariableDeclaration abstractVariableDeclaration = (AbstractVariableDeclaration) this.parser.enclosingNode;
- expected = abstractVariableDeclaration.initialization != null ? abstractVariableDeclaration.initialization.expectedType() : null;
+ expected = abstractVariableDeclaration.initialization != null ? abstractVariableDeclaration.initialization.expectedType() : null;
} else {
ReturnStatement returnStatement = (ReturnStatement) this.parser.enclosingNode;
if (returnStatement.expression != null) {
expected = returnStatement.expression.expectedType();
}
- }
+ }
addExpectedType(expected, scope);
} else {
TypeVariableBinding[] typeVariables = ((ReferenceBinding)ref.resolvedType).typeVariables();
@@ -4342,7 +4342,7 @@ public final class CompletionEngine
if(typeVariables != null && typeVariables.length >= length) {
int index = length - 1;
while(index > -1 && ref.typeArguments[index] != node) index--;
-
+
TypeBinding bound = typeVariables[index].firstBound;
addExpectedType(bound == null ? scope.getJavaLangObject() : bound, scope);
}
@@ -4477,7 +4477,7 @@ public final class CompletionEngine
// type if we are completing inside if(), for (; ;), while() and do while()
} else if (parent instanceof WhileStatement) { // covers both while and do-while loops
addExpectedType(TypeBinding.BOOLEAN, scope);
- } else if (parent instanceof IfStatement) {
+ } else if (parent instanceof IfStatement) {
addExpectedType(TypeBinding.BOOLEAN, scope);
} else if (parent instanceof AssertStatement) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=274466
@@ -4486,7 +4486,7 @@ public final class CompletionEngine
if (assertStatement.assertExpression == node) {
addExpectedType(TypeBinding.BOOLEAN, scope);
}
- } else if (parent instanceof ForStatement) { // astNodeParent set to ForStatement only for the condition
+ } else if (parent instanceof ForStatement) { // astNodeParent set to ForStatement only for the condition
addExpectedType(TypeBinding.BOOLEAN, scope);
// Expected types for javadoc
@@ -4771,7 +4771,7 @@ public final class CompletionEngine
}
return 0;
}
-
+
private int computeRelevanceForConstructor() {
if (this.assistNodeIsConstructor) {
return R_CONSTRUCTOR;
@@ -4837,10 +4837,10 @@ public final class CompletionEngine
if(this.expectedTypes != null && proposalType != null) {
int relevance = 0;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=271296
- // If there is at least one expected type, then void proposal types attract a degraded relevance.
+ // If there is at least one expected type, then void proposal types attract a degraded relevance.
if (proposalType == TypeBinding.VOID && this.expectedTypesPtr >=0) {
return R_VOID;
- }
+ }
for (int i = 0; i <= this.expectedTypesPtr; i++) {
if((this.expectedTypesFilter & SUBTYPE) != 0
&& (proposalType.erasure().isCompatibleWith(this.expectedTypes[i].erasure()))) {
@@ -4906,7 +4906,7 @@ public final class CompletionEngine
}
return R_INTERESTING;
}
-
+
private int computeRelevanceForInterestingProposal(char[] givenPkgName, char[] fullTypeName) {
for (int i = 0; i <= this.uninterestingBindingsPtr; i++) {
if (this.uninterestingBindings[i] instanceof TypeBinding) {
@@ -4971,7 +4971,7 @@ public final class CompletionEngine
}
return 0;
}
-
+
private int computeRelevanceForFinal(boolean onlyFinal, boolean isFinal) {
if (onlyFinal && isFinal) {
return R_FINAL;
@@ -5077,7 +5077,7 @@ public final class CompletionEngine
}
}
}
-
+
}
}
}
@@ -5227,7 +5227,7 @@ public final class CompletionEngine
InternalCompletionProposal proposal = createProposal(CompletionProposal.OVERRIDE_ROLE_DECLARATION, this.actualCompletionPosition);
proposal.setDeclarationSignature(getSignature(superTeam));
proposal.setDeclarationKey(superTeam.computeUniqueKey());
- proposal.setSignature(roleTypeSignature);
+ proposal.setSignature(roleTypeSignature);
// proposal.setKey(superRole.getKey().toCharArray()); // FIXME(SH): unused?
proposal.setDeclarationPackageName(superTeam.qualifiedPackageName());
proposal.setDeclarationTypeName(superTeam.qualifiedSourceName());
@@ -5243,7 +5243,7 @@ public final class CompletionEngine
}
}
}
-
+
private void createRole(char[] superRoleName, int modifiers, StringBuffer completion) {
//// Modifiers
if(modifiers != ClassFileConstants.AccDefault){
@@ -5602,16 +5602,16 @@ public final class CompletionEngine
int[] missingElementsStarts,
int[] missingElementsEnds,
boolean missingElementsHaveProblems) {
-
+
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
relevance += computeRelevanceForInterestingProposal(currentType);
relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);
-
+
if (missingElements != null) {
relevance += computeRelevanceForMissingElements(missingElementsHaveProblems);
}
-
+
//{ObjectTeams: other parts of completion prefer role interfaces, but here we need to go back to the role class:
if (currentType.isSynthInterface()) {
currentType = currentType.roleModel.getClassPartBinding();
@@ -5654,7 +5654,7 @@ public final class CompletionEngine
char[] completion = CharOperation.NO_CHAR;
char[] typeCompletion = null;
if (!exactMatch) {
- typeCompletion =
+ typeCompletion =
isQualified ?
CharOperation.concat(currentType.qualifiedPackageName(), currentType.qualifiedSourceName(), '.') :
currentType.sourceName();
@@ -5672,7 +5672,7 @@ public final class CompletionEngine
if(!isIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF)) {
char[] packageName = currentType.isLocalType() ? null : currentType.qualifiedPackageName();
char[] typeName = currentType.qualifiedSourceName();
-
+
InternalCompletionProposal proposal = createProposal(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, this.actualCompletionPosition);
proposal.setDeclarationSignature(getSignature(currentType));
proposal.setDeclarationKey(currentType.computeUniqueKey());
@@ -5691,7 +5691,7 @@ public final class CompletionEngine
//proposal.setPackageName(null);
//proposal.setTypeName(null);
proposal.setName(currentType.sourceName());
-
+
InternalCompletionProposal typeProposal = createProposal(CompletionProposal.TYPE_REF, this.actualCompletionPosition);
typeProposal.nameLookup = this.nameEnvironment.nameLookup;
typeProposal.completionEngine = this;
@@ -5705,7 +5705,7 @@ public final class CompletionEngine
typeProposal.setTokenRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setRelevance(relevance);
proposal.setRequiredProposals( new CompletionProposal[]{typeProposal});
-
+
proposal.setCompletion(completion);
proposal.setFlags(Flags.AccPublic);
proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset);
@@ -5850,7 +5850,7 @@ public final class CompletionEngine
}
}
}
-
+
void findConstructors(
ReferenceBinding currentType,
TypeBinding[] argTypes,
@@ -5861,16 +5861,16 @@ public final class CompletionEngine
int[] missingElementsStarts,
int[] missingElementsEnds,
boolean missingElementsHaveProblems) {
-
+
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
relevance += computeRelevanceForInterestingProposal();
relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);
-
+
if (missingElements != null) {
relevance += computeRelevanceForMissingElements(missingElementsHaveProblems);
}
-
+
findConstructors(
currentType,
argTypes,
@@ -5885,8 +5885,8 @@ public final class CompletionEngine
false,
relevance);
}
-
-
+
+
private void findConstructorsFromMissingType(
TypeReference typeRef,
final TypeBinding[] argTypes,
@@ -5918,9 +5918,9 @@ public final class CompletionEngine
missingElementsEnds,
hasProblems);
}
-
+
checkCancel();
-
+
if (!isIgnored(CompletionProposal.ANONYMOUS_CLASS_DECLARATION, missingElements != null)
&& !ref.isFinal()
&& !ref.isEnum()){
@@ -5939,7 +5939,7 @@ public final class CompletionEngine
};
missingTypesConverter.guess(typeRef, scope, substitutionRequestor);
}
-
+
private void findConstructors(
ReferenceBinding currentType,
TypeBinding[] argTypes,
@@ -6010,11 +6010,11 @@ public final class CompletionEngine
char[][] parameterNames = findMethodParameterNames(constructor,parameterTypeNames);
char[] completion = CharOperation.NO_CHAR;
-
+
if(forAnonymousType){
char[] typeCompletion = null;
if (!exactMatch) {
- typeCompletion =
+ typeCompletion =
isQualified ?
CharOperation.concat(currentType.qualifiedPackageName(), currentType.qualifiedSourceName(), '.') :
currentType.sourceName();
@@ -6026,13 +6026,13 @@ public final class CompletionEngine
completion = new char[] { '(', ')' };
}
}
-
+
this.noProposal = false;
if (!exactMatch) {
if(!isIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF)) {
char[] packageName = currentType.isLocalType() ? null : currentType.qualifiedPackageName();
char[] typeName = currentType.qualifiedSourceName();
-
+
InternalCompletionProposal proposal = createProposal(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, this.actualCompletionPosition);
proposal.setBinding(constructor);
proposal.setDeclarationSignature(getSignature(currentType));
@@ -6050,7 +6050,7 @@ public final class CompletionEngine
//proposal.setPackageName(null);
//proposal.setTypeName(null);
proposal.setName(currentType.sourceName());
-
+
InternalCompletionProposal typeProposal = createProposal(CompletionProposal.TYPE_REF, this.actualCompletionPosition);
typeProposal.nameLookup = this.nameEnvironment.nameLookup;
typeProposal.completionEngine = this;
@@ -6064,7 +6064,7 @@ public final class CompletionEngine
typeProposal.setTokenRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setRelevance(relevance);
proposal.setRequiredProposals( new CompletionProposal[]{typeProposal});
-
+
proposal.setCompletion(completion);
proposal.setFlags(constructor.modifiers);
proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset);
@@ -6172,11 +6172,11 @@ public final class CompletionEngine
}
} else {
if (!exactMatch) {
- typeCompletion =
+ typeCompletion =
isQualified ?
CharOperation.concat(currentType.qualifiedPackageName(), currentType.qualifiedSourceName(), '.') :
currentType.sourceName();
-
+
if (this.source != null
&& this.source.length > this.endPosition
&& this.source[this.endPosition] == '(') {
@@ -6209,7 +6209,7 @@ public final class CompletionEngine
//proposal.setPackageName(null);
//proposal.setTypeName(null);
proposal.setName(currentType.sourceName());
-
+
InternalCompletionProposal typeProposal = createProposal(CompletionProposal.TYPE_REF, this.actualCompletionPosition);
typeProposal.nameLookup = this.nameEnvironment.nameLookup;
typeProposal.completionEngine = this;
@@ -6223,7 +6223,7 @@ public final class CompletionEngine
typeProposal.setTokenRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setRelevance(constructorRelevance);
proposal.setRequiredProposals( new CompletionProposal[]{typeProposal});
-
+
proposal.setIsContructor(true);
proposal.setCompletion(completion);
proposal.setFlags(constructor.modifiers);
@@ -6314,7 +6314,7 @@ public final class CompletionEngine
}
}
}
-
+
private char[] getResolvedSignature(char[][] parameterTypes, char[] fullyQualifiedTypeName, int parameterCount, Scope scope) {
char[][] cn = CharOperation.splitOn('.', fullyQualifiedTypeName);
@@ -6324,7 +6324,7 @@ public final class CompletionEngine
} else {
ref = new QualifiedTypeReference(cn,new long[cn.length]);
}
-
+
TypeBinding guessedType = null;
INameEnvironment oldNameEnvironment = this.lookupEnvironment.nameEnvironment;
this.lookupEnvironment.nameEnvironment = getNoCacheNameEnvironment();
@@ -6338,38 +6338,38 @@ public final class CompletionEngine
guessedType = ref.resolveType((ClassScope)scope);
break;
}
-
+
if (guessedType != null && guessedType.isValidBinding()) {
// the erasure must be used because guessedType can be a RawTypeBinding (https://bugs.eclipse.org/bugs/show_bug.cgi?id=276890)
guessedType = guessedType.erasure();
-
+
if (guessedType instanceof SourceTypeBinding) {
SourceTypeBinding refBinding = (SourceTypeBinding) guessedType;
-
+
if (refBinding.scope == null || refBinding.scope.referenceContext == null) return null;
-
+
TypeDeclaration typeDeclaration = refBinding.scope.referenceContext;
AbstractMethodDeclaration[] methods = typeDeclaration.methods;
-
+
next : for (int i = 0; i < methods.length; i++) {
AbstractMethodDeclaration method = methods[i];
-
+
if (!method.isConstructor()) continue next;
-
+
Argument[] arguments = method.arguments;
int argumentsLength = arguments == null ? 0 : arguments.length;
-
+
if (parameterCount != argumentsLength) continue next;
-
+
for (int j = 0; j < argumentsLength; j++) {
char[] argumentTypeName = getTypeName(arguments[j].type);
-
+
if (!CharOperation.equals(argumentTypeName, parameterTypes[j])) {
continue next;
}
}
-
+
refBinding.resolveTypesFor(method.binding); // force resolution
if (method.binding == null) continue next;
return getSignature(method.binding);
@@ -6379,17 +6379,17 @@ public final class CompletionEngine
} finally {
this.lookupEnvironment.nameEnvironment = oldNameEnvironment;
}
-
+
return null;
}
-
+
private void findConstructorsOrAnonymousTypes(
ReferenceBinding currentType,
Scope scope,
InvocationSite invocationSite,
boolean isQualified,
int relevance) {
-
+
//{ObjectTeams: other parts of completion prefer role interfaces, but here we need to go back to the role class:
if (currentType.isSynthInterface()) {
currentType = currentType.roleModel.getClassPartBinding();
@@ -6413,7 +6413,7 @@ public final class CompletionEngine
isQualified,
relevance);
}
-
+
//{ObjectTeams: no anonymous classes from roles:
if (currentType.isRole())
return;
@@ -6718,7 +6718,7 @@ public final class CompletionEngine
return;
}
}
-
+
if (isForbidden(exceptionType)) return;
for (int j = typesFound.size; --j >= 0;) {
@@ -7025,7 +7025,7 @@ public final class CompletionEngine
int fieldLength = fieldName.length;
next : for (int f = fields.length; --f >= 0;) {
FieldBinding field = fields[f];
-
+
// Content assist invoked inside some field's initialization.
// bug 310427 and 325481
if (fieldBeingCompletedId >= 0 && field.id >= fieldBeingCompletedId) {
@@ -7042,7 +7042,7 @@ public final class CompletionEngine
}
}
}
-
+
//{ObjectTeams: filter out generated fields
if (!canBeCompleted(field.name)) continue next;
//carp}
@@ -7065,7 +7065,7 @@ public final class CompletionEngine
// SH}
if (this.options.checkVisibility
&& !field.canBeSeenBy(receiverType, invocationSite, scope)) continue next;
-
+
// don't propose non constant fields or strings (1.6 or below) in case expression
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343342
@@ -7075,9 +7075,9 @@ public final class CompletionEngine
if (field.type == null || field.type.id != TypeIds.T_JavaLangString)
continue next;
} else if (!(field.type instanceof BaseTypeBinding))
- continue next;
+ continue next;
} else {
- continue next; // non-constants not allowed in case.
+ continue next; // non-constants not allowed in case.
}
}
@@ -7773,9 +7773,9 @@ public final class CompletionEngine
receiverType = scope.getJavaLangObject();
}
-
+
checkCancel();
-
+
if(proposeField) {
findFields(
token,
@@ -7913,29 +7913,29 @@ public final class CompletionEngine
IfStatement ifStatement = (IfStatement)enclosingNode;
while (true) {
if (!(ifStatement.condition instanceof InstanceOfExpression)) return;
-
+
InstanceOfExpression instanceOfExpression = (InstanceOfExpression) ifStatement.condition;
-
+
TypeReference instanceOfType = instanceOfExpression.type;
-
+
if (instanceOfType.resolvedType == null) return;
-
+
boolean findFromAnotherReceiver = false;
-
+
char[][] receiverName = null;
int receiverStart = -1;
int receiverEnd = -1;
-
+
if (receiver instanceof QualifiedNameReference) {
QualifiedNameReference qualifiedNameReference = (QualifiedNameReference) receiver;
-
+
receiverName = qualifiedNameReference.tokens;
-
+
if (receiverName.length != 1) return;
-
+
receiverStart = (int) (qualifiedNameReference.sourcePositions[0] >>> 32);
receiverEnd = (int) qualifiedNameReference.sourcePositions[qualifiedNameReference.tokens.length - 1] + 1;
-
+
// if (local instanceof X) local.|
// if (field instanceof X) field.|
if (instanceOfExpression.expression instanceof SingleNameReference &&
@@ -7943,11 +7943,11 @@ public final class CompletionEngine
(qualifiedBinding instanceof LocalVariableBinding || qualifiedBinding instanceof FieldBinding)) {
findFromAnotherReceiver = true;
}
-
+
// if (this.field instanceof X) field.|
if (instanceOfExpression.expression instanceof FieldReference) {
FieldReference fieldReference = (FieldReference)instanceOfExpression.expression;
-
+
if (fieldReference.receiver instanceof ThisReference &&
qualifiedBinding instanceof FieldBinding &&
fieldReference.binding == qualifiedBinding) {
@@ -7956,24 +7956,24 @@ public final class CompletionEngine
}
} else if (receiver instanceof FieldReference) {
FieldReference fieldReference1 = (FieldReference) receiver;
-
+
receiverStart = fieldReference1.sourceStart;
receiverEnd = fieldReference1.sourceEnd + 1;
-
+
if (fieldReference1.receiver instanceof ThisReference) {
-
+
receiverName = new char[][] {THIS, fieldReference1.token};
-
+
// if (field instanceof X) this.field.|
if (instanceOfExpression.expression instanceof SingleNameReference &&
((SingleNameReference)instanceOfExpression.expression).binding == fieldReference1.binding) {
findFromAnotherReceiver = true;
}
-
+
// if (this.field instanceof X) this.field.|
if (instanceOfExpression.expression instanceof FieldReference) {
FieldReference fieldReference2 = (FieldReference)instanceOfExpression.expression;
-
+
if (fieldReference2.receiver instanceof ThisReference &&
fieldReference2.binding == fieldReference1.binding) {
findFromAnotherReceiver = true;
@@ -7981,18 +7981,18 @@ public final class CompletionEngine
}
}
}
-
+
if (findFromAnotherReceiver) {
TypeBinding receiverTypeBinding = instanceOfType.resolvedType;
char[] castedReceiver = null;
-
+
char[] castedTypeChars = CharOperation.concatWith(instanceOfType.getTypeName(), '.');
if(this.source != null) {
int memberRefStart = this.startPosition;
-
+
char[] receiverChars = CharOperation.subarray(this.source, receiverStart, receiverEnd);
char[] dotChars = CharOperation.subarray(this.source, receiverEnd, memberRefStart);
-
+
castedReceiver =
CharOperation.concat(
CharOperation.concat(
@@ -8013,12 +8013,12 @@ public final class CompletionEngine
')'),
DOT);
}
-
+
if (castedReceiver == null) return;
-
+
int oldStartPosition = this.startPosition;
this.startPosition = receiverStart;
-
+
findFieldsAndMethods(
this.completionToken,
receiverTypeBinding,
@@ -8036,7 +8036,7 @@ public final class CompletionEngine
castedReceiver,
receiverStart,
receiverEnd);
-
+
this.startPosition = oldStartPosition;
}
// traverse the enclosing node to find the instanceof expression corresponding
@@ -8841,7 +8841,7 @@ public final class CompletionEngine
}
}
}
-
+
private void findInterfacesMethodDeclarations(
char[] selector,
ReferenceBinding receiverType,
@@ -8891,7 +8891,7 @@ public final class CompletionEngine
}
}
}
-
+
private void findInterfacesMethods(
char[] selector,
TypeBinding[] typeArgTypes,
@@ -9132,7 +9132,7 @@ public final class CompletionEngine
}
}
- if (astNode instanceof CompletionOnFieldType &&
+ if (astNode instanceof CompletionOnFieldType &&
this.compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8) {
FieldBinding astNodeBinding = ((CompletionOnFieldType) astNode).binding;
ReferenceBinding declaringClass = astNodeBinding != null ? astNodeBinding.declaringClass : null;
@@ -9719,7 +9719,7 @@ public final class CompletionEngine
&& this.source.length > this.endPosition
&& this.source[this.endPosition] == '(')
completion = method.selector;
- else
+ else
completion = CharOperation.concat(method.selector, new char[] { '(', ')' });
if (castedReceiver != null) {
@@ -10193,7 +10193,7 @@ public final class CompletionEngine
/**
* Helper method for findMethods(char[], TypeBinding[], ReferenceBinding, Scope, ObjectVector, boolean, boolean, boolean)
* Note that the method doesn't do a comparison of the method names and expects the client to handle the same.
- *
+ *
* @methodName method as entered by the user, the one to completed
* @param methods a resultant array of MethodBinding, whose names should match methodName. The calling client must ensure that this check is handled.
*/
@@ -10829,7 +10829,7 @@ public final class CompletionEngine
}
boolean allowingLongComputationProposals = isAllowingLongComputationProposals();
-
+
this.noProposal = false;
if (!this.assistNodeIsConstructor ||
!allowingLongComputationProposals ||
@@ -10847,7 +10847,7 @@ public final class CompletionEngine
missingElementsEnds,
missingElementsHaveProblems);
}
-
+
if (this.assistNodeIsConstructor && allowingLongComputationProposals) {
findConstructorsOrAnonymousTypes(
memberType,
@@ -10892,7 +10892,7 @@ public final class CompletionEngine
typeRef.resolvedType = new ProblemReferenceBinding(new char[][]{ typeName }, null, ProblemReasons.NotFound);
missingTypesConverter.guess(typeRef, scope, substitutionRequestor);
}
-
+
private void findMemberTypesFromMissingType(
TypeReference typeRef,
final long pos,
@@ -10953,7 +10953,7 @@ public final class CompletionEngine
}
ReferenceBinding currentType = receiverType;
-
+
findInterfacesMethodDeclarations(
selector,
receiverType,
@@ -10964,13 +10964,13 @@ public final class CompletionEngine
missingElementsStarts,
missingElementsEnds,
missingElementsHaveProblems);
-
+
if (receiverType.isInterface()) {
currentType = scope.getJavaLangObject();
} else {
currentType = receiverType.superclass();
}
-
+
boolean hasPotentialDefaultAbstractMethods = true;
boolean java8Plus = this.compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8;
while (currentType != null) {
@@ -11025,7 +11025,7 @@ public final class CompletionEngine
}
// SH}
}
-
+
private char[][] findMethodParameterNames(MethodBinding method, char[][] parameterTypeNames){
//{ObjectTeams: added arg offset:
return findMethodParameterNames(method, /*parameterOffset*/0, parameterTypeNames);
@@ -11177,7 +11177,7 @@ public final class CompletionEngine
if (selector == null && notInJavadoc) {
return;
}
-
+
if (this.assistNodeIsInsideCase)
return; // no methods should be proposed inside case expression
@@ -11327,7 +11327,7 @@ public final class CompletionEngine
Scope scope,
boolean proposeAllMemberTypes,
ObjectVector typesFound) {
-
+
if (typeName == null)
return;
@@ -11401,7 +11401,7 @@ public final class CompletionEngine
false);
}
}
-
+
if (this.assistNodeIsConstructor && allowingLongComputationProposals) {
findConstructorsOrAnonymousTypes(
localType,
@@ -11465,32 +11465,32 @@ public final class CompletionEngine
findOverridableRolesFrom(tsuperTeam, knownRoles);
}
- private void findOverridableRolesFrom(ReferenceBinding superTeam, Set<String> knownRoles)
+ private void findOverridableRolesFrom(ReferenceBinding superTeam, Set<String> knownRoles)
{
int nameLength = this.completionToken.length;
ReferenceBinding[] superRoles = superTeam.memberTypes();
-
+
// inline roles:
for (int i = 0; i < superRoles.length; i++)
checkOverridableRole(superTeam, knownRoles, superRoles[i], nameLength);
-
- // secondary types like the super team are inserted into compilation using the
- // SourceTypeConverter, which doesn't know about role files.
+
+ // secondary types like the super team are inserted into compilation using the
+ // SourceTypeConverter, which doesn't know about role files.
// Thus we use the search engine (via IOTType.getRoleTypes) to find role files:
try {
IType superType = this.javaProject.findType(String.valueOf(superTeam.readableName()));
IOTType superTeamType = OTModelManager.getOTElement(superType);
if (superTeamType != null)
for (IType type : superTeamType.getRoleTypes(IOTType.ROLEFILE))
- checkOverridableRole(superTeam, knownRoles, type, nameLength);
+ checkOverridableRole(superTeam, knownRoles, type, nameLength);
} catch (JavaModelException e) {
// ignore
}
}
- private void checkOverridableRole(ReferenceBinding superTeam,
- Set<String> knownRoles,
+ private void checkOverridableRole(ReferenceBinding superTeam,
+ Set<String> knownRoles,
ReferenceBinding superRole,
- int nameLength)
+ int nameLength)
{
if (!superRole.isInterface())
return;
@@ -11501,7 +11501,7 @@ public final class CompletionEngine
char[] superRoleName = superRole.sourceName;
if (CharOperation.equals(superRoleName, IOTConstants.ILOWERABLE)) // not interesting to override
return;
-
+
if (this.completionToken.length > 0) {
if (this.completionToken.length > superRoleName.length)
return;
@@ -11510,21 +11510,21 @@ public final class CompletionEngine
&& !(this.options.camelCaseMatch && CharOperation.camelCaseMatch(this.completionToken, superRoleName)))
return;
}
-
+
String roleName = String.valueOf(superRoleName);
if (!knownRoles.add(roleName))
return;
-
+
ReferenceBinding classPart = superRole.roleModel.getClassPartBinding();
int modifiers = classPart != null ? classPart.modifiers : superRole.modifiers;
-
+
createOverrideRoleProposal(superTeam, superRoleName, getSignature(superRole), modifiers);
}
// similar to above, version for IType:
- private void checkOverridableRole(ReferenceBinding superTeam,
- Set<String> knownRoles,
+ private void checkOverridableRole(ReferenceBinding superTeam,
+ Set<String> knownRoles,
IType superRole,
- int nameLength) throws JavaModelException
+ int nameLength) throws JavaModelException
{
// don't check for interface, java model has no role-splitting
if (TypeHelper.isConfined(superRole)) // can't override Confined/IConfined
@@ -11560,7 +11560,7 @@ public final class CompletionEngine
if (moduleName.length > 0) {// do not propose invalid names
if (!Character.isJavaIdentifierStart(moduleName[0])) return;
for (char c : moduleName) {
- if (!Character.isJavaIdentifierPart(c) && c != '.') return;
+ if (!Character.isJavaIdentifierPart(c) && c != '.') return;
}
}
this.completionToken = CharOperation.concatWith(this.moduleDeclaration.tokens, '.');
@@ -11868,34 +11868,34 @@ public final class CompletionEngine
if (token == null)
return;
-
+
boolean allowingLongComputationProposals = isAllowingLongComputationProposals();
-
+
boolean proposeType =
!this.requestor.isIgnored(CompletionProposal.TYPE_REF) ||
((this.assistNodeInJavadoc & CompletionOnJavadoc.TEXT) != 0 && !this.requestor.isIgnored(CompletionProposal.JAVADOC_TYPE_REF));
boolean proposeAllMemberTypes = !this.assistNodeIsConstructor;
-
+
boolean proposeConstructor =
allowingLongComputationProposals &&
this.assistNodeIsConstructor &&
(!isIgnored(CompletionProposal.CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF) ||
!isIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF));
-
+
if ((proposeType || proposeConstructor) && scope.enclosingSourceType() != null) {
-
+
checkCancel();
-
+
findNestedTypes(token, scope.enclosingSourceType(), scope, proposeAllMemberTypes, typesFound);
if(!this.assistNodeIsInterface &&
!this.assistNodeIsConstructor &&
!this.assistNodeIsAnnotation &&
this.assistNodeInJavadoc == 0) {
-
+
checkCancel();
-
+
// don't propose type parameters if the completion is a constructor ('new |')
findTypeParameters(token, scope);
}
@@ -11912,7 +11912,7 @@ public final class CompletionEngine
boolean isEmptyPrefix = token.length == 0;
if ((proposeType || proposeConstructor) && this.unitScope != null) {
-
+
ReferenceBinding outerInvocationType = scope.enclosingSourceType();
if(outerInvocationType != null) {
ReferenceBinding temp = outerInvocationType.enclosingType();
@@ -11926,9 +11926,9 @@ public final class CompletionEngine
SourceTypeBinding[] types = this.unitScope.topLevelTypes;
next : for (int i = 0, length = types.length; i < length; i++) {
-
+
checkCancel();
-
+
SourceTypeBinding sourceType = types[i];
if(isForbidden(sourceType)) continue next;
@@ -11962,7 +11962,7 @@ public final class CompletionEngine
if (TypeBinding.equalsEquals(sourceType, otherType)) continue next;
}
-
+
typesFound.add(sourceType);
if (this.assistNodeIsExtendedType && sourceType.isFinal()) continue next;
@@ -12000,8 +12000,8 @@ public final class CompletionEngine
relevance += computeRelevanceForClass();
relevance += computeRelevanceForException(sourceType.sourceName);
}
-
-
+
+
this.noProposal = false;
if(proposeType &&
(!this.assistNodeIsConstructor ||
@@ -12021,7 +12021,7 @@ public final class CompletionEngine
null,
false);
}
-
+
if (proposeConstructor) {
findConstructorsOrAnonymousTypes(
sourceType,
@@ -12034,21 +12034,21 @@ public final class CompletionEngine
}
if (proposeConstructor && !isEmptyPrefix) {
-
+
checkCancel();
-
+
findTypesFromImports(token, scope, proposeType, typesFound);
} else if(proposeType) {
-
+
checkCancel();
-
+
findTypesFromStaticImports(token, scope, proposeAllMemberTypes, typesFound);
}
-
+
if (proposeConstructor) {
-
+
checkCancel();
-
+
findTypesFromExpectedTypes(token, scope, typesFound, proposeType, proposeConstructor);
}
@@ -12068,7 +12068,7 @@ public final class CompletionEngine
}
}
}
-
+
if (proposeConstructor) {
int l = typesFound.size();
for (int i = 0; i < l; i++) {
@@ -12080,9 +12080,9 @@ public final class CompletionEngine
'.');
this.knownTypes.put(fullyQualifiedTypeName, KNOWN_TYPE_WITH_KNOWN_CONSTRUCTORS);
}
-
+
checkCancel();
-
+
this.foundConstructorsCount = 0;
this.nameEnvironment.findConstructorDeclarations(
token,
@@ -12113,9 +12113,9 @@ public final class CompletionEngine
} else if(this.assistNodeIsAnnotation) {
searchFor = IJavaSearchConstants.ANNOTATION_TYPE;
}
-
+
checkCancel();
-
+
this.foundTypesCount = 0;
this.nameEnvironment.findTypes(
token,
@@ -12127,9 +12127,9 @@ public final class CompletionEngine
acceptTypes(scope);
}
if(!isEmptyPrefix && !this.requestor.isIgnored(CompletionProposal.PACKAGE_REF)) {
-
+
checkCancel();
-
+
this.nameEnvironment.findPackages(token, this);
}
}
@@ -12139,13 +12139,13 @@ public final class CompletionEngine
char[] token,
PackageBinding packageBinding,
Scope scope) {
-
+
boolean allowingLongComputationProposals = isAllowingLongComputationProposals();
boolean proposeType =
!this.requestor.isIgnored(CompletionProposal.TYPE_REF) ||
((this.assistNodeInJavadoc & CompletionOnJavadoc.TEXT) != 0 && !this.requestor.isIgnored(CompletionProposal.JAVADOC_TYPE_REF));
-
+
boolean proposeConstructor =
allowingLongComputationProposals &&
this.assistNodeIsConstructor &&
@@ -12173,11 +12173,11 @@ public final class CompletionEngine
SourceTypeBinding[] types = this.unitScope.topLevelTypes;
for (int i = 0, length = types.length; i < length; i++) {
-
+
checkCancel();
-
+
SourceTypeBinding sourceType = types[i];
-
+
if (isForbidden(sourceType)) continue;
if (this.assistNodeIsClass && sourceType.isInterface()) continue;
if (this.assistNodeIsInterface && sourceType.isClass()) continue;
@@ -12238,7 +12238,7 @@ public final class CompletionEngine
relevance += computeRelevanceForClass();
relevance += computeRelevanceForException(sourceType.sourceName);
}
-
+
this.noProposal = false;
if(proposeType &&
(!this.assistNodeIsConstructor ||
@@ -12258,7 +12258,7 @@ public final class CompletionEngine
null,
false);
}
-
+
if (proposeConstructor) {
findConstructorsOrAnonymousTypes(
sourceType,
@@ -12272,9 +12272,9 @@ public final class CompletionEngine
if (proposeConstructor) {
-
+
checkCancel();
-
+
this.foundConstructorsCount = 0;
this.nameEnvironment.findConstructorDeclarations(
qualifiedName,
@@ -12295,9 +12295,9 @@ public final class CompletionEngine
} else if(this.assistNodeIsAnnotation) {
searchFor = IJavaSearchConstants.ANNOTATION_TYPE;
}
-
+
checkCancel();
-
+
this.foundTypesCount = 0;
this.nameEnvironment.findTypes(
qualifiedName,
@@ -12308,28 +12308,28 @@ public final class CompletionEngine
this.monitor);
acceptTypes(scope);
}
-
+
if(!this.requestor.isIgnored(CompletionProposal.PACKAGE_REF)) {
this.nameEnvironment.findPackages(qualifiedName, this);
}
}
-
+
private void findTypesFromExpectedTypes(char[] token, Scope scope, ObjectVector typesFound, boolean proposeType, boolean proposeConstructor) {
if(this.expectedTypesPtr > -1) {
boolean allowingLongComputationProposals = isAllowingLongComputationProposals();
-
+
int typeLength = token == null ? 0 : token.length;
-
+
next : for (int i = 0; i <= this.expectedTypesPtr; i++) {
-
+
checkCancel();
-
+
if(this.expectedTypes[i] instanceof ReferenceBinding) {
ReferenceBinding refBinding = (ReferenceBinding)this.expectedTypes[i];
-
+
if (typeLength > 0) {
if (typeLength > refBinding.sourceName.length) continue next;
-
+
if (isFailedMatch(token, refBinding.sourceName)) continue next;
}
@@ -12371,7 +12371,7 @@ public final class CompletionEngine
continue next;
}
}
-
+
typesFound.add(refBinding);
boolean inSameUnit = this.unitScope.isDefinedInSameUnit(refBinding);
@@ -12419,7 +12419,7 @@ public final class CompletionEngine
} else if(refBinding.isInterface()) {
relevance += computeRelevanceForInterface();
}
-
+
if (proposeType &&
(!this.assistNodeIsConstructor ||
!allowingLongComputationProposals ||
@@ -12444,7 +12444,7 @@ public final class CompletionEngine
}
}
}
-
+
if (proposeConstructor) {
findConstructorsOrAnonymousTypes(
refBinding,
@@ -12497,7 +12497,7 @@ public final class CompletionEngine
if (typeLength > typeBinding.sourceName.length) continue next;
if (isFailedMatch(token, typeBinding.sourceName)) continue next;
-
+
int accessibility = IAccessRule.K_ACCESSIBLE;
if(typeBinding.hasRestrictedAccess()) {
AccessRestriction accessRestriction = this.lookupEnvironment.getAccessRestriction(typeBinding);
@@ -12518,11 +12518,11 @@ public final class CompletionEngine
}
}
}
-
+
if (typesFound.contains(typeBinding)) continue next;
-
+
typesFound.add(typeBinding);
-
+
if (this.assistNodeIsExtendedType && typeBinding.isFinal()) continue;
if (this.assistNodeIsInterfaceExcludingAnnotation && typeBinding.isAnnotationType()) continue;
if(this.assistNodeIsClass) {
@@ -12532,7 +12532,7 @@ public final class CompletionEngine
} else if (this.assistNodeIsAnnotation) {
if(!typeBinding.isAnnotationType()) continue;
}
-
+
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
relevance += computeRelevanceForInterestingProposal(typeBinding);
@@ -12540,7 +12540,7 @@ public final class CompletionEngine
relevance += computeRelevanceForExpectingType(typeBinding);
relevance += computeRelevanceForQualification(false);
relevance += computeRelevanceForRestrictions(accessibility);
-
+
if (typeBinding.isAnnotationType()) {
relevance += computeRelevanceForAnnotation();
relevance += computeRelevanceForAnnotationTarget(typeBinding);
@@ -12550,8 +12550,8 @@ public final class CompletionEngine
relevance += computeRelevanceForClass();
relevance += computeRelevanceForException(typeBinding.sourceName);
}
-
- if (proposeType &&
+
+ if (proposeType &&
(hasStaticMemberTypes(typeBinding, scope.enclosingSourceType(), this.unitScope) || hasArrayTypeAsExpectedSuperTypes())) {
this.noProposal = false;
if(!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) {
@@ -12571,7 +12571,7 @@ public final class CompletionEngine
}
}
}
-
+
findConstructorsOrAnonymousTypes(
typeBinding,
scope,
@@ -12584,7 +12584,7 @@ public final class CompletionEngine
}
}
}
-
+
private void findTypesFromStaticImports(char[] token, Scope scope, boolean proposeAllMemberTypes, ObjectVector typesFound) {
ImportBinding[] importBindings = scope.compilationUnitScope().imports;
if (importBindings == null) return;
@@ -12888,7 +12888,7 @@ public final class CompletionEngine
findPackagesInCurrentModule();
}
return;
-
+
} catch (JavaModelException e) {
//
}
@@ -12975,9 +12975,9 @@ public final class CompletionEngine
IType[] subclasses = newTypeHierarchy.getSubclasses(iClass);
for (IType iType2 : subclasses) {
getAllTypesInHierarchy(newTypeHierarchy,iType2,allTypes);
-
+
}
-
+
}
private char[][] findVariableFromUnresolvedReference(LocalDeclaration variable, BlockScope scope, final char[][] discouragedNames) {
@@ -13239,7 +13239,7 @@ public final class CompletionEngine
forbiddenNames,
type.dimensions(),
kind);
-
+
if (tb.isParameterizedType() &&
tb.findSuperTypeOriginatingFrom(TypeIds.T_JavaUtilCollection, false) != null) {
ParameterizedTypeBinding ptb = ((ParameterizedTypeBinding) tb);
@@ -13320,13 +13320,13 @@ public final class CompletionEngine
// carp}
if (local.isSecret())
continue next;
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328674
if (local.declaration.initialization != null && !local.declaration.type.isTypeNameVar(null)) {
// proposal being asked inside field's initialization. Don't propose this field.
continue next;
}
-
+
// don't propose non constant variables or strings (1.6 or below) in case expression
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=343342
@@ -13336,12 +13336,12 @@ public final class CompletionEngine
if (local.type == null || local.type.id != TypeIds.T_JavaLangString)
continue next;
} else if (!(local.type instanceof BaseTypeBinding))
- continue next;
+ continue next;
} else {
- continue next; // non-constants not allowed in case.
+ continue next; // non-constants not allowed in case.
}
}
-
+
int ptr = this.uninterestingBindingsPtr;
// Cases where the binding is uninteresting eg. for completion occurring inside a local var
// declaration, the local var binding is uninteresting and shouldn't be proposed.
@@ -13405,7 +13405,7 @@ public final class CompletionEngine
currentScope = currentScope.parent;
}
}
-
+
checkCancel();
boolean proposeField = !this.requestor.isIgnored(CompletionProposal.FIELD_REF);
@@ -13486,9 +13486,9 @@ public final class CompletionEngine
}
currentScope = currentScope.parent;
}
-
+
checkCancel();
-
+
findFieldsAndMethodsFromStaticImports(
token,
scope,
@@ -13503,9 +13503,9 @@ public final class CompletionEngine
proposeMethod);
if (this.assistNodeInJavadoc == 0) {
-
+
checkCancel();
-
+
// search in favorites import
findFieldsAndMethodsFromFavorites(
token,
@@ -13516,9 +13516,9 @@ public final class CompletionEngine
fieldsFound,
methodsFound);
}
-
+
checkCancel();
-
+
findEnumConstantsFromExpectedTypes(
token,
invocationScope,
@@ -13651,7 +13651,7 @@ public final class CompletionEngine
return this.favoriteReferenceBindings = resolvedImports;
}
-
+
private INameEnvironment getNoCacheNameEnvironment() {
if (this.noCacheNameEnvironment == null) {
JavaModelManager.getJavaModelManager().cacheZipFiles(this);
@@ -13667,7 +13667,7 @@ public final class CompletionEngine
}
protected boolean hasArrayTypeAsExpectedSuperTypes() {
if ((this.expectedTypesFilter & ~SUBTYPE) != 0) return false;
-
+
if (!this.hasComputedExpectedArrayTypes) {
if(this.expectedTypes != null) {
done : for (int i = 0; i <= this.expectedTypesPtr; i++) {
@@ -13677,10 +13677,10 @@ public final class CompletionEngine
}
}
}
-
+
this.hasComputedExpectedArrayTypes = true;
}
-
+
return this.hasExpectedArrayTypes;
}
protected boolean hasPossibleAnnotationTarget(TypeBinding typeBinding, Scope scope) {
@@ -13736,12 +13736,12 @@ public final class CompletionEngine
private boolean isAllowingLongComputationProposals() {
return this.monitor != null;
}
-
+
/**
* Checks whether name matches the token according to the current
* code completion settings (substring match, camel case match etc.)
* and sets whether the current match is a suffix proposal.
- *
+ *
* @param token the token that is tested
* @param name the name to match
* @return <code>true</code> if the token does not match,
@@ -13784,11 +13784,11 @@ public final class CompletionEngine
}
}
}
-
+
if (!isValidPackageName(givenPkgName)) {
return true;
}
-
+
return false;
}
@@ -14098,7 +14098,7 @@ public final class CompletionEngine
buffer.append('\t');
}
}
-
+
private void proposeConstructor(AcceptedConstructor deferredProposal, Scope scope) {
if (deferredProposal.proposeConstructor) {
proposeConstructor(
@@ -14118,7 +14118,7 @@ public final class CompletionEngine
deferredProposal.extraFlags);
}
}
-
+
private void proposeConstructor(
char[] simpleTypeName,
int parameterCount,
@@ -14175,7 +14175,7 @@ public final class CompletionEngine
relevance += computeRelevanceForException(simpleTypeName);
break;
}
-
+
char[] completion;
if (this.source != null
&& this.source.length > this.endPosition
@@ -14184,7 +14184,7 @@ public final class CompletionEngine
} else {
completion = new char[] { '(', ')' };
}
-
+
InternalCompletionProposal typeProposal = createProposal(CompletionProposal.TYPE_REF, this.actualCompletionPosition);
typeProposal.nameLookup = this.nameEnvironment.nameLookup;
typeProposal.completionEngine = this;
@@ -14197,14 +14197,14 @@ public final class CompletionEngine
typeProposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setTokenRange(this.startPosition - this.offset, this.endPosition - this.offset);
typeProposal.setRelevance(relevance);
-
+
switch (parameterCount) {
case -1: // default constructor
int flags = Flags.AccPublic;
if (Flags.isDeprecated(typeModifiers)) {
flags |= Flags.AccDeprecated;
}
-
+
if (isInterface || (typeModifiers & ClassFileConstants.AccAbstract) != 0) {
this.noProposal = false;
//{ObjectTeams: no anonymous roles:
@@ -14262,7 +14262,7 @@ public final class CompletionEngine
}
break;
case 0: // constructor with no parameter
-
+
if ((typeModifiers & ClassFileConstants.AccAbstract) != 0) {
//{ObjectTeams: no anonymous roles:
if ((typeModifiers & ExtraCompilerModifiers.AccRole) != 0) {
@@ -14327,12 +14327,12 @@ public final class CompletionEngine
} else {
signature = CharOperation.replaceOnCopy(signature, '/', '.');
}
-
+
int parameterNamesLength = parameterNames == null ? 0 : parameterNames.length;
if (parameterCount != parameterNamesLength) {
parameterNames = null;
}
-
+
if ((typeModifiers & ClassFileConstants.AccAbstract) != 0) {
this.noProposal = false;
if(!isIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF)) {
@@ -14385,7 +14385,7 @@ public final class CompletionEngine
proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset);
proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);
proposal.setRelevance(relevance);
-
+
this.requestor.accept(proposal);
if(DEBUG) {
this.printDebug(proposal);
@@ -14650,7 +14650,7 @@ public final class CompletionEngine
if(foundConflicts) return substituedParameterNames;
return null;
}
-
+
//{ObjectTeams: added methods:
// helper for base.foo, tsuper.foo
private boolean isBaseAccess(InvocationSite invocationSite) {
@@ -15058,14 +15058,14 @@ public final class CompletionEngine
}
private void inferCallouts(
- char[] selector,
+ char[] selector,
TypeBinding[] typeArgTypes,
- TypeBinding[] argTypes,
- ReferenceBinding receiverType,
+ TypeBinding[] argTypes,
+ ReferenceBinding receiverType,
Scope scope,
- ObjectVector methodsFound,
+ ObjectVector methodsFound,
boolean onlyStaticMethods,
- boolean exactMatch,
+ boolean exactMatch,
int kind,
TypeBinding expectedType,
InvocationSite invocationSite,
@@ -15076,12 +15076,12 @@ public final class CompletionEngine
Binding[] missingElements,
int[] missingElementsStarts,
int[] missingElementsEnds,
- boolean missingElementsHaveProblems,
+ boolean missingElementsHaveProblems,
char[] castedReceiver,
int receiverStart,
- int receiverEnd)
+ int receiverEnd)
{
-
+
ReferenceBinding baseclass = receiverType.baseclass();
boolean inferredCalloutAllowed = implicitCall;
if (!implicitCall && invocationSite instanceof CompletionOnMemberAccess)
@@ -15119,17 +15119,17 @@ public final class CompletionEngine
}
}
private void inferCalloutDeclarations(
- char[] selector,
- ReferenceBinding receiverType,
+ char[] selector,
+ ReferenceBinding receiverType,
Scope scope,
- ObjectVector methodsFound,
+ ObjectVector methodsFound,
Binding[] missingElements,
int[] missingElementsStarts,
int[] missingElementsEnds,
- boolean missingElementsHaveProblems)
+ boolean missingElementsHaveProblems)
{
ReferenceBinding baseclass = receiverType.baseclass();
-
+
// prepare for callout-to-field:
ObjectVector fieldsFound = new ObjectVector();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
index 93f6e3970..fb47fd63b 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
@@ -93,6 +93,6 @@ public interface ISearchRequestor {
* The default package is represented by an empty array.
*/
public void acceptPackage(char[] packageName);
-
+
public void acceptModule(char[] moduleName);
}
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 06882abf1..def77c8df 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
@@ -122,9 +122,9 @@ public class InternalCompletionContext extends CompletionContext {
@Override
public IJavaElement getEnclosingElement() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getEnclosingElement();
}
@@ -172,9 +172,9 @@ public class InternalCompletionContext extends CompletionContext {
@Override
public IJavaElement[] getVisibleElements(String typeSignature) {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return new IJavaElement[0];
-
+
return this.extendedContext.getVisibleElements(typeSignature);
}
@@ -197,7 +197,7 @@ public class InternalCompletionContext extends CompletionContext {
public boolean isInJavadocText() {
return (this.javadoc & CompletionOnJavadoc.TEXT) != 0;
}
-
+
/**
* Return the completion node associated with the current completion.
*
@@ -208,12 +208,12 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ASTNode getCompletionNode() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getCompletionNode();
}
-
+
/**
* Return the parent AST node of the completion node associated with the current completion.
*
@@ -224,12 +224,12 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ASTNode getCompletionNodeParent() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getCompletionNodeParent();
}
-
+
/**
* Return the bindings of all visible local variables in the current completion context.
*
@@ -241,12 +241,12 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ObjectVector getVisibleLocalVariables() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getVisibleLocalVariables();
}
-
+
/**
* Return the bindings of all visible fields in the current completion context.
*
@@ -258,12 +258,12 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ObjectVector getVisibleFields() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getVisibleFields();
}
-
+
/**
* Return the bindings of all visible methods in the current completion context.
*
@@ -275,9 +275,9 @@ public class InternalCompletionContext extends CompletionContext {
*/
public ObjectVector getVisibleMethods() {
if (!this.isExtended) throw new UnsupportedOperationException("Operation only supported in extended context"); //$NON-NLS-1$
-
+
if (this.extendedContext == null) return null;
-
+
return this.extendedContext.getVisibleMethods();
}
}
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 3236746c9..6c9174a31 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
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Andreas Magnusson <andreas.ch.magnusson@gmail.com>- contribution for bug 151500
@@ -46,7 +46,7 @@ import org.eclipse.jdt.internal.core.SourceMapper;
*/
public class InternalCompletionProposal extends CompletionProposal {
private static Object NO_ATTACHED_SOURCE = new Object();
-
+
protected CompletionEngine completionEngine;
protected NameLookup nameLookup;
@@ -192,7 +192,7 @@ public class InternalCompletionProposal extends CompletionProposal {
* Indicates whether parameter names have been computed.
*/
private boolean parameterNamesComputed = false;
-
+
protected char[][] findConstructorParameterNames(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, char[][] paramTypeNames){
if(paramTypeNames == null || declaringTypeName == null) return null;
@@ -282,7 +282,7 @@ public class InternalCompletionProposal extends CompletionProposal {
return parameters;
}
-
+
protected char[][] findMethodParameterNames(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, char[][] paramTypeNames){
if(paramTypeNames == null || declaringTypeName == null) return null;
@@ -344,7 +344,7 @@ public class InternalCompletionProposal extends CompletionProposal {
int startingIndex = 0;
String[] args;
IType enclosingType = type.getDeclaringType();
- // If the method is a constructor of a non-static inner type, add the enclosing type as an
+ // If the method is a constructor of a non-static inner type, add the enclosing type as an
// additional parameter to the constructor
if (enclosingType != null
&& CharOperation.equals(type.getElementName().toCharArray(), selector)
@@ -360,7 +360,7 @@ public class InternalCompletionProposal extends CompletionProposal {
args[i] = new String(paramTypeNames[i-startingIndex]);
}
method = type.getMethod(new String(selector), args);
-
+
IMethod[] methods = type.findMethods(method);
if (methods != null && methods.length > 0) {
method = methods[0];
@@ -375,7 +375,7 @@ public class InternalCompletionProposal extends CompletionProposal {
protected char[] getDeclarationTypeName() {
return this.declarationTypeName;
}
-
+
private int getOpenedBinaryTypesThreshold() {
return JavaModelManager.getJavaModelManager().getOpenableCacheSize() / 10;
}
@@ -905,7 +905,7 @@ public class InternalCompletionProposal extends CompletionProposal {
public void setFlags(int flags) {
this.flags = flags;
}
-
+
public void setHasNoParameterNamesFromIndex(boolean hasNoParameterNamesFromIndex) {
this.hasNoParameterNamesFromIndex = hasNoParameterNamesFromIndex;
}
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 4cb7868cd..da6d31618 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
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Technical University Berlin - extended API and implementation
@@ -181,15 +181,15 @@ public class InternalExtendedCompletionContext {
this.lookupEnvironment.unitBeingCompleted = this.compilationUnitDeclaration;
try {
this.hasComputedVisibleElementBindings = true;
-
+
Scope scope = this.assistScope;
ASTNode astNode = this.assistNode;
boolean notInJavadoc = this.completionContext.javadoc == 0;
-
+
this.visibleLocalVariables = new ObjectVector();
this.visibleFields = new ObjectVector();
this.visibleMethods = new ObjectVector();
-
+
ReferenceContext referenceContext = scope.referenceContext();
if (referenceContext instanceof AbstractMethodDeclaration || referenceContext instanceof LambdaExpression) {
// completion is inside a method body
@@ -208,7 +208,7 @@ public class InternalExtendedCompletionContext {
break done;
}
} else {
- FieldDeclaration fieldDeclaration = fields[i];
+ FieldDeclaration fieldDeclaration = fields[i];
if (fieldDeclaration.initialization != null && fieldDeclaration.binding != null) {
boolean isInsideInitializer = false;
if (fieldDeclaration.initialization.sourceEnd > 0) {
@@ -786,7 +786,7 @@ public class InternalExtendedCompletionContext {
// If the local variable declaration's initialization statement itself has the completion,
// then don't propose the local variable
if (local.declaration.initialization != null) {
- /*(use this if-else block if it is found that local.declaration.initialization != null is not sufficient to
+ /*(use this if-else block if it is found that local.declaration.initialization != null is not sufficient to
guarantee that proposal is being asked inside a local variable declaration's initializer)
if(local.declaration.initialization.sourceEnd > 0) {
if (this.assistNode.sourceEnd <= local.declaration.initialization.sourceEnd
@@ -929,7 +929,7 @@ public class InternalExtendedCompletionContext {
char[][] expectedTypekeys= this.completionContext.getExpectedTypesKeys();
if (expectedTypekeys == null || expectedTypekeys.length == 0)
return true;
- // Next, find out whether any of the constructor parameters are the same as one of the
+ // Next, find out whether any of the constructor parameters are the same as one of the
// class type variables. If yes, diamond cannot be used.
TypeReference ref;
if (cn.length == 1) {
@@ -967,14 +967,14 @@ public class InternalExtendedCompletionContext {
}
return false;
}
-
+
/**
* @see InternalCompletionContext#getCompletionNode()
*/
public ASTNode getCompletionNode() {
return this.assistNode;
}
-
+
/**
* @see InternalCompletionContext#getCompletionNodeParent()
*/
@@ -982,21 +982,21 @@ public class InternalExtendedCompletionContext {
// TODO Auto-generated method stub
return this.assistNodeParent;
}
-
+
public ObjectVector getVisibleLocalVariables() {
if (!this.hasComputedVisibleElementBindings) {
computeVisibleElementBindings();
}
return this.visibleLocalVariables;
}
-
+
public ObjectVector getVisibleFields() {
if (!this.hasComputedVisibleElementBindings) {
computeVisibleElementBindings();
}
return this.visibleFields;
}
-
+
public ObjectVector getVisibleMethods() {
if (!this.hasComputedVisibleElementBindings) {
computeVisibleElementBindings();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
index 383acb765..6e43a84a2 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
@@ -15,14 +15,14 @@ package org.eclipse.jdt.internal.codeassist;
public interface RelevanceConstants {
-
+
/*
* Important: The following rules must be strictly adhered to while declaring new relevance constants or modifying the existing:
* 1. One or more relevance constants are used in combination to form a relevance.
* 2. A particular relevance constant can be added only once to form a relevance.
* 3. A resultant relevance (after combining all the applicable relevance constants) must be a positive number.
* 4. The value of R_DEFAULT is maintained at a positive value such that the sum of all the negative relevance constants
- * and R_DEFAULT must not be negative.
+ * and R_DEFAULT must not be negative.
*/
int R_DEFAULT = 30;
int R_INTERESTING = 5;
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 b707c7bd1..d2f9ac944 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
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * Jesper Steen Møller <jesper@selskabet.org> - contributions for:
+ * Jesper Steen Møller <jesper@selskabet.org> - contributions for:
* Bug 531046: [10] ICodeAssist#codeSelect support for 'var'
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist;
@@ -154,16 +154,16 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transfor
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public final class SelectionEngine extends Engine implements ISearchRequestor {
-
+
private static class SelectionTypeNameMatchRequestorWrapper extends TypeNameMatchRequestorWrapper {
-
+
class AcceptedType {
public int modifiers;
public char[] packageName;
public char[] simpleTypeName;
public String path;
public AccessRestriction access;
-
+
public AcceptedType(int modifiers, char[] packageName, char[] simpleTypeName, String path, AccessRestriction access) {
this.modifiers = modifiers;
this.packageName = packageName;
@@ -172,63 +172,63 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
this.access = access;
}
}
-
+
private ImportReference[] importReferences;
-
+
private boolean importCachesNodeInitialized = false;
private ImportReference[] onDemandImportsNodeCache;
private int onDemandImportsNodeCacheCount;
private char[][][] importsNodeCache;
private int importsNodeCacheCount;
-
+
private HashtableOfObject onDemandFound = new HashtableOfObject();
private ObjectVector notImportedFound = new ObjectVector();
-
+
public SelectionTypeNameMatchRequestorWrapper(TypeNameMatchRequestor requestor, IJavaSearchScope scope, ImportReference[] importReferences) {
super(requestor, scope);
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;
-
+
if (!this.importCachesNodeInitialized) initializeImportNodeCaches();
-
+
char[] fullyQualifiedTypeName = CharOperation.concat(packageName, simpleTypeName, '.');
-
+
for (int i = 0; i < this.importsNodeCacheCount; i++) {
char[][] importName = this.importsNodeCache[i];
if (CharOperation.equals(importName[0], simpleTypeName)) {
-
+
if(CharOperation.equals(importName[1], fullyQualifiedTypeName)) {
super.acceptType(modifiers, packageName, simpleTypeName, enclosingTypeNames, path, access);
}
return;
}
}
-
+
for (int i = 0; i < this.onDemandImportsNodeCacheCount; i++) {
char[][] importName = this.onDemandImportsNodeCache[i].tokens;
char[] importFlatName = CharOperation.concatWith(importName, '.');
-
+
if (CharOperation.equals(importFlatName, packageName)) {
-
+
this.onDemandFound.put(simpleTypeName, simpleTypeName);
super.acceptType(modifiers, packageName, simpleTypeName, enclosingTypeNames, path, access);
return;
}
}
-
-
+
+
this.notImportedFound.add(new AcceptedType(modifiers, packageName, simpleTypeName, path, access));
}
-
+
public void acceptNotImported() {
int size = this.notImportedFound.size();
for (int i = 0; i < size; i++) {
AcceptedType acceptedType = (AcceptedType)this.notImportedFound.elementAt(i);
-
+
if (this.onDemandFound.get(acceptedType.simpleTypeName) == null) {
super.acceptType(
acceptedType.modifiers,
@@ -240,10 +240,10 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
}
}
-
+
public void initializeImportNodeCaches() {
int length = this.importReferences == null ? 0 : this.importReferences.length;
-
+
for (int i = 0; i < length; i++) {
ImportReference importReference = this.importReferences[i];
if((importReference.bits & ASTNode.OnDemand) != 0) {
@@ -256,15 +256,15 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
if(this.importsNodeCache == null) {
this.importsNodeCache = new char[length - i][][];
}
-
-
+
+
this.importsNodeCache[this.importsNodeCacheCount++] = new char[][]{
importReference.tokens[importReference.tokens.length - 1],
CharOperation.concatWith(importReference.tokens, '.')
};
}
}
-
+
this.importCachesNodeInitialized = true;
}
}
@@ -376,7 +376,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
this.parser = new SelectionParser(problemReporter);
this.owner = owner;
}
-
+
@Override
public void acceptConstructor(
int modifiers,
@@ -600,7 +600,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
scanner.setOTFlags(this.compilerOptions);
// SH}
scanner.setSource(source);
-
+
int lastIdentifierStart = -1;
int lastIdentifierEnd = -1;
char[] lastIdentifier = null;
@@ -720,7 +720,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
if (selectionStart == selectionEnd) { // Widen the selection to scan -> || :: if needed. No unicode handling for now.
if (selectionStart > 0 && selectionEnd < source.length - 1) {
if ((source[selectionStart] == '>' && source[selectionStart - 1] == '-') ||
- source[selectionStart] == ':' && source[selectionStart - 1] == ':') {
+ source[selectionStart] == ':' && source[selectionStart - 1] == ':') {
selectionStart--;
} else {
if ((source[selectionStart] == '-' && source[selectionEnd + 1] == '>') ||
@@ -728,7 +728,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
selectionEnd++;
}
}
- }
+ }
} // there could be some innocuous widening, shouldn't matter.
scanner.resetTo(selectionStart, selectionEnd, isModuleInfo);
@@ -759,12 +759,12 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
expectingIdentifier = false;
break;
- case TerminalTokens.TokenNameCOLON_COLON:
+ case TerminalTokens.TokenNameCOLON_COLON:
if (selectionStart >= scanner.startPosition && selectionEnd < scanner.currentPosition) {
this.actualSelectionStart = selectionStart;
this.actualSelectionEnd = selectionEnd;
this.selectedIdentifier = CharOperation.NO_CHAR;
- return true;
+ return true;
}
//$FALL-THROUGH$
case TerminalTokens.TokenNameDOT :
@@ -789,7 +789,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
this.actualSelectionStart = selectionStart;
this.actualSelectionEnd = selectionEnd;
this.selectedIdentifier = CharOperation.NO_CHAR;
- return true;
+ return true;
}
return false;
default :
@@ -875,7 +875,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
return false;
}
-
+
/*
* find all types outside the project scope
*/
@@ -916,7 +916,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
// implements interface method
}
};
-
+
TypeNameMatchRequestor typeNameMatchRequestor = new TypeNameMatchRequestor() {
@Override
public void acceptTypeNameMatch(TypeNameMatch match) {
@@ -926,17 +926,17 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
}
};
-
+
IJavaSearchScope scope = BasicSearchEngine.createWorkspaceScope();
-
+
SelectionTypeNameMatchRequestorWrapper requestorWrapper =
new SelectionTypeNameMatchRequestorWrapper(
- typeNameMatchRequestor,
+ typeNameMatchRequestor,
scope,
this.unitScope == null ? null : this.unitScope.referenceContext.imports);
-
+
org.eclipse.jdt.core.ICompilationUnit[] workingCopies = this.owner == null ? null : JavaModelManager.getJavaModelManager().getWorkingCopies(this.owner, true/*add primary WCs*/);
-
+
try {
new BasicSearchEngine(workingCopies).searchAllTypeNames(
null,
@@ -1201,7 +1201,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
// accept qualified types only if no unqualified type was accepted
if(!this.acceptedAnswer) {
acceptQualifiedTypes();
-
+
// accept types from all the workspace only if no type was found in the project scope
if (this.noProposal) {
findAllTypes(this.selectedIdentifier);
@@ -1646,7 +1646,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
public boolean visit(
LocalDeclaration localDeclaration, BlockScope scope) {
if(localDeclaration instanceof SelectionOnLocalName) {
- localDeclaration.resolve(scope);
+ localDeclaration.resolve(scope);
}
if (localDeclaration.type instanceof SingleTypeReference && ((SingleTypeReference)localDeclaration.type).token == assistIdentifier) {
if(localDeclaration.binding != null) {
@@ -1788,7 +1788,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
// find the type declaration that corresponds to the original source type
while (context.isLambda() && context.getParent() != null) {
- // It is easier to find the first enclosing proper type than the corresponding
+ // It is easier to find the first enclosing proper type than the corresponding
// lambda expression ast to add the selection node to.
context = (IType) context.getParent().getAncestor(IJavaElement.TYPE);
}
@@ -1820,7 +1820,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
CompilationResult result = new CompilationResult(reader.getFileName(), 1, 1, this.compilerOptions.maxProblemsPerUnit);
parsedUnit = new CompilationUnitDeclaration(this.parser.problemReporter(), result, 0);
HashSetOfCharArrayArray typeNames = new HashSetOfCharArrayArray();
-
+
BinaryTypeConverter converter = new BinaryTypeConverter(this.parser.problemReporter(), result, typeNames);
typeDeclaration = converter.buildTypeDeclaration(context, parsedUnit);
parsedUnit.imports = converter.buildImports(reader);
@@ -2105,7 +2105,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
return false;
}
-
+
/*
* Returns the correct method binding according to whether the selection is on the method declaration
* or on the inheritDoc tag in its javadoc.
@@ -2140,7 +2140,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
// SH}
return binding;
}
-
+
protected MethodBinding findOverriddenMethodInType(ReferenceBinding overriddenType, MethodBinding overriding) throws JavaModelException {
if (overriddenType == null)
return null;
@@ -2155,7 +2155,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
return null;
}
-
+
private Object findMethodWithAttachedDocInHierarchy(final MethodBinding method) throws JavaModelException {
ReferenceBinding type= method.declaringClass;
final SelectionRequestor requestor1 = (SelectionRequestor) this.requestor;
@@ -2173,7 +2173,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
IMember member = (IMember) requestor1.findMethodFromBinding(overridden, names, overridden.declaringClass);
if (member == null)
return InheritDocVisitor.CONTINUE;
- if (member.getAttachedJavadoc(null) != null ) {
+ if (member.getAttachedJavadoc(null) != null ) {
// for binary methods with attached javadoc and no source attached
return overridden;
}
@@ -2197,7 +2197,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
}
}.visitInheritDoc(type);
}
-
+
/**
* Implements the "Algorithm for Inheriting Method Comments" as specified for
* <a href="http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html#inheritingcomments">1.6</a>.
@@ -2277,7 +2277,7 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
/**
* Visits the super interfaces of the given type in the given hierarchy, thereby skipping already visited types.
- *
+ *
* @param visited set of visited types
* @param currentType type whose super interfaces should be visited
* @return the result, or {@link #CONTINUE} if no result has been found
@@ -2313,6 +2313,6 @@ public final class SelectionEngine extends Engine implements ISearchRequestor {
@Override
public void acceptModule(char[] moduleName) {
// TODO Auto-generated method stub
-
+
}
}
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 5847fba02..6ccf8bcb7 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
@@ -44,7 +44,7 @@ public class ThrownExceptionFinder extends ASTVisitor {
* Finds the thrown exceptions minus the ones that are already caught in previous catch blocks.
* Exception is already caught even if its super type is being caught. Also computes, separately,
* a list comprising of (a)those exceptions that have been caught already and (b)those exceptions that are thrown
- * by the method and whose super type has been caught already.
+ * by the method and whose super type has been caught already.
* @param tryStatement
* @param scope
*/
@@ -107,10 +107,10 @@ public class ThrownExceptionFinder extends ASTVisitor {
this.caughtExceptions.asArray(allCaughtExceptions);
return allCaughtExceptions;
}
-
+
/**
* Returns all the thrown exceptions minus the ones that are already caught in previous catch blocks
- * (of the same try), found by the call to
+ * (of the same try), found by the call to
* {@link ThrownExceptionFinder#processThrownExceptions(TryStatement, BlockScope)}.
* @return Returns an array of thrown exceptions that are still not caught in any catch block.
*/
@@ -119,9 +119,9 @@ public class ThrownExceptionFinder extends ASTVisitor {
this.thrownExceptions.asArray(result);
return result;
}
-
+
/**
- * Returns all exceptions that are discouraged to use because (a) they are already caught in some inner try-catch,
+ * Returns all exceptions that are discouraged to use because (a) they are already caught in some inner try-catch,
* or (b) their super exception has already been caught.
* @return all discouraged exceptions
*/
@@ -174,7 +174,7 @@ public class ThrownExceptionFinder extends ASTVisitor {
}
return false;
}
-
+
private void removeCaughtExceptions(TryStatement tryStatement, boolean recordUncheckedCaughtExceptions) {
Argument[] catchArguments = tryStatement.catchArguments;
int length = catchArguments == null ? 0 : catchArguments.length;
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 7b839bf19..a8f214a30 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
@@ -171,7 +171,7 @@ public class CompletionNodeDetector extends ASTVisitor {
}
@Override
public void endVisit(ReferenceExpression referenceExpression, BlockScope blockScope) {
- endVisit(referenceExpression);
+ endVisit(referenceExpression);
}
@Override
public void endVisit(SingleNameReference singleNameReference, BlockScope scope) {
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 eb3e281b5..584a251ed 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
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
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 1f0683955..7b1f581f4 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
@@ -87,7 +87,7 @@ public class CompletionOnJavadocTag extends JavadocSingleNameReference implement
switch (kind) {
case Scope.COMPILATION_UNIT_SCOPE:
// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=255752
- // Check for FAKE_TYPE_NAME to allow proposals (@see CompletionParser#consumeCompilationUnit)
+ // Check for FAKE_TYPE_NAME to allow proposals (@see CompletionParser#consumeCompilationUnit)
CompilationUnitDeclaration compilationUnit = scope.referenceCompilationUnit();
if(compilationUnit != null && compilationUnit.isModuleInfo() ) {
specifiedTags = MODULE_TAGS;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java
index 9c867b6d9..95720be70 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleDeclaration.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java
index ddb343acf..340bce639 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeywordModuleInfo.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.internal.compiler.ast.ExportsStatement;
import org.eclipse.jdt.internal.compiler.ast.ImportReference;
/**
- *
+ *
* This class is independent of its parent class and is in fact a dummy ExportsStatement. Used to hook
* into the existing module declaration type and is used as a placeholder for keyword completion. This can
* be any module keyword completion and not necessarily related to exports statement.
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 2c048f196..e70ec61f8 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
@@ -31,7 +31,7 @@ public class CompletionOnMessageSendName extends MessageSend {
public TypeBinding resolveType(BlockScope scope) {
this.constant = Constant.NotAConstant;
-
+
if (this.receiver.isImplicitThis())
throw new CompletionNodeFound();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java
index 548ede61f..b17708e18 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnModuleDeclaration.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
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 e45032c97..3d88012cf 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
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java
index 87b59d076..0900daba5 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsQualifiedTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java
index bdbe254b1..6b295cd15 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesImplementationsSingleTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java
index 9007ee1e4..eb06589c2 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesQualifiedTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java
index b89e8e8b7..d30284e8e 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnProvidesInterfacesSingleTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.complete;
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 a6ca50766..c69faafc8 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
@@ -38,9 +38,9 @@ public class CompletionOnQualifiedTypeReference extends QualifiedTypeReference {
private int kind = K_TYPE;
public char[] completionIdentifier;
-
+
public boolean isConstructorType;
-
+
public CompletionOnQualifiedTypeReference(char[][] previousIdentifiers, char[] completionIdentifier, long[] positions) {
this(previousIdentifiers, completionIdentifier, positions, K_TYPE);
}
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java
index 377c50105..e02edf669 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.java
@@ -24,14 +24,14 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.jdt.internal.compiler.parser.Scanner;
public class CompletionOnReferenceExpressionName extends ReferenceExpression {
-
+
public CompletionOnReferenceExpressionName(Scanner scanner) {
super(scanner);
}
@Override
public TypeBinding resolveType(BlockScope scope) {
-
+
final CompilerOptions compilerOptions = scope.compilerOptions();
TypeBinding lhsType;
boolean typeArgumentsHaveErrors;
@@ -54,7 +54,7 @@ public class CompletionOnReferenceExpressionName extends ReferenceExpression {
if (typeArgumentsHaveErrors || lhsType == null)
throw new CompletionNodeFound();
}
-
+
if (lhsType != null && lhsType.isValidBinding())
throw new CompletionNodeFound(this, lhsType, scope);
throw new CompletionNodeFound();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java
index 17ab3d3ca..cbc002e98 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesQualifiedTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/package org.eclipse.jdt.internal.codeassist.complete;
public class CompletionOnUsesQualifiedTypeReference extends CompletionOnQualifiedTypeReference {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java
index 11854055c..9745b0c42 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnUsesSingleTypeReference.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/package org.eclipse.jdt.internal.codeassist.complete;
public class CompletionOnUsesSingleTypeReference extends CompletionOnSingleTypeReference {
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 2054122e1..fc72da16f 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
@@ -213,7 +213,7 @@ public class CompletionParser extends AssistParser {
private IProgressMonitor monitor;
private int resumeOnSyntaxError = 0;
private boolean consumedEnhancedFor;
-
+
public CompletionParser(ProblemReporter problemReporter, boolean storeExtraSourceEnds) {
super(problemReporter);
this.reportSyntaxErrorIsRequired = false;
@@ -711,16 +711,16 @@ private static class SavedState {
this.parserCursorLocation = parserCursorLocation;
this.scannerCursorLocation = scannerCursorLocation;
this.assistNodeParent = assistNodeParent;
- }
+ }
}
@Override
public Object becomeSimpleParser() {
CompletionScanner completionScanner = (CompletionScanner)this.scanner;
SavedState parserState = new SavedState(this.cursorLocation, completionScanner.cursorLocation, this.assistNodeParent);
-
+
this.cursorLocation = Integer.MAX_VALUE;
completionScanner.cursorLocation = Integer.MAX_VALUE;
-
+
return parserState;
}
private void buildMoreAnnotationCompletionContext(MemberValuePair memberValuePair) {
@@ -1197,10 +1197,10 @@ private Statement buildMoreCompletionEnclosingContext(Statement statement) {
IfStatement ifStatement = null;
int index = -1;
/*
- * What happens here? When we have an "instanceof" after the last
- * K_CONTROL_STATEMENT_DELIMITER (which represents if or else-if), the former
+ * What happens here? When we have an "instanceof" after the last
+ * K_CONTROL_STATEMENT_DELIMITER (which represents if or else-if), the former
* is taken to be the current point. Otherwise, the standard rule applies: i.e.
- * pick the block if it comes after the K_CONTROL_STATEMENT_DELIMITER, otherwise pick the
+ * pick the block if it comes after the K_CONTROL_STATEMENT_DELIMITER, otherwise pick the
* K_BLOCK_DELIMITER.
*/
int blockIndex = lastIndexOfElement(K_BLOCK_DELIMITER);
@@ -1217,7 +1217,7 @@ private Statement buildMoreCompletionEnclosingContext(Statement statement) {
// Try to find an enclosing if statement even if one is not found immediately preceding the completion node.
if (index != -1 && this.elementInfoStack[index] == IF && this.elementObjectInfoStack[index] != null) {
Expression condition = (Expression)this.elementObjectInfoStack[index];
-
+
// If currentElement is a RecoveredLocalVariable then it can be contained in the if statement
if (this.currentElement instanceof RecoveredLocalVariable &&
this.currentElement.parent instanceof RecoveredBlock) {
@@ -1226,15 +1226,15 @@ private Statement buildMoreCompletionEnclosingContext(Statement statement) {
statement instanceof Expression && ((Expression) statement).isTrulyExpression() &&
condition.sourceStart < recoveredLocalVariable.localDeclaration.sourceStart) {
this.currentElement.add(statement, 0);
-
+
statement = recoveredLocalVariable.updatedStatement(0, new HashSet<TypeDeclaration>());
-
+
// RecoveredLocalVariable must be removed from its parent because the IfStatement will be added instead
RecoveredBlock recoveredBlock = (RecoveredBlock) recoveredLocalVariable.parent;
recoveredBlock.statements[--recoveredBlock.statementCount] = null;
-
+
this.currentElement = recoveredBlock;
-
+
}
}
if (statement instanceof AND_AND_Expression && this.assistNode instanceof Statement) {
@@ -1299,12 +1299,12 @@ private void buildMoreGenericsCompletionContext(ASTNode node, boolean consumeTyp
}
if(this.currentElement instanceof RecoveredType) {
this.currentElement = this.currentElement.add(new CompletionOnFieldType(ref, false), 0);
- } else {
-
+ } else {
+
if (prevKind == K_BETWEEN_NEW_AND_LEFT_BRACKET) {
-
+
AllocationExpression exp;
- if (this.expressionPtr > -1 && this.expressionStack[this.expressionPtr] instanceof AllocationExpression
+ if (this.expressionPtr > -1 && this.expressionStack[this.expressionPtr] instanceof AllocationExpression
&& this.invocationType == QUALIFIED_ALLOCATION) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=361963
exp = new QualifiedAllocationExpression();
exp.type = ref;
@@ -1607,7 +1607,7 @@ private boolean checkKeyword() {
&& (this.lastModifiers & ClassFileConstants.AccFinal) == 0) {
keywords[count++] = Keywords.FINAL;
}
-
+
//{ObjectTeams: consider team class
if (CharOperation.prefixEquals(this.identifierStack[ptr], Keywords.TEAM))
{
@@ -1618,7 +1618,7 @@ private boolean checkKeyword() {
if (this.options.complianceLevel >= ClassFileConstants.JDK1_5) {
keywords[count++] = Keywords.ENUM;
}
-
+
if((this.lastModifiers & ClassFileConstants.AccFinal) == 0) {
keywords[count++] = Keywords.INTERFACE;
}
@@ -1663,7 +1663,7 @@ private boolean checkModuleInfoConstructs() {
int index = -1;
if ((index = this.indexOfAssistIdentifier()) <= -1) return false;
-
+
if (this.currentElement instanceof RecoveredModule) {
RecoveredModule module = (RecoveredModule) this.currentElement;
if (checkModuleInfoKeyword(module, index)) return true;
@@ -1674,13 +1674,13 @@ private boolean checkModuleInfoConstructs() {
if (foundToken(K_AFTER_NAME_IN_PROVIDES_STATEMENT)) keyword = ModuleKeyword.PROVIDES_WITH;
}
if (keyword == ModuleKeyword.NOT_A_KEYWORD) return false;
-
+
int length = this.identifierLengthStack[this.identifierLengthPtr];
int ptr = this.identifierPtr - length + index + 1;
-
+
char[] ident = this.identifierStack[ptr];
- long pos = this.identifierPositionStack[ptr];
- char[][] keywords = getModuleKeywords(keyword);
+ long pos = this.identifierPositionStack[ptr];
+ char[][] keywords = getModuleKeywords(keyword);
if (this.currentElement instanceof RecoveredPackageVisibilityStatement) {
RecoveredPackageVisibilityStatement rPvs = (RecoveredPackageVisibilityStatement) this.currentElement;
rPvs.add(new CompletionOnKeywordModule2(ident, pos, keywords), 0);
@@ -1690,7 +1690,7 @@ private boolean checkModuleInfoConstructs() {
rPs.add(new CompletionOnKeyword1(ident, pos, keywords), 0);
return true;
}
- }
+ }
return false;
}
private boolean checkModuleInfoKeyword(RecoveredModule module, int index) {
@@ -2806,7 +2806,7 @@ protected void consumeClassHeaderImplements() {
for (int i = 0; i < length; i++) {
if (superInterfaces[i] == this.assistNode) {
this.assistNodeParent = typeDecl;
- }
+ }
}
}
}
@@ -2936,9 +2936,9 @@ protected void consumeDimWithOrWithOutExpr() {
@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
+ /* Sneak in the assist node. The reason we can't do that when we see the assist node is that
we don't know whether it is the first or subsequent statement in a block to be able to
- decide whether to call contactNodeLists. See Parser.consumeBlockStatement(s)
+ decide whether to call contactNodeLists. See Parser.consumeBlockStatement(s)
*/
if (this.shouldStackAssistNode && this.assistNode != null)
this.astStack[this.astPtr] = this.assistNodeParent instanceof MessageSend ? this.assistNodeParent : this.assistNode;
@@ -3228,10 +3228,10 @@ protected void consumeForceNoDiet() {
}
@Override
protected void consumeFormalParameter(boolean isVarArgs) {
-
+
this.invocationType = NO_RECEIVER;
this.qualifier = -1;
-
+
if (this.indexOfAssistIdentifier() < 0) {
super.consumeFormalParameter(isVarArgs);
if (this.pendingAnnotation != null) {
@@ -3261,14 +3261,14 @@ protected void consumeFormalParameter(boolean isVarArgs) {
varArgsAnnotations = new Annotation[length],
0,
length);
- }
+ }
}
int firstDimensions = this.intStack[this.intPtr--];
TypeReference type = getTypeReference(firstDimensions);
-
+
if (isVarArgs || extendedDimensions != 0) {
if (isVarArgs) {
- type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
+ type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
}
if (extendedDimensions != 0) { // combination illegal.
type = augmentTypeWithAdditionalDimensions(type, extendedDimensions, annotationsOnExtendedDimensions, false);
@@ -3318,7 +3318,7 @@ protected void consumeGenericTypeWithDiamond() {
super.consumeGenericTypeWithDiamond();
// we need to pop the <> of the diamond from the stack.
// This is not required in usual case when the type argument isn't elided
- // since the < and > get popped while parsing the type argument.
+ // since the < and > get popped while parsing the type argument.
popElement(K_BINARY_OPERATOR); // pop >
popElement(K_BINARY_OPERATOR); // pop <
}
@@ -3355,7 +3355,7 @@ protected void consumeInsideCastExpression() {
this.genericsPtr -= additionalBoundsLength;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, bounds, 1, additionalBoundsLength);
}
-
+
int end = this.intStack[this.intPtr--];
boolean isParameterized =(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_CAST);
if(isParameterized) {
@@ -3373,7 +3373,7 @@ protected void consumeInsideCastExpression() {
Expression castType = getTypeReference(this.intStack[this.intPtr--]);
if (additionalBoundsLength > 0) {
bounds[0] = (TypeReference) castType;
- castType = createIntersectionCastTypeReference(bounds);
+ castType = createIntersectionCastTypeReference(bounds);
}
if(isParameterized) {
this.intPtr--;
@@ -3444,7 +3444,7 @@ protected void consumeInsideCastExpressionWithQualifiedGenerics() {
int dim = this.intStack[this.intPtr--];
Annotation[][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim);
-
+
TypeReference[] bounds = null;
int additionalBoundsLength = this.genericsLengthStack[this.genericsLengthPtr--];
if (additionalBoundsLength > 0) {
@@ -3452,14 +3452,14 @@ protected void consumeInsideCastExpressionWithQualifiedGenerics() {
this.genericsPtr -= additionalBoundsLength;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, bounds, 1, additionalBoundsLength);
}
-
+
TypeReference rightSide = getTypeReference(0);
castType = computeQualifiedGenericsFromRightSide(rightSide, dim, annotationsOnDimensions);
if (additionalBoundsLength > 0) {
bounds[0] = (TypeReference) castType;
- castType = createIntersectionCastTypeReference(bounds);
- }
+ castType = createIntersectionCastTypeReference(bounds);
+ }
this.intPtr--;
castType.sourceEnd = end - 1;
castType.sourceStart = this.intStack[this.intPtr--] + 1;
@@ -4227,7 +4227,7 @@ protected void consumeToken(int token) {
int prevIdentifierPtr = this.previousIdentifierPtr;
isInsideEnhancedForLoopWithoutBlock(token);
-
+
if (isInsideMethod() || isInsideFieldInitialization() || isInsideAnnotation() || isInsideEnumConstantnitialization()) {
switch(token) {
case TokenNameLPAREN:
@@ -4346,7 +4346,7 @@ protected void consumeToken(int token) {
pushOnElementStack(K_YIELD_KEYWORD);
// Take the short cut here.
// Instead of injecting the TokenNameRestrictedIdentifierYield, totally ignore it
- // and let completion take it course. We will not be constructing the
+ // and let completion take it course. We will not be constructing the
// YieldStatement and thus not producing accurate completion, but completion doesn't have
// enough information anyway about the LHS anyway.
token = this.currentToken = this.getNextToken();
@@ -4854,7 +4854,7 @@ private void isInsideEnhancedForLoopWithoutBlock(int token) {
consumeOpenFakeBlock();
}
this.consumedEnhancedFor = false;
-
+
}
@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.
@@ -5673,9 +5673,9 @@ public void initialize(boolean parsingCompilationUnit) {
public void copyState(Parser from) {
super.copyState(from);
-
+
CompletionParser parser = (CompletionParser) from;
-
+
this.invocationType = parser.invocationType;
this.qualifier = parser.qualifier;
this.inReferenceExpression = parser.inReferenceExpression;
@@ -5977,12 +5977,12 @@ public void recoveryExitFromVariable() {
// To make sure the array initializer is popped when the focus is shifted to the parent
// in case we're restarting recovery inside an array initializer
RecoveredElement oldElement = this.currentElement;
- super.recoveryExitFromVariable();
- if(oldElement != this.currentElement) {
- if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_ARRAY_INITIALIZER) {
- popElement(K_ARRAY_INITIALIZER);
- popElement(K_FIELD_INITIALIZER_DELIMITER);
- }
+ super.recoveryExitFromVariable();
+ if(oldElement != this.currentElement) {
+ if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_ARRAY_INITIALIZER) {
+ popElement(K_ARRAY_INITIALIZER);
+ popElement(K_FIELD_INITIALIZER_DELIMITER);
+ }
}
} else {
super.recoveryExitFromVariable();
@@ -6069,11 +6069,11 @@ public void resetAfterCompletion() {
flushAssistState();
}
@Override
-public void restoreAssistParser(Object parserState) {
+public void restoreAssistParser(Object parserState) {
SavedState state = (SavedState) parserState;
-
+
CompletionScanner completionScanner = (CompletionScanner)this.scanner;
-
+
this.cursorLocation = state.parserCursorLocation;
completionScanner.cursorLocation = state.scannerCursorLocation;
this.assistNodeParent = state.assistNodeParent;
@@ -6083,7 +6083,7 @@ protected int resumeOnSyntaxError() {
if (this.monitor != null) {
if (++this.resumeOnSyntaxError > 100) {
this.resumeOnSyntaxError = 0;
- if (this.monitor.isCanceled())
+ if (this.monitor.isCanceled())
return HALT;
}
}
@@ -6100,14 +6100,14 @@ protected int resumeOnSyntaxError() {
protected int resumeAfterRecovery() {
this.hasUnusedModifiers = false;
if (this.assistNode != null) {
-
+
if (requireExtendedRecovery()) {
if (this.unstackedAct != ERROR_ACTION) {
return RESUME;
}
return super.resumeAfterRecovery();
}
-
+
/* if reached [eof] inside method body, but still inside nested type,
or inside a field initializer, should continue in diet mode until
the end of the method body or compilation unit */
@@ -6206,7 +6206,7 @@ protected void updateRecoveryState() {
parser = createSnapShotParser();
parser.copyState(this);
}
-
+
/* may be able to retrieve completionNode as an orphan, and then attach it */
completionIdentifierCheck();
attachOrphanCompletionNode();
@@ -6279,7 +6279,7 @@ protected boolean isInsideArrayInitializer(){
if (i > -1 && this.elementKindStack[i] == K_ARRAY_INITIALIZER) {
return true;
}
- return false;
+ return false;
}
private boolean foundToken(int token) {
int i = this.elementPtr;
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 b54ed99c8..d45e8e084 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
@@ -806,7 +806,7 @@ protected int getNextToken0() throws InvalidInputException {
pushLineSeparator();
}
}
- }
+ }
switch (this.currentCharacter) {
case '*':
star = true;
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 5d069a09e..02cf7cd2a 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
@@ -86,7 +86,7 @@ public abstract class AssistParser extends Parser {
// the index in the identifier stack of the previous identifier
protected int previousIdentifierPtr;
-
+
// depth of '(', '{' and '[]'
protected int bracketDepth;
@@ -151,26 +151,26 @@ public abstract char[] assistIdentifier();
@Override
public void copyState(Parser from) {
-
+
super.copyState(from);
AssistParser parser = (AssistParser) from;
-
+
this.previousToken = parser.previousToken;
this.previousIdentifierPtr = parser.previousIdentifierPtr;
-
+
this.lastModifiers = parser.lastModifiers;
this.lastModifiersStart = parser.lastModifiersStart;
-
+
this.bracketDepth = parser.bracketDepth;
this.elementPtr = parser.elementPtr;
-
+
int length;
System.arraycopy(parser.blockStarts, 0, this.blockStarts = new int [length = parser.blockStarts.length], 0, length);
System.arraycopy(parser.elementKindStack, 0, this.elementKindStack = new int [length = parser.elementKindStack.length], 0, length);
System.arraycopy(parser.elementInfoStack, 0, this.elementInfoStack = new int [length = parser.elementInfoStack.length], 0, length);
System.arraycopy(parser.elementObjectInfoStack, 0, this.elementObjectInfoStack = new Object [length = parser.elementObjectInfoStack.length], 0, length);
-
+
this.previousKind = parser.previousKind;
this.previousInfo = parser.previousInfo;
this.previousObjectInfo = parser.previousObjectInfo;
@@ -280,7 +280,7 @@ public RecoveredElement buildInitialRecoveryState(){
}
blockIndex = j+1; // shift the index to the new block
}
-
+
if (node instanceof LocalDeclaration){
LocalDeclaration local = (LocalDeclaration) node;
if (local.declarationSourceEnd == 0){
@@ -372,7 +372,7 @@ public RecoveredElement buildInitialRecoveryState(){
if (this.currentToken == TokenNameRBRACE) {
if (isIndirectlyInsideLambdaExpression())
this.ignoreNextClosingBrace = true;
- else
+ else
this.currentToken = 0; // closing brace has already been taken care of
}
@@ -408,7 +408,7 @@ private void initModuleInfo(RecoveredElement element) {
int i = 0;
for (; i <= this.astPtr; i++) {
if ((node = this.astStack[i]) instanceof ModuleDeclaration) {
- unit.add((ModuleDeclaration) node, this.bracketDepth);
+ unit.add((ModuleDeclaration) node, this.bracketDepth);
break;
}
}
@@ -552,7 +552,7 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean
See also that this concern does not arise in the case of field/local initialization since the initializer is replaced with full tree by consumeExitVariableWithInitialization.
*/
/*
- * All the above comments will not work if the assist node is buried deeper. This happens when there the
+ * All the above comments will not work if the assist node is buried deeper. This happens when there the
* lambda was part of a complex statement, such as it was one of the arguments to a method invocation. In which case,
* we start from the topmost recovery element and look for assist nodes. If the operation is successful, the method
* replaceAssistStatement() returns null. Else, it returns the original statement, thus falling back to replacing the
@@ -560,10 +560,10 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean
*/
statement = replaceAssistStatement(this.currentElement.topElement(),
this.assistNodeParent(), statementStart, statementEnd, statement);
-
+
if (statement != null) {
- RecoveredBlock recoveredBlock = (RecoveredBlock) (this.currentElement instanceof RecoveredBlock ? this.currentElement :
- (this.currentElement.parent instanceof RecoveredBlock) ? this.currentElement.parent :
+ RecoveredBlock recoveredBlock = (RecoveredBlock) (this.currentElement instanceof RecoveredBlock ? this.currentElement :
+ (this.currentElement.parent instanceof RecoveredBlock) ? this.currentElement.parent :
this.currentElement instanceof RecoveredMethod ? ((RecoveredMethod) this.currentElement).methodBody : null);
if (recoveredBlock != null) {
RecoveredStatement recoveredStatement = recoveredBlock.statementCount > 0 ? recoveredBlock.statements[recoveredBlock.statementCount - 1] : null;
@@ -576,7 +576,7 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean
((Expression) statement).isTrulyExpression()) {
RecoveredLocalVariable local = (RecoveredLocalVariable) recoveredStatement;
if (local.localDeclaration != null && local.localDeclaration.initialization != null) {
- if ((local.localDeclaration.initialization.sourceStart == 0 || local.localDeclaration.initialization.sourceEnd == 0) ||
+ if ((local.localDeclaration.initialization.sourceStart == 0 || local.localDeclaration.initialization.sourceEnd == 0) ||
(local.localDeclaration.initialization.sourceStart >= statementStart && local.localDeclaration.initialization.sourceEnd <= statementEnd) ){
local.localDeclaration.initialization = (Expression) statement;
local.localDeclaration.declarationSourceEnd = statement.sourceEnd;
@@ -875,7 +875,7 @@ protected void consumeOpenBlock() {
stackLength);
}
this.stack[this.stateStackTop++] = this.unstackedAct; // transition to Block ::= OpenBlock .LBRACE BlockStatementsopt RBRACE
- this.stack[this.stateStackTop] = tAction(this.unstackedAct, this.currentToken); // transition to Block ::= OpenBlock LBRACE .BlockStatementsopt RBRACE
+ this.stack[this.stateStackTop] = tAction(this.unstackedAct, this.currentToken); // transition to Block ::= OpenBlock LBRACE .BlockStatementsopt RBRACE
commit(true);
this.stateStackTop -= 2;
}
@@ -1409,7 +1409,7 @@ protected void consumeToken(int token) {
}
break;
}
- } else if (isInsideModuleInfo()) {
+ } else if (isInsideModuleInfo()) {
adjustBracket(token);
} else {
switch (token) {
@@ -1519,7 +1519,7 @@ protected void flushElementStack() {
@Override
protected TypeReference getTypeReference(int dim) {
//{ObjectTeams: wrap to introduce 2nd parameter
- return getTypeReference(dim, false);
+ return getTypeReference(dim, false);
}
@Override
protected TypeReference getTypeReference(int dim, boolean liftingTypeAllowed) {
@@ -1529,7 +1529,7 @@ protected TypeReference getTypeReference(int dim, boolean liftingTypeAllowed) {
/* no need to take action if not inside completed identifiers */
if ((index = indexOfAssistIdentifier(true)) < 0) {
-/* orig:
+/* orig:
return super.getTypeReference(dim);
:giro */
return super.getTypeReference(dim, liftingTypeAllowed);
@@ -1694,7 +1694,7 @@ protected NameReference getUnspecifiedReferenceOptimized() {
}
consumeNonTypeUseName();
-
+
/* retrieve identifiers subset and whole positions, the completion node positions
should include the entire replaced source. */
int length = this.identifierLengthStack[this.identifierLengthPtr];
@@ -1918,7 +1918,7 @@ protected boolean isInsideFieldInitialization(){
switch (this.elementKindStack[i]) {
case K_TYPE_DELIMITER : return false;
case K_METHOD_DELIMITER : return false;
- case K_FIELD_INITIALIZER_DELIMITER :
+ case K_FIELD_INITIALIZER_DELIMITER :
return true;
}
i--;
@@ -1942,9 +1942,9 @@ protected boolean isInsideModuleInfo(){
int i = this.elementPtr;
while(i > -1) {
switch (this.elementKindStack[i]) {
- case K_TYPE_DELIMITER :
+ case K_TYPE_DELIMITER :
case K_METHOD_DELIMITER :
- case K_FIELD_INITIALIZER_DELIMITER :
+ case K_FIELD_INITIALIZER_DELIMITER :
return false;
case K_MODULE_INFO_DELIMITER:
return true;
@@ -2258,12 +2258,12 @@ public void parseBlockStatements(AbstractMethodMappingDeclaration mapping, Compi
}
// SH}
-// the name is a misnomer, we allow "pop"s not just at the TOS. Lambda wants to be sticky till fully reduced, however we do want other elements popped at the right point, so ...
+// the name is a misnomer, we allow "pop"s not just at the TOS. Lambda wants to be sticky till fully reduced, however we do want other elements popped at the right point, so ...
protected void popElement(int kind) {
-
+
if (this.elementPtr < 0)
return;
-
+
int stackPointer = this.elementPtr;
if (kind != K_LAMBDA_EXPRESSION_DELIMITER) {
@@ -2273,7 +2273,7 @@ protected void popElement(int kind) {
}
if (stackPointer < 0 || this.elementKindStack[stackPointer] != kind)
return;
-
+
this.previousKind = this.elementKindStack[stackPointer];
this.previousInfo = this.elementInfoStack[stackPointer];
this.previousObjectInfo = this.elementObjectInfoStack[stackPointer];
@@ -2488,7 +2488,7 @@ protected abstract AssistParser createSnapShotParser();
protected int fallBackToSpringForward(Statement unused) {
int nextToken;
int automatonState = automatonState();
-
+
// If triggered fake EOF at completion site, see if the real next token would have passed muster.
if (this.currentToken == TokenNameEOF) {
int extendedEnd = this.scanner.source.length;
@@ -2510,7 +2510,7 @@ protected int fallBackToSpringForward(Statement unused) {
nextToken = this.currentToken;
this.scanner.ungetToken(nextToken);
if (nextToken == TokenNameRBRACE)
- ignoreNextClosingBrace(); // having ungotten it, recoveryTokenCheck will see this again.
+ ignoreNextClosingBrace(); // having ungotten it, recoveryTokenCheck will see this again.
}
// OK, next token is no good to resume "in place", attempt some local repair. FIXME: need to make sure we don't get stuck keep reducing empty statements !!
for (int i = 0, length = RECOVERY_TOKENS.length; i < length; i++) {
@@ -2555,7 +2555,7 @@ protected int resumeAfterRecovery() {
return RESUME;
}
}
-
+
// reset internal stacks
this.astPtr = -1;
this.astLengthPtr = -1;
@@ -2563,19 +2563,19 @@ protected int resumeAfterRecovery() {
this.expressionLengthPtr = -1;
this.typeAnnotationLengthPtr = -1;
this.typeAnnotationPtr = -1;
-
+
this.identifierPtr = -1;
this.identifierLengthPtr = -1;
this.intPtr = -1;
-
-
+
+
this.dimensions = 0 ;
this.recoveredStaticInitializerStart = 0;
this.genericsIdentifiersLengthPtr = -1;
this.genericsLengthPtr = -1;
this.genericsPtr = -1;
-
+
this.valueLambdaNestDepth = -1;
this.modifiers = ClassFileConstants.AccDefault;
@@ -2691,7 +2691,7 @@ protected Object topKnownElementObjectInfo(int owner) {
protected ASTNode wrapWithExplicitConstructorCallIfNeeded(ASTNode ast) {
int selector;
if (ast != null && topKnownElementKind(ASSIST_PARSER) == K_SELECTOR && ast instanceof Expression &&
- ((Expression) ast).isTrulyExpression() &&
+ ((Expression) ast).isTrulyExpression() &&
(((selector = topKnownElementInfo(ASSIST_PARSER)) == THIS_CONSTRUCTOR) ||
(selector == SUPER_CONSTRUCTOR))) {
ExplicitConstructorCall call = new ExplicitConstructorCall(
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 ff7fb8434..13f81de26 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
@@ -83,13 +83,13 @@ public abstract class Engine implements ITypeRequestor {
@Override
public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) {
CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit);
-
+
AssistParser assistParser = getParser();
Object parserState = assistParser.becomeSimpleParser();
-
+
CompilationUnitDeclaration parsedUnit =
assistParser.dietParse(sourceUnit, result);
-
+
assistParser.restoreAssistParser(parserState);
this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction);
@@ -161,7 +161,7 @@ public abstract class Engine implements ITypeRequestor {
}
// SH}
}
-
+
//{ObjectTeams: with dependencies configured for fieldAndMethods:
@Override
public void accept(IModule module, LookupEnvironment environment) {
@@ -169,7 +169,7 @@ public abstract class Engine implements ITypeRequestor {
ITypeRequestor.super.accept(module, environment);
}
}
-// SH}
+// SH}
public abstract AssistParser getParser();
@@ -177,7 +177,7 @@ public abstract class Engine implements ITypeRequestor {
if (this.currentPackageName == null) {
initializePackageCache();
}
-
+
ImportBinding[] importBindings = this.unitScope.imports;
int length = importBindings == null ? 0 : importBindings.length;
@@ -205,7 +205,7 @@ public abstract class Engine implements ITypeRequestor {
this.importCachesInitialized = true;
}
-
+
public void initializePackageCache() {
if (this.unitScope.fPackage != null) {
this.currentPackageName = CharOperation.concatWith(this.unitScope.fPackage.compoundName, '.');
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 d11db50a3..22226f361 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
@@ -204,7 +204,7 @@ public class SelectionJavadocParser extends JavadocParser {
((SelectionJavadoc) this.docComment).inheritDocSelected = true;
}
}
-
+
/*
* Sets a flag to denote that selection has taken place on an inheritDoc tag
*/
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 2aab501f2..5634b5b21 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
@@ -58,7 +58,7 @@ public class SelectionOnArgumentName extends Argument {
super.resolve(scope);
throw new SelectionNodeFound(this.binding);
}
-
+
@Override
public TypeBinding resolveForCatch(BlockScope scope) {
super.resolveForCatch(scope);
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java
index f248f5891..833b0dac7 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2014, 2015 IBM Corporation and others.
- *
+ *
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
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 ce48fe7ab..867db743f 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
@@ -33,7 +33,7 @@ public class SelectionOnLocalName extends LocalDeclaration{
if (isTypeNameVar(scope)) {
if ((this.bits & ASTNode.IsForeachElementVariable) != 0 && scope.blockStatement instanceof ForeachStatement) {
// small version extracted from ForeachStatement.resolve():
-
+
ForeachStatement stat = (ForeachStatement) scope.blockStatement;
TypeBinding collectionType = stat.collection == null ? null : stat.collection.resolveType((BlockScope) scope.parent);
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java
index a67a3541c..1b9145057 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnModuleDeclaration.java
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.select;
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 44d51e351..6770d9906 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
@@ -7,10 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- *
+ *
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.select;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
index 2838a8f18..064cc138e 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2014, 2017 IBM Corporation and others.
- *
+ *
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -21,12 +21,12 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.jdt.internal.compiler.parser.Scanner;
public class SelectionOnReferenceExpression extends ReferenceExpression {
-
+
public SelectionOnReferenceExpression(ReferenceExpression referenceExpression, Scanner scanner) {
super(scanner);
initialize(referenceExpression.compilationResult, referenceExpression.lhs, referenceExpression.typeArguments, referenceExpression.selector, referenceExpression.sourceEnd);
}
-
+
@Override
public TypeBinding resolveType(BlockScope scope) {
TypeBinding resolveType = super.resolveType(scope);
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 22a5552f8..7e6832495 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
@@ -34,13 +34,13 @@ public class SelectionOnReferenceExpressionName extends ReferenceExpression {
super.printExpression(indent, output);
return output.append('>');
}
-
+
// See SelectionScanner#scanIdentifierOrKeyword
@Override
public boolean isConstructorReference() {
return CharOperation.equals(this.selector, "new".toCharArray()); //$NON-NLS-1$
}
-
+
// See SelectionScanner#scanIdentifierOrKeyword
@Override
public boolean isMethodReference() {
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 6a6502b10..399265ab9 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
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
- * Jesper Steen Møller <jesper@selskabet.org> - contributions for:
+ * Jesper Steen Møller <jesper@selskabet.org> - contributions for:
* Bug 531046: [10] ICodeAssist#codeSelect support for 'var'
*******************************************************************************/
package org.eclipse.jdt.internal.codeassist.select;
@@ -566,7 +566,7 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) {
0,
argumentLength);
}
-
+
if (qualified) {
this.expressionLengthPtr--;
alloc.enclosingInstance = this.expressionStack[this.expressionPtr--];
@@ -587,7 +587,7 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) {
this.lastIgnoredToken = -1;
if (isIndirectlyInsideLambdaExpression())
this.ignoreNextOpeningBrace = true;
- else
+ else
this.currentToken = 0; // opening brace already taken into account.
this.hasReportedError = true;
}
@@ -600,7 +600,7 @@ protected void consumeEnterAnonymousClassBody(boolean qualified) {
this.currentElement = this.currentElement.add(anonymousType, 0);
if (isIndirectlyInsideLambdaExpression())
this.ignoreNextOpeningBrace = true;
- else
+ else
this.currentToken = 0; // opening brace already taken into account.
this.lastIgnoredToken = -1;
}
@@ -712,15 +712,15 @@ protected void consumeFormalParameter(boolean isVarArgs) {
varArgsAnnotations = new Annotation[length],
0,
length);
- }
+ }
}
int firstDimensions = this.intStack[this.intPtr--];
TypeReference type = getTypeReference(firstDimensions);
if (isVarArgs || extendedDimensions != 0) {
if (isVarArgs) {
- type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
- }
+ type = augmentTypeWithAdditionalDimensions(type, 1, varArgsAnnotations != null ? new Annotation[][] { varArgsAnnotations } : null, true);
+ }
if (extendedDimensions != 0) { // combination illegal.
type = augmentTypeWithAdditionalDimensions(type, extendedDimensions, annotationsOnExtendedDimensions, false);
}
@@ -1807,7 +1807,7 @@ protected Argument typeElidedArgument() {
char[] selector = this.identifierStack[this.identifierPtr];
if (selector != assistIdentifier()){
return super.typeElidedArgument();
- }
+ }
this.identifierLengthPtr--;
char[] identifierName = this.identifierStack[this.identifierPtr];
long namePositions = this.identifierPositionStack[this.identifierPtr--];

Back to the top