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

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryMethod


  IBinaryMethod[] methods = typeInfo.getMethods();
  if (methods == null) {
    return;
  }
  for (int i = 0, methodCount = methods.length; i < methodCount; i++) {
    IBinaryMethod methodInfo = methods[i];
    // TODO (jerome) filter out synthetic members
    //                        indexer should not index them as well
    // if ((methodInfo.getModifiers() & IConstants.AccSynthetic) != 0) continue; // skip synthetic
    char[] signature = methodInfo.getGenericSignature();
    if (signature == null) signature = methodInfo.getMethodDescriptor();
    String[] pNames = null;
    try {
      pNames = Signature.getParameterTypes(new String(signature));
    } catch (IllegalArgumentException e) {
      // protect against malformed .class file (e.g. com/sun/crypto/provider/SunJCE_b.class has a 'a' generic signature)
      signature = methodInfo.getMethodDescriptor();
      pNames = Signature.getParameterTypes(new String(signature));
    }
    char[][] paramNames= new char[pNames.length][];
    for (int j= 0; j < pNames.length; j++) {
      paramNames[j]= pNames[j].toCharArray();
    }
    char[][] parameterTypes = ClassFile.translatedNames(paramNames);
    JavaModelManager manager = JavaModelManager.getJavaModelManager();
    String selector = new String(methodInfo.getSelector());
    if (methodInfo.isConstructor()) {
      selector =type.getElementName();
    }
    selector =  manager.intern(selector);
    for (int j= 0; j < pNames.length; j++) {
      pNames[j]= manager.intern(new String(parameterTypes[j]));
View Full Code Here


    IBinaryMethod[] existingMs = existingType.binMethods;
    if (newMethods.length != existingMs.length) {
      return true;
    }
    new_method_loop: for (int i = 0; i < newMethods.length; i++) {
      IBinaryMethod method = newMethods[i];
      char[] methodName = method.getSelector();
      for (int j = 0; j < existingMs.length; j++) {
        if (CharOperation.equals(existingMs[j].getSelector(), methodName)) {
          // candidate match
          if (!CharOperation.equals(method.getMethodDescriptor(), existingMs[j].getMethodDescriptor())) {
            // ok, the descriptors don't match, but is this a funky ctor on a non-static inner
            // type?
            // boolean mightBeOK =
            // skippableDescriptorPrefix!=null && // set for inner types
            // CharOperation.equals(methodName,NameMangler.INIT) && // ctor
            // CharOperation.prefixEquals(skippableDescriptorPrefix,method.getMethodDescriptor()); // checking for
            // prefix on the descriptor
            // if (mightBeOK) {
            // // OK, so the descriptor starts something like '(Lpkg/Foo;' - we now may need to look at the rest of the
            // // descriptor if it takes >1 parameter.
            // // eg. could be (Lpkg/C;Ljava/lang/String;) where the skippablePrefix is (Lpkg/C;
            // char [] md = method.getMethodDescriptor();
            // char[] remainder = CharOperation.subarray(md, skippableDescriptorPrefix.length, md.length);
            // if (CharOperation.equals(remainder,BRACKET_V)) continue new_method_loop; // no other parameters to worry
            // about
            // char[] comparableSig = CharOperation.subarray(existingMethods[j].signature, 1,
            // existingMethods[j].signature.length);
            // boolean match = CharOperation.equals(comparableSig, remainder);
            // if (match) continue new_method_loop;
            // }
            continue; // might be overloading
          } else {
            // matching sigs
            IBinaryMethod existing = existingMs[j];
            if (!modifiersEqual(method.getModifiers(), existing.getModifiers())) {
              return true;
            }

            if (exceptionClausesDiffer(existing, method)) {
              return true;
            }

            char[] existingGSig = existing.getGenericSignature();
            char[] methodGSig = method.getGenericSignature();
            if ((existingGSig == null && methodGSig != null) || (existingGSig != null && methodGSig == null)) {
              return true;
            }
            if (existingGSig != null) {
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryMethod

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.