nus-yam/ex-repair huggingface dataset:
Program: 80617
Project: 80617
Buggy source:
public SimulatedRead getNextRead() throws IOException {
  SimulatedRead read;
  final String nameLine=fastqBr.readLine();
  if (nameLine == null)   return null;
  ArtAlnRecord alnRecord;
  if ((alnRecord=artAlnR.getNextAln()) == null)   return null;
  final String nameFields[]=nameLine.trim().substring(1).split("String_Node_Str");
  read=new SimulatedRead();
  read.fragment=Integer.parseInt(nameFields[nameFields.length - 1]);
  read.setReadId(nameFields[nameFields.length - 2]);
  read.sequence=fastqBr.readLine().trim();
  if (forceFiveBaseEncoding) {
    read.sequence=nonACGTPattern.matcher(read.sequence).replaceAll("String_Node_Str");
  }
  fastqBr.readLine();
  read.quality=fastqBr.readLine().trim();
  if (read.fragment == 1) {
    read.locs1.add(new GenomeLocation(alnRecord.chromosome,alnRecord.location,alnRecord.direction));
    read.origLocs1.add(new GenomeLocation(alnRecord.chromosome,alnRecord.location,alnRecord.direction));
    read.alignedBases1=alnRecord.alignedBases;
  }
 else {
    read.locs2.add(new GenomeLocation(alnRecord.chromosome,alnRecord.location,alnRecord.direction));
    read.origLocs2.add(new GenomeLocation(alnRecord.chromosome,alnRecord.location,alnRecord.direction));
    read.alignedBases2=alnRecord.alignedBases;
  }
  return read;
}

Fixed version (ground truth):
public SimulatedRead getNextRead() throws IOException {
  SimulatedRead read;
  final String nameLine=fastqBr.readLine();
  if (nameLine == null || nameLine.trim().length() < 1)   return null;
  ArtAlnRecord alnRecord;
  if ((alnRecord=artAlnR.getNextAln()) == null)   return null;
  final String nameFields[]=nameLine.trim().substring(1).split("String_Node_Str");
  if (nameFields.length < 2)   return null;
  read=new SimulatedRead();
  read.fragment=Integer.parseInt(nameFields[nameFields.length - 1]);
  read.setReadId(nameFields[nameFields.length - 2]);
  read.sequence=fastqBr.readLine().trim();
  if (forceFiveBaseEncoding) {
    read.sequence=nonACGTPattern.matcher(read.sequence).replaceAll("String_Node_Str");
  }
  fastqBr.readLine();
  read.quality=fastqBr.readLine().trim();
  if (read.fragment == 1) {
    read.locs1.add(new GenomeLocation(alnRecord.chromosome,alnRecord.location,alnRecord.direction));
    read.origLocs1.add(new GenomeLocation(alnRecord.chromosome,alnRecord.location,alnRecord.direction));
    read.alignedBases1=alnRecord.alignedBases;
  }
 else {
    read.locs2.add(new GenomeLocation(alnRecord.chromosome,alnRecord.location,alnRecord.direction));
    read.origLocs2.add(new GenomeLocation(alnRecord.chromosome,alnRecord.location,alnRecord.direction));
    read.alignedBases2=alnRecord.alignedBases;
  }
  return read;
}
Program: 80618
Project: 80618
Buggy source:
private void readHeader() throws IOException {
  while ((currentLine=br.readLine()) != null) {
    if (!currentLine.startsWith("String_Node_Str") && !currentLine.startsWith("String_Node_Str")) {
      break;
    }
    if (currentLine.startsWith("String_Node_Str")) {
      final String[] fields=currentLine.split("String_Node_Str");
      chromosomeLengths.put(fields[1],Integer.valueOf(fields[2]));
    }
  }
}

Fixed version (ground truth):
private void readHeader() throws IOException {
  while ((currentLine=br.readLine()) != null) {
    if (!currentLine.startsWith("String_Node_Str") && !currentLine.startsWith("String_Node_Str")) {
      break;
    }
    if (currentLine.startsWith("String_Node_Str")) {
      final String[] fields=currentLine.split("String_Node_Str");
      chromosomeLengths.put(new ChrString(fields[1]),Integer.valueOf(fields[2]));
    }
  }
}
Program: 80619
Project: 80619
Buggy source:
public ArtAlnRecord getNextAln() throws IOException {
  if (currentLine == null) {
    return null;
  }
  final String refAln=br.readLine().trim();
  final String readAln=br.readLine().trim();
  final String[] alnFields=splitterPattern.split(currentLine.trim().substring(1));
  int direction=(alnFields[3].equals("String_Node_Str")) ? 1 : 0;
  final int refLength=refAln.replace("String_Node_Str","String_Node_Str").length();
  ArtAlnRecord record=new ArtAlnRecord(new ChrString(alnFields[0]),Integer.parseInt(alnFields[2]) + 1,direction,alnFields[1],refLength);
  if (record.direction == 1) {
    final int chromosomeLength=chromosomeLengths.get(record.chromosome);
    record.location=chromosomeLength - (record.location - 1) + 1 - refLength;
  }
  currentLine=br.readLine();
  return record;
}

