nus-yam/ex-repair huggingface dataset:
Program: 52724
Project: 52724
Buggy source:
@Test public void extractFromOflazerAnalysisResult() throws IOException {
  Path inPath=DATA_PATH.resolve("String_Node_Str").resolve("String_Node_Str");
  List<String> lines=Files.readAllLines(inPath,StandardCharsets.UTF_8);
  Log.info("String_Node_Str");
  List<String> accepted=new ArrayList<>(lines.size() / 5);
  for (  String line : lines) {
    if (line.trim().length() == 0 || line.endsWith("String_Node_Str")) {
      continue;
    }
    accepted.add(line.substring(0,line.indexOf('\t')));
  }
  sortAndSave(DATA_PATH.resolve("String_Node_Str").resolve("String_Node_Str"),accepted);
}

Fixed version (ground truth):
@Test public void extractFromOflazerAnalysisResult() throws IOException {
  Path inPath=DATA_PATH.resolve("String_Node_Str").resolve("String_Node_Str");
  List<String> lines=Files.readAllLines(inPath,StandardCharsets.UTF_8);
  Log.info("String_Node_Str");
  LinkedHashSet<String> accepted=new LinkedHashSet<>(lines.size() / 5);
  for (  String line : lines) {
    if (line.trim().length() == 0 || line.endsWith("String_Node_Str")) {
      continue;
    }
    accepted.add(line.substring(0,line.indexOf('\t')));
  }
  sortAndSave(DATA_PATH.resolve("String_Node_Str").resolve("String_Node_Str"),new ArrayList<>(accepted));
}
Program: 52725
Project: 52725
Buggy source:
public TurkishMorphParserBuilder addTextDictResources(String... resources) throws IOException {
  List<String> lines=new ArrayList<>();
  for (  String resource : resources) {
    lines.addAll(Resources.readLines(Resources.getResource(resource),Charsets.UTF_8));
  }
  lexicon.addAll(new TurkishDictionaryLoader(suffixProvider).load(lines));
  return this;
}

Fixed version (ground truth):
public TurkishMorphParserBuilder addTextDictResources(String... resources) throws IOException {
  Log.info("String_Node_Str");
  List<String> lines=new ArrayList<>();
  for (  String resource : resources) {
    lines.addAll(Resources.readLines(Resources.getResource(resource),Charsets.UTF_8));
  }
  lexicon.addAll(new TurkishDictionaryLoader(suffixProvider).load(lines));
  Log.info("String_Node_Str");
  return this;
}
Program: 52726
Project: 52726
Buggy source:
void split(String full,int start,int end,LinkedList<String> buffer,List<String> results,boolean findSingle){
  while (end <= full.length()) {
    String sub=full.substring(start,end);
    if (check(sub)) {
      if (end == full.length()) {
        if (buffer.size() < maxTokenCount) {
          results.add(Joiner.on("String_Node_Str").join(buffer) + "String_Node_Str" + sub);
          if (findSingle) {
            return;
          }
        }
      }
 else {
        buffer.add(sub);
        start=end;
        end=start + 1;
        break;
      }
    }
    end++;
  }
  if (end > full.length()) {
    if (buffer.size() == 0 || start == 0)     return;
    String last=buffer.removeLast();
    start=start - last.length();
    end=start + last.length() + 1;
  }
  split(full,start,end,buffer,results,findSingle);
}

Fixed version (ground truth):
void split(String full,int start,int end,LinkedList<String> buffer,List<String> results,boolean findSingle){
  while (end <= full.length()) {
    String sub=full.substring(start,end);
    if (check(sub)) {
      if (end == full.length()) {
        if (buffer.size() < maxTokenCount) {
          if (buffer.size() == 0)           results.add(sub);
 else           results.add(Joiner.on("String_Node_Str").join(buffer) + "String_Node_Str" + sub);
          if (findSingle) {
            return;
          }
        }
      }
 else {
        buffer.add(sub);
        start=end;
        end=start + 1;
        break;
      }
    }
    end++;
  }
  if (end > full.length()) {
    if (buffer.size() == 0 || start == 0)     return;
    String last=buffer.removeLast();
    start=start - last.length();
    end=start + last.length() + 1;
  }
  split(full,start,end,buffer,results,findSingle);
}
Program: 52727
Project: 52727
Buggy source:
public WordSetSegmenter(Collection<String> words){
  this.words=new HashSet<>(words);
}

Fixed version (ground truth):
public WordSetSegmenter(String... words){
  this.words=new HashSet<>(Arrays.asList(words));
}
Program: 52728
Project: 52728
Buggy source:
public String findFirst(String textToSegment){
  if (textToSegment.length() == 0)   return null;
  List<String> results=new ArrayList<>(2);
  LinkedList<String> buffer=new LinkedList<>();
  split(textToSegment,0,1,buffer,results,false);
  if (results.size() == 1)   return results.get(0);
 else   return null;
}

Fixed version (ground truth):
public String findFirst(String textToSegment){
  if (textToSegment.length() == 0)   return null;
  List<String> results=new ArrayList<>(2);
  LinkedList<String> buffer=new LinkedList<>();
  split(textToSegment,0,1,buffer,results,false);
  if (results.size() > 0)   return results.get(0);
 else   return null;
}
Program: 52729
Project: 52729
Buggy source:
@Test public void testNormalize16bitLittleEndian(){
  byte[] ba={0x10,0x71,0x18,0x54};
  float[] da=FloatArrays.normalize16bitLittleEndian(ba);
  Assert.assertEquals(da[0] * Short.MAX_VALUE,28944f,0.0001);
  Assert.assertEquals(da[1] * Short.MAX_VALUE,21528f,0.0001);
  byte[] ba2=FloatArrays.denormalize16BitLittleEndian(da);
  Assert.assertEquals(ba2[0],0x10);
  Assert.assertEquals(ba2[3],0x54);
  byte[] ba3=FloatArrays.denormalizeLittleEndian(da,16);
  Assert.assertEquals(ba3[0],0x10);
  Assert.assertEquals(ba3[3],0x54);
  byte[] ba4={(byte)0xCC,(byte)0xAB};
  da=FloatArrays.normalize16bitLittleEndian(ba4);
  Assert.assertEquals(da[0] * Short.MIN_VALUE,21556f);
}

