[jboss-cvs] jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model ...
Robert Stryker
rawblem at gmail.com
Tue Aug 8 10:22:16 EDT 2006
User: rawb
Date: 06/08/08 10:22:16
Modified: as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model
DescriptorModel.java
Log:
Fixed bug: added to the preview list was any element that matched the xpath (even if it did not have the attribute).
Revision Changes Path
1.6 +18 -3 jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/DescriptorModel.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DescriptorModel.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/DescriptorModel.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- DescriptorModel.java 31 Jul 2006 19:43:45 -0000 1.5
+++ DescriptorModel.java 8 Aug 2006 14:22:16 -0000 1.6
@@ -260,13 +260,24 @@
if( tmp.size() > 0 ) {
if( attributeName == null || attributeName.equals("")) {
newItem = new XPathTreeItem(null, new File(p), tmp);
+ list.add(newItem);
} else {
- newItem = new XPathTreeItem(null, new File(p), tmp, attributeName);
+ // Remove any that match the path but not the attribute
+ Iterator j = tmp.iterator();
+ while( j.hasNext()) {
+ DefaultElement el = (DefaultElement)j.next();
+ if( el.attribute(attributeName) == null ) {
+ j.remove();
}
+ }
+ if( tmp.size() > 0 ) {
+ newItem = new XPathTreeItem(null, new File(p), tmp, attributeName);
list.add(newItem);
}
}
}
+ }
+ }
return (XPathTreeItem[]) list.toArray(new XPathTreeItem[list.size()]);
}
@@ -360,6 +371,7 @@
}
public String getText() {
+ try {
if( getData() instanceof DefaultElement ) {
if( !hasAttribute()) {
return ((DefaultElement)getData()).getText();
@@ -368,6 +380,9 @@
return att.getValue();
}
}
+ } catch( NullPointerException npe ) {
+ npe.printStackTrace();
+ }
return "";
}
More information about the jboss-cvs-commits
mailing list