Author: scabanovich
Date: 2007-07-20 04:32:48 -0400 (Fri, 20 Jul 2007)
New Revision: 2535
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
Log:
EXIN-217 XMLScanner: loading of properties improved
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2007-07-20
07:21:21 UTC (rev 2534)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2007-07-20
08:32:48 UTC (rev 2535)
@@ -65,8 +65,13 @@
changes = Change.addChange(changes, new Change(this, null, p1, null));
properties.remove(names[i]);
} else {
+ String oldName = p1.getName();
List<Change> cc = p1.merge(p2);
if(cc != null && cc.size() > 0) children.addChildren(cc);
+ if(oldName != null && !oldName.equals(p1.getName())) {
+ properties.remove(oldName);
+ addProperty(p1);
+ }
}
}
names = pd.properties.keySet().toArray(new String[0]);
@@ -75,10 +80,9 @@
SeamProperty p2 = (SeamProperty)pd.properties.get(names[i]);
if(p1 == null) {
changes = Change.addChange(changes, new Change(this, null, null, p2));
- properties.put(names[i], p2);
+ addProperty(p2);
}
}
- properties = pd.properties;
changes = Change.addChange(changes, children);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java 2007-07-20
07:21:21 UTC (rev 2534)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java 2007-07-20
08:32:48 UTC (rev 2535)
@@ -21,6 +21,7 @@
*/
public class SeamValueString extends SeamObject implements ISeamValueString {
IValueInfo value;
+ String currentValue;
public SeamValueString() {}
@@ -30,18 +31,18 @@
public void setValue(IValueInfo value) {
this.value = value;
+ if(value != null) currentValue = value.getValue();
}
public List<Change> merge(SeamObject s) {
List<Change> changes = super.merge(s);
SeamValueString v = (SeamValueString)s;
- String v1 = value.getValue();
+ String v1 = currentValue;
String v2 = v.value.getValue();
if(v1 == null || !v1.equals(v2)) {
changes = Change.addChange(changes, new Change(this, "value", v1, v2));
- value = v.value;
- adopt((SeamObject)value);
- }
+ }
+ setValue(v.value);
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-20
07:21:21 UTC (rev 2534)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-20
08:32:48 UTC (rev 2535)
@@ -211,8 +211,8 @@
vm.addEntry(e);
}
}
- component.addProperty(p);
}
+ component.addProperty(p);
}
ds.getComponents().add(component);
Show replies by date