Program: 145789
Project: 145789
Buggy source:
/** 
 * Wait for connections and handle commands.
 */
public void run(){
  while (serverThread != null && serverSocket != null) {
    try {
      Socket s=serverSocket.accept();
      BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
      BufferedReader reader=new BufferedReader(new InputStreamReader(s.getInputStream()));
      if (s.getInetAddress().equals(InetAddress.getLocalHost())) {
        String line=reader.readLine();
        String command=null, args=null;
        int idx=line.indexOf(' ');
        if (idx != -1) {
          command=line.substring(0,idx);
          args=line.substring(idx + 1);
        }
        System.out.println("String_Node_Str" + command + "String_Node_Str"+ args+ "String_Node_Str");
        if ("String_Node_Str".equals(command)) {
          Shutdown.shutdown();
        }
 else         if ("String_Node_Str".equals(command) && args != null) {
          try {
            ApplicationLoader.loadApplication(config.getProperty(Configuration.WEBAPP_ROOT),args);
          }
 catch (          Exception e) {
            e.printStackTrace(new PrintWriter(writer));
            writer.newLine();
          }
        }
 else         if ("String_Node_Str".equals(command) && args != null) {
          try {
            ApplicationLoader.unloadApplication(config.getProperty(Configuration.WEBAPP_ROOT),args);
          }
 catch (          Exception e) {
            e.printStackTrace(new PrintWriter(writer));
            writer.newLine();
          }
        }
 else         if ("String_Node_Str".equals(command) && args != null) {
          try {
            ApplicationLoader.reloadApplication(config.getProperty(Configuration.WEBAPP_ROOT),args);
          }
 catch (          Exception e) {
            e.printStackTrace(new PrintWriter(writer));
            writer.newLine();
          }
        }
 else {
          writer.write("String_Node_Str" + command + "String_Node_Str");
        }
      }
 else {
        writer.write("String_Node_Str");
        writer.newLine();
      }
      writer.flush();
      reader.close();
      writer.close();
      s.close();
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + e);
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Wait for connections and handle commands.
 */
public void run(){
  while (serverThread != null && serverSocket != null) {
    try {
      Socket s=serverSocket.accept();
      BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
      BufferedReader reader=new BufferedReader(new InputStreamReader(s.getInputStream()));
      if (s.getInetAddress().equals(InetAddress.getLocalHost())) {
        String line=reader.readLine();
        String command=null, args=null;
        int idx=line.indexOf(' ');
        if (idx != -1) {
          command=line.substring(0,idx);
          args=line.substring(idx + 1);
        }
        System.out.println("String_Node_Str" + command + "String_Node_Str"+ args+ "String_Node_Str");
        if ("String_Node_Str".equals(command)) {
          System.exit(0);
        }
 else         if ("String_Node_Str".equals(command) && args != null) {
          try {
            ApplicationLoader.loadApplication(config.getProperty(Configuration.WEBAPP_ROOT),args);
          }
 catch (          Exception e) {
            e.printStackTrace(new PrintWriter(writer));
            writer.newLine();
          }
        }
 else         if ("String_Node_Str".equals(command) && args != null) {
          try {
            ApplicationLoader.unloadApplication(config.getProperty(Configuration.WEBAPP_ROOT),args);
          }
 catch (          Exception e) {
            e.printStackTrace(new PrintWriter(writer));
            writer.newLine();
          }
        }
 else         if ("String_Node_Str".equals(command) && args != null) {
          try {
            ApplicationLoader.reloadApplication(config.getProperty(Configuration.WEBAPP_ROOT),args);
          }
 catch (          Exception e) {
            e.printStackTrace(new PrintWriter(writer));
            writer.newLine();
          }
        }
 else {
          writer.write("String_Node_Str" + command + "String_Node_Str");
        }
      }
 else {
        writer.write("String_Node_Str");
        writer.newLine();
      }
      writer.flush();
      reader.close();
      writer.close();
      s.close();
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + e);
      e.printStackTrace();
    }
  }
}