nus-yam/ex-repair huggingface dataset:
Program: 147323
Project: 147323
Buggy source:
int appendString(FeatureExpr ctx,MJIEnv env,int objref,String s){
  final int slen=s.length();
  Conditional<Integer> condAref=env.getReferenceField(ctx,objref,"String_Node_Str");
  Map<Integer,FeatureExpr> arefMap=condAref.toMap();
  for (  Integer aref : arefMap.keySet()) {
    FeatureExpr arefCtx=ctx.and(arefMap.get(aref));
    final int alen=env.getArrayLength(aref);
    Conditional<Integer> condCount=env.getIntField(ctx,objref,"String_Node_Str").simplify(arefCtx);
    Map<Integer,FeatureExpr> map=condCount.toMap();
    for (    Integer count : map.keySet()) {
      FeatureExpr currentCtx=arefCtx.and(map.get(count));
      int i, j;
      int n=count + slen;
      if (n < alen) {
        for (i=count, j=0; i < n; i++, j++) {
          env.setCharArrayElement(currentCtx,aref,i,s.charAt(j));
        }
      }
 else {
        int m=3 * alen / 2;
        if (m < n) {
          m=n;
        }
        int arefNew=env.newCharArray(currentCtx,m);
        for (i=0; i < count; i++) {
          env.setCharArrayElement(currentCtx,arefNew,i,env.getCharArrayElement(aref,i).simplify(currentCtx).getValue());
        }
        for (j=0; i < n; i++, j++) {
          env.setCharArrayElement(currentCtx,arefNew,i,s.charAt(j));
        }
        env.setReferenceField(NativeMethodInfo.CTX,objref,"String_Node_Str",arefNew);
      }
      env.setIntField(currentCtx,objref,"String_Node_Str",n);
    }
  }
  return objref;
}

Fixed version (ground truth):
int appendString(FeatureExpr ctx,MJIEnv env,int objref,Conditional<String> conditionalS){
  Conditional<Integer> condAref=env.getReferenceField(ctx,objref,"String_Node_Str");
  Map<Integer,FeatureExpr> arefMap=condAref.toMap();
  for (  Integer aref : arefMap.keySet()) {
    FeatureExpr arefCtx=ctx.and(arefMap.get(aref));
    Map<String,FeatureExpr> sMap=conditionalS.simplify(arefCtx).toMap();
    for (    String s : sMap.keySet()) {
      FeatureExpr stringCtx=arefCtx.and(sMap.get(s));
      final int slen=s.length();
      final int alen=env.getArrayLength(aref);
      Conditional<Integer> condCount=env.getIntField(ctx,objref,"String_Node_Str").simplify(stringCtx);
      Map<Integer,FeatureExpr> map=condCount.toMap();
      for (      Integer count : map.keySet()) {
        FeatureExpr currentCtx=stringCtx.and(map.get(count));
        int i, j;
        int n=count + slen;
        if (n < alen) {
          for (i=count, j=0; i < n; i++, j++) {
            env.setCharArrayElement(currentCtx,aref,i,s.charAt(j));
          }
        }
 else {
          int m=3 * alen / 2;
          if (m < n) {
            m=n;
          }
          int arefNew=env.newCharArray(currentCtx,m);
          for (i=0; i < count; i++) {
            env.setCharArrayElement(currentCtx,arefNew,i,env.getCharArrayElement(aref,i).simplify(currentCtx).getValue());
          }
          for (j=0; i < n; i++, j++) {
            env.setCharArrayElement(currentCtx,arefNew,i,s.charAt(j));
          }
          env.setReferenceField(currentCtx,objref,"String_Node_Str",arefNew);
        }
        env.setIntField(currentCtx,objref,"String_Node_Str",n);
      }
    }
  }
  return objref;
}
Program: 147324
Project: 147324
Buggy source:
@MJI public int append__Ljava_lang_String_2__Ljava_lang_StringBuilder_2(MJIEnv env,int objref,int sref){
  Conditional<String> s=env.getConditionalStringObject(sref);
  s=s.simplify(NativeMethodInfo.CTX).map(new Function<String,String>(){
    @Override public String apply(    String s){
      if (s == null) {
        return "String_Node_Str";
      }
      return s;
    }
  }
).simplify();
  return appendString(NativeMethodInfo.CTX,env,objref,s.getValue());
}

Fixed version (ground truth):
@MJI public int append__Ljava_lang_String_2__Ljava_lang_StringBuilder_2(MJIEnv env,int objref,int sref){
  Conditional<String> s=env.getConditionalStringObject(sref);
  s=s.simplify(NativeMethodInfo.CTX).map(new Function<String,String>(){
    @Override public String apply(    String s){
      if (s == null) {
        return "String_Node_Str";
      }
      return s;
    }
  }
).simplify();
  return appendString(NativeMethodInfo.CTX,env,objref,s);
}
Program: 147325
Project: 147325
Buggy source:
@Override public Conditional<T> simplify(FeatureExpr ctx){
  if ((ctx.and(featureExpr)).isContradiction()) {
    return elseBranch.simplify(ctx.andNot(featureExpr));
  }
  if ((ctx.andNot(featureExpr)).isContradiction()) {
    return thenBranch.simplify(ctx.and(featureExpr));
  }
  final Conditional<T> tb=thenBranch == null ? null : thenBranch.simplify(ctx.and(featureExpr));
  final Conditional<T> eb=elseBranch == null ? null : elseBranch.simplify(ctx.andNot(featureExpr));
  if (tb == null) {
    return eb;
  }
  if (eb == null) {
    return tb;
  }
  if (tb.equals(eb)) {
    return tb;
  }
  if (tb instanceof One) {
    if (eb instanceof Choice) {
      if (((Choice<T>)eb).thenBranch.equals(tb)) {
        return new Choice<>(featureExpr.or(((Choice<T>)eb).featureExpr),tb,((Choice<T>)eb).elseBranch);
      }
      if (((Choice<T>)eb).elseBranch.equals(tb)) {
        return new Choice<>(featureExpr.orNot(((Choice<T>)eb).featureExpr),tb,((Choice<T>)eb).thenBranch);
      }
    }
  }
  if (eb instanceof One) {
    if (tb instanceof Choice) {
      if (((Choice<T>)tb).thenBranch.equals(eb)) {
        return new Choice<>(featureExpr.andNot(((Choice<T>)tb).featureExpr),((Choice<T>)tb).elseBranch,eb);
      }
      if (((Choice<T>)tb).elseBranch.equals(eb)) {
        return new Choice<>(featureExpr.and(((Choice<T>)tb).featureExpr),((Choice<T>)tb).thenBranch,eb);
      }
    }
  }
  return new Choice<>((featureExpr),tb,eb);
}

