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 137638

Summary: auto-generated code is broken
Product: guibuilder Reporter: lordthecrow <lordthecrow>
Component: App FrameworkAssignee: issues@guibuilder <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Windows Vista   
Issue Type: DEFECT Exception Reporter:
Attachments: print screen for broken generated code
the form which generates broken code
generated java file

Description lordthecrow 2008-06-18 22:16:13 UTC
I created a simple interface, and handle events for my components. Suddenly, some of my custom code written for some
method become unavailable for editing, being marked as auto-generated. Beside that, when I add a new event handler the
method code is generated inside another method resulting in compile errors.
Comment 1 lordthecrow 2008-06-18 22:18:03 UTC
Created attachment 63043 [details]
print screen for broken generated code
Comment 2 lordthecrow 2008-06-18 22:19:24 UTC
Created attachment 63044 [details]
the form which generates broken code
Comment 3 Jiri Vagner 2008-06-19 07:00:45 UTC
Please add also VisualInterface.JAVA file. Can you please add a few steps how to reproduce it? (Something like: Create
form, add button, invoke popup menu, .... )
Comment 4 Jan Stola 2008-06-19 07:57:12 UTC
It seems like a duplicate of issue 116456. The root of the problem is that Surround with try-catch hint breaks (hidden) 
comments that mark the begin and the end of the guarded (read-only) blocks.

You can fix your form by editing these comments manually in external editor (outside NetBeans). See some non-corrupted 
form how these comments should look like.

*** This issue has been marked as a duplicate of 116456 ***
Comment 5 lordthecrow 2008-06-19 10:01:10 UTC
Created attachment 63062 [details]
generated java file
Comment 6 lordthecrow 2008-06-19 10:06:34 UTC
I added the java file for the form. Indeed it was from misplaced //GEN-LAST comment due to try catch surrounding. There
was multiple hidden comments misplaced. Unfortunately I cannot reproduce it. I can say that I added some menu item,
complete the code inside events which involved a try-catch, and then tried to add a new ActionEvent on a menu item.