nus-yam/ex-repair huggingface dataset:
Program: 117505
Project: 117505
Buggy source:
public void run(){
  while (true) {
    try {
      System.out.println("String_Node_Str" + serverSocket.getLocalPort() + "String_Node_Str");
      Socket server=serverSocket.accept();
      System.out.println("String_Node_Str" + server.getRemoteSocketAddress());
      DataInputStream in=new DataInputStream(server.getInputStream());
      String request=in.readUTF();
      System.out.println("String_Node_Str" + request);
      ObjectOutputStream out=new ObjectOutputStream(server.getOutputStream());
      if (storage.get(request) != null) {
        out.writeObject(storage.get(request));
      }
 else {
        out.writeObject(null);
      }
      server.close();
    }
 catch (    Exception s) {
      s.printStackTrace();
      break;
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    try {
      System.out.println("String_Node_Str" + serverSocket.getLocalPort() + "String_Node_Str");
      Socket server=serverSocket.accept();
      System.out.println("String_Node_Str" + server.getRemoteSocketAddress());
      DataInputStream in=new DataInputStream(server.getInputStream());
      String request=in.readUTF();
      System.out.println("String_Node_Str" + request);
      ObjectOutputStream out=new ObjectOutputStream(server.getOutputStream());
      if (request.equalsIgnoreCase("String_Node_Str")) {
        try {
          Object schema=stack.pop();
          System.out.println("String_Node_Str" + schema);
          out.writeObject(schema);
        }
 catch (        Exception e) {
          out.writeObject(storage.get(request));
        }
      }
 else {
        if (storage.get(request) != null) {
          out.writeObject(storage.get(request));
        }
 else {
          out.writeObject(null);
        }
      }
      server.close();
    }
 catch (    Exception s) {
      s.printStackTrace();
      break;
    }
  }
}
Program: 117506
Project: 117506
Buggy source:
public void startBroadcastServer(int port){
  try {
    storage=new HashMap<Object,Object>();
    Thread t=new BroadCastServer(port);
    t.start();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void startBroadcastServer(int port){
  try {
    storage=new HashMap<Object,Object>();
    stack=new Stack<Object>();
    Thread t=new BroadCastServer(port);
    t.start();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 117508
Project: 117508
Buggy source:
@SuppressWarnings("String_Node_Str") public void prepareToRead(RecordReader reader,PigSplit split) throws IOException {
  this.reader=reader;
  UDFContext udfc=UDFContext.getUDFContext();
  Properties p=udfc.getUDFProperties(this.getClass(),new String[]{udfcSignature});
  String strSchema=p.getProperty(SCHEMA_SIGNATURE);
  if (strSchema == null) {
    BroadCastClient bc=new BroadCastClient(System.getenv("String_Node_Str"),Integer.parseInt(System.getenv("String_Node_Str")));
    p=(Properties)bc.getBroadCastMessage("String_Node_Str");
    strSchema=p.getProperty(SCHEMA_SIGNATURE);
  }
  schema=new ResourceSchema(Utils.getSchemaFromString(strSchema));
  jsonFactory=new JsonFactory();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void prepareToRead(RecordReader reader,PigSplit split) throws IOException {
  this.reader=reader;
  UDFContext udfc=UDFContext.getUDFContext();
  Properties p=udfc.getUDFProperties(this.getClass(),new String[]{udfcSignature});
  String strSchema=p.getProperty(SCHEMA_SIGNATURE);
  if (strSchema == null) {
    BroadCastClient bc=new BroadCastClient(System.getenv("String_Node_Str"),Integer.parseInt(System.getenv("String_Node_Str")));
    p=(Properties)bc.getBroadCastMessage("String_Node_Str");
    p=(Properties)bc.getBroadCastMessage("String_Node_Str");
    strSchema=p.getProperty(SCHEMA_SIGNATURE);
  }
  schema=new ResourceSchema(Utils.getSchemaFromString(strSchema));
  jsonFactory=new JsonFactory();
}
Program: 117509
Project: 117509
Buggy source:
public ResourceSchema getSchema(String location,Job job) throws IOException {
  ResourceSchema s;
  if (schema != null) {
    s=schema;
  }
 else {
    s=(new JsonMetadata()).getSchema(location,job,true);
    if (s == null) {
      throw new IOException("String_Node_Str" + location);
    }
  }
  UDFContext udfc=UDFContext.getUDFContext();
  Properties p=udfc.getUDFProperties(this.getClass(),new String[]{udfcSignature});
  p.setProperty(SCHEMA_SIGNATURE,s.toString());
  try {
    if (SparkLauncher.bcaster != null) {
      SparkLauncher.bcaster.addResource("String_Node_Str",p);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return s;
}

Fixed version (ground truth):
public ResourceSchema getSchema(String location,Job job) throws IOException {
  ResourceSchema s;
  if (schema != null) {
    s=schema;
  }
 else {
    s=(new JsonMetadata()).getSchema(location,job,true);
    if (s == null) {
      throw new IOException("String_Node_Str" + location);
    }
  }
  UDFContext udfc=UDFContext.getUDFContext();
  Properties p=udfc.getUDFProperties(this.getClass(),new String[]{udfcSignature});
  p.setProperty(SCHEMA_SIGNATURE,s.toString());
  try {
    if (SparkLauncher.bcaster != null) {
      SparkLauncher.bcaster.addResource("String_Node_Str","String_Node_Str",p);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return s;
}
Program: 117510
Project: 117510
Buggy source:
@Override public void prepareToWrite(RecordWriter writer) throws IOException {
  this.writer=writer;
  UDFContext udfc=UDFContext.getUDFContext();
  Properties p=udfc.getUDFProperties(this.getClass(),new String[]{udfcSignature});
  String strSchema=p.getProperty(SCHEMA_SIGNATURE);
  if (strSchema == null) {
    throw new IOException("String_Node_Str");
  }
  schema=new ResourceSchema(Utils.getSchemaFromString(strSchema));
  jsonFactory=new JsonFactory();
}

Fixed version (ground truth):
@Override public void prepareToWrite(RecordWriter writer) throws IOException {
  this.writer=writer;
  UDFContext udfc=UDFContext.getUDFContext();
  Properties p=udfc.getUDFProperties(this.getClass(),new String[]{udfcSignature});
  String strSchema=p.getProperty(SCHEMA_SIGNATURE);
  if (strSchema == null) {
    BroadCastClient bc=new BroadCastClient(System.getenv("String_Node_Str"),Integer.parseInt(System.getenv("String_Node_Str")));
    p=(Properties)bc.getBroadCastMessage("String_Node_Str");
    strSchema=p.getProperty(SCHEMA_SIGNATURE);
  }
  schema=new ResourceSchema(Utils.getSchemaFromString(strSchema));
  jsonFactory=new JsonFactory();
}
Program: 117511
Project: 117511
Buggy source:
@Override public void checkSchema(ResourceSchema s) throws IOException {
  UDFContext udfc=UDFContext.getUDFContext();
  Properties p=udfc.getUDFProperties(this.getClass(),new String[]{udfcSignature});
  p.setProperty(SCHEMA_SIGNATURE,s.toString());
}

Fixed version (ground truth):
@Override public void checkSchema(ResourceSchema s) throws IOException {
  UDFContext udfc=UDFContext.getUDFContext();
  Properties p=udfc.getUDFProperties(this.getClass(),new String[]{udfcSignature});
  p.setProperty(SCHEMA_SIGNATURE,s.toString());
  try {
    if (SparkLauncher.bcaster != null) {
      SparkLauncher.bcaster.addResource("String_Node_Str",p);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 117512
Project: 117512
Buggy source:
@Override public RDD<Tuple> convert(List<RDD<Tuple>> predecessors,POGlobalRearrange physicalOperator) throws IOException {
  SparkUtil.assertPredecessorSizeGreaterThan(predecessors,physicalOperator,0);
  int parallelism=SparkUtil.getParallelism(predecessors,physicalOperator);
  String reducers=System.getenv("String_Node_Str");
  if (reducers != null) {
    parallelism=Integer.parseInt(reducers);
  }
  LOG.info("String_Node_Str" + parallelism);
  if (predecessors.size() == 1) {
    return predecessors.get(0).groupBy(GET_KEY_FUNCTION,parallelism,SparkUtil.getManifest(Object.class)).map(GROUP_TUPLE_FUNCTION,SparkUtil.getManifest(Tuple.class));
  }
 else {
    ClassTag<Tuple2<Object,Tuple>> tuple2ClassManifest=SparkUtil.<Object,Tuple>getTuple2Manifest();
    List<RDD<Tuple2<Object,Tuple>>> rddPairs=new ArrayList();
    for (    RDD<Tuple> rdd : predecessors) {
      RDD<Tuple2<Object,Tuple>> rddPair=rdd.map(TO_KEY_VALUE_FUNCTION,tuple2ClassManifest);
      rddPairs.add(rddPair);
    }
    CoGroupedRDD<Object> coGroupedRDD=new CoGroupedRDD<Object>((Seq<RDD<? extends Product2<Object,?>>>)(Object)(JavaConversions.asScalaBuffer(rddPairs).toSeq()),new HashPartitioner(parallelism));
    RDD<Tuple2<Object,Seq<Seq<Tuple>>>> rdd=(RDD<Tuple2<Object,Seq<Seq<Tuple>>>>)(Object)coGroupedRDD;
    return rdd.map(TO_GROUP_KEY_VALUE_FUNCTION,SparkUtil.getManifest(Tuple.class));
  }
}

Fixed version (ground truth):
@Override public RDD<Tuple> convert(List<RDD<Tuple>> predecessors,POGlobalRearrange physicalOperator) throws IOException {
  SparkUtil.assertPredecessorSizeGreaterThan(predecessors,physicalOperator,0);
  int parallelism=SparkUtil.getParallelism(predecessors,physicalOperator);
  parallelism=100;
  String reducers=System.getenv("String_Node_Str");
  if (reducers != null) {
    parallelism=Integer.parseInt(reducers);
  }
  LOG.info("String_Node_Str" + parallelism);
  if (predecessors.size() == 1) {
    return predecessors.get(0).groupBy(GET_KEY_FUNCTION,parallelism,SparkUtil.getManifest(Object.class)).map(GROUP_TUPLE_FUNCTION,SparkUtil.getManifest(Tuple.class));
  }
 else {
    ClassTag<Tuple2<Object,Tuple>> tuple2ClassManifest=SparkUtil.<Object,Tuple>getTuple2Manifest();
    List<RDD<Tuple2<Object,Tuple>>> rddPairs=new ArrayList();
    for (    RDD<Tuple> rdd : predecessors) {
      RDD<Tuple2<Object,Tuple>> rddPair=rdd.map(TO_KEY_VALUE_FUNCTION,tuple2ClassManifest);
      rddPairs.add(rddPair);
    }
    CoGroupedRDD<Object> coGroupedRDD=new CoGroupedRDD<Object>((Seq<RDD<? extends Product2<Object,?>>>)(Object)(JavaConversions.asScalaBuffer(rddPairs).toSeq()),new HashPartitioner(parallelism));
    RDD<Tuple2<Object,Seq<Seq<Tuple>>>> rdd=(RDD<Tuple2<Object,Seq<Seq<Tuple>>>>)(Object)coGroupedRDD;
    return rdd.map(TO_GROUP_KEY_VALUE_FUNCTION,SparkUtil.getManifest(Tuple.class));
  }
}
Program: 117513
Project: 117513
Buggy source:
@Override public Tuple apply(Tuple t){
  Result result;
  try {
    physicalOperator.setInputs(null);
    physicalOperator.attachInput(t);
    result=physicalOperator.getNextTuple();
    if (result == null) {
      throw new RuntimeException("String_Node_Str" + t);
    }
switch (result.returnStatus) {
case POStatus.STATUS_OK:
      Tuple resultTuple=(Tuple)result.result;
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str" + resultTuple);
  return resultTuple;
default :
throw new RuntimeException("String_Node_Str" + physicalOperator + "String_Node_Str"+ result);
}
}
 catch (ExecException e) {
throw new RuntimeException("String_Node_Str" + t,e);
}
}

Fixed version (ground truth):
@Override public Tuple apply(Tuple t){
  Result result;
  try {
    physicalOperator.setInputs(null);
    physicalOperator.attachInput(t);
    result=physicalOperator.getNextTuple();
    if (result == null) {
      throw new RuntimeException("String_Node_Str" + t);
    }
switch (result.returnStatus) {
case POStatus.STATUS_OK:
      Tuple resultTuple=(Tuple)result.result;
    return resultTuple;
default :
  throw new RuntimeException("String_Node_Str" + physicalOperator + "String_Node_Str"+ result);
}
}
 catch (ExecException e) {
throw new RuntimeException("String_Node_Str" + t,e);
}
}
Program: 117514
Project: 117514
Buggy source:
@Override public RDD<Tuple> convert(List<RDD<Tuple>> predecessors,POLocalRearrange physicalOperator) throws IOException {
  SparkUtil.assertPredecessorSize(predecessors,physicalOperator,1);
  RDD<Tuple> rdd=predecessors.get(0);
  return rdd.map(new LocalRearrangeFunction(physicalOperator),SparkUtil.getManifest(Tuple.class));
}

Fixed version (ground truth):
@Override public RDD<Tuple> convert(List<RDD<Tuple>> predecessors,POLocalRearrange physicalOperator) throws IOException {
  SparkUtil.assertPredecessorSize(predecessors,physicalOperator,1);
  RDD<Tuple> rdd=predecessors.get(0).repartition(100);
  return rdd.map(new LocalRearrangeFunction(physicalOperator),SparkUtil.getManifest(Tuple.class));
}
Program: 117517
Project: 117517
Buggy source:
@Override public RequiredFieldResponse pushProjection(RequiredFieldList requiredFieldList) throws FrontendException {
  if (requiredFieldList == null)   return null;
  if (requiredFieldList.getFields() != null) {
    int lastColumn=-1;
    for (    RequiredField rf : requiredFieldList.getFields()) {
      if (rf.getIndex() > lastColumn) {
        lastColumn=rf.getIndex();
      }
    }
    mRequiredColumns=new boolean[lastColumn + 1];
    for (    RequiredField rf : requiredFieldList.getFields()) {
      if (rf.getIndex() != -1)       mRequiredColumns[rf.getIndex()]=true;
    }
    Properties p=UDFContext.getUDFContext().getUDFProperties(this.getClass());
    try {
      p.setProperty(signature,ObjectSerializer.serialize(mRequiredColumns));
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return new RequiredFieldResponse(true);
}

Fixed version (ground truth):
@Override public RequiredFieldResponse pushProjection(RequiredFieldList requiredFieldList) throws FrontendException {
  if (requiredFieldList == null)   return null;
  if (requiredFieldList.getFields() != null) {
    int lastColumn=-1;
    for (    RequiredField rf : requiredFieldList.getFields()) {
      if (rf.getIndex() > lastColumn) {
        lastColumn=rf.getIndex();
      }
    }
    mRequiredColumns=new boolean[lastColumn + 1];
    for (    RequiredField rf : requiredFieldList.getFields()) {
      if (rf.getIndex() != -1)       mRequiredColumns[rf.getIndex()]=true;
    }
    try {
      required_fields=mRequiredColumns;
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    Properties p=UDFContext.getUDFContext().getUDFProperties(this.getClass());
    try {
      p.setProperty(signature,ObjectSerializer.serialize(mRequiredColumns));
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return new RequiredFieldResponse(true);
}
Program: 117519
Project: 117519
Buggy source:
public String buildCacheOp(SourceLocation loc,LOCache cacheOp,String inputAlias) throws ParserValidationException {
  String newAlias=newOperatorKey();
  String alias=buildOp(loc,cacheOp,newAlias,inputAlias,null);
  operators.remove(newAlias);
  putOperator(inputAlias,cacheOp);
  return alias;
}

Fixed version (ground truth):
public String buildCacheOp(SourceLocation loc,LOCache cacheOp,String inputAlias) throws ParserValidationException {
  String newAlias=newOperatorKey();
  String alias=buildOp(loc,cacheOp,newAlias,inputAlias,null);
  operators.remove(newAlias);
  cacheOp.setAlias(inputAlias);
  putOperator(inputAlias,cacheOp);
  return alias;
}
Program: 117520
Project: 117520
Buggy source:
@Test public void testMergeSchemaErrorMessage() throws IOException {
  try {
    pigServer.registerQuery("String_Node_Str");
    pigServer.registerQuery("String_Node_Str");
    pigServer.registerQuery("String_Node_Str");
    pigServer.openIterator("String_Node_Str");
  }
 catch (  Exception e) {
    PigException pe=LogUtils.getPigException(e);
    Util.checkStrContainsSubStr(pe.getMessage(),"String_Node_Str");
    Util.checkStrContainsSubStr(pe.getMessage(),"String_Node_Str");
    return;
  }
  Assert.fail();
}

Fixed version (ground truth):
@Test public void testMergeSchemaErrorMessage() throws IOException {
  try {
    pigServer.registerQuery("String_Node_Str");
    pigServer.registerQuery("String_Node_Str");
    pigServer.registerQuery("String_Node_Str");
    pigServer.openIterator("String_Node_Str");
  }
 catch (  Exception e) {
    PigException pe=LogUtils.getPigException(e);
    Util.checkStrContainsSubStr(pe.getMessage(),"String_Node_Str");
    return;
  }
  Assert.fail();
}
Program: 117521
Project: 117521
Buggy source:
@Test public void testErrorLogFile2() throws Exception {
  PrintWriter w=new PrintWriter(new FileWriter(PIG_FILE));
  w.println("String_Node_Str" + INPUT_FILE + "String_Node_Str");
  w.println("String_Node_Str");
  w.println("String_Node_Str" + OUTPUT_FILE + "String_Node_Str");
  w.close();
  try {
    String[] args={"String_Node_Str","String_Node_Str","String_Node_Str",PIG_FILE};
    PigStats stats=PigRunner.run(args,null);
    assertTrue(!stats.isSuccessful());
    Properties props=stats.getPigProperties();
    String logfile=props.getProperty("String_Node_Str");
    File f=new File(logfile);
    assertTrue(f.exists());
  }
  finally {
    new File(PIG_FILE).delete();
  }
}

Fixed version (ground truth):
@Test public void testErrorLogFile2() throws Exception {
  PrintWriter w=new PrintWriter(new FileWriter(PIG_FILE));
  w.println("String_Node_Str" + INPUT_FILE + "String_Node_Str");
  w.println("String_Node_Str");
  w.println("String_Node_Str" + OUTPUT_FILE + "String_Node_Str");
  w.close();
  try {
    String[] args={"String_Node_Str","String_Node_Str","String_Node_Str",PIG_FILE};
    PigStats stats=PigRunner.run(args,null);
    assertTrue(!stats.isSuccessful());
    Properties props=stats.getPigProperties();
    if (props != null) {
      String logfile=props.getProperty("String_Node_Str");
      File f=new File(logfile);
      assertTrue(f.exists());
    }
  }
  finally {
    new File(PIG_FILE).delete();
  }
}
Program: 117523
Project: 117523
Buggy source:
public InputFile buildInputFile(String fileName,FileSystem fs){
  for (  String sourceDir : Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")) {
    Iterable<InputFile> files=fs.inputFiles(fs.predicates().hasRelativePath(sourceDir + fileName));
    for (    InputFile f : files) {
      return f;
    }
  }
  return null;
}

Fixed version (ground truth):
public InputFile buildInputFile(String fileName,FileSystem fs){
  for (  String sourceDir : Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")) {
    System.out.println("String_Node_Str" + sourceDir + "String_Node_Str"+ fileName);
    Iterable<InputFile> files=fs.inputFiles(fs.predicates().hasRelativePath(sourceDir + "String_Node_Str" + fileName));
    for (    InputFile f : files) {
      return f;
    }
  }
  return null;
}
Program: 117524
Project: 117524
Buggy source:
/** 
 * Map Java line number to JSP line number based on SMAP The smap can be either embedded in the class file or alternatively place in separate file.
 * @param className Class name
 * @param originalLine Line of code of the auto-generated Java line (.jsp -> .java -> .class)
 * @param classFile (Optional)
 * @return JSP line number
 */
public SmapParser.SmapLocation extractSmapLocation(String className,int originalLine,File classFile){
  try (InputStream in=new FileInputStream(classFile)){
    DebugExtensionExtractor debug=new DebugExtensionExtractor();
    return getJspLineNumberFromSmap(debug.getDebugExtFromClass(in),originalLine);
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str" + classFile.getPath());
  }
  LOG.debug("String_Node_Str" + className);
  File smapFile=new File(classFile.getPath() + "String_Node_Str");
  if (smapFile.exists()) {
    try (InputStream smapInputStream=new FileInputStream(smapFile)){
      return getJspLineNumberFromSmap(IOUtils.toString(smapInputStream),originalLine);
    }
 catch (    IOException e) {
      LOG.debug("String_Node_Str" + smapFile.getAbsolutePath());
      throw new RuntimeException(e);
    }
  }
  LOG.debug("String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Map Java line number to JSP line number based on SMAP The smap can be either embedded in the class file or alternatively place in separate file.
 * @param className Class name
 * @param originalLine Line of code of the auto-generated Java line (.jsp -> .java -> .class)
 * @param classFile (Optional)
 * @return JSP line number
 */
public SmapParser.SmapLocation extractSmapLocation(String className,int originalLine,File classFile){
  try (InputStream in=new FileInputStream(classFile)){
    DebugExtensionExtractor debug=new DebugExtensionExtractor();
    return getJspLineNumberFromSmap(debug.getDebugExtFromClass(in),originalLine);
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str" + classFile.getPath());
  }
  LOG.debug("String_Node_Str" + className);
  File smapFile=new File(classFile.getPath() + "String_Node_Str");
  if (smapFile.exists()) {
    try (InputStream smapInputStream=new FileInputStream(smapFile)){
      return getJspLineNumberFromSmap(IOUtils.toString(smapInputStream),originalLine);
    }
 catch (    IOException e) {
      LOG.debug("String_Node_Str" + smapFile.getAbsolutePath());
    }
  }
 else {
    LOG.debug("String_Node_Str");
  }
  return null;
}
Program: 117525
Project: 117525
Buggy source:
/** 
 * Find the file system location of a given class name.<br/> (ie : <code>test.SomeClass</code> ->  <code>src/main/java/test/SomeClass.java</code>)
 * @param className Class name to look for
 * @param fs File system
 * @return Java source file that conrespond to the class name specified.
 */
public InputFile findJavaClassFile(String className,FileSystem fs){
  int indexDollarSign=className.indexOf("String_Node_Str");
  if (indexDollarSign != -1) {
    className=className.substring(0,indexDollarSign);
  }
  Iterable<InputFile> files=fs.inputFiles(fs.predicates().hasRelativePath("String_Node_Str" + className.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str"));
  for (  InputFile f : files) {
    return f;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Find the file system location of a given class name.<br/> (ie : <code>test.SomeClass</code> ->  <code>src/main/java/test/SomeClass.java</code>)
 * @param className Class name to look for
 * @param fs File system
 * @return Java source file that conrespond to the class name specified.
 */
public InputFile findJavaClassFile(String className,FileSystem fs){
  int indexDollarSign=className.indexOf("String_Node_Str");
  if (indexDollarSign != -1) {
    className=className.substring(0,indexDollarSign);
  }
  return buildInputFile(className.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str",fs);
}
Program: 117526
Project: 117526
Buggy source:
@Test public void findTemplateFile_jasperFileName(){
  String prefixSource="String_Node_Str";
  String[] pages={"String_Node_Str","String_Node_Str"};
  for (  String jspPage : pages) {
    String name="String_Node_Str" + JspUtils.makeJavaPackage(jspPage);
    System.out.println(name);
    ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
    when(fs.inputFiles(Matchers.<FilePredicate>any())).thenReturn(new ArrayList<InputFile>());
    locator.findTemplateFile(name,fs);
    System.out.println("String_Node_Str" + prefixSource + jspPage);
    verify(predicates,times(1)).hasRelativePath(prefixSource + jspPage);
  }
}

Fixed version (ground truth):
@Test public void findTemplateFile_jasperFileName(){
  String prefixSource="String_Node_Str";
  String[] pages={"String_Node_Str","String_Node_Str"};
  for (  String jspPage : pages) {
    String name="String_Node_Str" + JspUtils.makeJavaPackage(jspPage);
    System.out.println("String_Node_Str" + name);
    ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
    locator.findTemplateFile(name,fsEmpty);
    System.out.println("String_Node_Str" + prefixSource + jspPage);
    verify(predicatesEmpty,times(1)).hasRelativePath(prefixSource + jspPage);
  }
}
Program: 117527
Project: 117527
Buggy source:
@Test public void findJavaClassFile_withInnerClass(){
  when(fs.inputFiles(Matchers.<FilePredicate>any())).thenReturn(new ArrayList<InputFile>());
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findJavaClassFile("String_Node_Str",fs);
  verify(predicates,times(1)).hasRelativePath("String_Node_Str");
}

Fixed version (ground truth):
@Test public void findJavaClassFile_withInnerClass(){
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findJavaClassFile("String_Node_Str",fsEmpty);
  verify(predicatesEmpty,times(1)).hasRelativePath("String_Node_Str");
}
Program: 117528
Project: 117528
Buggy source:
@Before public void setUp(){
  fs=mock(FileSystem.class);
  predicates=mock(FilePredicates.class);
  when(fs.predicates()).thenReturn(predicates);
}

Fixed version (ground truth):
@Before public void setUp(){
  fsEmpty=mock(FileSystem.class);
  predicatesEmpty=mock(FilePredicates.class);
  when(fsEmpty.predicates()).thenReturn(predicatesEmpty);
  when(fsEmpty.inputFiles(any(FilePredicate.class))).thenReturn(new ArrayList<InputFile>());
}
Program: 117529
Project: 117529
Buggy source:
@Test public void findJavaClassFile_normalClassName(){
  when(fs.inputFiles(Matchers.<FilePredicate>any())).thenReturn(new ArrayList<InputFile>());
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findJavaClassFile("String_Node_Str",fs);
  verify(predicates,times(1)).hasRelativePath("String_Node_Str");
}

Fixed version (ground truth):
@Test public void findJavaClassFile_normalClassName(){
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findJavaClassFile("String_Node_Str",fsEmpty);
  verify(predicatesEmpty,times(1)).hasRelativePath("String_Node_Str");
}
Program: 117530
Project: 117530
Buggy source:
@Test public void findTemplateFile_weblogicFileName(){
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  when(fs.inputFiles(Matchers.<FilePredicate>any())).thenReturn(new ArrayList<InputFile>());
  locator.findTemplateFile("String_Node_Str",fs);
  verify(predicates,times(1)).hasRelativePath("String_Node_Str");
}

Fixed version (ground truth):
@Test public void findTemplateFile_weblogicFileName(){
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findTemplateFile("String_Node_Str",fsEmpty);
  verify(predicatesEmpty,times(1)).hasRelativePath("String_Node_Str");
}
Program: 117532
Project: 117532
Buggy source:
public InputFile buildInputFile(String fileName,FileSystem fs){
  for (  String sourceDir : Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")) {
    Iterable<InputFile> files=fs.inputFiles(fs.predicates().hasRelativePath(sourceDir + fileName));
    for (    InputFile f : files) {
      return f;
    }
  }
  return null;
}

Fixed version (ground truth):
public InputFile buildInputFile(String fileName,FileSystem fs){
  for (  String sourceDir : Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")) {
    System.out.println("String_Node_Str" + sourceDir + "String_Node_Str"+ fileName);
    Iterable<InputFile> files=fs.inputFiles(fs.predicates().hasRelativePath(sourceDir + "String_Node_Str" + fileName));
    for (    InputFile f : files) {
      return f;
    }
  }
  return null;
}
Program: 117533
Project: 117533
Buggy source:
/** 
 * Map Java line number to JSP line number based on SMAP The smap can be either embedded in the class file or alternatively place in separate file.
 * @param className Class name
 * @param originalLine Line of code of the auto-generated Java line (.jsp -> .java -> .class)
 * @param classFile (Optional)
 * @return JSP line number
 */
public SmapParser.SmapLocation extractSmapLocation(String className,int originalLine,File classFile){
  try (InputStream in=new FileInputStream(classFile)){
    DebugExtensionExtractor debug=new DebugExtensionExtractor();
    return getJspLineNumberFromSmap(debug.getDebugExtFromClass(in),originalLine);
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str" + classFile.getPath());
  }
  LOG.debug("String_Node_Str" + className);
  File smapFile=new File(classFile.getPath() + "String_Node_Str");
  if (smapFile.exists()) {
    try (InputStream smapInputStream=new FileInputStream(smapFile)){
      return getJspLineNumberFromSmap(IOUtils.toString(smapInputStream),originalLine);
    }
 catch (    IOException e) {
      LOG.debug("String_Node_Str" + smapFile.getAbsolutePath());
      throw new RuntimeException(e);
    }
  }
  LOG.debug("String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Map Java line number to JSP line number based on SMAP The smap can be either embedded in the class file or alternatively place in separate file.
 * @param className Class name
 * @param originalLine Line of code of the auto-generated Java line (.jsp -> .java -> .class)
 * @param classFile (Optional)
 * @return JSP line number
 */
public SmapParser.SmapLocation extractSmapLocation(String className,int originalLine,File classFile){
  try (InputStream in=new FileInputStream(classFile)){
    DebugExtensionExtractor debug=new DebugExtensionExtractor();
    return getJspLineNumberFromSmap(debug.getDebugExtFromClass(in),originalLine);
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str" + classFile.getPath());
  }
  LOG.debug("String_Node_Str" + className);
  File smapFile=new File(classFile.getPath() + "String_Node_Str");
  if (smapFile.exists()) {
    try (InputStream smapInputStream=new FileInputStream(smapFile)){
      return getJspLineNumberFromSmap(IOUtils.toString(smapInputStream),originalLine);
    }
 catch (    IOException e) {
      LOG.debug("String_Node_Str" + smapFile.getAbsolutePath());
    }
  }
 else {
    LOG.debug("String_Node_Str");
  }
  return null;
}
Program: 117534
Project: 117534
Buggy source:
/** 
 * Find the file system location of a given class name.<br/> (ie : <code>test.SomeClass</code> ->  <code>src/main/java/test/SomeClass.java</code>)
 * @param className Class name to look for
 * @param fs File system
 * @return Java source file that conrespond to the class name specified.
 */
public InputFile findJavaClassFile(String className,FileSystem fs){
  int indexDollarSign=className.indexOf("String_Node_Str");
  if (indexDollarSign != -1) {
    className=className.substring(0,indexDollarSign);
  }
  Iterable<InputFile> files=fs.inputFiles(fs.predicates().hasRelativePath("String_Node_Str" + className.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str"));
  for (  InputFile f : files) {
    return f;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Find the file system location of a given class name.<br/> (ie : <code>test.SomeClass</code> ->  <code>src/main/java/test/SomeClass.java</code>)
 * @param className Class name to look for
 * @param fs File system
 * @return Java source file that conrespond to the class name specified.
 */
public InputFile findJavaClassFile(String className,FileSystem fs){
  int indexDollarSign=className.indexOf("String_Node_Str");
  if (indexDollarSign != -1) {
    className=className.substring(0,indexDollarSign);
  }
  return buildInputFile(className.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str",fs);
}
Program: 117535
Project: 117535
Buggy source:
@Test public void findTemplateFile_jasperFileName(){
  String prefixSource="String_Node_Str";
  String[] pages={"String_Node_Str","String_Node_Str"};
  for (  String jspPage : pages) {
    String name="String_Node_Str" + JspUtils.makeJavaPackage(jspPage);
    System.out.println(name);
    ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
    when(fs.inputFiles(Matchers.<FilePredicate>any())).thenReturn(new ArrayList<InputFile>());
    locator.findTemplateFile(name,fs);
    System.out.println("String_Node_Str" + prefixSource + jspPage);
    verify(predicates,times(1)).hasRelativePath(prefixSource + jspPage);
  }
}

Fixed version (ground truth):
@Test public void findTemplateFile_jasperFileName(){
  String prefixSource="String_Node_Str";
  String[] pages={"String_Node_Str","String_Node_Str"};
  for (  String jspPage : pages) {
    String name="String_Node_Str" + JspUtils.makeJavaPackage(jspPage);
    System.out.println("String_Node_Str" + name);
    ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
    locator.findTemplateFile(name,fsEmpty);
    System.out.println("String_Node_Str" + prefixSource + jspPage);
    verify(predicatesEmpty,times(1)).hasRelativePath(prefixSource + jspPage);
  }
}
Program: 117536
Project: 117536
Buggy source:
@Test public void findJavaClassFile_withInnerClass(){
  when(fs.inputFiles(Matchers.<FilePredicate>any())).thenReturn(new ArrayList<InputFile>());
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findJavaClassFile("String_Node_Str",fs);
  verify(predicates,times(1)).hasRelativePath("String_Node_Str");
}

Fixed version (ground truth):
@Test public void findJavaClassFile_withInnerClass(){
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findJavaClassFile("String_Node_Str",fsEmpty);
  verify(predicatesEmpty,times(1)).hasRelativePath("String_Node_Str");
}
Program: 117537
Project: 117537
Buggy source:
@Before public void setUp(){
  fs=mock(FileSystem.class);
  predicates=mock(FilePredicates.class);
  when(fs.predicates()).thenReturn(predicates);
}

Fixed version (ground truth):
@Before public void setUp(){
  fsEmpty=mock(FileSystem.class);
  predicatesEmpty=mock(FilePredicates.class);
  when(fsEmpty.predicates()).thenReturn(predicatesEmpty);
  when(fsEmpty.inputFiles(any(FilePredicate.class))).thenReturn(new ArrayList<InputFile>());
}
Program: 117538
Project: 117538
Buggy source:
@Test public void findJavaClassFile_normalClassName(){
  when(fs.inputFiles(Matchers.<FilePredicate>any())).thenReturn(new ArrayList<InputFile>());
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findJavaClassFile("String_Node_Str",fs);
  verify(predicates,times(1)).hasRelativePath("String_Node_Str");
}

Fixed version (ground truth):
@Test public void findJavaClassFile_normalClassName(){
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findJavaClassFile("String_Node_Str",fsEmpty);
  verify(predicatesEmpty,times(1)).hasRelativePath("String_Node_Str");
}
Program: 117539
Project: 117539
Buggy source:
@Test public void findTemplateFile_weblogicFileName(){
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  when(fs.inputFiles(Matchers.<FilePredicate>any())).thenReturn(new ArrayList<InputFile>());
  locator.findTemplateFile("String_Node_Str",fs);
  verify(predicates,times(1)).hasRelativePath("String_Node_Str");
}

Fixed version (ground truth):
@Test public void findTemplateFile_weblogicFileName(){
  ByteCodeResourceLocator locator=new ByteCodeResourceLocator();
  locator.findTemplateFile("String_Node_Str",fsEmpty);
  verify(predicatesEmpty,times(1)).hasRelativePath("String_Node_Str");
}
Program: 117540
Project: 117540
Buggy source:
public edu.umd.cs.findbugs.Project getFindbugsProject() throws IOException {
  edu.umd.cs.findbugs.Project findbugsProject=new edu.umd.cs.findbugs.Project();
  for (  File file : getSourceFiles()) {
    findbugsProject.addFile(file.getAbsolutePath());
  }
  Collection<File> classFilesToAnalyze=javaResourceLocator.classFilesToAnalyze();
  for (  File classToAnalyze : classFilesToAnalyze) {
    findbugsProject.addFile(classToAnalyze.getCanonicalPath());
  }
  for (  File file : javaResourceLocator.classpath()) {
    findbugsProject.addAuxClasspathEntry(file.getAbsolutePath());
  }
  copyLibs();
  if (annotationsLib != null) {
    findbugsProject.addAuxClasspathEntry(annotationsLib.getAbsolutePath());
    findbugsProject.addAuxClasspathEntry(jsr305Lib.getAbsolutePath());
  }
  findbugsProject.setCurrentWorkingDirectory(fileSystem.workDir());
  return findbugsProject;
}

Fixed version (ground truth):
public edu.umd.cs.findbugs.Project getFindbugsProject() throws IOException {
  edu.umd.cs.findbugs.Project findbugsProject=new edu.umd.cs.findbugs.Project();
  for (  File file : getSourceFiles()) {
    findbugsProject.addFile(file.getCanonicalPath());
  }
  Collection<File> classFilesToAnalyze=javaResourceLocator.classFilesToAnalyze();
  for (  File classToAnalyze : classFilesToAnalyze) {
    findbugsProject.addFile(classToAnalyze.getCanonicalPath());
  }
  for (  File file : javaResourceLocator.classpath()) {
    findbugsProject.addAuxClasspathEntry(file.getCanonicalPath());
  }
  copyLibs();
  if (annotationsLib != null) {
    findbugsProject.addAuxClasspathEntry(annotationsLib.getCanonicalPath());
    findbugsProject.addAuxClasspathEntry(jsr305Lib.getCanonicalPath());
  }
  findbugsProject.setCurrentWorkingDirectory(fileSystem.workDir());
  return findbugsProject;
}
Program: 117541
Project: 117541
Buggy source:
@Override public void onStart(ConnectedNode connectedNode){
  geometry_msgs.Pose pose=connectedNode.getTopicMessageFactory().newFromType(geometry_msgs.Pose._TYPE);
  publisher=connectedNode.newPublisher("String_Node_Str",geometry_msgs.Pose._TYPE);
}

Fixed version (ground truth):
@Override public void onStart(ConnectedNode connectedNode){
  pose=connectedNode.getTopicMessageFactory().newFromType(geometry_msgs.Pose._TYPE);
  publisher=connectedNode.newPublisher("String_Node_Str",geometry_msgs.Pose._TYPE);
}
Program: 117542
Project: 117542
Buggy source:
@Override public void onStart(ConnectedNode node){
  mTangoOdomPublisher=new TangoOdomPublisher(node);
  mTangoPosePublisher=new TangoPosePublisher(node);
  node.executeCancellableLoop(new CancellableLoop(){
    @Override protected void loop() throws InterruptedException {
      Thread.sleep(30);
      final double[] posState=mVinsServiceHelper.getStateInFullStateFormat();
      final double[] rotState=mVinsServiceHelper.getStateInUnityFormat();
      updateTranslation(posState);
      Thread.sleep(50);
      updateRoataion(rotState);
      Thread.sleep(50);
      mTangoOdomPublisher.publishOdom();
      mTangoPosePublisher.publishPose();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onStart(ConnectedNode node){
  mTangoOdomPublisher=new TangoOdomPublisher(node);
  mTangoPosePublisher=new TangoPosePublisher(node);
  mTangoTfPublisher=new TangoTfPublisher(node);
  node.executeCancellableLoop(new CancellableLoop(){
    @Override protected void loop() throws InterruptedException {
      Thread.sleep(30);
      final double[] posState=mVinsServiceHelper.getStateInFullStateFormat();
      final double[] rotState=mVinsServiceHelper.getStateInUnityFormat();
      updateTranslation(posState);
      Thread.sleep(30);
      updateRoataion(rotState);
      Thread.sleep(30);
      mTangoOdomPublisher.publishOdom();
      mTangoPosePublisher.publishPose();
      mTangoTfPublisher.publishTransforms();
    }
  }
);
}
Program: 117543
Project: 117543
Buggy source:
public void updateTranslation(double[] state){
  mTangoOdomPublisher.setPosePoint(state[5],-state[4],0x0);
  mTangoPosePublisher.setPoint(state[5],-state[4],0x0);
}

Fixed version (ground truth):
public void updateTranslation(double[] state){
  mTangoOdomPublisher.setPosePoint(state[5],-state[4],state[6]);
  mTangoPosePublisher.setPoint(state[5],-state[4],state[6]);
  mTangoTfPublisher.setTranslation(state[5],-state[4],state[6]);
}
Program: 117544
Project: 117544
Buggy source:
@Override protected void loop() throws InterruptedException {
  Thread.sleep(30);
  final double[] posState=mVinsServiceHelper.getStateInFullStateFormat();
  final double[] rotState=mVinsServiceHelper.getStateInUnityFormat();
  updateTranslation(posState);
  Thread.sleep(50);
  updateRoataion(rotState);
  Thread.sleep(50);
  mTangoOdomPublisher.publishOdom();
  mTangoPosePublisher.publishPose();
}

Fixed version (ground truth):
@Override protected void loop() throws InterruptedException {
  Thread.sleep(30);
  final double[] posState=mVinsServiceHelper.getStateInFullStateFormat();
  final double[] rotState=mVinsServiceHelper.getStateInUnityFormat();
  updateTranslation(posState);
  Thread.sleep(30);
  updateRoataion(rotState);
  Thread.sleep(30);
  mTangoOdomPublisher.publishOdom();
  mTangoPosePublisher.publishPose();
  mTangoTfPublisher.publishTransforms();
}
Program: 117545
Project: 117545
Buggy source:
public void updateRoataion(double[] state){
  mTangoOdomPublisher.setPoseQuat(-state[2],state[0],-state[1],state[3]);
  mTangoPosePublisher.setQuat(-state[2],state[0],-state[1],state[3]);
}

Fixed version (ground truth):
public void updateRoataion(double[] state){
  mTangoOdomPublisher.setPoseQuat(-state[2],state[0],-state[1],state[3]);
  mTangoPosePublisher.setQuat(-state[2],state[0],-state[1],state[3]);
  mTangoTfPublisher.setRotation(-state[2],state[0],-state[1],state[3]);
}
Program: 117546
Project: 117546
Buggy source:
public Builder onPatch(final Patch patch){
  startTime=patch.getStartTime().getMillis();
  endTime=patch.getEndTime() == null ? null : patch.getEndTime().getMillis();
  return this;
}

Fixed version (ground truth):
public Builder onPatch(final Patch patch){
  startTime=patch.getStartTime().getMillis();
  endTime=patch.getEndTime() == null ? System.currentTimeMillis() : patch.getEndTime().getMillis();
  return this;
}
Program: 117547
Project: 117547
Buggy source:
public Builder onPatch(final Patch patch){
  startTime=patch.getStartTime().getMillis();
  endTime=patch.getEndTime() == null ? null : patch.getEndTime().getMillis();
  return this;
}

Fixed version (ground truth):
public Builder onPatch(final Patch patch){
  startTime=patch.getStartTime().getMillis();
  endTime=patch.getEndTime() == null ? System.currentTimeMillis() : patch.getEndTime().getMillis();
  return this;
}
Program: 117548
Project: 117548
Buggy source:
@Override public void run(){
synchronized (resetterLock) {
    if (!cancelled) {
      permitter.drainPermits();
synchronized (currentlyProcessingLock) {
        permitter.release(permits - currentlyProcessing);
      }
      resetter=null;
      drainer=null;
      timer.purge();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
synchronized (resetterLock) {
    if (!cancelled) {
      permitter.drainPermits();
synchronized (currentlyProcessingLock) {
        permitter.release(permits - currentlyProcessing);
      }
      if (drainer != null) {
        drainer.cancel();
      }
      resetter=null;
      drainer=null;
      timer.purge();
    }
  }
}
Program: 117549
Project: 117549
Buggy source:
@Override protected void loadCoreData(final String group){
  ImmutableMap.Builder<String,Object> builder;
switch (group) {
case LIST_PROXY_LOAD_GROUP:
    builder=ImmutableMap.builder();
  if (coreData.getPlatform() != null) {
    builder.put("String_Node_Str",Platform.withTag(coreData.getPlatform()));
  }
if (coreData.getSummonerId() != 0L) {
  builder.put("String_Node_Str",coreData.getSummonerId());
}
coreData=Orianna.getSettings().getPipeline().get(com.merakianalytics.orianna.types.data.championmastery.ChampionMasteries.class,builder.build());
loadListProxyData(new Function<com.merakianalytics.orianna.types.data.championmastery.ChampionMastery,ChampionMastery>(){
@Override public ChampionMastery apply(final com.merakianalytics.orianna.types.data.championmastery.ChampionMastery data){
final ChampionMastery mastery=new ChampionMastery(data);
mastery.markAsGhostLoaded(ChampionMastery.CHAMPION_MASTERY_LOAD_GROUP);
return mastery;
}
}
);
break;
default :
break;
}
}

Fixed version (ground truth):
@Override protected void loadCoreData(final String group){
  ImmutableMap.Builder<String,Object> builder;
switch (group) {
case LIST_PROXY_LOAD_GROUP:
    builder=ImmutableMap.builder();
  if (coreData.getPlatform() != null) {
    builder.put("String_Node_Str",Platform.withTag(coreData.getPlatform()));
  }
if (coreData.getSummonerId() != 0L) {
  builder.put("String_Node_Str",coreData.getSummonerId());
}
final com.merakianalytics.orianna.types.data.championmastery.ChampionMasteries data=Orianna.getSettings().getPipeline().get(com.merakianalytics.orianna.types.data.championmastery.ChampionMasteries.class,builder.build());
if (data != null) {
coreData=data;
}
loadListProxyData(new Function<com.merakianalytics.orianna.types.data.championmastery.ChampionMastery,ChampionMastery>(){
@Override public ChampionMastery apply(final com.merakianalytics.orianna.types.data.championmastery.ChampionMastery data){
final ChampionMastery mastery=new ChampionMastery(data);
mastery.markAsGhostLoaded(ChampionMastery.CHAMPION_MASTERY_LOAD_GROUP);
return mastery;
}
}
);
break;
default :
break;
}
}
Program: 117550
Project: 117550
Buggy source:
public boolean isChestGranted(){
  load(CHAMPION_MASTERY_LOAD_GROUP);
  return coreData.isChestGranted();
}

Fixed version (ground truth):
public boolean isChestGranted(){
  if (coreData.isChestGranted()) {
    load(CHAMPION_MASTERY_LOAD_GROUP);
  }
  return coreData.isChestGranted();
}
Program: 117551
Project: 117551
Buggy source:
public int getTokens(){
  load(CHAMPION_MASTERY_LOAD_GROUP);
  return coreData.getTokens();
}

Fixed version (ground truth):
public int getTokens(){
  if (coreData.getTokens() == 0) {
    load(CHAMPION_MASTERY_LOAD_GROUP);
  }
  return coreData.getTokens();
}
Program: 117552
Project: 117552
Buggy source:
@Override protected void loadCoreData(final String group){
  ImmutableMap.Builder<String,Object> builder;
switch (group) {
case CHAMPION_MASTERY_LOAD_GROUP:
    builder=ImmutableMap.builder();
  if (coreData.getSummonerId() != 0L) {
    builder.put("String_Node_Str",coreData.getSummonerId());
  }
if (coreData.getChampionId() != 0) {
  builder.put("String_Node_Str",coreData.getChampionId());
}
if (coreData.getPlatform() != null) {
builder.put("String_Node_Str",Platform.withTag(coreData.getPlatform()));
}
coreData=Orianna.getSettings().getPipeline().get(com.merakianalytics.orianna.types.data.championmastery.ChampionMastery.class,builder.build());
break;
default :
break;
}
}

Fixed version (ground truth):
@Override protected void loadCoreData(final String group){
  ImmutableMap.Builder<String,Object> builder;
switch (group) {
case CHAMPION_MASTERY_LOAD_GROUP:
    builder=ImmutableMap.builder();
  if (coreData.getSummonerId() != 0L) {
    builder.put("String_Node_Str",coreData.getSummonerId());
  }
if (coreData.getChampionId() != 0) {
  builder.put("String_Node_Str",coreData.getChampionId());
}
if (coreData.getPlatform() != null) {
builder.put("String_Node_Str",Platform.withTag(coreData.getPlatform()));
}
final com.merakianalytics.orianna.types.data.championmastery.ChampionMastery data=Orianna.getSettings().getPipeline().get(com.merakianalytics.orianna.types.data.championmastery.ChampionMastery.class,builder.build());
if (data != null) {
coreData=data;
}
break;
default :
break;
}
}
Program: 117553
Project: 117553
Buggy source:
public int getPointsUntilNextLevel(){
  load(CHAMPION_MASTERY_LOAD_GROUP);
  return coreData.getPointsUntilNextLevel();
}

Fixed version (ground truth):
public int getPointsUntilNextLevel(){
  if (coreData.getPointsUntilNextLevel() == 0) {
    load(CHAMPION_MASTERY_LOAD_GROUP);
  }
  return coreData.getPointsUntilNextLevel();
}
Program: 117554
Project: 117554
Buggy source:
public int getLevel(){
  load(CHAMPION_MASTERY_LOAD_GROUP);
  return coreData.getLevel();
}

Fixed version (ground truth):
public int getLevel(){
  if (coreData.getLevel() == 0) {
    load(CHAMPION_MASTERY_LOAD_GROUP);
  }
  return coreData.getLevel();
}
Program: 117555
Project: 117555
Buggy source:
public int getPointsSinceLastLevel(){
  load(CHAMPION_MASTERY_LOAD_GROUP);
  return coreData.getPointsSinceLastLevel();
}

Fixed version (ground truth):
public int getPointsSinceLastLevel(){
  if (coreData.getPointsSinceLastLevel() == 0) {
    load(CHAMPION_MASTERY_LOAD_GROUP);
  }
  return coreData.getPointsSinceLastLevel();
}
Program: 117556
Project: 117556
Buggy source:
public DateTime getLastPlayed(){
  load(CHAMPION_MASTERY_LOAD_GROUP);
  return coreData.getLastPlayed();
}

Fixed version (ground truth):
public DateTime getLastPlayed(){
  if (coreData.getLastPlayed() == null) {
    load(CHAMPION_MASTERY_LOAD_GROUP);
  }
  return coreData.getLastPlayed();
}
Program: 117557
Project: 117557
Buggy source:
public int getPoints(){
  load(CHAMPION_MASTERY_LOAD_GROUP);
  return coreData.getPoints();
}

Fixed version (ground truth):
public int getPoints(){
  if (coreData.getPoints() == 0) {
    load(CHAMPION_MASTERY_LOAD_GROUP);
  }
  return coreData.getPoints();
}