nus-yam/ex-repair huggingface dataset:
Program: 10280
Project: 10280
Buggy source:
@WebMethod public String[] getFromSparql(int id,int componentID,String option) throws ClientNotKnownException {
  ClientState state=getState(id);
  Component component=state.getComponent(componentID);
  if (option.equals("String_Node_Str"))   return ((SparqlEndpoint)component).getSubjects();
 else   if (option.equals("String_Node_Str"))   return ((SparqlEndpoint)component).getTriples();
 else   if (option.equals("String_Node_Str"))   return ((SparqlEndpoint)component).getConceptSubjects();
  return new String[0];
}

Fixed version (ground truth):
@WebMethod public String[] getFromSparql(int id,int componentID,String option) throws ClientNotKnownException {
  ClientState state=getState(id);
  Component component=state.getComponent(componentID);
  if (option.equals("String_Node_Str"))   return ((SparqlKnowledgeSource)component).getSubjects();
 else   if (option.equals("String_Node_Str"))   return ((SparqlKnowledgeSource)component).getTriples();
 else   if (option.equals("String_Node_Str"))   return ((SparqlKnowledgeSource)component).getConceptSubjects();
  return new String[0];
}
Program: 10281
Project: 10281
Buggy source:
@Override public void run(){
  ((SparqlEndpoint)component).setConceptThread(this);
  ((SparqlEndpoint)component).setConceptThreadRunning(true);
  ((SparqlEndpoint)component).calculateConceptSubjects(concept);
  ((SparqlEndpoint)component).setConceptThreadRunning(false);
}

Fixed version (ground truth):
@Override public void run(){
  ((SparqlKnowledgeSource)component).setConceptThread(this);
  ((SparqlKnowledgeSource)component).setConceptThreadRunning(true);
  ((SparqlKnowledgeSource)component).calculateConceptSubjects(concept);
  ((SparqlKnowledgeSource)component).setConceptThreadRunning(false);
}
Program: 10282
Project: 10282
Buggy source:
public DLLearnerWS(){
  knowledgeSourceMapping.put("String_Node_Str",OWLFile.class);
  knowledgeSourceMapping.put("String_Node_Str",SparqlEndpoint.class);
  reasonerMapping.put("String_Node_Str",DIGReasoner.class);
  learningProblemMapping.put("String_Node_Str",PosNegDefinitionLP.class);
  learningProblemMapping.put("String_Node_Str",PosNegInclusionLP.class);
  learningProblemMapping.put("String_Node_Str",PosOnlyDefinitionLP.class);
  learningAlgorithmMapping.put("String_Node_Str",ROLearner.class);
  components=Helper.union(knowledgeSourceMapping.keySet(),reasonerMapping.keySet());
  components=Helper.union(components,learningProblemMapping.keySet());
  components=Helper.union(components,learningAlgorithmMapping.keySet());
}

Fixed version (ground truth):
public DLLearnerWS(){
  knowledgeSourceMapping.put("String_Node_Str",OWLFile.class);
  knowledgeSourceMapping.put("String_Node_Str",SparqlKnowledgeSource.class);
  reasonerMapping.put("String_Node_Str",DIGReasoner.class);
  learningProblemMapping.put("String_Node_Str",PosNegDefinitionLP.class);
  learningProblemMapping.put("String_Node_Str",PosNegInclusionLP.class);
  learningProblemMapping.put("String_Node_Str",PosOnlyDefinitionLP.class);
  learningAlgorithmMapping.put("String_Node_Str",ROLearner.class);
  components=Helper.union(knowledgeSourceMapping.keySet(),reasonerMapping.keySet());
  components=Helper.union(components,learningProblemMapping.keySet());
  components=Helper.union(components,learningAlgorithmMapping.keySet());
}
Program: 10283
Project: 10283
Buggy source:
@WebMethod public void stopSparqlThread(int id,int componentID,String option) throws ClientNotKnownException {
  ClientState state=getState(id);
  Component component=state.getComponent(componentID);
  if (option.equals("String_Node_Str"))   ((SparqlEndpoint)component).getSubjectThread().stop();
 else   if (option.equals("String_Node_Str"))   ((SparqlEndpoint)component).getTriplesThread().stop();
 else   if (option.equals("String_Node_Str"))   ((SparqlEndpoint)component).getConceptThread().stop();
}

Fixed version (ground truth):
@WebMethod public void stopSparqlThread(int id,int componentID,String option) throws ClientNotKnownException {
  ClientState state=getState(id);
  Component component=state.getComponent(componentID);
  if (option.equals("String_Node_Str"))   ((SparqlKnowledgeSource)component).getSubjectThread().stop();
 else   if (option.equals("String_Node_Str"))   ((SparqlKnowledgeSource)component).getTriplesThread().stop();
 else   if (option.equals("String_Node_Str"))   ((SparqlKnowledgeSource)component).getConceptThread().stop();
}
Program: 10285
Project: 10285
Buggy source:
@WebMethod public boolean isThreadRunning(int id,int componentID,String option) throws ClientNotKnownException {
  ClientState state=getState(id);
  Component component=state.getComponent(componentID);
  if (option.equals("String_Node_Str"))   return ((SparqlEndpoint)component).subjectThreadIsRunning();
 else   if (option.equals("String_Node_Str"))   return ((SparqlEndpoint)component).triplesThreadIsRunning();
 else   if (option.equals("String_Node_Str"))   return ((SparqlEndpoint)component).conceptThreadIsRunning();
  return true;
}

Fixed version (ground truth):
@WebMethod public boolean isThreadRunning(int id,int componentID,String option) throws ClientNotKnownException {
  ClientState state=getState(id);
  Component component=state.getComponent(componentID);
  if (option.equals("String_Node_Str"))   return ((SparqlKnowledgeSource)component).subjectThreadIsRunning();
 else   if (option.equals("String_Node_Str"))   return ((SparqlKnowledgeSource)component).triplesThreadIsRunning();
 else   if (option.equals("String_Node_Str"))   return ((SparqlKnowledgeSource)component).conceptThreadIsRunning();
  return true;
}
Program: 10287
Project: 10287
Buggy source:
private static Map<Class<? extends Component>,String> createComponentPrefixMapping(){
  Map<Class<? extends Component>,String> componentPrefixMapping=new HashMap<Class<? extends Component>,String>();
  componentPrefixMapping.put(SparqlEndpoint.class,"String_Node_Str");
  componentPrefixMapping.put(DIGReasoner.class,"String_Node_Str");
  componentPrefixMapping.put(OWLAPIReasoner.class,"String_Node_Str");
  componentPrefixMapping.put(PosNegDefinitionLP.class,"String_Node_Str");
  componentPrefixMapping.put(ROLearner.class,"String_Node_Str");
  componentPrefixMapping.put(GP.class,"String_Node_Str");
  return componentPrefixMapping;
}

