@Override public boolean equals(Object o) { if (!(o instanceof BinaryType)) return false; return super.equals(o); }
public String[] getCategories() throws JavaModelException { SourceMapper mapper= getSourceMapper(); if (mapper != null) { // ensure the class file's buffer is open so that categories are computed ((ClassFile)getClassFile()).getBuffer(); if (mapper.categories != null) { String[] categories = (String[]) mapper.categories.get(this); if (categories != null) return categories; } } return CharOperation.NO_STRINGS; } public String getKey() {
public String getKey() { try { return getKey(false/*don't open*/); } catch (JavaModelException e) { // happen only if force open is true return null; } } /**
@Override protected void toStringName(StringBuffer buffer) { if (getElementName().length() > 0) super.toStringName(buffer); else buffer.append("<anonymous>"); //$NON-NLS-1$ } @Override
/** * @see org.eclipse.jdt.internal.core.JavaElement#hashCode() */ public int hashCode() { int hash = super.hashCode(); for (int i = 0, length = this.parameterTypes.length; i < length; i++) { hash = Util.combineHashCodes(hash, getErasedParameterType(i).hashCode()); } return hash; } /*
@Override public boolean isStructureKnown() throws JavaModelException { return ((IJavaElement)getOpenableParent()).isStructureKnown(); } /*
public String readableName() { StringBuffer buffer = new StringBuffer(super.readableName()); buffer.append("("); //$NON-NLS-1$ String[] paramTypes = this.parameterTypes; int length; if (paramTypes != null && (length = paramTypes.length) > 0) { for (int i = 0; i < length; i++) { buffer.append(Signature.toString(paramTypes[i])); if (i < length - 1) { buffer.append(", "); //$NON-NLS-1$ } } } buffer.append(")"); //$NON-NLS-1$ return buffer.toString(); } public JavaElement resolved(Binding binding) {
protected IAnnotation[] getAnnotations(IBinaryAnnotation[] binaryAnnotations, long tagBits) { IAnnotation[] standardAnnotations = getStandardAnnotations(tagBits); if (binaryAnnotations == null) return standardAnnotations; int length = binaryAnnotations.length; int standardLength = standardAnnotations.length; int fullLength = length + standardLength; if (fullLength == 0) { return Annotation.NO_ANNOTATIONS; } IAnnotation[] annotations = new IAnnotation[fullLength]; for (int i = 0; i < length; i++) { annotations[i] = Util.getAnnotation(this, binaryAnnotations[i], null); } System.arraycopy(standardAnnotations, 0, annotations, length, standardLength); return annotations; } private IAnnotation getAnnotation(char[][] annotationName) {
protected IAnnotation[] getStandardAnnotations(long tagBits) { if ((tagBits & TagBits.AllStandardAnnotationsMask) == 0) return Annotation.NO_ANNOTATIONS; ArrayList annotations = new ArrayList(); if ((tagBits & TagBits.AnnotationTargetMASK) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_ANNOTATION_TARGET)); } if ((tagBits & TagBits.AnnotationRetentionMASK) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_ANNOTATION_RETENTION)); } if ((tagBits & TagBits.AnnotationDeprecated) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_DEPRECATED)); } if ((tagBits & TagBits.AnnotationDocumented) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_ANNOTATION_DOCUMENTED)); } if ((tagBits & TagBits.AnnotationInherited) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_ANNOTATION_INHERITED)); } // note that JAVA_LANG_SUPPRESSWARNINGS and JAVA_LANG_OVERRIDE cannot appear in binaries return (IAnnotation[]) annotations.toArray(new IAnnotation[annotations.size()]); }
@Override public IOrdinaryClassFile getClassFile() { return (IOrdinaryClassFile) super.getClassFile(); } @Override
protected void toStringName(StringBuffer buffer) { if (getElementName().length() > 0) super.toStringName(buffer); else buffer.append("<anonymous>"); //$NON-NLS-1$ } public String getAttachedJavadoc(IProgressMonitor monitor) throws JavaModelException {
/** * @see org.eclipse.jdt.internal.core.JavaElement#hashCode() */ @Override public int hashCode() { int hash = super.hashCode(); for (int i = 0, length = this.parameterTypes.length; i < length; i++) { hash = Util.combineHashCodes(hash, getErasedParameterType(i).hashCode()); } return hash; } /*
public boolean isStructureKnown() throws JavaModelException { return ((IJavaElement)getOpenableParent()).isStructureKnown(); } /*
public String readableName() { StringBuffer buffer = new StringBuffer(super.readableName()); buffer.append("("); //$NON-NLS-1$ String[] paramTypes = this.parameterTypes; int length; if (paramTypes != null && (length = paramTypes.length) > 0) { for (int i = 0; i < length; i++) { buffer.append(Signature.toString(paramTypes[i])); if (i < length - 1) { buffer.append(", "); //$NON-NLS-1$ } } } buffer.append(")"); //$NON-NLS-1$ return buffer.toString(); } public JavaElement resolved(Binding binding) {
protected IAnnotation[] getAnnotations(IBinaryAnnotation[] binaryAnnotations, long tagBits) { IAnnotation[] standardAnnotations = getStandardAnnotations(tagBits); if (binaryAnnotations == null) return standardAnnotations; int length = binaryAnnotations.length; int standardLength = standardAnnotations.length; int fullLength = length + standardLength; if (fullLength == 0) { return Annotation.NO_ANNOTATIONS; } IAnnotation[] annotations = new IAnnotation[fullLength]; for (int i = 0; i < length; i++) { annotations[i] = Util.getAnnotation(this, binaryAnnotations[i], null); } System.arraycopy(standardAnnotations, 0, annotations, length, standardLength); return annotations; } private IAnnotation getAnnotation(char[][] annotationName) {
protected IAnnotation[] getStandardAnnotations(long tagBits) { if ((tagBits & TagBits.AllStandardAnnotationsMask) == 0) return Annotation.NO_ANNOTATIONS; ArrayList annotations = new ArrayList(); if ((tagBits & TagBits.AnnotationTargetMASK) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_ANNOTATION_TARGET)); } if ((tagBits & TagBits.AnnotationRetentionMASK) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_ANNOTATION_RETENTION)); } if ((tagBits & TagBits.AnnotationDeprecated) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_DEPRECATED)); } if ((tagBits & TagBits.AnnotationDocumented) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_ANNOTATION_DOCUMENTED)); } if ((tagBits & TagBits.AnnotationInherited) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_ANNOTATION_INHERITED)); } if ((tagBits & TagBits.AnnotationPolymorphicSignature) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_INVOKE_METHODHANDLE_$_POLYMORPHICSIGNATURE)); } if ((tagBits & TagBits.AnnotationSafeVarargs) != 0) { annotations.add(getAnnotation(TypeConstants.JAVA_LANG_SAFEVARARGS)); } // note that JAVA_LANG_SUPPRESSWARNINGS and JAVA_LANG_OVERRIDE cannot appear in binaries return (IAnnotation[]) annotations.toArray(new IAnnotation[annotations.size()]); }
@Override public String[] getCategories() throws JavaModelException { SourceMapper mapper= getSourceMapper(); if (mapper != null) { // ensure the class file's buffer is open so that categories are computed getClassFile().getBuffer(); if (mapper.categories != null) { String[] categories = (String[]) mapper.categories.get(this); if (categories != null) return categories; } } return CharOperation.NO_STRINGS; } public String getKey() {
public boolean equals(Object o) { if (!(o instanceof BinaryField)) return false; return super.equals(o); } public IAnnotation[] getAnnotations() throws JavaModelException {
public String getKey() { try { return getKey(false/*don't open*/); } catch (JavaModelException e) { // happen only if force open is true return null; } } /**
protected void toStringName(StringBuffer buffer) { if (getElementName().length() > 0) super.toStringName(buffer); else buffer.append("<anonymous>"); //$NON-NLS-1$ } public String getAttachedJavadoc(IProgressMonitor monitor) throws JavaModelException {