8022744: javac -Xpkginfo command's documentation is sparse

Thu, 29 Aug 2013 12:11:36 -0700

author
jjg
date
Thu, 29 Aug 2013 12:11:36 -0700
changeset 1988
96b6865eda94
parent 1987
9c0e192c0926
child 1989
fcd768844b99
child 1992
23f0f3c9c44a

8022744: javac -Xpkginfo command's documentation is sparse
Reviewed-by: darcy

src/share/classes/com/sun/tools/javac/main/Option.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/javac/main/Option.java	Thu Aug 29 12:03:28 2013 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/main/Option.java	Thu Aug 29 12:11:36 2013 -0700
     1.3 @@ -389,6 +389,7 @@
     1.4  
     1.5      XPREFER("-Xprefer:", "opt.prefer", EXTENDED, BASIC, ONEOF, "source", "newer"),
     1.6  
     1.7 +    // see enum PkgInfo
     1.8      XPKGINFO("-Xpkginfo:", "opt.pkginfo", EXTENDED, BASIC, ONEOF, "always", "legacy", "nonempty"),
     1.9  
    1.10      /* -O is a no-op, accepted for backward compatibility. */
    1.11 @@ -686,7 +687,28 @@
    1.12  
    1.13      // For -XpkgInfo:value
    1.14      public enum PkgInfo {
    1.15 -        ALWAYS, LEGACY, NONEMPTY;
    1.16 +        /**
    1.17 +         * Always generate package-info.class for every package-info.java file.
    1.18 +         * The file may be empty if there annotations with a RetentionPolicy
    1.19 +         * of CLASS or RUNTIME.  This option may be useful in conjunction with
    1.20 +         * build systems (such as Ant) that expect javac to generate at least
    1.21 +         * one .class file for every .java file.
    1.22 +         */
    1.23 +        ALWAYS,
    1.24 +        /**
    1.25 +         * Generate a package-info.class file if package-info.java contains
    1.26 +         * annotations. The file may be empty if all the annotations have
    1.27 +         * a RetentionPolicy of SOURCE.
    1.28 +         * This value is just for backwards compatibility with earlier behavior.
    1.29 +         * Either of the other two values are to be preferred to using this one.
    1.30 +         */
    1.31 +        LEGACY,
    1.32 +        /**
    1.33 +         * Generate a package-info.class file if and only if there are annotations
    1.34 +         * in package-info.java to be written into it.
    1.35 +         */
    1.36 +        NONEMPTY;
    1.37 +
    1.38          public static PkgInfo get(Options options) {
    1.39              String v = options.get(XPKGINFO);
    1.40              return (v == null

mercurial