Author: pferraro
Date: 2008-09-11 13:17:38 -0400 (Thu, 11 Sep 2008)
New Revision: 1808
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java
Log:
Fixed potential NullPointerException in establishJvmRouteAndConnectorAddress(...)
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java 2008-09-11 17:15:48
UTC (rev 1807)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java 2008-09-11 17:17:38
UTC (rev 1808)
@@ -105,8 +105,7 @@
public static void establishJvmRouteAndConnectorAddress(Engine engine, MCMPHandler
mcmpHandler) throws IOException
{
Connector connector = findProxyConnector(engine.getService().findConnectors());
- InetAddress localAddress = (InetAddress) IntrospectionUtils
- .getProperty(connector.getProtocolHandler(), "address");
+ InetAddress localAddress = (InetAddress)
IntrospectionUtils.getProperty(connector.getProtocolHandler(), "address");
if ((engine.getJvmRoute() == null || localAddress == null) &&
!mcmpHandler.getProxyStates().isEmpty())
{
// Automagical JVM route (address + port + engineName)
@@ -115,7 +114,7 @@
localAddress = mcmpHandler.getLocalAddress();
String hostAddress = (localAddress != null) ? localAddress.getHostAddress() :
"127.0.0.1";
IntrospectionUtils.setProperty(connector.getProtocolHandler(),
"address", hostAddress);
- log.info(sm.getString("modcluster.util.address",
localAddress.getHostAddress()));
+ log.info(sm.getString("modcluster.util.address", hostAddress));
}
if (engine.getJvmRoute() == null)
{
Show replies by date