Program: 47290
Project: 47290
Buggy source:
@Override public void run(){
  Request request=null;
  StartStopListenerDelegate startStopListenerDelegate=new StartStopListenerDelegate(socket.getInetAddress().getHostAddress());
  try {
    int receivedContentLength=-1;
    String headerLine=br.readLine();
    String userAgentString=null;
    StringBuilder unknownHeaders=new StringBuilder();
    String separator="String_Node_Str";
    RendererConfiguration renderer=null;
    InetSocketAddress remoteAddress=(InetSocketAddress)socket.getRemoteSocketAddress();
    InetAddress ia=remoteAddress.getAddress();
    if (filterIp(ia)) {
      throw new IOException("String_Node_Str" + ia + "String_Node_Str");
    }
    LOGGER.trace("String_Node_Str" + socket);
    PMS.get().getRegistry().disableGoToSleep();
    while (headerLine != null && headerLine.length() > 0) {
      LOGGER.trace("String_Node_Str" + headerLine);
      if (request != null && request.getMediaRenderer() == null) {
        renderer=RendererConfiguration.getRendererConfigurationBySocketAddress(ia);
        if (renderer != null) {
          PMS.get().setRendererfound(renderer);
          request.setMediaRenderer(renderer);
          LOGGER.trace("String_Node_Str" + renderer.getRendererName() + "String_Node_Str"+ ia);
        }
      }
      if (renderer == null && headerLine != null && headerLine.toUpperCase().startsWith("String_Node_Str") && request != null) {
        userAgentString=headerLine.substring(headerLine.indexOf("String_Node_Str") + 1).trim();
        renderer=RendererConfiguration.getRendererConfigurationByUA(userAgentString);
        if (renderer != null) {
          PMS.get().setRendererfound(renderer);
          request.setMediaRenderer(renderer);
          renderer.associateIP(ia);
          LOGGER.trace("String_Node_Str" + renderer.getRendererName() + "String_Node_Str"+ headerLine+ "String_Node_Str");
        }
      }
      if (renderer == null && headerLine != null && request != null) {
        renderer=RendererConfiguration.getRendererConfigurationByUAAHH(headerLine);
        if (renderer != null) {
          PMS.get().setRendererfound(renderer);
          request.setMediaRenderer(renderer);
          renderer.associateIP(ia);
          LOGGER.trace("String_Node_Str" + renderer.getRendererName() + "String_Node_Str"+ headerLine+ "String_Node_Str");
        }
      }
      try {
        StringTokenizer s=new StringTokenizer(headerLine);
        String temp=s.nextToken();
        if (temp.equals("String_Node_Str") || temp.equals("String_Node_Str") || temp.equals("String_Node_Str")|| temp.equals("String_Node_Str")) {
          request=new Request(temp,s.nextToken().substring(1));
          if (s.hasMoreTokens() && s.nextToken().equals("String_Node_Str")) {
            request.setHttp10(true);
          }
        }
 else         if (request != null && temp.toUpperCase().equals("String_Node_Str")) {
          request.setSoapaction(s.nextToken());
        }
 else         if (request != null && temp.toUpperCase().equals("String_Node_Str")) {
          request.setSoapaction(s.nextToken());
        }
 else         if (headerLine.toUpperCase().contains("String_Node_Str")) {
          receivedContentLength=Integer.parseInt(headerLine.substring(headerLine.toUpperCase().indexOf("String_Node_Str") + 16));
        }
 else         if (headerLine.toUpperCase().indexOf("String_Node_Str") > -1) {
          String nums=headerLine.substring(headerLine.toUpperCase().indexOf("String_Node_Str") + 13).trim();
          StringTokenizer st=new StringTokenizer(nums,"String_Node_Str");
          if (!nums.startsWith("String_Node_Str")) {
            request.setLowRange(Long.parseLong(st.nextToken()));
          }
          if (!nums.startsWith("String_Node_Str") && !nums.endsWith("String_Node_Str")) {
            request.setHighRange(Long.parseLong(st.nextToken()));
          }
 else {
            request.setHighRange(-1);
          }
        }
 else         if (headerLine.toLowerCase().indexOf("String_Node_Str") > -1) {
          request.setTransferMode(headerLine.substring(headerLine.toLowerCase().indexOf("String_Node_Str") + 22).trim());
        }
 else         if (headerLine.toLowerCase().indexOf("String_Node_Str") > -1) {
          request.setContentFeatures(headerLine.substring(headerLine.toLowerCase().indexOf("String_Node_Str") + 28).trim());
        }
 else         if (headerLine.toUpperCase().indexOf("String_Node_Str") > -1) {
          String timeseek=headerLine.substring(headerLine.toUpperCase().indexOf("String_Node_Str") + 28);
          if (timeseek.endsWith("String_Node_Str")) {
            timeseek=timeseek.substring(0,timeseek.length() - 1);
          }
 else           if (timeseek.indexOf("String_Node_Str") > -1) {
            timeseek=timeseek.substring(0,timeseek.indexOf("String_Node_Str"));
          }
          request.setTimeseek(Double.parseDouble(timeseek));
        }
 else         if (headerLine.toUpperCase().indexOf("String_Node_Str") > -1) {
          String timeseek=headerLine.substring(headerLine.toUpperCase().indexOf("String_Node_Str") + 29);
          if (timeseek.endsWith("String_Node_Str")) {
            timeseek=timeseek.substring(0,timeseek.length() - 1);
          }
 else           if (timeseek.indexOf("String_Node_Str") > -1) {
            timeseek=timeseek.substring(0,timeseek.indexOf("String_Node_Str"));
          }
          request.setTimeseek(Double.parseDouble(timeseek));
        }
 else {
          boolean isKnown=false;
          for (          String knownHeaderString : KNOWN_HEADERS) {
            if (headerLine.toLowerCase().startsWith(knownHeaderString.toLowerCase())) {
              isKnown=true;
              break;
            }
          }
          if (!isKnown) {
            unknownHeaders.append(separator).append(headerLine);
            separator="String_Node_Str";
          }
        }
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str",e);
      }
      headerLine=br.readLine();
    }
    if (request != null) {
      if (request.getMediaRenderer() == null) {
        request.setMediaRenderer(RendererConfiguration.getDefaultConf());
        LOGGER.trace("String_Node_Str" + request.getMediaRenderer().getRendererName());
        if (userAgentString != null && !userAgentString.equals("String_Node_Str")) {
          LOGGER.info("String_Node_Str" + userAgentString + ("String_Node_Str".equals(unknownHeaders.toString()) ? "String_Node_Str" : "String_Node_Str" + unknownHeaders.toString()));
          PMS.get().setRendererfound(request.getMediaRenderer());
        }
      }
 else {
        if (userAgentString != null) {
          LOGGER.trace("String_Node_Str" + userAgentString);
        }
        LOGGER.trace("String_Node_Str" + request.getMediaRenderer().getRendererName());
      }
    }
    if (receivedContentLength > 0) {
      char buf[]=new char[receivedContentLength];
      br.read(buf);
      if (request != null) {
        request.setTextContent(new String(buf));
      }
    }
    if (request != null) {
      LOGGER.trace("String_Node_Str" + request.getArgument() + "String_Node_Str"+ request.getLowRange()+ "String_Node_Str"+ request.getHighRange());
    }
    if (request != null) {
      request.answer(output,startStopListenerDelegate);
    }
    if (request != null && request.getInputStream() != null) {
      request.getInputStream().close();
    }
  }
 catch (  IOException e) {
    LOGGER.trace("String_Node_Str" + e.getClass().getName() + "String_Node_Str"+ e.getMessage());
    if (request != null && request.getInputStream() != null) {
      try {
        LOGGER.trace("String_Node_Str" + request.getInputStream());
        request.getInputStream().close();
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
 finally {
    try {
      PMS.get().getRegistry().reenableGoToSleep();
      output.close();
      br.close();
      socket.close();
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
    }
    startStopListenerDelegate.stop();
    LOGGER.trace("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void run(){
  Request request=null;
  StartStopListenerDelegate startStopListenerDelegate=new StartStopListenerDelegate(socket.getInetAddress().getHostAddress());
  try {
    int receivedContentLength=-1;
    String headerLine=br.readLine();
    String userAgentString=null;
    StringBuilder unknownHeaders=new StringBuilder();
    String separator="String_Node_Str";
    RendererConfiguration renderer=null;
    InetSocketAddress remoteAddress=(InetSocketAddress)socket.getRemoteSocketAddress();
    InetAddress ia=remoteAddress.getAddress();
    if (filterIp(ia)) {
      throw new IOException("String_Node_Str" + ia + "String_Node_Str");
    }
    LOGGER.trace("String_Node_Str" + socket);
    PMS.get().getRegistry().disableGoToSleep();
    while (headerLine != null && headerLine.length() > 0) {
      LOGGER.trace("String_Node_Str" + headerLine);
      if (request != null && request.getMediaRenderer() == null) {
        renderer=RendererConfiguration.getRendererConfigurationBySocketAddress(ia);
        if (renderer != null) {
          PMS.get().setRendererfound(renderer);
          request.setMediaRenderer(renderer);
          LOGGER.trace("String_Node_Str" + renderer.getRendererName() + "String_Node_Str"+ ia);
        }
      }
      if (renderer == null && headerLine != null && headerLine.toUpperCase().startsWith("String_Node_Str") && request != null) {
        userAgentString=headerLine.substring(headerLine.indexOf("String_Node_Str") + 1).trim();
        renderer=RendererConfiguration.getRendererConfigurationByUA(userAgentString);
        if (renderer != null) {
          PMS.get().setRendererfound(renderer);
          request.setMediaRenderer(renderer);
          renderer.associateIP(ia);
          LOGGER.trace("String_Node_Str" + renderer.getRendererName() + "String_Node_Str"+ headerLine+ "String_Node_Str");
        }
      }
      if (renderer == null && headerLine != null && request != null) {
        renderer=RendererConfiguration.getRendererConfigurationByUAAHH(headerLine);
        if (renderer != null) {
          PMS.get().setRendererfound(renderer);
          request.setMediaRenderer(renderer);
          renderer.associateIP(ia);
          LOGGER.trace("String_Node_Str" + renderer.getRendererName() + "String_Node_Str"+ headerLine+ "String_Node_Str");
        }
      }
      try {
        StringTokenizer s=new StringTokenizer(headerLine);
        String temp=s.nextToken();
        if (temp.equals("String_Node_Str") || temp.equals("String_Node_Str") || temp.equals("String_Node_Str")|| temp.equals("String_Node_Str")) {
          request=new Request(temp,s.nextToken().substring(1));
          if (s.hasMoreTokens() && s.nextToken().equals("String_Node_Str")) {
            request.setHttp10(true);
          }
        }
 else         if (request != null && temp.toUpperCase().equals("String_Node_Str")) {
          request.setSoapaction(s.nextToken());
        }
 else         if (request != null && temp.toUpperCase().equals("String_Node_Str")) {
          request.setSoapaction(s.nextToken());
        }
 else         if (headerLine.toUpperCase().contains("String_Node_Str")) {
          receivedContentLength=Integer.parseInt(headerLine.substring(headerLine.toUpperCase().indexOf("String_Node_Str") + 16));
        }
 else         if (headerLine.toUpperCase().indexOf("String_Node_Str") > -1) {
          String nums=headerLine.substring(headerLine.toUpperCase().indexOf("String_Node_Str") + 13).trim();
          StringTokenizer st=new StringTokenizer(nums,"String_Node_Str");
          if (!nums.startsWith("String_Node_Str")) {
            request.setLowRange(Long.parseLong(st.nextToken()));
          }
          if (!nums.startsWith("String_Node_Str") && !nums.endsWith("String_Node_Str")) {
            request.setHighRange(Long.parseLong(st.nextToken()));
          }
 else {
            request.setHighRange(-1);
          }
        }
 else         if (headerLine.toLowerCase().indexOf("String_Node_Str") > -1) {
          request.setTransferMode(headerLine.substring(headerLine.toLowerCase().indexOf("String_Node_Str") + 22).trim());
        }
 else         if (headerLine.toLowerCase().indexOf("String_Node_Str") > -1) {
          request.setContentFeatures(headerLine.substring(headerLine.toLowerCase().indexOf("String_Node_Str") + 28).trim());
        }
 else         if (headerLine.toUpperCase().indexOf("String_Node_Str") > -1) {
          String timeseek=headerLine.substring(headerLine.toUpperCase().indexOf("String_Node_Str") + 28);
          if (timeseek.endsWith("String_Node_Str")) {
            timeseek=timeseek.substring(0,timeseek.length() - 1);
          }
 else           if (timeseek.indexOf("String_Node_Str") > -1) {
            timeseek=timeseek.substring(0,timeseek.indexOf("String_Node_Str"));
          }
          request.setTimeseek(Double.parseDouble(timeseek));
        }
 else         if (headerLine.toUpperCase().indexOf("String_Node_Str") > -1) {
          String timeseek=headerLine.substring(headerLine.toUpperCase().indexOf("String_Node_Str") + 29);
          if (timeseek.endsWith("String_Node_Str")) {
            timeseek=timeseek.substring(0,timeseek.length() - 1);
          }
 else           if (timeseek.indexOf("String_Node_Str") > -1) {
            timeseek=timeseek.substring(0,timeseek.indexOf("String_Node_Str"));
          }
          request.setTimeseek(Double.parseDouble(timeseek));
        }
 else {
          boolean isKnown=false;
          for (          String knownHeaderString : KNOWN_HEADERS) {
            if (headerLine.toLowerCase().startsWith(knownHeaderString.toLowerCase())) {
              isKnown=true;
              break;
            }
          }
          if (!isKnown) {
            unknownHeaders.append(separator).append(headerLine);
            separator="String_Node_Str";
          }
        }
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str",e);
      }
      headerLine=br.readLine();
    }
    if (request != null) {
      if (request.getMediaRenderer() == null) {
        request.setMediaRenderer(RendererConfiguration.getDefaultConf());
        LOGGER.trace("String_Node_Str" + request.getMediaRenderer().getRendererName());
        if (userAgentString != null && !userAgentString.equals("String_Node_Str")) {
          LOGGER.info("String_Node_Str" + userAgentString + ("String_Node_Str".equals(unknownHeaders.toString()) ? "String_Node_Str" : "String_Node_Str" + unknownHeaders.toString()));
          PMS.get().setRendererfound(request.getMediaRenderer());
        }
      }
 else {
        if (userAgentString != null) {
          LOGGER.trace("String_Node_Str" + userAgentString);
        }
        LOGGER.trace("String_Node_Str" + request.getMediaRenderer().getRendererName());
      }
    }
    if (receivedContentLength > 0) {
      char buf[]=new char[receivedContentLength];
      br.read(buf);
      if (request != null) {
        request.setTextContent(new String(buf));
      }
    }
    if (request != null) {
      LOGGER.trace("String_Node_Str" + request.getArgument() + "String_Node_Str"+ request.getLowRange()+ "String_Node_Str"+ request.getHighRange());
    }
    if (request != null) {
      request.answer(output,startStopListenerDelegate);
    }
    if (request != null && request.getInputStream() != null) {
      request.getInputStream().close();
    }
  }
 catch (  IOException e) {
    LOGGER.trace("String_Node_Str" + e.getClass().getName() + "String_Node_Str"+ e.getMessage());
    if (request != null && request.getInputStream() != null) {
      try {
        LOGGER.trace("String_Node_Str" + request.getInputStream());
        request.getInputStream().close();
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
      }
    }
  }
 finally {
    try {
      PMS.get().getRegistry().reenableGoToSleep();
      output.close();
      br.close();
      socket.close();
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
    }
    startStopListenerDelegate.stop();
    LOGGER.trace("String_Node_Str");
  }
}