Program: 168182
Project: 168182
Buggy source:
public int[] process(String line,HashMap<String,Integer> map){
  int ret[]=new int[3];
  int numWords=0;
  int sixltr=0;
  int numerals=0;
  Matcher matcher=pattern.matcher(line);
  if (doLower)   line=line.toLowerCase();
  if (phraseDetect) {
    for (    String key : phraseLookup.keySet()) {
      Pattern p, justp;
      if (key.endsWith("String_Node_Str")) {
        p=Pattern.compile("String_Node_Str" + key + "String_Node_Str");
        justp=Pattern.compile(key + "String_Node_Str");
        key=key.substring(0,key.length() - 1);
      }
 else {
        p=Pattern.compile("String_Node_Str" + key + "String_Node_Str");
        justp=Pattern.compile(key + "String_Node_Str");
      }
      int wordsInPhrase=key.split("String_Node_Str").length;
      Matcher m=p.matcher(line);
      ArrayList<Integer> indexes=new ArrayList<Integer>();
      while (m.find()) {
        String match=m.group();
        indexes.add(m.start() + 1);
        indexes.add(m.end());
        numWords=numWords + wordsInPhrase;
        sixltr=sixltr + bigWords(match);
        Object value=map.get(key);
        if (value != null) {
          int i=((Integer)value).intValue();
          map.put(key,i + wordsInPhrase);
        }
 else {
          map.put(key,wordsInPhrase);
        }
      }
      for (int i=0; i < indexes.size(); i=i + 2) {
        line=line.substring(0,indexes.get(i)) + line.substring(indexes.get(i + 1));
        int diff=indexes.get(i + 1) - indexes.get(i);
        for (int j=0; j < indexes.size(); j++)         indexes.set(j,indexes.get(j) - diff);
      }
      indexes.clear();
      Matcher m2=justp.matcher(line);
      while (m2.find()) {
        String match=m2.group();
        indexes.add(m2.start());
        indexes.add(m2.end());
        numWords=numWords + wordsInPhrase;
        sixltr=sixltr + bigWords(match);
        Object value=map.get(key);
        if (value != null) {
          int i=((Integer)value).intValue();
          map.put(key,i + wordsInPhrase);
        }
 else {
          map.put(key,wordsInPhrase);
        }
      }
      for (int i=0; i < indexes.size(); i=i + 2) {
        line=line.substring(0,indexes.get(i)) + line.substring(indexes.get(i + 1));
        int diff=indexes.get(i + 1) - indexes.get(i);
        for (int j=0; j < indexes.size(); j++)         indexes.set(j,indexes.get(j) - diff);
      }
    }
  }
  StringTokenizer st=new StringTokenizer(line,delimiters);
  String currentWord=null;
  if (st.hasMoreTokens())   currentWord=trimChars(st.nextToken(),punctuations);
  do {
    String nextWord=null;
    if (st.hasMoreTokens())     nextWord=trimChars(st.nextToken(),punctuations);
    if (currentWord == null || currentWord.equals("String_Node_Str")) {
      currentWord=nextWord;
      continue;
    }
    matcher=pattern.matcher(currentWord);
    while (matcher.find()) {
      numerals++;
    }
    if (doSnowballStemming) {
      stemmer.setCurrent(currentWord);
      String stemmedWord="String_Node_Str";
      if (stemmer.stem())       stemmedWord=stemmer.getCurrent();
      if (!stemmedWord.equals("String_Node_Str"))       currentWord=stemmedWord;
    }
    if (doStopWords)     if (stopWordSet.contains(currentWord))     continue;
    Matcher word=regularPattern.matcher(currentWord);
    if (word.find()) {
      numWords=numWords + 1;
      if (currentWord.length() > 6) {
        sixltr=sixltr + 1;
      }
    }
    boolean treatAsOne=true;
    Matcher dh=doubleHyphenPattern.matcher(currentWord);
    if (dh.find()) {
      currentWord=currentWord.replaceFirst("String_Node_Str","String_Node_Str").toLowerCase();
      if (categorizer.query(currentWord) != null && !categorizer.checkHyphen(currentWord)) {
        Object value=map.get(currentWord);
        if (value != null) {
          int i=((Integer)value).intValue();
          map.put(currentWord,i + 1);
        }
 else {
          map.put(currentWord,1);
        }
        String[] words=currentWord.split("String_Node_Str",2);
        int hyphened=words.length;
        weirdDashCount=weirdDashCount + hyphened;
      }
 else {
        String[] words=currentWord.split("String_Node_Str",2);
        int hyphened=words.length - 1;
        if (categorizer.query(currentWord) != null) {
          Object value=map.get(currentWord);
          if (value != null) {
            int i=((Integer)value).intValue();
            map.put(words[0],i + 1);
          }
 else {
            map.put(words[0],1);
          }
          numWords=numWords + hyphened;
          treatAsOne=true;
        }
 else {
          numWords=numWords + hyphened;
          if (categorizer.query(words[0]) != null) {
            Object value=map.get(words[0]);
            if (value != null) {
              int i=((Integer)value).intValue();
              map.put(words[0],i + 1);
            }
 else {
              map.put(words[0],1);
            }
          }
          treatAsOne=false;
        }
        if (treatAsOne)         weirdDashCount++;
 else         weirdDashCount=weirdDashCount + hyphened;
      }
    }
 else {
      Matcher cm=compoundPattern.matcher(currentWord);
      if (cm.find()) {
        String[] words=currentWord.split("String_Node_Str");
        int hyphened=-1;
        for (        String s : words) {
          if (s == null || s.equals("String_Node_Str"))           continue;
          hyphened++;
        }
        if (categorizer.query(currentWord.toLowerCase()) == null) {
          numWords=numWords + hyphened;
          treatAsOne=false;
        }
 else         weirdDashCount=weirdDashCount + 1;
      }
      if (treatAsOne) {
        Object value=map.get(currentWord);
        if (value != null) {
          int i=((Integer)value).intValue();
          map.put(currentWord,i + 1);
        }
 else {
          map.put(currentWord,1);
        }
      }
 else {
        String[] parts=currentWord.split("String_Node_Str");
        for (        String part : parts) {
          if (part == null || part.equals("String_Node_Str"))           continue;
          Object value=map.get(part);
          if (value != null) {
            int i=((Integer)value).intValue();
            map.put(part,i + 1);
          }
 else {
            map.put(part,1);
          }
        }
      }
    }
    currentWord=nextWord;
  }
 while (st.hasMoreTokens() || null != currentWord);
  ret[0]=numWords;
  ret[1]=sixltr;
  ret[2]=numerals;
  return ret;
}