Fixed version (ground truth):
@Test public void testNormalize16bitLittleEndian(){
  byte[] ba={0x10,0x71,0x18,0x54};
  float[] da=FloatArrays.normalize16bitLittleEndian(ba);
  Assert.assertEquals(da[0] * Short.MAX_VALUE,28944f,0.0001);
  Assert.assertEquals(da[1] * Short.MAX_VALUE,21528f,0.0001);
  byte[] ba2=FloatArrays.denormalize16BitLittleEndian(da);
  Assert.assertEquals(ba2[0],0x10);
  Assert.assertEquals(ba2[3],0x54);
  byte[] ba3=FloatArrays.denormalizeLittleEndian(da,16);
  Assert.assertEquals(ba3[0],0x10);
  Assert.assertEquals(ba3[3],0x54);
  byte[] ba4={(byte)0xCC,(byte)0xAB};
  da=FloatArrays.normalize16bitLittleEndian(ba4);
  Assert.assertEquals(da[0] * Short.MIN_VALUE,21556f,0.0001);
}
Program: 52730
Project: 52730
Buggy source:
@Test public void testLog2(){
  Assert.assertEquals(2,(int)LogMath.log2(4));
  Assert.assertEquals(3,(int)LogMath.log2(8));
  Assert.assertEquals(-1,(int)LogMath.log2(0.5));
}

Fixed version (ground truth):
@Test public void testLog2(){
  Assert.assertEquals(2,LogMath.log2(4),0.0001);
  Assert.assertEquals(3,LogMath.log2(8),0.0001);
  Assert.assertEquals(10,LogMath.log2(1024),0.0001);
  Assert.assertEquals(-1,LogMath.log2(0.5),0.0001);
}
Program: 52731
Project: 52731
Buggy source:
@Test public void logSumErrorFloat() throws IOException {
  int VALS=10000000;
  float[] logA=new float[VALS];
  for (int a=0; a < VALS; a++) {
    if (a == 0)     logA[a]=LogMath.LOG_ZERO_FLOAT;
 else     logA[a]=(float)Math.log((double)a / VALS);
  }
  Stopwatch sw=Stopwatch.createStarted();
  float maxError=0;
  float a=0;
  float b=0;
  for (int i=0; i < logA.length; i++) {
    float la=logA[i];
    float lb=logA[logA.length - i - 1];
    float exact=(float)LogMath.logSum(la,lb);
    float approx=LogMath.LOG_SUM_FLOAT.lookup(la,lb);
    float error=Math.abs(exact - approx);
    if (error > maxError) {
      maxError=error;
      a=la;
      b=lb;
    }
  }
  System.out.println("String_Node_Str" + maxError);
  System.out.println("String_Node_Str" + a + "String_Node_Str"+ b);
  Assert.assertTrue(maxError < 0.0005);
  System.out.println(sw.elapsed(TimeUnit.MILLISECONDS));
  sw.stop();
}

Fixed version (ground truth):
@Test public void logSumErrorFloat() throws IOException {
  int VALS=10000000;
  float[] logA=new float[VALS];
  for (int a=0; a < VALS; a++) {
    if (a == 0)     logA[a]=LogMath.LOG_ZERO_FLOAT;
 else     logA[a]=(float)Math.log((double)a / VALS);
  }
  Stopwatch sw=Stopwatch.createStarted();
  float maxError=0;
  float a=0;
  float b=0;
  for (int i=0; i < logA.length; i++) {
    float la=logA[i];
    float lb=logA[logA.length - i - 1];
    float exact=(float)LogMath.logSum(la,lb);
    float approx=LogMath.LOG_SUM_FLOAT.lookup(la,lb);
    float error=Math.abs(exact - approx);
    if (error > maxError) {
      maxError=error;
      a=la;
      b=lb;
    }
  }
  System.out.println("String_Node_Str" + maxError);
  System.out.println("String_Node_Str" + a + "String_Node_Str"+ b);
  Assert.assertTrue(maxError < 0.007);
  System.out.println(sw.elapsed(TimeUnit.MILLISECONDS));
  sw.stop();
}
Program: 52733
Project: 52733
Buggy source:
public void run() throws IOException {
  TurkishWordParserGenerator parser=TurkishWordParserGenerator.createWithDefaults();
  String input;
  System.out.println("String_Node_Str");
  Scanner sc=new Scanner(System.in);
  input=sc.nextLine();
  while (!input.equals("String_Node_Str") && !input.equals("String_Node_Str")) {
    List<MorphParse> tokens=parser.parse(input);
    if (tokens.size() == 0) {
      System.out.println("String_Node_Str");
      if (parser.getParser() instanceof WordParser) {
        ((WordParser)parser.getParser()).dump(input);
      }
    }
 else {
      tokens.forEach(this::printMorphParse);
    }
    input=sc.nextLine();
  }
}

Fixed version (ground truth):
public void run(TurkishWordParserGenerator parser) throws IOException {
  String input;
  System.out.println("String_Node_Str");
  Scanner sc=new Scanner(System.in);
  input=sc.nextLine();
  while (!input.equals("String_Node_Str") && !input.equals("String_Node_Str")) {
    List<MorphParse> tokens=parser.parse(input);
    if (tokens.size() == 0) {
      System.out.println("String_Node_Str");
      if (parser.getParser() instanceof WordParser) {
        ((WordParser)parser.getParser()).dump(input);
      }
    }
 else {
      tokens.forEach(this::printMorphParse);
    }
    input=sc.nextLine();
  }
}
Program: 52734
Project: 52734
Buggy source:
public static void main(String[] args) throws IOException {
  new ParseConsole().run();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  new ParseConsole().run(TurkishWordParserGenerator.createWithDefaults());
}
Program: 52735
Project: 52735
Buggy source:
public static void main(String[] args) throws IOException {
  new DevlParseConsole().doit();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  new ParseConsole().run(TurkishWordParserGenerator.builder().addTextDictFiles(new File(Resources.getResource("String_Node_Str").getFile())).build());
}
Program: 52736
Project: 52736
Buggy source:
/** 
 * Returns list of all root and derivational roots of a parse. Examples: "kitaplar"  ->["kitap"] "kitabım"   ->["kitap"] "kitaplaşır"->["kitap", "kitaplaş"] "kitaplaş"  ->["kitap", "kitaplaş"] "arattıragörür" -> ["ara","arat","arattır","arattıragör"]
 */
