Lines 30-36
Link Here
|
30 |
public int modifiers; |
30 |
public int modifiers; |
31 |
public char[][] typeParameterSignatures; |
31 |
public char[][] typeParameterSignatures; |
32 |
|
32 |
|
33 |
protected boolean checkOnlySuperinterfaces; // used for IMPLEMENTORS |
33 |
protected int superRefKind; |
|
|
34 |
public static final int ALL_SUPER_TYPES = 0; |
35 |
public static final int ONLY_SUPER_INTERFACES = 1; // used for IMPLEMENTORS |
36 |
public static final int ONLY_SUPER_CLASSES = 2; // used for hierarachy with a class focus |
34 |
|
37 |
|
35 |
protected static char[][] CATEGORIES = { SUPER_REF }; |
38 |
protected static char[][] CATEGORIES = { SUPER_REF }; |
36 |
|
39 |
|
Lines 139-145
Link Here
|
139 |
public SuperTypeReferencePattern( |
142 |
public SuperTypeReferencePattern( |
140 |
char[] superQualification, |
143 |
char[] superQualification, |
141 |
char[] superSimpleName, |
144 |
char[] superSimpleName, |
142 |
boolean checkOnlySuperinterfaces, |
145 |
int superRefKind, |
143 |
int matchRule) { |
146 |
int matchRule) { |
144 |
|
147 |
|
145 |
this(matchRule); |
148 |
this(matchRule); |
Lines 147-153
Link Here
|
147 |
this.superQualification = isCaseSensitive() ? superQualification : CharOperation.toLowerCase(superQualification); |
150 |
this.superQualification = isCaseSensitive() ? superQualification : CharOperation.toLowerCase(superQualification); |
148 |
this.superSimpleName = isCaseSensitive() ? superSimpleName : CharOperation.toLowerCase(superSimpleName); |
151 |
this.superSimpleName = isCaseSensitive() ? superSimpleName : CharOperation.toLowerCase(superSimpleName); |
149 |
((InternalSearchPattern)this).mustResolve = superQualification != null; |
152 |
((InternalSearchPattern)this).mustResolve = superQualification != null; |
150 |
this.checkOnlySuperinterfaces = checkOnlySuperinterfaces; // ie. skip the superclass |
153 |
this.superRefKind = superRefKind; |
151 |
} |
154 |
} |
152 |
SuperTypeReferencePattern(int matchRule) { |
155 |
SuperTypeReferencePattern(int matchRule) { |
153 |
super(SUPER_REF_PATTERN, matchRule); |
156 |
super(SUPER_REF_PATTERN, matchRule); |
Lines 203-210
Link Here
|
203 |
} |
206 |
} |
204 |
public boolean matchesDecodedKey(SearchPattern decodedPattern) { |
207 |
public boolean matchesDecodedKey(SearchPattern decodedPattern) { |
205 |
SuperTypeReferencePattern pattern = (SuperTypeReferencePattern) decodedPattern; |
208 |
SuperTypeReferencePattern pattern = (SuperTypeReferencePattern) decodedPattern; |
206 |
if (this.checkOnlySuperinterfaces) |
209 |
if (this.superRefKind == ONLY_SUPER_INTERFACES) |
207 |
if (pattern.superClassOrInterface != IIndexConstants.INTERFACE_SUFFIX) return false; |
210 |
if (pattern.superClassOrInterface != IIndexConstants.INTERFACE_SUFFIX) return false; |
|
|
211 |
if (this.superRefKind == ONLY_SUPER_CLASSES && pattern.enclosingTypeName != IIndexConstants.ONE_ZERO/*not an anonymous*/) |
212 |
// consider enumerations as classes, reject interfaces and annotations |
213 |
if (pattern.superClassOrInterface == IIndexConstants.INTERFACE_SUFFIX |
214 |
|| pattern.superClassOrInterface == IIndexConstants.ANNOTATION_TYPE_SUFFIX) |
215 |
return false; |
208 |
|
216 |
|
209 |
if (pattern.superQualification != null) |
217 |
if (pattern.superQualification != null) |
210 |
if (!matchesName(this.superQualification, pattern.superQualification)) return false; |
218 |
if (!matchesName(this.superQualification, pattern.superQualification)) return false; |
Lines 234-243
Link Here
|
234 |
return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null |
242 |
return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null |
235 |
} |
243 |
} |
236 |
protected StringBuffer print(StringBuffer output) { |
244 |
protected StringBuffer print(StringBuffer output) { |
237 |
output.append( |
245 |
switch (this.superRefKind) { |
238 |
this.checkOnlySuperinterfaces |
246 |
case ALL_SUPER_TYPES: |
239 |
? "SuperInterfaceReferencePattern: <" //$NON-NLS-1$ |
247 |
output.append("SuperTypeReferencePattern: <"); //$NON-NLS-1$ |
240 |
: "SuperTypeReferencePattern: <"); //$NON-NLS-1$ |
248 |
break; |
|
|
249 |
case ONLY_SUPER_INTERFACES: |
250 |
output.append("SuperInterfaceReferencePattern: <"); //$NON-NLS-1$ |
251 |
break; |
252 |
case ONLY_SUPER_CLASSES: |
253 |
output.append("SuperClassReferencePattern: <"); //$NON-NLS-1$ |
254 |
break; |
255 |
} |
241 |
if (superSimpleName != null) |
256 |
if (superSimpleName != null) |
242 |
output.append(superSimpleName); |
257 |
output.append(superSimpleName); |
243 |
else |
258 |
else |