Fixed version (ground truth):
public int[] process(String line,HashMap<String,Integer> map){
  int ret[]=new int[3];
  int numWords=0;
  int sixltr=0;
  int numerals=0;
  Matcher matcher=pattern.matcher(line);
  if (doLower)   line=line.toLowerCase();
  if (phraseDetect) {
    for (    String key : phraseLookup.keySet()) {
      Pattern p, justp;
      if (key.endsWith("String_Node_Str")) {
        p=Pattern.compile("String_Node_Str" + key + "String_Node_Str");
        justp=Pattern.compile(key + "String_Node_Str");
        key=key.substring(0,key.length() - 1);
      }
 else {
        p=Pattern.compile("String_Node_Str" + key + "String_Node_Str");
        justp=Pattern.compile(key + "String_Node_Str");
      }
      int wordsInPhrase=key.split("String_Node_Str").length;
      Matcher m=p.matcher(line);
      ArrayList<Integer> indexes=new ArrayList<Integer>();
      while (m.find()) {
        String match=m.group();
        indexes.add(m.start() + 1);
        indexes.add(m.end());
        numWords=numWords + wordsInPhrase;
        sixltr=sixltr + bigWords(match);
        Object value=map.get(key);
        if (value != null) {
          int i=((Integer)value).intValue();
          map.put(key,i + wordsInPhrase);
        }
 else {
          map.put(key,wordsInPhrase);
        }
      }
      for (int i=0; i < indexes.size(); i=i + 2) {
        line=line.substring(0,indexes.get(i)) + line.substring(indexes.get(i + 1));
        int diff=indexes.get(i + 1) - indexes.get(i);
        for (int j=0; j < indexes.size(); j++)         indexes.set(j,indexes.get(j) - diff);
      }
      indexes.clear();
      Matcher m2=justp.matcher(line);
      while (m2.find()) {
        String match=m2.group();
        indexes.add(m2.start());
        indexes.add(m2.end());
        numWords=numWords + wordsInPhrase;
        sixltr=sixltr + bigWords(match);
        Object value=map.get(key);
        if (value != null) {
          int i=((Integer)value).intValue();
          map.put(key,i + wordsInPhrase);
        }
 else {
          map.put(key,wordsInPhrase);
        }
      }
      for (int i=0; i < indexes.size(); i=i + 2) {
        line=line.substring(0,indexes.get(i)) + line.substring(indexes.get(i + 1));
        int diff=indexes.get(i + 1) - indexes.get(i);
        for (int j=0; j < indexes.size(); j++)         indexes.set(j,indexes.get(j) - diff);
      }
    }
  }
  StringTokenizer st=new StringTokenizer(line,delimiters);
  String currentWord=null;
  if (st.hasMoreTokens())   currentWord=trimChars(st.nextToken(),punctuations);
  do {
    String nextWord=null;
    if (st.hasMoreTokens())     nextWord=trimChars(st.nextToken(),punctuations);
    if (currentWord == null || currentWord.equals("String_Node_Str")) {
      currentWord=nextWord;
      continue;
    }
    matcher=pattern.matcher(currentWord);
    while (matcher.find()) {
      numerals++;
    }
    if (doSnowballStemming) {
      stemmer.setCurrent(currentWord);
      String stemmedWord="String_Node_Str";
      if (stemmer.stem())       stemmedWord=stemmer.getCurrent();
      if (!stemmedWord.equals("String_Node_Str"))       currentWord=stemmedWord;
    }
    if (doStopWords)     if (stopWordSet.contains(currentWord)) {
      currentWord=nextWord;
      continue;
    }
    Matcher word=regularPattern.matcher(currentWord);
    if (word.find()) {
      numWords=numWords + 1;
      if (currentWord.length() > 6) {
        sixltr=sixltr + 1;
      }
    }
    boolean treatAsOne=true;
    Matcher dh=doubleHyphenPattern.matcher(currentWord);
    if (dh.find()) {
      currentWord=currentWord.replaceFirst("String_Node_Str","String_Node_Str").toLowerCase();
      if (categorizer.query(currentWord) != null && !categorizer.checkHyphen(currentWord)) {
        Object value=map.get(currentWord);
        if (value != null) {
          int i=((Integer)value).intValue();
          map.put(currentWord,i + 1);
        }
 else {
          map.put(currentWord,1);
        }
        String[] words=currentWord.split("String_Node_Str",2);
        int hyphened=words.length;
        weirdDashCount=weirdDashCount + hyphened;
      }
 else {
        String[] words=currentWord.split("String_Node_Str",2);
        int hyphened=words.length - 1;
        if (categorizer.query(currentWord) != null) {
          Object value=map.get(currentWord);
          if (value != null) {
            int i=((Integer)value).intValue();
            map.put(words[0],i + 1);
          }
 else {
            map.put(words[0],1);
          }
          numWords=numWords + hyphened;
          treatAsOne=true;
        }
 else {
          numWords=numWords + hyphened;
          if (categorizer.query(words[0]) != null) {
            Object value=map.get(words[0]);
            if (value != null) {
              int i=((Integer)value).intValue();
              map.put(words[0],i + 1);
            }
 else {
              map.put(words[0],1);
            }
          }
          treatAsOne=false;
        }
        if (treatAsOne)         weirdDashCount++;
 else         weirdDashCount=weirdDashCount + hyphened;
      }
    }
 else {
      Matcher cm=compoundPattern.matcher(currentWord);
      if (cm.find()) {
        String[] words=currentWord.split("String_Node_Str");
        int hyphened=-1;
        for (        String s : words) {
          if (s == null || s.equals("String_Node_Str"))           continue;
          hyphened++;
        }
        if (categorizer.query(currentWord.toLowerCase()) == null) {
          numWords=numWords + hyphened;
          treatAsOne=false;
        }
 else         weirdDashCount=weirdDashCount + 1;
      }
      if (treatAsOne) {
        Object value=map.get(currentWord);
        if (value != null) {
          int i=((Integer)value).intValue();
          map.put(currentWord,i + 1);
        }
 else {
          map.put(currentWord,1);
        }
      }
 else {
        String[] parts=currentWord.split("String_Node_Str");
        for (        String part : parts) {
          if (part == null || part.equals("String_Node_Str"))           continue;
          Object value=map.get(part);
          if (value != null) {
            int i=((Integer)value).intValue();
            map.put(part,i + 1);
          }
 else {
            map.put(part,1);
          }
        }
      }
    }
    currentWord=nextWord;
  }
 while (st.hasMoreTokens() || null != currentWord);
  ret[0]=numWords;
  ret[1]=sixltr;
  ret[2]=numerals;
  return ret;
}