Class Indexer
The Indexer operates on input streams that point to class file data. Input streams do not need to be buffered, as the indexer already does this. There is also no limit to the number of class file streams the indexer can process, other than available memory.
The Indexer attempts to minimize the final memory state of the index, but to do this it must maintain additional in-process state (intern tables etc) until the index is complete.
Numerous optimizations are taken during indexing to attempt to minimize the CPU and I/O cost, however, the Java class file format was not designed for partial searching, which ultimately limits the efficiency of processing them.
Thread-Safety This class is not thread-safe can not be shared between threads. The index it produces however is thread-safe.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static final classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]private static final intprivate HashMap<DotName, List<AnnotationInstance>> private intprivate static final byte[]private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate byte[]private byte[]private int[]private intprivate ClassInfoprivate ArrayList<AnnotationInstance> private static final byte[]private static final intprivate static final byte[]private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final byte[]private static final intprivate Map<DotName, Indexer.InnerClassInfo> private static final byte[]private static final intprivate Map<DotName, List<AnnotationInstance>> private static final byte[]private static final intprivate IdentityHashMap<MethodInfo, MethodParamList> private List<MethodInfo> private static final byte[]private static final intprivate static final byte[]private static final intprivate static final byte[]private static final intprivate DotNameprivate Map<DotName, ModuleInfo> private NameTableprivate static final byte[]private static final intprivate static final byte[]private static final intprivate List<RecordComponentInfo> private static final byte[]private static final intprivate static final byte[]private static final intprivate static final byte[]private static final intprivate static final byte[]private static final intprivate static final byte[]private static final intprivate static final byte[]private static final intprivate static final byte[]private static final intprivate GenericSignatureParserprivate IdentityHashMap<AnnotationTarget, Object> private final Indexer.TmpObjects -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddImplementor(DotName interfaceName, ClassInfo currentClass) private voidaddSubclass(DotName superName, ClassInfo currentClass) private voidaddSubinterface(DotName superName, ClassInfo currentClass) private voidprivate voidprivate intbitsToInt(byte[] pool, int pos) private longbitsToLong(byte[] pool, int pos) private ArrayDeque<Indexer.InnerClassInfo> buildClassesQueue(Type type) Returns a list ofIndexer.InnerClassInfos representing types enclosing giventype.buildOwnerMap(Type type) complete()Completes, finalizes, and returns the index after zero or more calls toindex().private static StringconvertClassFieldDescriptor(String descriptor) private ParameterizedTypeconvertParameterized(Type oType) private static Type[]copyTypeParameters(AnnotationTarget target) private DotNamedecodeClassEntry(int index) private DotNamedecodeDotNameEntry(int index, int constantType, String typeName, char delim) private doubledecodeDoubleEntry(int index) private floatdecodeFloatEntry(int index) private intdecodeIntegerEntry(int index) private longdecodeLongEntry(int index) private DotNamedecodeModuleEntry(int index) private Indexer.NameAndTypedecodeNameAndTypeEntry(int index) private StringdecodeOptionalUtf8Entry(int index) private DotNamedecodePackageEntry(int index) private StringdecodeUtf8Entry(int index) private byte[]decodeUtf8EntryAsBytes(int index) private TypedeepCopyTypeIfNeeded(Type type) Whentypecontains no type variable references, returnstype.private TypeVariablefindTypeParameter(Type[] typeParameters, String identifier) Finds and returns a type variable with givenidentifieramong giventypeParameters.private static Type[]getTypeParameters(AnnotationTarget target) private StringgetTypeVariableIdentifier(Type typeVariable) private booleanhasAnonymousEncloser(Indexer.TypeAnnotationState typeAnnotationState) private booleanhasLocalEncloser(Indexer.TypeAnnotationState typeAnnotationState) voidindex(InputStream stream) Analyze and index the class file data present in given inputstream.index$$bridge(InputStream stream) voidindexClass(Class<?> clazz) Analyze and index the class file data of givenclazz.indexClass$$bridge(Class<?> clazz) indexWithSummary(InputStream stream) Analyze and index the class file data present in given inputstream.private voidprivate voidprivate byte[]intern(byte[] bytes) private Stringprivate Typeprivate Type[]private booleanisBridge(MethodInfo methodInfo) private static booleanisEnumConstructor(MethodInfo method) private booleanisInnerConstructor(MethodInfo method) private booleanisJDK11OrNewer(DataInputStream stream) private static booleanmatch(byte[] target, int offset, byte[] expected) private static intminLength(int oldLength, int minGrowth) private static intnewLength(int oldLength, int minGrowth, int prefGrowth) private DotNameReturns the name of the outermost type that encloses giventypeand on which type annotations are admissible.private voidparseClassSignature(String signature, ClassInfo clazz) private voidparseFieldSignature(String signature, FieldInfo field) private Type[]parseMethodArgs(String descriptor, Indexer.IntegerHolder pos) private voidparseMethodSignature(String signature, MethodInfo method) private voidparseRecordComponentSignature(String signature, RecordComponentInfo recordComponent) private Typeprivate TypeparseType(String descriptor, Indexer.IntegerHolder pos) private voidpatchTypeVariableReferences(Type type, Deque<TypeVariable> typeVarStack, AnnotationTarget parametricEncloser) Patches all type variable references contained in giventype.private intpopNestedDepth(Indexer.PathElementStack elements) private AnnotationInstanceprocessAnnotation(DataInputStream data, AnnotationTarget target, boolean visible) private voidprocessAnnotationDefault(DataInputStream data, MethodInfo target) private AnnotationValueprocessAnnotationElementValue(String name, DataInputStream data) private voidprocessAnnotations(DataInputStream data, AnnotationTarget target, boolean visible) private voidprocessAttributes(DataInputStream data, AnnotationTarget target) private voidprivate voidprocessCode(DataInputStream data, MethodInfo target) private booleanprocessConstantPool(DataInputStream stream) private voidprocessEnclosingMethod(DataInputStream data, ClassInfo target) private voidprocessExceptions(DataInputStream data, MethodInfo target) private voidprivate voidprocessInnerClasses(DataInputStream data, ClassInfo target) private voidprocessLocalVariableTable(DataInputStream data, MethodInfo target) private voidprivate voidprocessMethodParameters(DataInputStream data, MethodInfo target) private voidprocessModule(DataInputStream data, ClassInfo target) private List<ModuleInfo.ExportedPackageInfo> private voidprocessModuleMainClass(DataInputStream data, ClassInfo target) private List<ModuleInfo.OpenedPackageInfo> private voidprocessModulePackages(DataInputStream data, ClassInfo target) private List<ModuleInfo.ProvidedServiceInfo> private List<ModuleInfo.RequiredModuleInfo> private voidprocessPermittedSubclasses(DataInputStream data, ClassInfo target) private voidprivate voidprocessSignature(DataInputStream data, AnnotationTarget target) private ArrayList<Indexer.PathElement> processTargetPath(DataInputStream data, Indexer.BooleanHolder genericsRequired, Indexer.BooleanHolder bridgeIncompatible) private Indexer.TypeAnnotationStateprocessTypeAnnotation(DataInputStream data, AnnotationTarget target, boolean visible) private voidprocessTypeAnnotations(DataInputStream data, AnnotationTarget target, boolean visible) private TypepropagateOneTypeParameterBound(Type type, Type[] allTypeParams, AnnotationTarget target) private voidprivate voidpropagateTypeParameterBounds(AnnotationTarget target, Deque<TypeVariable> sharedTypeVarStack) private voidprivate TypepropagateTypeVariables(Type type, AnnotationTarget parametricEncloser) private TyperebuildNestedType(Type last, ArrayDeque<Indexer.InnerClassInfo> classes, Type type, int depth, Indexer.TypeAnnotationState typeAnnotationState) private voidrecordAnnotation(Map<DotName, List<AnnotationInstance>> classAnnotations, DotName annotation, AnnotationInstance instance) private voidrecordUsedClass(DotName usedClass) private voidrecordUsedType(Type type) private voidresolveTypeAnnotation(AnnotationTarget target, Indexer.TypeAnnotationState typeAnnotationState) private voidprivate TypeVariableresolveTypeParameter(AnnotationTarget target, String identifier) Resolves a given type variableidentifieragainst given parametrictarget(either a method or a class).private TyperesolveTypePath(Type type, Indexer.TypeAnnotationState typeAnnotationState) private voidprivate voidretargetTypeAnnotations(AnnotationTarget parametricEncloser, Type oldType, Type newType) private TypesearchNestedType(Type type, int depth, Indexer.TypeAnnotationState typeAnnotationState) private TypesearchTypePath(Type type, Indexer.TypeAnnotationState typeAnnotationState) private static voidsetTypeParameters(AnnotationTarget target, Type[] typeParameters) private static byte[]sizeToFit(byte[] buf, int needed, int offset, int remainingEntries) private booleanskipBridge(Indexer.TypeAnnotationState typeAnnotationState, MethodInfo method) private static voidskipFully(InputStream s, long n) private voidprivate booleantargetsArray(Indexer.TypeAnnotationState typeAnnotationState) private voidupdateTypeTarget(AnnotationTarget enclosingTarget, Indexer.TypeAnnotationState typeAnnotationState) private voidprivate voidverifyMagic(DataInputStream stream)
-
Field Details
-
CONSTANT_CLASS
private static final int CONSTANT_CLASS- See Also:
-
CONSTANT_FIELDREF
private static final int CONSTANT_FIELDREF- See Also:
-
CONSTANT_METHODREF
private static final int CONSTANT_METHODREF- See Also:
-
CONSTANT_INTERFACEMETHODREF
private static final int CONSTANT_INTERFACEMETHODREF- See Also:
-
CONSTANT_STRING
private static final int CONSTANT_STRING- See Also:
-
CONSTANT_INTEGER
private static final int CONSTANT_INTEGER- See Also:
-
CONSTANT_FLOAT
private static final int CONSTANT_FLOAT- See Also:
-
CONSTANT_LONG
private static final int CONSTANT_LONG- See Also:
-
CONSTANT_DOUBLE
private static final int CONSTANT_DOUBLE- See Also:
-
CONSTANT_NAMEANDTYPE
private static final int CONSTANT_NAMEANDTYPE- See Also:
-
CONSTANT_UTF8
private static final int CONSTANT_UTF8- See Also:
-
CONSTANT_INVOKEDYNAMIC
private static final int CONSTANT_INVOKEDYNAMIC- See Also:
-
CONSTANT_METHODHANDLE
private static final int CONSTANT_METHODHANDLE- See Also:
-
CONSTANT_METHODTYPE
private static final int CONSTANT_METHODTYPE- See Also:
-
CONSTANT_MODULE
private static final int CONSTANT_MODULE- See Also:
-
CONSTANT_PACKAGE
private static final int CONSTANT_PACKAGE- See Also:
-
CONSTANT_DYNAMIC
private static final int CONSTANT_DYNAMIC- See Also:
-
RUNTIME_ANNOTATIONS
private static final byte[] RUNTIME_ANNOTATIONS -
RUNTIME_PARAM_ANNOTATIONS
private static final byte[] RUNTIME_PARAM_ANNOTATIONS -
RUNTIME_TYPE_ANNOTATIONS
private static final byte[] RUNTIME_TYPE_ANNOTATIONS -
ANNOTATION_DEFAULT
private static final byte[] ANNOTATION_DEFAULT -
SIGNATURE
private static final byte[] SIGNATURE -
EXCEPTIONS
private static final byte[] EXCEPTIONS -
INNER_CLASSES
private static final byte[] INNER_CLASSES -
ENCLOSING_METHOD
private static final byte[] ENCLOSING_METHOD -
METHOD_PARAMETERS
private static final byte[] METHOD_PARAMETERS -
LOCAL_VARIABLE_TABLE
private static final byte[] LOCAL_VARIABLE_TABLE -
CODE
private static final byte[] CODE -
MODULE
private static final byte[] MODULE -
MODULE_PACKAGES
private static final byte[] MODULE_PACKAGES -
MODULE_MAIN_CLASS
private static final byte[] MODULE_MAIN_CLASS -
RECORD
private static final byte[] RECORD -
RUNTIME_INVISIBLE_ANNOTATIONS
private static final byte[] RUNTIME_INVISIBLE_ANNOTATIONS -
RUNTIME_INVISIBLE_PARAM_ANNOTATIONS
private static final byte[] RUNTIME_INVISIBLE_PARAM_ANNOTATIONS -
RUNTIME_INVISIBLE_TYPE_ANNOTATIONS
private static final byte[] RUNTIME_INVISIBLE_TYPE_ANNOTATIONS -
PERMITTED_SUBCLASSES
private static final byte[] PERMITTED_SUBCLASSES -
RUNTIME_ANNOTATIONS_LEN
private static final int RUNTIME_ANNOTATIONS_LEN -
RUNTIME_PARAM_ANNOTATIONS_LEN
private static final int RUNTIME_PARAM_ANNOTATIONS_LEN -
RUNTIME_TYPE_ANNOTATIONS_LEN
private static final int RUNTIME_TYPE_ANNOTATIONS_LEN -
ANNOTATION_DEFAULT_LEN
private static final int ANNOTATION_DEFAULT_LEN -
SIGNATURE_LEN
private static final int SIGNATURE_LEN -
EXCEPTIONS_LEN
private static final int EXCEPTIONS_LEN -
INNER_CLASSES_LEN
private static final int INNER_CLASSES_LEN -
ENCLOSING_METHOD_LEN
private static final int ENCLOSING_METHOD_LEN -
METHOD_PARAMETERS_LEN
private static final int METHOD_PARAMETERS_LEN -
LOCAL_VARIABLE_TABLE_LEN
private static final int LOCAL_VARIABLE_TABLE_LEN -
CODE_LEN
private static final int CODE_LEN -
MODULE_LEN
private static final int MODULE_LEN -
MODULE_PACKAGES_LEN
private static final int MODULE_PACKAGES_LEN -
MODULE_MAIN_CLASS_LEN
private static final int MODULE_MAIN_CLASS_LEN -
RECORD_LEN
private static final int RECORD_LEN -
RUNTIME_INVISIBLE_ANNOTATIONS_LEN
private static final int RUNTIME_INVISIBLE_ANNOTATIONS_LEN -
RUNTIME_INVISIBLE_PARAM_ANNOTATIONS_LEN
private static final int RUNTIME_INVISIBLE_PARAM_ANNOTATIONS_LEN -
RUNTIME_INVISIBLE_TYPE_ANNOTATIONS_LEN
private static final int RUNTIME_INVISIBLE_TYPE_ANNOTATIONS_LEN -
PERMITTED_SUBCLASSES_LEN
private static final int PERMITTED_SUBCLASSES_LEN -
HAS_RUNTIME_ANNOTATION
private static final int HAS_RUNTIME_ANNOTATION- See Also:
-
HAS_RUNTIME_PARAM_ANNOTATION
private static final int HAS_RUNTIME_PARAM_ANNOTATION- See Also:
-
HAS_RUNTIME_TYPE_ANNOTATION
private static final int HAS_RUNTIME_TYPE_ANNOTATION- See Also:
-
HAS_SIGNATURE
private static final int HAS_SIGNATURE- See Also:
-
HAS_EXCEPTIONS
private static final int HAS_EXCEPTIONS- See Also:
-
HAS_INNER_CLASSES
private static final int HAS_INNER_CLASSES- See Also:
-
HAS_ENCLOSING_METHOD
private static final int HAS_ENCLOSING_METHOD- See Also:
-
HAS_ANNOTATION_DEFAULT
private static final int HAS_ANNOTATION_DEFAULT- See Also:
-
HAS_METHOD_PARAMETERS
private static final int HAS_METHOD_PARAMETERS- See Also:
-
HAS_LOCAL_VARIABLE_TABLE
private static final int HAS_LOCAL_VARIABLE_TABLE- See Also:
-
HAS_CODE
private static final int HAS_CODE- See Also:
-
HAS_MODULE
private static final int HAS_MODULE- See Also:
-
HAS_MODULE_PACKAGES
private static final int HAS_MODULE_PACKAGES- See Also:
-
HAS_MODULE_MAIN_CLASS
private static final int HAS_MODULE_MAIN_CLASS- See Also:
-
HAS_RECORD
private static final int HAS_RECORD- See Also:
-
HAS_RUNTIME_INVISIBLE_ANNOTATION
private static final int HAS_RUNTIME_INVISIBLE_ANNOTATION- See Also:
-
HAS_RUNTIME_INVISIBLE_PARAM_ANNOTATION
private static final int HAS_RUNTIME_INVISIBLE_PARAM_ANNOTATION- See Also:
-
HAS_RUNTIME_INVISIBLE_TYPE_ANNOTATION
private static final int HAS_RUNTIME_INVISIBLE_TYPE_ANNOTATION- See Also:
-
HAS_PERMITTED_SUBCLASSES
private static final int HAS_PERMITTED_SUBCLASSES- See Also:
-
constantPoolSize
private int constantPoolSize -
constantPool
private byte[] constantPool -
constantPoolOffsets
private int[] constantPoolOffsets -
constantPoolAnnoAttrributes
private byte[] constantPoolAnnoAttrributes -
currentClass
-
classAnnotations
-
elementAnnotations
-
signaturePresent
-
signatures
-
classSignatureIndex
private int classSignatureIndex -
innerClasses
-
typeAnnotations
-
methods
-
fields
-
recordComponents
-
methodParams
-
modulePackages
-
moduleMainClass
-
masterAnnotations
-
subclasses
-
subinterfaces
-
implementors
-
classes
-
modules
-
users
-
names
-
signatureParser
-
tmpObjects
-
-
Constructor Details
-
Indexer
public Indexer()
-
-
Method Details
-
match
private static boolean match(byte[] target, int offset, byte[] expected) -
sizeToFit
private static byte[] sizeToFit(byte[] buf, int needed, int offset, int remainingEntries) -
newLength
private static int newLength(int oldLength, int minGrowth, int prefGrowth) -
minLength
private static int minLength(int oldLength, int minGrowth) -
skipFully
- Throws:
IOException
-
initIndexMaps
private void initIndexMaps() -
initClassFields
private void initClassFields() -
processMethodInfo
- Throws:
IOException
-
processFieldInfo
- Throws:
IOException
-
processRecordComponents
- Throws:
IOException
-
processPermittedSubclasses
- Throws:
IOException
-
processAttributes
- Throws:
IOException
-
processModule
- Throws:
IOException
-
processModuleRequires
private List<ModuleInfo.RequiredModuleInfo> processModuleRequires(DataInputStream data) throws IOException - Throws:
IOException
-
processModuleExports
private List<ModuleInfo.ExportedPackageInfo> processModuleExports(DataInputStream data) throws IOException - Throws:
IOException
-
processModuleOpens
private List<ModuleInfo.OpenedPackageInfo> processModuleOpens(DataInputStream data) throws IOException - Throws:
IOException
-
processModuleUses
- Throws:
IOException
-
processModuleProvides
private List<ModuleInfo.ProvidedServiceInfo> processModuleProvides(DataInputStream data) throws IOException - Throws:
IOException
-
processModulePackages
- Throws:
IOException
-
processModuleMainClass
- Throws:
IOException
-
processCode
- Throws:
IOException
-
processAnnotationDefault
- Throws:
IOException
-
processAnnotations
private void processAnnotations(DataInputStream data, AnnotationTarget target, boolean visible) throws IOException - Throws:
IOException
-
processInnerClasses
- Throws:
IOException
-
processMethodParameters
- Throws:
IOException
-
processLocalVariableTable
- Throws:
IOException
-
processEnclosingMethod
- Throws:
IOException
-
processTypeAnnotations
private void processTypeAnnotations(DataInputStream data, AnnotationTarget target, boolean visible) throws IOException - Throws:
IOException
-
processTypeAnnotation
private Indexer.TypeAnnotationState processTypeAnnotation(DataInputStream data, AnnotationTarget target, boolean visible) throws IOException - Throws:
IOException
-
adjustMethodParameters
private void adjustMethodParameters() -
isInnerConstructor
-
isEnumConstructor
-
resolveTypeAnnotations
private void resolveTypeAnnotations() -
resolveUsers
- Throws:
IOException
-
recordUsedType
-
recordUsedClass
-
updateTypeTargets
private void updateTypeTargets() -
getTypeParameters
-
copyTypeParameters
-
setTypeParameters
-
resolveTypeAnnotation
private void resolveTypeAnnotation(AnnotationTarget target, Indexer.TypeAnnotationState typeAnnotationState) -
skipBridge
-
isBridge
-
targetsArray
-
resolveTypePath
-
popNestedDepth
-
updateTypeTarget
private void updateTypeTarget(AnnotationTarget enclosingTarget, Indexer.TypeAnnotationState typeAnnotationState) -
searchTypePath
-
rebuildNestedType
private Type rebuildNestedType(Type last, ArrayDeque<Indexer.InnerClassInfo> classes, Type type, int depth, Indexer.TypeAnnotationState typeAnnotationState) -
convertParameterized
-
searchNestedType
private Type searchNestedType(Type type, int depth, Indexer.TypeAnnotationState typeAnnotationState) -
hasAnonymousEncloser
-
hasLocalEncloser
-
outermostAnnotableTypeName
Returns the name of the outermost type that encloses giventypeand on which type annotations are admissible. This is either the nearest enclosingstaticnested class, or the enclosing top-level class. Iftypeis not a nested type, returs its name.This could easily be implemented by calling
buildClassesQueue(Type)and looking at the first element. The only difference is that the present implementation doesn't allocate and is probably a little faster. -
buildClassesQueue
Returns a list ofIndexer.InnerClassInfos representing types enclosing giventype. Only types on which type annotations are admissible are present in the result. That is, the first element of the list represents the outermost type on which type annotations are admissible, and the last element of the list is anInnerClassInforepresentingtypeitself. Returns an empty list iftypeis not a nested type. -
buildOwnerMap
-
processTargetPath
private ArrayList<Indexer.PathElement> processTargetPath(DataInputStream data, Indexer.BooleanHolder genericsRequired, Indexer.BooleanHolder bridgeIncompatible) throws IOException - Throws:
IOException
-
skipTargetPath
- Throws:
IOException
-
processExceptions
- Throws:
IOException
-
processSignature
- Throws:
IOException
-
applySignatures
private void applySignatures() -
parseClassSignature
-
parseFieldSignature
-
parseMethodSignature
-
parseRecordComponentSignature
-
processAnnotation
private AnnotationInstance processAnnotation(DataInputStream data, AnnotationTarget target, boolean visible) throws IOException - Throws:
IOException
-
recordAnnotation
private void recordAnnotation(Map<DotName, List<AnnotationInstance>> classAnnotations, DotName annotation, AnnotationInstance instance) -
intern
-
intern
private byte[] intern(byte[] bytes) -
intern
-
intern
-
processAnnotationElementValue
private AnnotationValue processAnnotationElementValue(String name, DataInputStream data) throws IOException - Throws:
IOException
-
processClassInfo
- Throws:
IOException
-
addSubclass
-
addSubinterface
-
addImplementor
-
isJDK11OrNewer
- Throws:
IOException
-
verifyMagic
- Throws:
IOException
-
decodeClassEntry
- Throws:
IOException
-
decodeModuleEntry
- Throws:
IOException
-
decodePackageEntry
- Throws:
IOException
-
decodeDotNameEntry
private DotName decodeDotNameEntry(int index, int constantType, String typeName, char delim) throws IOException - Throws:
IOException
-
decodeOptionalUtf8Entry
- Throws:
IOException
-
decodeUtf8Entry
- Throws:
IOException
-
decodeUtf8EntryAsBytes
private byte[] decodeUtf8EntryAsBytes(int index) -
decodeNameAndTypeEntry
- Throws:
IOException
-
bitsToInt
private int bitsToInt(byte[] pool, int pos) -
bitsToLong
private long bitsToLong(byte[] pool, int pos) -
decodeIntegerEntry
private int decodeIntegerEntry(int index) -
decodeLongEntry
private long decodeLongEntry(int index) -
decodeFloatEntry
private float decodeFloatEntry(int index) -
decodeDoubleEntry
private double decodeDoubleEntry(int index) -
convertClassFieldDescriptor
-
parseMethodArgs
-
parseType
-
parseType
-
processConstantPool
- Throws:
IOException
-
indexClass
Analyze and index the class file data of givenclazz. Each call adds information to the final complete index.- Parameters:
clazz- a previously-loaded class- Throws:
IOException- if the class file data is corrupt or the underlying stream failsIllegalArgumentException- ifclazzisnull
-
indexClass$$bridge
- Throws:
IOException
-
index
Analyze and index the class file data present in given inputstream. Each call adds information to the final complete index. Closing the input stream is the caller's responsibility.- Parameters:
stream- the class bytecode to index, must not benull- Throws:
IOException- if the class file data is corrupt or the stream failsIllegalArgumentException- ifstreamisnull
-
index$$bridge
- Throws:
IOException
-
indexWithSummary
Analyze and index the class file data present in given inputstream. Each call adds information to the final complete index. Closing the input stream is the caller's responsibility.For reporting progress in batch indexers, this variant of
indexreturns a summary of the just-indexed class.- Parameters:
stream- the class bytecode to index, must not benull- Returns:
- a summary of the just-indexed class
- Throws:
IOException- if the class file data is corrupt or the stream failsIllegalArgumentException- ifstreamisnull
-
complete
Completes, finalizes, and returns the index after zero or more calls toindex(). Future calls toindex()will result in a new index.- Returns:
- the master index for all scanned class streams
-
propagateTypeParameterBounds
private void propagateTypeParameterBounds() -
propagateTypeParameterBounds
private void propagateTypeParameterBounds(AnnotationTarget target, Deque<TypeVariable> sharedTypeVarStack) -
propagateOneTypeParameterBound
private Type propagateOneTypeParameterBound(Type type, Type[] allTypeParams, AnnotationTarget target) -
deepCopyTypeIfNeeded
Whentypecontains no type variable references, returnstype. Whentypedoes contain type variable references, returns a deep copy with each reference replaced by a new one. In that case, the newly created references must be patched by the caller.When called from outside,
typemust be a type variable. -
patchTypeVariableReferences
private void patchTypeVariableReferences(Type type, Deque<TypeVariable> typeVarStack, AnnotationTarget parametricEncloser) Patches all type variable references contained in giventype. ThetypeVarStackis used to track enclosing type variables when traversing the structure of the type; when called from outside, it must be empty and must not be used anywhere else. TheparametricEncloseris thetype's nearest enclosing annotation target that may have type parameters, that is, the nearest enclosing method or class. -
findTypeParameter
Finds and returns a type variable with givenidentifieramong giventypeParameters. Returnsnullwhen none exists. -
resolveTypeParameter
Resolves a given type variableidentifieragainst given parametrictarget(either a method or a class). That is, if thetargethas a type parameter with matching identifier, returns it; otherwise, resolvesidentifieragainsttarget's nearest enclosing method or class. Returnsnullif the identifier can't be resolved. -
getTypeVariableIdentifier
-
propagateTypeVariables
private void propagateTypeVariables() -
propagateTypeVariables
-
retargetTypeAnnotations
private void retargetTypeAnnotations(AnnotationTarget parametricEncloser, Type oldType, Type newType)
-