JDK-8033114 : The values of non-static final fields are printed for the -constants option
  • Type: Bug
  • Component: tools
  • Sub-Component: javap
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-01-29
  • Updated: 2014-07-29
  • Resolved: 2014-02-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u20Fixed 9 b04Fixed
Description
Compile and get javap's output for any class that contains final fields with "-constants" option, e.g.
class SimpleClass {
    public final String FINAL_CONSTANT = "Lorem ipsum dolor sit amet...";
    public static String STATIC_CONSTANT = "Lorem ipsum dolor sit amet...";
    public static final String STATIC_FINAL_CONSTANT = "Lorem ipsum dolor sit amet...";
}

The output message contains the value of the non-static final field:
....
  public final java.lang.String FINAL_CONSTANT = "Lorem ipsum dolor sit amet...";
  public static java.lang.String STATIC_CONSTANT;
  public static final java.lang.String STATIC_FINAL_CONSTANT = "Lorem ipsum dolor sit amet...";
....
According to the help message only the "static final" constant values should be included ("-constants               Show static final constants")
Comments
The "constant" (being applied to java) at first sight is associated with the final static field (IMHO).
31-01-2014

The help message is wrong. The listing of the fields is correct.
30-01-2014