NameDateSize

..14-Dec-20176

CSV.javaH A D14-Dec-20175.1 KiB

CSVParseException.javaH A D14-Dec-20172 KiB

DeprData.javaH A D14-Dec-20172.2 KiB

DeprDB.javaH A D14-Dec-20176 KiB

internals.mdH A D14-Dec-20177.4 KiB

LoadProc.javaH A D14-Dec-20177.3 KiB

Main.javaH A D14-Dec-201726.1 KiB

Messages.javaH A D14-Dec-20172.7 KiB

Pretty.javaH A D14-Dec-20178.4 KiB

readme.mdH A D14-Dec-20176.3 KiB

resources/H14-Dec-20175

scan/H14-Dec-20177

TraverseProc.javaH A D14-Dec-20176.1 KiB

readme.md

1<!--
2
3Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
4DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
6This code is free software; you can redistribute it and/or modify it
7under the terms of the GNU General Public License version 2 only, as
8published by the Free Software Foundation.  Oracle designates this
9particular file as subject to the "Classpath" exception as provided
10by Oracle in the LICENSE file that accompanied this code.
11
12This code is distributed in the hope that it will be useful, but WITHOUT
13ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15version 2 for more details (a copy is included in the LICENSE file that
16accompanied this code).
17
18You should have received a copy of the GNU General Public License version
192 along with this work; if not, write to the Free Software Foundation,
20Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
22Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23or visit www.oracle.com if you need additional information or have any
24questions.
25
26-->
27
28
29JDeprScan Tool Command Reference
30-----
31
32**NAME**
33
34        jdeprscan - Java deprecation scanner
35
36**SYNOPSIS**
37
38        jdeprscan [options] {dir | jar | class} ...
39
40**OPTIONS**
41
42        --class-path PATH
43
44            Sets the classpath to PATH.
45
46        --for-removal
47
48            Limit reporting to deprecations whose forRemoval element
49            is true.
50
51        --full-version
52
53            Prints the full version string of the tool and exits.
54
55        -h
56        --help
57
58            Prints a help message and exits.
59
60        -l
61        --list
62
63            Prints out the set of deprecated APIs.
64
65        --release 6|7|8|9
66
67            Specifies the Java SE release that is the source of
68            the list of deprecated APIs. If no --release option is
69            provided, the latest release is used.
70
71        -v
72        --verbose
73
74            Enables additional output.
75
76        --version
77
78            Prints the version string of the tool and exits.
79
80**DESCRIPTION**
81
82**jdeprscan** scans a class library for uses of deprecated APIs.
83**jdeprscan** processes one or more arguments, which can be any
84combination of a directory, a jar file, or a class name.
85
86A directory argument must specify a path to a directory hierarchy that
87reflects the Java package hierarchy of the classes it contains.
88**jdeprscan** will scan each class found in the directory hierarchy
89and report information about how those classes use deprecated APIs.
90
91Given a jar file, **jdeprscan** will scan the classes found within
92that jar file and report information about how those classes use
93deprecated APIs.
94
95Given a class file, **jdeprscan** will scan that class and report
96its use of deprecated APIs.
97
98Given a class name, **jdeprscan** will search for that class on the
99classpath, scan that class, and report information about how that
100class uses deprecated APIs. The class name must use the fully
101qualified binary name of the class, as described in the
102[Java Language Specification, section 13.1][jls131]. This form uses
103the '$' character instead of '.' as the separator for nested class names.
104For example, the `Thread.State` enum would be specified using the string
105
106        java.lang.Thread$State
107
108The `--class-path` option specifies the classpath used for
109class searching. The classpath is used for classes named on the
110command line, as well as for dependencies of the classes in jar file
111or directory hierarchy to be scanned.
112
113The `--for-removal` option limits output to uses of deprecated APIs
114whose `@Deprecated` annotation includes the `forRemoval` element with
115the value `true`. Note: the `forRemoval` attribute of the
116`@Deprecated` annotation did not exist prior to Java SE 9, so this
117option cannot be used with a release value of 6, 7, or 8.
118
119The `--release` option specifies the Java SE specification version
120that determines the set of deprecated APIs for which scanning is
121done. This is useful if a deprecation report is desired that lists
122uses of deprecated APIs as of a particular release in the past. If no
123`--release` option is given, the latest release is used.
124
125The `--list` and `-l` options will list the known set of deprecated
126APIs instead of doing any scanning. Since no scanning is done,
127no directory, jar, or class arguments should be provided. The set
128of deprecated APIs listed is affected by the `--release` and the
129`--for-removal` options.
130
131
132**EXAMPLE OUTPUT**
133
134The output is a report that lists program elements that use deprecated
135APIs. Output is subject to change.
136
137Consider the following declarations from Java SE 9:
138
139        // java.lang.Boolean
140
141        @Deprecated(since="9")
142        public Boolean(boolean value)
143
144        // java.lang.Runtime
145
146        @Deprecated(since="1.2", forRemoval=true)
147        public static void runFinalizersOnExit(boolean value)
148
149Running **jdeprscan** over a class that calls these methods will result
150in output something like the following:
151
152        class Example uses method java/lang/Boolean.<init>(Z)V deprecated
153        class Example uses method java/lang/Runtime.runFinalizersOnExit(Z)V deprecated for removal
154
155Running **jdeprscan** with the `--list` option will result in output
156including something like the following:
157
158        ...
159        @Deprecated(since="9") java.lang.Boolean(boolean)
160        @Deprecated(since="1.2", forRemoval=true) void java.lang.Runtime.runFinalizersOnExit(boolean)
161        ...
162
163**NOTES**
164
165The **jdeprscan** tool operates by opening Java class files and
166reading their structures directly, particularly the constant
167pool. Because of this, **jdeprscan** can tell _that_ a deprecated API
168is used, but it often cannot tell _where_ in the class that API is
169used.
170
171The **jdeprscan** tool doesn't follow the same set of rules for
172emitting warnings as specified for Java compilers in [JLS section
1739.6.4.6][jls9646]. In particular, **jdeprscan** does not respond to
174the `@SuppressWarnings` annotation, as that is significant only in
175source code, not in class files. In addition, **jdeprscan** emits
176warnings even if the usage is within the API element that is
177deprecated and when the use and declaration are within the same
178outermost class.
179
180[jls9646]: http://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.6.4.6
181
182[jls131]: http://docs.oracle.com/javase/specs/jls/se8/html/jls-13.html#jls-13.1
183