public List<String> getLemmas(){
  List<String> stems=Lists.newArrayListWithCapacity(2);
  stems.add(dictionaryItem.root);
  String previousStem=stems.get(0);
  if (inflectionalGroups.size() > 1) {
    previousStem=previousStem + inflectionalGroups.get(0).surfaceForm();
    for (int i=1; i < inflectionalGroups.size(); i++) {
      InflectionalGroup ig=inflectionalGroups.get(i);
      SuffixData suffixData=ig.suffixList.get(0);
      if (suffixData.surface.length() > 0) {
        String surface=suffixData.surface;
        if (suffixData.lex.endsWith("String_Node_Str")) {
          surface=surface.substring(0,surface.length() - 1) + "String_Node_Str";
        }
        String stem=previousStem + surface;
        if (!stems.contains(stem))         stems.add(stem);
      }
      previousStem=previousStem + ig.surfaceForm();
    }
  }
  return stems;
}

Fixed version (ground truth):
/** 
 * Returns list of all lemmas of a parse.  Examples: "kitaplar"  ->["kitap"] "kitabım"   ->["kitap"] "kitaplaşır"->["kitap", "kitaplaş"] "kitaplaş"  ->["kitap", "kitaplaş"] "arattıragörür" -> ["ara","arat","arattır","arattıragör"]
 */
public List<String> getLemmas(){
  List<String> lemmas=Lists.newArrayListWithCapacity(2);
  lemmas.add(dictionaryItem.root);
  String previousStem=root;
  if (inflectionalGroups.size() > 1) {
    previousStem=previousStem + inflectionalGroups.get(0).surfaceForm();
    for (int i=1; i < inflectionalGroups.size(); i++) {
      InflectionalGroup ig=inflectionalGroups.get(i);
      SuffixData suffixData=ig.suffixList.get(0);
      if (suffixData.surface.length() > 0) {
        String surface=suffixData.surface;
        if (suffixData.lex.endsWith("String_Node_Str")) {
          surface=surface.substring(0,surface.length() - 1) + "String_Node_Str";
        }
        String stem=previousStem + surface;
        if (!lemmas.contains(stem))         lemmas.add(stem);
      }
      previousStem=previousStem + ig.surfaceForm();
    }
  }
  return lemmas;
}
Program: 52737
Project: 52737
Buggy source:
@Test public void getLemmasTest(){
  SimpleParser parser=getParser("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  String[] testSet={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String[][] expected={{"String_Node_Str","String_Node_Str"},{"String_Node_Str"},{"String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}};
  int i=0;
  for (  String s : testSet) {
    List<MorphParse> results=parser.parse(s);
    MorphParse res=results.get(0);
    List<String> expStems=Lists.newArrayList(expected[i]);
    MatcherAssert.assertThat(res.getLemmas(),equalTo(expStems));
    i++;
  }
}

