Examples of IBinaryField


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

  if (fields == null) {
    return;
  }
  JavaModelManager manager = JavaModelManager.getJavaModelManager();
  for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) {
    IBinaryField fieldInfo = fields[i];
    IField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName())));
    newElements.put(field, fieldInfo);
    childrenHandles.add(field);
  }
}
View Full Code Here

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

    IBinaryField[] existingFs = existingType.binFields;
    if (newFields.length != existingFs.length) {
      return true;
    }
    new_field_loop: for (int i = 0; i < newFields.length; i++) {
      IBinaryField field = newFields[i];
      char[] fieldName = field.getName();
      for (int j = 0; j < existingFs.length; j++) {
        if (CharOperation.equals(existingFs[j].getName(), fieldName)) {
          IBinaryField existing = existingFs[j];
          if (!modifiersEqual(field.getModifiers(), existing.getModifiers())) {
            return true;
          }
          if (!CharOperation.equals(existing.getTypeName(), field.getTypeName())) {
            return true;
          }

          char[] existingGSig = existing.getGenericSignature();
          char[] fieldGSig = field.getGenericSignature();
          if ((existingGSig == null && fieldGSig != null) || (existingGSig != null && fieldGSig == null)) {
            return true;
          }
          if (existingGSig != null) {
            if (!CharOperation.equals(existingGSig, fieldGSig)) {
              return true;
            }
          }

          continue new_field_loop;
        }
      }
      return true;
    }

    // methods
    // CompactMemberStructureRepresentation[] existingMethods = existingType.methods;
    IBinaryMethod[] newMethods = reader.getMethods();
    if (newMethods == null) {
      newMethods = CompactTypeStructureRepresentation.NoMethod;
    }

    // all redundant for now ... could be an optimization at some point...

    // Ctors in a non-static inner type have an 'extra parameter' of the enclosing type.
    // If skippableDescriptorPrefix gets set here then it is set to the descriptor portion
    // for this 'extra parameter'. For an inner class of pkg.Foo the skippable descriptor
    // prefix will be '(Lpkg/Foo;' - so later when comparing <init> methods we know what to
    // compare.
    // IF THIS CODE NEEDS TO GET MORE COMPLICATED, I THINK ITS WORTH RIPPING IT ALL OUT AND
    // CREATING THE STRUCTURAL CHANGES OBJECT BASED ON CLASSREADER OUTPUT RATHER THAN
    // THE RESOLVEDTYPE - THEN THERE WOULD BE NO NEED TO TREAT SOME METHODS IN A PECULIAR
    // WAY.
    // char[] skippableDescriptorPrefix = null;
    // char[] enclosingTypeName = reader.getEnclosingTypeName();
    // boolean isStaticType = Modifier.isStatic(reader.getModifiers());
    // if (!isStaticType && enclosingTypeName!=null) {
    // StringBuffer sb = new StringBuffer();
    // sb.append("(L").append(new String(enclosingTypeName)).append(";");
    // skippableDescriptorPrefix = sb.toString().toCharArray();
    // }
    //
    //
    // // remove the aspectOf, hasAspect, clinit and ajc$XXX methods
    // // from those we compare with the existing methods - bug 129163
    // List nonGenMethods = new ArrayList();
    // for (int i = 0; i < newMethods.length; i++) {
    // IBinaryMethod method = newMethods[i];
    // // if ((method.getModifiers() & 0x1000)!=0) continue; // 0x1000 => synthetic - will cause us to skip access$0 - is this
    // always safe?
    // char[] methodName = method.getSelector();
    // // if (!CharOperation.equals(methodName,NameMangler.METHOD_ASPECTOF) &&
    // // !CharOperation.equals(methodName,NameMangler.METHOD_HASASPECT) &&
    // // !CharOperation.equals(methodName,NameMangler.STATIC_INITIALIZER) &&
    // // !CharOperation.prefixEquals(NameMangler.AJC_DOLLAR_PREFIX,methodName) &&
    // // !CharOperation.prefixEquals(NameMangler.CLINIT,methodName)) {
    // nonGenMethods.add(method);
    // // }
    // }
    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

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

}
/*
* @see IField
*/
public Object getConstant() throws JavaModelException {
  IBinaryField info = (IBinaryField) getElementInfo();
  return convertConstant(info.getConstant());
}
View Full Code Here

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

}
/*
* @see IMember
*/
public int getFlags() throws JavaModelException {
  IBinaryField info = (IBinaryField) getElementInfo();
  return info.getModifiers();
}
View Full Code Here

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

}
/*
* @see IField
*/
public String getTypeSignature() throws JavaModelException {
  IBinaryField info = (IBinaryField) getElementInfo();
  return new String(ClassFile.translatedName(info.getTypeName()));
}
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.env.IBinaryField

  if (fields == null) {
    return;
  }
  JavaModelManager manager = JavaModelManager.getJavaModelManager();
  for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) {
    IBinaryField fieldInfo = fields[i];
    BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName())));
    newElements.put(field, fieldInfo);
    childrenHandles.add(field);
    generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements);
  }
}
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.env.IBinaryField

  if (fields == null) {
    return;
  }
  JavaModelManager manager = JavaModelManager.getJavaModelManager();
  for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) {
    IBinaryField fieldInfo = fields[i];
    BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName())));
    newElements.put(field, fieldInfo);
    childrenHandles.add(field);
    generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements);
  }
}
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.env.IBinaryField

  if (fields == null) {
    return;
  }
  JavaModelManager manager = JavaModelManager.getJavaModelManager();
  for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) {
    IBinaryField fieldInfo = fields[i];
    BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName())));
    newElements.put(field, fieldInfo);
    childrenHandles.add(field);
    generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements);
  }
}
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.env.IBinaryField

public boolean equals(Object o) {
  if (!(o instanceof BinaryField)) return false;
  return super.equals(o);
}
public IAnnotation[] getAnnotations() throws JavaModelException {
  IBinaryField info = (IBinaryField) getElementInfo();
  IBinaryAnnotation[] binaryAnnotations = info.getAnnotations();
  return getAnnotations(binaryAnnotations, info.getTagBits());
}
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.env.IBinaryField

}
/*
* @see IField
*/
public Object getConstant() throws JavaModelException {
  IBinaryField info = (IBinaryField) getElementInfo();
  return convertConstant(info.getConstant());
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.