# HG changeset patch # User jjg # Date 1377803496 25200 # Node ID 96b6865eda949646586d187a6658c32b036e75f2 # Parent 9c0e192c09266e57208922c1ec200304dd0d25f6 8022744: javac -Xpkginfo command's documentation is sparse Reviewed-by: darcy diff -r 9c0e192c0926 -r 96b6865eda94 src/share/classes/com/sun/tools/javac/main/Option.java --- a/src/share/classes/com/sun/tools/javac/main/Option.java Thu Aug 29 12:03:28 2013 -0700 +++ b/src/share/classes/com/sun/tools/javac/main/Option.java Thu Aug 29 12:11:36 2013 -0700 @@ -389,6 +389,7 @@ XPREFER("-Xprefer:", "opt.prefer", EXTENDED, BASIC, ONEOF, "source", "newer"), + // see enum PkgInfo XPKGINFO("-Xpkginfo:", "opt.pkginfo", EXTENDED, BASIC, ONEOF, "always", "legacy", "nonempty"), /* -O is a no-op, accepted for backward compatibility. */ @@ -686,7 +687,28 @@ // For -XpkgInfo:value public enum PkgInfo { - ALWAYS, LEGACY, NONEMPTY; + /** + * Always generate package-info.class for every package-info.java file. + * The file may be empty if there annotations with a RetentionPolicy + * of CLASS or RUNTIME. This option may be useful in conjunction with + * build systems (such as Ant) that expect javac to generate at least + * one .class file for every .java file. + */ + ALWAYS, + /** + * Generate a package-info.class file if package-info.java contains + * annotations. The file may be empty if all the annotations have + * a RetentionPolicy of SOURCE. + * This value is just for backwards compatibility with earlier behavior. + * Either of the other two values are to be preferred to using this one. + */ + LEGACY, + /** + * Generate a package-info.class file if and only if there are annotations + * in package-info.java to be written into it. + */ + NONEMPTY; + public static PkgInfo get(Options options) { String v = options.get(XPKGINFO); return (v == null