Fixed version (ground truth):
@Test public void getLemmasTest(){
  SimpleParser parser=getParser("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  String[] testSet={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String[][] expected={{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str"},{"String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  int i=0;
  for (  String s : testSet) {
    List<MorphParse> results=parser.parse(s);
    MorphParse res=results.get(0);
    List<String> expStems=Lists.newArrayList(expected[i]);
    MatcherAssert.assertThat(res.getLemmas(),equalTo(expStems));
    i++;
  }
}
Program: 52738
Project: 52738
Buggy source:
public List<MorphParse> parse(String word){
  if (cache != null) {
    List<MorphParse> result=cache.parse(word);
    return result != null ? result : parser.parse(word);
  }
  return parser.parse(word);
}

Fixed version (ground truth):
public List<MorphParse> parse(String word){
  word=normalize(word);
  if (cache != null) {
    List<MorphParse> result=cache.parse(word);
    return result != null ? result : parser.parse(word);
  }
  return parser.parse(word);
}
Program: 52739
Project: 52739
Buggy source:
/** 
 * Returns list of all lemmas of a parse.  Examples: "kitaplar"  ->["kitap"] "kitabım"   ->["kitap"] "kitaplaşır"->["kitap", "kitaplaş"] "kitaplaş"  ->["kitap", "kitaplaş"] "arattıragörür" -> ["ara","arat","arattır","arattıragör"]
 */
public List<String> getLemmas(){
  List<String> lemmas=Lists.newArrayListWithCapacity(2);
  lemmas.add(dictionaryItem.root);
  String previousStem=root;
  if (inflectionalGroups.size() > 1) {
    previousStem=previousStem + inflectionalGroups.get(0).surfaceForm();
    for (int i=1; i < inflectionalGroups.size(); i++) {
      InflectionalGroup ig=inflectionalGroups.get(i);
      SuffixData suffixData=ig.suffixList.get(0);
      if (suffixData.surface.length() > 0) {
        String surface=suffixData.surface;
        if (suffixData.lex.endsWith("String_Node_Str")) {
          surface=surface.substring(0,surface.length() - 1) + "String_Node_Str";
        }
        String stem=previousStem + surface;
        if (!lemmas.contains(stem))         lemmas.add(stem);
      }
      previousStem=previousStem + ig.surfaceForm();
    }
  }
  return lemmas;
}

Fixed version (ground truth):
/** 
 * Returns list of all lemmas of a parse. Examples: "kitaplar"  ->["kitap"] "kitabım"   ->["kitap"] "kitaplaşır"->["kitap", "kitaplaş"] "kitaplaş"  ->["kitap", "kitaplaş"] "arattıragörür" -> ["ara","arat","arattır","arattıragör"]
 */
public List<String> getLemmas(){
  List<String> lemmas=Lists.newArrayListWithCapacity(2);
  lemmas.add(dictionaryItem.root);
  String previousStem=root;
  if (inflectionalGroups.size() > 1) {
    previousStem=previousStem + inflectionalGroups.get(0).surfaceForm();
    for (int i=1; i < inflectionalGroups.size(); i++) {
      InflectionalGroup ig=inflectionalGroups.get(i);
      SuffixData suffixData=ig.suffixList.get(0);
      if (suffixData.surface.length() > 0) {
        String surface=suffixData.surface;
        if (suffixData.lex.endsWith("String_Node_Str")) {
          surface=surface.substring(0,surface.length() - 1) + "String_Node_Str";
        }
        String stem=previousStem + surface;
        if (!lemmas.contains(stem))         lemmas.add(stem);
      }
      previousStem=previousStem + ig.surfaceForm();
    }
  }
  return lemmas;
}
Program: 52740
Project: 52740
Buggy source:
@Test @Ignore("String_Node_Str") public void shouldParse8MWords() throws Exception {
  final List<File> files=Arrays.asList(new File("String_Node_Str"),new File("String_Node_Str"),new File("String_Node_Str"),new File("String_Node_Str"),new File("String_Node_Str"));
  final LinkedList<String> words=new LinkedList<>();
  final HashSet<String> uniqueWords=new HashSet<>();
  for (  File tokenizedFile : files) {
    final List<String> lines=Files.readLines(tokenizedFile,Charsets.UTF_8);
    for (    String line : lines) {
      final ArrayList<String> strings=Lists.newArrayList(Splitter.on("String_Node_Str").trimResults().omitEmptyStrings().split(line));
      words.addAll(strings);
      uniqueWords.addAll(strings);
    }
  }
  System.out.println("String_Node_Str" + words.size());
  System.out.println("String_Node_Str" + uniqueWords.size());
  System.out.println("String_Node_Str");
  final TurkishMorphParser parser=TurkishMorphParser.newBuilder().addDefaultDictionaries().addDefaultCache().build();
  final Stopwatch stopWatch=new Stopwatch();
  stopWatch.start();
  int i=0;
  for (  String word : words) {
    parser.parse(word);
    if (++i % 500 == 0)     System.out.println("String_Node_Str" + i);
  }
  stopWatch.stop();
  System.out.println("String_Node_Str" + stopWatch.toString());
  System.out.println("String_Node_Str" + words.size());
  System.out.println("String_Node_Str" + (stopWatch.elapsed(TimeUnit.MILLISECONDS) * 1.0) / (words.size() * 1.0d) + "String_Node_Str");
}

Fixed version (ground truth):
@Test @Ignore("String_Node_Str") public void shouldParse8MWords() throws Exception {
  final List<File> files=Arrays.asList(new File("String_Node_Str"),new File("String_Node_Str"),new File("String_Node_Str"),new File("String_Node_Str"),new File("String_Node_Str"));
  final LinkedList<String> words=new LinkedList<>();
  final HashSet<String> uniqueWords=new HashSet<>();
  for (  File tokenizedFile : files) {
    final List<String> lines=Files.readLines(tokenizedFile,Charsets.UTF_8);
    for (    String line : lines) {
      final ArrayList<String> strings=Lists.newArrayList(Splitter.on("String_Node_Str").trimResults().omitEmptyStrings().split(line));
      words.addAll(strings);
      uniqueWords.addAll(strings);
    }
  }
  System.out.println("String_Node_Str" + words.size());
  System.out.println("String_Node_Str" + uniqueWords.size());
  System.out.println("String_Node_Str");
  final TurkishMorphParser parser=TurkishMorphParser.builder().addDefaultDictionaries().addDefaultCache().build();
  final Stopwatch stopWatch=new Stopwatch();
  stopWatch.start();
  int i=0;
  for (  String word : words) {
    parser.parse(word);
    if (++i % 500 == 0)     System.out.println("String_Node_Str" + i);
  }
  stopWatch.stop();
  System.out.println("String_Node_Str" + stopWatch.toString());
  System.out.println("String_Node_Str" + words.size());
  System.out.println("String_Node_Str" + (stopWatch.elapsed(TimeUnit.MILLISECONDS) * 1.0) / (words.size() * 1.0d) + "String_Node_Str");
}
Program: 52741
Project: 52741
Buggy source:
@Test public void shouldCreateTurkishMorphParserSuccessfully() throws IOException {
  TurkishMorphParser parser=TurkishMorphParser.newBuilder().addDefaultDictionaries().build();
  List<MorphParse> results=parser.parse("String_Node_Str");
  for (  MorphParse result : results) {
    System.out.println(result.formatNoEmpty());
    System.out.println(result.formatLong());
  }
}

Fixed version (ground truth):
@Test public void shouldCreateTurkishMorphParserSuccessfully() throws IOException {
  TurkishMorphParser parser=TurkishMorphParser.builder().addDefaultDictionaries().build();
  List<MorphParse> results=parser.parse("String_Node_Str");
  for (  MorphParse result : results) {
    System.out.println(result.formatNoEmpty());
    System.out.println(result.formatLong());
  }
}
Program: 52742
Project: 52742
Buggy source:
@Before public void setUp() throws Exception {
  TurkishMorphParser morphParser=TurkishMorphParser.newBuilder().addDefaultDictionaries().build();
  parser=new TurkishSentenceParser(morphParser,new Z3MarkovModelDisambiguator());
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  TurkishMorphParser morphParser=TurkishMorphParser.builder().addDefaultDictionaries().build();
  parser=new TurkishSentenceParser(morphParser,new Z3MarkovModelDisambiguator());
}
Program: 52743
Project: 52743
Buggy source:
@Test public void shouldCreateUnidentifiedTokenParserSuccessfully() throws IOException {
  TurkishMorphParser parser=null;
  UnidentifiedTokenParser uiParser=new UnidentifiedTokenParser(parser);
  List<MorphParse> results=uiParser.parse("String_Node_Str");
  for (  MorphParse result : results) {
    System.out.println(result);
  }
}

Fixed version (ground truth):
@Test public void shouldCreateUnidentifiedTokenParserSuccessfully() throws IOException {
  TurkishMorphParser parser=TurkishMorphParser.createWithDefaults();
  UnidentifiedTokenParser uiParser=new UnidentifiedTokenParser(parser);
  List<MorphParse> results=uiParser.parse("String_Node_Str");
  for (  MorphParse result : results) {
    System.out.println(result);
  }
}
Program: 52744
Project: 52744
Buggy source:
public boolean contains(T key){
  return locate(key) > 0;
}

Fixed version (ground truth):
public boolean contains(T key){
  return locate(key) >= 0;
}
Program: 52745
Project: 52745
Buggy source:
public boolean contains(T key){
  return locate(key) > 0;
}

Fixed version (ground truth):
public boolean contains(T key){
  return locate(key) >= 0;
}
Program: 52746
Project: 52746
Buggy source:
public static void log(Level level,String message,Object... params){
  final int stackPositionOfCaller=2;
  StackTraceElement caller=new Throwable().getStackTrace()[stackPositionOfCaller];
  String className=caller.getClassName();
  Logger logger;
  logger=loggers.get(className);
  if (logger == null) {
    logger=Logger.getLogger(className);
    loggers.putIfAbsent(className,logger);
  }
  if (logger.isLoggable(level)) {
    String formattedMessage;
    Throwable thrown=null;
    if (params.length == 0) {
      formattedMessage=message;
    }
 else {
      Object last=params[params.length - 1];
      if (last instanceof Throwable) {
        Object[] subParams=new Object[params.length - 1];
        System.arraycopy(params,0,subParams,0,subParams.length);
        formattedMessage=String.format(message,subParams);
        thrown=(Throwable)last;
      }
 else {
        formattedMessage=String.format(message,params);
      }
    }
    LogRecord record=new LogRecord(level,formattedMessage);
    record.setLoggerName(logger.getName());
    record.setSourceClassName(className);
    record.setSourceMethodName(caller.getMethodName());
    record.setThrown(thrown);
    record.setParameters(params);
    logger.log(record);
  }
}

Fixed version (ground truth):
public static void log(Level level,String message,Object... params){
  final int stackPositionOfCaller=2;
  StackTraceElement caller=new Throwable().getStackTrace()[stackPositionOfCaller];
  String className=caller.getClassName();
  Logger logger;
  logger=loggers.get(className);
  if (logger == null) {
    logger=Logger.getLogger(className);
    loggers.putIfAbsent(className,logger);
    logger.setLevel(currentLevel);
  }
  if (logger.isLoggable(level)) {
    String formattedMessage;
    Throwable thrown=null;
    if (params.length == 0) {
      formattedMessage=message;
    }
 else {
      Object last=params[params.length - 1];
      if (last instanceof Throwable) {
        Object[] subParams=new Object[params.length - 1];
        System.arraycopy(params,0,subParams,0,subParams.length);
        formattedMessage=String.format(message,subParams);
        thrown=(Throwable)last;
      }
 else {
        formattedMessage=String.format(message,params);
      }
    }
    LogRecord record=new LogRecord(level,formattedMessage);
    record.setLoggerName(logger.getName());
    record.setSourceClassName(className);
    record.setSourceMethodName(caller.getMethodName());
    record.setThrown(thrown);
    record.setParameters(params);
    logger.log(record);
  }
}
Program: 52747
Project: 52747
Buggy source:
public static void setInfo(){
  for (  Logger logger : loggers.values()) {
    logger.setLevel(Level.INFO);
  }
}

Fixed version (ground truth):
public static void setInfo(){
  setLevel(Level.INFO);
}
Program: 52748
Project: 52748
Buggy source:
public static void setDebug(){
  for (  Logger logger : loggers.values()) {
    logger.setLevel(Level.FINE);
  }
}

Fixed version (ground truth):
public static void setDebug(){
  setLevel(Level.FINE);
}
Program: 52749
Project: 52749
Buggy source:
DoubleValueSet<String> decode(String input){
  Hypothesis hyp=new Hypothesis(null,root,0,Operation.N_A);
  DoubleValueSet<String> hypotheses=new DoubleValueSet<>(3);
  Set<Hypothesis> next=expand(hyp,input,hypotheses);
  while (true) {
    HashSet<Hypothesis> newHyps=new HashSet<>();
    for (    Hypothesis hypothesis : next) {
      newHyps.addAll(expand(hypothesis,input,hypotheses));
    }
    if (newHyps.size() == 0)     break;
    next=newHyps;
  }
  return hypotheses;
}

Fixed version (ground truth):
DoubleValueSet<String> decode(String input){
  Hypothesis hyp=new Hypothesis(null,root,0,Operation.N_A);
  DoubleValueSet<String> hypotheses=new DoubleValueSet<>();
  Set<Hypothesis> next=expand(hyp,input,hypotheses);
  while (true) {
    HashSet<Hypothesis> newHyps=new HashSet<>();
    if (Log.isDebug())     Log.info("String_Node_Str");
    for (    Hypothesis hypothesis : next) {
      if (Log.isDebug())       Log.info("String_Node_Str",hypothesis);
      newHyps.addAll(expand(hypothesis,input,hypotheses));
    }
    if (newHyps.size() == 0)     break;
    next=newHyps;
  }
  return hypotheses;
}
Program: 52750
Project: 52750
Buggy source:
void addHypothesis(DoubleValueSet<String> result,Hypothesis hypothesis){
  String hypWord=hypothesis.node.word;
  if (hypWord == null)   return;
  if (!result.contains(hypWord)) {
    result.set(hypWord,hypothesis.penalty);
  }
 else   if (result.get(hypWord) > hypothesis.penalty) {
    result.set(hypWord,hypothesis.penalty);
  }
}

Fixed version (ground truth):
void addHypothesis(DoubleValueSet<String> result,Hypothesis hypothesis){
  String hypWord=hypothesis.node.word;
  if (hypWord == null) {
    if (Log.isDebug())     Log.info("String_Node_Str",hypothesis.toString());
    return;
  }
  if (!result.contains(hypWord)) {
    result.set(hypWord,hypothesis.penalty);
    if (Log.isDebug())     Log.info("String_Node_Str",hypWord,hypothesis.toString());
  }
 else   if (result.get(hypWord) > hypothesis.penalty) {
    result.set(hypWord,hypothesis.penalty);
    if (Log.isDebug())     Log.info("String_Node_Str",hypWord,hypothesis.toString());
  }
}
Program: 52751
Project: 52751
Buggy source:
@Test public void singleWordDictionaryTest2(){
  SingleWordSpellChecker spellChecker=new SingleWordSpellChecker(1);
  spellChecker.addWord("String_Node_Str");
  spellChecker.addWord("String_Node_Str");
  spellChecker.addWord("String_Node_Str");
  spellChecker.addWord("String_Node_Str");
  DoubleValueSet<String> result=spellChecker.decode("String_Node_Str");
  for (  String s : result) {
    System.out.println(s + "String_Node_Str" + result.get(s));
  }
}

Fixed version (ground truth):
@Test public void singleWordDictionaryTest2(){
  Log.setDebug();
  SingleWordSpellChecker spellChecker=new SingleWordSpellChecker(1);
  spellChecker.addWord("String_Node_Str");
  spellChecker.addWord("String_Node_Str");
  DoubleValueSet<String> result=spellChecker.decode("String_Node_Str");
  for (  String s : result) {
    System.out.println(s + "String_Node_Str" + result.get(s));
  }
}
Program: 52752
Project: 52752
Buggy source:
/** 
 * save session
 * @param session
 * @throws UnknownSessionException
 */
private void saveSession(Session session) throws UnknownSessionException {
  if (session == null || session.getId() == null) {
    logger.error("String_Node_Str");
    return;
  }
  byte[] key=getByteKey(session.getId());
  byte[] value=SerializeUtils.serialize(session);
  Long timeout=session.getTimeout() / 1000;
  int expire=timeout.intValue();
  this.redisManager.set(key,value,expire);
}

Fixed version (ground truth):
/** 
 * save session
 * @param session
 * @throws UnknownSessionException
 */
private void saveSession(Session session) throws UnknownSessionException {
  if (session == null || session.getId() == null) {
    logger.error("String_Node_Str");
    return;
  }
  byte[] key=getByteKey(session.getId());
  byte[] value=SerializeUtils.serialize(session);
  session.setTimeout(redisManager.getExpire() * 1000);
  this.redisManager.set(key,value,redisManager.getExpire());
}
Program: 52753
Project: 52753
Buggy source:
@Override public boolean equals(Object o){
  if (o == null || !o.getClass().equals(this.getClass())) {
    return false;
  }
  Invocation other=(Invocation)o;
  return this.mock.equals(other.mock) && this.method.equals(other.method) && this.equalArguments(other.arguments);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o == null || !o.getClass().equals(this.getClass())) {
    return false;
  }
  Invocation other=(Invocation)o;
  return this.mock == other.mock && this.method.equals(other.method) && this.equalArguments(other.arguments);
}
Program: 52755
Project: 52755
Buggy source:
/** 
 * Reports an argument matcher. This method is needed to define own argument matchers. For details, see the EasyMock documentation.
 * @param matcher
 */
