JDK-8058708 : java.lang.AssertionError compiling source code
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-09-18
  • Updated: 2015-06-04
  • Resolved: 2014-09-26
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
8u45Fixed 9 b33Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
compile this code with the -g option:

class Test {
    void m(Object o)
    {
        if (o != null) {
            Object notUsed;
            Object used;
            if (o != null) {
                final Object finalLocal = null;
                used = null;
                if (o == null) {}
            }
        }
    }
}

javac crashes with an assertion error.
Comments
The regression was provoked by fix for JDK-8037937
25-09-2014

The bug can be reproduced with this reduced test case: class Test { void m(Object o) { if (o != null) { Object notUsed; Object used; if (o != null) { final Object finalLocal = null; used = null; if (o == null) {} } } } }
25-09-2014