Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 470004

Summary: compiler fails to report uninitialized field use
Product: [Eclipse Project] JDT Reporter: Igor Fedorenko <igor>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 4.5   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Igor Fedorenko CLA 2015-06-11 16:46:50 EDT
The following code compiles in Eclipse I20150528-0700 but fails with "variable a might not have been initialized" when using Oracle javac 1.8.0_40 on command line


    public class UninitializedFinal {
      private final Object a;
      private final Object b;
    
      public UninitializedFinal() {
        this.b = this.a; // "might not have been initialized" error in javac
        this.a = new Object();
      }
    }


Oddly enough, the code compiles with Oracle javac 1.7.0_65-b17.

(apologies if this is fixed in a more recent 4.5 RC)
Comment 1 Igor Fedorenko CLA 2016-09-16 20:35:53 EDT

*** This bug has been marked as a duplicate of bug 480989 ***