public class CheckSer extends Object
serialVersionUID
fields.Modifier and Type | Field and Description |
---|---|
private static int |
MASK |
private static boolean |
resinit |
private static ResourceBundle |
resources |
Constructor and Description |
---|
CheckSer() |
Modifier and Type | Method and Description |
---|---|
static void |
check(String dir,
int strip)
Checks the class file directory hierarchy starting from the specified
directory.
|
private static void |
checkClass(String file,
int strip) |
private static String |
getString(String key) |
static void |
main(String[] args)
Checks class file directory hierarchies for serializable classes
that do not have explicit
serialVersionUID fields,
and prints the names of such classes to the standard output stream. |
private static void |
print(String key,
String val) |
private static final int MASK
private static ResourceBundle resources
private static boolean resinit
public static void main(String[] args)
serialVersionUID
fields,
and prints the names of such classes to the standard output stream.
The only options are zero or more filenames that specify the roots
of directory hierarchies; if no filenames are specified, the single
root /vob/jive/classes
is used. In those hierarchies,
each file with a name ending in the suffix .class
is
treated as a class file; the corresponding class name is obtained
from the filename by stripping off both the original prefix root
filename and the .class
suffix, and replacing each file
separator character with a period (.
). Each such class
is loaded from the class loader of this tool. If the class is not an
interface, directly or indirectly implements Serializable
,
and does not have a declared static
final
field named serialVersionUID
, then the name of the class
is printed to the standard output stream.args
- the roots of directory hierarchiespublic static void check(String dir, int strip)
.class
is treated as a class file; the
corresponding class name is obtained from the filename by stripping
off the first strip
characters of prefix and the
.class
suffix, and replacing each file separator
character with a period (.
). Each such class is loaded
from the class loader of this tool. If the class is not an interface,
directly or indirectly implements Serializable
, and does not
have a declared static
final
field named
serialVersionUID
, then the name of the class is printed
to the standard output stream.dir
- directory hierarchy rootstrip
- number of characters of prefix to strip from each
class file nameprivate static void checkClass(String file, int strip)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.