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 211589

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

Description stefan79 2012-04-23 12:37:52 UTC
[ BUILD # : 201204220400 ]
[ JDK VERSION : 1.7.3 ]

At the following code, the array is shown as unbalanced:
..
    public NewClass() {
        String[] myArray = createArray();
        
        String val1 = myArray[0];
        String val2 = myArray[1];
        
        System.out.println("1: " + val1 + " 2: " + val2);
    }

    private String[] createArray() {
        return new String[] {"1", "2"};
    }
..
Comment 1 stefan79 2012-04-23 12:38:20 UTC
Created attachment 118632 [details]
Sample class.
Comment 2 stefan79 2012-04-23 12:39:37 UTC
Created attachment 118633 [details]
Screenshot
Comment 3 Jan Lahoda 2012-04-23 13:48:01 UTC
Fixed as bug #211248. Thanks for the report anyway.

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