switch (currentScope.kind) {
case Scope.METHOD_SCOPE :
// handle the error case inside an explicit constructor call (see MethodScope>>findField)
MethodScope methodScope = (MethodScope) currentScope;
staticsOnly |= methodScope.isStatic | methodScope.isConstructorCall;
//$FALL-THROUGH$
case Scope.BLOCK_SCOPE :
BlockScope blockScope = (BlockScope) currentScope;
next : for (int i = 0, length = blockScope.locals.length; i < length; i++) {
LocalVariableBinding local = blockScope.locals[i];
if (local == null)
break next;
if (local.isSecret())
continue next;
// 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
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
&& this.assistNode.sourceStart >= local.declaration.initialization.sourceStart) {
continue next;
}
} else {
CompletionNodeDetector detector = new CompletionNodeDetector(
this.assistNode,
local.declaration.initialization);
if (detector.containsCompletionNode()) {
continue next;
}
}*/
continue next;
}
for (int f = 0; f < localsFound.size; f++) {
LocalVariableBinding otherLocal =
(LocalVariableBinding) localsFound.elementAt(f);
if (CharOperation.equals(otherLocal.name, local.name, true))
continue next;
}
localsFound.add(local);
}
break;
case Scope.COMPILATION_UNIT_SCOPE :
break done1;
}
currentScope = currentScope.parent;
}
staticsOnly = false;
currentScope = scope;
done2 : while (true) { // done when a COMPILATION_UNIT_SCOPE is found
switch (currentScope.kind) {
case Scope.METHOD_SCOPE :
// handle the error case inside an explicit constructor call (see MethodScope>>findField)
MethodScope methodScope = (MethodScope) currentScope;
staticsOnly |= methodScope.isStatic | methodScope.isConstructorCall;
break;
case Scope.CLASS_SCOPE :
ClassScope classScope = (ClassScope) currentScope;
SourceTypeBinding enclosingType = classScope.referenceContext.binding;