nus-yam/ex-repair huggingface dataset:
Program: 147362
Project: 147362
Buggy source:
private int handleLink(final XMLEventReader rdr) throws XMLStreamException {
  XMLEvent linkContent=rdr.nextEvent();
  if (!linkContent.isCharacters())   throw new RuntimeException("String_Node_Str");
  return rdr.nextEvent().getLocation().getCharacterOffset();
}

Fixed version (ground truth):
private int handleLink(final XMLEventReader rdr) throws XMLStreamException {
  XMLEvent linkContent=rdr.nextEvent();
  if (linkContent.isEndElement())   return linkContent.getLocation().getCharacterOffset();
 else   if (linkContent.isCharacters())   return rdr.nextEvent().getLocation().getCharacterOffset();
 else   throw new RuntimeException("String_Node_Str");
}
Program: 147364
Project: 147364
Buggy source:
@Override public Communication getRoot(){
  return null;
}

Fixed version (ground truth):
@Override public Communication getRoot(){
  return this.csc.getRoot();
}
Program: 147365
Project: 147365
Buggy source:
@Override public List<Sentence> getSentences(){
  return null;
}

Fixed version (ground truth):
@Override public List<Sentence> getSentences(){
  return this.csc.getSentences();
}
Program: 147366
Project: 147366
Buggy source:
@Override public List<Section> getSections(){
  return null;
}

Fixed version (ground truth):
@Override public List<Section> getSections(){
  return this.csc.getSections();
}
Program: 147367
Project: 147367
Buggy source:
@Override public Map<UUID,Sentence> getUuidToSentenceMap(){
  return null;
}

Fixed version (ground truth):
@Override public Map<UUID,Sentence> getUuidToSentenceMap(){
  return this.csc.getUuidToSentenceMap();
}
Program: 147368
Project: 147368
Buggy source:
@Override public boolean isAnnotatable(Communication c){
  boolean hasSections=c.isSetSectionList() && c.getSectionListSize() > 0;
  boolean valid=hasSections && c.isSetText() && !c.getText().equals("String_Node_Str");
  return valid;
}

