Find Usages in Compiled Dependencies

(Difference between revisions)

Revision as of 12:27, 30 August 2015

Find Usages in Compiled Dependencies

To find where a class, interface, method, or field is used in your project, you use the Find Usages command. From NetBeans 8.1 you can also find where they are used in the dependencies of your project. To get the results from your project's dependencies, NetBeans indexes the binary version of these dependencies. Searching for usages in compiled dependencies has certain limitations.


Find Usages limitations

Missing type references in the byte code

Missing Annotations with RetentionPolicy.SOURCE

Missing unused imports

Missing field access on constants.

According to JLS the constant is defined as static final primitive type or string which value is constant in compile time. For example: public static final String PROP_ENTRIES = "entries"; In the JDK 9 there should be an unused CONSTANT_Fieldref in constant pool emitted by compiler which will fix the problem.

Missing references from if (compile time false) blocks.

private static final boolean DEBUG = false; ... if (DEBUG) {



===Missing references on types which are just referred in the method bodies (no method call or field access is done on them) unless you compile with -g:vars. These references are not present due to missing Local Variable Table.===

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo