### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: search/org/eclipse/jdt/internal/core/index/DiskIndex.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java,v retrieving revision 1.43 diff -u -r1.43 DiskIndex.java --- search/org/eclipse/jdt/internal/core/index/DiskIndex.java 3 Feb 2006 15:28:57 -0000 1.43 +++ search/org/eclipse/jdt/internal/core/index/DiskIndex.java 15 Feb 2006 12:20:44 -0000 @@ -35,7 +35,7 @@ private HashtableOfObject categoryTables; // category name -> HashtableOfObject(words -> int[] of document #'s) or offset if not read yet private char[] cachedCategoryName; -public static final String SIGNATURE= "INDEX VERSION 1.108"; //$NON-NLS-1$ +public static final String SIGNATURE= "INDEX VERSION 1.109"; //$NON-NLS-1$ public static boolean DEBUG = false; private static final int RE_INDEXED = -1; Index: search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java,v retrieving revision 1.51 diff -u -r1.51 BinaryIndexer.java --- search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java 3 Feb 2006 15:28:57 -0000 1.51 +++ search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java 15 Feb 2006 12:20:44 -0000 @@ -23,6 +23,8 @@ import org.eclipse.jdt.internal.compiler.env.EnumConstantSignature; import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation; import org.eclipse.jdt.internal.compiler.env.IBinaryElementValuePair; +import org.eclipse.jdt.internal.compiler.lookup.TagBits; +import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; import org.eclipse.jdt.internal.compiler.util.SuffixConstants; public class BinaryIndexer extends AbstractIndexer implements SuffixConstants { @@ -40,6 +42,76 @@ public BinaryIndexer(SearchDocument document) { super(document); } + private void addBinaryStandardAnnotations(long annotationTagBits) { + char[][] compoundName = null; + if ((annotationTagBits & TagBits.AnnotationTargetMASK) != 0) { + compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET; + addBinaryTargetAnnotation(annotationTagBits); + } + if ((annotationTagBits & TagBits.AnnotationRetentionMASK) != 0) { + compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET; + addBinaryRetentionAnnotation(annotationTagBits); + } + if ((annotationTagBits & TagBits.AnnotationDeprecated) != 0) { + compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET; + } + if ((annotationTagBits & TagBits.AnnotationDocumented) != 0) { + compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET; + } + if ((annotationTagBits & TagBits.AnnotationInherited) != 0) { + compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET; + } + if ((annotationTagBits & TagBits.AnnotationOverride) != 0) { + compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET; + } + if ((annotationTagBits & TagBits.AnnotationSuppressWarnings) != 0) { + compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET; + } + if (compoundName == null) return; + addTypeReference(compoundName[compoundName.length-1]); + } + private void addBinaryTargetAnnotation(long bits) { + if ((bits & TagBits.AnnotationTarget) != 0) return; + char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_ELEMENTTYPE; + addTypeReference(compoundName[compoundName.length-1]); + if ((bits & TagBits.AnnotationForAnnotationType) != 0) { + addFieldReference(TypeConstants.UPPER_ANNOTATION_TYPE); + } + if ((bits & TagBits.AnnotationForConstructor) != 0) { + addFieldReference(TypeConstants.UPPER_CONSTRUCTOR); + } + if ((bits & TagBits.AnnotationForField) != 0) { + addFieldReference(TypeConstants.UPPER_FIELD); + } + if ((bits & TagBits.AnnotationForLocalVariable) != 0) { + addFieldReference(TypeConstants.UPPER_LOCAL_VARIABLE); + } + if ((bits & TagBits.AnnotationForMethod) != 0) { + addFieldReference(TypeConstants.UPPER_METHOD); + } + if ((bits & TagBits.AnnotationForPackage) != 0) { + addFieldReference(TypeConstants.UPPER_PACKAGE); + } + if ((bits & TagBits.AnnotationForParameter) != 0) { + addFieldReference(TypeConstants.UPPER_PARAMETER); + } + if ((bits & TagBits.AnnotationForType) != 0) { + addFieldReference(TypeConstants.TYPE); + } + } + private void addBinaryRetentionAnnotation(long bits) { + char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_RETENTIONPOLICY; + addTypeReference(compoundName[compoundName.length-1]); + if ((bits & TagBits.AnnotationRuntimeRetention) != 0) { + addFieldReference(TypeConstants.UPPER_RUNTIME); + } + else if ((bits & TagBits.AnnotationClassRetention) != 0) { + addFieldReference(TypeConstants.UPPER_CLASS); + } + else if ((bits & TagBits.AnnotationSourceRetention) != 0) { + addFieldReference(TypeConstants.UPPER_SOURCE); + } + } private void addBinaryAnnotation(IBinaryAnnotation annotation) { addTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName()))); IBinaryElementValuePair[] valuePairs = annotation.getElementValuePairs(); @@ -550,6 +622,10 @@ addBinaryAnnotation(annotation); } } + long tagBits = reader.getTagBits() & TagBits.AnnotationTargetMASK|TagBits.AnnotationDeprecated|TagBits.AnnotationRetentionMASK; + if (tagBits != 0) { + addBinaryStandardAnnotations(tagBits); + } // first reference all methods declarations and field declarations MethodInfo[] methods = (MethodInfo[]) reader.getMethods();