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 95730 - Unrequested corruptive change of source code
Summary: Unrequested corruptive change of source code
Status: RESOLVED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-15 18:18 UTC by Marian Petras
Modified: 2007-02-16 10:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
diff of the .form file (5.43 KB, patch)
2007-02-15 18:20 UTC, Marian Petras
Details | Diff
diff of the .java file (6.41 KB, patch)
2007-02-15 18:21 UTC, Marian Petras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2007-02-15 18:18:08 UTC
I am fixing bug #86198 ("Mnemonics handling issue") by replace calls

     button.setText(... bundle.getString(...))
     button.setMnemonic(... bundle.getString(...).charAt(0))

with

     org.openide.awt.Mnemonics.setText(button, bundle.getString(...))

I do these changes mostly in the form editor by changing the appropriate values
in property sheets.

Everything worked fine until I started fixing the above issues in class
BundleNodeCustomer (in module "Resource Bundles" aka "Properties"). In the
middle of the work, I reviewed changes made in the .form file - they seemed OK -
and also in the .java file - they seemed almost OK with one surprising
exception. The exception is that part of code in the guarded block changed in a
way that seems to have no reason. There is no corresponding change in the .form
file and I have not modified anything related to that part of the code in the
form editor.

I am attaching diffs of the two files (.form, .java).
Comment 1 Marian Petras 2007-02-15 18:20:45 UTC
Created attachment 38570 [details]
diff of the .form file
Comment 2 Marian Petras 2007-02-15 18:21:20 UTC
Created attachment 38571 [details]
diff of the .java file
Comment 3 Marian Petras 2007-02-15 18:26:24 UTC
Look at lines 61-62 of the diff of the .java files:

-    label.setText(NbBundle.getBundle(...).getString("LAB_defaultLanguage"))
+    label.setText(NbBundle.getBundle(...).getString("LAB_DefaultBundle_Label"))

The modified line is inside the guarded block and there is no apparent reason
for such change. The original key ("LAB_defaultLanguage") is a valid key in the
used resource bundle. The modified key ("LAB_DefaultBundle_Label") is not
present in the used resource bundle so this unrequested change effectively
breaks functionality of the class.
Comment 4 Marian Petras 2007-02-16 10:55:00 UTC
The mystery is explained. The wrong resource bundle key has been in the .form
file, just the .java file was not in sync with the .form file (the critical part
had been modified from outside of the form-editor). When I made some changes to
the form in the form-dialog, guarded blocks of the .java file were regenerated,
thus propagating the wrong resource bundle key to the .java file.

Marking as INVALID.