public static void reportMatcher(final IArgumentMatcher matcher){
  LastControl.reportMatcher(matcher);
}

Fixed version (ground truth):
/** 
 * Reports an argument matcher. This method is needed to define own argument matchers. For details, see the EasyMock documentation.
 * @param matcher the matcher to use to match currently mocked method argument
 */
public static void reportMatcher(final IArgumentMatcher matcher){
  LastControl.reportMatcher(matcher);
}
Program: 52756
Project: 52756
Buggy source:
/** 
 * Returns the expectation setter for the last expected invocation in the current thread.
 * @param < T > type returned by the expected method
 * @param value the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. <code>expect(mock.getName()).andReturn("John Doe")<code>.
 * @return the expectation setter.
 */
public static <T>IExpectationSetters<T> expect(final T value){
  return EasyMock.getControlForLastCall();
}

Fixed version (ground truth):
/** 
 * Returns the expectation setter for the last expected invocation in the current thread.
 * @param < T > type returned by the expected method
 * @param value the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").
 * @return the expectation setter.
 */
public static <T>IExpectationSetters<T> expect(final T value){
  return EasyMock.getControlForLastCall();
}
Program: 52757
Project: 52757
Buggy source:
/** 
 * Create named mock from the provided mock control using the arguments passed to the builder.
 * @param name the mock name
 * @return the newly created mock
 */
