Program: 24414
Project: 24414
Buggy source:
/** 
 * Connects to the given RMI port (default: 9999) and invokes shutdown on the loader. <ul> <li>Arg 0 = port number</li> <li>Arg 1 = auth name</li> <li>Arg 2 = auth password</li> </ul>
 * @param args see args list
 */
@SuppressWarnings("String_Node_Str") public static void main(String[] args){
  try {
    String policyFile=System.getProperty("String_Node_Str");
    if (policyFile == null) {
      System.setProperty("String_Node_Str","String_Node_Str");
      String configRoot=Bootstrap.getConfigurationRoot(Bootstrap.getRed5Root());
      System.out.printf("String_Node_Str",configRoot);
      System.setProperty("String_Node_Str",configRoot + "String_Node_Str");
    }
    String rmiAdapterHost=System.getProperty("String_Node_Str");
    if (rmiAdapterHost == null) {
      String ipv4=System.getProperty("String_Node_Str");
      if ("String_Node_Str".equals(ipv4)) {
        rmiAdapterHost="String_Node_Str";
      }
 else {
        rmiAdapterHost="String_Node_Str";
      }
    }
    ClassLoader baseLoader=Thread.currentThread().getContextClassLoader();
    ClassLoader loader=ClassLoaderBuilder.build(null,ClassLoaderBuilder.USE_RED5_LIB,baseLoader);
    Thread.currentThread().setContextClassLoader(loader);
    JMXServiceURL url=null;
    JMXConnector jmxc=null;
    HashMap<String,Object> env=null;
    if (null == args || args.length < 1) {
      System.out.printf("String_Node_Str",rmiAdapterHost);
      url=new JMXServiceURL("String_Node_Str" + rmiAdapterHost + "String_Node_Str"+ rmiAdapterHost+ "String_Node_Str");
    }
 else {
      System.out.printf("String_Node_Str",rmiAdapterHost,args[0]);
      url=new JMXServiceURL("String_Node_Str" + rmiAdapterHost + "String_Node_Str"+ args[0]+ "String_Node_Str"+ rmiAdapterHost+ "String_Node_Str"+ args[0]+ "String_Node_Str");
      if (args.length > 1) {
        env=new HashMap<String,Object>(1);
        String[] credentials=new String[]{args[1],args[2]};
        env.put("String_Node_Str",credentials);
      }
    }
    jmxc=JMXConnectorFactory.connect(url,env);
    MBeanServerConnection mbs=jmxc.getMBeanServerConnection();
    ShutdownMXBean proxy=null;
    ObjectName tomcatObjectName=new ObjectName("String_Node_Str");
    ObjectName jettyObjectName=new ObjectName("String_Node_Str");
    ObjectName winstoneObjectName=new ObjectName("String_Node_Str");
    ObjectName contextLoaderObjectName=new ObjectName("String_Node_Str");
    if (mbs.isRegistered(jettyObjectName)) {
      System.out.println("String_Node_Str");
      proxy=JMX.newMXBeanProxy(mbs,jettyObjectName,ShutdownMXBean.class,true);
    }
 else     if (mbs.isRegistered(tomcatObjectName)) {
      System.out.println("String_Node_Str");
      proxy=JMX.newMXBeanProxy(mbs,tomcatObjectName,ShutdownMXBean.class,true);
    }
 else     if (mbs.isRegistered(winstoneObjectName)) {
      System.out.println("String_Node_Str");
      proxy=JMX.newMXBeanProxy(mbs,winstoneObjectName,ShutdownMXBean.class,true);
    }
 else     if (mbs.isRegistered(contextLoaderObjectName)) {
      System.out.println("String_Node_Str");
      proxy=JMX.newMXBeanProxy(mbs,contextLoaderObjectName,ShutdownMXBean.class,true);
    }
 else {
      System.out.println("String_Node_Str");
    }
    if (proxy != null) {
      System.out.println("String_Node_Str");
      proxy.destroy();
    }
    jmxc.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Connects to the given RMI port (default: 9999) and invokes shutdown on the loader. <ul> <li>Arg 0 = port number</li> <li>Arg 1 = auth name</li> <li>Arg 2 = auth password</li> </ul>
 * @param args see args list
 */
@SuppressWarnings("String_Node_Str") public static void main(String[] args){
  try {
    String policyFile=System.getProperty("String_Node_Str");
    if (policyFile == null) {
      System.setProperty("String_Node_Str","String_Node_Str");
      String configRoot=Bootstrap.getConfigurationRoot(Bootstrap.getRed5Root());
      System.out.printf("String_Node_Str",configRoot);
      System.setProperty("String_Node_Str",configRoot + "String_Node_Str");
    }
    String rmiAdapterHost=System.getProperty("String_Node_Str");
    if (rmiAdapterHost == null) {
      String ipv4=System.getProperty("String_Node_Str");
      if ("String_Node_Str".equals(ipv4)) {
        rmiAdapterHost="String_Node_Str";
      }
 else {
        rmiAdapterHost="String_Node_Str";
      }
    }
    ClassLoader baseLoader=Thread.currentThread().getContextClassLoader();
    ClassLoader loader=ClassLoaderBuilder.build(null,ClassLoaderBuilder.USE_RED5_LIB,baseLoader);
    Thread.currentThread().setContextClassLoader(loader);
    JMXServiceURL url=null;
    JMXConnector jmxc=null;
    HashMap<String,Object> env=null;
    if (null == args || args.length < 1) {
      System.out.printf("String_Node_Str",rmiAdapterHost);
      url=new JMXServiceURL("String_Node_Str" + rmiAdapterHost + "String_Node_Str"+ rmiAdapterHost+ "String_Node_Str");
    }
 else {
      System.out.printf("String_Node_Str",rmiAdapterHost,args[0]);
      url=new JMXServiceURL("String_Node_Str" + rmiAdapterHost + "String_Node_Str"+ args[0]+ "String_Node_Str"+ rmiAdapterHost+ "String_Node_Str"+ args[0]+ "String_Node_Str");
      if (args.length > 1) {
        env=new HashMap<String,Object>(1);
        String[] credentials=new String[]{args[1],args[2]};
        env.put("String_Node_Str",credentials);
      }
    }
    jmxc=JMXConnectorFactory.connect(url,env);
    MBeanServerConnection mbs=jmxc.getMBeanServerConnection();
    final ShutdownMXBean proxy;
    ObjectName tomcatObjectName=new ObjectName("String_Node_Str");
    ObjectName jettyObjectName=new ObjectName("String_Node_Str");
    ObjectName winstoneObjectName=new ObjectName("String_Node_Str");
    ObjectName contextLoaderObjectName=new ObjectName("String_Node_Str");
    if (mbs.isRegistered(jettyObjectName)) {
      System.out.println("String_Node_Str");
      proxy=JMX.newMXBeanProxy(mbs,jettyObjectName,ShutdownMXBean.class,true);
    }
 else     if (mbs.isRegistered(tomcatObjectName)) {
      System.out.println("String_Node_Str");
      proxy=JMX.newMXBeanProxy(mbs,tomcatObjectName,ShutdownMXBean.class,true);
    }
 else     if (mbs.isRegistered(winstoneObjectName)) {
      System.out.println("String_Node_Str");
      proxy=JMX.newMXBeanProxy(mbs,winstoneObjectName,ShutdownMXBean.class,true);
    }
 else     if (mbs.isRegistered(contextLoaderObjectName)) {
      System.out.println("String_Node_Str");
      proxy=JMX.newMXBeanProxy(mbs,contextLoaderObjectName,ShutdownMXBean.class,true);
    }
 else {
      System.out.println("String_Node_Str");
      proxy=null;
    }
    if (proxy != null) {
      System.out.println("String_Node_Str");
      final CountDownLatch latch=new CountDownLatch(1);
      new Thread(new Runnable(){
        public void run(){
          try {
            proxy.destroy();
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
          latch.countDown();
        }
      }
,"String_Node_Str").start();
      try {
        latch.await(5,TimeUnit.SECONDS);
      }
 catch (      InterruptedException e) {
        System.out.println("String_Node_Str");
      }
 finally {
        System.exit(0);
      }
    }
    jmxc.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}