activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r439346 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
Date Fri, 01 Sep 2006 15:06:13 GMT
Author: chirino
Date: Fri Sep  1 08:06:13 2006
New Revision: 439346

URL: http://svn.apache.org/viewvc?rev=439346&view=rev
Log:
Protect against NPE when toString() is called before object is fully initialized.
Spring seems to be doing this (part of of it's debug logging) with newer releases.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java?rev=439346&r1=439345&r2=439346&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
Fri Sep  1 08:06:13 2006
@@ -310,7 +310,10 @@
 
     public String getName(){
         if( name==null ){
-            name = getUri().toString();
+        	uri = getUri();
+        	if( uri != null ) {
+        		name = uri.toString();
+        	}
         }
         return name;
     }
@@ -319,7 +322,10 @@
     }
 
     public String toString() {
-        return getName();
+        String rc = getName();
+        if( rc == null )
+        	rc = super.toString();
+        return rc;
     }
 
 	public boolean isDisableAsyncDispatch() {



Mime
View raw message