JDK-6818199 : javac -Xprint missing newline for enums printed from a classfile
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2009-03-17
  • Updated: 2011-03-02
  • Resolved: 2011-03-02
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 7
7Resolved
Related Reports
Duplicate :  
Description
The javac command includes a -Xprint flag that uses annotation processing to output a source-code representation of a type.  This flag can be against either source files or class files as the originating location.  When the class file for a enum is used as the originating location, a newline is missed after the last enum constant, unliked when a source file is used as the origination location.

It would be good if this discrepency were fixed.

Example:

>javac -Xprint javax.lang.model.SourceVersion 
package javax.lang.model;

public enum SourceVersion {

  RELEASE_0,
  RELEASE_1,
  RELEASE_2,
  RELEASE_3,
  RELEASE_4,
  RELEASE_5,
  RELEASE_6,
  RELEASE_7;  private static final javax.lang.model.SourceVersion latestSupported;
  private static final java.util.Set<java.lang.String> keywords;

  public static javax.lang.model.SourceVersion[] values();

  public static javax.lang.model.SourceVersion valueOf(java.lang.String arg0);

  private SourceVersion();

  public static javax.lang.model.SourceVersion latest();

  private static javax.lang.model.SourceVersion getLatestSupported();

  public static javax.lang.model.SourceVersion latestSupported();

  public static boolean isIdentifier(java.lang.CharSequence arg0);

  public static boolean isName(java.lang.CharSequence arg0);

  public static boolean isKeyword(java.lang.CharSequence arg0);
}

vs

>javac -Xprint javax/lang/model/SourceVersion.java

package javax.lang.model;

public enum SourceVersion {

  RELEASE_0,
  RELEASE_1,
  RELEASE_2,
  RELEASE_3,
  RELEASE_4,
  RELEASE_5,
  RELEASE_6,
  RELEASE_7;
  public static javax.lang.model.SourceVersion[] values();

  public static javax.lang.model.SourceVersion valueOf(java.lang.String name);

  private SourceVersion();

  public static javax.lang.model.SourceVersion latest();
  private static final javax.lang.model.SourceVersion latestSupported;

  private static javax.lang.model.SourceVersion getLatestSupported();

  public static javax.lang.model.SourceVersion latestSupported();

  public static boolean isIdentifier(java.lang.CharSequence name);

  public static boolean isName(java.lang.CharSequence name);
  private static final java.util.Set<java.lang.String> keywords;

  public static boolean isKeyword(java.lang.CharSequence s);
}

Comments
EVALUATION It's not an exact dup of 6937417, but it's related and close enough that it was fixed by the fix for it.
02-03-2011