- 
    Bug 
- 
    Resolution: Fixed
- 
     P4 P4
- 
    9
- 
        b01
- 
        generic
- 
        generic
                    Output for a desugared tree (sourceOutput == false) thus cannot be compiled.  Output for (sourceOutput == true) is correct so this may be considered a non-issue.
enum Foo {AA, BB, CC { void m() {} }; void m() {};}
Generates ---
enum Foo {
/*public static final*/ AA /* = new Foo() */,
/*public static final*/ BB /* = new Foo() */,
/*public static final*/ CC /* = new Foo()/*enum*/{
        
void m() {
}
} */;
    
void m() {
}
}
Cause is
public void visitVarDef(JCVariableDecl tree) {
...
if ((tree.mods.flags & ENUM) != 0) {
...
print(" /* = ");
printExpr(tree.init);
print(" */");
}
            
enum Foo {AA, BB, CC { void m() {} }; void m() {};}
Generates ---
enum Foo {
/*public static final*/ AA /* = new Foo() */,
/*public static final*/ BB /* = new Foo() */,
/*public static final*/ CC /* = new Foo()/*enum*/{
void m() {
}
} */;
void m() {
}
}
Cause is
public void visitVarDef(JCVariableDecl tree) {
...
if ((tree.mods.flags & ENUM) != 0) {
...
print(" /* = ");
printExpr(tree.init);
print(" */");
}