Author: scabanovich
Date: 2007-07-24 06:26:43 -0400 (Tue, 24 Jul 2007)
New Revision: 2614
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
Log:
EXIN-217 null pointer fixed in SeamProperty
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2007-07-23
16:31:27 UTC (rev 2613)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2007-07-24
10:26:43 UTC (rev 2614)
@@ -27,7 +27,7 @@
public void setValue(ISeamValue value) {
this.value = value;
- adopt((SeamObject)value);
+ if(value != null) adopt((SeamObject)value);
}
public List<Change> merge(SeamObject s) {
@@ -40,11 +40,24 @@
name = d.name;
}
- List<Change> cs = ((SeamObject)value).merge((SeamObject)d.value);
- if(cs != null && cs.size() > 0) {
- Change c = new Change(this, "value", value, value);
- c.addChildren(cs);
- }
+ if(value == null) {
+ if(d.value != null) {
+ setValue(d.value);
+ changes = Change.addChange(changes, new Change(this, "value", null,
value));
+ }
+ } else if(d.value == null) {
+ if(value != null) {
+ changes = Change.addChange(changes, new Change(this, "value", value,
null));
+ }
+ value = null;
+ } else {
+ List<Change> cs = ((SeamObject)value).merge((SeamObject)d.value);
+ if(cs != null && cs.size() > 0) {
+ Change c = new Change(this, "value", value, value);
+ c.addChildren(cs);
+ changes = Change.addChange(changes, c);
+ }
+ }
return changes;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-23
16:31:27 UTC (rev 2613)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-24
10:26:43 UTC (rev 2614)
@@ -210,6 +210,7 @@
e.setValue(value);
vm.addEntry(e);
}
+ p.setValue(vm);
}
}
component.addProperty(p);
Show replies by date