Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilos Kleint2010-12-20 08:36:55 +0000
committerMilos Kleint2010-12-20 08:36:55 +0000
commit6714b91b4bdc33e9682974ecaf66301bb594ad50 (patch)
treecbcb417c3103bf8a94731dd9095c77271e56c972
parente0c663332fcbfcece1328bf473aba21fecc004b5 (diff)
downloadm2e-core-6714b91b4bdc33e9682974ecaf66301bb594ad50.tar.gz
m2e-core-6714b91b4bdc33e9682974ecaf66301bb594ad50.tar.xz
m2e-core-6714b91b4bdc33e9682974ecaf66301bb594ad50.zip
MECLIPSE-1979 replace local code with a combination of utility methods that might prevent the issue. the text value is now retrieved in a dfferent way
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java
index c878bfdc..ec806a04 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java
@@ -11,6 +11,7 @@
package org.eclipse.m2e.editor.xml;
+import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -22,6 +23,8 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
+import org.eclipse.m2e.editor.xml.internal.XmlUtils;
+
/**
* @author Eugene Kuleshov
@@ -323,21 +326,7 @@ public class PomContentOutlineConfiguration extends XMLContentOutlineConfigurati
}
private String getValue(Node node, String name) {
- NodeList childNodes = node.getChildNodes();
- for(int i = 0; i < childNodes.getLength(); i++ ) {
- Node item = childNodes.item(i);
- if(item.getNodeType()==Node.ELEMENT_NODE && name.equals(item.getNodeName())) {
- NodeList nodes = item.getChildNodes();
- if(nodes.getLength()==1) {
- String value = nodes.item(0).getNodeValue().trim();
- if(value.length()>0) {
- return value;
- }
- }
- return null;
- }
- }
- return null;
+ return XmlUtils.getElementTextValue(XmlUtils.findChildElement((Element)node, name));
}
private String cleanText(Node node) {

Back to the top