This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 218844

Summary: Add fixable hint for "variable might not be initialized"
Product: java Reporter: markiewb
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows Vista   
Issue Type: ENHANCEMENT Exception Reporter:

Description markiewb 2012-09-22 21:49:16 UTC
[ BUILD # : 201209210001 ]
[ JDK VERSION : 1.6.35 ]

public class JavaApplication2 {

    final static String foo;

    public static void main(String[] args) {
        int a = foo.length();
    }
}

results in error "variable foo might not be initialized"

EXPECTED: provide a fixable hint which initializes the variable with a default

value