T createMock(String name,IMocksControl control);

Fixed version (ground truth):
/** 
 * Create named mock from the provided mock control using the arguments passed to the builder.
 * @param name the mock name
 * @param control {@link org.easymock.classextension.IMocksControl} used tocreate the object
 * @return the newly created mock
 */
T createMock(String name,IMocksControl control);
Program: 52758
Project: 52758
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle state){
  Activity activity;
  if ((activity=getActivity()) == null)   return null;
  activity.setTitle(R.string.compose_sampler_cube);
  try {
    cubeMapView=((CubeMapActivity)activity).getCubeMapView();
  }
 catch (  ClassCastException e) {
    throw new ClassCastException(activity.toString() + "String_Node_Str" + "String_Node_Str");
  }
  View view;
  View fab;
  if ((view=inflater.inflate(R.layout.fragment_cube_map,container,false)) == null || (fab=view.findViewById(R.id.add_texture)) == null) {
    activity.finish();
    return null;
  }
  fab.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      addTexture();
    }
  }
);
  cubeMapView.setVisibility(View.VISIBLE);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle state){
  Activity activity;
  if ((activity=getActivity()) == null)   return null;
  activity.setTitle(R.string.compose_sampler_cube);
  try {
    cubeMapView=((CubeMapViewProvider)activity).getCubeMapView();
  }
 catch (  ClassCastException e) {
    throw new ClassCastException(activity.toString() + "String_Node_Str" + "String_Node_Str");
  }
  View view;
  View fab;
  if ((view=inflater.inflate(R.layout.fragment_cube_map,container,false)) == null || (fab=view.findViewById(R.id.add_texture)) == null) {
    activity.finish();
    return null;
  }
  fab.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      addTexture();
    }
  }
);
  cubeMapView.setVisibility(View.VISIBLE);
  return view;
}
Program: 52760
Project: 52760
Buggy source:
public void addUniform(String statement){
  if (statement == null)   return;
  Editable e=getText();
  Matcher m=PATTERN_INSERT_UNIFORM.matcher(e);
  int start=0;
  if (m.find())   start=Math.max(0,m.end() - 1);
 else {
    if ((start=endIndexOfLastEndIf(e)) > -1)     statement="String_Node_Str" + statement;
    ++start;
  }
  e.insert(start,statement + "String_Node_Str");
}

