From: Simon Brandhof Date: Mon, 25 Aug 2014 17:52:23 +0000 (+0200) Subject: Fix quality flaw X-Git-Tag: 4.5-RC1~96 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9245b29fe0419dc17c880cdea33d4ee348d68721;p=sonarqube.git Fix quality flaw --- 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); }