Fixed version (ground truth):
@Override public Conditional<T> simplify(FeatureExpr ctx){
  if ((ctx.and(featureExpr)).isContradiction()) {
    return elseBranch.simplify(ctx.andNot(featureExpr));
  }
  if ((ctx.andNot(featureExpr)).isContradiction()) {
    return thenBranch.simplify(ctx.and(featureExpr));
  }
  final Conditional<T> tb=thenBranch == null ? null : thenBranch.simplify(ctx.and(featureExpr));
  final Conditional<T> eb=elseBranch == null ? null : elseBranch.simplify(ctx.andNot(featureExpr));
  if (tb == null) {
    return eb;
  }
  if (eb == null) {
    return tb;
  }
  if (tb.equals(eb)) {
    return tb;
  }
  return new Choice<>((featureExpr),tb,eb);
}
Program: 147326
Project: 147326
Buggy source:
@Override public Object put(Object keyObject,Object valueObject){
  if (keyObject == null) {
    throw exception("String_Node_Str");
  }
 else   if (!(keyObject instanceof String)) {
    throw exception("String_Node_Str" + keyObject);
  }
  if (valueObject != null && !(valueObject instanceof String)) {
    throw exception("String_Node_Str" + valueObject);
  }
  String key=(String)keyObject;
  String value=(String)valueObject;
  if (key.length() == 0) {
    throw exception("String_Node_Str");
  }
  if (key.charAt(0) == KEY_PREFIX) {
    processPseudoProperty(key,value);
    return null;
  }
 else {
    String k=expandString(null,key);
    if (!(value == null)) {
      String v=(String)value;
      if (k.charAt(k.length() - 1) == '+') {
        k=k.substring(0,k.length() - 1);
        return append(k,v,null);
      }
 else       if (k.charAt(0) == '+') {
        k=k.substring(1);
        return prepend(k,v,null);
      }
 else {
        v=normalize(expandString(k,v));
        if (v != null) {
          return setKey(k,v);
        }
 else {
          return removeKey(k);
        }
      }
    }
 else {
      return removeKey(k);
    }
  }
}

Fixed version (ground truth):
@Override public Object put(Object keyObject,Object valueObject){
  if (keyObject == null) {
    throw exception("String_Node_Str");
  }
 else   if (!(keyObject instanceof String)) {
    throw exception("String_Node_Str" + keyObject);
  }
  if (valueObject != null && !(valueObject instanceof String)) {
    throw exception("String_Node_Str" + valueObject);
  }
  String key=(String)keyObject;
  String value=(String)valueObject;
  if (key.length() == 0) {
    throw exception("String_Node_Str");
  }
  if (key.charAt(0) == KEY_PREFIX) {
    processPseudoProperty(key,value);
    return null;
  }
 else {
    String k=expandString(null,key);
    if (!(value == null)) {
      String v=value;
      if (k.charAt(k.length() - 1) == '+') {
        k=k.substring(0,k.length() - 1);
        return append(k,v,null);
      }
 else       if (k.charAt(0) == '+') {
        k=k.substring(1);
        return prepend(k,v,null);
      }
 else {
        v=normalize(expandString(k,v));
        if (v != null) {
          return setKey(k,v);
        }
 else {
          return removeKey(k);
        }
      }
    }
 else {
      return removeKey(k);
    }
  }
}
Program: 147327
Project: 147327
Buggy source:
/** 
 * Signature_attribute { u2 attribute_name_index; u4 attr-length; u2 signature-index << pos }
 */
public void parseSignatureAttr(ClassFileReader reader,Object tag){
  int cpIdx=readU2();
  setSignature(reader,tag,(String)utf8At(cpIdx));
}

Fixed version (ground truth):
/** 
 * Signature_attribute { u2 attribute_name_index; u4 attr-length; u2 signature-index << pos }
 */
public void parseSignatureAttr(ClassFileReader reader,Object tag){
  int cpIdx=readU2();
  setSignature(reader,tag,utf8At(cpIdx));
}
Program: 147328
Project: 147328
Buggy source:
public Byte next(){
  if (next == buffer.length) {
    throw new NoSuchElementException();
  }
  Byte e=(Byte)buffer[next];
  next++;
  return e;
}

Fixed version (ground truth):
public Byte next(){
  if (next == buffer.length) {
    throw new NoSuchElementException();
  }
  Byte e=buffer[next];
  next++;
  return e;
}
Program: 147329
Project: 147329
Buggy source:
public static <A>TypedIterator<A> typedIterator(Object head,Class<A> type){
  if (head == null) {
    return (TypedIterator<A>)emptyTypedIterator;
  }
 else {
    return new TypedIterator<A>(head,type);
  }
}

Fixed version (ground truth):
public static <A>TypedIterator<A> typedIterator(Object head,Class<A> type){
  if (head == null) {
    return (TypedIterator<A>)emptyTypedIterator;
  }
 else {
    return new TypedIterator<>(head,type);
  }
}
Program: 147330
Project: 147330
Buggy source:
/** 
 * Finds all resources in the classpath with the given name. Returns an  enumeration of the URL objects.
 */
public String[] findResources(String resourceName){
  ArrayList<String> resources=new ArrayList(0);
  for (  String cpe : getClassPathElements()) {
    String URL=getResourceURL(cpe,resourceName);
    if (URL != null) {
      if (!resources.contains(URL)) {
        resources.add(URL);
      }
    }
  }
  return resources.toArray(new String[resources.size()]);
}

Fixed version (ground truth):
/** 
 * Finds all resources in the classpath with the given name. Returns an  enumeration of the URL objects.
 */
public String[] findResources(String resourceName){
  ArrayList<String> resources=new ArrayList<>(0);
  for (  String cpe : getClassPathElements()) {
    String URL=getResourceURL(cpe,resourceName);
    if (URL != null) {
      if (!resources.contains(URL)) {
        resources.add(URL);
      }
    }
  }
  return resources.toArray(new String[resources.size()]);
}
Program: 147331
Project: 147331
Buggy source:
/** 
 * creates callerSlots dummy Stackframe for testing of operand/local operations NOTE - TESTING ONLY! this does not have a MethodInfo
 */
protected StackFrame(int nLocals,int nOperands){
  stackBase=nLocals;
  stack=new StackHandler(nLocals,nOperands);
}

Fixed version (ground truth):
/** 
 * creates callerSlots dummy Stackframe for testing of operand/local operations NOTE - TESTING ONLY! this does not have a MethodInfo
 */
