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

Examples of org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding


    int interfacesCount = superInterfacesBinding.length;
    int interfacesCountPosition = this.contentsOffset;
    this.contentsOffset += 2;
    int interfaceCounter = 0;
    for (int i = 0; i < interfacesCount; i++) {
      ReferenceBinding binding = superInterfacesBinding[i];
      if ((binding.tagBits & TagBits.HasMissingType) != 0) {
        continue;
      }
      interfaceCounter++;
      int interfaceIndex = this.constantPool.literalIndexForType(binding);
View Full Code Here


          resolvedPosition++;
        }

        // take into account the synthetic parameters
        if (methodBinding.declaringClass.isNestedType()) {
          ReferenceBinding enclosingInstanceTypes[];
          if ((enclosingInstanceTypes = methodBinding.declaringClass.syntheticEnclosingInstanceTypes()) != null) {
            for (int i = 0, max = enclosingInstanceTypes.length; i < max; i++) {
              // an enclosingInstanceType can only be a reference
              // binding. It cannot be
              // LongBinding or DoubleBinding
View Full Code Here

  public void recordInnerClasses(TypeBinding binding) {
    if (this.innerClassesBindings == null) {
      this.innerClassesBindings = new HashSet(INNER_CLASSES_SIZE);
    }
    ReferenceBinding innerClass = (ReferenceBinding) binding;
    this.innerClassesBindings.add(innerClass.erasure());
    ReferenceBinding enclosingType = innerClass.enclosingType();
    while (enclosingType != null
        && enclosingType.isNestedType()) {
      this.innerClassesBindings.add(enclosingType.erasure());
      enclosingType = enclosingType.enclosingType();
    }
  }
View Full Code Here

  if (CharOperation.equals(TypeConstants.SERIALVERSIONUID, field.name)
      && field.isStatic()
      && field.isPrivate()
      && field.isFinal()
      && TypeBinding.LONG == field.type) {
    ReferenceBinding referenceBinding = field.declaringClass;
    if (referenceBinding != null) {
      if (referenceBinding.findSuperTypeOriginatingFrom(TypeIds.T_JavaIoSerializable, false /*Serializable is not a class*/) != null) {
        return; // do not report field hiding for serialVersionUID field for class that implements Serializable
      }
    }
  }
  if (CharOperation.equals(TypeConstants.SERIALPERSISTENTFIELDS, field.name)
      && field.isStatic()
      && field.isPrivate()
      && field.isFinal()
      && field.type.dimensions() == 1
      && CharOperation.equals(TypeConstants.CharArray_JAVA_IO_OBJECTSTREAMFIELD, field.type.leafComponentType().readableName())) {
    ReferenceBinding referenceBinding = field.declaringClass;
    if (referenceBinding != null) {
      if (referenceBinding.findSuperTypeOriginatingFrom(TypeIds.T_JavaIoSerializable, false /*Serializable is not a class*/) != null) {
        return; // do not report field hiding for serialPersistenFields field for class that implements Serializable
      }
    }
  }
  boolean isLocal = hiddenVariable instanceof LocalVariableBinding;
View Full Code Here

}
public void illegalInstanceOfGenericType(TypeBinding checkedType, ASTNode location) {
  TypeBinding erasedType = checkedType.leafComponentType().erasure();
  StringBuffer recommendedFormBuffer = new StringBuffer(10);
  if (erasedType instanceof ReferenceBinding) {
    ReferenceBinding referenceBinding = (ReferenceBinding) erasedType;
    recommendedFormBuffer.append(referenceBinding.qualifiedSourceName());
  } else {
    recommendedFormBuffer.append(erasedType.sourceName());
  }
  int count = erasedType.typeVariables().length;
  if (count > 0) {
View Full Code Here

    .append(inheritedMethod.declaringClass.shortReadableName())
    .append('.')
    .append(inheritedMethod.shortReadableName());

  int id;
  final ReferenceBinding declaringClass = currentMethod.declaringClass;
  if (declaringClass.isInterface()
      && !inheritedMethod.isPublic()){ // interface inheriting Object protected method
    id = IProblem.IncompatibleReturnTypeForNonInheritedInterfaceMethod;
  } else {
    id = IProblem.IncompatibleReturnType;
  }
View Full Code Here

  if (CharOperation.equals(TypeConstants.SERIALVERSIONUID, field.name)
      && field.isStatic()
      && field.isFinal()
      && TypeBinding.LONG == field.type) {
    ReferenceBinding referenceBinding = field.declaringClass;
    if (referenceBinding != null) {
      if (referenceBinding.findSuperTypeOriginatingFrom(TypeIds.T_JavaIoSerializable, false /*Serializable is not a class*/) != null) {
        return; // do not report unused serialVersionUID field for class that implements Serializable
      }
    }
  }
  if (CharOperation.equals(TypeConstants.SERIALPERSISTENTFIELDS, field.name)
      && field.isStatic()
      && field.isFinal()
      && field.type.dimensions() == 1
      && CharOperation.equals(TypeConstants.CharArray_JAVA_IO_OBJECTSTREAMFIELD, field.type.leafComponentType().readableName())) {
    ReferenceBinding referenceBinding = field.declaringClass;
    if (referenceBinding != null) {
      if (referenceBinding.findSuperTypeOriginatingFrom(TypeIds.T_JavaIoSerializable, false /*Serializable is not a class*/) != null) {
        return; // do not report unused serialVersionUID field for class that implements Serializable
      }
    }
  }
  this.handle(
View Full Code Here

        && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
          // from 1.5 source level on, array#clone() resolves to array type, but codegen to #clone()Object - thus require extra inserted cast
      this.valueCast = runtimeTimeType;
    }
        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

  boolean isStatic = codegenBinding.isStatic();
  if (isStatic) {
    this.receiver.generateCode(currentScope, codeStream, false);
  } else if ((this.bits & ASTNode.DepthMASK) != 0 && this.receiver.isImplicitThis()) { // outer access ?
    // outer method can be reached through emulation if implicit access
    ReferenceBinding targetType = currentScope.enclosingSourceType().enclosingTypeAt((this.bits & ASTNode.DepthMASK) >> ASTNode.DepthSHIFT);
    Object[] path = currentScope.getEmulationPath(targetType, true /*only exact match*/, false/*consider enclosing arg*/);
    codeStream.generateOuterAccess(path, this, targetType, currentScope);
  } else {
    this.receiver.generateCode(currentScope, codeStream, true);
    if ((this.bits & NeedReceiverGenericCast) != 0) {
View Full Code Here

        return null;
      }
    }
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=245007 avoid secondary errors in case of
    // missing super type for anonymous classes ...
    ReferenceBinding declaringClass = this.binding.declaringClass;
    boolean avoidSecondary = declaringClass != null &&
                 declaringClass.isAnonymousType() &&
                 declaringClass.superclass() instanceof MissingTypeBinding;
    if (!avoidSecondary)
      scope.problemReporter().invalidMethod(this, this.binding);
    MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch;
    switch (this.binding.problemId()) {
      case ProblemReasons.Ambiguous :
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding

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.