< prev index next >

src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad

@@ -217,11 +217,11 @@
                 throw new XMLStreamException("Namespace URI "+namespaceURI +
                         "is not bound to any prefix" );
             }
 
             String qualifiedName = null;
-            if(prefix.equals("")){
+            if(prefix.isEmpty()){
                 qualifiedName = localName;
             }else{
                 qualifiedName = getQName(prefix,localName);
             }
             Attr attr = ownerDoc.createAttributeNS(namespaceURI, qualifiedName);

@@ -252,11 +252,11 @@
             }
             if(prefix == null){
                 throw new XMLStreamException("prefix cannot be null");
             }
             String qualifiedName = null;
-            if(prefix.equals("")){
+            if(prefix.isEmpty()){
                 qualifiedName = localName;
             }else{
 
                 qualifiedName = getQName(prefix,localName);
             }

@@ -500,11 +500,11 @@
             throw new XMLStreamException("NamespaceURI cannot be null");
         }
 
         String qname = null;
 
-        if (prefix.equals("")) {
+        if (prefix.isEmpty()) {
             qname = XMLConstants.XMLNS_ATTRIBUTE;
         } else {
             qname = getQName(XMLConstants.XMLNS_ATTRIBUTE,prefix);
         }
 

@@ -667,11 +667,11 @@
             }
             if(prefix == null){
                 throw new XMLStreamException("Prefix cannot be null");
             }
 
-            if(prefix.equals("")){
+            if(prefix.isEmpty()){
                 qname = localName;
             }else{
                 qname = getQName(prefix,localName);
             }
 
< prev index next >