Author: scabanovich
Date: 2011-12-05 18:43:25 -0500 (Mon, 05 Dec 2011)
New Revision: 36974
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java
Log:
JBIDE-10162
https://issues.jboss.org/browse/JBIDE-10162
Search of position of attribute value by model object is improved.
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java 2011-12-05
23:03:28 UTC (rev 36973)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java 2011-12-05
23:43:25 UTC (rev 36974)
@@ -119,7 +119,10 @@
startPosition = startPosition + i2 + 1;
}
} else {
- xml = xml.substring(0, xml.indexOf('.'));
+ xml = xml.substring(0, xml.lastIndexOf('.')); //remove .#text
+ if(xml.indexOf('.') >= 0) {
+ xml = xml.substring(xml.lastIndexOf('.') + 1); // simplify - look for the
last name only
+ }
int e1 = text.indexOf("</" + getTagXMLName(object) + ">",
startPosition); //$NON-NLS-1$ //$NON-NLS-2$
String s = e1 < 0 ? "" : text.substring(startPosition, e1);
//$NON-NLS-1$
if(xml.length() == 0) {