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 102215 - sun-ejb-jar.xml editor's "Edit As XML" button asks if I want to save changes every time I click it, even when there are no changes
Summary: sun-ejb-jar.xml editor's "Edit As XML" button asks if I want to save changes ...
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
: 99022 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-23 18:26 UTC by rdelaplante
Modified: 2007-08-27 19:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sun-web.xml that tells me there are changes when clicking "Edit As XML", when there are no changes (719 bytes, text/xml)
2007-04-23 21:28 UTC, rdelaplante
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rdelaplante 2007-04-23 18:26:13 UTC
I double click the sun-ejb-jar.xml file in my projects tree and the window
opens.  I click the "Edit As XML" button, it tells me the file has been modified
and asks me if I want to Save, Discard or Cancel.

This is kind of funny because in NetBeans 5.5 I found this same problem in
sun-web.xml editor, but not in sun-ejb-jar.xml.  Now that I have upgraded to
5.5.1 RC1, I see the problem has been fixed in sun-web.xml, but is now in
sun-ejb-jar.xml.
Comment 1 rdelaplante 2007-04-23 21:26:44 UTC
Nope I was wrong, sun-web.xml also tells me there are changes when I click "Edit
As XML" after opening the file.   There are no changes.  I'll attach my
sun-web.xml from my Visual Web Pack project
Comment 2 rdelaplante 2007-04-23 21:28:09 UTC
Created attachment 41500 [details]
sun-web.xml that tells me there are changes when clicking "Edit As XML", when there are no changes
Comment 3 rdelaplante 2007-05-17 15:25:59 UTC
Could this issue pleased be fixed for the 5.5.1 release?  This was not an issue
in 5.5.0, and seems like it would be an easy fix.  Thanks
Comment 4 rdelaplante 2007-05-22 18:53:43 UTC
I think the release is in a couple days.  I'm not sure what other priorities you
have.. this is probably a simple regression to fix and it would be nice if it
was done for the 5.5.1 release.  Thank you.
Comment 5 Nitya Doraisamy 2007-05-30 16:36:42 UTC
Peter
Looks like I dropped the ball on this one. I didn't notice this issue all this time.

rdelaplante,
My fault. Ihe issue landed on my plate and I hadn't seen it. Sorry.
Comment 6 _ pcw 2007-05-30 19:36:22 UTC
Submitter: If you save the file, does it save out the same contents you had before?

There was another issue filed about this behavior (same submitter) IIRC.  I
could not reproduce it.  I suspect it's interaction with VWP of some sort.  I
will investigate a little.  Thanks for attaching sun-web.xml, but what would be
helpful would be a ZIP file containing an entire project that reproduces this,
or instructions on how to make one.

Nitya: No worries, even in late April 5.5.1 was already frozen (for core modules
like ours at least).
Comment 7 _ pcw 2007-05-30 20:06:55 UTC
Ok, I can reproduce this bug.  Here's what I found.

1) You must have the separate properties window visible (this is the default
when Visual Web Pack is installed, but you can select Window | Properties to get
reproduce this in vanilla NetBeans).

2) Saving the file does not appear to change the contents (e.g. it writes out
the same data that was read in.)  Arguably, there could be an edge case here,
but I don't know of any.

3) Once the file has been saved, for that session, this bug will not reappear. 
But it will come back if the IDE is restarted.

The properties view has detected the DConfigBeans (aka enhanced javabeans)
backing our editor and is displaying them, even though they were not intended to
be displayed this way and are not tested as such.  Very likely there is a set
method being called that should have been ignored or some such nonsense.

I did a revamp of all our BeanInfo structures for 5.5.1 to deal with another
issue, but that patch was late and rejected by QA as too large (a targeted fix
for the NPE that led me to do the sweep in the first place was accepted though).

Conclusions:

1. Workaround - close the property view panel before opening sun-???.xml.
2. Affects 5.5.x only.  Won't affect 6.0 onward due to switch to multiview UI.
3. The best fix is probably the revamp of the BeanInfo's that eliminated
visibility of most of the properties (except for some of the readonly ones). 
Could be hotfixed later, no resources to do this now.
Comment 8 _ pcw 2007-05-30 20:28:13 UTC
Additional info - the properties view is changing string properties from null to "".

For sun-web.xml, the property being changed is the attribute "extra-class-path"
in the entry "/sun-web-app/class-loader".  You can bypass bug by adding the the
attribute 'extra-classpath=""' to the class-loader element.  However, if you
edit this file in gui mode such a field will be removed on save, as it is
optional and the bug will come back.  I would not recommend using a non-empty
dummy value in for this field as that could cause issues at deploy/runtime.

For sun-ejb-jar.xml, the property being changed is "name" (element under
/sun-ejb-jar/enterprise-beans), so you can set a non-null value for the name
field and avoid this issue for this file altogether.
Comment 9 _ pcw 2007-05-30 20:32:58 UTC
This issue also affects sun-application.xml (changing the content of
"pass-by-reference" from null to "").

It does not affect sun-application-client.xml.
Comment 10 _ pcw 2007-05-30 20:35:17 UTC
*** Issue 99022 has been marked as a duplicate of this issue. ***
Comment 11 _ pcw 2007-08-27 19:49:01 UTC
Fixed by new editor design - no more java beans for the property editor to stumble upon and no more Edit As XML button
either, since multiview provides simultaneous access to XML and GUI.