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 72867 - .Form/.java out of sync, some changes lost
Summary: .Form/.java out of sync, some changes lost
Status: RESOLVED DUPLICATE of bug 77092
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-21 07:27 UTC by xxiii
Modified: 2006-08-24 15:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (48.37 KB, text/plain)
2006-02-21 07:29 UTC, xxiii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xxiii 2006-02-21 07:27:08 UTC
Not sure when/what happened, The attached messages.log contains what appear to
be the relevant exceptions. I have a JPanel, which actually derives from another
locally developed class, which itself derives from JPanel. I was experiencing
some null pointer exceptions when interacting with this panel, and upon
investigation, I discovered that the form had many duplicate variables.

I had renamed most of the variables, from things like jTextField1 to
idTextField, and so forth, but in the guarded code blocks both were still
present. The "new" variables (idTextField) were not used at all in the
initComponents section, while jTextField1, which had apparently taken its place
was. I opened the .form file outside of the ide in a text editor to discover
that none of my variable renames were present. It appears that at some point,
the renames were applied in the .java file, but not in the .form file, then
later somehow the .java file ended up with both sets of variables, and
initComponents only using the .form version of the names. (Also, none of the
renamed versions of the variables showed up in the Inspector).

I then experimentally tried renaming (in the gui form editor) one of the
variables (jTextField1 to idTextField) to see what would happen, and the .java
file then snapped into sync with the .form, and all the previously renamed
variables vanished. Things appear to be fine now, other than I had to go and
re-rename my variables. No code outside of the guarded blocks was touched.

(I was getting the null pointer exceptions because my code was referring to the
idTextField, while the form/initComponents was referring to the jTextField1.
Upon getting them back in sync, I just ended up with a bunch of unresolved
variable references, which were fixed when I renamed all my fields back to what
they were supposed to be).

Some of my forms contain other forms from the same project, and the form editor
does not seem to be happy if you happen to load one of these when its dependent
form .class files no longer exist (because I had done a clean). I am wondering
if it is one of these times when they got out of sync somehow, although the form
described above does not actually rely on any embedded forms (though it does
rely on intermediate classes, which as the exceptions note, didn't always exist
in compiled form).

In this case, I have:
class xxxPanel extends basePanel<otherClass>
public abstract class xxxPanel<T extends someBaseInterface> extends JPanel
Comment 1 xxiii 2006-02-21 07:29:54 UTC
Created attachment 28961 [details]
messages.log
Comment 2 Jan Stola 2006-08-24 15:36:20 UTC
Seems to be a duplicate of issue 77092

*** This issue has been marked as a duplicate of 77092 ***