Fixed version (ground truth):
public void addUniform(String statement){
  if (statement == null)   return;
  Editable e=getText();
  Matcher m=PATTERN_INSERT_UNIFORM.matcher(e);
  int start;
  if (m.find())   start=Math.max(0,m.end() - 1);
 else {
    if ((start=endIndexOfLastEndIf(e)) > -1)     statement="String_Node_Str" + statement;
    ++start;
  }
  e.insert(start,statement + "String_Node_Str");
}
Program: 52761
Project: 52761
Buggy source:
private CharSequence autoIndent(CharSequence source,Spanned dest,int dstart,int dend){
  String indent="String_Node_Str";
  int istart=dstart - 1;
  int iend=-1;
  boolean dataBefore=false;
  int pt=0;
  for (; istart > -1; --istart) {
    char c=dest.charAt(istart);
    if (c == '\n')     break;
    if (c != ' ' && c != '\t') {
      if (!dataBefore) {
        if (c == '{' || c == '+' || c == '-' || c == '*' || c == '/' || c == '%' || c == '^' || c == '=')         --pt;
        dataBefore=true;
      }
      if (c == '(')       --pt;
 else       if (c == ')')       ++pt;
    }
  }
  if (istart > -1) {
    char charAtCursor=dest.charAt(dstart);
    for (iend=++istart; iend < dend; ++iend) {
      char c=dest.charAt(iend);
      if (charAtCursor != '\n' && c == '/' && iend + 1 < dend && dest.charAt(iend) == c) {
        iend+=2;
        break;
      }
      if (c != ' ' && c != '\t')       break;
    }
    indent+=dest.subSequence(istart,iend);
  }
  if (pt < 0)   indent+="String_Node_Str";
  return source + indent;
}

Fixed version (ground truth):
private CharSequence autoIndent(CharSequence source,Spanned dest,int dstart,int dend){
  String indent="String_Node_Str";
  int istart=dstart - 1;
  boolean dataBefore=false;
  int pt=0;
  for (; istart > -1; --istart) {
    char c=dest.charAt(istart);
    if (c == '\n')     break;
    if (c != ' ' && c != '\t') {
      if (!dataBefore) {
        if (c == '{' || c == '+' || c == '-' || c == '*' || c == '/' || c == '%' || c == '^' || c == '=')         --pt;
        dataBefore=true;
      }
      if (c == '(')       --pt;
 else       if (c == ')')       ++pt;
    }
  }
  if (istart > -1) {
    char charAtCursor=dest.charAt(dstart);
    int iend;
    for (iend=++istart; iend < dend; ++iend) {
      char c=dest.charAt(iend);
      if (charAtCursor != '\n' && c == '/' && iend + 1 < dend && dest.charAt(iend) == c) {
        iend+=2;
        break;
      }
      if (c != ' ' && c != '\t')       break;
    }
    indent+=dest.subSequence(istart,iend);
  }
  if (pt < 0)   indent+="String_Node_Str";
  return source + indent;
}
Program: 52762
Project: 52762
Buggy source:
private void initDrawer(){
  drawerLayout=(TouchThruDrawerlayout)findViewById(R.id.drawer_layout);
  menuFrame=findViewById(R.id.menu_frame);
  drawerToggle=new ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.drawer_open,R.string.drawer_close){
    public void onDrawerClosed(    View view){
      supportInvalidateOptionsMenu();
    }
    public void onDrawerOpened(    View view){
      supportInvalidateOptionsMenu();
    }
  }
;
  drawerToggle.setDrawerIndicatorEnabled(true);
  drawerLayout.setDrawerListener(drawerToggle);
}

Fixed version (ground truth):
private void initDrawer(){
  drawerLayout=(TouchThruDrawerlayout)findViewById(R.id.drawer_layout);
  menuFrame=findViewById(R.id.menu_frame);
  drawerToggle=new ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.drawer_open,R.string.drawer_close){
    public void onDrawerClosed(    View view){
      supportInvalidateOptionsMenu();
    }
    public void onDrawerOpened(    View view){
      supportInvalidateOptionsMenu();
    }
  }
;
  drawerToggle.setDrawerIndicatorEnabled(true);
  drawerLayout.addDrawerListener(drawerToggle);
}
Program: 52763
Project: 52763
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  preferences.init(this);
  dataSource.openAsync(this);
  if (BuildConfig.DEBUG) {
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build());
  }
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  preferences.init(this);
  dataSource.openAsync(this);
  if (BuildConfig.DEBUG) {
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().penaltyLog().penaltyDeath().build());
  }
}
Program: 52764
Project: 52764
Buggy source:
private void saveShader(){
  String src=shaderEditor.getText().toString();
  if (!compileOnChange)   loadShader(src);
  dataSource.update(shaderSpinner.getSelectedItemId(),src,shaderView.renderer.getThumbnail());
  updateAdapter();
}

