Description
When a dependency is only required for a constant in a JAR, dependency:analyze incorrectly reports the dependency as "Unused declared".
Example:
Constants.jar has 1 class called Constants.java:
package com.myco.util; public class Constants { private Constants() {}; public static final double PI = 3.14159; }
Then App jar has App.java as:
package com.myco.app; public class App { public static void main( String[] args ) { System.out.println( com.myco.util.Constants.PI ); } }
Since the constant gets optimized away in the generated App.class, the dependency is not detected, even though the project won't compile without it.
Attachments
Issue Links
- depends upon
-
MDEP-122 Analyze target does not work correctly when only using a constant defined in a different module
- Closed