Program: 4474
Project: 4474
Buggy source:
public void checkAndUpdate(Connection connection){
  String nv=connection.getVersion();
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + latestVersion + "String_Node_Str"+ nv);
  String myVersion=null;
  if (latestVersion.equals(SPECIAL_VERSION))   myVersion=CommonUtils.getLimeWireVersion();
 else   myVersion=latestVersion;
  if (!isGreaterVersion(nv,myVersion))   return;
  if (nv.equals(SPECIAL_VERSION))   return;
  final Connection c=connection;
  final String myversion=myVersion;
  Thread checker=new ManagedThread("String_Node_Str"){
    public void managedRun(){
      LOG.trace("String_Node_Str");
      final String UPDATE="String_Node_Str";
      String ip=c.getAddress();
      int port=c.getPort();
      String connectTo="String_Node_Str" + ip + "String_Node_Str"+ port+ UPDATE;
      HttpMethod get=new GetMethod(connectTo);
      get.addRequestHeader("String_Node_Str","String_Node_Str");
      get.addRequestHeader("String_Node_Str",CommonUtils.getHttpServer());
      get.addRequestHeader(HTTPHeaderName.CONNECTION.httpStringValue(),"String_Node_Str");
      HttpClient client=HttpClientManager.getNewClient();
      try {
        client.executeMethod(get);
        byte[] data=get.getResponseBody();
        if (data == null)         return;
        UpdateMessageVerifier verifier=new UpdateMessageVerifier(data,false);
        if (!verifier.verifySource())         return;
        LOG.trace("String_Node_Str");
        String xml=new String(verifier.getMessageBytes(),"String_Node_Str");
        UpdateFileParser parser=new UpdateFileParser(xml);
        if (LOG.isTraceEnabled())         LOG.trace("String_Node_Str" + parser.getVersion());
        String newVersion=parser.getVersion();
        if (newVersion == null)         return;
        if (isGreaterVersion(newVersion,myversion)) {
          LOG.trace("String_Node_Str");
synchronized (UpdateManager.this) {
            commitVersionFile(data);
            latestVersion=newVersion;
            if (LOG.isTraceEnabled())             LOG.trace("String_Node_Str" + latestVersion);
          }
          String runningVersion=CommonUtils.getLimeWireVersion();
          if (!isGreaterVersion(newVersion,runningVersion))           return;
          RouterService.getCallback().indicateNewVersion();
        }
      }
 catch (      IOException iox) {
        return;
      }
catch (      SAXException sx) {
        return;
      }
catch (      Throwable t) {
        ErrorService.error(t);
      }
 finally {
        if (get != null)         get.releaseConnection();
      }
    }
  }
;
  checker.start();
}

Fixed version (ground truth):
public void checkAndUpdate(Connection connection){
  String nv=connection.getVersion();
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + latestVersion + "String_Node_Str"+ nv);
  String myVersion=null;
  if (latestVersion.equals(SPECIAL_VERSION))   myVersion=CommonUtils.getLimeWireVersion();
 else   myVersion=latestVersion;
  if (!isGreaterVersion(nv,myVersion))   return;
  if (nv.equals(SPECIAL_VERSION))   return;
  final Connection c=connection;
  final String myversion=myVersion;
  Thread checker=new ManagedThread("String_Node_Str"){
    public void managedRun(){
      LOG.trace("String_Node_Str");
      final String UPDATE="String_Node_Str";
      String ip=c.getAddress();
      int port=c.getPort();
      String connectTo="String_Node_Str" + ip + "String_Node_Str"+ port+ UPDATE;
      HttpMethod get=new GetMethod(connectTo);
      get.addRequestHeader("String_Node_Str","String_Node_Str");
      get.addRequestHeader("String_Node_Str",CommonUtils.getHttpServer());
      get.addRequestHeader(HTTPHeaderName.CONNECTION.httpStringValue(),"String_Node_Str");
      HttpClient client=HttpClientManager.getNewClient();
      try {
        client.executeMethod(get);
        byte[] data=get.getResponseBody();
        if (data == null)         return;
        UpdateMessageVerifier verifier=new UpdateMessageVerifier(data,false);
        if (!verifier.verifySource())         return;
        LOG.trace("String_Node_Str");
        String xml=new String(verifier.getMessageBytes(),"String_Node_Str");
        UpdateFileParser parser=new UpdateFileParser(xml);
        if (LOG.isTraceEnabled())         LOG.trace("String_Node_Str" + parser.getVersion());
        String newVersion=parser.getVersion();
        if (newVersion == null)         return;
        if (isGreaterVersion(newVersion,myversion)) {
          LOG.trace("String_Node_Str");
synchronized (UpdateManager.this) {
            commitVersionFile(data);
            latestVersion=newVersion;
            if (LOG.isTraceEnabled())             LOG.trace("String_Node_Str" + latestVersion);
          }
          String runningVersion=CommonUtils.getLimeWireVersion();
          if (!isGreaterVersion(newVersion,runningVersion))           return;
          long makeTime=parser.getTimestamp();
          if (makeTime == -1)           makeTime=System.currentTimeMillis();
          if (System.currentTimeMillis() < makeTime + SEVEN_HOURS) {
            Random rand=new Random();
            long sleep=rand.nextLong() % SEVEN_HOURS;
            if (sleep < 0)             sleep=-1 * sleep;
            try {
              Thread.sleep(sleep);
            }
 catch (            InterruptedException ignored) {
            }
          }
          RouterService.getCallback().indicateNewVersion();
        }
      }
 catch (      IOException iox) {
        return;
      }
catch (      SAXException sx) {
        return;
      }
catch (      Throwable t) {
        ErrorService.error(t);
      }
 finally {
        if (get != null)         get.releaseConnection();
      }
    }
  }
;
  checker.setDaemon(true);
  checker.start();
}