ws-woden-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkapu...@apache.org
Subject svn commit: r326269 - /incubator/woden/java/src/javax/xml/namespace/QName.java
Date Tue, 18 Oct 2005 22:04:22 GMT
Author: jkaputin
Date: Tue Oct 18 15:04:17 2005
New Revision: 326269

URL: http://svn.apache.org/viewcvs?rev=326269&view=rev
Log:
Refactored the QName constructors.

Modified:
    incubator/woden/java/src/javax/xml/namespace/QName.java

Modified: incubator/woden/java/src/javax/xml/namespace/QName.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/javax/xml/namespace/QName.java?rev=326269&r1=326268&r2=326269&view=diff
==============================================================================
--- incubator/woden/java/src/javax/xml/namespace/QName.java (original)
+++ incubator/woden/java/src/javax/xml/namespace/QName.java Tue Oct 18 15:04:17 2005
@@ -83,16 +83,7 @@
    */
   public QName(String localPart)
   {
-    this.namespaceURI = emptyString;
-    if(localPart != null)
-    {
-        this.localPart = localPart.intern();
-    }
-    else
-    {
-        throw new IllegalArgumentException("localpart is null.");
-    }
-    this.prefix       = emptyString;
+      this(emptyString, localPart, emptyString);
   }
 
   /**
@@ -108,18 +99,9 @@
    */
   public QName(String namespaceURI, String localPart)
   {
-    this.namespaceURI = (namespaceURI == null)
-                        ? emptyString
-                        : namespaceURI.intern();
-    if(localPart != null)
-    {
-        this.localPart = localPart.intern();
-    }
-    else
-    {
-        throw new IllegalArgumentException("localpart is null.");
-    }
-    this.prefix       = emptyString;
+      this(namespaceURI == null ? emptyString : namespaceURI,
+           localPart,
+           emptyString);
   }
 
   /**
@@ -145,7 +127,7 @@
     }
     else
     {
-        throw new IllegalArgumentException("localpart is null.");
+        throw new IllegalArgumentException("localpart cannot be null.");
     }
     if(prefix != null)
     {
@@ -153,7 +135,7 @@
     }
     else
     {
-        throw new IllegalArgumentException("prefix is null.");
+        throw new IllegalArgumentException("prefix cannot be null.");
     }
   }
   



---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org


Mime
View raw message