Fixed version (ground truth):
private static Map<Class<? extends Component>,String> createComponentPrefixMapping(){
  Map<Class<? extends Component>,String> componentPrefixMapping=new HashMap<Class<? extends Component>,String>();
  componentPrefixMapping.put(SparqlKnowledgeSource.class,"String_Node_Str");
  componentPrefixMapping.put(DIGReasoner.class,"String_Node_Str");
  componentPrefixMapping.put(OWLAPIReasoner.class,"String_Node_Str");
  componentPrefixMapping.put(PosNegDefinitionLP.class,"String_Node_Str");
  componentPrefixMapping.put(ROLearner.class,"String_Node_Str");
  componentPrefixMapping.put(GP.class,"String_Node_Str");
  return componentPrefixMapping;
}
Program: 10288
Project: 10288
Buggy source:
ReasonerPanel(Config config){
  super(new BorderLayout());
  this.config=config;
  digButton=new JButton("String_Node_Str");
  digButton.addActionListener(this);
  digList=new JList();
  digList.setLayoutOrientation(JList.VERTICAL);
  digList.setVisibleRowCount(-1);
  JScrollPane listScroller=new JScrollPane(digList);
  listScroller.setPreferredSize(new Dimension(550,350));
  digPanel.add(digButton);
  add(digPanel,BorderLayout.PAGE_START);
  centerPanel.add(listScroller);
  add(centerPanel,BorderLayout.CENTER);
  digList.addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent evt){
      if (evt.getValueIsAdjusting())       return;
      Set<String> exampleSet=new HashSet<String>();
      int[] selectedIndices=digList.getSelectedIndices();
      for (      int i : selectedIndices)       exampleSet.add(individuals.get(i).toString());
    }
  }
);
}

Fixed version (ground truth):
ReasonerPanel(final Config config){
  super(new BorderLayout());
  this.config=config;
  digButton=new JButton("String_Node_Str");
  digButton.addActionListener(this);
  digList=new JList();
  digList.setLayoutOrientation(JList.VERTICAL);
  digList.setVisibleRowCount(-1);
  JScrollPane listScroller=new JScrollPane(digList);
  listScroller.setPreferredSize(new Dimension(550,350));
  digPanel.add(digButton);
  add(digPanel,BorderLayout.PAGE_START);
  centerPanel.add(listScroller);
  add(centerPanel,BorderLayout.CENTER);
  digList.addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent evt){
      if (evt.getValueIsAdjusting())       return;
      Set<String> exampleSet=new HashSet<String>();
      int[] selectedIndices=digList.getSelectedIndices();
      for (      int i : selectedIndices)       exampleSet.add(individuals.get(i).toString());
      config.setExampleSet(exampleSet);
      System.out.println("String_Node_Str" + config.getExampleSet());
    }
  }
);
}
Program: 10289
Project: 10289
Buggy source:
public int compareTo(Node n){
  return super.compareTo(n);
}

