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.
When having void a() { List<String> ls = null; List<Number> ln = null; forc| } expands to for (Iterator<Number> it = ln.iterator(); it.hasNext();) { Number number = it.next(); } Modifying selected "it" will result into an incorrect text being inserted at invalid places (shifted by missing "<Number" text). The code is broken.
http://hg.netbeans.org/jet-main/rev/ee352580e637
Unfortunately there is another "nested" case which does not work: void a() { String s; List<String> ls = null; List<Number> ln = null; forc| } static <X> X get(X x) { return x; } and Tab to select "ln" and then do Ctrl+Space and choose "get()". The resulting invalid code is for (Iterator it = (s).iteratogetr(); it.hasNext();) { Object object = it.next(); }
Integrated into 'main-golden', will be available in build *200905220201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/ee352580e637 User: Miloslav Metelka <mmetelka@netbeans.org> Log: #165696 - Broken editing of expanded "forc" code template.
When trying to fix the problem I've tried to test the behavior in both 6.5.1 and 6.1 and the problem can be reproduced in both of them although in 6.5.1 it's similar to state that I've already fixed previously while in 6.1 it's similar to current state. So it's in fact not a regression but I'll try to fix anyway.
http://hg.netbeans.org/jet-main/rev/d17520c2e307
Integrated into 'main-golden', will be available in build *200905270201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/d17520c2e307 User: Miloslav Metelka <mmetelka@netbeans.org> Log: #165696 - Broken editing of expanded "forc" code template.
verified in 090702
The fix has been ported into the release67_fixes repository. http://hg.netbeans.org/release67_fixes/rev/619793565485
v. in 6.7.1