]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaw
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 25 Aug 2014 17:52:23 +0000 (19:52 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 25 Aug 2014 17:52:23 +0000 (19:52 +0200)
server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java

index 09f422ba09b93e8120ebbbe4f67a03c6936edacb..128321519000a4cb260f8755aaeb831834911c95 100644 (file)
@@ -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);
       }