org.eclipse.pde.api.tools_1.0.301.v20111129-2053

          restrictions, 
            access, 
            access2, 
            type1, 
            name, 
            new String[] { Util.getDescriptorName(type1), name });
        }
        else if (field.getConstantValue() != null)
        {
          changeFinalToNonFinal = true;
          addDelta(
            7, 
            2, 
            20, 
            restrictions, 
            access, 
            access2, 
            type1, 
            name, 
            new String[] { Util.getDescriptorName(type1), name });
        }
        else
        {
          addDelta(
            7, 
            2, 
            21, 
            restrictions, 
            access, 
            access2, 
            type1, 
            name, 
            new String[] { Util.getDescriptorName(type1), name });
        }
      }
    }
    else if (Flags.isFinal(access2)) {
      addDelta(
        7, 
        2, 
        31, 
        restrictions, 
        access, 
        access2, 
        type1, 
        name, 
        new String[] { Util.getDescriptorName(type1), name });
    }
    if (Flags.isStatic(access))
    {
      if (!Flags.isStatic(access2)) {
        addDelta(
          7, 
          2, 
          38, 
          restrictions, 
          access, 
          access2, 
          type1, 
          name, 
          new String[] { Util.getDescriptorName(type1), name });
      }
    }
    else if (Flags.isStatic(access2)) {
      addDelta(
        7, 
        2, 
        33, 
        restrictions, 
        access, 
        access2, 
        type1, 
        name, 
        new String[] { Util.getDescriptorName(type1), name });
    }
    if (Flags.isTransient(access))
    {
      if (!Flags.isTransient(access2)) {
        addDelta(
          7, 
          2, 
          45, 
          restrictions, 
          access, 
          access2, 
          type1, 
          name, 
          new String[] { Util.getDescriptorName(type1), name });
      }
    }
    else if (Flags.isTransient(access2)) {
      addDelta(
        7, 
        2, 
        35, 
        restrictions, 
        access, 
        access2, 
        type1, 
        name, 
        new String[] { Util.getDescriptorName(type1), name });
    }
    if (Flags.isVolatile(access))
    {
      if (!Flags.isVolatile(access2)) {
        addDelta(
          7, 
          2, 
          58, 
          restrictions, 
          access, 
          access2, 
          type1, 
          name, 
          new String[] { Util.getDescriptorName(type1), name });
      }
    }
    else if (Flags.isVolatile(access2)) {
      addDelta(
        7, 
        2, 
        57, 
        restrictions, 
        access, 
        access2, 
        type1, 
        name, 
        new String[] { Util.getDescriptorName(type1), name });
    }
    if (Flags.isDeprecated(access))
    {
      if (!Flags.isDeprecated(access2)) {
        addDelta(
          7, 
          3, 
          72, 
          restrictions, 
          access, 
          access2, 
          type1, 
          name, 
          new String[] { Util.getDescriptorName(type1), name });
      }
    }
    else if (Flags.isDeprecated(access2)) {
      addDelta(
        7, 
        1, 
        72, 
        restrictions, 
        access, 
        access2, 
        type1, 
        name, 
        new String[] { Util.getDescriptorName(type1), name });
    }
    if (field.getConstantValue() != null)
    {
      if (field2.getConstantValue() == null)
      {
        if (!changeFinalToNonFinal) {
          addDelta(
            7, 
            3, 
            54, 
            restrictions, 
            access, 
            access2, 
            type1, 
            name, 
            new String[] { Util.getDescriptorName(type1), name, String.valueOf(field.getConstantValue()) });
        }
      }
      else if (!field.getConstantValue().equals(field2.getConstantValue())) {
        addDelta(
          7, 
          2, 
          54, 
          restrictions, 
          access, 
          access2, 
          type1, 
          name, 
          new String[] { Util.getDescriptorName(type1), name, String.valueOf(field.getConstantValue()) });
      }
    }
    else if (field2.getConstantValue() != null) {
      addDelta(
        7, 
        1, 
        54, 
        restrictions, 
        access, 
        access2, 
        type1, 
        name, 
        new String[] { Util.getDescriptorName(type1), name, String.valueOf(field2.getConstantValue()) });
    }
  }
  
  private void getDeltaForMethod(IApiMethod method)
  {
    int access = method.getModifiers();
    if (Flags.isSynthetic(access)) {
      return;
    }
    String name = method.getName();
    String descriptor = method.getSignature();
    String key = getKeyForMethod(method, type1);
    IApiMethod method2 = type2.getMethod(name, descriptor);
    String methodDisplayName = getMethodDisplayName(method, type1);
    if (method2 == null)
    {
      if (method.isClassInitializer())
      {
        addDelta(
          getElementType(type1), 
          3, 
          7, 
          currentDescriptorRestrictions, 
          access, 
          0, 
          type1, 
          type1.getName(), 
          Util.getDescriptorName(type1));
        return;
      }
      if ((Flags.isPrivate(access)) || 
        (Util.isDefault(access)))
      {
        addDelta(
          getElementType(type1), 
          3, 
          getTargetType(method), 
          Flags.isAbstract(type2.getModifiers()) ? currentDescriptorRestrictions | 0x4 : currentDescriptorRestrictions, 
          access, 
          0, 
          type1, 
          getKeyForMethod(method, type1), 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
        return;
      }
      boolean found = false;
      if ((component2 != null) && (!method.isConstructor())) {
        if (type1.isInterface())
        {
          Set interfacesSet = getInterfacesSet(type2);
          if ((interfacesSet != null) && (isStatusOk())) {
            for (Iterator iterator = interfacesSet.iterator(); iterator.hasNext();)
            {
              IApiType superTypeDescriptor = (IApiType)iterator.next();
              IApiMethod method3 = superTypeDescriptor.getMethod(name, descriptor);
              if (method3 != null)
              {
                addDelta(
                  getElementType(type1), 
                  3, 
                  26, 
                  currentDescriptorRestrictions, 
                  access, 
                  method3.getModifiers(), 
                  type1, 
                  getKeyForMethod(method3, type1), 
                  new String[] { Util.getDescriptorName(type1), methodDisplayName });
                found = true;
                break;
              }
            }
          }
        }
        else
        {
          List superclassList = getSuperclassList(type2, true);
          if ((superclassList != null) && (isStatusOk())) {
            for (Iterator iterator = superclassList.iterator(); iterator.hasNext();)
            {
              IApiType superTypeDescriptor = (IApiType)iterator.next();
              IApiMethod method3 = superTypeDescriptor.getMethod(name, descriptor);
              if (method3 != null)
              {
                int access3 = method3.getModifiers();
                if ((Flags.isPublic(access3)) || 
                  (Flags.isProtected(access3)))
                {
                  addDelta(
                    getElementType(type1), 
                    3, 
                    26, 
                    currentDescriptorRestrictions, 
                    access, 
                    access3, 
                    type1, 
                    getKeyForMethod(method3, type1), 
                    new String[] { Util.getDescriptorName(type1), methodDisplayName });
                  found = true;
                  break;
                }
              }
            }
          }
        }
      }
      if (!found)
      {
        if ((visibilityModifiers == 1) && (component.hasApiDescription()))
        {
          IApiDescription apiDescription = null;
          try
          {
            apiDescription = component.getApiDescription();
          }
          catch (CoreException e)
          {
            reportStatus(e);
          }
          if (apiDescription != null)
          {
            IApiAnnotations apiAnnotations = apiDescription.resolveAnnotations(method.getHandle());
            if (apiAnnotations != null)
            {
              int restrictions = apiAnnotations.getRestrictions();
              if (RestrictionModifiers.isReferenceRestriction(restrictions)) {
                return;
              }
            }
          }
        }
        if (type1.isAnnotation())
        {
          addDelta(
            getElementType(type1), 
            3, 
            method.getDefaultValue() != null ? 27 : 28, 
            currentDescriptorRestrictions, 
            access, 
            0, 
            type1, 
            getKeyForMethod(method, type1), 
            new String[] { Util.getDescriptorName(type1), methodDisplayName });
        }
        else
        {
          int restrictions = currentDescriptorRestrictions;
          if ((RestrictionModifiers.isExtendRestriction(initialDescriptorRestrictions)) && 
            (!RestrictionModifiers.isExtendRestriction(currentDescriptorRestrictions))) {
            restrictions = initialDescriptorRestrictions;
          }
          addDelta(
            getElementType(type1), 
            3, 
            getTargetType(method), 
            Flags.isAbstract(type2.getModifiers()) ? restrictions | 0x4 : restrictions, 
            access, 
            0, 
            type1, 
            getKeyForMethod(method, type1), 
            new String[] { Util.getDescriptorName(type1), methodDisplayName });
        }
      }
      return;
    }
    int restrictions = currentDescriptorRestrictions;
    if (component2.hasApiDescription()) {
      try
      {
        IApiDescription apiDescription = component2.getApiDescription();
        IApiAnnotations resolvedAPIDescription = apiDescription.resolveAnnotations(method2.getHandle());
        if (resolvedAPIDescription != null) {
          restrictions |= resolvedAPIDescription.getRestrictions();
        }
      }
      catch (CoreException localCoreException1) {}
    }
    int referenceRestrictions = initialDescriptorRestrictions;
    int access2 = method2.getModifiers();
    if (component.hasApiDescription())
    {
      IApiDescription apiDescription = null;
      try
      {
        apiDescription = component.getApiDescription();
      }
      catch (CoreException e)
      {
        reportStatus(e);
      }
      if (apiDescription != null)
      {
        IApiAnnotations apiAnnotations = apiDescription.resolveAnnotations(method.getHandle());
        if (apiAnnotations != null) {
          referenceRestrictions |= apiAnnotations.getRestrictions();
        }
      }
    }
    if ((visibilityModifiers == 1) && (component.hasApiDescription())) {
      if (RestrictionModifiers.isReferenceRestriction(referenceRestrictions))
      {
        if (!RestrictionModifiers.isReferenceRestriction(restrictions)) {
          if (method.isConstructor())
          {
            addDelta(
              getElementType(type2), 
              1, 
              8, 
              currentDescriptorRestrictions, 
              access, 
              access2, 
              type1, 
              getKeyForMethod(method, type2), 
              new String[] { Util.getDescriptorName(type2), methodDisplayName });
          }
          else if (type2.isAnnotation())
          {
            if (method.getDefaultValue() != null) {
              addDelta(
                getElementType(type2), 
                1, 
                27, 
                currentDescriptorRestrictions, 
                access, 
                access2, 
                type1, 
                getKeyForMethod(method, type2), 
                new String[] { Util.getDescriptorName(type2), methodDisplayName });
            } else {
              addDelta(
                getElementType(type2), 
                1, 
                28, 
                currentDescriptorRestrictions, 
                access, 
                access2, 
                type1, 
                getKeyForMethod(method, type2), 
                new String[] { Util.getDescriptorName(type2), methodDisplayName });
            }
          }
          else
          {
            boolean found = false;
            if (component2 != null) {
              if (type1.isInterface())
              {
                Set interfacesSet = getInterfacesSet(type2);
                if ((interfacesSet != null) && (isStatusOk())) {
                  for (Iterator iterator = interfacesSet.iterator(); iterator.hasNext();)
                  {
                    IApiType superTypeDescriptor = (IApiType)iterator.next();
                    IApiMethod method3 = superTypeDescriptor.getMethod(name, descriptor);
                    if (method3 != null)
                    {
                      found = true;
                      break;
                    }
                  }
                }
              }
              else
              {
                List superclassList = getSuperclassList(type2, true);
                if (superclassList != null) {
                  for (Iterator iterator = superclassList.iterator(); iterator.hasNext();)
                  {
                    IApiType superTypeDescriptor = (IApiType)iterator.next();
                    IApiMethod method3 = superTypeDescriptor.getMethod(name, descriptor);
                    if (method3 != null)
                    {
                      int access3 = method3.getModifiers();
                      if ((Flags.isPublic(access3)) || 
                        (Flags.isProtected(access3)))
                      {
                        found = true;
                        break;
                      }
                    }
                  }
                }
              }
            }
            addDelta(
              getElementType(type2), 
              1, 
              found ? 36 : 25, 
              currentDescriptorRestrictions, 
              access, 
              access2, 
              type1, 
              getKeyForMethod(method, type2), 
              new String[] { Util.getDescriptorName(type2), methodDisplayName });
          }
        }
      }
      else if ((RestrictionModifiers.isReferenceRestriction(restrictions)) && (
        (Flags.isPublic(access2)) || (Flags.isProtected(access2))))
      {
        if (type2.isAnnotation()) {
          addDelta(
            getElementType(type2), 
            3, 
            method.getDefaultValue() != null ? 65 : 66, 
            currentDescriptorRestrictions, 
            access, 
            access2, 
            type1, 
            getKeyForMethod(method2, type2), 
            new String[] { Util.getDescriptorName(type2), methodDisplayName });
        } else if ((Flags.isPublic(access)) || (Flags.isProtected(access))) {
          addDelta(
            getElementType(type2), 
            3, 
            method.isConstructor() ? 63 : 62, 
            Flags.isAbstract(type2.getModifiers()) ? currentDescriptorRestrictions | 0x4 : currentDescriptorRestrictions, 
            access, 
            access2, 
            type1, 
            getKeyForMethod(method2, type2), 
            new String[] { Util.getDescriptorName(type2), methodDisplayName });
        }
        return;
      }
    }
    if ((component.hasApiDescription()) && (!method.isConstructor()) && (!method.isClassInitializer()) && 
      (!type1.isInterface()) && (!type1.isAnnotation()) && 
      (restrictions != referenceRestrictions) && 
      (!Flags.isFinal(access2)) && 
      (RestrictionModifiers.isOverrideRestriction(restrictions)) && 
      (!RestrictionModifiers.isOverrideRestriction(referenceRestrictions))) {
      addDelta(
        getElementType(method), 
        1, 
        37, 
        restrictions, 
        referenceRestrictions, 
        access, 
        access2, 
        type1, 
        getKeyForMethod(method2, type2), 
        new String[] { Util.getDescriptorName(type2), methodDisplayName });
    }
    String[] names1 = method.getExceptionNames();
    List list1 = null;
    if (names1 != null)
    {
      list1 = new ArrayList(names1.length);
      for (int i = 0; i < names1.length; i++) {
        list1.add(names1[i]);
      }
    }
    String[] names2 = method2.getExceptionNames();
    List list2 = null;
    if (names2 != null)
    {
      list2 = new ArrayList(names2.length);
      for (int i = 0; i < names2.length; i++) {
        list2.add(names2[i]);
      }
    }
    if (names1 != null)
    {
      if (names2 == null)
      {
        for (Iterator iterator = list1.iterator(); iterator.hasNext();)
        {
          String exceptionName = ((String)iterator.next()).replace('/', '.');
          if (isCheckedException(apiBaseline1, component, exceptionName))
          {
            addDelta(
              getElementType(method), 
              3, 
              5, 
              restrictions, 
              access, 
              access2, 
              type1, 
              key, 
              new String[] { Util.getDescriptorName(type1), methodDisplayName, exceptionName });
            break;
          }
          addDelta(
            getElementType(method), 
            3, 
            53, 
            restrictions, 
            access, 
            access2, 
            type1, 
            key, 
            new String[] { Util.getDescriptorName(type1), methodDisplayName, exceptionName });
        }
      }
      else
      {
        List removedExceptions = new ArrayList();
        for (Iterator iterator = list1.iterator(); iterator.hasNext();)
        {
          String exceptionName = ((String)iterator.next()).replace('/', '.');
          if (!list2.remove(exceptionName)) {
            removedExceptions.add(exceptionName);
          }
        }
        if (removedExceptions.size() != 0) {
          for (Iterator iterator = removedExceptions.iterator(); iterator.hasNext();)
          {
            String exceptionName = ((String)iterator.next()).replace('/', '.');
            if (isCheckedException(apiBaseline1, component, exceptionName))
            {
              addDelta(
                getElementType(method), 
                3, 
                5, 
                restrictions, 
                access, 
                access2, 
                type1, 
                key, 
                new String[] { Util.getDescriptorName(type1), methodDisplayName, exceptionName });
              break;
            }
            addDelta(
              getElementType(method), 
              3, 
              53, 
              restrictions, 
              access, 
              access2, 
              type1, 
              key, 
              new String[] { Util.getDescriptorName(type1), methodDisplayName, exceptionName });
          }
        }
        for (Iterator iterator = list2.iterator(); iterator.hasNext();)
        {
          String exceptionName = ((String)iterator.next()).replace('/', '.');
          if (isCheckedException(apiBaseline2, component2, exceptionName))
          {
            addDelta(
              getElementType(method), 
              1, 
              5, 
              restrictions, 
              access, 
              access2, 
              type1, 
              key, 
              new String[] { Util.getDescriptorName(type1), methodDisplayName, exceptionName });
            break;
          }
          addDelta(
            getElementType(method), 
            1, 
            53, 
            restrictions, 
            access, 
            access2, 
            type1, 
            key, 
            new String[] { Util.getDescriptorName(type1), methodDisplayName, exceptionName });
        }
      }
    }
    else if (names2 != null) {
      for (Iterator iterator = list2.iterator(); iterator.hasNext();)
      {
        String exceptionName = ((String)iterator.next()).replace('/', '.');
        if (isCheckedException(apiBaseline2, component2, exceptionName))
        {
          addDelta(
            getElementType(method), 
            1, 
            5, 
            restrictions, 
            access, 
            access2, 
            type1, 
            key, 
            new String[] { Util.getDescriptorName(type1), methodDisplayName, exceptionName });
          
          break;
        }
        addDelta(
          getElementType(method), 
          1, 
          53, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName, exceptionName });
      }
    }
    if (Flags.isVarargs(access))
    {
      if (!Flags.isVarargs(access2)) {
        addDelta(
          getElementType(method), 
          2, 
          55, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if (Flags.isVarargs(access2)) {
      addDelta(
        getElementType(method), 
        2, 
        4, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    }
    if (Flags.isProtected(access))
    {
      if ((Flags.isPrivate(access2)) || (Util.isDefault(access2))) {
        addDelta(
          getElementType(method), 
          2, 
          11, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      } else if (Flags.isPublic(access2)) {
        addDelta(
          getElementType(method), 
          2, 
          22, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if ((Flags.isPublic(access)) && (
      (Flags.isProtected(access2)) || 
      (Flags.isPrivate(access2)) || 
      (Util.isDefault(access2)))) {
      addDelta(
        getElementType(method), 
        2, 
        11, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    } else if ((Util.isDefault(access)) && (
      (Flags.isPublic(access2)) || 
      (Flags.isProtected(access2)))) {
      addDelta(
        getElementType(method), 
        2, 
        22, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    } else if ((Flags.isPrivate(access)) && (
      (Util.isDefault(access2)) || 
      (Flags.isPublic(access2)) || 
      (Flags.isProtected(access2)))) {
      addDelta(
        getElementType(method), 
        2, 
        22, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    }
    if (Flags.isAbstract(access))
    {
      if (!Flags.isAbstract(access2)) {
        addDelta(
          getElementType(method), 
          2, 
          1, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if (Flags.isAbstract(access2)) {
      addDelta(
        getElementType(method), 
        2, 
        30, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    }
    if (Flags.isFinal(access))
    {
      if (!Flags.isFinal(access2)) {
        addDelta(
          getElementType(method), 
          2, 
          18, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if (Flags.isFinal(access2))
    {
      int res = restrictions;
      if (!RestrictionModifiers.isOverrideRestriction(res))
      {
        if (RestrictionModifiers.isExtendRestriction(currentDescriptorRestrictions)) {
          res = currentDescriptorRestrictions;
        } else if (RestrictionModifiers.isExtendRestriction(initialDescriptorRestrictions)) {
          res = initialDescriptorRestrictions;
        }
        if (RestrictionModifiers.isOverrideRestriction(referenceRestrictions)) {
          res = referenceRestrictions;
        }
      }
      addDelta(
        getElementType(method2), 
        2, 
        31, 
        res, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type2), getMethodDisplayName(method2, type2) });
    }
    if (Flags.isStatic(access))
    {
      if (!Flags.isStatic(access2)) {
        addDelta(
          getElementType(method), 
          2, 
          38, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if (Flags.isStatic(access2)) {
      addDelta(
        getElementType(method), 
        2, 
        33, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    }
    if (Flags.isNative(access))
    {
      if (!Flags.isNative(access2)) {
        addDelta(
          getElementType(method), 
          2, 
          29, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if (Flags.isNative(access2)) {
      addDelta(
        getElementType(method), 
        2, 
        32, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    }
    if (Flags.isSynchronized(access))
    {
      if (!Flags.isSynchronized(access2)) {
        addDelta(
          getElementType(method), 
          2, 
          40, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if (Flags.isSynchronized(access2)) {
      addDelta(
        getElementType(method), 
        2, 
        34, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    }
    if (Flags.isDeprecated(access))
    {
      if (!Flags.isDeprecated(access2)) {
        addDelta(
          getElementType(method), 
          3, 
          72, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if (Flags.isDeprecated(access2)) {
      addDelta(
        getElementType(method), 
        1, 
        72, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    }
    String signature1 = method.getGenericSignature();
    String signature2 = method2.getGenericSignature();
    checkGenericSignature(signature1, signature2, method, method2);
    if (method.getDefaultValue() == null)
    {
      if (method2.getDefaultValue() != null) {
        addDelta(
          getElementType(method), 
          1, 
          2, 
          restrictions, 
          access, 
          access2, 
          type1, 
          key, 
          new String[] { Util.getDescriptorName(type1), methodDisplayName });
      }
    }
    else if (method2.getDefaultValue() == null) {
      addDelta(
        getElementType(method), 
        3, 
        2, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    } else if (!method.getDefaultValue().equals(method2.getDefaultValue())) {
      addDelta(
        getElementType(method), 
        2, 
        2, 
        restrictions, 
        access, 
        access2, 
        type1, 
        key, 
        new String[] { Util.getDescriptorName(type1), methodDisplayName });
    }
  }
  
  private Set getInterfacesSet(IApiType type)
  {
    HashSet set = new HashSet();
    status = null;
    collectAllInterfaces(type, set);
    if (set.isEmpty()) {
      return null;
    }
    return set;
  }
  
  private String getMethodDisplayName(IApiMethod method, IApiType type)
  {
    String methodName = null;
    if (method.isConstructor()) {
      methodName = type.getSimpleName();
    } else {
      methodName = method.getName();
    }
    String signature = null;
    String genericSignature = method.getGenericSignature();
    if (genericSignature != null) {
      signature = genericSignature;
    } else {
      signature = method.getSignature();
    }
    return Signature.toString(signature, methodName, null, false, false);
  }
  
  private SignatureDescriptor getSignatureDescriptor(String signature)
  {
    SignatureDescriptor signatureDescriptor = new SignatureDescriptor();
    SignatureReader signatureReader = new SignatureReader(signature);
    signatureReader.accept(new SignatureDecoder(signatureDescriptor));
    return signatureDescriptor;
  }
  
  private List getSuperclassList(IApiType type)
  {
    return getSuperclassList(type, false);
  }
  
  private List getSuperclassList(IApiType type, boolean includeObject)
  {
    return getSuperclassList(type, includeObject, false);
  }
  
  private List getSuperclassList(IApiType type, boolean includeObject, boolean includePrivate)
  {
    IApiType superClass = type;
    status = null;
    String superName = superClass.getSuperclassName();
    if ((Util.isJavaLangObject(superName)) && (!includeObject)) {
      return null;
    }
    List list = new ArrayList();
    try
    {
      do
      {
        superClass = superClass.getSuperclass();
        int visibility = 2;
        IApiComponent superComponent = superClass.getApiComponent();
        IApiDescription apiDescription = superComponent.getApiDescription();
        IApiAnnotations elementDescription = apiDescription.resolveAnnotations(superClass.getHandle());
        if (elementDescription != null) {
          visibility = elementDescription.getVisibility();
        }
        if ((includePrivate) || ((visibility & visibilityModifiers) != 0)) {
          list.add(superClass);
        }
        superName = superClass.getSuperclassName();
        if (superName == null) {
          break;
        }
      } while ((!Util.isJavaLangObject(superName)) || (includeObject));
    }
    catch (CoreException e)
    {
      reportStatus(e);
    }
    if (list.isEmpty()) {
      return null;
    }
    return list;
  }
  
  private void reportFieldAddition(IApiField field, IApiType type)
  {
    int access = field.getModifiers();
    String name = field.getName();
    if (Flags.isSynthetic(access)) {
      return;
    }
    if ((visibilityModifiers == 1) && (component2.hasApiDescription()))
    {
      IApiDescription apiDescription = null;
      try
      {
        apiDescription = component2.getApiDescription();
      }
      catch (CoreException e)
      {
        reportStatus(e);
      }
      if (apiDescription != null)
      {
        IApiAnnotations apiAnnotations = apiDescription.resolveAnnotations(field.getHandle());
        if (apiAnnotations != null)
        {
          int restrictions = apiAnnotations.getRestrictions();
          if (RestrictionModifiers.isReferenceRestriction(restrictions)) {
            return;
          }
        }
      }
    }
    if (field.isEnumConstant()) {
      addDelta(
        getElementType(type), 
        1, 
        12, 
        currentDescriptorRestrictions, 
        initialDescriptorRestrictions, 
        0, 
        access, 
        type1, 
        name, 
        new String[] { Util.getDescriptorName(type), name });
    } else {
      addDelta(
        getElementType(type), 
        1, 
        16, 
        currentDescriptorRestrictions, 
        initialDescriptorRestrictions, 
        0, 
        access, 
        type1, 
        name, 
        new String[] { Util.getDescriptorName(type), name });
    }
  }
  
  private void reportMethodAddition(IApiMethod method, IApiType type)
  {
    int access = method.getModifiers();
    if (method.isClassInitializer())
    {
      addDelta(
        getElementType(type), 
        1, 
        7, 
        currentDescriptorRestrictions, 
        0, 
        access, 
        type1, 
        type.getName(), 
        Util.getDescriptorName(type1));
      return;
    }
    if (Flags.isSynthetic(access)) {
      return;
    }
    IApiDescription apiDescription = null;
    if (((visibilityModifiers & 0x1) != 0) && (component2.hasApiDescription()))
    {
      int restrictions = 0;
      try
      {
        apiDescription = component2.getApiDescription();
      }
      catch (CoreException e)
      {
        reportStatus(e);
      }
      if (apiDescription != null)
      {
        IApiAnnotations apiAnnotations = apiDescription.resolveAnnotations(method.getHandle());
        if (apiAnnotations != null) {
          restrictions = apiAnnotations.getRestrictions();
        }
      }
      if ((visibilityModifiers == 1) && (RestrictionModifiers.isReferenceRestriction(restrictions))) {
        return;
      }
    }
    String methodDisplayName = getMethodDisplayName(method, type);
    int restrictionsForMethodAddition = currentDescriptorRestrictions;
    if (Flags.isFinal(type2.getModifiers())) {
      restrictionsForMethodAddition |= 0x2;
    }
    if ((apiDescription != null) && 
      (type2.isMemberType()) && (Flags.isProtected(type2.getModifiers())))
    {
      IApiType enclosingType = type2;
      try
      {
        do
        {
          if (enclosingType != null)
          {
            IApiAnnotations memberTypeAnnotations = apiDescription.resolveAnnotations(enclosingType.getHandle());
            if (memberTypeAnnotations != null)
            {
              int restrictions = memberTypeAnnotations.getRestrictions();
              if (RestrictionModifiers.isReferenceRestriction(restrictions)) {
                restrictionsForMethodAddition |= 0x8;
              }
              if (RestrictionModifiers.isExtendRestriction(restrictions))
              {
                restrictionsForMethodAddition |= 0x2;
                if (visibilityModifiers == 1) {
                  return;
                }
              }
              if (RestrictionModifiers.isImplementRestriction(restrictions)) {
                restrictionsForMethodAddition |= 0x1;
              }
            }
          }
          enclosingType = enclosingType.getEnclosingType();
        } while (enclosingType != null);
      }
      catch (CoreException e)
      {
        reportStatus(e);
      }
    }
    if ((Flags.isPublic(access)) || (Flags.isProtected(access)))
    {
      if (method.isConstructor())
      {
        addDelta(
          getElementType(type), 
          1, 
          8, 
          restrictionsForMethodAddition, 
          initialDescriptorRestrictions, 
          0, 
          access, 
          type1, 
          getKeyForMethod(method, type), 
          new String[] { Util.getDescriptorName(type), methodDisplayName });
      }
      else if (type.isAnnotation())
      {
        if (method.getDefaultValue() != null) {
          addDelta(
            getElementType(type), 
            1, 
            27, 
            restrictionsForMethodAddition, 
            initialDescriptorRestrictions, 
            0, 
            access, 
            type1, 
            getKeyForMethod(method, type), 
            new String[] { Util.getDescriptorName(type), methodDisplayName });
        } else {
          addDelta(
            getElementType(type), 
            1, 
            28, 
            restrictionsForMethodAddition, 
            initialDescriptorRestrictions, 
            0, 
            access, 
            type1, 
            getKeyForMethod(method, type), 
            new String[] { Util.getDescriptorName(type), methodDisplayName });
        }
      }
      else
      {
        boolean found = false;
        if (component2 != null)
        {
          String name = method.getName();
          String descriptor = method.getSignature();
          if (type1.isInterface())
          {
            Set interfacesSet = getInterfacesSet(type2);
            if ((interfacesSet != null) && (isStatusOk())) {
              for (Iterator iterator = interfacesSet.iterator(); iterator.hasNext();)
              {
                IApiType superTypeDescriptor = (IApiType)iterator.next();
                IApiMethod method3 = superTypeDescriptor.getMethod(name, descriptor);
                if (method3 != null)
                {
                  found = true;
                  break;
                }
              }
            }
          }
          else
          {
            List superclassList = getSuperclassList(type2, true);
            if ((superclassList != null) && (isStatusOk())) {
              for (Iterator iterator = superclassList.iterator(); iterator.hasNext();)
              {
                IApiType superTypeDescriptor = (IApiType)iterator.next();
                IApiMethod method3 = superTypeDescriptor.getMethod(name, descriptor);
                if (method3 != null)
                {
                  int access3 = method3.getModifiers();
                  if ((Flags.isPublic(access3)) || 
                    (Flags.isProtected(access3)))
                  {
                    found = true;
                    break;
                  }
                }
              }
            }
          }
        }
        if (!found)
        {
          if (component != null)
          {
            String name = method.getName();
            String descriptor = method.getSignature();
            if (type1.isInterface())
            {
              Set interfacesSet = getInterfacesSet(type1);
              if ((interfacesSet != null) && (isStatusOk())) {
                for (Iterator iterator = interfacesSet.iterator(); iterator.hasNext();)
                {
                  IApiType superTypeDescriptor = (IApiType)iterator.next();
                  IApiMethod method3 = superTypeDescriptor.getMethod(name, descriptor);
                  if (method3 != null)
                  {
                    found = true;
                    break;
                  }
                }
              }
            }
            else
            {
              List superclassList = getSuperclassList(type1, true);
              if ((superclassList != null) && (isStatusOk())) {
                for (Iterator iterator = superclassList.iterator(); iterator.hasNext();)
                {
                  IApiType superTypeDescriptor = (IApiType)iterator.next();
                  IApiMethod method3 = superTypeDescriptor.getMethod(name, descriptor);
                  if (method3 != null)
                  {
                    int access3 = method3.getModifiers();
                    if ((Flags.isPublic(access3)) || 
                      (Flags.isProtected(access3)))
                    {
                      found = true;
                   
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd