| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Set | |
| pack-priv final List | |
| pack-priv final DeprDB | |
| pack-priv Pattern | |
| pack-priv final PrintStream | |
| pack-priv boolean | |
| pack-priv final ClassFinder | |
| pack-priv final PrintStream | |
| pack-priv Pattern | |
| pack-priv final boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | addInterfaces(Deque<String>
the deque of interfaces intfs, ClassModel the ClassModel of this class
@ if a constant pool entry cannot be found cf)Adds all interfaces from this class to the deque of interfaces. |
| pack-priv void | checkClasses(ClassModel
the ClassModel of this class cf, CPEntries constant pool entries collected from this class
@ if a constant pool entry cannot be found entries)Checks Class_info entries in the constant pool. |
| pack-priv void | checkFieldRef(ClassModel
the ClassModel of this class
@ if a constant pool entry cannot be found cf, FieldRefEntry fri)Checks fields referred to from the constant pool. |
| pack-priv void | checkFields(ClassModel
the ClassModel of this class
@ if a constant pool entry cannot be found cf)Checks the fields declared in this class. |
| pack-priv void | checkInterfaces(ClassModel
the ClassModel of this class
@ if a constant pool entry cannot be found cf)Checks the interfaces of this class. |
| pack-priv void | checkMethodRef(ClassModel
the ClassModel of this class cf, String the class name clname, NameAndTypeEntry the NameAndType_info from a MethodRef or InterfaceMethodRef entry nti, String message key for localization
@ if a constant pool entry cannot be found msgKey)Checks methods referred to from the constant pool. |
| pack-priv void | checkMethods(ClassModel
the ClassModel object of this class
@ if a constant pool entry cannot be found cf)Checks the methods declared in this class. |
| pack-priv void | checkSuper(ClassModel
the ClassModel of this class
@ if a constant pool entry cannot be found cf)Checks the superclass of this class. |
| pack-priv String | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv boolean | Returns: boolean indicating whether the member is present @ if a constant pool entry cannot be foundthe ClassModel of the class to search targetClass, String the method or field's name targetName, String the methods descriptor (ignored if checkMethod is false) targetDesc, boolean true if checking for method, false if checking for field checkMethod)Checks whether a member (method or field) is present in a class. |
| pack-priv String | Returns: the extracted class name, or nullthe type from a descriptor descType)Given a descriptor type, extracts and returns the class name from it, if any. |
| pack-priv String | Returns: the extracted class name, or nulla reference type name refType)Given a ref type name, extracts and returns the class name from it, if any. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | processClass(ClassModel
the ClassModel of the class
@ if a constant pool entry cannot be found cf)Processes a single class file. |
| public boolean | Returns: true on success, false on failurethe class file to scan fileName)Scans the named class file for uses of deprecated APIs. |
| public boolean | Returns: true on success, false on failurethe class to scan className)Scans the named class for uses of deprecated APIs. |
| pack-priv String | Returns: the name of the class where the member resolved, or null @ if a constant pool entry cannot be foundthe ClassModel of this class cf, String the name of the class at which to start searching startClassName, String the member name to search for findName, String the method descriptor to search for (ignored for fields) findDesc, boolean true if resolving a method, false if resolving a field resolveMethod, boolean true if the start class should be searched, false if
it should be skipped checkStartClass)Resolves a member by searching this class and all its superclasses and implemented interfaces. |
| public boolean | |
| public boolean | |
| pack-priv String |
| classesNotFound | back to summary |
|---|---|
| pack-priv final Set<String> classesNotFound | |
| classPath | back to summary |
|---|---|
| pack-priv final List<String> classPath | |
| db | back to summary |
|---|---|
| pack-priv final DeprDB db | |
| descTypePattern | back to summary |
|---|---|
| pack-priv Pattern descTypePattern | |
| err | back to summary |
|---|---|
| pack-priv final PrintStream err | |
| errorOccurred | back to summary |
|---|---|
| pack-priv boolean errorOccurred | |
| finder | back to summary |
|---|---|
| pack-priv final ClassFinder finder | |
| out | back to summary |
|---|---|
| pack-priv final PrintStream out | |
| refTypePattern | back to summary |
|---|---|
| pack-priv Pattern refTypePattern | |
| verbose | back to summary |
|---|---|
| pack-priv final boolean verbose | |
| Scan | back to summary |
|---|---|
| public Scan(PrintStream out, PrintStream err, List<String> classPath, DeprDB db, boolean verbose) | |
| addInterfaces | back to summary |
|---|---|
| pack-priv void addInterfaces(Deque<String> intfs, ClassModel cf) Adds all interfaces from this class to the deque of interfaces.
| |
| checkClasses | back to summary |
|---|---|
| pack-priv void checkClasses(ClassModel cf, CPEntries entries) Checks Class_info entries in the constant pool.
| |
| checkFieldRef | back to summary |
|---|---|
| pack-priv void checkFieldRef(ClassModel cf, FieldRefEntry fri) Checks fields referred to from the constant pool.
| |
| checkFields | back to summary |
|---|---|
| pack-priv void checkFields(ClassModel cf) Checks the fields declared in this class.
| |
| checkInterfaces | back to summary |
|---|---|
| pack-priv void checkInterfaces(ClassModel cf) Checks the interfaces of this class.
| |
| checkMethodRef | back to summary |
|---|---|
| pack-priv void checkMethodRef(ClassModel cf, String clname, NameAndTypeEntry nti, String msgKey) Checks methods referred to from the constant pool.
| |
| checkMethods | back to summary |
|---|---|
| pack-priv void checkMethods(ClassModel cf) Checks the methods declared in this class.
| |
| checkSuper | back to summary |
|---|---|
| pack-priv void checkSuper(ClassModel cf) Checks the superclass of this class.
| |
| dep | back to summary |
|---|---|
| pack-priv String dep(boolean forRemoval) | |
| errorException | back to summary |
|---|---|
| pack-priv void errorException(Exception ex) | |
| errorNoClass | back to summary |
|---|---|
| pack-priv void errorNoClass(String className) | |
| errorNoFile | back to summary |
|---|---|
| pack-priv void errorNoFile(String fileName) | |
| errorNoMethod | back to summary |
|---|---|
| pack-priv void errorNoMethod(String className, String methodName, String desc) | |
| isMemberPresent | back to summary |
|---|---|
| pack-priv boolean isMemberPresent(ClassModel targetClass, String targetName, String targetDesc, boolean checkMethod) Checks whether a member (method or field) is present in a class. The checkMethod parameter determines whether this checks for a method or for a field.
| |
| nameFromDescType | back to summary |
|---|---|
| pack-priv String nameFromDescType(String descType) Given a descriptor type, extracts and returns the class name from it, if any. These types are obtained from field descriptors (JVMS 4.3.2) and method descriptors (JVMS 4.3.3). They have one of the following forms: I // or any other primitive, or V for void [I // array of primitives, including multi-dimensional Lname; // the named class [Lname; // array whose component is the named class (also multi-d) This method extracts and returns the class name, or returns empty for primitives, void, or array of primitives. Returns nullable reference instead of Optional because downstream processing can throw checked exceptions. | |
| nameFromRefType | back to summary |
|---|---|
| pack-priv String nameFromRefType(String refType) Given a ref type name, extracts and returns the class name from it, if any. Ref type names are obtained from a Class_info structure (JVMS 4.4.1) and from Fieldref_info, Methodref_info, and InterfaceMethodref_info structures (JVMS 4.4.2). They represent named classes or array classes mentioned by name, and they represent class or interface types that have the referenced field or method as a member. They have one of the following forms: [I // array of primitives, including multi-dimensional name // the named class [Lname; // array whose component is the named class (also multi-d) Notably, a plain class name doesn't have the L prefix and ; suffix, and primitives and void do not occur. Returns nullable reference instead of Optional because downstream processing can throw checked exceptions. | |
| printField | back to summary |
|---|---|
| pack-priv void printField(String key, ClassModel cf, String cname, String fname, boolean r) | |
| printFieldType | back to summary |
|---|---|
| pack-priv void printFieldType(String key, ClassModel cf, String cname, String fname, String type, boolean r) | |
| printHasField | back to summary |
|---|---|
| pack-priv void printHasField(ClassModel cf, String fname, String type, boolean r) | |
| printHasMethodParmType | back to summary |
|---|---|
| pack-priv void printHasMethodParmType(ClassModel cf, String mname, String parmType, boolean r) | |
| printHasMethodRetType | back to summary |
|---|---|
| pack-priv void printHasMethodRetType(ClassModel cf, String mname, String retType, boolean r) | |
| printHasOverriddenMethod | back to summary |
|---|---|
| pack-priv void printHasOverriddenMethod(ClassModel cf, String overridden, String mname, String desc, boolean r) | |
| printMethod | back to summary |
|---|---|
| pack-priv void printMethod(String key, ClassModel cf, String cname, String mname, String rtype, boolean r) | |
| printType | back to summary |
|---|---|
| pack-priv void printType(String key, ClassModel cf, String cname, boolean r) | |
| processClass | back to summary |
|---|---|
| pack-priv void processClass(ClassModel cf) Processes a single class file.
| |
| processClassFile | back to summary |
|---|---|
| public boolean processClassFile(String fileName) Scans the named class file for uses of deprecated APIs.
| |
| processClassName | back to summary |
|---|---|
| public boolean processClassName(String className) Scans the named class for uses of deprecated APIs.
| |
| resolveMember | back to summary |
|---|---|
| pack-priv String resolveMember(ClassModel cf, String startClassName, String findName, String findDesc, boolean resolveMethod, boolean checkStartClass) Resolves a member by searching this class and all its superclasses and implemented interfaces. Todo handles a few too many cases; needs cleanup. Todo refine error handling
| |
| scanDir | back to summary |
|---|---|
| public boolean scanDir(String dirname) Scans class files in the named directory hierarchy for uses of deprecated APIs.
| |
| scanJar | back to summary |
|---|---|
| public boolean scanJar(String jarname) Scans a jar file for uses of deprecated APIs.
| |
| typeKind | back to summary |
|---|---|
| pack-priv String typeKind(ClassModel cf) | |