diff --git a/activemq-client/src/main/java/org/apache/activemq/util/IdGenerator.java b/activemq-client/src/main/java/org/apache/activemq/util/IdGenerator.java index 071a35e6a7..0b2941610b 100755 --- a/activemq-client/src/main/java/org/apache/activemq/util/IdGenerator.java +++ b/activemq-client/src/main/java/org/apache/activemq/util/IdGenerator.java @@ -59,7 +59,7 @@ public class IdGenerator { int idGeneratorPort = 0; ServerSocket ss = null; try { - if( hostName!=null ) { + if( hostName==null ) { hostName = InetAddressUtil.getLocalHostName(); } if( localPort==0 ) {