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.
[ BUILD # : ef67b41cc450 ] [ JDK VERSION : 1.6.* ] Follow this steps: 1. Create a new main class like this: public class NewMain { public static void main(String[] args) { final String str = "abc"; str.toString(); } } 2. Select the line 3, 'final String str = "abc";', and hit code template 'Surround with if (exp)...' the generated code will be: public class NewMain { public static void main(String[] args) { String str = null; if (exp) { final str = "abc"; } else { } str.toString(); } } and the expected is remove 'final' keyword.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/b0d96cd8edd2