Fixed version (ground truth):
private void saveShader(){
  String src=shaderEditor.getText().toString();
  if (!compileOnChange) {
    loadShader(src);
    shaderEditor.refresh();
  }
  dataSource.update(shaderSpinner.getSelectedItemId(),src,shaderView.renderer.getThumbnail());
  updateAdapter();
}
Program: 52765
Project: 52765
Buggy source:
public static Offset rangeToTextOffset(CharSequence charsSequence,Comment.Range range){
  int startOffset=0;
  int endOffset=0;
  try {
    BufferedReader reader=new BufferedReader(new CharSequenceReader(charsSequence));
    String line;
    int textLineCount=1;
    while ((line=reader.readLine()) != null) {
      if (textLineCount < range.startLine) {
        startOffset+=line.length();
        startOffset++;
      }
      if (textLineCount < range.endLine) {
        endOffset+=line.length();
        endOffset++;
      }
 else {
        break;
      }
      textLineCount++;
    }
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
  startOffset+=range.startCharacter;
  endOffset+=range.endCharacter;
  return new Offset(startOffset,endOffset);
}

Fixed version (ground truth):
public static Offset rangeToTextOffset(CharSequence charsSequence,Comment.Range range){
  int startOffset=0;
  int endOffset=0;
  CharSequenceReader charSequenceReader=new CharSequenceReader(charsSequence);
  try {
    BufferedReader reader=new BufferedReader(charSequenceReader);
    String line;
    int textLineCount=1;
    while ((line=reader.readLine()) != null) {
      if (textLineCount < range.startLine) {
        startOffset+=line.length();
        startOffset++;
      }
      if (textLineCount < range.endLine) {
        endOffset+=line.length();
        endOffset++;
      }
 else {
        break;
      }
      textLineCount++;
    }
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
 finally {
    charSequenceReader.close();
  }
  startOffset+=range.startCharacter;
  endOffset+=range.endCharacter;
  return new Offset(startOffset,endOffset);
}
Program: 52766
Project: 52766
Buggy source:
public static Comment.Range textOffsetToRange(CharSequence charsSequence,int start,int end){
  int startLine=1;
  int startOffset=-1;
  int endLine=1;
  int endOffset=-1;
  try {
    BufferedReader reader=new BufferedReader(new CharSequenceReader(charsSequence));
    String lineString;
    int currentCharCount=0;
    while ((lineString=reader.readLine()) != null) {
      currentCharCount+=lineString.length();
      currentCharCount++;
      if (start > currentCharCount) {
        startLine++;
      }
 else       if (startOffset < 0) {
        startOffset=start - (currentCharCount - lineString.length() - 1);
      }
      if (end > currentCharCount) {
        endLine++;
      }
 else       if (endOffset < 0) {
        endOffset=end - (currentCharCount - lineString.length() - 1);
        break;
      }
    }
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
  Comment.Range range=new Comment.Range();
  range.startLine=startLine;
  range.startCharacter=startOffset;
  range.endLine=endLine;
  range.endCharacter=endOffset;
  return range;
}

Fixed version (ground truth):
public static Comment.Range textOffsetToRange(CharSequence charsSequence,int start,int end){
  int startLine=1;
  int startOffset=-1;
  int endLine=1;
  int endOffset=-1;
  CharSequenceReader charSequenceReader=new CharSequenceReader(charsSequence);
  try {
    BufferedReader reader=new BufferedReader(charSequenceReader);
    String lineString;
    int currentCharCount=0;
    while ((lineString=reader.readLine()) != null) {
      currentCharCount+=lineString.length();
      currentCharCount++;
      if (start > currentCharCount) {
        startLine++;
      }
 else       if (startOffset < 0) {
        startOffset=start - (currentCharCount - lineString.length() - 1);
      }
      if (end > currentCharCount) {
        endLine++;
      }
 else       if (endOffset < 0) {
        endOffset=end - (currentCharCount - lineString.length() - 1);
        break;
      }
    }
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
 finally {
    charSequenceReader.close();
  }
  Comment.Range range=new Comment.Range();
  range.startLine=startLine;
  range.startCharacter=startOffset;
  range.endLine=endLine;
  range.endCharacter=endOffset;
  return range;
}
Program: 52767
Project: 52767
Buggy source:
public Offset(int start,int end){
  this.start=start;
  this.end=end;
}

Fixed version (ground truth):
Offset(int start,int end){
  this.start=start;
  this.end=end;
}
Program: 52768
Project: 52768
Buggy source:
public Element getState(){
  final Element element=new Element(GERRIT_SETTINGS_TAG);
  element.setAttribute(LOGIN,(getLogin() != null ? getLogin() : "String_Node_Str"));
  element.setAttribute(HOST,(getHost() != null ? getHost() : "String_Node_Str"));
  element.setAttribute(LIST_ALL_CHANGES,Boolean.toString(getListAllChanges()));
  element.setAttribute(AUTOMATIC_REFRESH,Boolean.toString(getAutomaticRefresh()));
  element.setAttribute(REFRESH_TIMEOUT,"String_Node_Str" + getRefreshTimeout());
  element.setAttribute(REVIEW_NOTIFICATIONS,Boolean.toString(getReviewNotifications()));
  element.setAttribute(PUSH_TO_GERRIT,Boolean.toString(getPushToGerrit()));
  element.setAttribute(SHOW_CHANGE_NUMBER_COLUMN,Boolean.toString(getShowChangeNumberColumn()));
  element.setAttribute(SHOW_CHANGE_ID_COLUMN,Boolean.toString(getShowChangeIdColumn()));
  element.setAttribute(SHOW_TOPIC_COLUMN,Boolean.toString(getShowTopicColumn()));
  element.setAttribute(SHOW_PROJECT_COLUMN,getShowProjectColumn().name());
  return element;
}

Fixed version (ground truth):
public Element getState(){
  final Element element=new Element(GERRIT_SETTINGS_TAG);
  element.setAttribute(LOGIN,(getLogin() != null ? getLogin() : "String_Node_Str"));
  element.setAttribute(HOST,(getHost() != null ? getHost() : "String_Node_Str"));
  element.setAttribute(LIST_ALL_CHANGES,Boolean.toString(getListAllChanges()));
  element.setAttribute(AUTOMATIC_REFRESH,Boolean.toString(getAutomaticRefresh()));
  element.setAttribute(REFRESH_TIMEOUT,Integer.toString(getRefreshTimeout()));
  element.setAttribute(REVIEW_NOTIFICATIONS,Boolean.toString(getReviewNotifications()));
  element.setAttribute(PUSH_TO_GERRIT,Boolean.toString(getPushToGerrit()));
  element.setAttribute(SHOW_CHANGE_NUMBER_COLUMN,Boolean.toString(getShowChangeNumberColumn()));
  element.setAttribute(SHOW_CHANGE_ID_COLUMN,Boolean.toString(getShowChangeIdColumn()));
  element.setAttribute(SHOW_TOPIC_COLUMN,Boolean.toString(getShowTopicColumn()));
  element.setAttribute(SHOW_PROJECT_COLUMN,getShowProjectColumn().name());
  return element;
}
Program: 52769
Project: 52769
Buggy source:
private void postError(String json){
  CloseableHttpClient httpClient=HttpClients.createDefault();
  HttpPost httpPost=new HttpPost(ERROR_REPORT_URL);
  httpPost.setEntity(new StringEntity(json,ContentType.APPLICATION_JSON));
  try {
    CloseableHttpResponse response=httpClient.execute(httpPost);
    try {
      if (response.getStatusLine().getStatusCode() == 406) {
        String reasonPhrase=response.getStatusLine().getReasonPhrase();
        Messages.showErrorDialog(reasonPhrase,"String_Node_Str");
      }
    }
  finally {
      response.close();
    }
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private void postError(String json){
  try {
    CloseableHttpClient httpClient=HttpClients.createDefault();
    try {
      HttpPost httpPost=new HttpPost(ERROR_REPORT_URL);
      httpPost.setEntity(new StringEntity(json,ContentType.APPLICATION_JSON));
      CloseableHttpResponse response=httpClient.execute(httpPost);
      if (response.getStatusLine().getStatusCode() == 406) {
        String reasonPhrase=response.getStatusLine().getReasonPhrase();
        Messages.showErrorDialog(reasonPhrase,"String_Node_Str");
      }
    }
  finally {
      httpClient.close();
    }
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
}