Lines 14-24
Link Here
|
14 |
import org.eclipse.jdt.core.compiler.CharOperation; |
14 |
import org.eclipse.jdt.core.compiler.CharOperation; |
15 |
import org.eclipse.jdt.core.search.SearchDocument; |
15 |
import org.eclipse.jdt.core.search.SearchDocument; |
16 |
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; |
16 |
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; |
|
|
17 |
import org.eclipse.jdt.internal.compiler.classfmt.AnnotationInfo; |
17 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
18 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
18 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; |
19 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; |
19 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; |
20 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; |
|
|
21 |
import org.eclipse.jdt.internal.compiler.classfmt.ElementValuePairInfo; |
20 |
import org.eclipse.jdt.internal.compiler.classfmt.FieldInfo; |
22 |
import org.eclipse.jdt.internal.compiler.classfmt.FieldInfo; |
21 |
import org.eclipse.jdt.internal.compiler.classfmt.MethodInfo; |
23 |
import org.eclipse.jdt.internal.compiler.classfmt.MethodInfo; |
|
|
24 |
import org.eclipse.jdt.internal.compiler.env.ClassSignature; |
25 |
import org.eclipse.jdt.internal.compiler.env.EnumConstantSignature; |
22 |
import org.eclipse.jdt.internal.compiler.util.SuffixConstants; |
26 |
import org.eclipse.jdt.internal.compiler.util.SuffixConstants; |
23 |
|
27 |
|
24 |
public class BinaryIndexer extends AbstractIndexer implements SuffixConstants { |
28 |
public class BinaryIndexer extends AbstractIndexer implements SuffixConstants { |
Lines 508-514
Link Here
|
508 |
addAnnotationTypeDeclaration(modifiers, packageName, name, enclosingTypeNames, false); |
512 |
addAnnotationTypeDeclaration(modifiers, packageName, name, enclosingTypeNames, false); |
509 |
break; |
513 |
break; |
510 |
} |
514 |
} |
511 |
|
515 |
|
|
|
516 |
// Look for references in annotations |
517 |
AnnotationInfo[] annotations = (AnnotationInfo[]) reader.getAnnotations(); |
518 |
if (annotations != null) { |
519 |
for (int i=0, aLength=annotations.length; i<aLength; i++) { |
520 |
AnnotationInfo annotation = annotations[i]; |
521 |
addTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName()))); |
522 |
ElementValuePairInfo[] valuePairs = (ElementValuePairInfo[]) annotation.getElementValuePairs(); |
523 |
if (valuePairs != null) { |
524 |
for (int j=0, vpLength=valuePairs.length; j<vpLength; j++) { |
525 |
ElementValuePairInfo valuePair = valuePairs[j]; |
526 |
addMethodReference(valuePair.getName(), 0); |
527 |
Object pairValue = valuePair.getValue(); |
528 |
if (pairValue instanceof EnumConstantSignature) { |
529 |
EnumConstantSignature enumConstant = (EnumConstantSignature) pairValue; |
530 |
addTypeReference(replace('/', '.', Signature.toCharArray(enumConstant.getTypeName()))); |
531 |
addNameReference(enumConstant.getEnumConstantName()); |
532 |
} else if (pairValue instanceof ClassSignature) { |
533 |
ClassSignature classConstant = (ClassSignature) pairValue; |
534 |
addTypeReference(replace('/', '.', Signature.toCharArray(classConstant.getTypeName()))); |
535 |
} |
536 |
} |
537 |
} |
538 |
} |
539 |
} |
540 |
|
541 |
|
512 |
// first reference all methods declarations and field declarations |
542 |
// first reference all methods declarations and field declarations |
513 |
MethodInfo[] methods = (MethodInfo[]) reader.getMethods(); |
543 |
MethodInfo[] methods = (MethodInfo[]) reader.getMethods(); |
514 |
if (methods != null) { |
544 |
if (methods != null) { |