protected StackFrame(int nLocals,int nOperands){
  stackBase=nLocals;
  this.nLocals=nLocals;
  stack=new StackHandler(nLocals,nOperands);
}
Program: 147332
Project: 147332
Buggy source:
@Test public void testListIteration(){
  Object[] v={new Integer(2),"String_Node_Str"};
  for (  Object a : ObjectList.iterator(attr)) {
    fail("String_Node_Str");
  }
  for (int i=v.length - 1; i >= 0; i--) {
    attr=ObjectList.add(attr,v[i]);
  }
  int len=ObjectList.size(attr);
  for (int i=0; i < len; i++) {
    Object a=ObjectList.get(attr,i);
    System.out.printf("String_Node_Str",i,a.toString());
    assertEquals(a,v[i]);
  }
  attr=ObjectList.add(attr,"String_Node_Str");
  attr=ObjectList.add(attr,new Integer(4));
  int i=0;
  for (Integer a=ObjectList.getFirst(attr,Integer.class); a != null; a=ObjectList.getNext(attr,Integer.class,a)) {
    System.out.println(a);
    i++;
  }
  assertTrue(i == 2);
  System.out.println("String_Node_Str");
  i=0;
  for (  Object a : ObjectList.iterator(attr)) {
    System.out.printf("String_Node_Str",i++,a.toString());
  }
  assertTrue(i == 4);
  System.out.println("String_Node_Str");
  i=0;
  for (  String a : ObjectList.typedIterator(attr,String.class)) {
    System.out.printf("String_Node_Str",i++,a.toString());
  }
  assertTrue(i == 2);
  System.out.println("String_Node_Str");
  i=0;
  for (  float f : ObjectList.typedIterator(attr,Float.class)) {
    System.out.printf("String_Node_Str",i++,f);
  }
  assertTrue(i == 0);
}

Fixed version (ground truth):
@Test public void testListIteration(){
  Object[] v={new Integer(2),"String_Node_Str"};
  for (  @SuppressWarnings("String_Node_Str") Object a : ObjectList.iterator(attr)) {
    fail("String_Node_Str");
  }
  for (int i=v.length - 1; i >= 0; i--) {
    attr=ObjectList.add(attr,v[i]);
  }
  int len=ObjectList.size(attr);
  for (int i=0; i < len; i++) {
    Object a=ObjectList.get(attr,i);
    System.out.printf("String_Node_Str",i,a.toString());
    assertEquals(a,v[i]);
  }
  attr=ObjectList.add(attr,"String_Node_Str");
  attr=ObjectList.add(attr,new Integer(4));
  int i=0;
  for (Integer a=ObjectList.getFirst(attr,Integer.class); a != null; a=ObjectList.getNext(attr,Integer.class,a)) {
    System.out.println(a);
    i++;
  }
  assertTrue(i == 2);
  System.out.println("String_Node_Str");
  i=0;
  for (  Object a : ObjectList.iterator(attr)) {
    System.out.printf("String_Node_Str",i++,a.toString());
  }
  assertTrue(i == 4);
  System.out.println("String_Node_Str");
  i=0;
  for (  String a : ObjectList.typedIterator(attr,String.class)) {
    System.out.printf("String_Node_Str",i++,a.toString());
  }
  assertTrue(i == 2);
  System.out.println("String_Node_Str");
  i=0;
  for (  float f : ObjectList.typedIterator(attr,Float.class)) {
    System.out.printf("String_Node_Str",i++,f);
  }
  assertTrue(i == 0);
}
Program: 147333
Project: 147333
Buggy source:
public static boolean prepare(Path outputPath) throws IOException {
  LOGGER.debug("String_Node_Str",outputPath.toString());
  final int nPaths=outputPath.getNameCount();
  LOGGER.debug("String_Node_Str",nPaths);
  if (nPaths > 1) {
    Path abs=outputPath.toAbsolutePath();
    LOGGER.debug("String_Node_Str",abs.toString());
    Path folders=abs.getParent();
    LOGGER.debug("String_Node_Str",folders.toString());
    LOGGER.debug("String_Node_Str",folders.toString());
    Files.createDirectories(folders);
  }
  return Files.exists(outputPath);
}

Fixed version (ground truth):
public static boolean prepare(Path outputPath) throws IOException {
  LOGGER.debug("String_Node_Str",outputPath.toString());
  final int nPaths=outputPath.getNameCount();
  LOGGER.debug("String_Node_Str",nPaths);
  if (nPaths > 1) {
    Path abs=outputPath.toAbsolutePath();
    LOGGER.debug("String_Node_Str",abs.toString());
    Path folders=abs.getParent();
    LOGGER.debug("String_Node_Str",folders.toString());
    LOGGER.debug("String_Node_Str",folders.toString());
    while (Files.isSymbolicLink(folders)) {
      folders=Files.readSymbolicLink(folders);
    }
    Files.createDirectories(folders);
  }
  return Files.exists(outputPath);
}
Program: 147334
Project: 147334
Buggy source:
static Section handleHeadline(XMLEventReader rdr,Communication ptr) throws XMLStreamException {
  if (!ptr.isSetText())   throw new IllegalArgumentException("String_Node_Str");
  XMLEvent hl=rdr.nextEvent();
  StartElement hlse=hl.asStartElement();
  QName hlqn=hlse.getName();
  final String hlPart=hlqn.getLocalPart();
  LOGGER.debug("String_Node_Str",hlPart);
  Characters hlChars=rdr.nextEvent().asCharacters();
  final int charOff=hlChars.getLocation().getCharacterOffset();
  final int clen=hlChars.getData().length();
  final int endTextOffset=charOff + clen;
  final String hlText=ptr.getText().substring(charOff,endTextOffset);
  SimpleImmutableEntry<Integer,Integer> pads=trimSpacing(hlText);
  TextSpan ts=new TextSpan(charOff + pads.getKey(),endTextOffset - pads.getValue());
  Section s=new Section();
  s.setKind("String_Node_Str");
  s.setTextSpan(ts);
  s.addToNumberList(0);
  return s;
}

