jdeprscan is a static analysis tool which can be used for scanning an aggregation of the class files in java for the use of deprecated API elements. Its usage is as :
jdeprscan [ options ]{dir|jar|class}
Example of its usage is :
jdeprscan commons-math3-3.6.1.jar
where one line of output might be:
class org/apache/commons/math3/util/MathUtils uses deprecated method java/lang/Double::<init>(D)V
The name of the deprecated method is , which is a special name that means that the method is actually a constructor. Another special name is , which indicates a class static initializer. Other methods are just listed by their method name. Following the method name is the argument list and return type: (D)V
. This indicates that it takes a single double
value (a primitive) and returns void
The argument and return types can become cryptic. For example, another line of output might be:
class org/apache/commons/math3/util/Precision uses deprecated method java/math/BigDecimal::setScale(II)Ljava/math/BigDecimal;
In this line of output, the deprecated method is on class java.math.BigDecimal
, and the method is setScale()
. In this case, the (II)
means that it takes two int arguments. The Ljava/math/BigDecimal;
after the parentheses means that it returns a reference to java.math.BigDecimal.