You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by be...@apache.org on 2013/06/07 18:14:49 UTC

git commit: easy code readability by using static imports

Updated Branches:
  refs/heads/master 498b51bc1 -> 7b43aa87a


easy code readability by using static imports


Project: http://git-wip-us.apache.org/repos/asf/mina-vysper/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-vysper/commit/7b43aa87
Tree: http://git-wip-us.apache.org/repos/asf/mina-vysper/tree/7b43aa87
Diff: http://git-wip-us.apache.org/repos/asf/mina-vysper/diff/7b43aa87

Branch: refs/heads/master
Commit: 7b43aa87a80f39602f34b1ff4a67567b79644435
Parents: 498b51b
Author: Bernd Fondermann <be...@brainlounge.de>
Authored: Fri Jun 7 18:12:20 2013 +0200
Committer: Bernd Fondermann <be...@brainlounge.de>
Committed: Fri Jun 7 18:12:20 2013 +0200

----------------------------------------------------------------------
 .../vysper/xml/fragment/XMLElementVerifier.java    |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-vysper/blob/7b43aa87/nbxml/src/main/java/org/apache/vysper/xml/fragment/XMLElementVerifier.java
----------------------------------------------------------------------
diff --git a/nbxml/src/main/java/org/apache/vysper/xml/fragment/XMLElementVerifier.java b/nbxml/src/main/java/org/apache/vysper/xml/fragment/XMLElementVerifier.java
index 3f25725..35c22b7 100644
--- a/nbxml/src/main/java/org/apache/vysper/xml/fragment/XMLElementVerifier.java
+++ b/nbxml/src/main/java/org/apache/vysper/xml/fragment/XMLElementVerifier.java
@@ -23,6 +23,9 @@ package org.apache.vysper.xml.fragment;
 import java.util.Collection;
 import java.util.List;
 
+import static org.apache.vysper.xml.fragment.Namespaces.XMLNS;
+import static org.apache.vysper.xml.fragment.Namespaces.XMLNS_AND_COLON;
+
 /**
  * provides common tools to check a element against its specification or
  * semantical context this classes instances are immutual.
@@ -143,7 +146,7 @@ public class XMLElementVerifier {
         }
 
         for (Attribute attribute : element.getAttributes()) {
-            if (attribute.getName().startsWith("xmlns") && attribute.getValue().equals(namespaceURI)) {
+            if (attribute.getName().startsWith(XMLNS) && attribute.getValue().equals(namespaceURI)) {
                 return true;
             }
         }
@@ -162,16 +165,15 @@ public class XMLElementVerifier {
      */
     public String getNamespaceIdentifier(String namespace) {
         for (Attribute attribute : element.getAttributes()) {
-            if (attribute.getValue().equals(namespace) && attribute.getName().startsWith(Namespaces.XMLNS_AND_COLON)) {
-                return attribute.getName().substring(Namespaces.XMLNS_AND_COLON.length());
+            if (attribute.getValue().equals(namespace) && attribute.getName().startsWith(XMLNS_AND_COLON)) {
+                return attribute.getName().substring(XMLNS_AND_COLON.length());
             }
         }
         return null;
     }
 
     private boolean isNamespaceAttribute(Attribute attribute) {
-        return (attribute.getName().equalsIgnoreCase(Namespaces.XMLNS) || attribute.getName().startsWith(
-                Namespaces.XMLNS_AND_COLON));
+        return (attribute.getName().equalsIgnoreCase(XMLNS) || attribute.getName().startsWith(XMLNS_AND_COLON));
     }
 
     public String getUniqueXMLNSValue() {