Fixed version (ground truth):
static Section handleHeadline(XMLEventReader rdr,Communication ptr) throws XMLStreamException {
  if (!ptr.isSetText())   throw new IllegalArgumentException("String_Node_Str");
  XMLEvent hl=rdr.nextEvent();
  StartElement hlse=hl.asStartElement();
  QName hlqn=hlse.getName();
  final String hlPart=hlqn.getLocalPart();
  LOGGER.debug("String_Node_Str",hlPart);
  Characters hlChars=rdr.nextEvent().asCharacters();
  final int charOff=hlChars.getLocation().getCharacterOffset();
  final int clen=hlChars.getData().length();
  final int endTextOffset=charOff + clen;
  final String hlText=ptr.getText().substring(charOff,endTextOffset);
  LOGGER.debug("String_Node_Str",charOff,clen,endTextOffset,hlText);
  String trimmed=hlText.trim();
  TextSpan ts;
  if (trimmed.isEmpty()) {
    ts=new TextSpan(charOff,endTextOffset);
  }
 else {
    SimpleImmutableEntry<Integer,Integer> pads=trimSpacing(hlText);
    ts=new TextSpan(charOff + pads.getKey(),endTextOffset - pads.getValue());
  }
  Section s=new Section();
  s.setKind("String_Node_Str");
  s.setTextSpan(ts);
  s.addToNumberList(0);
  return s;
}
Program: 147335
Project: 147335
Buggy source:
@Test public void storeFetch() throws Exception {
  SimpleAccumuloConfig config=new SimpleAccumuloConfig(namespace,SimpleAccumuloConfig.DEFAULT_TABLE,SimpleAccumuloConfig.DEFAULT_INSTANCE,SimpleAccumuloConfig.DEFAULT_ZOOKEEPERS);
  int numThreads=1;
  try (SimpleAccumuloStore store=new SimpleAccumuloStore(config,numThreads)){
    store.connect(user,password);
    store.store(comm);
  }
   try (SimpleAccumuloFetch fetch=new SimpleAccumuloFetch(config,numThreads)){
    fetch.connect(user,password);
    FetchRequest r=new FetchRequest();
    r.addToCommunicationIds(comm.getId());
    FetchResult res=fetch.fetch(r);
    System.out.println("String_Node_Str" + res);
    assertEquals(res.getCommunicationsSize(),1);
    assertEquals(res.getCommunications().get(0).getText(),comm.getText());
  }
 }

Fixed version (ground truth):
/** 
 * Works on test1-3 where you have access to the r8n* machines which host accumulo. Does not work on whatever machine runs CI, presumably because it cannot reach r8n*.
 */
public void storeFetch() throws Exception {
  SimpleAccumuloConfig config=new SimpleAccumuloConfig(namespace,SimpleAccumuloConfig.DEFAULT_TABLE,SimpleAccumuloConfig.DEFAULT_INSTANCE,SimpleAccumuloConfig.DEFAULT_ZOOKEEPERS);
  int numThreads=1;
  try (SimpleAccumuloStore store=new SimpleAccumuloStore(config,numThreads)){
    store.connect(user,password);
    store.store(comm);
  }
   try (SimpleAccumuloFetch fetch=new SimpleAccumuloFetch(config,numThreads)){
    fetch.connect(user,password);
    FetchRequest r=new FetchRequest();
    r.addToCommunicationIds(comm.getId());
    FetchResult res=fetch.fetch(r);
    System.out.println("String_Node_Str" + res);
    assertEquals(res.getCommunicationsSize(),1);
    assertEquals(res.getCommunications().get(0).getText(),comm.getText());
  }
 }
Program: 147337
Project: 147337
Buggy source:
@Override public void run(){
  try {
    SimpleAccumuloFetch.main(new String[]{"String_Node_Str",user,"String_Node_Str",passwordStr,"String_Node_Str",namespace,"String_Node_Str",String.valueOf(port)});
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    System.getProperties().put("String_Node_Str",user);
    System.getProperties().put("String_Node_Str",passwordStr);
    System.getProperties().put("String_Node_Str",namespace);
    System.getProperties().put("String_Node_Str",String.valueOf(port));
    SimpleAccumuloFetch.main(new String[]{});
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 147338
Project: 147338
Buggy source:
public static void main(String[] args) throws Exception {
  Properties config=SimpleAccumuloConfig.loadConfig();
  SimpleAccumuloConfig saConf=SimpleAccumuloConfig.fromConfig(config);
  int nt=Integer.parseInt(config.getProperty("String_Node_Str","String_Node_Str"));
  int port=Integer.parseInt(config.getProperty("String_Node_Str","String_Node_Str"));
  logger.info("String_Node_Str" + port);
  logger.info("String_Node_Str" + nt);
  logger.info("String_Node_Str" + saConf);
  try (SimpleAccumuloStore serv=new SimpleAccumuloStore(saConf,nt)){
    serv.connect(config.getProperty("String_Node_Str"),new PasswordToken(config.getProperty("String_Node_Str")));
    TServerTransport serverTransport=new TServerSocket(port);
    TServer server=new TSimpleServer(new Args(serverTransport).processor(new StoreCommunicationService.Processor<>(serv)));
    logger.info("String_Node_Str");
    server.serve();
  }
 }

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  Properties config=SimpleAccumuloConfig.loadConfig();
  SimpleAccumuloConfig saConf=SimpleAccumuloConfig.fromConfig(config);
  int nt=Integer.parseInt(config.getProperty("String_Node_Str","String_Node_Str"));
  int port=Integer.parseInt(config.getProperty("String_Node_Str","String_Node_Str"));
  logger.info("String_Node_Str" + port);
  logger.info("String_Node_Str" + nt);
  logger.info("String_Node_Str" + saConf);
  try (SimpleAccumuloStore serv=new SimpleAccumuloStore(saConf,nt)){
    serv.connect(config.getProperty("String_Node_Str"),new PasswordToken(config.getProperty("String_Node_Str")));
    Processor<SimpleAccumuloStore> proc=new StoreCommunicationService.Processor<>(serv);
    TNonblockingServerTransport transport=new TNonblockingServerSocket(port);
    TNonblockingServer.Args serverArgs=new TNonblockingServer.Args(transport);
    serverArgs=serverArgs.processorFactory(new TProcessorFactory(proc));
    serverArgs=serverArgs.protocolFactory(new TCompactProtocol.Factory());
    serverArgs=serverArgs.transportFactory(new TFramedTransport.Factory(Integer.MAX_VALUE));
    serverArgs.maxReadBufferBytes=Long.MAX_VALUE;
    TNonblockingServer server=new TNonblockingServer(serverArgs);
    logger.info("String_Node_Str");
    server.serve();
  }
 }
Program: 147339
Project: 147339
Buggy source:
public static void main(String[] args) throws Exception {
  Properties config=SimpleAccumuloConfig.loadConfig();
  SimpleAccumuloConfig saConf=SimpleAccumuloConfig.fromConfig(config);
  int nt=Integer.parseInt(config.getProperty("String_Node_Str","String_Node_Str"));
  int port=Integer.parseInt(config.getProperty("String_Node_Str","String_Node_Str"));
  logger.info("String_Node_Str" + port);
  logger.info("String_Node_Str" + nt);
  logger.info("String_Node_Str" + saConf);
  try (SimpleAccumuloFetch serv=new SimpleAccumuloFetch(saConf,nt)){
    serv.connect(config.getProperty("String_Node_Str"),new PasswordToken(config.getProperty("String_Node_Str")));
    TServerTransport serverTransport=new TServerSocket(port);
    TServer server=new TSimpleServer(new Args(serverTransport).processor(new FetchCommunicationService.Processor<>(serv)));
    logger.info("String_Node_Str");
    server.serve();
  }
 }

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  Properties config=SimpleAccumuloConfig.loadConfig();
  SimpleAccumuloConfig saConf=SimpleAccumuloConfig.fromConfig(config);
  int nt=Integer.parseInt(config.getProperty("String_Node_Str","String_Node_Str"));
  int port=Integer.parseInt(config.getProperty("String_Node_Str","String_Node_Str"));
  logger.info("String_Node_Str" + port);
  logger.info("String_Node_Str" + nt);
  logger.info("String_Node_Str" + saConf);
  try (SimpleAccumuloFetch serv=new SimpleAccumuloFetch(saConf,nt)){
    serv.connect(config.getProperty("String_Node_Str"),new PasswordToken(config.getProperty("String_Node_Str")));
    Processor<SimpleAccumuloFetch> proc=new FetchCommunicationService.Processor<>(serv);
    TNonblockingServerTransport transport=new TNonblockingServerSocket(port);
    TNonblockingServer.Args serverArgs=new TNonblockingServer.Args(transport);
    serverArgs=serverArgs.processorFactory(new TProcessorFactory(proc));
    serverArgs=serverArgs.protocolFactory(new TCompactProtocol.Factory());
    serverArgs=serverArgs.transportFactory(new TFramedTransport.Factory(Integer.MAX_VALUE));
    serverArgs.maxReadBufferBytes=Long.MAX_VALUE;
    TNonblockingServer server=new TNonblockingServer(serverArgs);
    logger.info("String_Node_Str");
    server.serve();
  }
 }
