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.
[release 5.0 fcs; JDK 1.5.0] Steps to reproduce: 1.Create new JPanel in default package of the J2SE project 2.Place JTextField in the top left corner 3.Switch from Design view to Source view 4.Add a call to a non-existing method to the constructor's body last line "nonExisting();" 5.Save the file 6.Let the cursor is on the line with non-existing method call 7.Push Alt+Enter and then Enter - the following code is there in class as a guarded block: -------------------------------------%<-------------------------------- // Variables declaration - do not mo private void nonExisting() { throw new UnsupportedOperationException("Not yet implemented"); } dify private javax.swing.JTextField jTextField1; // End of variables declaration -------------------------------------%<-------------------------------- The code is uncompilable then and it is not possible to make the code compilable because the error is in guarded block - this is why this issue has the highest priority.
Reassigning to java. Note that this seems to be a duplicate of issue 58816 that has been marked as fixed because we (form guys) have changed the code generation according to pflaska's suggestion.
This issue is not related to issue 58816 but rather to issue 67994.
The problem is in saving garded sections. We will fix it for 5.5.
*** Issue 67994 has been marked as a duplicate of this issue. ***
*** Issue 74312 has been marked as a duplicate of this issue. ***
This problem happens, when new guarded block is saved into the file. The real fix would be risky. It would require to implement logic to add spaces into document which correspond to guraded markers in files. We implemented workaround which reloads the file right after the document with new guarded block is saved. Checking in JavaEditor.java; /cvs/java/src/org/netbeans/modules/java/JavaEditor.java,v <-- JavaEditor.java new revision: 1.206; previous revision: 1.205 done
Verified in dev build #200604061800.
Fixed in release_55 Checking in JavaEditor.java; /cvs/java/src/org/netbeans/modules/java/JavaEditor.java,v <-- JavaEditor.java new revision: 1.199.2.2.2.1; previous revision: 1.199.2.2 done
*** Issue 74662 has been marked as a duplicate of this issue. ***
*** Issue 71952 has been marked as a duplicate of this issue. ***
*** Issue 72015 has been marked as a duplicate of this issue. ***
*** Issue 74590 has been marked as a duplicate of this issue. ***
*** Issue 75093 has been marked as a duplicate of this issue. ***