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.
Product Version: NetBeans IDE Dev (Build 20080425101413) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb) Create local variable generates declaration at wrong position, if there is variable with the same name in the another block. Steps to reproduce: 0) configure the hint to create local variable at the place of first usage 1) have a method fragment: for (int i = 0; i < childs; i++) { Object child = model.getChild(parent, i); al.add(child); } if (level <= sortLevel) { sortChilds(al); } while(!al.isEmpty()) { child = al.remove(0); browseChildren(model, child, level + 1); } 2) in the last block('while') use create local variable, -> the Object child is created before the first block. This cause error in code, since the redeclaration in the 'for' block Object child; for (int i = 0; i < childs; i++) { Object child = model.getChild(parent, i); al.add(child); } if (level <= sortLevel) { sortChilds(al); } while(!al.isEmpty()) { child = al.remove(0); browseChildren(model, child, level + 1); }
Max volunteered :)
This will be resolved LATER.
NetBeans.org Migration: changing resolution from LATER to WONTFIX