Fixed version (ground truth):
@Override public boolean isAnnotatable(Communication c){
  boolean hasSections=c.isSetSectionList() && c.getSectionListSize() > 0;
  boolean valid=!hasSections && c.isSetText() && !c.getText().equals("String_Node_Str");
  return valid;
}
Program: 147370
Project: 147370
Buggy source:
@Override public Communication toCommunication(){
  final String localId="String_Node_Str" + this.anytd.getGuid();
  try {
    AnnotationMetadata md=TooledMetadataConverter.convert(this);
    CommunicationMetadata cmd=new CommunicationMetadata();
    cmd.setNitfInfo(extractNITFInfo(this.anytd));
    Communication c=CommunicationFactory.create(localId);
    c.setMetadata(md);
    c.setCommunicationMetadata(cmd);
    c.setType("String_Node_Str");
    int ctr=0;
    StringBuilder ctxt=new StringBuilder();
    List<StringStringStringTuple> sstList=this.extractTuples().sequential().collect(Collectors.toList());
    final int lSize=sstList.size();
    for (int i=0; i < lSize; i++) {
      final StringStringStringTuple t=sstList.get(i);
      final String skind=t.getS1();
      final String slabel=t.getS2();
      final String txt=t.getS3();
      final int txtlen=txt.length();
      final TextSpan ts=new TextSpan(ctr,ctr + txtlen);
      final Section s=SectionFactory.fromTextSpan(ts,skind);
      s.setLabel(slabel);
      c.addToSectionList(s);
      ctxt.append(txt);
      if (i + 1 != lSize) {
        ctxt.append(System.lineSeparator());
        ctxt.append(System.lineSeparator());
        ctr+=txtlen + 2;
      }
    }
    c.setText(ctxt.toString());
    return c;
  }
 catch (  ConcreteException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public Communication toCommunication(){
  final String localId="String_Node_Str" + this.anytd.getGuid();
  try {
    AnnotationMetadata md=TooledMetadataConverter.convert(this);
    CommunicationMetadata cmd=new CommunicationMetadata();
    cmd.setNitfInfo(extractNITFInfo(this.anytd));
    Communication c=CommunicationFactory.create(localId);
    c.setMetadata(md);
    c.setCommunicationMetadata(cmd);
    c.setType("String_Node_Str");
    int ctr=0;
    StringBuilder ctxt=new StringBuilder();
    List<StringStringStringTuple> sstList=this.extractTuples().sequential().collect(Collectors.toList());
    final int lSize=sstList.size();
    LOGGER.debug("String_Node_Str",lSize);
    for (int i=0; i < lSize; i++) {
      LOGGER.debug("String_Node_Str",ctr);
      final StringStringStringTuple t=sstList.get(i);
      final String skind=t.getS1();
      LOGGER.debug("String_Node_Str",skind);
      final String slabel=t.getS2();
      LOGGER.debug("String_Node_Str",slabel);
      final String txt=t.getS3();
      LOGGER.debug("String_Node_Str",txt);
      final int txtlen=txt.length();
      LOGGER.debug("String_Node_Str",ctr,ctr + txtlen);
      final TextSpan ts=new TextSpan(ctr,ctr + txtlen);
      final Section s=SectionFactory.fromTextSpan(ts,skind);
      s.setLabel(slabel);
      c.addToSectionList(s);
      ctxt.append(txt);
      if (i + 1 != lSize) {
        ctxt.append(System.lineSeparator());
        ctxt.append(System.lineSeparator());
        ctr+=txtlen + 2;
      }
    }
    final String ctxtstr=ctxt.toString();
    LOGGER.debug("String_Node_Str",ctxtstr.length());
    c.setText(ctxtstr);
    return c;
  }
 catch (  ConcreteException e) {
    throw new RuntimeException(e);
  }
}
Program: 147371
Project: 147371
Buggy source:
public CachedSentencedCommunication(final Communication orig) throws MiscommunicationException {
  this.cpy=new CachedSectionedCommunication(orig);
  Optional<Section> bs=this.cpy.getSections().stream().filter(s -> validSentencePredicate(s)).findAny();
  if (bs.isPresent())   throw new MiscommunicationException("String_Node_Str" + bs.get().getUuid().getUuidString() + "String_Node_Str");
  final Map<UUID,Sentence> toRet=new LinkedHashMap<>();
  List<Section> sectList=new ArrayList<>(this.cpy.getSections());
  for (  Section s : sectList)   for (  Sentence st : s.getSentenceList())   toRet.put(st.getUuid(),st);
  this.sentIdToSentenceMap=toRet;
}

Fixed version (ground truth):
public CachedSentencedCommunication(final Communication orig) throws MiscommunicationException {
  this.cpy=new CachedSectionedCommunication(orig);
  List<Section> sectList=this.cpy.getSections();
  Optional<Section> bs=sectList.stream().filter(s -> !validSentencePredicate(s)).findAny();
  if (bs.isPresent())   throw new MiscommunicationException("String_Node_Str" + bs.get().getUuid().getUuidString() + "String_Node_Str");
  final Map<UUID,Sentence> toRet=new LinkedHashMap<>();
  for (  Section s : sectList)   for (  Sentence st : s.getSentenceList())   toRet.put(st.getUuid(),st);
  this.sentIdToSentenceMap=toRet;
}
Program: 147372
Project: 147372
Buggy source:
public CachedTokenizationCommunication(final Communication orig) throws MiscommunicationException {
  this.cpy=new CachedSentencedCommunication(orig);
  Optional<Sentence> bs=this.cpy.getSentences().stream().filter(s -> validPredicate(s)).findAny();
  if (bs.isPresent())   throw new MiscommunicationException("String_Node_Str" + bs.get().getUuid().getUuidString() + "String_Node_Str");
  final Map<UUID,Tokenization> toRet=new LinkedHashMap<>();
  List<Sentence> stList=new ArrayList<>(this.cpy.getSentences());
  for (  Sentence st : stList) {
    Tokenization tok=st.getTokenization();
    UUID tId=tok.getUuid();
    toRet.put(tId,tok);
  }
  this.tokenizationIdToTokenizationMap=toRet;
}

Fixed version (ground truth):
public CachedTokenizationCommunication(final Communication orig) throws MiscommunicationException {
  this.cpy=new CachedSentencedCommunication(orig);
  Optional<Sentence> bs=this.cpy.getSentences().stream().filter(s -> !validPredicate(s)).findAny();
  if (bs.isPresent())   throw new MiscommunicationException("String_Node_Str" + bs.get().getUuid().getUuidString() + "String_Node_Str");
  final Map<UUID,Tokenization> toRet=new LinkedHashMap<>();
  List<Sentence> stList=new ArrayList<>(this.cpy.getSentences());
  for (  Sentence st : stList) {
    Tokenization tok=st.getTokenization();
    UUID tId=tok.getUuid();
    toRet.put(tId,tok);
  }
  this.tokenizationIdToTokenizationMap=toRet;
}
Program: 147373
Project: 147373
Buggy source:
public boolean validate(){
  boolean valid=true;
  Iterator<Section> sectIter=this.comm.getSectionListIterator();
  while (valid && sectIter.hasNext()) {
    Section s=sectIter.next();
    valid=new ValidatableSection(s).validate(this.comm);
    Iterator<Sentence> sentIter=s.getSentenceListIterator();
    while (valid && sentIter.hasNext()) {
      Sentence st=sentIter.next();
      valid=new ValidatableSentence(st).validate(this.comm);
      Tokenization tok=st.getTokenization();
      valid=new ValidatableTokenization(tok).validate(this.comm);
    }
  }
  if (this.comm.isSetEntityMentionSetList()) {
    Iterator<EntityMentionSet> emsIter=this.comm.getEntityMentionSetListIterator();
    while (valid && emsIter.hasNext()) {
      EntityMentionSet ems=emsIter.next();
      valid=new ValidatableEntityMentionSet(ems).validate(this.comm);
    }
  }
  return valid;
}

Fixed version (ground truth):
public boolean validate(){
  boolean valid=true;
  Iterator<Section> sectIter=this.comm.getSectionListIterator();
  while (valid && sectIter != null && sectIter.hasNext()) {
    Section s=sectIter.next();
    valid=new ValidatableSection(s).validate(this.comm);
    Iterator<Sentence> sentIter=s.getSentenceListIterator();
    while (valid && sentIter != null && sentIter.hasNext()) {
      Sentence st=sentIter.next();
      valid=new ValidatableSentence(st).validate(this.comm);
      Tokenization tok=st.getTokenization();
      valid=new ValidatableTokenization(tok).validate(this.comm);
    }
  }
  if (this.comm.isSetEntityMentionSetList()) {
    Iterator<EntityMentionSet> emsIter=this.comm.getEntityMentionSetListIterator();
    while (valid && emsIter.hasNext()) {
      EntityMentionSet ems=emsIter.next();
      valid=new ValidatableEntityMentionSet(ems).validate(this.comm);
    }
  }
  return valid;
}
Program: 147374
Project: 147374
Buggy source:
@Override public Communication fromCharacterBasedFile(Path path) throws IngestException {
  try {
    ExistingNonDirectoryFile f=new ExistingNonDirectoryFile(path);
    try (InputStream is=Files.newInputStream(path)){
      String content=IOUtils.toString(is,StandardCharsets.UTF_8);
      Communication c=CommunicationFactory.create(f.getName(),content);
      c.setType(this.commKind);
      c.setMetadata(this.getMetadata());
      String[] split2xNewline=content.split(doubleLineSep);
      Stream.Builder<TextSpanKindTuple> stream=Stream.builder();
      int charCtr=0;
      for (      String s : split2xNewline) {
        final int len=s.length();
        TextSpan ts=new TextSpan(charCtr,len + charCtr);
        charCtr=len + 2;
        stream.add(new TextSpanKindTuple(ts,this.sectionKindLabel));
      }
      Stream<Section> sections=SectionFactory.fromTextSpanStream(stream.build());
      sections.forEach(s -> c.addToSectionList(s));
      return c;
    }
 catch (    IOException e) {
      throw new IngestException("String_Node_Str",e);
    }
catch (    ConcreteException e) {
      throw new IngestException(e);
    }
  }
 catch (  NoSuchFileException|NotFileException e) {
    throw new IngestException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public Communication fromCharacterBasedFile(Path path) throws IngestException {
  try {
    ExistingNonDirectoryFile f=new ExistingNonDirectoryFile(path);
    try (InputStream is=Files.newInputStream(path)){
      String content=IOUtils.toString(is,StandardCharsets.UTF_8);
      Communication c=CommunicationFactory.create(f.getName(),content);
      c.setType(this.commKind);
      c.setMetadata(this.getMetadata());
      String[] split2xNewline=content.split(doubleLineSep);
      Stream.Builder<TextSpanKindTuple> stream=Stream.builder();
      int charCtr=0;
      for (      String s : split2xNewline) {
        final int len=s.length();
        final int sum=len + charCtr;
        TextSpan ts=new TextSpan(charCtr,sum);
        charCtr=sum + 2;
        stream.add(new TextSpanKindTuple(ts,this.sectionKindLabel));
      }
      Stream<Section> sections=SectionFactory.fromTextSpanStream(stream.build());
      sections.forEach(s -> c.addToSectionList(s));
      return c;
    }
 catch (    IOException e) {
      throw new IngestException("String_Node_Str",e);
    }
catch (    ConcreteException e) {
      throw new IngestException(e);
    }
  }
 catch (  NoSuchFileException|NotFileException e) {
    throw new IngestException("String_Node_Str",e);
  }
}
Program: 147375
Project: 147375
Buggy source:
@Test public void testFromCharacterBasedFile() throws IngestException {
  UTF8FileIngester ing=new DoubleLineBreakFileIngester("String_Node_Str","String_Node_Str");
  Communication c=ing.fromCharacterBasedFile(tmpPath);
  assertEquals(testContent,c.getText());
  Section sOne=c.getSectionList().get(0);
  assertEquals("String_Node_Str",sOne.getKind());
  TextSpan tsOne=sOne.getTextSpan();
  assertEquals(0,tsOne.getStart());
  assertEquals(5,tsOne.getEnding());
  Section sTwo=c.getSectionList().get(1);
  TextSpan tsTwo=sTwo.getTextSpan();
  assertEquals(7,tsTwo.getStart());
  assertEquals(12,tsTwo.getEnding());
  assertEquals(testContent.length(),tsTwo.getEnding());
}

Fixed version (ground truth):
@Test public void testFromCharacterBasedFile() throws IngestException {
  UTF8FileIngester ing=new DoubleLineBreakFileIngester("String_Node_Str","String_Node_Str");
  Communication c=ing.fromCharacterBasedFile(tmpPath);
  List<Section> sList=c.getSectionList();
  assertEquals(testContent,c.getText());
  assertEquals(3,c.getSectionListSize());
  Section sOne=c.getSectionList().get(0);
  assertEquals("String_Node_Str",sOne.getKind());
  TextSpan tsOne=sOne.getTextSpan();
  assertEquals(0,tsOne.getStart());
  assertEquals(5,tsOne.getEnding());
  Section sTwo=c.getSectionList().get(1);
  TextSpan tsTwo=sTwo.getTextSpan();
  assertEquals(7,tsTwo.getStart());
  assertEquals(12,tsTwo.getEnding());
  assertEquals(testContent.length(),sList.get(2).getTextSpan().getEnding());
}
Program: 147376
Project: 147376
Buggy source:
@Before public void setUp() throws Exception {
  tmpPath=tf.getRoot().toPath().resolve("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(System.lineSeparator());
  sb.append(System.lineSeparator());
  sb.append("String_Node_Str");
  testContent=sb.toString();
  try (FileWriterWithEncoding writer=new FileWriterWithEncoding(tmpPath.toFile(),StandardCharsets.UTF_8)){
    writer.write(testContent);
  }
 }

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  tmpPath=tf.getRoot().toPath().resolve("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(System.lineSeparator());
  sb.append(System.lineSeparator());
  sb.append("String_Node_Str");
  sb.append(System.lineSeparator());
  sb.append(System.lineSeparator());
  sb.append("String_Node_Str");
  testContent=sb.toString();
  try (FileWriterWithEncoding writer=new FileWriterWithEncoding(tmpPath.toFile(),StandardCharsets.UTF_8)){
    writer.write(testContent);
  }
 }
Program: 147377
Project: 147377
Buggy source:
public Communication communication(){
  return new Communication().setUuid(UUIDFactory.newUUID()).setId("String_Node_Str" + this.r.nextInt(Integer.MAX_VALUE)).setText("String_Node_Str").setType(this.communicationType()).setMetadata(AnnotationMetadataFactory.fromCurrentUTCTime().setTool("String_Node_Str"));
}

Fixed version (ground truth):
public Communication communication(){
  return new Communication().setUuid(UUIDFactory.newUUID()).setId("String_Node_Str" + this.r.nextInt(Integer.MAX_VALUE)).setText("String_Node_Str").setType(this.communicationType()).setMetadata(AnnotationMetadataFactory.fromCurrentLocalTime().setTool("String_Node_Str"));
}
Program: 147378
Project: 147378
Buggy source:
@Override public String getFileName(){
  return this.id;
}

Fixed version (ground truth):
@Override public String getFileName(){
  return this.id + ext;
}
Program: 147379
Project: 147379
Buggy source:
@Override public Communication fromCharacterBasedFile(Path path,Charset charset) throws IngestException {
  try {
    ExistingNonDirectoryFile f=new ExistingNonDirectoryFile(path);
    try (InputStream is=Files.newInputStream(f.getPath());BufferedInputStream bis=new BufferedInputStream(is);Scanner sc=new Scanner(bis,this.cs.toString())){
      StringBuilder sb=new StringBuilder();
      while (sc.hasNextLine())       sb.append(sc.nextLine());
      String content=sb.toString();
      return CommunicationFactory.create(f.getName(),content,"String_Node_Str");
    }
 catch (    IOException e) {
      throw new IngestException("String_Node_Str",e);
    }
catch (    ConcreteException e) {
      throw new IngestException(e);
    }
  }
 catch (  NoSuchFileException|NotFileException e) {
    throw new IngestException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public Communication fromCharacterBasedFile(Path path,Charset charset) throws IngestException {
  try {
    ExistingNonDirectoryFile f=new ExistingNonDirectoryFile(path);
    try (InputStream is=Files.newInputStream(f.getPath())){
      String content=IOUtils.toString(is,this.cs);
      return CommunicationFactory.create(f.getName(),content,"String_Node_Str");
    }
 catch (    IOException e) {
      throw new IngestException("String_Node_Str",e);
    }
catch (    ConcreteException e) {
      throw new IngestException(e);
    }
  }
 catch (  NoSuchFileException|NotFileException e) {
    throw new IngestException("String_Node_Str",e);
  }
}
Program: 147380
Project: 147380
Buggy source:
/** 
 * Generate a   {@link Communication} object with basic fields set.
 */
public Communication randomCommunication(){
  return new Communication().setUuid(new ConcreteUUIDFactory().getConcreteUUID()).setId("String_Node_Str" + Math.abs(this.r.nextInt())).setText("String_Node_Str").setType(this.randomCommunicationType()).setMetadata(this.randomMetadata());
}

Fixed version (ground truth):
/** 
 * Generate a   {@link Communication} object with basic fields set.
 */
public Communication randomCommunication(){
  return new Communication().setUuid(new ConcreteUUIDFactory().getConcreteUUID()).setId("String_Node_Str" + this.r.nextInt(Integer.MAX_VALUE)).setText("String_Node_Str").setType(this.randomCommunicationType()).setMetadata(this.randomMetadata());
}
Program: 147381
Project: 147381
Buggy source:
/** 
 * Iterate over all   {@link SectionSegmentation}s and create a   {@link Map} of [SectionID, Section].
 * @return a {@link Map} whose keys contain {@link Section} {@link UUID} strings, and whose values contain {@link Section} objects with that id string.
 */
private final Map<UUID,Section> sectionIdToSectionMap(){
  final Map<UUID,Section> toRet=new HashMap<>();
  if (this.comm.isSetSectionSegmentationList())   for (  SectionSegmentation ss : this.comm.getSectionSegmentationList())   if (ss.isSetSectionList())   for (  Section s : ss.getSectionList())   toRet.put(s.getUuid(),s);
  return toRet;
}

Fixed version (ground truth):
/** 
 * Iterate over all   {@link SectionSegmentation}s and create a   {@link Map} of [SectionID, Section].
 * @return a {@link Map} whose keys contain {@link Section} {@link UUID} strings, and whose values contain {@link Section} objects with that id string.
 */
private final Map<UUID,Section> sectionIdToSectionMap(){
  final Map<UUID,Section> toRet=new HashMap<>();
  for (  Section ss : this.comm.getSectionList())   toRet.put(ss.getUuid(),ss);
  return toRet;
}
Program: 147382
Project: 147382
Buggy source:
/** 
 * Return a   {@link Map} of [SentenceID, Sentence] for all {@link SentenceSegmentation}s in all   {@link SectionSegmentation}s.
 * @return a {@link Map} whose keys contain {@link Sentence} {@link UUID} strings, and whose values contain {@link Section} objects with that id string.
 */
private final Map<UUID,Sentence> sentIdToSentenceMap(){
  final Map<UUID,Sentence> toRet=new HashMap<>();
  List<Section> sectList=new ArrayList<>(this.sectionIdToSectionMap.values());
  for (  Section s : sectList)   if (s.isSetSentenceSegmentationList())   for (  SentenceSegmentation ss : s.getSentenceSegmentationList())   if (ss.isSetSentenceList())   for (  Sentence st : ss.getSentenceList())   toRet.put(st.getUuid(),st);
  return toRet;
}

Fixed version (ground truth):
/** 
 * Return a   {@link Map} of [SentenceID, Sentence] for all {@link SentenceSegmentation}s in all   {@link SectionSegmentation}s.
 * @return a {@link Map} whose keys contain {@link Sentence} {@link UUID} strings, and whose values contain {@link Section} objects with that id string.
 */
private final Map<UUID,Sentence> sentIdToSentenceMap(){
  final Map<UUID,Sentence> toRet=new HashMap<>();
  List<Section> sectList=new ArrayList<>(this.sectionIdToSectionMap.values());
  for (  Section s : sectList)   for (  Sentence st : s.getSentenceList())   toRet.put(st.getUuid(),st);
  return toRet;
}
Program: 147383
Project: 147383
Buggy source:
/** 
 * True if this   {@link Communication} contains annotations that are not part of a"root"  {@link Communication}. Used in rebar to see if any dangling annotations exist and chop them off if needed. 
 */
public boolean containsAnnotations(){
  return this.comm.isSetSectionSegmentationList() || this.comm.isSetEntityMentionSetList() || this.comm.isSetEntitySetList()|| this.comm.isSetSituationMentionSetList()|| this.comm.isSetSituationSetList()|| this.comm.isSetLidList();
}

Fixed version (ground truth):
/** 
 * True if this   {@link Communication} contains annotations that are not part of a"root"  {@link Communication}. Used in rebar to see if any dangling annotations exist and chop them off if needed. 
 */
public boolean containsAnnotations(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 147384
Project: 147384
Buggy source:
/** 
 * Get the first   {@link Tokenization}.
 * @return the first {@link Tokenization}
 * @throws ConcreteException if there is no  {@link Tokenization}, or if any of the prerequisites are missing.
 */
public Tokenization firstTokenization() throws ConcreteException {
  Sentence s=this.firstSentence();
  if (s.isSetTokenizationList() && s.getTokenizationListSize() > 0)   return s.getTokenizationList().get(0);
 else   throw new ConcreteException("String_Node_Str" + s.getUuid() + "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get the first   {@link Tokenization}.
 * @return the first {@link Tokenization}
 * @throws ConcreteException if there is no  {@link Tokenization}, or if any of the prerequisites are missing.
 */
public Tokenization firstTokenization() throws ConcreteException {
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 147385
Project: 147385
Buggy source:
@Override public Map<UUID,Sentence> generateSentenceIdToSectionMap(){
  if (this.sectionIdToSectionMap == null)   this.generateSectionIdToSectionMap();
  if (this.sentIdToSentenceMap != null)   return new HashMap<>(this.sentIdToSentenceMap);
 else {
    final Map<UUID,Sentence> toRet=new HashMap<>();
    List<Section> sectList=new ArrayList<>(this.sectionIdToSectionMap.values());
    for (    Section s : sectList)     if (s.isSetSentenceSegmentationList())     for (    SentenceSegmentation ss : s.getSentenceSegmentationList())     if (ss.isSetSentenceList())     for (    Sentence st : ss.getSentenceList())     toRet.put(st.getUuid(),st);
    this.sentIdToSentenceMap=toRet;
    return new HashMap<>(toRet);
  }
}

Fixed version (ground truth):
@Override public Map<UUID,Sentence> generateSentenceIdToSectionMap(){
  if (this.sectionIdToSectionMap == null)   this.generateSectionIdToSectionMap();
  if (this.sentIdToSentenceMap != null)   return new HashMap<>(this.sentIdToSentenceMap);
 else {
    final Map<UUID,Sentence> toRet=new HashMap<>();
    List<Section> sectList=new ArrayList<>(this.sectionIdToSectionMap.values());
    for (    Section s : sectList)     for (    Sentence st : s.getSentenceList())     toRet.put(st.getUuid(),st);
    this.sentIdToSentenceMap=toRet;
    return new HashMap<>(toRet);
  }
}
Program: 147386
Project: 147386
Buggy source:
private final Map<UUID,Tokenization> tokenizationIdToTokenizationMap(){
  final Map<UUID,Tokenization> toRet=new HashMap<>();
  List<Sentence> stList=new ArrayList<>(this.sentIdToSentenceMap.values());
  for (  Sentence st : stList)   if (st.isSetTokenizationList())   for (  Tokenization t : st.getTokenizationList()) {
    UUID tId=t.getUuid();
    toRet.put(tId,t);
  }
  return toRet;
}

Fixed version (ground truth):
private final Map<UUID,Tokenization> tokenizationIdToTokenizationMap(){
  final Map<UUID,Tokenization> toRet=new HashMap<>();
  List<Sentence> stList=new ArrayList<>(this.sentIdToSentenceMap.values());
  for (  Sentence st : stList) {
    Tokenization tok=st.getTokenization();
    UUID tId=tok.getUuid();
    toRet.put(tId,tok);
  }
  return toRet;
}
Program: 147387
Project: 147387
Buggy source:
/** 
 * Get the first   {@link Section} from the first {@link SectionSegmentation} from the wrapped {@link Communication}.
 * @return the first {@link Section} from the first {@link SectionSegmentation}
 * @throws ConcreteException if there is no  {@link Section} or {@link SectionSegmentation}
 */
public Section firstSection() throws ConcreteException {
  SectionSegmentation ss=this.firstSectionSegmentation();
  if (this.hasSections())   return ss.getSectionList().get(0);
 else   throw new ConcreteException("String_Node_Str" + ss.getUuid() + "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get the first   {@link Section} from the first {@link SectionSegmentation} from the wrapped {@link Communication}.
 * @return the first {@link Section} from the first {@link SectionSegmentation}
 * @throws ConcreteException if there is no  {@link Section} or {@link SectionSegmentation}
 */
public Section firstSection() throws ConcreteException {
  if (this.hasSections())   return this.comm.getSectionList().get(0);
 else   throw new ConcreteException("String_Node_Str");
}
Program: 147388
Project: 147388
Buggy source:
@Override public Map<UUID,Section> generateSectionIdToSectionMap(){
  if (this.sectionIdToSectionMap != null)   return new HashMap<>(this.sectionIdToSectionMap);
 else {
    final Map<UUID,Section> map=new HashMap<>();
    if (this.comm.isSetSectionSegmentationList())     for (    SectionSegmentation ss : this.comm.getSectionSegmentationList())     if (ss.isSetSectionList())     for (    Section s : ss.getSectionList())     map.put(s.getUuid(),s);
    this.sectionIdToSectionMap=map;
    return new HashMap<>(map);
  }
}

Fixed version (ground truth):
@Override public Map<UUID,Section> generateSectionIdToSectionMap(){
  if (this.sectionIdToSectionMap != null)   return new HashMap<>(this.sectionIdToSectionMap);
 else {
    final Map<UUID,Section> map=new HashMap<>();
    for (    Section s : this.comm.getSectionList())     map.put(s.getUuid(),s);
    this.sectionIdToSectionMap=map;
    return new HashMap<>(map);
  }
}
Program: 147389
Project: 147389
Buggy source:
/** 
 * Return a "stripped"   {@link SuperCommunication} with extraneous annotations removed.
 */
public SuperCommunication stripAnnotations(){
  Communication copy=new Communication(this.comm);
  if (copy.isSetEntitySetList())   copy.unsetEntitySetList();
  if (copy.isSetEntityMentionSetList())   copy.unsetEntityMentionSetList();
  if (copy.isSetSituationSetList())   copy.unsetSituationSetList();
  if (copy.isSetSituationMentionSetList())   copy.unsetSituationMentionSetList();
  if (copy.isSetSectionSegmentationList())   copy.unsetSectionSegmentationList();
  if (copy.isSetLidList())   copy.unsetLidList();
  return new SuperCommunication(copy);
}

Fixed version (ground truth):
/** 
 * Return a "stripped"   {@link SuperCommunication} with extraneous annotations removed.
 */
public SuperCommunication stripAnnotations(){
  Communication copy=new Communication(this.comm);
  if (copy.isSetEntitySetList())   copy.unsetEntitySetList();
  if (copy.isSetEntityMentionSetList())   copy.unsetEntityMentionSetList();
  if (copy.isSetSituationSetList())   copy.unsetSituationSetList();
  if (copy.isSetSituationMentionSetList())   copy.unsetSituationMentionSetList();
  if (copy.isSetLidList())   copy.unsetLidList();
  return new SuperCommunication(copy);
}
Program: 147390
Project: 147390
Buggy source:
/** 
 * Get the first   {@link Sentence}.
 * @return the first {@link Sentence}
 * @throws ConcreteException if there is no  {@link Sentence}, or if any prerequisites are missing.
 */
public Sentence firstSentence() throws ConcreteException {
  SentenceSegmentation s=this.firstSentenceSegmentation();
  if (s.isSetSentenceList() && s.getSentenceListSize() > 0)   return s.getSentenceList().get(0);
 else   throw new ConcreteException("String_Node_Str" + s.getUuid() + "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get the first   {@link Sentence}.
 * @return the first {@link Sentence}
 * @throws ConcreteException if there is no  {@link Sentence}, or if any prerequisites are missing.
 */
public Sentence firstSentence() throws ConcreteException {
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 147391
Project: 147391
Buggy source:
/** 
 * @return true if {@link Section}(s) are present in all   {@link SectionSegmentation}s
 */
public boolean hasSections(){
  if (!this.hasSectionSegmentations())   return false;
  Iterator<SectionSegmentation> i=this.comm.getSectionSegmentationListIterator();
  boolean validSections=true;
  while (validSections && i.hasNext()) {
    SectionSegmentation ss=i.next();
    validSections=ss.isSetSectionList() && ss.getSectionListSize() > 0;
  }
  return validSections;
}

Fixed version (ground truth):
/** 
 * @return true if {@link Section}(s) are present in all   {@link SectionSegmentation}s
 */
public boolean hasSections(){
  return this.comm.isSetSectionList() && this.comm.getSectionListSize() > 0;
}
Program: 147392
Project: 147392
Buggy source:
private final Map<UUID,Tokenization> tokenizationIdToTokenizationMap(){
  final Map<UUID,Tokenization> toRet=new HashMap<>();
  List<Sentence> stList=new ArrayList<>(this.sentIdToSentenceMap.values());
  for (  Sentence st : stList)   if (st.isSetTokenizationList())   for (  Tokenization t : st.getTokenizationList()) {
    UUID tId=t.getUuid();
    toRet.put(tId,t);
  }
  return toRet;
}

Fixed version (ground truth):
private final Map<UUID,Tokenization> tokenizationIdToTokenizationMap(){
  final Map<UUID,Tokenization> toRet=new HashMap<>();
  List<Sentence> stList=new ArrayList<>(this.sentIdToSentenceMap.values());
  for (  Sentence st : stList) {
    Tokenization tok=st.getTokenization();
    UUID tId=tok.getUuid();
    toRet.put(tId,tok);
  }
  return toRet;
}
Program: 147393
Project: 147393
Buggy source:
@Override public final AnnotationMetadata getMetadata(){
  AnnotationMetadata md=new AnnotationMetadata();
  md.setConfidence(1.0);
  md.setTimestamp(System.currentTimeMillis());
  md.setTool("String_Node_Str");
  return md;
}

Fixed version (ground truth):
@Override public final AnnotationMetadata getMetadata(){
  AnnotationMetadata md=new AnnotationMetadata();
  md.setTimestamp(System.currentTimeMillis());
  md.setTool("String_Node_Str");
  return md;
}
Program: 147394
Project: 147394
Buggy source:
/** 
 * Generate an   {@link AnnotationMetadata} object.
 */
public AnnotationMetadata randomMetadata(){
  return new AnnotationMetadata().setConfidence(this.r.nextFloat()).setTimestamp(System.currentTimeMillis()).setTool("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Generate an   {@link AnnotationMetadata} object.
 */
public AnnotationMetadata randomMetadata(){
  return new AnnotationMetadata().setTimestamp(System.currentTimeMillis()).setTool("String_Node_Str");
}
Program: 147395
Project: 147395
Buggy source:
@Test public void test(){
  AnnotationMetadata md=new AnnotationMetadata();
  md.confidence=1f;
  System.out.println(md.toString());
  md.setConfidence(1F);
  System.out.println(md.toString());
  md.tool="String_Node_Str";
  System.out.println(md.toString());
}

Fixed version (ground truth):
@Test public void test(){
  AnnotationMetadata md=new AnnotationMetadata();
  System.out.println(md.toString());
  md.tool="String_Node_Str";
  System.out.println(md.toString());
}
Program: 147396
Project: 147396
Buggy source:
/** 
 * Same as   {@link #fromBytes(TBase,byte[])}, but takes in a   {@link String} that representsa path to a serialized  {@link TBase} object on disk. 
 * @see #fromBytes(TBase,Path)
 */
public <T extends TBase<T,? extends TFieldIdEnum>>T fromFileString(T object,String pathToSerializedFileString) throws ConcreteException {
  return this.fromBytes(object,Paths.get(pathToSerializedFileString));
}

Fixed version (ground truth):
/** 
 * Same as   {@link #fromBytes(TBase,byte[])}, but takes in a   {@link String} that representsa path to a serialized  {@link TBase} object on disk. 
 * @see #fromBytes(TBase,Path)
 */
public <T extends TBase<T,? extends TFieldIdEnum>>T fromFileString(T object,String pathToSerializedFileString) throws ConcreteException {
  return this.fromPath(object,Paths.get(pathToSerializedFileString));
}
Program: 147397
Project: 147397
Buggy source:
@Override public boolean isValid(){
  boolean init=this.validateUUID(this.annotation.getUuid()) && this.printStatus("String_Node_Str",this.annotation.isSetArgumentList()) && this.printStatus("String_Node_Str",this.annotation.getArgumentListSize() > 0)&& this.printStatus("String_Node_Str",this.annotation.isSetSituationType());
  if (!init)   return false;
 else {
    String st=this.annotation.getSituationType();
    if (st == "String_Node_Str")     return this.printStatus("String_Node_Str",this.annotation.isSetEventType());
 else     if (st == "String_Node_Str")     return this.printStatus("String_Node_Str",this.annotation.isSetStateType());
 else     return true;
  }
}

Fixed version (ground truth):
@Override public boolean isValid(){
  boolean init=this.validateUUID(this.annotation.getUuid()) && this.printStatus("String_Node_Str",this.annotation.isSetArgumentList()) && this.printStatus("String_Node_Str",this.annotation.getArgumentListSize() > 0)&& this.printStatus("String_Node_Str",this.annotation.isSetSituationType());
  if (!init)   return false;
 else {
    return true;
  }
}
Program: 147398
Project: 147398
Buggy source:
@Override protected boolean isValidWithComm(Communication c){
  UUID tokUuid=this.annotation.getTokenizationId();
  List<Integer> tokenIdxIds=this.annotation.getTokenIndexList();
  TokenizedSuperCommunication cc=new TokenizedSuperCommunication(c);
  if (this.printStatus("String_Node_Str",cc.getTokenizationIds().contains(tokUuid))) {
    Set<Integer> tokIdxSet=cc.getTokenizationIdToTokenIdxToTokenMap().get(tokUuid).keySet();
    if (this.printStatus("String_Node_Str",!tokIdxSet.containsAll(tokenIdxIds)))     return false;
 else     return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override protected boolean isValidWithComm(Communication c){
  UUID tokUuid=this.annotation.getTokenizationId();
  List<Integer> tokenIdxIds=this.annotation.getTokenIndexList();
  TokenizedSuperCommunication cc=new TokenizedSuperCommunication(c);
  if (this.printStatus("String_Node_Str",cc.getTokenizationIds().contains(tokUuid))) {
    Set<Integer> tokIdxSet=cc.getTokenizationIdToTokenIdxToTokenMap().get(tokUuid).keySet();
    return this.printStatus("String_Node_Str",tokIdxSet.containsAll(tokenIdxIds));
  }
 else {
    return false;
  }
}
Program: 147399
Project: 147399
Buggy source:
@Override protected boolean isValidWithComm(Communication c){
  return new SectionedSuperCommunication(c).getSectionIdToSectionMap().keySet().contains(this.annotation.getSentenceId());
}

Fixed version (ground truth):
@Override protected boolean isValidWithComm(Communication c){
  return true;
}
Program: 147400
Project: 147400
Buggy source:
/** 
 * Get the text from a   {@link TextSpan}. May throw an   {@link IndexOutOfBoundsException}if the   {@link Communication} and {@link TextSpan} do not align properly.
 * @return a {@link String} with the text of the {@link TextSpan} object. 
 */
public String getText(){
  return c.getText().substring(ts.getStart(),ts.getEnding());
}

Fixed version (ground truth):
/** 
 * Get the text from a   {@link TextSpan}. May throw an   {@link IndexOutOfBoundsException}if the   {@link Communication} and {@link TextSpan} do not align properly.
 * @return a {@link String} with the text of the {@link TextSpan} object. 
 */
public String getText(){
  return c.getProcessedContent().substring(ts.getStart(),ts.getEnding());
}
Program: 147401
Project: 147401
Buggy source:
/** 
 * Test method for   {@link edu.jhu.hlt.concrete.util.SuperTextSpan#getText()}.
 */
@Test public void testGetText(){
  Communication c=new Communication();
  String txt="String_Node_Str";
  String txtTwo="String_Node_Str";
  c.text=txt + txtTwo;
  TextSpan ts=new TextSpan(0,txt.length());
  SuperTextSpan sts=new SuperTextSpan(ts,c);
  assertEquals(txt,sts.getText());
  assertEquals(txtTwo,new SuperTextSpan(new TextSpan(txt.length(),txt.length() + txtTwo.length()),c).getText());
}

Fixed version (ground truth):
/** 
 * Test method for   {@link edu.jhu.hlt.concrete.util.SuperTextSpan#getText()}.
 */
@Test public void testGetText(){
  Communication c=new Communication();
  String txt="String_Node_Str";
  String txtTwo="String_Node_Str";
  c.text=txt + txtTwo;
  c.processedContent=txt + txtTwo;
  TextSpan ts=new TextSpan(0,txt.length());
  SuperTextSpan sts=new SuperTextSpan(ts,c);
  assertEquals(txt,sts.getText());
  assertEquals(txtTwo,new SuperTextSpan(new TextSpan(txt.length(),txt.length() + txtTwo.length()),c).getText());
}
Program: 147402
Project: 147402
Buggy source:
/** 
 * Return a   {@link List} of {@link Token} objects in the first {@link Tokenization} object inthis  {@link Communication} object. If none exists, will throw an exception.
 * @return a List of Token objects
 */
public List<Token> getTokens(){
  List<Token> tokenList;
  Tokenization tkn=comm.getSectionSegmentation(0).getSection(0).getSentenceSegmentation(0).getSentence(0).getTokenization(0);
  TokenRefSequence trs=this.mention.getTokenSequence();
  List<Integer> tokenIdList=trs.getTokenIdList();
  tokenList=new ArrayList<>(tokenIdList.size());
  for (  Integer i : tokenIdList)   tokenList.add(tkn.getToken(i));
  return tokenList;
}

Fixed version (ground truth):
/** 
 * Return a   {@link List} of {@link Token} objects in the first {@link Tokenization} object inthis  {@link Communication} object. If none exists, will throw an exception.
 * @return a List of Token objects
 */
public List<Token> getTokens(){
  List<Token> tokenList;
  Tokenization tkn=comm.getSectionSegmentation(0).getSection(0).getSentenceSegmentation(0).getSentence(0).getTokenization(0);
  TokenRefSequence trs=this.mention.getTokens();
  List<Integer> tokenIdList=trs.getTokenIdList();
  tokenList=new ArrayList<>(tokenIdList.size());
  for (  Integer i : tokenIdList)   tokenList.add(tkn.getToken(i));
  return tokenList;
}
Program: 147403
Project: 147403
Buggy source:
/** 
 * @return the next message in the protocol buffer
 * @throws ConcreteException 
 */
public Message next() throws ConcreteException {
  final int INT_SIZE=4;
  lastBytesRead=0;
  byte[] messageSizeBytes=new byte[INT_SIZE];
  try {
    if (inputStream.read(messageSizeBytes) < INT_SIZE) {
      return null;
    }
    int messageSize=new BigInteger(messageSizeBytes).intValue();
    lastBytesRead=INT_SIZE;
    if (messageSize < 1)     return null;
    byte[] messageBytes=new byte[messageSize];
    if (inputStream.read(messageBytes) < messageSize)     return null;
    lastBytesRead+=messageSize;
    this.totalBytesRead+=lastBytesRead;
    Method newBuilderMethod=messageClass.getMethod("String_Node_Str",(Class[])null);
    Message.Builder builder=(Message.Builder)newBuilderMethod.invoke(null,(Object[])null);
    return builder.mergeFrom(messageBytes).build();
  }
 catch (  NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException|IOException e) {
    throw new ConcreteException(e);
  }
}

Fixed version (ground truth):
/** 
 * @return the next message in the protocol buffer
 * @throws ConcreteException 
 */
public Message next() throws ConcreteException {
}
Program: 147404
Project: 147404
Buggy source:
public void write(Message message) throws IOException {
  byte[] messageBytes=message.toByteString().toByteArray();
  int size=messageBytes.length;
  final int INT_SIZE=4;
  ByteBuffer buffer=ByteBuffer.allocate(INT_SIZE);
  byte[] messageBytesSize=buffer.putInt(size).array();
  outputStream.write(messageBytesSize);
  outputStream.write(messageBytes);
}

Fixed version (ground truth):
public void write(Message message) throws IOException {
  byte[] messageBytes=message.toByteString().toByteArray();
  int size=messageBytes.length;
  final int LONG_SIZE=8;
  ByteBuffer buffer=ByteBuffer.allocate(LONG_SIZE);
  byte[] messageBytesSize=buffer.putLong(size).array();
  outputStream.write(messageBytesSize);
  outputStream.write(messageBytes);
}
Program: 147407
Project: 147407
Buggy source:
private static void checkParams(int major,int minor,int patch){
  if (major < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (minor < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (patch < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (major == 0 && minor == 0 && patch == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
private static void checkParams(int major,int minor,int patch){
  require(major >= 0,"String_Node_Str");
  require(minor >= 0,"String_Node_Str");
  require(patch >= 0,"String_Node_Str");
  require(major != 0 || minor != 0 || patch != 0,"String_Node_Str");
}
Program: 147408
Project: 147408
Buggy source:
/** 
 * Returns whether the given String is a valid pre-release identifier. That is, this method returns <code>true</code> if, and only if the  {@code preRelease} parameter is either the empty string or properlyformatted as a pre-release identifier according to the semantic version specification. <p> Note: this method does not throw an exception upon <code>null</code> input, but returns <code>false</code> instead. </p>
 * @param preRelease The String to check.
 * @return Whether the given String is a valid pre-release identifier.
 * @since 0.5.0
 */
public static boolean isValidPreRelease(String preRelease){
  if (preRelease == null) {
    return false;
  }
 else   if (preRelease.isEmpty()) {
    return true;
  }
  return PRE_RELEASE.matcher(preRelease).matches();
}

Fixed version (ground truth):
/** 
 * Returns whether the given String is a valid pre-release identifier. That is, this method returns <code>true</code> if, and only if the  {@code preRelease} parameter is either the empty string or properlyformatted as a pre-release identifier according to the semantic version specification. <p> Note: this method does not throw an exception upon <code>null</code> input, but returns <code>false</code> instead. </p>
 * @param preRelease The String to check.
 * @return Whether the given String is a valid pre-release identifier.
 * @since 0.5.0
 */
public static boolean isValidPreRelease(String preRelease){
  return preRelease != null && (preRelease.isEmpty() || PRE_RELEASE.matcher(preRelease).matches());
}
Program: 147409
Project: 147409
Buggy source:
/** 
 * Returns whether the given String is a valid build meta data identifier. That is, this method returns <code>true</code> if, and only if the  {@code buildMetaData} parameter is either the empty string or properlyformatted as a build meta data identifier according to the semantic version specification. <p> Note: this method does not throw an exception upon <code>null</code> input, but returns <code>false</code> instead. </p>
 * @param buildMetaData The String to check.
 * @return Whether the given String is a valid build meta data identifier.
 * @since 0.5.0
 */
public static boolean isValidBuildMetaData(String buildMetaData){
  if (buildMetaData == null) {
    return false;
  }
 else   if (buildMetaData.isEmpty()) {
    return true;
  }
  return PRE_RELEASE.matcher(buildMetaData).matches();
}

Fixed version (ground truth):
/** 
 * Returns whether the given String is a valid build meta data identifier. That is, this method returns <code>true</code> if, and only if the  {@code buildMetaData} parameter is either the empty string or properlyformatted as a build meta data identifier according to the semantic version specification. <p> Note: this method does not throw an exception upon <code>null</code> input, but returns <code>false</code> instead. </p>
 * @param buildMetaData The String to check.
 * @return Whether the given String is a valid build meta data identifier.
 * @since 0.5.0
 */
public static boolean isValidBuildMetaData(String buildMetaData){
  return buildMetaData != null && (buildMetaData.isEmpty() || BUILD_MD.matcher(buildMetaData).matches());
}
Program: 147410
Project: 147410
Buggy source:
@Test public void testIsValidBuildMDIdentifier() throws Exception {
  for (  final Version v : SEMVER_ORG_BMD_VERSIONS) {
    assertTrue(Version.isValidBuildMetaData(v.getPreRelease()));
  }
}

Fixed version (ground truth):
@Test public void testIsValidBuildMDIdentifier() throws Exception {
  for (  final Version v : SEMVER_ORG_BMD_VERSIONS) {
    assertTrue(v.toString(),Version.isValidBuildMetaData(v.getBuildMetaData()));
  }
}
Program: 147411
Project: 147411
Buggy source:
/** 
 * Creates a String representation of this version by joining its parts together as by the semantic version specification.
 * @return The version as a String.
 */
@Override public String toString(){
  final StringBuilder b=new StringBuilder(this.preRelease.length() + this.buildMetaData.length() + 24);
  b.append(this.major).append("String_Node_Str").append(this.minor).append("String_Node_Str").append(this.patch);
  if (!this.preRelease.isEmpty()) {
    b.append("String_Node_Str").append(this.preRelease);
  }
  if (!this.buildMetaData.isEmpty()) {
    b.append("String_Node_Str").append(this.buildMetaData);
  }
  return b.toString();
}

Fixed version (ground truth):
/** 
 * Creates a String representation of this version by joining its parts together as by the semantic version specification.
 * @return The version as a String.
 */
@Override public String toString(){
  final StringBuilder b=new StringBuilder(this.preRelease.length() + this.buildMetaData.length() + TO_STRING_ESTIMATE);
  b.append(this.major).append("String_Node_Str").append(this.minor).append("String_Node_Str").append(this.patch);
  if (!this.preRelease.isEmpty()) {
    b.append("String_Node_Str").append(this.preRelease);
  }
  if (!this.buildMetaData.isEmpty()) {
    b.append("String_Node_Str").append(this.buildMetaData);
  }
  return b.toString();
}
Program: 147412
Project: 147412
Buggy source:
private static int compare(Version v1,Version v2,boolean withBuildMetaData){
  if (v1 == null) {
    throw new NullPointerException("String_Node_Str");
  }
 else   if (v2 == null) {
    throw new NullPointerException("String_Node_Str");
  }
 else   if (v1 == v2) {
    return 0;
  }
  final int mc, mm, mp;
  final int result;
  if ((mc=Integer.compare(v1.major,v2.major)) == 0) {
    if ((mm=Integer.compare(v1.minor,v2.minor)) == 0) {
      if ((mp=Integer.compare(v1.patch,v2.patch)) == 0) {
        if (v1.isPreRelease() && v2.isPreRelease()) {
          result=compareIdentifiers(v1.getPreReleaseParts(),v2.getPreReleaseParts());
        }
 else         if (v1.isPreRelease()) {
          result=-1;
        }
 else         if (v2.isPreRelease()) {
          result=1;
        }
 else {
          result=0;
        }
      }
 else {
        result=mp;
      }
    }
 else {
      result=mm;
    }
  }
 else {
    result=mc;
  }
  if (withBuildMetaData && result == 0) {
    if (v1.hasBuildMetaData() && v2.hasBuildMetaData()) {
      return compareIdentifiers(v1.getBuildMetaDataParts(),v2.getBuildMetaDataParts());
    }
 else     if (v1.hasBuildMetaData()) {
      return -1;
    }
 else {
      return 1;
    }
  }
  return result;
}

Fixed version (ground truth):
private static int compare(Version v1,Version v2,boolean withBuildMetaData){
}