From 735b8dfe3725f0a94e3f139871a230f3e5bc9f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 10 Jun 2018 03:41:22 +0200 Subject: [PATCH] Use better name --- .../java/net/sourceforge/pmd/lang/ast/AbstractNode.java | 2 +- .../src/main/java/net/sourceforge/pmd/lang/ast/Node.java | 4 ++-- .../pmd/lang/ast/xpath/AttributeAxisIterator.java | 2 +- .../net/sourceforge/pmd/lang/ast/xpath/AttributeNode.java | 2 +- .../sourceforge/pmd/lang/ast/xpath/DocumentNavigator.java | 2 +- .../pmd/lang/ast/xpath/saxon/AttributeAxisIterator.java | 2 +- .../pmd/util/fxdesigner/NodeInfoPanelController.java | 2 +- .../net/sourceforge/pmd/lang/xml/ast/XmlNodeWrapper.java | 6 +++--- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractNode.java index f43c03ab64..fb0f0512d3 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractNode.java @@ -519,7 +519,7 @@ public abstract class AbstractNode implements Node { @Override - public Iterator getXPathAttributes() { + public Iterator getXPathAttributesIterator() { return new AttributeAxisIterator(this); } } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/Node.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/Node.java index a905195701..f91b4f03a6 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/Node.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/Node.java @@ -327,9 +327,9 @@ public interface Node { /** - * Returns an iterator containing all the attributes that are available + * Returns an iterator enumerating all the attributes that are available * from XPath for this node. */ - Iterator getXPathAttributes(); + Iterator getXPathAttributesIterator(); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeAxisIterator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeAxisIterator.java index 11a69142b1..2a93c13ba5 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeAxisIterator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeAxisIterator.java @@ -44,7 +44,7 @@ public class AttributeAxisIterator implements Iterator { /** * Creates a new iterator that enumerates the attributes of the given node. * Note: if you want to access the attributes of a node, don't use this directly, - * use instead the overridable {@link Node#getXPathAttributes()}. + * use instead the overridable {@link Node#getXPathAttributesIterator()}. */ public AttributeAxisIterator(Node contextNode) { this.node = contextNode; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeNode.java index b08b8e579f..6fead63886 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeNode.java @@ -12,7 +12,7 @@ import java.util.Iterator; * access to it's attributes, versus having them be determined via * introspection. * - * @deprecated See {@link net.sourceforge.pmd.lang.ast.Node#getXPathAttributes()}. + * @deprecated See {@link net.sourceforge.pmd.lang.ast.Node#getXPathAttributesIterator()}. * Will be removed in 7.0.0 */ @Deprecated diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/DocumentNavigator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/DocumentNavigator.java index 4369e33606..9fcdcf2163 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/DocumentNavigator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/DocumentNavigator.java @@ -135,7 +135,7 @@ public class DocumentNavigator extends DefaultNavigator { @Override public Iterator getAttributeAxisIterator(Object arg0) { - return ((Node) arg0).getXPathAttributes(); + return ((Node) arg0).getXPathAttributesIterator(); } /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/saxon/AttributeAxisIterator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/saxon/AttributeAxisIterator.java index db767a8bd3..ada6ed8a78 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/saxon/AttributeAxisIterator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/saxon/AttributeAxisIterator.java @@ -27,7 +27,7 @@ public class AttributeAxisIterator extends Navigator.BaseEnumeration { */ public AttributeAxisIterator(ElementNode startNodeInfo) { this.startNodeInfo = startNodeInfo; - this.iterator = startNodeInfo.node.getXPathAttributes(); + this.iterator = startNodeInfo.node.getXPathAttributesIterator(); } @Override diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/NodeInfoPanelController.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/NodeInfoPanelController.java index f939675032..2acbff2c9a 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/NodeInfoPanelController.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/NodeInfoPanelController.java @@ -138,7 +138,7 @@ public class NodeInfoPanelController implements Initializable { */ private static ObservableList getAttributes(Node node) { ObservableList result = FXCollections.observableArrayList(); - Iterator attributeAxisIterator = node.getXPathAttributes(); + Iterator attributeAxisIterator = node.getXPathAttributesIterator(); while (attributeAxisIterator.hasNext()) { Attribute attribute = attributeAxisIterator.next(); // TODO the display should be handled in a ListCell diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/ast/XmlNodeWrapper.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/ast/XmlNodeWrapper.java index d3436300af..bf9c1cad6e 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/ast/XmlNodeWrapper.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/ast/XmlNodeWrapper.java @@ -204,7 +204,7 @@ public class XmlNodeWrapper extends AbstractDomNodeProxy implements XmlNode { @Override - public Iterator getXPathAttributes() { + public Iterator getXPathAttributesIterator() { List> iterators = new ArrayList<>(); // Expose DOM Attributes @@ -250,12 +250,12 @@ public class XmlNodeWrapper extends AbstractDomNodeProxy implements XmlNode { /** - * @deprecated use {@link #getXPathAttributes()} + * @deprecated use {@link #getXPathAttributesIterator()} */ @Override @Deprecated public Iterator getAttributeIterator() { - return getXPathAttributes(); + return getXPathAttributesIterator(); }