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 219626 - Create Field hint should not create a final class - variable
Summary: Create Field hint should not create a final class - variable
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-05 19:30 UTC by stefan79
Modified: 2013-06-23 02:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample class. (240 bytes, text/x-java-source)
2012-10-05 19:30 UTC, stefan79
Details
Screenshot (12.29 KB, image/png)
2012-10-05 19:30 UTC, stefan79
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stefan79 2012-10-05 19:30:07 UTC
Created attachment 125493 [details]
Sample class.

At the following example, you can´t compile the class, because you get the error:
variable argsLocal might not have been initialized


Example
...
public class NewClass1 {

    public NewClass1() {
    }
    
    public NewClass1(String[] args) {
        argsLocal = args;
    }
}
...

After clicking at the hint "Creating Field argsLocal in NewClass1", the following code is produced:
....
    private final String[] argsLocal;

    public NewClass1() {
    }
    
    public NewClass1(String[] args) {
        argsLocal = args;
    }
...

At the empty constructor you get the following error: "variable argsLocal might not have been initialized".


This is similar to #213699 (but not the same).
Comment 1 stefan79 2012-10-05 19:30:58 UTC
Created attachment 125494 [details]
Screenshot
Comment 2 Dusan Balek 2013-06-21 11:00:46 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/57b562d767ee
Comment 3 Quality Engineering 2013-06-23 02:09:41 UTC
Integrated into 'main-golden', will be available in build *201306222301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/57b562d767ee
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #219626: Create Field hint should not create a final class - variable - fixed.