Program: 147340
Project: 147340
Buggy source:
/** 
 * Send a   {@link Communication} to the target server.
 * @param c a {@link Communication} to send across the wire
 * @throws TException on thrift error
 * @see Sender.Iface#store(Communication)
 */
public void store(Communication c) throws TException {
  this.client.store(c);
}

Fixed version (ground truth):
/** 
 * Send a   {@link Communication} to the target server.
 * @param c a {@link Communication} to send across the wire
 * @throws TException on thrift error
 */
public void store(Communication c) throws TException {
  this.client.store(c);
}
Program: 147341
Project: 147341
Buggy source:
@Override public FetchResult fetch(FetchRequest fr) throws ServicesException, TException {
  if (fr == null || fr.isSetCommunicationIds() || fr.getCommunicationIdsSize() == 0)   throw new ServicesException("String_Node_Str");
  int n=fr.getCommunicationIdsSize();
  FetchResult r=new FetchResult();
  r.setCommunications(new ArrayList<>(n));
  Authorizations auths=new Authorizations(fr.getAuths());
  try {
    if (n == 1) {
      if (reader == null)       reader=getConnector().createScanner(config.table,auths);
      reader.setRange(Range.exact(fr.getCommunicationIds().get(0)));
      Entry<Key,Value> e=reader.iterator().next();
      byte[] commBytes=e.getValue().get();
      Communication c=new Communication();
      commDeser.deserialize(c,commBytes);
      r.addToCommunications(c);
    }
 else {
      if (readerB == null)       readerB=getConnector().createBatchScanner(config.table,auths,numThreads);
      List<Range> ids=new ArrayList<>(n);
      for (      String c : fr.getCommunicationIds())       ids.add(Range.exact(c));
      readerB.setRanges(ids);
      for (      Entry<Key,Value> e : readerB) {
        byte[] bytes=e.getValue().get();
        Communication c=new Communication();
        commDeser.deserialize(c,bytes);
        r.addToCommunications(c);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new ServicesException(e.getMessage());
  }
  return r;
}

Fixed version (ground truth):
@Override public FetchResult fetch(FetchRequest fr) throws ServicesException, TException {
  if (fr == null || !fr.isSetCommunicationIds() || fr.getCommunicationIdsSize() == 0)   throw new ServicesException("String_Node_Str");
  int n=fr.getCommunicationIdsSize();
  FetchResult r=new FetchResult();
  r.setCommunications(new ArrayList<>(n));
  Authorizations auths=new Authorizations();
  if (fr.isSetAuths())   auths=new Authorizations(fr.getAuths());
  try {
    if (n == 1) {
      if (reader == null)       reader=getConnector().createScanner(config.table,auths);
      reader.setRange(Range.exact(fr.getCommunicationIds().get(0)));
      for (      Entry<Key,Value> e : reader) {
        byte[] commBytes=e.getValue().get();
        Communication c=new Communication();
        commDeser.deserialize(c,commBytes);
        r.addToCommunications(c);
      }
    }
 else {
      if (readerB == null)       readerB=getConnector().createBatchScanner(config.table,auths,numThreads);
      List<Range> ids=new ArrayList<>(n);
      for (      String c : fr.getCommunicationIds())       ids.add(Range.exact(c));
      readerB.setRanges(ids);
      for (      Entry<Key,Value> e : readerB) {
        byte[] bytes=e.getValue().get();
        Communication c=new Communication();
        commDeser.deserialize(c,bytes);
        r.addToCommunications(c);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new ServicesException(e.getMessage());
  }
  return r;
}
Program: 147342
Project: 147342
Buggy source:
/** 
 * Default implementation. Calls   {@link #fromTarGz(InputStream)}.
 * @see #fromTarGz(InputStream)
 * @param in a  {@link GzipCompressorInputStream} representing a .tar.gz archive of {@link Communication} objects
 * @return an {@link Iterator} of {@link Communication} objects
 * @throws ConcreteException on serialization error (e.g., if a  {@link Communication} is missing required fields)
 * @throws IOException on I/O error
 */
default Iterator<Communication> fromTarGz(GzipCompressorInputStream in) throws ConcreteException, IOException {
  return this.fromTarGz(in);
}

Fixed version (ground truth):
/** 
 * @param is an  {@link InputStream}. Should be closed when finished.
 * @return an {@link Iterator} of {@link Communication} objects
 * @throws ConcreteException on serialization error (e.g., if a  {@link Communication} is missing required fields)
 * @throws IOException on I/O error
 */
public Iterator<Communication> fromTarGz(InputStream is) throws ConcreteException, IOException ;
Program: 147343
Project: 147343
Buggy source:
/** 
 * @param args
 * @throws ConcreteException
 * @throws IOException
 * @throws TException
 */
public static void main(String[] args) throws ConcreteException, IOException, TException {
  Random r=new Random();
  CompactCommunicationSerializer cs=new CompactCommunicationSerializer();
  Communication root=new Communication();
  root.setType("String_Node_Str");
  AnnotationMetadata md=new AnnotationMetadata();
  md.setTool(ProjectConstants.PROJECT_NAME + "String_Node_Str" + ProjectConstants.VERSION+ "String_Node_Str"+ RandomCommunicationStreamProducer.class.getSimpleName());
  md.setTimestamp(Timing.currentLocalTime());
  root.setMetadata(md);
  AnalyticUUIDGeneratorFactory f=new AnalyticUUIDGeneratorFactory();
  AnalyticUUIDGenerator g=f.create();
  while (true) {
    Communication nc=new Communication(root);
    String idstr="String_Node_Str" + Math.abs(r.nextInt());
    nc.setId(idstr);
    nc.setUuid(g.next());
    nc.setText("String_Node_Str");
    System.out.write(cs.toBytes(nc));
  }
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws ConcreteException
 * @throws IOException
 * @throws TException
 */
public static void main(String[] args) throws ConcreteException, IOException, TException {
  Random r=new Random();
  CompactCommunicationSerializer cs=new CompactCommunicationSerializer();
  Communication root=new Communication();
  root.setType("String_Node_Str");
  AnnotationMetadata md=new AnnotationMetadata();
  md.setTool(ProjectConstants.PROJECT_NAME + "String_Node_Str" + ProjectConstants.VERSION+ "String_Node_Str"+ RandomCommunicationStreamProducer.class.getSimpleName());
  md.setTimestamp(Timing.currentLocalTime());
  root.setMetadata(md);
  AnalyticUUIDGeneratorFactory f=new AnalyticUUIDGeneratorFactory();
  AnalyticUUIDGenerator g=f.create();
  while (true) {
    Communication nc=new Communication(root);
    String idstr="String_Node_Str" + r.nextInt(Integer.MAX_VALUE);
    nc.setId(idstr);
    nc.setUuid(g.next());
    nc.setText("String_Node_Str");
    System.out.write(cs.toBytes(nc));
  }
}
Program: 147344
Project: 147344
Buggy source:
/** 
 * @return the tokenTags
 */
public List<String> getTokenTags(){
  return tokenTags;
}

Fixed version (ground truth):
/** 
 * @return the tokenTags
 */
public String[] getTokenTags(){
  return tokenTags;
}
Program: 147345
Project: 147345
Buggy source:
/** 
 * @return the tokens
 */
public List<String> getTokens(){
  return tokens;
}

Fixed version (ground truth):
/** 
 * @return the tokens
 */
public String[] getTokens(){
  return tokens;
}
Program: 147346
Project: 147346
Buggy source:
/** 
 * @return the offsets
 */
public List<Integer> getOffsets(){
  return offsets;
}

Fixed version (ground truth):
/** 
 * @return the offsets
 */
public int[] getOffsets(){
  return offsets;
}
Program: 147347
Project: 147347
Buggy source:
public TaggedTokenizationOutput(String[][] twitterTokenizerOutput){
  this.tokens=Arrays.asList(twitterTokenizerOutput[0]);
  this.tokenTags=Arrays.asList(twitterTokenizerOutput[1]);
  String[] offsetStrings=twitterTokenizerOutput[2];
  this.offsets=new ArrayList<>(offsetStrings.length);
  for (  String offset : offsetStrings)   this.offsets.add(Integer.parseInt(offset));
}

Fixed version (ground truth):
public TaggedTokenizationOutput(String[][] twitterTokenizerOutput){
  this.tokens=twitterTokenizerOutput[0];
  this.tokenTags=twitterTokenizerOutput[1];
  String[] offsetStrings=twitterTokenizerOutput[2];
  this.offsets=new int[offsetStrings.length];
  for (int i=0; i < offsetStrings.length; i++)   this.offsets[i]=Integer.parseInt(offsetStrings[i]);
}
Program: 147348
Project: 147348
Buggy source:
/** 
 */
public TokenTagTuple(String token,String tag){
  this.token=token;
  this.tag=tag;
}

Fixed version (ground truth):
public TokenTagTuple(String token,String tag){
  this.token=token;
  this.tag=Optional.ofNullable(tag);
}
Program: 147349
Project: 147349
Buggy source:
/** 
 * @return the tag
 */
public String getTag(){
  return tag;
}

Fixed version (ground truth):
/** 
 * @return the tag
 */
public Optional<String> getTag(){
  return tag;
}
Program: 147350
Project: 147350
Buggy source:
@Override public TokenizedCommunication annotate(Communication comm) throws AnalyticException {
  Communication cp=new Communication(comm);
  try {
    CachedSentencedCommunication csc=new CachedSentencedCommunication(cp);
    List<Sentence> sentences=new ArrayList<>(csc.getSentences());
    for (    Sentence st : sentences) {
      SuperTextSpan sts=new SuperTextSpan(st.getTextSpan(),cp);
      String sentenceText=sts.getText();
      Tokenization t=this.tokenizer.tokenizeSentence(sentenceText,0,st.getUuid());
      t.setMetadata(TooledMetadataConverter.convert(this));
      st.setTokenization(t);
    }
    return new CachedTokenizationCommunication(cp);
  }
 catch (  MiscommunicationException e) {
    throw new AnalyticException(e);
  }
}

Fixed version (ground truth):
@Override public TokenizedCommunication annotate(Communication comm) throws AnalyticException {
  Communication cp=new Communication(comm);
  try {
    CachedSentencedCommunication csc=new CachedSentencedCommunication(cp);
    List<Sentence> sentences=new ArrayList<>(csc.getSentences());
    for (    Sentence st : sentences) {
      TextSpan sts=st.getTextSpan();
      final String stText=cp.getText().substring(sts.getStart(),sts.getEnding());
      Tokenization t=this.tokenizer.tokenizeToConcrete(stText);
      t.setMetadata(TooledMetadataConverter.convert(this));
      st.setTokenization(t);
    }
    return new CachedTokenizationCommunication(cp);
  }
 catch (  MiscommunicationException e) {
    throw new AnalyticException(e);
  }
}
Program: 147351
Project: 147351
Buggy source:
public ALNCIngester(Path path) throws IngestException {
  this.ts=Timing.currentLocalTime();
  this.path=path;
  try {
    if (Files.probeContentType(this.path).contains("String_Node_Str"))     this.conv=new ALNCFileConverter(new BZip2CompressorInputStream(Files.newInputStream(this.path)));
 else     this.conv=new ALNCFileConverter(Files.newInputStream(this.path));
  }
 catch (  IOException e) {
    throw new IngestException(e);
  }
}

Fixed version (ground truth):
public ALNCIngester(Path path) throws IngestException {
  this.ts=Timing.currentLocalTime();
  this.path=path;
  try {
    Optional<String> inferredType=Optional.ofNullable(Files.probeContentType(this.path));
    String ft=inferredType.orElse("String_Node_Str");
    if (ft.contains("String_Node_Str"))     this.conv=new ALNCFileConverter(new BZip2CompressorInputStream(Files.newInputStream(this.path)));
 else     this.conv=new ALNCFileConverter(Files.newInputStream(this.path));
  }
 catch (  IOException e) {
    throw new IngestException(e);
  }
}
Program: 147352
Project: 147352
Buggy source:
@Test public void testTokenizeToConcreteTwitter(){
  String text="String_Node_Str";
  int expectedTokenCount=5;
  Tokenization ct=Tokenizer.TWITTER.tokenizeToConcrete(text,0);
  List<Token> tokenList=ct.getTokenList().getTokenList();
  assertEquals(expectedTokenCount,tokenList.size());
  for (  Token t : tokenList) {
    logger.info("String_Node_Str",t.getTokenIndex(),t.getText());
    TextSpan ts=t.getTextSpan();
    logger.info("String_Node_Str",ts.getStart(),ts.getEnding());
  }
  Optional<TokenTagging> tt=ct.getTokenTaggingList().stream().filter(tl -> tl.getTaggingType().equalsIgnoreCase("String_Node_Str")).findFirst();
  assertTrue(tt.isPresent());
  for (  TaggedToken t : tt.get().getTaggedTokenList()) {
    logger.info("String_Node_Str",t.getTag(),t.getTokenIndex());
  }
}

Fixed version (ground truth):
@Test public void testTokenizeToConcreteTwitter(){
  String text="String_Node_Str";
  int expectedTokenCount=5;
  Tokenization ct=Tokenizer.TWITTER.tokenizeToConcrete(text,0);
  List<Token> tokenList=ct.getTokenList().getTokenList();
  assertEquals(expectedTokenCount,tokenList.size());
  for (  Token t : tokenList) {
    logger.info("String_Node_Str",t.getTokenIndex(),t.getText());
    TextSpan ts=t.getTextSpan();
    logger.info("String_Node_Str",ts.getStart(),ts.getEnding());
  }
  Optional<TokenTagging> tt=ct.getTokenTaggingList().stream().filter(tl -> tl.getTaggingType().equalsIgnoreCase("String_Node_Str")).findFirst();
  assertTrue(tt.isPresent());
  for (  TaggedToken t : tt.get().getTaggedTokenList()) {
    int idx=t.getTokenIndex();
    logger.info("String_Node_Str",t.getTag(),idx);
    assertEquals(4,idx);
  }
}
Program: 147353
Project: 147353
Buggy source:
private static int getLeftSpacesPaddingCount(final String str){
  final int len=str.length();
  for (int i=0; i < len; i++) {
    Character c=str.charAt(i);
    if (!isSpaceOrUnixNewline(c))     return i;
  }
  return len;
}

Fixed version (ground truth):
/** 
 * Length of longest whitespace prefix.
 */
private static int getLeftSpacesPaddingCount(final String str){
  final int len=str.length();
  for (int i=0; i < len; i++) {
    char c=str.charAt(i);
    if (!Character.isWhitespace(c))     return i;
  }
  return len;
}
Program: 147354
Project: 147354
Buggy source:
private static Section handleHeadline(final XMLEventReader rdr,final String content) throws XMLStreamException, ConcreteException {
  rdr.nextEvent();
  rdr.nextEvent();
  rdr.nextEvent();
  XMLEvent hl=rdr.nextEvent();
  StartElement hlse=hl.asStartElement();
  QName hlqn=hlse.getName();
  final String hlPart=hlqn.getLocalPart();
  LOGGER.debug("String_Node_Str",hlPart);
  int hlPartOff=hlse.getLocation().getCharacterOffset();
  LOGGER.debug("String_Node_Str",hlPartOff);
  Characters cc=rdr.nextEvent().asCharacters();
  int charOff=cc.getLocation().getCharacterOffset();
  int clen=cc.getData().length();
  rdr.nextEvent();
  rdr.nextEvent();
  final int charOffPlusLen=charOff + clen;
  final String hlText=content.substring(charOff,charOffPlusLen);
  SimpleImmutableEntry<Integer,Integer> pads=trimSpacing(hlText);
  TextSpan ts=new TextSpan(charOff + pads.getKey(),charOffPlusLen - pads.getValue());
  Section s=new Section();
  s.setKind("String_Node_Str");
  s.setTextSpan(ts);
  List<Integer> intList=new ArrayList<>();
  intList.add(0);
  s.setNumberList(intList);
  return s;
}

Fixed version (ground truth):
private static Section handleHeadline(final XMLEventReader rdr,final String content) throws XMLStreamException, ConcreteException {
}
Program: 147355
Project: 147355
Buggy source:
private static int getRightSpacesPaddingCount(final String str){
  final int lenIdx=str.length() - 1;
  for (int i=0; i < lenIdx; i++) {
    Character c=str.charAt(lenIdx - i);
    if (!isSpaceOrUnixNewline(c))     return i;
  }
  return lenIdx + 1;
}

Fixed version (ground truth):
/** 
 * Number of whitespace characters that follow a non-whitespace charachter (if the given string is all whitespace, this returns 0).
 */
private static int getRightSpacesPaddingCount(final String str){
  final int lenIdx=str.length() - 1;
  for (int i=0; i < lenIdx; i++) {
    char c=str.charAt(lenIdx - i);
    if (!Character.isWhitespace(c))     return i;
  }
  return 0;
}
Program: 147356
Project: 147356
Buggy source:
public AnalyticUUIDGenerator(String uuidstr){
  UUIDTuple tuple=new UUIDTuple(uuidstr);
  this.xPart=tuple.p1;
  this.yPart=generateHexUnif(tuple.p2.length());
  String zPartStr=generateHexUnif(tuple.p3.length());
  this.zPart=Integer.parseUnsignedInt(zPartStr,16);
  this.zLen=zPartStr.length();
  this.zBound=(int)Math.pow(2,(4 * this.zLen));
}

Fixed version (ground truth):
public AnalyticUUIDGenerator(String uuidstr){
  UUIDTuple tuple=new UUIDTuple(uuidstr);
  this.xPart=tuple.p1;
  this.yPart=generateHexUnif(tuple.p2.length());
  String zPartStr=generateHexUnif(tuple.p3.length());
  this.zPart=Long.parseUnsignedLong(zPartStr,16);
  this.zLen=zPartStr.length();
  this.zBound=(int)Math.pow(2,(4 * this.zLen));
}
Program: 147357
Project: 147357
Buggy source:
private String zeroPaddedHex(int k,int pad){
  String hexStr=Integer.toHexString(k);
  int nonHex=Integer.parseInt(hexStr.substring(2));
  int nZeroes=pad - hexStr.length();
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < nZeroes; i++)   sb.append("String_Node_Str");
  sb.append(nonHex);
  return sb.toString();
}

Fixed version (ground truth):
public static String zeroPaddedHex(long k,int pad){
  String hexStr=Long.toHexString(k);
  int nZeroes=pad - hexStr.length();
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < nZeroes; i++)   sb.append("String_Node_Str");
  sb.append(hexStr);
  return sb.toString();
}
Program: 147358
Project: 147358
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  Thread.setDefaultUncaughtExceptionHandler(new LoggedUncaughtExceptionHandler());
  FilterArchiveByCommunicationType m=new FilterArchiveByCommunicationType();
  JCommander jc=new JCommander(m,args);
  jc.setProgramName(FilterArchiveByCommunicationType.class.getName());
  if (m.help) {
    jc.usage();
    return;
  }
  Predicate<Communication> notOfTypePred=comm -> !m.paramList.contains(comm.getType());
  try {
    ExistingNonDirectoryFile ef=new ExistingNonDirectoryFile(Paths.get(m.inFile));
    Path p=ef.getPath();
    try (InputStream is=Files.newInputStream(p);BufferedInputStream bin=new BufferedInputStream(is,1024 * 8 * 24);OutputStream os=Files.newOutputStream(Paths.get(m.outFile));GzipCompressorOutputStream gout=new GzipCompressorOutputStream(os);BufferedOutputStream bos=new BufferedOutputStream(gout,1024 * 8 * 24);TarArchiver arch=new TarArchiver(bos)){
      TarGzArchiveEntryCommunicationIterator iter=new TarGzArchiveEntryCommunicationIterator(bin);
      final Iterable<Communication> ic=() -> iter;
      StreamSupport.stream(ic.spliterator(),false).filter(notOfTypePred).forEach(c -> {
        try {
          arch.addEntry(new ArchivableCommunication(c));
        }
 catch (        IOException e) {
          throw new UncheckedIOException(e);
        }
      }
);
    }
     LOGGER.info("String_Node_Str",m.inFile);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + m.inFile,e);
  }
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args){
  Thread.setDefaultUncaughtExceptionHandler(new LoggedUncaughtExceptionHandler());
  FilterArchiveByCommunicationType m=new FilterArchiveByCommunicationType();
  JCommander jc=new JCommander(m,args);
  jc.setProgramName(FilterArchiveByCommunicationType.class.getName());
  if (m.help) {
    jc.usage();
    return;
  }
  final Set<String> toFilterSet=new HashSet<>(m.typeList);
  toFilterSet.forEach(s -> LOGGER.info("String_Node_Str",s));
  Predicate<Communication> notOfTypePred=comm -> !toFilterSet.contains(comm.getType());
  try {
    ExistingNonDirectoryFile ef=new ExistingNonDirectoryFile(Paths.get(m.inFile));
    Path p=ef.getPath();
    try (InputStream is=Files.newInputStream(p);BufferedInputStream bin=new BufferedInputStream(is,1024 * 8 * 24);OutputStream os=Files.newOutputStream(Paths.get(m.outFile));GzipCompressorOutputStream gout=new GzipCompressorOutputStream(os);BufferedOutputStream bos=new BufferedOutputStream(gout,1024 * 8 * 24);TarArchiver arch=new TarArchiver(bos)){
      TarGzArchiveEntryCommunicationIterator iter=new TarGzArchiveEntryCommunicationIterator(bin);
      final Iterable<Communication> ic=() -> iter;
      StreamSupport.stream(ic.spliterator(),false).filter(notOfTypePred).forEach(c -> {
        try {
          arch.addEntry(new ArchivableCommunication(c));
        }
 catch (        IOException e) {
          throw new UncheckedIOException(e);
        }
      }
);
    }
     LOGGER.info("String_Node_Str",m.inFile);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + m.inFile,e);
  }
}
Program: 147359
Project: 147359
Buggy source:
public Communication fromSgmlString(String ldcSgml){
  PersistentArrayMap map=(PersistentArrayMap)this.processSgmlFx.invoke(ldcSgml);
  String kind=(String)map.get(Keyword.find("String_Node_Str"));
  String id=(String)map.get(Keyword.find("String_Node_Str"));
  long date=(long)map.get(Keyword.find("String_Node_Str"));
  Communication c=CommunicationFactory.create().setId(id).setStartTime(date / 1000).setType(kind).setText(ldcSgml).setMetadata(TooledMetadataConverter.convert(this));
  Keyword skw=Keyword.find("String_Node_Str");
  @SuppressWarnings("String_Node_Str") List<PersistentArrayMap> sectionList=(List<PersistentArrayMap>)map.get(skw);
  LOGGER.debug("String_Node_Str",sectionList.size());
  sectionList.forEach(pam -> c.addToSectionList(this.fromPAM(pam)));
  return c;
}

