public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
@Override public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public void resolve(MethodScope scope) { FieldBinding previousField = scope.initializedField; int previousFieldID = scope.lastVisibleFieldID; try { scope.initializedField = null; scope.lastVisibleFieldID = this.lastVisibleFieldID; if (isStatic()) { ReferenceBinding declaringType = scope.enclosingSourceType(); if (declaringType.isNestedType() && !declaringType.isStatic()) scope.problemReporter().innerTypesCannotDeclareStaticInitializers( declaringType, this); } if (this.block != null) this.block.resolve(scope); } finally { scope.initializedField = previousField; scope.lastVisibleFieldID = previousFieldID; } }
public VariableBinding[] getEmulationPath(LocalVariableBinding outerLocalVariable) { MethodScope currentMethodScope = methodScope(); SourceTypeBinding sourceType = currentMethodScope.enclosingSourceType(); // identity check BlockScope variableScope = outerLocalVariable.declaringScope; if (variableScope == null /*val$this$0*/ || currentMethodScope == variableScope.methodScope()) { return new VariableBinding[] { outerLocalVariable }; // implicit this is good enough } // use synthetic constructor arguments if possible if (currentMethodScope.isInsideInitializerOrConstructor() && (sourceType.isNestedType())) { SyntheticArgumentBinding syntheticArg; if ((syntheticArg = ((NestedTypeBinding) sourceType).getSyntheticArgument(outerLocalVariable)) != null) { return new VariableBinding[] { syntheticArg }; } } // use a synthetic field then if (!currentMethodScope.isStatic) { FieldBinding syntheticField; if ((syntheticField = sourceType.getSyntheticField(outerLocalVariable)) != null) { return new VariableBinding[] { syntheticField }; } } return null; }
/** * Check and/or redirect the field access to the delegate receiver if any */ public TypeBinding checkFieldAccess(BlockScope scope) { FieldBinding fieldBinding = (FieldBinding) this.binding; MethodScope methodScope = scope.methodScope(); TypeBinding declaringClass = fieldBinding.original().declaringClass; // check for forward references if ((this.indexOfFirstFieldBinding == 1 || declaringClass.isEnum()) && methodScope.enclosingSourceType() == declaringClass && methodScope.lastVisibleFieldID >= 0 && fieldBinding.id >= methodScope.lastVisibleFieldID && (!fieldBinding.isStatic() || methodScope.isStatic)) { scope.problemReporter().forwardReference(this, this.indexOfFirstFieldBinding-1, fieldBinding); } this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits this.bits |= Binding.FIELD; return getOtherFieldBindings(scope); }
/** * Check and/or redirect the field access to the delegate receiver if any */ public TypeBinding checkFieldAccess(BlockScope scope) { FieldBinding fieldBinding = (FieldBinding) this.binding; MethodScope methodScope = scope.methodScope(); TypeBinding declaringClass = fieldBinding.original().declaringClass; // check for forward references if ((this.indexOfFirstFieldBinding == 1 || declaringClass.isEnum()) && TypeBinding.equalsEquals(methodScope.enclosingSourceType(), declaringClass) && methodScope.lastVisibleFieldID >= 0 && fieldBinding.id >= methodScope.lastVisibleFieldID && (!fieldBinding.isStatic() || methodScope.isStatic)) { scope.problemReporter().forwardReference(this, this.indexOfFirstFieldBinding-1, fieldBinding); } this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits this.bits |= Binding.FIELD; return getOtherFieldBindings(scope); }
/** * Check and/or redirect the field access to the delegate receiver if any */ public TypeBinding checkFieldAccess(BlockScope scope) { FieldBinding fieldBinding = (FieldBinding) this.binding; MethodScope methodScope = scope.methodScope(); TypeBinding declaringClass = fieldBinding.original().declaringClass; // check for forward references if ((this.indexOfFirstFieldBinding == 1 || declaringClass.isEnum()) && TypeBinding.equalsEquals(methodScope.enclosingSourceType(), declaringClass) && methodScope.lastVisibleFieldID >= 0 && fieldBinding.id >= methodScope.lastVisibleFieldID && (!fieldBinding.isStatic() || methodScope.isStatic)) { scope.problemReporter().forwardReference(this, this.indexOfFirstFieldBinding-1, fieldBinding); } this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits this.bits |= Binding.FIELD; return getOtherFieldBindings(scope); }
/** * Check and/or redirect the field access to the delegate receiver if any */ public TypeBinding checkFieldAccess(BlockScope scope) { FieldBinding fieldBinding = (FieldBinding) this.binding; MethodScope methodScope = scope.methodScope(); TypeBinding declaringClass = fieldBinding.original().declaringClass; // check for forward references if ((this.indexOfFirstFieldBinding == 1 || declaringClass.isEnum()) && TypeBinding.equalsEquals(methodScope.enclosingSourceType(), declaringClass) && methodScope.lastVisibleFieldID >= 0 && fieldBinding.id >= methodScope.lastVisibleFieldID && (!fieldBinding.isStatic() || methodScope.isStatic)) { scope.problemReporter().forwardReference(this, this.indexOfFirstFieldBinding-1, fieldBinding); } this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits this.bits |= Binding.FIELD; return getOtherFieldBindings(scope); }
/** * Check and/or redirect the field access to the delegate receiver if any */ public TypeBinding checkFieldAccess(BlockScope scope) { FieldBinding fieldBinding = (FieldBinding) this.binding; MethodScope methodScope = scope.methodScope(); TypeBinding declaringClass = fieldBinding.original().declaringClass; // check for forward references if ((this.indexOfFirstFieldBinding == 1 || declaringClass.isEnum()) && TypeBinding.equalsEquals(methodScope.enclosingSourceType(), declaringClass) && methodScope.lastVisibleFieldID >= 0 && fieldBinding.id >= methodScope.lastVisibleFieldID && (!fieldBinding.isStatic() || methodScope.isStatic)) { scope.problemReporter().forwardReference(this, this.indexOfFirstFieldBinding-1, fieldBinding); } this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits this.bits |= Binding.FIELD; return getOtherFieldBindings(scope); }
/** * Check and/or redirect the field access to the delegate receiver if any */ public TypeBinding checkFieldAccess(BlockScope scope) { FieldBinding fieldBinding = (FieldBinding) this.binding; MethodScope methodScope = scope.methodScope(); TypeBinding declaringClass = fieldBinding.original().declaringClass; // check for forward references if ((this.indexOfFirstFieldBinding == 1 || declaringClass.isEnum()) && TypeBinding.equalsEquals(methodScope.enclosingSourceType(), declaringClass) && methodScope.lastVisibleFieldID >= 0 && fieldBinding.id >= methodScope.lastVisibleFieldID && (!fieldBinding.isStatic() || methodScope.isStatic)) { scope.problemReporter().forwardReference(this, this.indexOfFirstFieldBinding-1, fieldBinding); } this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits this.bits |= Binding.FIELD; return getOtherFieldBindings(scope); }
public void resolveStatements() { SourceTypeBinding sourceType = this.scope.enclosingSourceType(); if (!CharOperation.equals(sourceType.sourceName, this.selector)){ this.scope.problemReporter().missingReturnType(this); } // typeParameters are already resolved from Scope#connectTypeVariables() if (this.binding != null && !this.binding.isPrivate()) { sourceType.tagBits |= TagBits.HasNonPrivateConstructor; } // if null ==> an error has occurs at parsing time .... if (this.constructorCall != null) { if (sourceType.id == TypeIds.T_JavaLangObject && this.constructorCall.accessMode != ExplicitConstructorCall.This) { // cannot use super() in java.lang.Object if (this.constructorCall.accessMode == ExplicitConstructorCall.Super) { this.scope.problemReporter().cannotUseSuperInJavaLangObject(this.constructorCall); } this.constructorCall = null; } else { this.constructorCall.resolve(this.scope); } } if ((this.modifiers & ExtraCompilerModifiers.AccSemicolonBody) != 0) { this.scope.problemReporter().methodNeedBody(this); } super.resolveStatements(); }
public void resolveStatements() { SourceTypeBinding sourceType = this.scope.enclosingSourceType(); if (!CharOperation.equals(sourceType.sourceName, this.selector)){ this.scope.problemReporter().missingReturnType(this); } // typeParameters are already resolved from Scope#connectTypeVariables() if (this.binding != null && !this.binding.isPrivate()) { sourceType.tagBits |= TagBits.HasNonPrivateConstructor; } // if null ==> an error has occurs at parsing time .... if (this.constructorCall != null) { if (sourceType.id == TypeIds.T_JavaLangObject && this.constructorCall.accessMode != ExplicitConstructorCall.This) { // cannot use super() in java.lang.Object if (this.constructorCall.accessMode == ExplicitConstructorCall.Super) { this.scope.problemReporter().cannotUseSuperInJavaLangObject(this.constructorCall); } this.constructorCall = null; } else { this.constructorCall.resolve(this.scope); } } if ((this.modifiers & ExtraCompilerModifiers.AccSemicolonBody) != 0) { this.scope.problemReporter().methodNeedBody(this); } super.resolveStatements(); }