View | Details | Raw Unified | Return to bug 124469 | Differences between
and this patch

Collapse All | Expand All

(-)search/org/eclipse/jdt/internal/core/index/DiskIndex.java (-1 / +1 lines)
Lines 35-41 Link Here
35
private HashtableOfObject categoryTables; // category name -> HashtableOfObject(words -> int[] of document #'s) or offset if not read yet
35
private HashtableOfObject categoryTables; // category name -> HashtableOfObject(words -> int[] of document #'s) or offset if not read yet
36
private char[] cachedCategoryName;
36
private char[] cachedCategoryName;
37
37
38
public static final String SIGNATURE= "INDEX VERSION 1.108"; //$NON-NLS-1$
38
public static final String SIGNATURE= "INDEX VERSION 1.109"; //$NON-NLS-1$
39
public static boolean DEBUG = false;
39
public static boolean DEBUG = false;
40
40
41
private static final int RE_INDEXED = -1;
41
private static final int RE_INDEXED = -1;
(-)search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java (+76 lines)
Lines 23-28 Link Here
23
import org.eclipse.jdt.internal.compiler.env.EnumConstantSignature;
23
import org.eclipse.jdt.internal.compiler.env.EnumConstantSignature;
24
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
24
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
25
import org.eclipse.jdt.internal.compiler.env.IBinaryElementValuePair;
25
import org.eclipse.jdt.internal.compiler.env.IBinaryElementValuePair;
26
import org.eclipse.jdt.internal.compiler.lookup.TagBits;
27
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
26
import org.eclipse.jdt.internal.compiler.util.SuffixConstants;
28
import org.eclipse.jdt.internal.compiler.util.SuffixConstants;
27
29
28
public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
30
public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
Lines 40-45 Link Here
40
	public BinaryIndexer(SearchDocument document) {
42
	public BinaryIndexer(SearchDocument document) {
41
		super(document);
43
		super(document);
42
	}
44
	}
45
	private void addBinaryStandardAnnotations(long annotationTagBits) {
46
		char[][] compoundName = null;
47
		if ((annotationTagBits & TagBits.AnnotationTargetMASK) != 0) {
48
			compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
49
			addBinaryTargetAnnotation(annotationTagBits);
50
		}
51
		if ((annotationTagBits & TagBits.AnnotationRetentionMASK) != 0) {
52
			compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
53
			addBinaryRetentionAnnotation(annotationTagBits);
54
		}
55
		if ((annotationTagBits & TagBits.AnnotationDeprecated) != 0) {
56
			compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
57
		}
58
		if ((annotationTagBits & TagBits.AnnotationDocumented) != 0) {
59
			compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
60
		}
61
		if ((annotationTagBits & TagBits.AnnotationInherited) != 0) {
62
			compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
63
		}
64
		if ((annotationTagBits & TagBits.AnnotationOverride) != 0) {
65
			compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
66
		}
67
		if ((annotationTagBits & TagBits.AnnotationSuppressWarnings) != 0) {
68
			compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
69
		}
70
		if (compoundName == null) return;
71
		addTypeReference(compoundName[compoundName.length-1]);
72
	}
73
	private void addBinaryTargetAnnotation(long bits) {
74
		if ((bits & TagBits.AnnotationTarget) != 0) return;
75
		char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_ELEMENTTYPE;
76
		addTypeReference(compoundName[compoundName.length-1]);
77
		if ((bits & TagBits.AnnotationForAnnotationType) != 0) {
78
			addFieldReference(TypeConstants.UPPER_ANNOTATION_TYPE);
79
		}
80
		if ((bits & TagBits.AnnotationForConstructor) != 0) {
81
			addFieldReference(TypeConstants.UPPER_CONSTRUCTOR);
82
		}
83
		if ((bits & TagBits.AnnotationForField) != 0) {
84
			addFieldReference(TypeConstants.UPPER_FIELD);
85
		}
86
		if ((bits & TagBits.AnnotationForLocalVariable) != 0) {
87
			addFieldReference(TypeConstants.UPPER_LOCAL_VARIABLE);
88
		}
89
		if ((bits & TagBits.AnnotationForMethod) != 0) {
90
			addFieldReference(TypeConstants.UPPER_METHOD);
91
		}
92
		if ((bits & TagBits.AnnotationForPackage) != 0) {
93
			addFieldReference(TypeConstants.UPPER_PACKAGE);
94
		}
95
		if ((bits & TagBits.AnnotationForParameter) != 0) {
96
			addFieldReference(TypeConstants.UPPER_PARAMETER);
97
		}
98
		if ((bits & TagBits.AnnotationForType) != 0) {
99
			addFieldReference(TypeConstants.TYPE);
100
		}
101
	}
102
	private void addBinaryRetentionAnnotation(long bits) {
103
		char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_RETENTIONPOLICY;
104
		addTypeReference(compoundName[compoundName.length-1]);
105
		if ((bits & TagBits.AnnotationRuntimeRetention) != 0) {
106
			addFieldReference(TypeConstants.UPPER_RUNTIME);
107
		}
108
		else if ((bits & TagBits.AnnotationClassRetention) != 0) {
109
			addFieldReference(TypeConstants.UPPER_CLASS);
110
		}
111
		else if ((bits & TagBits.AnnotationSourceRetention) != 0) {
112
			addFieldReference(TypeConstants.UPPER_SOURCE);
113
		}
114
	}
43
	private void addBinaryAnnotation(IBinaryAnnotation annotation) {
115
	private void addBinaryAnnotation(IBinaryAnnotation annotation) {
44
		addTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName())));
116
		addTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName())));
45
		IBinaryElementValuePair[] valuePairs = annotation.getElementValuePairs();
117
		IBinaryElementValuePair[] valuePairs = annotation.getElementValuePairs();
Lines 550-555 Link Here
550
					addBinaryAnnotation(annotation);
622
					addBinaryAnnotation(annotation);
551
				}
623
				}
552
			}
624
			}
625
			long tagBits = reader.getTagBits() & TagBits.AnnotationTargetMASK|TagBits.AnnotationDeprecated|TagBits.AnnotationRetentionMASK;
626
			if (tagBits != 0) {
627
				addBinaryStandardAnnotations(tagBits);
628
			}
553
629
554
			// first reference all methods declarations and field declarations
630
			// first reference all methods declarations and field declarations
555
			MethodInfo[] methods = (MethodInfo[]) reader.getMethods();
631
			MethodInfo[] methods = (MethodInfo[]) reader.getMethods();

Return to bug 124469