Skip to content

Commit fe1b524

Browse files
committed
Fixes a 'bug' where inner classes would not be imported (always used FQCN). Here's what I know:
Back when codemodel was inside the JAXB RI, JAXB-166 was filed to report a bug where generated code would not compile. That was found to be a bug in the javac compiler, and BugParade 6431987 was filed for that. As a temporary fix, this line was added to the formatter to avoid generating bad code. The compiler bug has since been resolved (sometime in JDK6, which is EOL anyway these days), so it seems reasonable to go back to importing inner classes when possible. They will still be imported in full if there is a naming conflict with another imported type.
1 parent a074f05 commit fe1b524

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

codemodel/src/main/java/com/sun/codemodel/JFormatter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,6 @@ public boolean collisions(JDefinedClass enclosingClass) {
539539
return true; //collision
540540
}
541541
}
542-
if(c.outer()!=null)
543-
return true; // avoid importing inner class to work around 6431987. Also see jaxb issue 166
544542
}
545543

546544
return false;

0 commit comments

Comments
 (0)