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 83567 - NPE on reopening OTA schema after applying design pattern
Summary: NPE on reopening OTA schema after applying design pattern
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: XDM (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords:
: 83570 83599 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-28 10:32 UTC by Andrei Chistiakov
Modified: 2006-09-01 10:59 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Chistiakov 2006-08-28 10:32:01 UTC
Reproduced in build 060827 (JDK 1.6 beta 2).

To reproduce the bug:
- open a single file OTA schema;
- apply Russian Doll design pattern to it;
- close the schema/discard changes;
- immediately after closing reopen the schema.
java.lang.NullPointerException
	at org.netbeans.modules.xml.xdm.diff.MergeDiff.merge(MergeDiff.java:71)
	at org.netbeans.modules.xml.xdm.diff.XDMTreeDiff.mergeDiff(XDMTreeDiff.java:69)
	at org.netbeans.modules.xml.xdm.XDMModel.finishSync(XDMModel.java:185)
	at org.netbeans.modules.xml.xdm.XDMModel.sync(XDMModel.java:127)
	at org.netbeans.modules.xml.xdm.xam.XDMAccess.sync(XDMAccess.java:121)
...
Comment 1 Ayub Khan 2006-08-28 19:59:52 UTC
*** Issue 83599 has been marked as a duplicate of this issue. ***
Comment 2 Ayub Khan 2006-08-28 20:57:25 UTC
*** Issue 83579 has been marked as a duplicate of this issue. ***
Comment 3 Ayub Khan 2006-08-28 20:57:54 UTC
*** Issue 83570 has been marked as a duplicate of this issue. ***
Comment 4 Ayub Khan 2006-08-29 07:21:20 UTC
Nam, please take a look at this issue.
Comment 5 Nam Nguyen 2006-08-31 02:19:43 UTC
The issue is in the order of applying diffs and the fact that we do position
changes by delete and add a clone complicate the updating of the changed nodes
for next diff application.  Fix by changing the applying order and implement
reorder mutation:


/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/diff/MergeDiff.java,v  <-- 
MergeDiff.java
new revision: 1.2.2.12; previous revision: 1.2.2.11
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/diff/DiffFinder.java,v  <-- 
DiffFinder.java
new revision: 1.2.2.16; previous revision: 1.2.2.15
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/diff/Attic/Change.java,v  <-- 
Change.java
new revision: 1.1.2.7; previous revision: 1.1.2.6
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/diff/Attic/Difference.java,v  <--
 Difference.java
new revision: 1.1.2.6; previous revision: 1.1.2.5
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/diff/Attic/Add.java,v  <--  Add.java
new revision: 1.1.2.7; previous revision: 1.1.2.6
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/diff/Attic/NodeInfo.java,v  <-- 
NodeInfo.java
new revision: 1.1.2.7; previous revision: 1.1.2.6
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/diff/Attic/Delete.java,v  <-- 
Delete.java
new revision: 1.1.2.7; previous revision: 1.1.2.6
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/nodes/NodeImpl.java,v  <-- 
NodeImpl.java
new revision: 1.2.2.17; previous revision: 1.2.2.16
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/nodes/Element.java,v  <-- 
Element.java
new revision: 1.2.2.11; previous revision: 1.2.2.10
/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/XDMModel.java,v  <--  XDMModel.java


Comment 6 Andrei Chistiakov 2006-09-01 10:59:38 UTC
Verified in build 060831_2.