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 class
private static class
private static class
private static class
private static class
private static class
private static final class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]
private static final int
private HashMap
<DotName, List<AnnotationInstance>> private int
private static final byte[]
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private byte[]
private byte[]
private int[]
private int
private ClassInfo
private ArrayList
<AnnotationInstance> private static final byte[]
private static final int
private static final byte[]
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final byte[]
private static final int
private Map
<DotName, Indexer.InnerClassInfo> private static final byte[]
private static final int
private Map
<DotName, List<AnnotationInstance>> private static final byte[]
private static final int
private IdentityHashMap
<MethodInfo, MethodParamList> private List
<MethodInfo> private static final byte[]
private static final int
private static final byte[]
private static final int
private static final byte[]
private static final int
private DotName
private Map
<DotName, ModuleInfo> private NameTable
private static final byte[]
private static final int
private static final byte[]
private static final int
private List
<RecordComponentInfo> private static final byte[]
private static final int
private static final byte[]
private static final int
private static final byte[]
private static final int
private static final byte[]
private static final int
private static final byte[]
private static final int
private static final byte[]
private static final int
private static final byte[]
private static final int
private GenericSignatureParser
private IdentityHashMap
<AnnotationTarget, Object> private final Indexer.TmpObjects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addImplementor
(DotName interfaceName, ClassInfo currentClass) private void
addSubclass
(DotName superName, ClassInfo currentClass) private void
addSubinterface
(DotName superName, ClassInfo currentClass) private void
private void
private int
bitsToInt
(byte[] pool, int pos) private long
bitsToLong
(byte[] pool, int pos) private ArrayDeque
<Indexer.InnerClassInfo> buildClassesQueue
(Type type) Returns a list ofIndexer.InnerClassInfo
s representing types enclosing giventype
.buildOwnerMap
(Type type) complete()
Completes, finalizes, and returns the index after zero or more calls toindex()
.private static String
convertClassFieldDescriptor
(String descriptor) private ParameterizedType
convertParameterized
(Type oType) private static Type[]
copyTypeParameters
(AnnotationTarget target) private DotName
decodeClassEntry
(int index) private DotName
decodeDotNameEntry
(int index, int constantType, String typeName, char delim) private double
decodeDoubleEntry
(int index) private float
decodeFloatEntry
(int index) private int
decodeIntegerEntry
(int index) private long
decodeLongEntry
(int index) private DotName
decodeModuleEntry
(int index) private Indexer.NameAndType
decodeNameAndTypeEntry
(int index) private String
decodeOptionalUtf8Entry
(int index) private DotName
decodePackageEntry
(int index) private String
decodeUtf8Entry
(int index) private byte[]
decodeUtf8EntryAsBytes
(int index) private Type
deepCopyTypeIfNeeded
(Type type) Whentype
contains no type variable references, returnstype
.private TypeVariable
findTypeParameter
(Type[] typeParameters, String identifier) Finds and returns a type variable with givenidentifier
among giventypeParameters
.private static Type[]
getTypeParameters
(AnnotationTarget target) private String
getTypeVariableIdentifier
(Type typeVariable) private boolean
hasAnonymousEncloser
(Indexer.TypeAnnotationState typeAnnotationState) private boolean
hasLocalEncloser
(Indexer.TypeAnnotationState typeAnnotationState) void
index
(InputStream stream) Analyze and index the class file data present in given inputstream
.index$$bridge
(InputStream stream) void
indexClass
(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 void
private void
private byte[]
intern
(byte[] bytes) private String
private Type
private Type[]
private boolean
isBridge
(MethodInfo methodInfo) private static boolean
isEnumConstructor
(MethodInfo method) private boolean
isInnerConstructor
(MethodInfo method) private boolean
isJDK11OrNewer
(DataInputStream stream) private static boolean
match
(byte[] target, int offset, byte[] expected) private static int
minLength
(int oldLength, int minGrowth) private static int
newLength
(int oldLength, int minGrowth, int prefGrowth) private DotName
Returns the name of the outermost type that encloses giventype
and on which type annotations are admissible.private void
parseClassSignature
(String signature, ClassInfo clazz) private void
parseFieldSignature
(String signature, FieldInfo field) private Type[]
parseMethodArgs
(String descriptor, Indexer.IntegerHolder pos) private void
parseMethodSignature
(String signature, MethodInfo method) private void
parseRecordComponentSignature
(String signature, RecordComponentInfo recordComponent) private Type
private Type
parseType
(String descriptor, Indexer.IntegerHolder pos) private void
patchTypeVariableReferences
(Type type, Deque<TypeVariable> typeVarStack, AnnotationTarget parametricEncloser) Patches all type variable references contained in giventype
.private int
popNestedDepth
(Indexer.PathElementStack elements) private AnnotationInstance
processAnnotation
(DataInputStream data, AnnotationTarget target, boolean visible) private void
processAnnotationDefault
(DataInputStream data, MethodInfo target) private AnnotationValue
processAnnotationElementValue
(String name, DataInputStream data) private void
processAnnotations
(DataInputStream data, AnnotationTarget target, boolean visible) private void
processAttributes
(DataInputStream data, AnnotationTarget target) private void
private void
processCode
(DataInputStream data, MethodInfo target) private boolean
processConstantPool
(DataInputStream stream) private void
processEnclosingMethod
(DataInputStream data, ClassInfo target) private void
processExceptions
(DataInputStream data, MethodInfo target) private void
private void
processInnerClasses
(DataInputStream data, ClassInfo target) private void
processLocalVariableTable
(DataInputStream data, MethodInfo target) private void
private void
processMethodParameters
(DataInputStream data, MethodInfo target) private void
processModule
(DataInputStream data, ClassInfo target) private List
<ModuleInfo.ExportedPackageInfo> private void
processModuleMainClass
(DataInputStream data, ClassInfo target) private List
<ModuleInfo.OpenedPackageInfo> private void
processModulePackages
(DataInputStream data, ClassInfo target) private List
<ModuleInfo.ProvidedServiceInfo> private List
<ModuleInfo.RequiredModuleInfo> private void
processPermittedSubclasses
(DataInputStream data, ClassInfo target) private void
private void
processSignature
(DataInputStream data, AnnotationTarget target) private ArrayList
<Indexer.PathElement> processTargetPath
(DataInputStream data, Indexer.BooleanHolder genericsRequired, Indexer.BooleanHolder bridgeIncompatible) private Indexer.TypeAnnotationState
processTypeAnnotation
(DataInputStream data, AnnotationTarget target, boolean visible) private void
processTypeAnnotations
(DataInputStream data, AnnotationTarget target, boolean visible) private Type
propagateOneTypeParameterBound
(Type type, Type[] allTypeParams, AnnotationTarget target) private void
private void
propagateTypeParameterBounds
(AnnotationTarget target, Deque<TypeVariable> sharedTypeVarStack) private void
private Type
propagateTypeVariables
(Type type, AnnotationTarget parametricEncloser) private Type
rebuildNestedType
(Type last, ArrayDeque<Indexer.InnerClassInfo> classes, Type type, int depth, Indexer.TypeAnnotationState typeAnnotationState) private void
recordAnnotation
(Map<DotName, List<AnnotationInstance>> classAnnotations, DotName annotation, AnnotationInstance instance) private void
recordUsedClass
(DotName usedClass) private void
recordUsedType
(Type type) private void
resolveTypeAnnotation
(AnnotationTarget target, Indexer.TypeAnnotationState typeAnnotationState) private void
private TypeVariable
resolveTypeParameter
(AnnotationTarget target, String identifier) Resolves a given type variableidentifier
against given parametrictarget
(either a method or a class).private Type
resolveTypePath
(Type type, Indexer.TypeAnnotationState typeAnnotationState) private void
private void
retargetTypeAnnotations
(AnnotationTarget parametricEncloser, Type oldType, Type newType) private Type
searchNestedType
(Type type, int depth, Indexer.TypeAnnotationState typeAnnotationState) private Type
searchTypePath
(Type type, Indexer.TypeAnnotationState typeAnnotationState) private static void
setTypeParameters
(AnnotationTarget target, Type[] typeParameters) private static byte[]
sizeToFit
(byte[] buf, int needed, int offset, int remainingEntries) private boolean
skipBridge
(Indexer.TypeAnnotationState typeAnnotationState, MethodInfo method) private static void
skipFully
(InputStream s, long n) private void
private boolean
targetsArray
(Indexer.TypeAnnotationState typeAnnotationState) private void
updateTypeTarget
(AnnotationTarget enclosingTarget, Indexer.TypeAnnotationState typeAnnotationState) private void
private void
verifyMagic
(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 giventype
and on which type annotations are admissible. This is either the nearest enclosingstatic
nested class, or the enclosing top-level class. Iftype
is 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.InnerClassInfo
s 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 anInnerClassInfo
representingtype
itself. Returns an empty list iftype
is 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
- ifclazz
isnull
-
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
- ifstream
isnull
-
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
index
returns 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
- ifstream
isnull
-
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
Whentype
contains no type variable references, returnstype
. Whentype
does 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,
type
must be a type variable. -
patchTypeVariableReferences
private void patchTypeVariableReferences(Type type, Deque<TypeVariable> typeVarStack, AnnotationTarget parametricEncloser) Patches all type variable references contained in giventype
. ThetypeVarStack
is 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. TheparametricEncloser
is 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 givenidentifier
among giventypeParameters
. Returnsnull
when none exists. -
resolveTypeParameter
Resolves a given type variableidentifier
against given parametrictarget
(either a method or a class). That is, if thetarget
has a type parameter with matching identifier, returns it; otherwise, resolvesidentifier
againsttarget
's nearest enclosing method or class. Returnsnull
if the identifier can't be resolved. -
getTypeVariableIdentifier
-
propagateTypeVariables
private void propagateTypeVariables() -
propagateTypeVariables
-
retargetTypeAnnotations
private void retargetTypeAnnotations(AnnotationTarget parametricEncloser, Type oldType, Type newType)
-