Fixed version (ground truth):
public ArtAlnRecord getNextAln() throws IOException {
  if (currentLine == null) {
    return null;
  }
  final String refAln=br.readLine().trim();
  final String readAln=br.readLine().trim();
  final String[] alnFields=splitterPattern.split(currentLine.trim().substring(1));
  int direction=(alnFields[3].equals("String_Node_Str")) ? 1 : 0;
  final int refLength=refAln.replace("String_Node_Str","String_Node_Str").length();
  ArtAlnRecord record=new ArtAlnRecord(new ChrString(alnFields[0]),Integer.parseInt(alnFields[2]) + 1,direction,alnFields[1],refLength);
  if (!chromosomeLengths.containsKey(record.chromosome)) {
    return null;
  }
  if (record.direction == 1) {
    final int chromosomeLength=chromosomeLengths.get(record.chromosome);
    record.location=chromosomeLength - (record.location - 1) + 1 - refLength;
  }
  currentLine=br.readLine();
  return record;
}
Program: 80620
Project: 80620
Buggy source:
public ReadMap(final File file) throws IOException {
  log.info("String_Node_Str" + file.getName());
  bufferedReader=new BufferedReader(new InputStreamReader(decompressStream(file.getName())));
  while (hasMoreInput()) {
    readLine();
    log.trace("String_Node_Str" + line);
    if (line == null || line.trim().isEmpty()) {
      break;
    }
    final ReadMapRecord record=parseLine();
    readMap.put(record.getReadName(),record);
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
public ReadMap(final File file) throws IOException {
  log.info("String_Node_Str" + file);
  bufferedReader=new BufferedReader(new InputStreamReader(decompressStream(file)));
  while (hasMoreInput()) {
    readLine();
    log.trace("String_Node_Str" + line);
    if (line == null || line.trim().isEmpty()) {
      break;
    }
    final ReadMapRecord record=parseLine();
    readMap.put(record.getReadName(),record);
  }
  log.info("String_Node_Str");
}
Program: 80622
Project: 80622
Buggy source:
/** 
 * @param dgvVariantType DGV Variant type
 * @param dgvVariantSubtype DGV Variant subtype
 * @return VariantType. Return value is null if cannot map to the right VariantType
 */
public VariantType getVariantType(final String dgvVariantType,final String dgvVariantSubtype){
switch (dgvVariantType) {
case "String_Node_Str":
switch (dgvVariantSubtype) {
case "String_Node_Str":
      return VariantType.Tandem_Duplication;
case "String_Node_Str":
    return VariantType.Deletion;
case "String_Node_Str":
  return VariantType.Tandem_Duplication;
case "String_Node_Str":
return VariantType.Tandem_Duplication;
case "String_Node_Str":
return VariantType.Insertion;
case "String_Node_Str":
return VariantType.Deletion;
default :
throw new IllegalArgumentException("String_Node_Str" + dgvVariantSubtype);
}
case "String_Node_Str":
switch (dgvVariantSubtype) {
case "String_Node_Str":
return VariantType.Tandem_Duplication;
case "String_Node_Str":
return VariantType.Inversion;
default :
throw new IllegalArgumentException("String_Node_Str" + dgvVariantSubtype);
}
default :
throw new IllegalArgumentException("String_Node_Str" + dgvVariantType);
}
}

Fixed version (ground truth):
/** 
 * @param dgvVariantType DGV Variant type
 * @param dgvVariantSubtype DGV Variant subtype
 * @return VariantType. Return value is null if cannot map to the right VariantType
 */
public VariantType getVariantType(final String dgvVariantSubtype){
switch (dgvVariantSubtype) {
case "String_Node_Str":
    return VariantType.Tandem_Duplication;
case "String_Node_Str":
  return VariantType.Deletion;
case "String_Node_Str":
return VariantType.Tandem_Duplication;
case "String_Node_Str":
return VariantType.Tandem_Duplication;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
return VariantType.Insertion;
case "String_Node_Str":
return VariantType.Deletion;
case "String_Node_Str":
return VariantType.Tandem_Duplication;
case "String_Node_Str":
return VariantType.Inversion;
default :
throw new IllegalArgumentException("String_Node_Str" + dgvVariantSubtype);
}
}
Program: 80624
Project: 80624
Buggy source:
/** 
 * there are 3 possible ways to construct an ALT 1) breakend 2) symbolic allele 3) alt sequence
 */
public Alt(String alt){
  if (alt.startsWith("String_Node_Str")) {
    this.symbolicAllele=SymbolicAllele.symbolicAlleleFactory(alt);
  }
 else   if (alt.indexOf("String_Node_Str") >= 0) {
    this.breakend=Breakend.breakendFactory(alt);
  }
}

Fixed version (ground truth):
/** 
 * there are 3 possible ways to construct an ALT 1) breakend 2) symbolic allele 3) alt sequence
 */
public Alt(String alt){
  if (alt.startsWith("String_Node_Str")) {
    this.symbolicAllele=SymbolicAllele.symbolicAlleleFactory(alt);
  }
 else   if (alt.indexOf("String_Node_Str") >= 0) {
    this.breakend=Breakend.breakendFactory(alt);
  }
 else {
    this.seq=new FlexSeq(alt.getBytes());
  }
}
Program: 80625
Project: 80625
Buggy source:
@Test public void homopolymerInsertionParsingTest() throws UnexpectedException {
  Variant v=parser.processLine("String_Node_Str");
  assertTrue(v.toString().equals("String_Node_Str"));
  assertTrue(v.isPhased());
  assertTrue(v.getReference().length == 0);
  assertTrue(v.getAlt(1).length() == 3);
}

Fixed version (ground truth):
@Test public void homopolymerInsertionParsingTest() throws UnexpectedException {
  Variant v=parser.processLine("String_Node_Str");
  assertTrue(v.toString().equals("String_Node_Str"));
  assertTrue(v.isPhased());
  assertTrue(v.getReference().length == 0);
  assertTrue(v.getAlt(1).getSeq().length() == 3);
}
Program: 80626
Project: 80626
Buggy source:
@Test public void insertionParsingTest() throws UnexpectedException {
  Variant v=parser.processLine("String_Node_Str");
  assertTrue(v.toString().equals("String_Node_Str"));
  assertTrue(v.isPhased());
  assertTrue(v.getReference().length == 0);
  assertTrue(v.getAlt(1).length() == 2);
}

Fixed version (ground truth):
@Test public void insertionParsingTest() throws UnexpectedException {
  Variant v=parser.processLine("String_Node_Str");
  assertTrue(v.toString().equals("String_Node_Str"));
  assertTrue(v.isPhased());
  assertTrue(v.getReference().length == 0);
  assertTrue(v.getAlt(1).getSeq().length() == 2);
}
Program: 80627
Project: 80627
Buggy source:
@Test public void deletionParsingTest() throws UnexpectedException {
  Variant v=parser.processLine("String_Node_Str");
  assertTrue(v.toString().equals("String_Node_Str"));
  assertTrue(v.isPhased());
  assertTrue(v.getReference().length == 1);
  assertTrue(v.getAlt(1).length() == 0);
}

Fixed version (ground truth):
@Test public void deletionParsingTest() throws UnexpectedException {
  Variant v=parser.processLine("String_Node_Str");
  assertTrue(v.toString().equals("String_Node_Str"));
  assertTrue(v.isPhased());
  assertTrue(v.getReference().length == 1);
  assertTrue(v.getAlt(1).getSeq().length() == 0);
}
Program: 80628
Project: 80628
Buggy source:
/** 
 * generate VCF file header a little explanation about translocation-related meta-info lines: each locus involved in translocations is modeled independently as a cut-paste event with slight variations for different types of translocations. Basically, a region at locus A (the sink) will be cut (deleted), and a region at locus B (the source) will be placed at the sink. The placement may be: complete transfer; complete transfer with inversion; no transfer (one-way or unbalanced translocation).
 * @param referenceFileName reference file name
 * @param sampleNames list of sample names
 * @return
 */
private String generateVCFHeader(final String referenceFileName,final List<String> sampleNames){
  String VCFHeader="String_Node_Str" + "String_Node_Str" + referenceFileName + "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";
  StringJoiner joiner=new StringJoiner("String_Node_Str");
  for (  String id : sampleNames) {
    joiner.add(id);
  }
  return VCFHeader + "String_Node_Str" + (sampleNames.isEmpty() ? "String_Node_Str" : "String_Node_Str")+ joiner.toString()+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * generate VCF file header a little explanation about translocation-related meta-info lines: each locus involved in translocations is modeled independently as a cut-paste event with slight variations for different types of translocations. Basically, a region at locus A (the sink) will be cut (deleted), and a region at locus B (the source) will be placed at the sink. The placement may be: complete transfer; complete transfer with inversion; no transfer (one-way or unbalanced translocation).
 * @param referenceFileName reference file name
 * @param sampleNames list of sample names
 * @return
 */
private String generateVCFHeader(final String referenceFileName,final List<String> sampleNames){
  String VCFHeader="String_Node_Str" + "String_Node_Str" + referenceFileName + "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"+ "String_Node_Str"+ "String_Node_Str";
  StringJoiner joiner=new StringJoiner("String_Node_Str");
  for (  String id : sampleNames) {
    joiner.add(id);
  }
  return VCFHeader + "String_Node_Str" + (sampleNames.isEmpty() ? "String_Node_Str" : "String_Node_Str")+ joiner.toString()+ "String_Node_Str";
}
Program: 80630
Project: 80630
Buggy source:
/** 
 * write perturbed maternal or paternal genomes into files flag array and sequences to be inserted for each haploid genome are required. here, insertion has broader meaning as all variants are considered combinations of insertion + deletion instead of calling writeDiploid and then writeMultiploid since we really only have two haplotypes, we can call writeHaploid twice. Got more haplotypes? Use a loop. This avoids creation of anonymous lists.
 * @param sequence
 * @param ins_seq
 * @param sequenceName
 * @param sequenceFileName
 * @param outputFlag
 */
private void writeHaploid(final byte[] sequence,Hashtable<Integer,FlexSeq> ins_seq,final String sequenceName,final String sequenceFileName,final Boolean outputFlag){
  try {
    FileWriter fw=new FileWriter(new File(outDir,sequenceFileName));
    BufferedWriter bw=new BufferedWriter(fw);
    writeGenome(bw,sequenceName,sequence,ins_seq);
    bw.close();
    fw.close();
  }
 catch (  IOException ex) {
    log.error(ex.toString());
  }
}

Fixed version (ground truth):
/** 
 * write perturbed maternal or paternal genomes into files flag array and sequences to be inserted for each haploid genome are required. here, insertion has broader meaning as all variants are considered combinations of insertion + deletion instead of calling writeDiploid and then writeMultiploid since we really only have two haplotypes, we can call writeHaploid twice. Got more haplotypes? Use a loop. This avoids creation of anonymous lists.
 * @param sequence
 * @param ins_seq
 * @param sequenceName
 * @param sequenceFileName
 */
private void writeHaploid(final byte[] sequence,Hashtable<Integer,FlexSeq> ins_seq,final String sequenceName,final String sequenceFileName){
  try {
    FileWriter fw=new FileWriter(new File(outDir,sequenceFileName));
    BufferedWriter bw=new BufferedWriter(fw);
    writeGenome(bw,sequenceName,sequence,ins_seq);
    bw.close();
    fw.close();
  }
 catch (  IOException ex) {
    log.error(ex.toString());
  }
}
Program: 80632
Project: 80632
Buggy source:
public void calculateExtraBase(final Sequence refSeq){
  for (  final FlexSeq alt : _alts) {
    if (alt.isSeq() && alt.length() == 0) {
      extraBase=String.valueOf((char)refSeq.byteAt(getPos() + _del));
    }
  }
}

Fixed version (ground truth):
public void calculateExtraBase(final Sequence refSeq){
  for (  final FlexSeq alt : _alts) {
    if (alt.isSeq() && alt.length() == 0 && getPos() + _del < refSeq.length()) {
      extraBase=String.valueOf((char)refSeq.byteAt(getPos() + _del));
    }
  }
}
Program: 80633
Project: 80633
Buggy source:
public String getLength(){
  StringBuilder len=new StringBuilder();
  for (int i=0; i < _alts.length; i++) {
    if (i > 0) {
      len.append(',');
    }
    VariantType t=getType(i + 1);
    if (t == VariantType.Deletion) {
      len.append(-_del);
    }
 else     if (t == VariantType.Complex) {
      int alt_len=_alts[i].length();
      if (_del > alt_len) {
        len.append(-_del);
      }
 else {
        len.append(alt_len);
      }
    }
 else {
      len.append(_alts[i].length());
    }
  }
  return len.toString();
}

Fixed version (ground truth):
public String getLength(){
  StringBuilder len=new StringBuilder();
  for (int i=0; i < _alts.length; i++) {
    if (i > 0) {
      len.append(',');
    }
    VariantType t=getType(i + 1);
    if (t == VariantType.Deletion) {
      len.append(-_del + _alts[i].length());
    }
 else     if (t == VariantType.Complex) {
      int alt_len=_alts[i].length();
      if (_del > alt_len) {
        len.append(-_del);
      }
 else {
        len.append(alt_len);
      }
    }
 else {
      len.append(_alts[i].length());
    }
  }
  return len.toString();
}
Program: 80634
Project: 80634
Buggy source:
public StringBuilder alt_string(){
  StringBuilder sbStr=new StringBuilder();
  for (int i=0; i < _alts.length; i++) {
    if (i > 0 && _alts[i].toString().equals(_alts[i - 1].toString())) {
      continue;
    }
    if (i > 0) {
      sbStr.append("String_Node_Str");
    }
    if (_alts[i].isSeq()) {
      sbStr.append(_ref_deleted).append(_alts[i].toString()).append(extraBase);
    }
 else {
      sbStr.append(_alts[i].toString());
    }
  }
  return sbStr;
}

Fixed version (ground truth):
public StringBuilder alt_string(){
  StringBuilder sbStr=new StringBuilder();
  for (int i=0; i < _alts.length; i++) {
    if (i > 0) {
      sbStr.append("String_Node_Str");
    }
    if (_alts[i].isSeq()) {
      sbStr.append(_ref_deleted).append(_alts[i].toString()).append(extraBase);
    }
 else {
      sbStr.append(_alts[i].toString());
    }
  }
  return sbStr;
}
Program: 80636
Project: 80636
Buggy source:
StatsRatioRecord(){
  bin_counts=new RatioRecord[bin_breaks.length + 1];
  if (bin_breaks.length > 0) {
    bin_counts[0]=new RatioRecord(1,bin_breaks[0]);
  }
 else {
    bin_counts[0]=new RatioRecord(1,-1);
  }
  for (int i=1; i < bin_counts.length; i++) {
    if (i < bin_breaks.length) {
      bin_counts[i]=new RatioRecord(bin_breaks[i - 1] + 1,bin_breaks[i]);
    }
 else {
      bin_counts[i]=new RatioRecord(bin_breaks[i - 1] + 1,-1);
    }
  }
  sum_count=new RatioRecord();
}

Fixed version (ground truth):
StatsRatioRecord(){
  bin_counts=new RatioRecord[bin_breaks.length + 1];
  if (bin_breaks.length > 0) {
    bin_counts[0]=new RatioRecord(1,bin_breaks[0]);
  }
 else {
    bin_counts[0]=new RatioRecord(1,-1);
  }
  for (int i=1; i < bin_counts.length; i++) {
    if (i < bin_breaks.length) {
      bin_counts[i]=new RatioRecord(bin_breaks[i - 1] + 1,bin_breaks[i]);
    }
 else {
      bin_counts[i]=new RatioRecord(bin_breaks[i - 1] + 1,-1);
    }
  }
  sum_count=new RatioRecord();
  svSumCount=new RatioRecord();
}
Program: 80638
Project: 80638
Buggy source:
@Override public boolean canEvaluate(Template template){
  if (!template.getContextTypeId().equals(JavaStatementPostfixContext.CONTEXT_TYPE_ID))   return false;
  if (fForceEvaluation)   return true;
  if (currentNode == null)   return false;
  if (template.getName().toLowerCase().startsWith(getPrefixKey().toLowerCase()) == false) {
    return false;
  }
  String regex=("String_Node_Str");
  Pattern pattern=Pattern.compile(regex);
  Matcher matcher=pattern.matcher(template.getPattern());
  boolean result=true;
  while (matcher.find()) {
    String[] types=matcher.group(2).split("String_Node_Str");
    for (    String s : types) {
      result=false;
      if (this.isNodeResolvingTo(currentNode,s.trim()) == true) {
        return true;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public boolean canEvaluate(Template template){
  if (!template.getContextTypeId().equals(JavaStatementPostfixContext.CONTEXT_TYPE_ID))   return false;
  if (fForceEvaluation)   return true;
  if (selectedNode == null)   return false;
  if (template.getName().toLowerCase().startsWith(getPrefixKey().toLowerCase()) == false) {
    return false;
  }
  String regex=("String_Node_Str");
  Pattern pattern=Pattern.compile(regex);
  Matcher matcher=pattern.matcher(template.getPattern());
  boolean result=true;
  while (matcher.find()) {
    String[] types=matcher.group(2).split("String_Node_Str");
    for (    String s : types) {
      result=false;
      if (this.isNodeResolvingTo(selectedNode,s.trim()) == true) {
        return true;
      }
    }
  }
  return result;
}
Program: 80639
Project: 80639
Buggy source:
public JavaStatementPostfixContext(JavaStatementPostfixContextType type,IDocument document,int offset,int length,ICompilationUnit compilationUnit,ASTNode currentNode,ASTNode parentNode){
  super(type,document,offset,length,compilationUnit);
  this.currentNode=currentNode;
  this.parentNode=parentNode;
}

Fixed version (ground truth):
public JavaStatementPostfixContext(JavaStatementPostfixContextType type,IDocument document,int offset,int length,ICompilationUnit compilationUnit,ASTNode currentNode,ASTNode parentNode){
  super(type,document,offset,length,compilationUnit);
  this.nodeRegions=new HashMap<>();
  this.currentCompletionNode=currentNode;
  nodeRegions.put(currentNode,calculateNodeRegion(currentNode));
  this.currentCompletionNodeParent=parentNode;
  nodeRegions.put(parentNode,calculateNodeRegion(parentNode));
  this.selectedNode=currentNode;
}
Program: 80640
Project: 80640
Buggy source:
/** 
 * Returns the current prefix of the key which was typed in. <br/> Examples: <code> <br/> new Object().		=> getPrefixKey() returns "" new Object().a		=> getPrefixKey() returns "a" new object().asdf	=> getPrefixKey() returns "asdf"
 * @return an empty string or a string which represents the prefix of the key which was typed in
 */
protected String getPrefixKey(){
  IDocument document=getDocument();
  int start=getCompletionOffset();
  int end=getEnd();
  try {
    String temp=document.get(start,1);
    while (!"String_Node_Str".equals(temp)) {
      temp=document.get(--start,1);
    }
    return document.get(start + 1,end - start - 1);
  }
 catch (  BadLocationException e) {
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns the current prefix of the key which was typed in. <br/> Examples: <code> <br/> new Object().		=> getPrefixKey() returns "" new Object().a		=> getPrefixKey() returns "a" new object().asdf	=> getPrefixKey() returns "asdf"
 * @return an empty string or a string which represents the prefix of the key which was typed in
 */
protected String getPrefixKey(){
  IDocument document=getDocument();
  int start=getCompletionOffset();
  int end=getCompletionOffset();
  try {
    String temp=document.get(start,1);
    while (!"String_Node_Str".equals(temp)) {
      temp=document.get(--start,1);
    }
    return document.get(start + 1,end - start - 1);
  }
 catch (  BadLocationException e) {
  }
  return "String_Node_Str";
}
Program: 80641
Project: 80641
Buggy source:
/** 
 * Returns the   {@link Region} which represents the source region of the affected statement.
 * @return
 */
public Region getAffectedSourceRegion(){
  int start=getNodeBegin(currentNode);
  return new Region(start,(getCompletionOffset() - getPrefixKey().length()) - start - 1);
}

Fixed version (ground truth):
/** 
 * Returns the   {@link Region} which represents the source region of the affected statement.
 * @return
 */
public Region getAffectedSourceRegion(){
  return new Region(getCompletionOffset() - getPrefixKey().length() - nodeRegions.get(selectedNode).getLength()- 1,nodeRegions.get(selectedNode).getLength());
}
Program: 80642
Project: 80642
Buggy source:
/** 
 * Returns the fully qualified name the node of the current code completion invocation resolves to.
 * @return a fully qualified type signature or the name of the base type.
 */
public String getInnerExpressionTypeSignature(){
  return resolveNodeToTypeString(currentNode);
}

Fixed version (ground truth):
/** 
 * Returns the fully qualified name the node of the current code completion invocation resolves to.
 * @return a fully qualified type signature or the name of the base type.
 */
public String getInnerExpressionTypeSignature(){
  return resolveNodeToTypeString(selectedNode);
}
Program: 80643
Project: 80643
Buggy source:
/** 
 * Parse and verify CPIM ( https://tools.ietf.org/html/rfc3860 ). The decrypted content of a message is in CPIM format.
 */
private static MessageContent parseCPIMOrNull(String cpim,String myUID,Optional<String> senderKeyUID,EnumSet<Coder.Error> allErrors){
  CPIMMessage cpimMessage;
  try {
    cpimMessage=CPIMMessage.parse(cpim);
  }
 catch (  ParseException ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
    allErrors.add(Coder.Error.INVALID_DATA);
    return null;
  }
  String mime=cpimMessage.getMime();
  if (!Arrays.stream(cpimMessage.getTo()).anyMatch(s -> s.contains(myUID))) {
    LOGGER.warning("String_Node_Str");
    allErrors.add(Coder.Error.INVALID_RECIPIENT);
  }
  if (senderKeyUID.isPresent() && !senderKeyUID.get().equals(cpimMessage.getFrom())) {
    LOGGER.warning("String_Node_Str");
    allErrors.add(Coder.Error.INVALID_SENDER);
  }
  String content=cpimMessage.getBody().toString();
  MessageContent decryptedContent;
  if (XMPPParserUtils.XML_XMPP_TYPE.equalsIgnoreCase(mime)) {
    Message parsedMessage;
    try {
      parsedMessage=XMPPParserUtils.parseMessageStanza(content);
    }
 catch (    Exception ex) {
      LOGGER.log(Level.WARNING,"String_Node_Str",ex);
      allErrors.add(Coder.Error.INVALID_DATA);
      return null;
    }
    LOGGER.config("String_Node_Str" + parsedMessage.toXML());
    decryptedContent=ClientUtils.parseMessageContent(parsedMessage,true);
  }
 else {
    decryptedContent=MessageContent.plainText(content);
  }
  return decryptedContent;
}

Fixed version (ground truth):
/** 
 * Parse and verify CPIM ( https://tools.ietf.org/html/rfc3860 ). The decrypted content of a message is in CPIM format.
 */
private static MessageContent parseCPIMOrNull(String cpim,String myUID,Optional<String> senderKeyUID,EnumSet<Coder.Error> allErrors){
  CPIMMessage cpimMessage;
  try {
    cpimMessage=CPIMMessage.parse(cpim);
  }
 catch (  ParseException ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
    allErrors.add(Coder.Error.INVALID_DATA);
    return null;
  }
  String mime=cpimMessage.getMime();
  if (Arrays.stream(cpimMessage.getTo()).noneMatch(s -> s.contains(myUID))) {
    LOGGER.warning("String_Node_Str");
    allErrors.add(Coder.Error.INVALID_RECIPIENT);
  }
  if (senderKeyUID.isPresent() && !senderKeyUID.get().equals(cpimMessage.getFrom())) {
    LOGGER.warning("String_Node_Str");
    allErrors.add(Coder.Error.INVALID_SENDER);
  }
  String content=cpimMessage.getBody().toString();
  MessageContent decryptedContent;
  if (XMPPParserUtils.XML_XMPP_TYPE.equalsIgnoreCase(mime)) {
    Message parsedMessage;
    try {
      parsedMessage=XMPPParserUtils.parseMessageStanza(content);
    }
 catch (    Exception ex) {
      LOGGER.log(Level.WARNING,"String_Node_Str",ex);
      allErrors.add(Coder.Error.INVALID_DATA);
      return null;
    }
    LOGGER.config("String_Node_Str" + parsedMessage.toXML());
    decryptedContent=ClientUtils.parseMessageContent(parsedMessage,true);
  }
 else {
    decryptedContent=MessageContent.plainText(content);
  }
  return decryptedContent;
}
Program: 80644
Project: 80644
Buggy source:
public SubjectPGPPublicKeyInfo(byte[] publicKey){
  keyData=new DERBitString(publicKey);
}

Fixed version (ground truth):
SubjectPGPPublicKeyInfo(byte[] publicKey){
  keyData=new DERBitString(publicKey);
}
Program: 80645
Project: 80645
Buggy source:
@Override public int hashCode(){
  return Objects.hash(mTransmission);
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hash=this.abstractHashCode();
  hash=67 * hash + Objects.hash(mTransmission);
  return hash;
}
Program: 80646
Project: 80646
Buggy source:
protected void changed(boolean repeat){
  this.setChanged();
  this.notifyObservers(repeat);
}

Fixed version (ground truth):
void changed(boolean repeat){
  this.setChanged();
  this.notifyObservers(repeat);
}
Program: 80647
Project: 80647
Buggy source:
@Override public int hashCode(){
  return Objects.hash(mTransmissions);
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hash=this.abstractHashCode();
  hash=67 * hash + Objects.hash(mTransmissions);
  return hash;
}
Program: 80648
Project: 80648
Buggy source:
public DownloadTask(InMessage message){
  this.message=message;
}

Fixed version (ground truth):
DownloadTask(InMessage message){
  this.message=message;
}
Program: 80649
Project: 80649
Buggy source:
public UploadTask(OutMessage message){
  this.message=message;
}

Fixed version (ground truth):
UploadTask(OutMessage message){
  this.message=message;
}
Program: 80650
Project: 80650
Buggy source:
@Override public void onInMessage(GroupCommand command,Contact sender){
  KonGroupData gid=mChat.getGroupData();
  MessageContent.GroupCommand.OP op=command.getOperation();
  if (op != GroupCommand.OP.LEAVE) {
    if (!gid.owner.equals(sender.getJID())) {
      LOGGER.warning("String_Node_Str");
      return;
    }
  }
  List<ProtoMember> added=new ArrayList<>();
  List<ProtoMember> removed=new ArrayList<>();
  String subject="String_Node_Str";
switch (command.getOperation()) {
case CREATE:
    added.addAll(JIDsToMembers(command.getAdded()));
  if (!added.stream().anyMatch(m -> m.getContact().isMe()))   LOGGER.warning("String_Node_Str");
subject=command.getSubject();
break;
case LEAVE:
removed.add(new ProtoMember(sender));
break;
case SET:
added.addAll(JIDsToMembers(command.getAdded()));
if (command.isAddingMe()) added.addAll(JIDsToMembers(command.getUnchanged()));
for (JID jid : command.getRemoved()) {
Contact contact=mModel.contacts().get(jid).orElse(null);
if (contact == null) {
LOGGER.warning("String_Node_Str" + jid);
continue;
}
removed.add(new ProtoMember(contact));
}
subject=command.getSubject();
break;
default :
LOGGER.warning("String_Node_Str" + command.getOperation());
}
mChat.applyGroupChanges(added,removed,subject);
}

Fixed version (ground truth):
@Override void onInMessage(GroupCommand command,Contact sender){
  KonGroupData gid=mChat.getGroupData();
  MessageContent.GroupCommand.OP op=command.getOperation();
  if (op != GroupCommand.OP.LEAVE) {
    if (!gid.owner.equals(sender.getJID())) {
      LOGGER.warning("String_Node_Str");
      return;
    }
  }
  List<ProtoMember> added=new ArrayList<>();
  List<ProtoMember> removed=new ArrayList<>();
  String subject="String_Node_Str";
switch (command.getOperation()) {
case CREATE:
    added.addAll(JIDsToMembers(command.getAdded()));
  if (added.stream().noneMatch(m -> m.getContact().isMe()))   LOGGER.warning("String_Node_Str");
subject=command.getSubject();
break;
case LEAVE:
removed.add(new ProtoMember(sender));
break;
case SET:
added.addAll(JIDsToMembers(command.getAdded()));
if (command.isAddingMe()) added.addAll(JIDsToMembers(command.getUnchanged()));
for (JID jid : command.getRemoved()) {
Contact contact=mModel.contacts().get(jid).orElse(null);
if (contact == null) {
LOGGER.warning("String_Node_Str" + jid);
continue;
}
removed.add(new ProtoMember(contact));
}
subject=command.getSubject();
break;
default :
LOGGER.warning("String_Node_Str" + command.getOperation());
}
mChat.applyGroupChanges(added,removed,subject);
}
Program: 80652
Project: 80652
Buggy source:
public InternalException(String msg){
  super(msg);
}

Fixed version (ground truth):
InternalException(String msg){
  super(msg);
}
Program: 80653
Project: 80653
Buggy source:
public CellRenderer(){
  mNameLabel=new WebLabel();
  mRoleLabel=new WebLabel();
  mRoleLabel.setForeground(View.DARK_GREEN);
  this.setMargin(View.MARGIN_DEFAULT);
  this.setBorder(BorderFactory.createMatteBorder(0,0,1,0,Color.LIGHT_GRAY));
  this.add(new GroupPanel(GroupingType.fillMiddle,View.GAP_DEFAULT,mNameLabel,Box.createGlue(),mRoleLabel),BorderLayout.CENTER);
}

Fixed version (ground truth):
CellRenderer(){
  mNameLabel=new WebLabel();
  mRoleLabel=new WebLabel();
  mRoleLabel.setForeground(View.DARK_GREEN);
  this.setMargin(View.MARGIN_DEFAULT);
  this.setBorder(BorderFactory.createMatteBorder(0,0,1,0,Color.LIGHT_GRAY));
  this.add(new GroupPanel(GroupingType.fillMiddle,View.GAP_DEFAULT,mNameLabel,Box.createGlue(),mRoleLabel),BorderLayout.CENTER);
}
Program: 80654
Project: 80654
Buggy source:
Optional<char[]> getNewPassword(){
  if (!mSetPass.isSelected())   return Optional.of(new char[0]);
  char[] newPass=mNewPassField.getPassword();
  if (!Arrays.equals(newPass,mConfirmPassField.getPassword()))   Optional.empty();
  return Optional.of(newPass);
}

Fixed version (ground truth):
Optional<char[]> getNewPassword(){
  if (!mSetPass.isSelected())   return Optional.of(new char[0]);
  char[] newPass=mNewPassField.getPassword();
  if (!Arrays.equals(newPass,mConfirmPassField.getPassword()))   return Optional.empty();
  return Optional.of(newPass);
}
Program: 80655
Project: 80655
Buggy source:
public NetworkPanel(){
  GroupPanel groupPanel=new GroupPanel(View.GAP_DEFAULT,false);
  groupPanel.setMargin(View.MARGIN_BIG);
  groupPanel.add(new WebLabel(Tr.tr("String_Node_Str")).setBoldFont());
  groupPanel.add(new WebSeparator(true,true));
  mConnectStartupBox=createCheckBox(Tr.tr("String_Node_Str"),"String_Node_Str",mConf.getBoolean(Config.MAIN_CONNECT_STARTUP));
  groupPanel.add(mConnectStartupBox);
  mConnectRetryBox=createCheckBox(Tr.tr("String_Node_Str"),Tr.tr("String_Node_Str"),mConf.getBoolean(Config.NET_RETRY_CONNECT));
  groupPanel.add(new GroupPanel(mConnectRetryBox,new WebSeparator()));
  mRequestAvatars=createCheckBox(Tr.tr("String_Node_Str"),Tr.tr("String_Node_Str"),mConf.getBoolean(Config.NET_REQUEST_AVATARS));
  groupPanel.add(new GroupPanel(mRequestAvatars,new WebSeparator()));
  mImgResizeMap=new LinkedHashMap<>();
  mImgResizeMap.put(-1,Tr.tr("String_Node_Str"));
  mImgResizeMap.put(300 * 1000,Tr.tr("String_Node_Str"));
  mImgResizeMap.put(500 * 1000,Tr.tr("String_Node_Str"));
  mImgResizeMap.put(800 * 1000,Tr.tr("String_Node_Str"));
  mMaxImgSizeBox=new WebComboBox(new ArrayList<>(mImgResizeMap.values()).toArray());
  int maxImgIndex=new ArrayList<>(mImgResizeMap.keySet()).indexOf(mConf.getInt(Config.NET_MAX_IMG_SIZE));
  if (maxImgIndex >= 0)   mMaxImgSizeBox.setSelectedIndex(maxImgIndex);
  TooltipManager.addTooltip(mMaxImgSizeBox,Tr.tr("String_Node_Str"));
  groupPanel.add(new GroupPanel(View.GAP_DEFAULT,new WebLabel(Tr.tr("String_Node_Str")),mMaxImgSizeBox,new WebSeparator()));
  this.add(groupPanel);
}

Fixed version (ground truth):
NetworkPanel(){
  GroupPanel groupPanel=new GroupPanel(View.GAP_DEFAULT,false);
  groupPanel.setMargin(View.MARGIN_BIG);
  groupPanel.add(new WebLabel(Tr.tr("String_Node_Str")).setBoldFont());
  groupPanel.add(new WebSeparator(true,true));
  mConnectStartupBox=createCheckBox(Tr.tr("String_Node_Str"),"String_Node_Str",mConf.getBoolean(Config.MAIN_CONNECT_STARTUP));
  groupPanel.add(mConnectStartupBox);
  mConnectRetryBox=createCheckBox(Tr.tr("String_Node_Str"),Tr.tr("String_Node_Str"),mConf.getBoolean(Config.NET_RETRY_CONNECT));
  groupPanel.add(new GroupPanel(mConnectRetryBox,new WebSeparator()));
  mRequestAvatars=createCheckBox(Tr.tr("String_Node_Str"),Tr.tr("String_Node_Str"),mConf.getBoolean(Config.NET_REQUEST_AVATARS));
  groupPanel.add(new GroupPanel(mRequestAvatars,new WebSeparator()));
  mImgResizeMap=new LinkedHashMap<>();
  mImgResizeMap.put(-1,Tr.tr("String_Node_Str"));
  mImgResizeMap.put(300 * 1000,Tr.tr("String_Node_Str"));
  mImgResizeMap.put(500 * 1000,Tr.tr("String_Node_Str"));
  mImgResizeMap.put(800 * 1000,Tr.tr("String_Node_Str"));
  mMaxImgSizeBox=new WebComboBox(new ArrayList<>(mImgResizeMap.values()).toArray());
  int maxImgIndex=new ArrayList<>(mImgResizeMap.keySet()).indexOf(mConf.getInt(Config.NET_MAX_IMG_SIZE));
  if (maxImgIndex >= 0)   mMaxImgSizeBox.setSelectedIndex(maxImgIndex);
  TooltipManager.addTooltip(mMaxImgSizeBox,Tr.tr("String_Node_Str"));
  groupPanel.add(new GroupPanel(View.GAP_DEFAULT,new WebLabel(Tr.tr("String_Node_Str")),mMaxImgSizeBox,new WebSeparator()));
  this.add(groupPanel);
}
Program: 80656
Project: 80656
Buggy source:
protected void configUpdate(){
}

Fixed version (ground truth):
void configUpdate(){
}
Program: 80657
Project: 80657
Buggy source:
public WrapLabelView(Element elem){
  super(elem);
}

Fixed version (ground truth):
WrapLabelView(Element elem){
  super(elem);
}
Program: 80658
Project: 80658
Buggy source:
private static WebPanel createListPanel(final WebTable list,String overlayText,WebToggleButton button){
  WebOverlay listOverlay=new WebOverlay(list);
  listOverlay.setOverlayMargin(20);
  final WebTextArea overlayArea=new WebTextArea();
  overlayArea.setText(overlayText);
  overlayArea.setLineWrap(true);
  overlayArea.setWrapStyleWord(true);
  overlayArea.setMargin(View.MARGIN_DEFAULT);
  overlayArea.setFontSize(View.FONT_SIZE_BIG);
  overlayArea.setEditable(false);
  BorderPainter<WebTextArea> borderPainter=new BorderPainter<>(Color.LIGHT_GRAY);
  borderPainter.setRound(15);
  overlayArea.setPainter(borderPainter);
  list.getModel().addTableModelListener(new TableModelListener(){
    @Override public void tableChanged(    TableModelEvent e){
      overlayArea.setVisible(list.getModel().getRowCount() == 0);
    }
  }
);
  overlayArea.setVisible(list.getModel().getRowCount() == 0);
  listOverlay.addOverlay(overlayArea,SwingConstants.CENTER,SwingConstants.CENTER);
  WebScrollPane scrollPane=new ComponentUtils.ScrollPane(listOverlay);
  scrollPane.setDrawBorder(false);
  button.setOpaque(false);
  button.setUndecorated(true);
  WebOverlay chatListOverlay=new WebOverlay(scrollPane,button,SwingConstants.TRAILING,SwingConstants.BOTTOM);
  chatListOverlay.setOverlayMargin(0,0,View.GAP_BIG,View.GAP_BIG + SCROLL_BAR_WIDTH);
  return chatListOverlay;
}

Fixed version (ground truth):
private static WebPanel createListPanel(final WebTable list,String overlayText,WebToggleButton button){
  WebOverlay listOverlay=new WebOverlay(list);
  listOverlay.setOverlayMargin(20);
  final WebTextArea overlayArea=new WebTextArea();
  overlayArea.setText(overlayText);
  overlayArea.setLineWrap(true);
  overlayArea.setWrapStyleWord(true);
  overlayArea.setMargin(View.MARGIN_DEFAULT);
  overlayArea.setFontSize(View.FONT_SIZE_BIG);
  overlayArea.setEditable(false);
  BorderPainter<WebTextArea> borderPainter=new BorderPainter<>(Color.LIGHT_GRAY);
  borderPainter.setRound(15);
  overlayArea.setPainter(borderPainter);
  list.getModel().addTableModelListener(new TableModelListener(){
    @Override public void tableChanged(    TableModelEvent e){
      overlayArea.setVisible(list.getModel().getRowCount() == 0);
    }
  }
);
  overlayArea.setVisible(list.getModel().getRowCount() == 0);
  listOverlay.addOverlay(overlayArea,SwingConstants.CENTER,SwingConstants.CENTER);
  WebScrollPane scrollPane=new ComponentUtils.ScrollPane(listOverlay);
  scrollPane.setDrawBorder(false);
  button.setOpaque(false);
  button.setUndecorated(true);
  WebOverlay chatListOverlay=new WebOverlay(scrollPane,button,SwingConstants.TRAILING,SwingConstants.BOTTOM);
  chatListOverlay.setOverlayMargin(0,0,View.GAP_BIG,View.GAP_BIG + SCROLL_BAR_WIDTH);
  SwingUtils.delayInvokeLater(0,new Runnable(){
    @Override public void run(){
      TooltipManager.showOneTimeTooltip(list,new Point(1,1),"String_Node_Str");
    }
  }
);
  return chatListOverlay;
}
Program: 80659
Project: 80659
Buggy source:
@Override public JPopupMenu getComponentPopupMenu(){
  WebPopupMenu menu=new WebPopupMenu();
  if (mFile == null)   return null;
  WebMenuItem saveMenuItem=new WebMenuItem(Tr.tr("String_Node_Str"));
  saveMenuItem.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      if (mFile == null)       return;
      mFileChooser.setSelectedFile(new File(mFileChooser.getCurrentDirectory(),mFile.getName()));
      int option=mFileChooser.showSaveDialog(AttachmentPanel.this);
      if (option == JFileChooser.APPROVE_OPTION) {
        try {
          Files.copy(mFile.toPath(),mFileChooser.getSelectedFile().toPath(),StandardCopyOption.REPLACE_EXISTING);
        }
 catch (        IOException ex) {
          LOGGER.log(Level.WARNING,"String_Node_Str",ex);
        }
      }
    }
  }
);
  if (!mFile.exists()) {
    saveMenuItem.setEnabled(false);
    saveMenuItem.setToolTipText(Tr.tr("String_Node_Str"));
  }
  menu.add(saveMenuItem);
  return menu;
}

Fixed version (ground truth):
@Override public JPopupMenu getComponentPopupMenu(){
  WebPopupMenu menu=new WebPopupMenu();
  if (mFile == null)   return null;
  WebMenuItem saveMenuItem=new WebMenuItem(Tr.tr("String_Node_Str"));
  saveMenuItem.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      if (mFile == null)       return;
      File suggestedFile=new File(mFileChooser.getCurrentDirectory(),mFile.getName());
      mFileChooser.setSelectedFile(suggestedFile);
      mFileChooser.getFileChooserPanel().setSelectedFiles(new File[]{suggestedFile});
      int option=mFileChooser.showSaveDialog(AttachmentPanel.this);
      if (option == JFileChooser.APPROVE_OPTION) {
        try {
          Files.copy(mFile.toPath(),mFileChooser.getSelectedFile().toPath(),StandardCopyOption.REPLACE_EXISTING);
        }
 catch (        IOException ex) {
          LOGGER.log(Level.WARNING,"String_Node_Str",ex);
        }
      }
    }
  }
);
  if (!mFile.exists()) {
    saveMenuItem.setEnabled(false);
    saveMenuItem.setToolTipText(Tr.tr("String_Node_Str"));
  }
  menu.add(saveMenuItem);
  return menu;
}
Program: 80660
Project: 80660
Buggy source:
private void updateView(Object arg){
  if (arg == null || arg instanceof Contact || arg instanceof String || arg instanceof GroupCommand) {
    mTitleLabel.setText(Utils.chatTitle(mValue));
  }
  if (arg == null || arg instanceof Contact || arg instanceof String) {
    mAvatar.setImage(AvatarLoader.load(mValue));
  }
  if (arg == null || arg instanceof KonMessage) {
    this.updateBG();
    mStatusLabel.setText(lastActivity(mValue,true));
    ChatListView.this.updateSorting();
  }
 else   if (arg instanceof Boolean) {
    this.updateBG();
  }
 else   if (arg instanceof Timer) {
    mStatusLabel.setText(lastActivity(mValue,true));
  }
  String stateText="String_Node_Str";
  if (arg instanceof Member) {
    Member member=(Member)arg;
switch (member.getState()) {
case composing:
      stateText=Tr.tr("String_Node_Str");
    break;
}
if (!stateText.isEmpty() && mValue.isGroupChat()) stateText=member.getContact().getName() + "String_Node_Str" + stateText;
}
if (stateText.isEmpty()) {
mChatStateLabel.setText("String_Node_Str");
mStatusLabel.setVisible(true);
}
 else {
mChatStateLabel.setText(stateText);
mStatusLabel.setVisible(false);
}
}

Fixed version (ground truth):
private void updateView(Object arg){
  if (arg == null || arg instanceof Contact || arg instanceof String || arg instanceof GroupCommand) {
    mTitleLabel.setText(Utils.chatTitle(mValue));
  }
  if (arg == null || arg instanceof Contact || arg instanceof String) {
    Utils.fixedSetWebImageImage(mAvatar,AvatarLoader.load(mValue));
  }
  if (arg == null || arg instanceof KonMessage) {
    this.updateBG();
    mStatusLabel.setText(lastActivity(mValue,true));
    ChatListView.this.updateSorting();
  }
 else   if (arg instanceof Boolean) {
    this.updateBG();
  }
 else   if (arg instanceof Timer) {
    mStatusLabel.setText(lastActivity(mValue,true));
  }
  String stateText="String_Node_Str";
  if (arg instanceof Member) {
    Member member=(Member)arg;
switch (member.getState()) {
case composing:
      stateText=Tr.tr("String_Node_Str");
    break;
}
if (!stateText.isEmpty() && mValue.isGroupChat()) stateText=member.getContact().getName() + "String_Node_Str" + stateText;
}
if (stateText.isEmpty()) {
mChatStateLabel.setText("String_Node_Str");
mStatusLabel.setVisible(true);
}
 else {
mChatStateLabel.setText(stateText);
mStatusLabel.setVisible(false);
}
}
Program: 80661
Project: 80661
Buggy source:
@Override protected void updateOnEDT(Object arg){
  if (arg == null || arg instanceof String) {
    mAvatar.setImage(AvatarLoader.load(mValue));
    String name=Utils.displayName(mValue);
    if (!name.equals(mNameLabel.getText())) {
      mNameLabel.setText(name);
      ContactListView.this.updateSorting();
    }
  }
  if (arg == null || arg instanceof Contact.Subscription || arg instanceof Contact.Online) {
    mStatusLabel.setText(Utils.mainStatus(mValue,false));
  }
  if (arg == null || arg instanceof Contact.Subscription) {
    Contact.Subscription subStatus=mValue.getSubScription();
    mBackground=mValue.getOnline() == Contact.Online.YES ? View.LIGHT_BLUE : subStatus == Contact.Subscription.UNSUBSCRIBED || subStatus == Contact.Subscription.PENDING || mValue.isBlocked() ? View.LIGHT_GREY : Color.WHITE;
    this.setBackground(mBackground);
  }
  ContactListView.this.repaint();
}

Fixed version (ground truth):
@Override protected void updateOnEDT(Object arg){
  if (arg == null || arg instanceof String) {
    Utils.fixedSetWebImageImage(mAvatar,AvatarLoader.load(mValue));
    String name=Utils.displayName(mValue);
    if (!name.equals(mNameLabel.getText())) {
      mNameLabel.setText(name);
      ContactListView.this.updateSorting();
    }
  }
  if (arg == null || arg instanceof Contact.Subscription || arg instanceof Contact.Online) {
    mStatusLabel.setText(Utils.mainStatus(mValue,false));
  }
  if (arg == null || arg instanceof Contact.Subscription) {
    Contact.Subscription subStatus=mValue.getSubScription();
    mBackground=mValue.getOnline() == Contact.Online.YES ? View.LIGHT_BLUE : subStatus == Contact.Subscription.UNSUBSCRIBED || subStatus == Contact.Subscription.PENDING || mValue.isBlocked() ? View.LIGHT_GREY : Color.WHITE;
    this.setBackground(mBackground);
  }
  ContactListView.this.repaint();
}
Program: 80662
Project: 80662
Buggy source:
public boolean execDeleteWhereInsecure(String table,String where){
  try (Statement stat=mConn.createStatement()){
    int c=stat.executeUpdate("String_Node_Str" + table + "String_Node_Str"+ where);
    LOGGER.info("String_Node_Str" + c + "String_Node_Str"+ table+ "String_Node_Str"+ where);
  }
 catch (  SQLException ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean execDeleteWhereInsecure(String table,String where){
  LOGGER.info("String_Node_Str" + table + "String_Node_Str"+ where);
  try (Statement stat=mConn.createStatement()){
    int c=stat.executeUpdate("String_Node_Str" + table + "String_Node_Str"+ where);
    LOGGER.config("String_Node_Str" + c + "String_Node_Str");
  }
 catch (  SQLException ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
    return false;
  }
  return true;
}
Program: 80663
Project: 80663
Buggy source:
public ChatMessages(Chat chat){
  mChat=chat;
}

Fixed version (ground truth):
ChatMessages(Chat chat,boolean newChat){
  mChat=chat;
  mLoaded=newChat;
}