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

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


    if (annotations != null) {
      int length;
      if ((length = annotations.length) >= 0) {
        switch (kind) {
          case Binding.PACKAGE :
            PackageBinding packageBinding = (PackageBinding) recipient;
            if ((packageBinding.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return;
            break;
          case Binding.TYPE :
          case Binding.GENERIC_TYPE :
            ReferenceBinding type = (ReferenceBinding) recipient;
            if ((type.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return;
            break;
          case Binding.METHOD :
            MethodBinding method = (MethodBinding) recipient;
            if ((method.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return;
            break;
          case Binding.FIELD :
            FieldBinding field = (FieldBinding) recipient;
            if ((field.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return;
            break;
          case Binding.LOCAL :
            LocalVariableBinding local = (LocalVariableBinding) recipient;
            if ((local.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return;
            break;
          default :
            return;
        }
        for (int i = 0; i < length; i++) {
          TypeReference annotationTypeRef = annotations[i].type;
          // only resolve type name if 'Deprecated' last token
          if (!CharOperation.equals(TypeConstants.JAVA_LANG_DEPRECATED[2], annotationTypeRef.getLastToken())) continue;
          TypeBinding annotationType = annotations[i].type.resolveType(scope);
          if(annotationType != null && annotationType.isValidBinding() && annotationType.id == TypeIds.T_JavaLangDeprecated) {
            switch (kind) {
              case Binding.PACKAGE :
                PackageBinding packageBinding = (PackageBinding) recipient;
                packageBinding.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved);
                return;
              case Binding.TYPE :
              case Binding.GENERIC_TYPE :
              case Binding.TYPE_PARAMETER :
                ReferenceBinding type = (ReferenceBinding) recipient;
                type.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved);
                return;
              case Binding.METHOD :
                MethodBinding method = (MethodBinding) recipient;
                method.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved);
                return;
              case Binding.FIELD :
                FieldBinding field = (FieldBinding) recipient;
                field.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved);
                return;
              case Binding.LOCAL :
                LocalVariableBinding local = (LocalVariableBinding) recipient;
                local.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved);
                return;
              default:
                return;
            }
          }
        }
      }
    }
    switch (kind) {
      case Binding.PACKAGE :
        PackageBinding packageBinding = (PackageBinding) recipient;
        packageBinding.tagBits |= TagBits.DeprecatedAnnotationResolved;
        return;
      case Binding.TYPE :
      case Binding.GENERIC_TYPE :
      case Binding.TYPE_PARAMETER :
View Full Code Here


  // receiverType can be an array binding in one case... see if you can change it
  if (receiverType instanceof ArrayBinding)
    return false;
  ReferenceBinding type = (ReferenceBinding) receiverType;
  PackageBinding declaringPackage = fieldBinding.declaringClass.fPackage;
  TypeBinding originalDeclaringClass = fieldBinding.declaringClass .original();
  do {
    if (type.isCapture()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002
      if (TypeBinding.equalsEquals(originalDeclaringClass, type.erasure().original())) return true
    } else {
View Full Code Here

  // receiverType can be an array binding in one case... see if you can change it
  if (receiverType instanceof ArrayBinding)
    return false;
  ReferenceBinding type = (ReferenceBinding) receiverType;
  PackageBinding declaringPackage = methodBinding.declaringClass.fPackage;
  TypeBinding originalDeclaringClass = methodBinding.declaringClass .original();
  do {
    if (type.isCapture()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002
      if (TypeBinding.equalsEquals(originalDeclaringClass, type.erasure().original())) return true;
    } else {
View Full Code Here

    return binding;

  int length = compoundName.length;
  int currentIndex = 1;
  foundType: if (binding instanceof PackageBinding) {
    PackageBinding packageBinding = (PackageBinding) binding;

    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
View Full Code Here

TOP

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

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.