mirror of https://github.com/apache/activemq.git
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. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@439346 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2b51c3357e
commit
e16114f99b
|
@ -310,7 +310,10 @@ public class TransportConnector implements Connector {
|
|||
|
||||
public String getName(){
|
||||
if( name==null ){
|
||||
name = getUri().toString();
|
||||
uri = getUri();
|
||||
if( uri != null ) {
|
||||
name = uri.toString();
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
@ -319,7 +322,10 @@ public class TransportConnector implements Connector {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return getName();
|
||||
String rc = getName();
|
||||
if( rc == null )
|
||||
rc = super.toString();
|
||||
return rc;
|
||||
}
|
||||
|
||||
public boolean isDisableAsyncDispatch() {
|
||||
|
|
Loading…
Reference in New Issue