Fixed version (ground truth):
public Communication fromSgmlString(String ldcSgml){
  PersistentArrayMap map=(PersistentArrayMap)this.processSgmlFx.invoke(ldcSgml);
  String kind=(String)map.get(Keyword.find("String_Node_Str"));
  String id=(String)map.get(Keyword.find("String_Node_Str"));
  long date=(long)map.get(Keyword.find("String_Node_Str"));
  Communication c=CommunicationFactory.create().setId(id).setStartTime(date / 1000).setType(kind).setText(ldcSgml).setMetadata(TooledMetadataConverter.convert(this));
  Keyword skw=Keyword.find("String_Node_Str");
  @SuppressWarnings("String_Node_Str") List<PersistentArrayMap> sectionList=(List<PersistentArrayMap>)map.get(skw);
  LOGGER.debug("String_Node_Str",sectionList.size());
  sectionList.stream().map(pam -> this.fromPAM(pam)).filter(SectionWrapper.hasZeroLengthTextSpan().negate()).forEach(s -> c.addToSectionList(s));
  LOGGER.debug("String_Node_Str",c.getSectionListSize());
  return c;
}
Program: 147360
Project: 147360
Buggy source:
/** 
 * @param pathToGigaSGMLFile a {@link Path} that represents a path to a .sgml file on disk.
 * @return a {@link GigawordDocument} object that represents the .sgml file
 */
