FULL PRODUCT VERSION :
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux dmitry-m-d 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
When compiling class that contains private inner class without explicitly defined constructor, compiler treats creation of instances of the inner class as creation of anonymous class.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile attached source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
2 class files - A.class and A$B.class
ACTUAL -
3 class files - A.class, A$B.class and excessive A$1.class
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package p;
class A {
void test() {
new B();
}
private class B {
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Adding empty default constructor suppresses issue.
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux dmitry-m-d 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
When compiling class that contains private inner class without explicitly defined constructor, compiler treats creation of instances of the inner class as creation of anonymous class.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile attached source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
2 class files - A.class and A$B.class
ACTUAL -
3 class files - A.class, A$B.class and excessive A$1.class
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package p;
class A {
void test() {
new B();
}
private class B {
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Adding empty default constructor suppresses issue.