Package org.aspectj.org.eclipse.jdt.internal.compiler.lookup

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


    }
        if (this.valueCast instanceof ReferenceBinding) {
      ReferenceBinding referenceCast = (ReferenceBinding) this.valueCast;
      if (!referenceCast.canBeSeenBy(scope)) {
            scope.problemReporter().invalidType(this,
                new ProblemReferenceBinding(
              CharOperation.splitOn('.', referenceCast.shortReadableName()),
              referenceCast,
              ProblemReasons.NotVisible));
      }
        }   
View Full Code Here


    while (currentIndex < length) {
      binding = packageBinding.getTypeOrPackage(compoundName[currentIndex++]);
      invocationSite.setFieldIndex(currentIndex);
       if (binding == null) {
         if (currentIndex == length) // must be a type if its the last name, otherwise we have no idea if its a package or type
          return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), null, ProblemReasons.NotFound);
        else
          return new ProblemBinding(CharOperation.subarray(compoundName, 0, currentIndex), ProblemReasons.NotFound);
       }
       if (binding instanceof ReferenceBinding) {
         if (!binding.isValidBinding())
          return new ProblemReferenceBinding(
                  CharOperation.subarray(compoundName, 0, currentIndex),
                  ((ReferenceBinding)binding).closestMatch(),
                  binding.problemId());
         if (!this.canBeSeenByForCodeSnippet((ReferenceBinding) binding, receiverType))
          return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), (ReferenceBinding) binding, ProblemReasons.NotVisible);
         break foundType;
       }
       packageBinding = (PackageBinding) binding;
    }

    // It is illegal to request a PACKAGE from this method.
    return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), null, ProblemReasons.NotFound);
  }

  // know binding is now a ReferenceBinding
  while (currentIndex < length) {
    ReferenceBinding typeBinding = (ReferenceBinding) binding;
    char[] nextName = compoundName[currentIndex++];
    invocationSite.setFieldIndex(currentIndex);
    if ((binding = findFieldForCodeSnippet(typeBinding, nextName, invocationSite)) != null) {
      if (!binding.isValidBinding()) {
        return new ProblemFieldBinding(
            (FieldBinding)binding,
            ((FieldBinding)binding).declaringClass,
            CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'),
            binding.problemId());
      }
      break; // binding is now a field
    }
    if ((binding = findMemberType(nextName, typeBinding)) == null)
      return new ProblemBinding(CharOperation.subarray(compoundName, 0, currentIndex), typeBinding, ProblemReasons.NotFound);
     if (!binding.isValidBinding())
      return new ProblemReferenceBinding(
                CharOperation.subarray(compoundName, 0, currentIndex),
                ((ReferenceBinding)binding).closestMatch(),
                binding.problemId());
  }
View Full Code Here

          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);
     
      this.ignoreFurtherInvestigation=true;
      ReferenceBinding closestMatch = null;
      if (((TypeVariableBinding)rb).firstBound!=null) {
        closestMatch = ((TypeVariableBinding)rb).firstBound.enclosingType();
      }
      rb = new ProblemReferenceBinding(rb.compoundName,closestMatch,0);
    }

   
    // if resolution failed, give up - someone else is going to report an error
    if (rb instanceof ProblemReferenceBinding) return;
View Full Code Here

      scope.problemReporter().typeMismatchError(enclosingInstanceType, expectedType, this.enclosingInstance);
      return this.resolvedType = receiverType;
    }

    if (receiverType.isTypeVariable()) {
      receiverType = new ProblemReferenceBinding(receiverType.sourceName(), (ReferenceBinding)receiverType, ProblemReasons.IllegalSuperTypeVariable);
      scope.problemReporter().invalidType(this, receiverType);
      return null;
    } else if (this.type != null && receiverType.isEnum()) { // tolerate enum constant body
      scope.problemReporter().cannotInstantiate(this.type, receiverType);
      return this.resolvedType = receiverType;
View Full Code Here

  private ReferenceBinding lookupBinding(String sname) {
    char[][] name = CharOperation.splitOn('.', sname.toCharArray());
    ReferenceBinding rb = lookupEnvironment.getType(name);
    if (rb == null && !sname.equals(UnresolvedType.MISSING_NAME)) {
      return new ProblemReferenceBinding(name, null, ProblemReasons.NotFound);
    }
    return rb;
  }
View Full Code Here

        setGenericCast(length, typeCast);
          if (typeCast instanceof ReferenceBinding) {
        ReferenceBinding referenceCast = (ReferenceBinding) typeCast;
        if (!referenceCast.canBeSeenBy(scope)) {
              scope.problemReporter().invalidType(this,
                  new ProblemReferenceBinding(
                CharOperation.splitOn('.', referenceCast.shortReadableName()),
                referenceCast,
                ProblemReasons.NotVisible));
        }
          }           
View Full Code Here

public TypeBinding resolveSuperType(ClassScope scope) {
  // assumes the implementation of resolveType(ClassScope) will call back to detect cycles
  if (resolveType(scope) == null) return null;

  if (this.resolvedType.isTypeVariable()) {
    this.resolvedType = new ProblemReferenceBinding(getTypeName(), (ReferenceBinding) this.resolvedType, ProblemReasons.IllegalSuperTypeVariable);
    reportInvalidType(scope);
    return null;
  }
  return this.resolvedType;
}
View Full Code Here

    } else if (!referenceBinding.isValidBinding()) {
      switch(referenceBinding.problemId()) {
        case ProblemReasons.NotVisible :
        case ProblemReasons.NonStaticReferenceInStaticContext :
          if (referenceBinding instanceof ProblemReferenceBinding) {
            ProblemReferenceBinding problemReferenceBinding = (ProblemReferenceBinding) referenceBinding;
            ReferenceBinding binding2 = problemReferenceBinding.closestMatch();
            ITypeBinding binding = (ITypeBinding) this.bindingTables.compilerBindingsToASTBindings.get(binding2);
            if (binding != null) {
              return binding;
            }
            binding = new TypeBinding(this, binding2);
View Full Code Here

      this.ignoreFurtherInvestigation=true;
      ReferenceBinding closestMatch = null;
      if (((TypeVariableBinding)rb).firstBound!=null) {
        closestMatch = ((TypeVariableBinding)rb).firstBound.enclosingType();
      }
      rb = new ProblemReferenceBinding(rb.compoundName,closestMatch,0);
    }

   
    // if resolution failed, give up - someone else is going to report an error
    if (rb instanceof ProblemReferenceBinding) return;
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding

Copyright © 2018 www.massapicom. 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.