public Communication fromPath(Path pathToGigaSGMLFile) throws IOException {
  try (InputStream is=Files.newInputStream(pathToGigaSGMLFile);BufferedInputStream bin=new BufferedInputStream(is,1024 * 8 * 24)){
    return this.fromSgmlString(IOUtils.toString(bin));
  }
 }

Fixed version (ground truth):
/** 
 * @param pathToGigaSGMLFile a {@link Path} that represents a path to a .sgml file on disk.
 * @return a {@link Communication} object that represents the .sgml file
 */
public Communication fromPath(Path pathToGigaSGMLFile) throws IOException {
  try (InputStream is=Files.newInputStream(pathToGigaSGMLFile);BufferedInputStream bin=new BufferedInputStream(is,1024 * 8 * 24)){
    return this.fromSgmlString(IOUtils.toString(bin));
  }
 }
Program: 147361
Project: 147361
Buggy source:
private int handleImg(final XMLEventReader rdr) throws XMLStreamException {
  return rdr.nextEvent().asEndElement().getLocation().getCharacterOffset();
}

Fixed version (ground truth):
private int handleImg(final XMLEventReader rdr) throws XMLStreamException {
  XMLEvent n=rdr.nextEvent();
  return n.asEndElement().getLocation().getCharacterOffset();
}