Examples of MethodScope


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

  public TypeBinding resolveType(BlockScope scope) {
 
    // implicit this
    this.constant = Constant.NotAConstant;
    TypeBinding snippetType = null;
    MethodScope methodScope = scope.methodScope();
    if (!this.isImplicit && !checkAccess(methodScope)) {
      return null;
    }
    snippetType = scope.enclosingSourceType();
   
    this.delegateThis = scope.getField(snippetType, DELEGATE_THIS, this);
    if (this.delegateThis == null || !this.delegateThis.isValidBinding()) {
      // should not happen
      // if this happen we should report illegal access to this in a static context
      methodScope.problemReporter().errorThisSuperInStatic(this);
      return null;
    }
    return this.resolvedType = this.delegateThis.type;
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

    this.scribe.space();
    /*
     * Print the method return type
     */ 
    final TypeReference returnType = annotationTypeMemberDeclaration.returnType;
    final MethodScope annotationTypeMemberDeclarationScope = annotationTypeMemberDeclaration.scope;
   
    if (returnType != null) {
      returnType.traverse(this, annotationTypeMemberDeclarationScope);
    }
    /*
 
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

   
    /*
     * Print the method return type
     */ 
    final TypeReference returnType = methodDeclaration.returnType;
    final MethodScope methodDeclarationScope = methodDeclaration.scope;
   
    if (returnType != null) {
      returnType.traverse(this, methodDeclarationScope);
    }
    /*
 
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

   * by the ITD can be resolved.  For example, if type variables are referred to in the ontype for the ITD,
   * they have to be resolved against the ontype, not the aspect containing the ITD.
   */
  public void ensureScopeSetup() {
    if (scopeSetup) return; // don't do it again
    MethodScope scope = this.scope;
   
    TypeReference ot = onType;
    ReferenceBinding rb = null;
   
    if (ot instanceof ParameterizedQualifiedTypeReference) { // pr132349
      ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) ot;
      if (pref.typeArguments!=null && pref.typeArguments.length!=0) {
        boolean usingNonTypeVariableInITD = false;
        // Check if any of them are not type variables
        for (int i = 0; i < pref.typeArguments.length; i++) {
          TypeReference[] refs = pref.typeArguments[i];
          for (int j = 0; refs!=null && j < refs.length; j++) {
            TypeBinding tb = refs[j].getTypeBindingPublic(scope.parent);
            if (!tb.isTypeVariable() && !(tb instanceof ProblemReferenceBinding)) {
              usingNonTypeVariableInITD = true;
            }
           
          }
        }
        if (usingNonTypeVariableInITD) {
          scope.problemReporter().signalError(sourceStart,sourceEnd,
            "Cannot make inter-type declarations on parameterized types");
          // to prevent disgusting cascading errors after this problem - lets null out what leads to them (pr105038)
          this.arguments=null;
          this.returnType=new SingleTypeReference(TypeReference.VOID,0L);
         
          this.ignoreFurtherInvestigation=true;
          ReferenceBinding closestMatch = null;
          rb = new ProblemReferenceBinding(ot.getParameterizedTypeName(),closestMatch,0);   
          onType=null;
        }
      }
   
    }

    // Work out the real base type
    if (ot instanceof ParameterizedSingleTypeReference) {
      ParameterizedSingleTypeReference pref = (ParameterizedSingleTypeReference) ot;
      long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
      ot = new SingleTypeReference(pref.token,pos);
    } else if (ot instanceof ParameterizedQualifiedTypeReference) {
      ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) ot;
      long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
      ot = new QualifiedTypeReference(pref.tokens,new long[]{pos});//SingleTypeReference(pref.Quatoken,pos);
    }
   
    // resolve it
    if (rb==null) {
      rb = (ReferenceBinding)ot.getTypeBindingPublic(scope.parent);
    }
   
    // pr203646 - if we have ended up with the raw type, get back to the underlying generic one.
    if (rb.isRawType() && rb.isMemberType()) {
      // if the real target type used a type variable alias then we can do this OK, but need to switch things around, we want the generic type
      rb = ((RawTypeBinding)rb).type;
    }
   
    if (rb instanceof TypeVariableBinding) {
      scope.problemReporter().signalError(sourceStart,sourceEnd,
            "Cannot make inter-type declarations on type variables, use an interface and declare parents");
      // to prevent disgusting cascading errors after this problem - lets null out what leads to them (pr105038)
      this.arguments=null;
      this.returnType=new SingleTypeReference(TypeReference.VOID,0L);
     
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

      superBinding = ((ParameterizedMethodBinding) superBinding).original();
    }
    EclipseFactory factory = ((AjLookupEnvironment) method.scope.environment()).factory;
    if (depthCounter != 0 && targetClass.isInterface()) {// pr198196 - when calling MarkerInterface.super.XXX()
      if (call.isSuperAccess() && !call.binding.isStatic()) {
        MethodScope currentMethodScope = scope.methodScope();
        SourceTypeBinding sourceType = currentMethodScope.enclosingSourceType();
        FieldBinding field = sourceType.addSyntheticFieldForInnerclass(targetClass);
        call.receiver = new KnownFieldReference(field, call.receiver.sourceStart, call.receiver.sourceEnd);
      } else {
        return;
      }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

    codeStream.reset(this, classFile);
    TypeDeclaration declaringType = classScope.referenceContext;

    // initialize local positions - including initializer scope.
    MethodScope staticInitializerScope = declaringType.staticInitializerScope;
    staticInitializerScope.computeLocalVariablePositions(0, codeStream);

    // 1.4 feature
    // This has to be done before any other initialization
    // AspectJ Extension - move logic to helper method
    // was:
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

    return output;
  }

  public void resolve(ClassScope classScope) {

    this.scope = new MethodScope(classScope, classScope.referenceContext, true);
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

      if (visitor.visit(this, this.scope)) {
        if (this.types != null && isPackageInfo()) {
                // resolve synthetic type declaration
          final TypeDeclaration syntheticTypeDeclaration = types[0];
          // resolve javadoc package if any
          final MethodScope methodScope = syntheticTypeDeclaration.staticInitializerScope;
          if (this.javadoc != null) {
            this.javadoc.traverse(visitor, methodScope);
          }
          if (this.currentPackage != null) {
            final Annotation[] annotations = this.currentPackage.annotations;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

      }
      if (this.indexOfFirstFieldBinding == 1) { // was an implicit reference to the first field binding
        ReferenceBinding declaringClass = lastFieldBinding.declaringClass;
        // check if accessing enum static field in initializer         
        if (declaringClass.isEnum()) {
          MethodScope methodScope = currentScope.methodScope();
          SourceTypeBinding sourceType = methodScope.enclosingSourceType();
          if (lastFieldBinding.isStatic()
              && (sourceType == declaringClass || sourceType.superclass == declaringClass) // enum constant body
              && lastFieldBinding.constant() == Constant.NotAConstant
              && !methodScope.isStatic
              && methodScope.isInsideInitializerOrConstructor()) {
            currentScope.problemReporter().enumStaticFieldUsedDuringInitialization(lastFieldBinding, this);
          }
        }       
      }
      // check if final blank field
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

      if (this.indexOfFirstFieldBinding == 1) { // was an implicit reference to the first field binding
        FieldBinding fieldBinding = (FieldBinding) this.binding;
        ReferenceBinding declaringClass = fieldBinding.declaringClass;
        // check if accessing enum static field in initializer         
        if (declaringClass.isEnum()) {
          MethodScope methodScope = currentScope.methodScope();
          SourceTypeBinding sourceType = methodScope.enclosingSourceType();
          if (fieldBinding.isStatic()
              && (sourceType == declaringClass || sourceType.superclass == declaringClass) // enum constant body
              && fieldBinding.constant() == Constant.NotAConstant
              && !methodScope.isStatic
              && methodScope.isInsideInitializerOrConstructor()) {
            currentScope.problemReporter().enumStaticFieldUsedDuringInitialization(fieldBinding, this);
          }
        }       
        // check if reading a final blank field
        if (fieldBinding.isBlankFinal()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.