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 86941 - REGRESSION: Schema is treated as not well-formed after Apply Design Pattern->Close/Discard changes->reopen
Summary: REGRESSION: Schema is treated as not well-formed after Apply Design Pattern->...
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-11 15:02 UTC by Andrei Chistiakov
Modified: 2006-10-17 11:33 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
fix (3.49 KB, application/octet-stream)
2006-10-14 00:59 UTC, Nam Nguyen
Details
an improved fix (4.36 KB, patch)
2006-10-16 17:57 UTC, Nam Nguyen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Chistiakov 2006-10-11 15:02:45 UTC
Reproduced in build 061010 (jdk 1.6 beta 2).

This is a regression since build 060927_5 (milestone 21).

To reproduce the bug:

- create a new java app project;
- add and open Purchase Order schema;
- apply Venetian Blind design pattern to the schema (create single global
element + create type(s));
- close the schema's editor window/discard changes;
- reopen the schema.
<The schema is not well-formed...> message displays in the editor.

Workaround: restart IDE.
Comment 1 Samaresh Panda 2006-10-11 18:20:02 UTC
After discard changes, the schema model's state becomes NOT_WELL_FORMED. I'm not
sure why. Need to investigate further.
Comment 2 Samaresh Panda 2006-10-12 19:00:46 UTC
On discard changes I get the following exception:
java.lang.AssertionError
        at org.netbeans.modules.xml.xdm.diff.MergeDiff.processAddOrReorder(Merge
Diff.java:208)
        at org.netbeans.modules.xml.xdm.diff.MergeDiff.applyChildrenDiffs(MergeD
iff.java:131)
        at org.netbeans.modules.xml.xdm.diff.MergeDiff.merge(MergeDiff.java:85)
        at org.netbeans.modules.xml.xdm.diff.XDMTreeDiff.mergeDiff(XDMTreeDiff.j
ava:65)
        at org.netbeans.modules.xml.xdm.XDMModel.finishSync(XDMModel.java:204)
        at org.netbeans.modules.xml.xdm.XDMModel.sync(XDMModel.java:146)
        at org.netbeans.modules.xml.xdm.xam.XDMAccess.sync(XDMAccess.java:121)
        at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:23
0)
        at org.netbeans.modules.xml.axi.impl.AXIModelImpl.sync(AXIModelImpl.java
:163)
        at org.netbeans.modules.xml.xam.AbstractModel$1.run(AbstractModel.java:5
36)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
[catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 3 Ayub Khan 2006-10-12 20:02:01 UTC
assigning to nam
Comment 4 Nam Nguyen 2006-10-14 00:58:16 UTC
The xdm assert error is a separated issue 87153.
We fix this current issue by rework the fix for issue 86942 so that schema model
is not sync on discard.  

On the other hand, since the assertion error is replaced by an
IllegalArgumentException which is handled by auto-sync or UI, we just need to
detect if schema model is not well-formed state, then we force reload the
document which would trigger reset of the schema root and also refresh the axi
model.

Fixed is checked in relesae55_dev, and diffs is attached.
Comment 5 Nam Nguyen 2006-10-14 00:59:44 UTC
Created attachment 35203 [details]
fix
Comment 6 Nam Nguyen 2006-10-14 01:04:15 UTC
Note that the verification of this issue needs to be done with assertion turned
OFF as followed.  Edit NB55/etc/netbeans.conf so that the property
netbeans_default_options will have value include '-J-da' instead of '-J-ea'. 
This is the configuration of production build that we will ship.
Comment 7 Chris Webster 2006-10-14 02:35:57 UTC
The diffs look good. 
Comment 8 Nam Nguyen 2006-10-16 17:57:29 UTC
Created attachment 35241 [details]
an improved fix
Comment 9 Nam Nguyen 2006-10-16 17:58:33 UTC
Fix committed to release55.
Comment 10 Andrei Chistiakov 2006-10-17 11:33:25 UTC
Verified in build 061016_1.