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 # : 201306132201 ] [ JDK VERSION : 1.7.0_21 ] moving a package including a component used by a form does not update the component class inside the form xml file (.form), the form file (.java) is updated correctly. this breaks the design editor throwing a ClassNotFoundException
Can you provide specific steps how to reproduce it? Possibly attach a sample project? There can be more ways of the setup and I have no luck reproducing it. I've tried to rename a package with a component used in a GUI form that is either in a different or in the same package (within the same project) and it worked fine. I guess there are some special steps/setup where it does not work - but I need to know how to get that situation. Thanks.
trying to create a reproduceable project, but the following procedure killed the X window. netbeans is still running. see the attached log (from .xsession-errors) how it comes: create New Project... -> Java Class Library -> name it TestBase -> ok create new Java Package under source -> name it gui -> ok create new Java Class... -> name it MyLabel -> ok in editor edit the class so it extends from JLabel and calls super("MyLabel"); Save all create New Project... -> Java Application -> name it TestApp -> ok create new JPanel Form... -> name it MyPanel -> ok -> panel in editor TestApp>Properties>Libraries>Add Project... -> select TestBase -> ok drag TestBase>Source>gui>MyLabel from Project into Design Editor -> Warning! -> ok compile File MyLabel (wrong, must compile MyPanel why?) drag TestBase>Source>gui>MyLabel from Project into Design Editor -> Warning! ---- crash XWindow gone, Jave still alive this is reproduceable in TestApp create a new Panel Form drag MyLabel into -> warning -> ok drag MyLabel into -> warning -> ok ---- crash Netbeans gone
Created attachment 136050 [details] crash log
For the drag and drop crash please file a different bug (on product 'platform'), it's a different problem. I've found how to reproduce the original problem - class not updated in .form file. It happens when the 'Generate Full Classnames' property of the form is turned off. You can turn it on again to workaround this problem (it is on by default and things are in general less prone to errors when fully qualified class names are generated in the code). To find the property, open the GUI form in design, in the navigator select the root node and see the properties window. In fact there is not an obvious way how to fix this class move bug. The refactoring in form files is invoked when changes in the generated (guarded) code are requested by java refactoring. Here no change in guarded code is needed, only the import statement is changed.
Similar thing happens when renaming a component from default package to a named package - the java refactoring will create an import and not change anything in guarded code (bug 189514).
*** Bug 189514 has been marked as a duplicate of this bug. ***