You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/04/27 22:21:33 UTC

svn commit: r397628 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http: AbstractHTTPSender.java HttpTransportProperties.java

Author: dims
Date: Thu Apr 27 13:21:29 2006
New Revision: 397628

URL: http://svn.apache.org/viewcvs?rev=397628&view=rev
Log:
protect against NPE's - cleanup improper checks for null

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HttpTransportProperties.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?rev=397628&r1=397627&r2=397628&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Thu Apr 27 13:21:29 2006
@@ -142,10 +142,9 @@
                 proxyPort = proxyProperties.getProxyPort();
             }
 
-            if (!proxyProperties.getProxyHostName().equals("")
-                    || (proxyProperties.getProxyHostName() != null)) {
-                proxyHostName = proxyProperties.getProxyHostName();
-            } else {
+            proxyHostName = proxyProperties.getProxyHostName();
+            if (proxyHostName == null
+                    || proxyHostName.length() == 0) {
                 throw new AxisFault("Proxy Name is not valid");
             }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HttpTransportProperties.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HttpTransportProperties.java?rev=397628&r1=397627&r2=397628&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HttpTransportProperties.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HttpTransportProperties.java Thu Apr 27 13:21:29 2006
@@ -64,7 +64,7 @@
         }
 
         public String getDomain() {
-            if (domain.equals("") || (domain == null)) {
+            if (domain == null || domain.length() == 0) {
                 return "anonymous";
             } else {
                 return domain;
@@ -72,7 +72,7 @@
         }
 
         public String getPassWord() {
-            if (passWord.equals("") || (passWord == null)) {
+            if (passWord == null || passWord.length() == 0) {
                 return "anonymous";
             } else {
                 return passWord;
@@ -88,7 +88,7 @@
         }
 
         public String getUserName() {
-            if (userName.equals("") || (userName == null)) {
+            if (userName == null || userName.length() == 0) {
                 return "anonymous";
             } else {
                 return userName;