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 231337 - Component class not updated in .form file when generating FQN is off
Summary: Component class not updated in .form file when generating FQN is off
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 189514 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-17 07:51 UTC by infonaut
Modified: 2014-01-13 10:25 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
crash log (98.43 KB, application/octet-stream)
2013-06-19 18:34 UTC, infonaut
Details

Note You need to log in before you can comment on or make changes to this bug.
Description infonaut 2013-06-17 07:51:09 UTC
[ 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
Comment 1 Tomas Pavek 2013-06-19 16:34:42 UTC
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.
Comment 2 infonaut 2013-06-19 18:33:10 UTC
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
Comment 3 infonaut 2013-06-19 18:34:13 UTC
Created attachment 136050 [details]
crash log
Comment 4 Tomas Pavek 2013-06-25 09:23:16 UTC
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.
Comment 5 Tomas Pavek 2014-01-13 10:25:33 UTC
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).
Comment 6 Tomas Pavek 2014-01-13 10:25:46 UTC
*** Bug 189514 has been marked as a duplicate of this bug. ***