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 209850

Summary: Java-Hint "Unbalaced read/write with arrays" is wrong at Arrays
Product: java Reporter: stefan79 <stefan79>
Component: HintsAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot

Description stefan79 2012-03-21 12:20:14 UTC
[ BUILD # : 201203200400 ]
[ JDK VERSION : 1.7.3 ]

Example-Code:

Collection<Integer[]> myCollection = new ArrayList<Integer[]>();
        myCollection.add(new Integer[]{1, 2});

        for (Integer[] X1 : myCollection) { //Here the Hint "Unbalaced
read/write with arrays" is shown
            Integer Xx0 = X1[0]; //Here the Array is used
            Integer Xx1 = X1[1]; //And here again
            System.out.println(Xx0 + "->" + Xx1);
        }
Comment 1 stefan79 2012-03-21 12:22:05 UTC
Created attachment 117002 [details]
Screenshot
Comment 2 Jan Lahoda 2012-03-21 15:23:18 UTC
Thanks for the report, should be fixed in the trunk:
http://hg.netbeans.org/jet-main/rev/3a0663979d94
Comment 3 Quality Engineering 2012-03-23 10:34:34 UTC
Integrated into 'main-golden', will be available in build *201203230400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3a0663979d94
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #209850: Unbalanced$Array needs to ignore for each variables.