From 9245b29fe0419dc17c880cdea33d4ee348d68721 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 25 Aug 2014 19:52:23 +0200 Subject: [PATCH] Fix quality flaw --- .../src/main/java/org/sonar/process/ProcessWrapper.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java b/server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java index 09f422ba09b..12832151900 100644 --- a/server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java +++ b/server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java @@ -251,7 +251,7 @@ public class ProcessWrapper extends Thread implements Terminable { private ProcessMXBean waitForJMX() { String loopbackAddress = localAddress(); String path = "/jndi/rmi://" + loopbackAddress + ":" + jmxPort + "/jmxrmi"; - JMXServiceURL jmxUrl = null; + JMXServiceURL jmxUrl; try { jmxUrl = new JMXServiceURL("rmi", loopbackAddress, jmxPort, path); } catch (MalformedURLException e) { @@ -270,8 +270,7 @@ public class ProcessWrapper extends Thread implements Terminable { } }, null, null); MBeanServerConnection mBeanServer = jmxConnector.getMBeanServerConnection(); - ProcessMXBean bean = JMX.newMBeanProxy(mBeanServer, JmxUtils.objectName(processName), ProcessMXBean.class); - return bean; + return JMX.newMBeanProxy(mBeanServer, JmxUtils.objectName(processName), ProcessMXBean.class); } catch (Exception ignored) { LOGGER.trace("Could not connect JMX yet", ignored); } -- 2.39.5