Fixed version (ground truth):
@Override public int compareTo(Node n){
  return super.compareTo(n);
}
Program: 10290
Project: 10290
Buggy source:
@Override public void export(File file,org.dllearner.core.OntologyFormat format){
  Reasoner kaon2Reasoner=KAON2Reasoner.getKAON2Reasoner(kb);
  OntologyFileFormat kaon2Format=null;
  if (format.equals(org.dllearner.core.OntologyFormat.RDF_XML))   kaon2Format=OntologyFileFormat.OWL_RDF;
 else {
    System.err.println("String_Node_Str" + format + "String_Node_Str");
    System.exit(0);
  }
  try {
    kaon2Reasoner.getOntology().saveOntology(kaon2Format,file,"String_Node_Str");
  }
 catch (  KAON2Exception e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void export(File file,org.dllearner.core.OntologyFormat format){
  Reasoner kaon2Reasoner=KAON2Reasoner.getKAON2Reasoner(kb);
  String kaon2Format=null;
  if (format.equals(org.dllearner.core.OntologyFormat.RDF_XML))   kaon2Format=OntologyFileFormat.OWL_RDF;
 else {
    System.err.println("String_Node_Str" + format + "String_Node_Str");
    System.exit(0);
  }
  try {
    kaon2Reasoner.getOntology().saveOntology(kaon2Format,file,"String_Node_Str");
  }
 catch (  KAON2Exception e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 10291
Project: 10291
Buggy source:
public void saveOntology(File file,org.dllearner.core.OntologyFormat format){
  OntologyFileFormat kaon2Format=null;
  if (format.equals(org.dllearner.core.OntologyFormat.RDF_XML))   kaon2Format=OntologyFileFormat.OWL_RDF;
 else {
    System.err.println("String_Node_Str" + format + "String_Node_Str");
    System.exit(0);
  }
  try {
    kaon2Reasoner.getOntology().saveOntology(kaon2Format,file,"String_Node_Str");
  }
 catch (  KAON2Exception e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void saveOntology(File file,org.dllearner.core.OntologyFormat format){
  String kaon2Format=null;
  if (format.equals(org.dllearner.core.OntologyFormat.RDF_XML))   kaon2Format=OntologyFileFormat.OWL_RDF;
 else {
    System.err.println("String_Node_Str" + format + "String_Node_Str");
    System.exit(0);
  }
  try {
    kaon2Reasoner.getOntology().saveOntology(kaon2Format,file,"String_Node_Str");
  }
 catch (  KAON2Exception e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 10293
Project: 10293
Buggy source:
public void actionPerformed(ActionEvent e){
  if (e.getSource() == openButton) {
    int returnVal=fc.showOpenDialog(KnowledgeSourcePanel.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      StartGUI.myconfig.setFile(fc.getSelectedFile());
      fileDisplay.setText(StartGUI.myconfig.getFile().toString());
      System.out.println("String_Node_Str");
      StartGUI.myconfig.getComponentManager().applyConfigEntry(StartGUI.myconfig.getKnowledgeSource(),"String_Node_Str",StartGUI.myconfig.getFile().toURI().toString());
      StartGUI.myconfig.getKnowledgeSource().init();
    }
  }
  if (cb.getSelectedItem().toString() == kbBoxItems[0]) {
    System.out.println("String_Node_Str" + cb.getSelectedItem());
    makeCenterClean();
  }
  if (cb.getSelectedItem().toString() == kbBoxItems[1]) {
    System.out.println("String_Node_Str" + cb.getSelectedItem());
    makeCenterClean();
  }
  if (cb.getSelectedItem().toString() == kbBoxItems[2]) {
    System.out.println("String_Node_Str" + cb.getSelectedItem());
    makeCenterClean();
    openPanel.add(fileDisplay);
    openPanel.add(openButton);
    openPanel.repaint();
    StartGUI.myconfig.setKnowledgeSource(StartGUI.myconfig.getComponentManager().knowledgeSource(OWLFile.class));
  }
  if (cb.getSelectedItem().toString() == kbBoxItems[3]) {
    System.out.println("String_Node_Str" + cb.getSelectedItem());
    makeCenterClean();
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (e.getSource() == openButton) {
    int returnVal=fc.showOpenDialog(KnowledgeSourcePanel.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      StartGUI.myconfig.setFile(fc.getSelectedFile());
      fileDisplay.setText(StartGUI.myconfig.getFile().toString());
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str" + StartGUI.myconfig.getFile().toURI().toString());
      StartGUI.myconfig.getComponentManager().applyConfigEntry(StartGUI.myconfig.getKnowledgeSource(),"String_Node_Str",StartGUI.myconfig.getFile().toURI().toString());
      StartGUI.myconfig.getKnowledgeSource().init();
    }
    return;
  }
  if (cb.getSelectedItem().toString() == kbBoxItems[0]) {
    System.out.println("String_Node_Str" + cb.getSelectedItem());
    makeCenterClean();
  }
  if (cb.getSelectedItem().toString() == kbBoxItems[1]) {
    System.out.println("String_Node_Str" + cb.getSelectedItem());
    makeCenterClean();
  }
  if (cb.getSelectedItem().toString() == kbBoxItems[2]) {
    System.out.println("String_Node_Str" + cb.getSelectedItem());
    makeCenterClean();
    openPanel.add(fileDisplay);
    openPanel.add(openButton);
    openPanel.repaint();
    StartGUI.myconfig.setKnowledgeSource(StartGUI.myconfig.getComponentManager().knowledgeSource(OWLFile.class));
  }
  if (cb.getSelectedItem().toString() == kbBoxItems[3]) {
    System.out.println("String_Node_Str" + cb.getSelectedItem());
    makeCenterClean();
  }
}
Program: 10294
Project: 10294
Buggy source:
public void actionPerformed(ActionEvent e){
  if (e.getSource() == digButton) {
    StartGUI.myconfig.setReasoner(StartGUI.myconfig.getComponentManager().reasoner(DIGReasoner.class,StartGUI.myconfig.getKnowledgeSource()));
    StartGUI.myconfig.getReasoner().init();
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (e.getSource() == digButton) {
    StartGUI.myconfig.setReasoner(StartGUI.myconfig.getComponentManager().reasoner(DIGReasoner.class,StartGUI.myconfig.getKnowledgeSource()));
    System.out.println(StartGUI.myconfig.getKnowledgeSource());
    StartGUI.myconfig.getReasoner().init();
    System.out.println("String_Node_Str");
  }
}
Program: 10295
Project: 10295
Buggy source:
public Node expandNode(URI u,TypedSparqlQuery tsp){
  Node n=getFirstNode(u);
  Vector<Node> v=new Vector<Node>();
  v.add(n);
  System.out.println("String_Node_Str" + v);
  for (int x=1; x <= this.recursionDepth; x++) {
    Vector<Node> tmp=new Vector<Node>();
    while (v.size() > 0) {
      Node tmpNode=v.remove(0);
      System.out.println("String_Node_Str" + tmpNode);
      Vector<Node> tmpVec=tmpNode.expand(tsp,this.manipulator);
      tmp.addAll(tmpVec);
    }
    v=tmp;
    System.out.println("String_Node_Str" + x + "String_Node_Str"+ v);
  }
  if (this.getAllBackground) {
    Vector<Node> classes=new Vector<Node>();
    for (    Node one : v) {
      if (one.isClass()) {
        classes.add(one);
      }
    }
    while (classes.size() > 0) {
      System.out.println(classes.size());
      Node next=classes.remove(0);
      System.out.println(next);
      classes.addAll(next.expand(tsp,this.manipulator));
    }
  }
  return n;
}

Fixed version (ground truth):
public Node expandNode(URI u,TypedSparqlQuery tsp){
  Node n=getFirstNode(u);
  Vector<Node> v=new Vector<Node>();
  v.add(n);
  System.out.println("String_Node_Str" + v);
  for (int x=1; x <= recursionDepth; x++) {
    Vector<Node> tmp=new Vector<Node>();
    while (v.size() > 0) {
      Node tmpNode=v.remove(0);
      System.out.println("String_Node_Str" + tmpNode);
      Vector<Node> tmpVec=tmpNode.expand(tsp,manipulator);
      tmp.addAll(tmpVec);
    }
    v=tmp;
    System.out.println("String_Node_Str" + x + "String_Node_Str"+ v);
  }
  if (this.getAllBackground) {
    Vector<Node> classes=new Vector<Node>();
    for (    Node one : v) {
      if (one.isClass()) {
        classes.add(one);
      }
    }
    while (classes.size() > 0) {
      System.out.println(classes.size());
      Node next=classes.remove(0);
      System.out.println(next);
      classes.addAll(next.expand(tsp,manipulator));
    }
  }
  return n;
}
Program: 10296
Project: 10296
Buggy source:
@Override public Vector<Node> expand(TypedSparqlQuery tsq,Manipulator m){
  Set<Tupel> s=tsq.query(this.uri);
  m.check(s,this);
  Vector<Node> Nodes=new Vector<Node>();
  Iterator<Tupel> it=s.iterator();
  while (it.hasNext()) {
    Tupel t=(Tupel)it.next();
    try {
      if (t.a.equals(m.type)) {
        ClassNode tmp=new ClassNode(new URI(t.b));
        classes.add(tmp);
        Nodes.add(tmp);
      }
 else {
        InstanceNode tmp=new InstanceNode(new URI(t.b));
        properties.add(new PropertyNode(new URI(t.a),this,tmp));
        Nodes.add(tmp);
      }
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + t);
      e.printStackTrace();
    }
  }
  this.expanded=true;
  return Nodes;
}

Fixed version (ground truth):
@Override public Vector<Node> expand(TypedSparqlQuery tsq,Manipulator m){
  Set<Tupel> s=tsq.query(uri);
  m.check(s,this);
  Vector<Node> Nodes=new Vector<Node>();
  Iterator<Tupel> it=s.iterator();
  while (it.hasNext()) {
    Tupel t=(Tupel)it.next();
    try {
      if (t.a.equals(m.type)) {
        ClassNode tmp=new ClassNode(new URI(t.b));
        classes.add(tmp);
        Nodes.add(tmp);
      }
 else {
        InstanceNode tmp=new InstanceNode(new URI(t.b));
        properties.add(new PropertyNode(new URI(t.a),this,tmp));
        Nodes.add(tmp);
      }
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + t);
      e.printStackTrace();
    }
  }
  expanded=true;
  return Nodes;
}
Program: 10297
Project: 10297
Buggy source:
@Override public Set<String> toNTriple(){
  Set<String> s=new HashSet<String>();
  s.add("String_Node_Str" + this.uri + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  for (  ClassNode one : classes) {
    s.add("String_Node_Str" + this.uri + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ one.getURI()+ "String_Node_Str");
    s.addAll(one.toNTriple());
  }
  for (  PropertyNode one : properties) {
    s.add("String_Node_Str" + this.uri + "String_Node_Str"+ one.getURI()+ "String_Node_Str"+ one.getB().getURI()+ "String_Node_Str");
    s.addAll(one.toNTriple());
    s.addAll(one.getB().toNTriple());
  }
  return s;
}

Fixed version (ground truth):
@Override public Set<String> toNTriple(){
  Set<String> s=new HashSet<String>();
  s.add("String_Node_Str" + uri + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  for (  ClassNode one : classes) {
    s.add("String_Node_Str" + uri + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ one.getURI()+ "String_Node_Str");
    s.addAll(one.toNTriple());
  }
  for (  PropertyNode one : properties) {
    s.add("String_Node_Str" + uri + "String_Node_Str"+ one.getURI()+ "String_Node_Str"+ one.getB().getURI()+ "String_Node_Str");
    s.addAll(one.toNTriple());
    s.addAll(one.getB().toNTriple());
  }
  return s;
}
Program: 10298
Project: 10298
Buggy source:
public String extract(Set<String> instances){
  System.out.println("String_Node_Str");
  Set<String> ret=new HashSet<String>();
  for (  String one : instances) {
    try {
      Node n=this.extractionAlgorithm.expandNode(new URI(one),this.typedSparqlQuery);
      ret.addAll(n.toNTriple());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  String nt="String_Node_Str";
  for (  String str : ret) {
    nt+=str + "String_Node_Str";
  }
  return nt;
}

Fixed version (ground truth):
public String extract(Set<String> instances){
  System.out.println("String_Node_Str");
  Set<String> ret=new HashSet<String>();
  for (  String one : instances) {
    try {
      Node n=extractionAlgorithm.expandNode(new URI(one),typedSparqlQuery);
      ret.addAll(n.toNTriple());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  String nt="String_Node_Str";
  for (  String str : ret) {
    nt+=str + "String_Node_Str";
  }
  return nt;
}
Program: 10299
Project: 10299
Buggy source:
public Set<Tupel> check(Set<Tupel> s,Node node){
  Set<Tupel> toRemove=new HashSet<Tupel>();
  Iterator<Tupel> it=s.iterator();
  while (it.hasNext()) {
    Tupel t=(Tupel)it.next();
    if (t.a.equals(this.type) && t.b.equals(this.classns) && node.isClass()) {
      toRemove.add(t);
    }
    ;
    if (t.b.equals(this.classns) && node.isClass()) {
      toRemove.add(t);
    }
    ;
    if (t.a.equals(this.type) && t.b.equals(this.thing) && node.isInstance()) {
      toRemove.add(t);
    }
    ;
  }
  s.removeAll(toRemove);
  return s;
}

Fixed version (ground truth):
public Set<Tupel> check(Set<Tupel> s,Node node){
  Set<Tupel> toRemove=new HashSet<Tupel>();
  Iterator<Tupel> it=s.iterator();
  while (it.hasNext()) {
    Tupel t=(Tupel)it.next();
    if (t.a.equals(type) && t.b.equals(classns) && node.isClass()) {
      toRemove.add(t);
    }
    if (t.b.equals(classns) && node.isClass()) {
      toRemove.add(t);
    }
    if (t.a.equals(type) && t.b.equals(thing) && node.isInstance()) {
      toRemove.add(t);
    }
  }
  s.removeAll(toRemove);
  return s;
}
Program: 10300
Project: 10300
Buggy source:
@Override public Vector<Node> expand(TypedSparqlQuery tsq,Manipulator m){
  Set<Tupel> s=tsq.query(this.uri);
  Vector<Node> Nodes=new Vector<Node>();
  Iterator<Tupel> it=s.iterator();
  while (it.hasNext()) {
    Tupel t=(Tupel)it.next();
    try {
      if (t.a.equals(m.type)) {
        specialTypes.add(t.b);
      }
    }
 catch (    Exception e) {
      System.out.println(t);
      e.printStackTrace();
    }
  }
  return Nodes;
}

Fixed version (ground truth):
@Override public Vector<Node> expand(TypedSparqlQuery tsq,Manipulator m){
  Set<Tupel> s=tsq.query(uri);
  Vector<Node> Nodes=new Vector<Node>();
  Iterator<Tupel> it=s.iterator();
  while (it.hasNext()) {
    Tupel t=(Tupel)it.next();
    try {
      if (t.a.equals(m.type)) {
        specialTypes.add(t.b);
      }
    }
 catch (    Exception e) {
      System.out.println(t);
      e.printStackTrace();
    }
  }
  return Nodes;
}
Program: 10301
Project: 10301
Buggy source:
@Override public Set<String> toNTriple(){
  Set<String> s=new HashSet<String>();
  s.add("String_Node_Str" + this.uri + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  for (  String one : specialTypes) {
    s.add("String_Node_Str" + this.uri + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ one+ "String_Node_Str");
  }
  return s;
}

Fixed version (ground truth):
@Override public Set<String> toNTriple(){
  Set<String> s=new HashSet<String>();
  s.add("String_Node_Str" + uri + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  for (  String one : specialTypes) {
    s.add("String_Node_Str" + uri + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ one+ "String_Node_Str");
  }
  return s;
}
Program: 10302
Project: 10302
Buggy source:
public Node getB(){
  return this.b;
}

Fixed version (ground truth):
public Node getB(){
  return b;
}
Program: 10303
Project: 10303
Buggy source:
public String makeQueryUsingFilters(String subject){
  String lineend="String_Node_Str";
  String Filter="String_Node_Str";
  if (!this.sparqlQueryType.isLiterals())   Filter+="String_Node_Str";
  for (  String p : this.sparqlQueryType.getPredicatefilterlist()) {
    Filter+=lineend + filterPredicate(p);
  }
  for (  String o : this.sparqlQueryType.getObjectfilterlist()) {
    Filter+=lineend + filterObject(o);
  }
  String ret="String_Node_Str" + lineend + "String_Node_Str"+ subject+ "String_Node_Str"+ lineend+ "String_Node_Str"+ lineend+ "String_Node_Str"+ Filter+ "String_Node_Str";
  return ret;
}

Fixed version (ground truth):
public String makeQueryUsingFilters(String subject){
  String lineend="String_Node_Str";
  String Filter="String_Node_Str";
  if (!this.sparqlQueryType.isLiterals())   Filter+="String_Node_Str";
  for (  String p : sparqlQueryType.getPredicatefilterlist()) {
    Filter+=lineend + filterPredicate(p);
  }
  for (  String o : sparqlQueryType.getObjectfilterlist()) {
    Filter+=lineend + filterObject(o);
  }
  String ret="String_Node_Str" + lineend + "String_Node_Str"+ subject+ "String_Node_Str"+ lineend+ "String_Node_Str"+ lineend+ "String_Node_Str"+ Filter+ "String_Node_Str";
  return ret;
}
Program: 10304
Project: 10304
Buggy source:
public boolean equals(Tupel t){
  if (this.a.equals(t.a) && this.b.equals(t.b))   return true;
 else   return false;
}

Fixed version (ground truth):
public boolean equals(Tupel t){
  if (a.equals(t.a) && b.equals(t.b))   return true;
 else   return false;
}
Program: 10306
Project: 10306
Buggy source:
public TypedSparqlQuery(Configuration Configuration){
  this.configuration=Configuration;
  this.sparqlQueryMaker=new SparqlQueryMaker(Configuration.getSparqlQueryType());
  this.Cache=new Cache("String_Node_Str");
}

Fixed version (ground truth):
public TypedSparqlQuery(Configuration Configuration){
  this.configuration=Configuration;
  this.sparqlQueryMaker=new SparqlQueryMaker(Configuration.getSparqlQueryType());
  this.cache=new Cache("String_Node_Str");
}
Program: 10307
Project: 10307
Buggy source:
public Set<Tupel> query(URI u){
  String sparql=sparqlQueryMaker.makeQueryUsingFilters(u.toString());
  String FromCache=this.Cache.get(u.toString(),sparql);
  String xml=null;
  if (FromCache == null) {
    try {
      xml=sendAndReceiveSPARQL(sparql);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
    this.Cache.put(u.toString(),xml,sparql);
    System.out.print("String_Node_Str");
  }
 else {
    xml=FromCache;
    System.out.println("String_Node_Str");
  }
  Set<Tupel> s=this.processResult(xml);
  try {
    System.out.println("String_Node_Str" + s.size() + "String_Node_Str");
  }
 catch (  Exception e) {
  }
  return s;
}

Fixed version (ground truth):
public Set<Tupel> query(URI u){
  String sparql=sparqlQueryMaker.makeQueryUsingFilters(u.toString());
  String FromCache=cache.get(u.toString(),sparql);
  String xml=null;
  if (FromCache == null) {
    try {
      xml=sendAndReceiveSPARQL(sparql);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
    cache.put(u.toString(),xml,sparql);
    System.out.print("String_Node_Str");
  }
 else {
    xml=FromCache;
    System.out.println("String_Node_Str");
  }
  Set<Tupel> s=processResult(xml);
  try {
    System.out.println("String_Node_Str" + s.size() + "String_Node_Str");
  }
 catch (  Exception e) {
  }
  return s;
}
Program: 10308
Project: 10308
Buggy source:
@Override public void init(){
  if (searchTreeFile == null)   searchTreeFile=new File(defaultSearchTreeFile);
  if (heuristic == Heuristic.LEXICOGRAPHIC)   nodeComparator=new NodeComparator();
 else {
    if (posOnly) {
      throw new RuntimeException("String_Node_Str");
    }
    nodeComparator=new NodeComparator2(learningProblem.getNegativeExamples().size(),learningProblem.getPercentPerLengthUnit());
  }
  operator=new RhoDown(rs);
  candidates=new TreeSet<Node>(nodeComparator);
  if (allowedConcepts != null) {
    Helper.checkConcepts(rs,allowedConcepts);
    usedConcepts=allowedConcepts;
  }
 else   if (ignoredConcepts != null) {
    usedConcepts=Helper.computeConceptsUsingIgnoreList(rs,ignoredConcepts);
  }
 else {
    usedConcepts=Helper.computeConcepts(rs);
  }
  if (allowedRoles != null) {
    Helper.checkRoles(rs,allowedRoles);
    usedRoles=allowedRoles;
  }
 else   if (ignoredRoles != null) {
    Helper.checkRoles(rs,ignoredRoles);
    usedRoles=Helper.difference(rs.getAtomicRoles(),ignoredRoles);
  }
  rs.prepareSubsumptionHierarchy(usedConcepts);
  rs.getSubsumptionHierarchy().improveSubsumptionHierarchy();
  rs.prepareRoleHierarchy(usedRoles);
}

Fixed version (ground truth):
@Override public void init(){
  if (searchTreeFile == null)   searchTreeFile=new File(defaultSearchTreeFile);
  if (heuristic == Heuristic.LEXICOGRAPHIC)   nodeComparator=new NodeComparator();
 else {
    if (posOnly) {
      throw new RuntimeException("String_Node_Str");
    }
    nodeComparator=new NodeComparator2(learningProblem.getNegativeExamples().size(),learningProblem.getPercentPerLengthUnit());
  }
  operator=new RhoDown(rs);
  candidates=new TreeSet<Node>(nodeComparator);
  if (allowedConcepts != null) {
    Helper.checkConcepts(rs,allowedConcepts);
    usedConcepts=allowedConcepts;
  }
 else   if (ignoredConcepts != null) {
    usedConcepts=Helper.computeConceptsUsingIgnoreList(rs,ignoredConcepts);
  }
 else {
    usedConcepts=Helper.computeConcepts(rs);
  }
  if (allowedRoles != null) {
    Helper.checkRoles(rs,allowedRoles);
    usedRoles=allowedRoles;
  }
 else   if (ignoredRoles != null) {
    Helper.checkRoles(rs,ignoredRoles);
    usedRoles=Helper.difference(rs.getAtomicRoles(),ignoredRoles);
  }
 else {
    usedRoles=rs.getAtomicRoles();
  }
  rs.prepareSubsumptionHierarchy(usedConcepts);
  rs.getSubsumptionHierarchy().improveSubsumptionHierarchy();
  rs.prepareRoleHierarchy(usedRoles);
}
Program: 10312
Project: 10312
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  if (!Common.PACKAGE_DIR.exists()) {
    Common.PACKAGE_DIR.mkdir();
  }
  ctx=context;
  resources=ctx.getResources();
  String action=intent.getAction();
  Bundle extras=intent.getExtras();
  boolean hasExtras=extras != null;
  if (Common.ACTION_BACKUP_APK_FILE.equals(action)) {
    if (hasExtras) {
      String apkFile=extras.getString(Common.FILE);
      backupApkFile(apkFile);
    }
  }
 else   if (Common.ACTION_DELETE_APK_FILE.equals(action)) {
    if (hasExtras) {
      String apkFile=extras.getString(Common.FILE);
      deleteApkFile(apkFile);
    }
  }
 else   if (Common.ACTION_UNINSTALL_SYSTEM_APP.equals(action)) {
    if (hasExtras) {
      String packageName=extras.getString(Common.PACKAGE);
      uninstallSystemApp(packageName);
    }
  }
 else   if (Common.ACTION_BACKUP_PREFERENCES.equals(action)) {
    backupPreferences();
  }
 else   if (Common.ACTION_RESTORE_PREFERENCES.equals(action)) {
    restorePreferences();
  }
 else   if (Common.ACTION_RESET_PREFERENCES.equals(action)) {
    resetPreferences();
  }
 else   if (Common.ACTION_CONFIRM_CHECK_SIGNATURE.equals(action)) {
    confirmCheckSignatures();
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  if (!PACKAGE_DIR.exists()) {
    PACKAGE_DIR.mkdir();
  }
  ctx=context;
  resources=ctx.getResources();
  String action=intent.getAction();
  Bundle extras=intent.getExtras();
  boolean hasExtras=extras != null;
  if (Common.ACTION_BACKUP_APK_FILE.equals(action)) {
    if (hasExtras) {
      String apkFile=extras.getString(Common.FILE);
      backupApkFile(apkFile);
    }
  }
 else   if (Common.ACTION_DELETE_APK_FILE.equals(action)) {
    if (hasExtras) {
      String apkFile=extras.getString(Common.FILE);
      deleteApkFile(apkFile);
    }
  }
 else   if (Common.ACTION_UNINSTALL_SYSTEM_APP.equals(action)) {
    if (hasExtras) {
      String packageName=extras.getString(Common.PACKAGE);
      uninstallSystemApp(packageName);
    }
  }
 else   if (Common.ACTION_BACKUP_PREFERENCES.equals(action)) {
    backupPreferences();
  }
 else   if (Common.ACTION_RESTORE_PREFERENCES.equals(action)) {
    restorePreferences();
  }
 else   if (Common.ACTION_RESET_PREFERENCES.equals(action)) {
    resetPreferences();
  }
 else   if (Common.ACTION_CONFIRM_CHECK_SIGNATURE.equals(action)) {
    confirmCheckSignatures();
  }
}
Program: 10313
Project: 10313
Buggy source:
public void backupPreferences(){
  if (!Common.PREFERENCES_BACKUP_FILE.exists()) {
    try {
      Common.PREFERENCES_BACKUP_FILE.createNewFile();
    }
 catch (    Exception e) {
    }
  }
  ObjectOutputStream output=null;
  try {
    output=new ObjectOutputStream(new FileOutputStream(Common.PREFERENCES_BACKUP_FILE));
    SharedPreferences prefs=ctx.getSharedPreferences(Common.PACKAGE_PREFERENCES,Context.MODE_WORLD_READABLE);
    output.writeObject(prefs.getAll());
  }
 catch (  Exception e) {
  }
 finally {
    try {
      if (output != null) {
        output.flush();
        output.close();
      }
    }
 catch (    Exception e) {
    }
  }
  Toast.makeText(ctx,resources.getString(R.string.preferences_backed_up),Toast.LENGTH_LONG).show();
}

Fixed version (ground truth):
public void backupPreferences(){
  if (!PREFERENCES_BACKUP_FILE.exists()) {
    try {
      PREFERENCES_BACKUP_FILE.createNewFile();
    }
 catch (    Exception e) {
    }
  }
  ObjectOutputStream output=null;
  try {
    output=new ObjectOutputStream(new FileOutputStream(PREFERENCES_BACKUP_FILE));
    SharedPreferences prefs=ctx.getSharedPreferences(Common.PACKAGE_PREFERENCES,Context.MODE_WORLD_READABLE);
    output.writeObject(prefs.getAll());
  }
 catch (  Exception e) {
  }
 finally {
    try {
      if (output != null) {
        output.flush();
        output.close();
      }
    }
 catch (    Exception e) {
    }
  }
  Toast.makeText(ctx,resources.getString(R.string.preferences_backed_up),Toast.LENGTH_LONG).show();
}
Program: 10316
Project: 10316
Buggy source:
/** 
 * Increment yaw to the yaw for the next tick.
 */
@Override public void updateScreen(){
  if (mc.world != null) {
    this.cam.prevRotationPitch=this.cam.rotationPitch=0.0F;
    this.cam.prevRotationYaw=this.yaw;
    this.cam.lastTickPosY=this.cam.prevPosY=this.cam.posY;
    this.cam.lastTickPosX=this.cam.prevPosX=this.cam.posX;
    this.cam.lastTickPosZ=this.cam.prevPosZ=this.cam.posZ;
    this.yaw=(this.yaw + ROTATION_SPEED * (float)(1 + ROTATION_VARIANCE * Math.cos((this.yaw + 45) / 45.0 * Math.PI)));
    this.cam.rotationYaw=this.yaw;
    double x=Math.cos(yaw / 180.0D * Math.PI);
    double z=Math.sin((yaw - 90) / 180.0D * Math.PI);
    double distance=truncateDistanceIfBlockInWay(x,z,.5);
    this.cam.posY=WDL.thePlayer.posY;
    this.cam.posX=WDL.thePlayer.posX - distance * x;
    this.cam.posZ=WDL.thePlayer.posZ + distance * z;
  }
  super.updateScreen();
}

Fixed version (ground truth):
/** 
 * Increment yaw to the yaw for the next tick.
 */
@Override public void updateScreen(){
  if (mc.world != null && this.initializedCamera) {
    this.cam.prevRotationPitch=this.cam.rotationPitch=0.0F;
    this.cam.prevRotationYaw=this.yaw;
    this.cam.lastTickPosY=this.cam.prevPosY=this.cam.posY;
    this.cam.lastTickPosX=this.cam.prevPosX=this.cam.posX;
    this.cam.lastTickPosZ=this.cam.prevPosZ=this.cam.posZ;
    this.yaw=(this.yaw + ROTATION_SPEED * (float)(1 + ROTATION_VARIANCE * Math.cos((this.yaw + 45) / 45.0 * Math.PI)));
    this.cam.rotationYaw=this.yaw;
    double x=Math.cos(yaw / 180.0D * Math.PI);
    double z=Math.sin((yaw - 90) / 180.0D * Math.PI);
    double distance=truncateDistanceIfBlockInWay(x,z,.5);
    this.cam.posY=WDL.thePlayer.posY;
    this.cam.posX=WDL.thePlayer.posX - distance * x;
    this.cam.posZ=WDL.thePlayer.posZ + distance * z;
  }
  this.deactivateRenderViewEntity();
  super.updateScreen();
}
Program: 10317
Project: 10317
Buggy source:
/** 
 * Adds the buttons (and other controls) to the screen in question.
 */
@Override public void initGui(){
  if (!initializedCamera) {
    this.cam=LocalUtils.makePlayer();
    this.cam.setLocationAndAngles(WDL.thePlayer.posX,WDL.thePlayer.posY,WDL.thePlayer.posZ,WDL.thePlayer.rotationYaw,0.0F);
    this.yaw=WDL.thePlayer.rotationYaw;
    this.oldCameraMode=WDL.minecraft.gameSettings.thirdPersonView;
    this.oldHideHud=WDL.minecraft.gameSettings.hideGUI;
    this.oldShowDebug=WDL.minecraft.gameSettings.showDebugInfo;
    this.oldChatVisibility=WDL.minecraft.gameSettings.chatVisibility;
    WDL.minecraft.gameSettings.thirdPersonView=0;
    WDL.minecraft.gameSettings.hideGUI=true;
    WDL.minecraft.gameSettings.showDebugInfo=false;
    WDL.minecraft.gameSettings.chatVisibility=EnumChatVisibility.HIDDEN;
    this.oldRenderViewEntity=WDL.minecraft.getRenderViewEntity();
    initializedCamera=true;
  }
  WDL.minecraft.setRenderViewEntity(this.cam);
}

Fixed version (ground truth):
/** 
 * Adds the buttons (and other controls) to the screen in question.
 */
@Override public void initGui(){
  if (!initializedCamera) {
    this.cam=LocalUtils.makePlayer();
    this.cam.setLocationAndAngles(WDL.thePlayer.posX,WDL.thePlayer.posY,WDL.thePlayer.posZ,WDL.thePlayer.rotationYaw,0.0F);
    this.yaw=WDL.thePlayer.rotationYaw;
    this.oldCameraMode=WDL.minecraft.gameSettings.thirdPersonView;
    this.oldHideHud=WDL.minecraft.gameSettings.hideGUI;
    this.oldShowDebug=WDL.minecraft.gameSettings.showDebugInfo;
    this.oldChatVisibility=WDL.minecraft.gameSettings.chatVisibility;
    this.oldRenderViewEntity=WDL.minecraft.getRenderViewEntity();
    initializedCamera=true;
  }
}
Program: 10318
Project: 10318
Buggy source:
@Override public void onGuiClosed(){
  super.onGuiClosed();
  WDL.minecraft.gameSettings.thirdPersonView=this.oldCameraMode;
  WDL.minecraft.gameSettings.hideGUI=oldHideHud;
  WDL.minecraft.gameSettings.showDebugInfo=oldShowDebug;
  WDL.minecraft.gameSettings.chatVisibility=oldChatVisibility;
  WDL.minecraft.setRenderViewEntity(this.oldRenderViewEntity);
}

Fixed version (ground truth):
@Override public void onGuiClosed(){
  super.onGuiClosed();
  this.deactivateRenderViewEntity();
}
Program: 10319
Project: 10319
Buggy source:
/** 
 * Draws the given button (for multi-version compatability, this is needed for lists)
 * @param button The button to draw.  Should already have been positioned.
 */
public static void drawButton(GuiButton button,Minecraft mc,int mouseX,int mouseY){
  button.drawButton(mc,mouseX,mouseY);
}

Fixed version (ground truth):
@Override public void drawButton(Minecraft mc,int mouseX,int mouseY){
  beforeDraw();
  super.drawButton(mc,mouseX,mouseY);
  afterDraw();
}
Program: 10320
Project: 10320
Buggy source:
/** 
 * Draws the given button (for multi-version compatability, this is needed for lists)
 * @param button The button to draw.  Should already have been positioned.
 */
public static void drawButton(GuiButton button,Minecraft mc,int mouseX,int mouseY){
  button.drawButton(mc,mouseX,mouseY);
}

Fixed version (ground truth):
@Override public void drawButton(Minecraft mc,int mouseX,int mouseY){
  beforeDraw();
  super.drawButton(mc,mouseX,mouseY);
  afterDraw();
}
Program: 10321
Project: 10321
Buggy source:
/** 
 * Draws the given button (for multi-version compatability, this is needed for lists)
 * @param button The button to draw.  Should already have been positioned.
 */
public static void drawButton(GuiButton button,Minecraft mc,int mouseX,int mouseY){
  button.drawButton(mc,mouseX,mouseY);
}

Fixed version (ground truth):
@Override public void drawButton(Minecraft mc,int mouseX,int mouseY){
  beforeDraw();
  super.drawButton(mc,mouseX,mouseY);
  afterDraw();
}
Program: 10322
Project: 10322
Buggy source:
/** 
 * Draws the given button (for multi-version compatability, this is needed for lists)
 * @param button The button to draw.  Should already have been positioned.
 */
public static void drawButton(GuiButton button,Minecraft mc,int mouseX,int mouseY){
  button.drawButton(mc,mouseX,mouseY);
}

Fixed version (ground truth):
@Override public void drawButton(Minecraft mc,int mouseX,int mouseY){
  beforeDraw();
  super.drawButton(mc,mouseX,mouseY);
  afterDraw();
}
Program: 10323
Project: 10323
Buggy source:
/** 
 * Returns true if the given world has skylight data.
 * @return a boolean
 */
public static boolean hasSkyLight(World world){
  return !world.provider.hasNoSky();
}

Fixed version (ground truth):
/** 
 * Returns true if the given world has skylight data.
 * @return a boolean
 */
public static boolean hasSkyLight(World world){
  return !world.provider.isNether();
}
Program: 10324
Project: 10324
Buggy source:
/** 
 * Returns true if the given world has skylight data.
 * @return a boolean
 */
public static boolean hasSkyLight(World world){
  return !world.provider.hasNoSky();
}

Fixed version (ground truth):
/** 
 * Returns true if the given world has skylight data.
 * @return a boolean
 */
public static boolean hasSkyLight(World world){
  return !world.provider.isNether();
}
Program: 10325
Project: 10325
Buggy source:
/** 
 * Calls saveChunk for all currently loaded chunks
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 */
public static void saveChunks(GuiWDLSaveProgress progressScreen) throws IllegalArgumentException, IllegalAccessException {
  if (!WDLPluginChannels.canDownloadAtAll()) {
    return;
  }
  WDLMessages.chatMessageTranslated(WDLMessageTypes.SAVING,"String_Node_Str");
  ChunkProviderClient chunkProvider=(ChunkProviderClient)worldClient.getChunkProvider();
  @SuppressWarnings("String_Node_Str") Long2ObjectMap<Chunk> chunkMap=(Long2ObjectMap<Chunk>)ReflectionUtils.findAndGetPrivateField(chunkProvider,Long2ObjectMap.class);
  List<Chunk> chunks=new ArrayList<Chunk>(chunkMap.values());
  progressScreen.startMajorTask(I18n.format("String_Node_Str"),chunks.size());
  for (int currentChunk=0; currentChunk < chunks.size(); currentChunk++) {
    Chunk c=(Chunk)chunks.get(currentChunk);
    if (c != null) {
      if (!WDLPluginChannels.canSaveChunk(c)) {
        continue;
      }
      progressScreen.setMinorTaskProgress(I18n.format("String_Node_Str",c.xPosition,c.zPosition),currentChunk);
      saveChunk(c);
    }
  }
  WDLMessages.chatMessageTranslated(WDLMessageTypes.SAVING,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Calls saveChunk for all currently loaded chunks
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 */
public static void saveChunks(GuiWDLSaveProgress progressScreen) throws IllegalArgumentException, IllegalAccessException {
  if (!WDLPluginChannels.canDownloadAtAll()) {
    return;
  }
  WDLMessages.chatMessageTranslated(WDLMessageTypes.SAVING,"String_Node_Str");
  ChunkProviderClient chunkProvider=(ChunkProviderClient)worldClient.getChunkProvider();
  @SuppressWarnings("String_Node_Str") Long2ObjectMap<Chunk> chunkMap=(Long2ObjectMap<Chunk>)ReflectionUtils.findAndGetPrivateField(chunkProvider,Long2ObjectMap.class);
  List<Chunk> chunks=new ArrayList<Chunk>(chunkMap.values());
  progressScreen.startMajorTask(I18n.format("String_Node_Str"),chunks.size());
  for (int currentChunk=0; currentChunk < chunks.size(); currentChunk++) {
    Chunk c=(Chunk)chunks.get(currentChunk);
    if (c != null) {
      if (!WDLPluginChannels.canSaveChunk(c)) {
        continue;
      }
      progressScreen.setMinorTaskProgress(I18n.format("String_Node_Str",c.x,c.z),currentChunk);
      saveChunk(c);
    }
  }
  WDLMessages.chatMessageTranslated(WDLMessageTypes.SAVING,"String_Node_Str");
}
Program: 10326
Project: 10326
Buggy source:
/** 
 * Import all non-overwritten TileEntities, then save the chunk
 */
public static void saveChunk(Chunk c){
  if (!WDLPluginChannels.canDownloadAtAll()) {
    return;
  }
  if (!WDLPluginChannels.canSaveChunk(c)) {
    return;
  }
  try {
    if (isEmpty(c)) {
      logger.warn("String_Node_Str" + c + "String_Node_Str"+ c.xPosition+ "String_Node_Str"+ c.zPosition+ "String_Node_Str");
      return;
    }
    chunkLoader.saveChunk(worldClient,c);
  }
 catch (  Exception e) {
    WDLMessages.chatMessageTranslated(WDLMessageTypes.ERROR,"String_Node_Str",c.xPosition,c.zPosition,e);
  }
}

Fixed version (ground truth):
/** 
 * Import all non-overwritten TileEntities, then save the chunk
 */
public static void saveChunk(Chunk c){
  if (!WDLPluginChannels.canDownloadAtAll()) {
    return;
  }
  if (!WDLPluginChannels.canSaveChunk(c)) {
    return;
  }
  try {
    if (isEmpty(c)) {
      logger.warn("String_Node_Str" + c + "String_Node_Str"+ c.x+ "String_Node_Str"+ c.z+ "String_Node_Str");
      return;
    }
    chunkLoader.saveChunk(worldClient,c);
  }
 catch (  Exception e) {
    WDLMessages.chatMessageTranslated(WDLMessageTypes.ERROR,"String_Node_Str",c.x,c.z,e);
  }
}
Program: 10328
Project: 10328
Buggy source:
private static boolean isEmpty(Chunk c){
  if (c.isEmpty() || c instanceof EmptyChunk) {
    return true;
  }
  ExtendedBlockStorage[] array=c.getBlockStorageArray();
  for (int i=1; i < array.length; i++) {
    if (array[i] != Chunk.NULL_BLOCK_STORAGE) {
      return false;
    }
  }
  if (array[0] != Chunk.NULL_BLOCK_STORAGE) {
    for (int y=0; y < 16; y++) {
      for (int z=0; z < 16; z++) {
        for (int x=0; x < 16; x++) {
          int id=Block.getStateId(array[0].get(x,y,z));
          id=(id & 0xFFF) << 4 | (id & 0xF000) >> 12;
          if ((id > 0x00F) && (id < 0x1A0 || id > 0x1AF)) {
            return false;
          }
        }
      }
    }
    logger.warn("String_Node_Str" + c.xPosition + "String_Node_Str"+ c.zPosition);
  }
 else {
    logger.warn("String_Node_Str" + c.xPosition + "String_Node_Str"+ c.zPosition);
  }
  return true;
}

Fixed version (ground truth):
private static boolean isEmpty(Chunk c){
  if (c.isEmpty() || c instanceof EmptyChunk) {
    return true;
  }
  ExtendedBlockStorage[] array=c.getBlockStorageArray();
  for (int i=1; i < array.length; i++) {
    if (array[i] != Chunk.NULL_BLOCK_STORAGE) {
      return false;
    }
  }
  if (array[0] != Chunk.NULL_BLOCK_STORAGE) {
    for (int y=0; y < 16; y++) {
      for (int z=0; z < 16; z++) {
        for (int x=0; x < 16; x++) {
          int id=Block.getStateId(array[0].get(x,y,z));
          id=(id & 0xFFF) << 4 | (id & 0xF000) >> 12;
          if ((id > 0x00F) && (id < 0x1A0 || id > 0x1AF)) {
            return false;
          }
        }
      }
    }
    logger.warn("String_Node_Str" + c.x + "String_Node_Str"+ c.z);
  }
 else {
    logger.warn("String_Node_Str" + c.x + "String_Node_Str"+ c.z);
  }
  return true;
}
Program: 10333
Project: 10333
Buggy source:
/** 
 * Must be called when a chunk is no longer needed and is about to be removed.
 */
public static void onChunkNoLongerNeeded(Chunk unneededChunk){
  if (!WDL.downloading) {
    return;
  }
  if (unneededChunk == null) {
    return;
  }
  if (WDLPluginChannels.canSaveChunk(unneededChunk)) {
    WDLMessages.chatMessageTranslated(WDLMessageTypes.ON_CHUNK_NO_LONGER_NEEDED,"String_Node_Str",unneededChunk.xPosition,unneededChunk.zPosition);
    WDL.saveChunk(unneededChunk);
  }
 else {
    WDLMessages.chatMessageTranslated(WDLMessageTypes.ON_CHUNK_NO_LONGER_NEEDED,"String_Node_Str",unneededChunk.xPosition,unneededChunk.zPosition);
  }
}

Fixed version (ground truth):
/** 
 * Must be called when a chunk is no longer needed and is about to be removed.
 */
public static void onChunkNoLongerNeeded(Chunk unneededChunk){
  if (!WDL.downloading) {
    return;
  }
  if (unneededChunk == null) {
    return;
  }
  if (WDLPluginChannels.canSaveChunk(unneededChunk)) {
    WDLMessages.chatMessageTranslated(WDLMessageTypes.ON_CHUNK_NO_LONGER_NEEDED,"String_Node_Str",unneededChunk.x,unneededChunk.z);
    WDL.saveChunk(unneededChunk);
  }
 else {
    WDLMessages.chatMessageTranslated(WDLMessageTypes.ON_CHUNK_NO_LONGER_NEEDED,"String_Node_Str",unneededChunk.x,unneededChunk.z);
  }
}