Program: 10110
Project: 10110
Buggy source:
@Override public void run(){
  while (true) {
    long now=DateTime.now().getMillis();
    for (    int pageNo : pageNos) {
      String lastMod=pagesLastMods[pageNo];
      Page page;
      long startTime=DateTime.now().getMillis();
      try {
        page=sourceBoard.getPage(pageNo,lastMod);
      }
 catch (      HttpGetException e) {
        if (e.getHttpStatus() == 304)         debug(TALK,(pageNo == 0 ? "String_Node_Str" : "String_Node_Str" + pageNo) + "String_Node_Str");
 else         debug(WARN,"String_Node_Str" + pageNo + "String_Node_Str"+ e.getMessage());
        continue;
      }
catch (      ContentGetException e) {
        debug(WARN,"String_Node_Str" + pageNo + "String_Node_Str"+ e.getMessage());
        continue;
      }
catch (      ContentParseException e) {
        debug(WARN,"String_Node_Str" + pageNo + "String_Node_Str"+ e.getMessage());
        continue;
      }
      if (page == null) {
        debug(WARN,(pageNo == 0 ? "String_Node_Str" : "String_Node_Str" + pageNo) + "String_Node_Str");
        continue;
      }
      pagesLastMods[pageNo]=page.getLastMod();
      debug(INFO,"String_Node_Str" + pageNo);
      for (      Topic newTopic : page.getThreads()) {
        int num=newTopic.getNum();
synchronized (newTopics) {
          if (newTopics.contains(num))           continue;
        }
        if (!topics.containsKey(num)) {
          try {
            newTopics.put(num);
          }
 catch (          InterruptedException e) {
          }
          continue;
        }
        Topic fullTopic=topics.get(num);
        if (fullTopic == null)         continue;
        fullTopic.lock.writeLock().lock();
        if (fullTopic.getLastHit() > startTime) {
          fullTopic.lock.writeLock().unlock();
          continue;
        }
        fullTopic.setLastPage(pageNo);
        int oldPosts=0;
        int newPosts=0;
        boolean mustRefresh=false;
        if (findDeleted(fullTopic,newTopic,false)) {
          mustRefresh=true;
          newPosts++;
        }
        for (Iterator<Post> it=newTopic.getPosts().iterator(); it.hasNext(); ) {
          Post newPost=it.next();
          if (fullTopic.findPost(newPost.getNum())) {
            if (newPost.isOmitted())             it.remove();
            oldPosts++;
            continue;
          }
          fullTopic.addPost(newPost.getNum());
          newPosts++;
          if (newPost.isOmitted())           mustRefresh=true;
        }
        fullTopic.setLastHit(startTime);
        fullTopic.lock.writeLock().unlock();
        if (oldPosts != 0 && newPosts == 0)         continue;
        debug(TALK,(pageNo == 0 ? "String_Node_Str" : "String_Node_Str" + pageNo) + "String_Node_Str");
        newTopic.lock.readLock().lock();
        topicUpdates.add(newTopic);
        newTopic.lock.readLock().unlock();
        if (mustRefresh || oldPosts < 2) {
          debug(TALK,num + "String_Node_Str");
          try {
            newTopics.put(num);
          }
 catch (          InterruptedException e) {
          }
        }
      }
    }
    long left=this.wait - (DateTime.now().getMillis() - now);
    if (left > 0) {
      try {
        Thread.sleep(left);
      }
 catch (      InterruptedException e) {
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (true) {
    long startTime=DateTime.now().getMillis();
    for (    int pageNo : pageNos) {
      String lastMod=pagesLastMods[pageNo];
      Page page;
      long pageStartTime=DateTime.now().getMillis();
      try {
        page=sourceBoard.getPage(pageNo,lastMod);
      }
 catch (      HttpGetException e) {
        if (e.getHttpStatus() == 304)         debug(TALK,(pageNo == 0 ? "String_Node_Str" : "String_Node_Str" + pageNo) + "String_Node_Str");
 else         debug(WARN,"String_Node_Str" + pageNo + "String_Node_Str"+ e.getMessage());
        continue;
      }
catch (      ContentGetException e) {
        debug(WARN,"String_Node_Str" + pageNo + "String_Node_Str"+ e.getMessage());
        continue;
      }
catch (      ContentParseException e) {
        debug(WARN,"String_Node_Str" + pageNo + "String_Node_Str"+ e.getMessage());
        continue;
      }
      if (page == null) {
        debug(WARN,(pageNo == 0 ? "String_Node_Str" : "String_Node_Str" + pageNo) + "String_Node_Str");
        continue;
      }
      pagesLastMods[pageNo]=page.getLastMod();
      debug(INFO,"String_Node_Str" + pageNo);
      for (      Topic newTopic : page.getThreads()) {
        int num=newTopic.getNum();
synchronized (newTopics) {
          if (newTopics.contains(num))           continue;
        }
        if (!topics.containsKey(num)) {
          try {
            newTopics.put(num);
          }
 catch (          InterruptedException e) {
          }
          continue;
        }
        Topic fullTopic=topics.get(num);
        if (fullTopic == null)         continue;
        fullTopic.lock.writeLock().lock();
        if (fullTopic.getLastHit() > pageStartTime) {
          fullTopic.lock.writeLock().unlock();
          continue;
        }
        fullTopic.setLastPage(pageNo);
        int oldPosts=0;
        int newPosts=0;
        boolean mustRefresh=false;
        if (findDeleted(fullTopic,newTopic,false)) {
          mustRefresh=true;
          newPosts++;
        }
        for (Iterator<Post> it=newTopic.getPosts().iterator(); it.hasNext(); ) {
          Post newPost=it.next();
          if (fullTopic.findPost(newPost.getNum())) {
            if (newPost.isOmitted())             it.remove();
            oldPosts++;
            continue;
          }
          fullTopic.addPost(newPost.getNum());
          newPosts++;
          if (newPost.isOmitted())           mustRefresh=true;
        }
        fullTopic.setLastHit(pageStartTime);
        fullTopic.lock.writeLock().unlock();
        if (oldPosts != 0 && newPosts == 0)         continue;
        debug(TALK,(pageNo == 0 ? "String_Node_Str" : "String_Node_Str" + pageNo) + "String_Node_Str");
        newTopic.lock.readLock().lock();
        topicUpdates.add(newTopic);
        newTopic.lock.readLock().unlock();
        if (mustRefresh || oldPosts < 2) {
          debug(TALK,num + "String_Node_Str");
          try {
            newTopics.put(num);
          }
 catch (          InterruptedException e) {
          }
        }
      }
    }
    long left=this.wait - (DateTime.now().getMillis() - startTime);
    if (left > 0) {
      try {
        Thread.sleep(left);
      }
 catch (      InterruptedException e) {
      }
    }
  }
}