nus-yam/ex-repair huggingface dataset:
Program: 83510
Project: 83510
Buggy source:
public void generatePackageListJs(PrintWriter w) throws IOException {
class DefinedPkgInfo extends PkgInfo<DefinedPkgInfo> {
    public DefinedPkgInfo(    String name){
      super(name);
    }
    protected DefinedPkgInfo create(    String name){
      return new DefinedPkgInfo(name);
    }
    /** 
 * False if this class doesn't have any classes in it (excluding descendants.)
 */
    boolean hasClasses;
    public void write(    JsonWriter js){
      super.write(js);
      if (hasClasses)       js.property("String_Node_Str",true);
    }
  }
  DefinedPkgInfo root=new DefinedPkgInfo("String_Node_Str");
  for (  PackageElement pe : pss.getPackageElement()) {
    root.add(pe.getQualifiedName().toString()).hasClasses=true;
  }
  try {
    w.println("String_Node_Str");
    root.write(new JsonWriter(w));
    w.println("String_Node_Str");
  }
  finally {
    w.close();
  }
}

Fixed version (ground truth):
public void generatePackageListJs(PrintWriter w) throws IOException {
class DefinedPkgInfo extends PkgInfo<DefinedPkgInfo> {
    public DefinedPkgInfo(    String name){
      super(name);
    }
    protected DefinedPkgInfo create(    String name){
      return new DefinedPkgInfo(name);
    }
    /** 
 * False if this class doesn't have any classes in it (excluding descendants.)
 */
    boolean hasClasses;
    public void write(    JsonWriter js){
      super.write(js);
      if (hasClasses)       js.property("String_Node_Str",true);
    }
  }
  DefinedPkgInfo root=new DefinedPkgInfo("String_Node_Str");
  for (  PackageElement pe : pss.getPackageElement()) {
    root.add(pe.getQualifiedName().toString()).hasClasses=true;
  }
  try {
    w.println("String_Node_Str");
    new JsonWriter(w).object(root);
    w.println("String_Node_Str");
  }
  finally {
    w.close();
  }
}
Program: 83511
Project: 83511
Buggy source:
/** 
 * Writes a JSON object that represents this node.
 */
protected void write(JsonWriter w){
  w.startObject();
  if (element != null) {
    if (path == null)     writeOutlineNodeProperties(w,element);
 else     writeOutlineNodeProperties(w,element,path.getCompilationUnit(),path.getLeaf());
  }
  if (!children.isEmpty()) {
    w.key("String_Node_Str");
    w.startArray();
    for (    Node child : children.values()) {
      child.write(w);
    }
    w.endArray();
  }
  if (!leaves.isEmpty()) {
    w.key("String_Node_Str");
    w.startArray();
    for (    TreePath p : leaves) {
      w.startObject();
      w.property("String_Node_Str",p.getLeaf().toString());
      w.endObject();
    }
  }
  w.endArray();
  w.endObject();
}

Fixed version (ground truth):
/** 
 * Writes a JSON object that represents this node.
 */
protected void write(JsonWriter w){
  w.startObject();
  if (element != null) {
    if (path == null)     writeOutlineNodeProperties(w,element);
 else     writeOutlineNodeProperties(w,element,path.getCompilationUnit(),path.getLeaf());
  }
  if (!children.isEmpty()) {
    w.key("String_Node_Str");
    w.startArray();
    for (    Node child : children.values()) {
      child.write(w);
    }
    w.endArray();
  }
  if (!leaves.isEmpty()) {
    w.key("String_Node_Str");
    w.startArray();
    for (    TreePath p : leaves) {
      w.startObject();
      w.property("String_Node_Str",p.getLeaf().toString());
      w.endObject();
    }
    w.endArray();
  }
  w.endObject();
}
Program: 83512
Project: 83512
Buggy source:
/** 
 * Adds the given   {@link TreePath} to the {@link Node} treerooted at "this" node, then return the  {@link Node} wherethe  {@link TreePath} is ultimately stored.
 */
protected Node add(TreePath t){
  Node p;
  if (t.getParentPath() != null)   p=add(t.getParentPath());
 else   p=this;
  Element e=TreeUtil.getElement(t.getLeaf());
  if (e != null) {
    if (TreeUtil.OUTLINE_WORTHY.contains(e.getKind())) {
      Node n=children.get(e);
      if (n == null)       children.put(e,n=createNode(e,t));
      return n;
    }
  }
  return p;
}

Fixed version (ground truth):
/** 
 * Adds the given   {@link TreePath} to the {@link Node} treerooted at "this" node, then return the  {@link Node} wherethe  {@link TreePath} is ultimately stored.
 */
protected Node add(TreePath t){
  Node p;
  if (t.getParentPath() != null)   p=add(t.getParentPath());
 else   p=this;
  Element e=TreeUtil.getElement(t.getLeaf());
  if (e != null) {
    if (TreeUtil.OUTLINE_WORTHY.contains(e.getKind())) {
      Node n=p.children.get(e);
      if (n == null)       p.children.put(e,n=createNode(e,t));
      return n;
    }
  }
  return p;
}
Program: 83513
Project: 83513
Buggy source:
private void sep(){
  if (first)   first=false;
 else   w.print(',');
  nl(0);
}

Fixed version (ground truth):
private void sep(){
  if (first)   first=false;
 else {
    w.print(',');
    nl(0);
  }
}
Program: 83514
Project: 83514
Buggy source:
/** 
 * Finds the first identifier token after the given tree. <p> This is used to identify the position of few nodes that are not available from javac.
 * @return nullif no such node is found or a syntax error is detected.
 */
protected final Token findTokenAfter(Tree t){
  long pos=pss.getSourcePositions().getEndPosition(compUnit,t);
  if (pos < 0)   return null;
  JavaLexer lexer=new JavaLexer(new StringReader(sourceFile.substring((int)pos)));
  lexer.setTabSize(pss.getTabWidth());
  try {
    while (true) {
      Token token=lexer.nextToken();
      int type=token.getType();
      if (type == JavaTokenTypes.EOF)       break;
      if (type == JavaTokenTypes.IDENT) {
        LineMap lm=compUnit.getLineMap();
        token.setLine(token.getLine() + (int)lm.getLineNumber(pos) - 1);
        token.setColumn(token.getColumn() + (int)lm.getColumnNumber(pos) - 1);
        return token;
      }
    }
  }
 catch (  TokenStreamException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Finds the first identifier token after the given tree. <p> This is used to identify the position of few nodes that are not available from javac.
 * @param t The first token after the end position of this tree node will be returned.
 * @param id If non-null, find the first token that has this identifier.
 * @return nullif no such node is found or a syntax error is detected.
 */
protected final Token findTokenAfter(Tree t,String id){
  long pos=pss.getSourcePositions().getEndPosition(compUnit,t);
  if (pos < 0)   return null;
  JavaLexer lexer=new JavaLexer(new StringReader(sourceFile.substring((int)pos)));
  lexer.setTabSize(pss.getTabWidth());
  try {
    while (true) {
      Token token=lexer.nextToken();
      int type=token.getType();
      if (type == JavaTokenTypes.EOF)       break;
      if (type == JavaTokenTypes.IDENT) {
        if (id != null && !token.getText().equals(id))         continue;
        LineMap lm=compUnit.getLineMap();
        token.setLine(token.getLine() + (int)lm.getLineNumber(pos) - 1);
        token.setColumn(token.getColumn() + (int)lm.getColumnNumber(pos) - 1);
        return token;
      }
    }
  }
 catch (  TokenStreamException e) {
  }
  return null;
}
Program: 83515
Project: 83515
Buggy source:
/** 
 * Definition of a variable, such as parameter, field, and local variables.
 */
public Void visitVariable(VariableTree vt,Void _){
  Element e=TreeUtil.getElement(vt);
  if (e != null) {
    if (e.getKind() != ElementKind.ENUM_CONSTANT) {
      Token t=gen.findTokenAfter(vt.getType());
      if (t != null) {
        gen.add(new SpanMarker(lineMap,t,getCssClass(e,"String_Node_Str"),buildId(e)));
      }
    }
 else {
      gen.add(new SpanMarker(cu,srcPos,vt,getCssClass(e,"String_Node_Str"),buildId(e)));
    }
  }
  return super.visitVariable(vt,_);
}

Fixed version (ground truth):
/** 
 * Definition of a variable, such as parameter, field, and local variables.
 */
public Void visitVariable(VariableTree vt,Void _){
  Element e=TreeUtil.getElement(vt);
  if (e != null) {
    if (e.getKind() != ElementKind.ENUM_CONSTANT) {
      Token t=gen.findTokenAfter(vt.getType(),vt.getName().toString());
      if (t != null) {
        gen.add(new SpanMarker(lineMap,t,getCssClass(e,"String_Node_Str"),buildId(e)));
      }
    }
 else {
      gen.add(new SpanMarker(cu,srcPos,vt,getCssClass(e,"String_Node_Str"),buildId(e)));
    }
  }
  return super.visitVariable(vt,_);
}
Program: 83517
Project: 83517
Buggy source:
public InternalLinkResolver(PackageElement pkg,ParsedSourceSet pss){
  this.pss=pss;
  this.trees=pss.getTrees();
  this.elements=pss.getElements();
  this.types=pss.getTypes();
  this.primary=null;
  this.pkg=pkg.getQualifiedName().toString().split("String_Node_Str");
}

Fixed version (ground truth):
public InternalLinkResolver(PackageElement pkg,ParsedSourceSet pss){
  this.pss=pss;
  this.compUnit=null;
  this.trees=pss.getTrees();
  this.elements=pss.getElements();
  this.types=pss.getTypes();
  this.pkg=pkg.getQualifiedName().toString().split("String_Node_Str");
}
Program: 83518
Project: 83518
Buggy source:
public StringBuilder visitType(TypeElement t,Void _){
  if (t == primary)   return new StringBuilder();
  if (trees.getTree(t) == null)   return null;
switch (t.getNestingKind()) {
case ANONYMOUS:
    String binaryName=elements.getBinaryName(t).toString();
  int idx=binaryName.lastIndexOf('$');
String name='~' + binaryName.substring(idx);
return combine(getEnclosingTypeOrPackage(t).accept(this,null)).append(name);
case TOP_LEVEL:
return recurse(t).append(t.getSimpleName()).append("String_Node_Str");
case MEMBER:
case LOCAL:
return recurse(t).append('~').append(t.getSimpleName());
default :
throw new IllegalStateException(t.getNestingKind().toString());
}
}

Fixed version (ground truth):
public StringBuilder visitType(TypeElement t,Void _){
  ClassTree ct=trees.getTree(t);
  if (ct == null)   return null;
switch (t.getNestingKind()) {
case ANONYMOUS:
    String binaryName=elements.getBinaryName(t).toString();
  int idx=binaryName.lastIndexOf('$');
String name="String_Node_Str" + binaryName.substring(idx);
return combine(getEnclosingTypeOrPackage(t).accept(this,null)).append(name);
case TOP_LEVEL:
CompilationUnitTree owner=pss.getTreePathByClass().get(ct).getCompilationUnit();
String primaryTypeName=TreeUtil.getPrimaryTypeName(owner);
String simpleName=ct.getSimpleName().toString();
StringBuilder buf;
if (!owner.equals(compUnit)) {
buf=combine(recurse(t)).append(t.getSimpleName()).append("String_Node_Str");
}
 else {
buf=new StringBuilder();
}
if (!primaryTypeName.equals(simpleName)) {
return buf.append("String_Node_Str").append(simpleName);
}
return buf;
case MEMBER:
case LOCAL:
return recurse(t).append('~').append(t.getSimpleName());
default :
throw new IllegalStateException(t.getNestingKind().toString());
}
}
Program: 83519
Project: 83519
Buggy source:
/** 
 * Gets all the classes in the given package.
 */
public Collection<TypeElement> getClassElements(PackageElement pkg){
  Set<TypeElement> r=new TreeSet<TypeElement>(TYPE_COMPARATOR);
  for (  TypeElement e : classElements) {
    Element p=e.getEnclosingElement();
    if (p.equals(pkg))     r.add(e);
  }
  return r;
}

Fixed version (ground truth):
/** 
 * Gets all the classes in the given package.
 */
public Collection<TypeElement> getClassElements(PackageElement pkg){
  Set<TypeElement> r=new TreeSet<TypeElement>(TYPE_COMPARATOR);
  for (  TypeElement e : parsedTypes.keySet()) {
    Element p=e.getEnclosingElement();
    if (p.equals(pkg))     r.add(e);
  }
  return r;
}
Program: 83520
Project: 83520
Buggy source:
/** 
 * Runs <tt>javac</tt> and analyzes the result. <p> Any error found during the analysis will be reported to  {@link DiagnosticListener} installed on {@link JavacTask}.
 */
public ParsedSourceSet(JavacTask javac) throws IOException {
  trees=Trees.instance(javac);
  elements=javac.getElements();
  types=javac.getTypes();
  srcPos=new SourcePositionsWrapper(trees.getSourcePositions());
  Iterable<? extends CompilationUnitTree> parsed=javac.parse();
  javac.analyze();
  TreePathScanner<?,?> classScanner=new TreePathScanner<Void,Void>(){
    public Void visitClass(    ClassTree ct,    Void _){
      TreePath path=getCurrentPath();
      TypeElement e=(TypeElement)trees.getElement(path);
      if (e != null) {
        classes.put(e.getQualifiedName().toString(),path);
        classElements.add(e);
        getParsedType(e);
      }
      return super.visitClass(ct,_);
    }
  }
;
  for (  CompilationUnitTree u : parsed) {
    compilationUnits.add(u);
    classScanner.scan(u,null);
  }
  for (  TypeElement e : classElements) {
    Element p=e.getEnclosingElement();
    if (p.getKind() == ElementKind.PACKAGE) {
      PackageElement pe=(PackageElement)p;
      packages.add(pe);
    }
  }
  for (  Map.Entry<TypeElement,Set<CompilationUnitTree>> e : ClassReferenceBuilder.build(compilationUnits).entrySet())   getParsedType(e.getKey()).referers=e.getValue().toArray(new CompilationUnitTree[e.getValue().size()]);
}

Fixed version (ground truth):
/** 
 * Runs <tt>javac</tt> and analyzes the result. <p> Any error found during the analysis will be reported to  {@link DiagnosticListener} installed on {@link JavacTask}.
 */
public ParsedSourceSet(JavacTask javac) throws IOException {
  trees=Trees.instance(javac);
  elements=javac.getElements();
  types=javac.getTypes();
  srcPos=new SourcePositionsWrapper(trees.getSourcePositions());
  Iterable<? extends CompilationUnitTree> parsed=javac.parse();
  javac.analyze();
  TreePathScanner<?,?> classScanner=new TreePathScanner<Void,Void>(){
    public Void visitClass(    ClassTree ct,    Void _){
      TreePath path=getCurrentPath();
      treePathByClass.put(ct,path);
      TypeElement e=(TypeElement)trees.getElement(path);
      if (e != null) {
        classes.put(e.getQualifiedName().toString(),path);
        getParsedType(e);
      }
      return super.visitClass(ct,_);
    }
  }
;
  for (  CompilationUnitTree u : parsed) {
    compilationUnits.add(u);
    classScanner.scan(u,null);
  }
  for (  TypeElement e : parsedTypes.keySet()) {
    Element p=e.getEnclosingElement();
    if (p.getKind() == ElementKind.PACKAGE) {
      PackageElement pe=(PackageElement)p;
      packages.add(pe);
    }
  }
  for (  Map.Entry<TypeElement,Set<CompilationUnitTree>> e : ClassReferenceBuilder.build(compilationUnits).entrySet())   getParsedType(e.getKey()).referers=e.getValue().toArray(new CompilationUnitTree[e.getValue().size()]);
}
Program: 83522
Project: 83522
Buggy source:
public StringBuilder visitType(TypeElement t,Void _){
  ClassTree ct=trees.getTree(t);
  if (ct == null)   return null;
switch (t.getNestingKind()) {
case ANONYMOUS:
    String binaryName=elements.getBinaryName(t).toString();
  int idx=binaryName.lastIndexOf('$');
String name="String_Node_Str" + binaryName.substring(idx);
return combine(getEnclosingTypeOrPackage(t).accept(this,null)).append(name);
case TOP_LEVEL:
CompilationUnitTree owner=pss.getTreePathByClass().get(ct).getCompilationUnit();
String primaryTypeName=TreeUtil.getPrimaryTypeName(owner);
String simpleName=ct.getSimpleName().toString();
StringBuilder buf;
if (!owner.equals(compUnit)) {
buf=combine(recurse(t)).append(t.getSimpleName()).append("String_Node_Str");
}
 else {
buf=new StringBuilder();
}
if (!primaryTypeName.equals(simpleName)) {
return buf.append("String_Node_Str").append(simpleName);
}
return buf;
case MEMBER:
case LOCAL:
return recurse(t).append('~').append(t.getSimpleName());
default :
throw new IllegalStateException(t.getNestingKind().toString());
}
}

Fixed version (ground truth):
public StringBuilder visitType(TypeElement t,Void _){
  ClassTree ct=trees.getTree(t);
  if (ct == null)   return null;
switch (t.getNestingKind()) {
case ANONYMOUS:
    String binaryName=elements.getBinaryName(t).toString();
  int idx=binaryName.lastIndexOf('$');
String name="String_Node_Str" + binaryName.substring(idx);
return combine(getEnclosingTypeOrPackage(t).accept(this,null)).append(name);
case TOP_LEVEL:
CompilationUnitTree owner=pss.getTreePathByClass().get(ct).getCompilationUnit();
String primaryTypeName=TreeUtil.getPrimaryTypeName(owner);
String simpleName=ct.getSimpleName().toString();
StringBuilder buf;
if (!owner.equals(compUnit)) {
buf=combine(recurse(t)).append(primaryTypeName).append("String_Node_Str");
}
 else {
buf=new StringBuilder();
}
if (!primaryTypeName.equals(simpleName)) {
return buf.append("String_Node_Str").append(simpleName);
}
return buf;
case MEMBER:
case LOCAL:
return recurse(t).append('~').append(t.getSimpleName());
default :
throw new IllegalStateException(t.getNestingKind().toString());
}
}
Program: 83523
Project: 83523
Buggy source:
/** 
 * Gets all the packages of the analyzed source files.
 * @return can be empty but never null.
 */
public Collection<PackageElement> getPackageElement(){
  return Collections.unmodifiableCollection(packages);
}

Fixed version (ground truth):
/** 
 * Gets all the packages of the analyzed source files. <p> This does not include those packages that are just referenced. 
 * @return can be empty but never null.
 */
public Collection<PackageElement> getPackageElement(){
  return Collections.unmodifiableCollection(packages);
}
Program: 83524
Project: 83524
Buggy source:
/** 
 * Runs <tt>javac</tt> and analyzes the result. <p> Any error found during the analysis will be reported to  {@link DiagnosticListener} installed on {@link JavacTask}.
 */
public ParsedSourceSet(JavacTask javac) throws IOException {
  trees=Trees.instance(javac);
  elements=javac.getElements();
  types=javac.getTypes();
  srcPos=new SourcePositionsWrapper(trees.getSourcePositions());
  Iterable<? extends CompilationUnitTree> parsed=javac.parse();
  javac.analyze();
  TreePathScanner<?,?> classScanner=new TreePathScanner<Void,Void>(){
    public Void visitClass(    ClassTree ct,    Void _){
      TreePath path=getCurrentPath();
      treePathByClass.put(ct,path);
      TypeElement e=(TypeElement)trees.getElement(path);
      if (e != null) {
        classes.put(e.getQualifiedName().toString(),path);
        getParsedType(e);
      }
      return super.visitClass(ct,_);
    }
  }
;
  for (  CompilationUnitTree u : parsed) {
    compilationUnits.add(u);
    classScanner.scan(u,null);
  }
  for (  TypeElement e : parsedTypes.keySet()) {
    Element p=e.getEnclosingElement();
    if (p.getKind() == ElementKind.PACKAGE) {
      PackageElement pe=(PackageElement)p;
      packages.add(pe);
    }
  }
  for (  Map.Entry<TypeElement,Set<CompilationUnitTree>> e : ClassReferenceBuilder.build(compilationUnits).entrySet())   getParsedType(e.getKey()).referers=e.getValue().toArray(new CompilationUnitTree[e.getValue().size()]);
}

Fixed version (ground truth):
/** 
 * Runs <tt>javac</tt> and analyzes the result. <p> Any error found during the analysis will be reported to  {@link DiagnosticListener} installed on {@link JavacTask}.
 */
public ParsedSourceSet(JavacTask javac) throws IOException {
  trees=Trees.instance(javac);
  elements=javac.getElements();
  types=javac.getTypes();
  srcPos=new SourcePositionsWrapper(trees.getSourcePositions());
  Iterable<? extends CompilationUnitTree> parsed=javac.parse();
  javac.analyze();
  TreePathScanner<?,?> classScanner=new TreePathScanner<Void,Void>(){
    public Void visitClass(    ClassTree ct,    Void _){
      TreePath path=getCurrentPath();
      treePathByClass.put(ct,path);
      TypeElement e=(TypeElement)trees.getElement(path);
      if (e != null) {
        classes.put(e.getQualifiedName().toString(),path);
        getParsedType(e);
        Element p=e.getEnclosingElement();
        if (p.getKind() == ElementKind.PACKAGE)         packages.add((PackageElement)p);
      }
      return super.visitClass(ct,_);
    }
  }
;
  for (  CompilationUnitTree u : parsed) {
    compilationUnits.add(u);
    classScanner.scan(u,null);
  }
  for (  Map.Entry<TypeElement,Set<CompilationUnitTree>> e : ClassReferenceBuilder.build(compilationUnits).entrySet())   getParsedType(e.getKey()).referers=e.getValue().toArray(new CompilationUnitTree[e.getValue().size()]);
}
Program: 83525
Project: 83525
Buggy source:
public void clear(){
  toDraw=false;
  StylesFactory.clearCache();
  style=StylesFactory.getCurrentStyle();
}

Fixed version (ground truth):
public void clear(){
  toDraw=false;
  StylesFactory.clearCache();
  setStyle(StylesFactory.getCurrentStyle());
}
Program: 83526
Project: 83526
Buggy source:
public void setStyle(Style style){
  toDraw=false;
  this.style=style;
}

Fixed version (ground truth):
public void setStyle(Style style){
  toDraw=false;
  style.setColor(color);
  this.style=style;
}
Program: 83527
Project: 83527
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  upgrade();
  surface=new Surface(this);
  LayoutParams params=new LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,android.view.ViewGroup.LayoutParams.FILL_PARENT);
  setContentView(surface,params);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  surface=new Surface(this);
  LayoutParams params=new LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,android.view.ViewGroup.LayoutParams.FILL_PARENT);
  setContentView(surface,params);
}
Program: 83528
Project: 83528
Buggy source:
protected Void doInBackground(Void... urls){
  surface.getThread().pauseDrawing();
  String path="String_Node_Str";
  String filename="String_Node_Str";
  String extension="String_Node_Str";
  if (!new File(path).exists()) {
    new File(path).mkdirs();
  }
  int suffix=1;
  while (new File(path + filename + suffix+ extension).exists()) {
    suffix++;
  }
  final String fileName=path + filename + suffix+ extension;
  try {
    surface.saveBitmap(fileName);
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
protected Void doInBackground(Void... urls){
  surface.getThread().pauseDrawing();
  String sdPath=Environment.getExternalStorageDirectory().getAbsolutePath();
  String path=sdPath + "String_Node_Str";
  String filename="String_Node_Str";
  String extension="String_Node_Str";
  if (!new File(path).exists()) {
    new File(path).mkdirs();
  }
  int suffix=1;
  while (new File(path + filename + suffix+ extension).exists()) {
    suffix++;
  }
  final String fileName=path + filename + suffix+ extension;
  try {
    surface.saveBitmap(fileName);
  }
 catch (  FileNotFoundException e) {
    throw new RuntimeException(e);
  }
  Uri uri=Uri.fromFile(new File(fileName));
  sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,uri));
  return null;
}
Program: 83529
Project: 83529
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  menu.add(0,MENU_SAVE,0,"String_Node_Str").setIcon(R.drawable.save);
  menu.add(0,MENU_SEND,0,"String_Node_Str").setIcon(R.drawable.send);
  menu.add(0,MENU_CLEAR,0,"String_Node_Str").setIcon(R.drawable.clear);
  SubMenu subMenu=menu.addSubMenu("String_Node_Str").setIcon(R.drawable.brushes);
  subMenu.add(GROUP_BRUSHES,StylesFactory.SKETCHY,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.SIMPLE,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.SHADED,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.CHROME,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.FUR,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.LONGFUR,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.WEB,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.SQUARES,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.RIBBON,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.CIRCLES,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.GRID,0,"String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  menu.add(0,MENU_SAVE,0,"String_Node_Str").setIcon(R.drawable.save);
  menu.add(0,MENU_SEND,0,"String_Node_Str").setIcon(R.drawable.send);
  menu.add(0,MENU_CLEAR,0,"String_Node_Str").setIcon(R.drawable.clear);
  menu.add(0,MENU_COLOR,0,"String_Node_Str");
  SubMenu subMenu=menu.addSubMenu("String_Node_Str").setIcon(R.drawable.brushes);
  subMenu.add(GROUP_BRUSHES,StylesFactory.SKETCHY,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.SIMPLE,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.SHADED,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.CHROME,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.FUR,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.LONGFUR,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.WEB,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.SQUARES,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.RIBBON,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.CIRCLES,0,"String_Node_Str");
  subMenu.add(GROUP_BRUSHES,StylesFactory.GRID,0,"String_Node_Str");
  return true;
}
Program: 83530
Project: 83530
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  if (item.getGroupId() == GROUP_BRUSHES) {
    surface.setStyle(StylesFactory.getStyle(item.getItemId()));
    return true;
  }
switch (item.getItemId()) {
case MENU_CLEAR:
    surface.clearBitmap();
  return true;
case MENU_SAVE:
saveToSD();
return true;
case MENU_SEND:
sendImage();
return true;
default :
return false;
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  if (item.getGroupId() == GROUP_BRUSHES) {
    surface.setStyle(StylesFactory.getStyle(item.getItemId()));
    return true;
  }
switch (item.getItemId()) {
case MENU_CLEAR:
    surface.clearBitmap();
  return true;
case MENU_SAVE:
saveToSD();
return true;
case MENU_SEND:
sendImage();
return true;
case MENU_COLOR:
new ColorPickerDialog(this,new OnColorChangedListener(){
@Override public void colorChanged(int color){
surface.setPaintColor(color);
}
}
,surface.getPaintColor()).show();
return true;
default :
return false;
}
}
Program: 83531
Project: 83531
Buggy source:
private void saveToSD(){
  String externalStorageState=Environment.getExternalStorageState();
  if (!externalStorageState.equals(Environment.MEDIA_MOUNTED)) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    return;
  }
  final ProgressDialog dialog=ProgressDialog.show(this,"String_Node_Str","String_Node_Str",true);
  new AsyncTask<Void,Void,Void>(){
    protected Void doInBackground(    Void... urls){
      surface.getThread().pauseDrawing();
      String path="String_Node_Str";
      String filename="String_Node_Str";
      String extension="String_Node_Str";
      if (!new File(path).exists()) {
        new File(path).mkdirs();
      }
      int suffix=1;
      while (new File(path + filename + suffix+ extension).exists()) {
        suffix++;
      }
      final String fileName=path + filename + suffix+ extension;
      try {
        surface.saveBitmap(fileName);
      }
 catch (      FileNotFoundException e) {
        e.printStackTrace();
      }
      return null;
    }
    protected void onPostExecute(    Void result){
      surface.getThread().resumeDrawing();
      dialog.hide();
    }
  }
.execute();
}

Fixed version (ground truth):
private void saveToSD(){
  String externalStorageState=Environment.getExternalStorageState();
  if (!externalStorageState.equals(Environment.MEDIA_MOUNTED)) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    return;
  }
  final ProgressDialog dialog=ProgressDialog.show(this,"String_Node_Str","String_Node_Str",true);
  new AsyncTask<Void,Void,Void>(){
    protected Void doInBackground(    Void... urls){
      surface.getThread().pauseDrawing();
      String sdPath=Environment.getExternalStorageDirectory().getAbsolutePath();
      String path=sdPath + "String_Node_Str";
      String filename="String_Node_Str";
      String extension="String_Node_Str";
      if (!new File(path).exists()) {
        new File(path).mkdirs();
      }
      int suffix=1;
      while (new File(path + filename + suffix+ extension).exists()) {
        suffix++;
      }
      final String fileName=path + filename + suffix+ extension;
      try {
        surface.saveBitmap(fileName);
      }
 catch (      FileNotFoundException e) {
        throw new RuntimeException(e);
      }
      Uri uri=Uri.fromFile(new File(fileName));
      sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,uri));
      return null;
    }
    protected void onPostExecute(    Void result){
      surface.getThread().resumeDrawing();
      dialog.hide();
    }
  }
.execute();
}
Program: 83532
Project: 83532
Buggy source:
public ExpressionRejectedByFilterResult(ExpressionRejectedByFilterException details){
  this.details=details;
  if (details == null) {
    filter=null;
  }
 else {
    filter=details.getFilter();
  }
}

Fixed version (ground truth):
/** 
 * Result with the given details.
 * @param details (optional) Details of where and why
 */
public ExpressionRejectedByFilterResult(ExpressionRejectedByFilterException details){
  this.details=details;
  if (details == null) {
    filter=null;
  }
 else {
    filter=details.getFilter();
  }
}
Program: 83533
Project: 83533
Buggy source:
public String toString(){
  return "String_Node_Str" + details + "String_Node_Str"+ super.getExpressionDescriptor()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + details + "String_Node_Str"+ super.getExpressionDescriptor()+ "String_Node_Str";
}
Program: 83534
Project: 83534
Buggy source:
public FailedValidationResult(InvalidExpressionException failure){
  this.failure=failure;
}

Fixed version (ground truth):
/** 
 * Result for the given failure.
 * @param failure (required) details of what was wrong
 */
public FailedValidationResult(InvalidExpressionException failure){
  this.failure=failure;
}
Program: 83535
Project: 83535
Buggy source:
public JsfExpressionDescriptor(int lineNumber,String jspFile){
  this.tagLineNumber=lineNumber;
  this.jspFile=jspFile;
  this.expression="String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Descriptor with tag location information and no EL expression (it's assumed that it isn't needed because it's already communicated in another way).
 * @param lineNumber (required) the line where the tag containing the EL expression in question starts
 * @param jspFile (required) the page source file where the tag is
 */
public JsfExpressionDescriptor(int lineNumber,String jspFile){
  this.tagLineNumber=lineNumber;
  this.jspFile=jspFile;
  this.expression="String_Node_Str";
}
Program: 83536
Project: 83536
Buggy source:
public void add(ValidationResult singleResult){
  addSingleResult(singleResult);
}

Fixed version (ground truth):
/** 
 * Add a single result to this collection.
 * @param singleResult (required)
 */
public void add(ValidationResult singleResult){
  addSingleResult(singleResult);
}
Program: 83537
Project: 83537
Buggy source:
public ResultsIterable<ExpressionRejectedByFilterResult> excluded(){
  return new ResultsIterable<ExpressionRejectedByFilterResult>(exclusions);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public ResultsIterable<ExpressionRejectedByFilterResult> excluded(){
  return new ResultsIterable<ExpressionRejectedByFilterResult>(exclusions);
}
Program: 83538
Project: 83538
Buggy source:
public Iterator<ValidationResult> iterator(){
  return results.iterator();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public Iterator<ValidationResult> iterator(){
  return results.iterator();
}
Program: 83539
Project: 83539
Buggy source:
public ResultsIterable<FailedValidationResult> failures(){
  return new ResultsIterable<FailedValidationResult>(failures);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public ResultsIterable<FailedValidationResult> failures(){
  return new ResultsIterable<FailedValidationResult>(failures);
}
Program: 83540
Project: 83540
Buggy source:
public void addAll(Collection<ValidationResult> allResults){
  for (  ValidationResult singleResult : allResults) {
    this.add(singleResult);
  }
}

Fixed version (ground truth):
/** 
 * Add all the results in the collection to this one.
 * @param allResults (required)
 */
public void addAll(Collection<ValidationResult> allResults){
  for (  ValidationResult singleResult : allResults) {
    this.add(singleResult);
  }
}
Program: 83541
Project: 83541
Buggy source:
protected void postAddSingleResult(ValidationResult singleResult){
}

Fixed version (ground truth):
/** 
 * Subclass hook - called after a single result has been added to this.
 * @param singleResult (required)
 */
protected void postAddSingleResult(ValidationResult singleResult){
}
Program: 83542
Project: 83542
Buggy source:
public ResultsIterable<SuccessfulValidationResult> goodResults(){
  return new ResultsIterable<SuccessfulValidationResult>(goodResults);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public ResultsIterable<SuccessfulValidationResult> goodResults(){
  return new ResultsIterable<SuccessfulValidationResult>(goodResults);
}
Program: 83543
Project: 83543
Buggy source:
public Iterator<T> iterator(){
  return results.iterator();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public Iterator<T> iterator(){
  return results.iterator();
}
Program: 83544
Project: 83544
Buggy source:
public int size(){
  return results.size();
}

Fixed version (ground truth):
/** 
 * Number of results in this iterable.
 * @return >= 0
 */
public int size(){
  return results.size();
}
Program: 83545
Project: 83545
Buggy source:
public SuccessfulValidationResult(Object expressionResult){
  this.expressionResult=expressionResult;
}

Fixed version (ground truth):
/** 
 * Result for EL expression whose evaluation produced the given value. In the context of the "fake" validating resolver this is usually a "fake value" of the expression's output type.
 * @param expressionResult (optional) result of evaluating the EL
 * @see net.jakubholy.jeeutils.jsfelcheck.validator.FakeValueFactory
 */
public SuccessfulValidationResult(Object expressionResult){
  this.expressionResult=expressionResult;
}
Program: 83546
Project: 83546
Buggy source:
/** 
 * The value produced by the resolved expression.
 */
public Object getExpressionResult(){
  return expressionResult;
}

Fixed version (ground truth):
/** 
 * @return the value produced by the resolved expression.
 */
public Object getExpressionResult(){
  return expressionResult;
}
Program: 83547
Project: 83547
Buggy source:
abstract public boolean hasErrors();

Fixed version (ground truth):
/** 
 * Were there errors or other problems when validating the expression?
 * @return true if the validation wasn't successful
 */
public abstract boolean hasErrors();
Program: 83548
Project: 83548
Buggy source:
public void add(String key,String value,String addedBy) throws IOException, ConfigurationException {
  DictionaryItem item=new DictionaryItem(value,addedBy,new Date().getTime());
  dictionary.addProperty(key,new JSONObject(item).toString().replaceAll("String_Node_Str","String_Node_Str"));
  dictionary.save();
}

Fixed version (ground truth):
public void add(String key,String value,String addedBy) throws IOException, ConfigurationException {
  DictionaryItem item=new DictionaryItem(value,addedBy,new Date().getTime());
  dictionary.addProperty(key.trim().toLowerCase(),new JSONObject(item).toString().replaceAll("String_Node_Str","String_Node_Str"));
  dictionary.save();
}
Program: 83549
Project: 83549
Buggy source:
@SuppressWarnings("String_Node_Str") public int getSize(){
  return new ArrayList<Object>((Collection<Object>)dictionary.getKeys()).size();
}

Fixed version (ground truth):
public int getSize(){
  Iterator<?> iterator=dictionary.getKeys();
  int i=0;
  while (iterator.hasNext()) {
    iterator.next();
    i++;
  }
  return i;
}
Program: 83550
Project: 83550
Buggy source:
public DictionaryItem get(String key){
  String jsonText=dictionary.getString(key);
  if (jsonText == null)   return null;
  try {
    JSONObject j=new JSONObject(jsonText.replaceAll("String_Node_Str","String_Node_Str"));
    return new DictionaryItem(j.getString("String_Node_Str"),j.getString("String_Node_Str"),j.getLong("String_Node_Str"));
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public DictionaryItem get(String key){
  key=key.trim().toLowerCase();
  String jsonText=dictionary.getString(key);
  if (jsonText == null)   return null;
  try {
    JSONObject j=new JSONObject(jsonText.replaceAll("String_Node_Str","String_Node_Str"));
    return new DictionaryItem(j.getString("String_Node_Str"),j.getString("String_Node_Str"),j.getLong("String_Node_Str"));
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 83551
Project: 83551
Buggy source:
public boolean has(String key){
  return dictionary.containsKey(key);
}

Fixed version (ground truth):
public boolean has(String key){
  return dictionary.containsKey(key.toLowerCase());
}
Program: 83552
Project: 83552
Buggy source:
public void remove(String key) throws IOException, ConfigurationException {
  dictionary.clearProperty(key);
  dictionary.save();
}

Fixed version (ground truth):
public void remove(String key) throws IOException, ConfigurationException {
  dictionary.clearProperty(key.toLowerCase());
  dictionary.save();
}
Program: 83553
Project: 83553
Buggy source:
private void add(String key,String value,String addedBy,Adapter adapter){
  try {
    Bot.dictionary.add(key,value,addedBy);
    adapter.send(key + "String_Node_Str" + value);
  }
 catch (  IOException e) {
    adapter.send("String_Node_Str");
    e.printStackTrace();
  }
catch (  ConfigurationException e) {
    adapter.send("String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void add(String key,String value,String addedBy,Adapter adapter){
  try {
    Bot.dictionary.add(key,value,addedBy);
    adapter.send(key.toLowerCase() + "String_Node_Str" + value);
  }
 catch (  IOException e) {
    adapter.send("String_Node_Str");
    e.printStackTrace();
  }
catch (  ConfigurationException e) {
    adapter.send("String_Node_Str");
    e.printStackTrace();
  }
}
Program: 83554
Project: 83554
Buggy source:
@Override public void process(String sender,String args,Adapter adapter){
  String[] argsArr=args.trim().split("String_Node_Str",2);
  if (argsArr.length < 2) {
    adapter.send(getHelpText());
    return;
  }
  if (Bot.dictionary.has(argsArr[0])) {
    adapter.send("String_Node_Str" + argsArr[0] + "String_Node_Str");
    return;
  }
  if (args.indexOf(REPLY_TAG) > 0) {
    int replyTagEndIndex=args.indexOf(REPLY_TAG) + REPLY_TAG.length();
    add(argsArr[0],args.substring(replyTagEndIndex).trim(),sender,adapter);
    return;
  }
  add(argsArr[0],args,sender,adapter);
}

Fixed version (ground truth):
@Override public void process(String sender,String args,Adapter adapter){
  String[] argsArr=args.trim().split("String_Node_Str",2);
  if (argsArr.length < 2) {
    adapter.send(getHelpText());
    return;
  }
  if (Bot.dictionary.has(argsArr[0])) {
    adapter.send("String_Node_Str" + argsArr[0] + "String_Node_Str");
    return;
  }
  if (args.indexOf(REPLY_TAG) > 0) {
    int replyTagEndIndex=args.indexOf(REPLY_TAG) + REPLY_TAG.length();
    add(argsArr[0],args.substring(replyTagEndIndex).trim(),sender,adapter);
    return;
  }
  add(argsArr[0].replace(':',' ').trim(),args,sender,adapter);
}
Program: 83555
Project: 83555
Buggy source:
@Override public void process(String sender,String args,Adapter adapter){
  String target=args.split("String_Node_Str",2)[0];
  if (target.isEmpty())   return;
  if (adapter.getAuthLevel(target).compareTo(Authorization.ADMIN) >= 0)   adapter.send(sender + "String_Node_Str");
 else   if (sender.equals(target)) {
    adapter.send(target + "String_Node_Str");
    adapter.revokeVoice(target);
  }
 else   if (adapter.isSuperior(target,sender,false))   adapter.send("String_Node_Str" + sender + "String_Node_Str");
 else   adapter.revokeVoice(target);
  System.out.println("String_Node_Str" + sender + "String_Node_Str"+ target);
  adapter.revokeVoice(target);
}

Fixed version (ground truth):
@Override public void process(String sender,String args,Adapter adapter){
  String target=args.split("String_Node_Str",2)[0];
  if (target.isEmpty())   return;
  System.out.println("String_Node_Str" + sender + "String_Node_Str"+ target);
  if (adapter.getAuthLevel(target).compareTo(Authorization.ADMIN) >= 0) {
    adapter.send(sender + "String_Node_Str");
    return;
  }
  if (sender.equals(target)) {
    adapter.send(target + "String_Node_Str");
    adapter.revokeVoice(target);
    return;
  }
  if (adapter.isSuperior(target,sender,false)) {
    adapter.send("String_Node_Str" + sender + "String_Node_Str");
    return;
  }
  adapter.revokeVoice(target);
}
Program: 83559
Project: 83559
Buggy source:
@SuppressWarnings("String_Node_Str") public void onCreate(){
  super.onCreate();
  powermanager=(PowerManager)this.getSystemService(Context.POWER_SERVICE);
  wifimanager=(WifiManager)getSystemService(Context.WIFI_SERVICE);
  wakelockcall=this.powermanager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"String_Node_Str");
  wakelockota=this.powermanager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"String_Node_Str");
  wifilockota=wifimanager.createWifiLock("String_Node_Str");
  LiquidSettings.runRootCommand("String_Node_Str");
  prefs=PreferenceManager.getDefaultSharedPreferences(this);
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  filter.addAction(Intent.ACTION_SCREEN_ON);
  filter.addAction("String_Node_Str");
  this.registerReceiver(mIntentReceiver,filter,null,mHandler);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onCreate(){
  super.onCreate();
  myactivity=this;
  mNotificationManager=(NotificationManager)myactivity.getSystemService(Context.NOTIFICATION_SERVICE);
  powermanager=(PowerManager)this.getSystemService(Context.POWER_SERVICE);
  wifimanager=(WifiManager)getSystemService(Context.WIFI_SERVICE);
  wakelockcall=this.powermanager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"String_Node_Str");
  wakelockota=this.powermanager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"String_Node_Str");
  wifilockota=wifimanager.createWifiLock("String_Node_Str");
  LiquidSettings.runRootCommand("String_Node_Str");
  prefs=PreferenceManager.getDefaultSharedPreferences(this);
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  filter.addAction(Intent.ACTION_SCREEN_ON);
  filter.addAction("String_Node_Str");
  this.registerReceiver(mIntentReceiver,filter,null,mHandler);
}
Program: 83560
Project: 83560
Buggy source:
public static void startcall(){
  call=true;
  try {
    wakelockcall.acquire();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void startcall(){
  call=true;
  try {
    wakelockcall.acquire();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  String tickerText="String_Node_Str";
  Notification mNotification=new Notification(android.R.drawable.stat_sys_warning,tickerText,System.currentTimeMillis());
  Intent intent;
  intent=new Intent();
  PendingIntent mContentIntent=PendingIntent.getActivity(myactivity,0,intent,0);
  RemoteViews contentView=new RemoteViews(myactivity.getPackageName(),R.layout.notification_custom_layout);
  contentView.setImageViewResource(R.id.notification_layout_image,R.drawable.icon);
  contentView.setTextViewText(R.id.notification_layout_text1,"String_Node_Str");
  contentView.setTextViewText(R.id.notification_layout_text2,"String_Node_Str");
  mNotification.contentView=contentView;
  mNotification.contentIntent=mContentIntent;
  mNotification.flags=Notification.FLAG_ONGOING_EVENT;
  mNotificationManager.notify(7,mNotification);
}
Program: 83561
Project: 83561
Buggy source:
public static void stopcall(){
  call=false;
  try {
    wakelockcall.release();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void stopcall(){
  call=false;
  try {
    wakelockcall.release();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  try {
    mNotificationManager.cancel(7);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 83563
Project: 83563
Buggy source:
public boolean onPreferenceClick(Preference preference){
  Editor editor=prefs.edit();
  editor.putBoolean("String_Node_Str",true);
  editor.commit();
  new StartSystem().startsystem(myactivity);
  return true;
}

Fixed version (ground truth):
public boolean onPreferenceClick(Preference preference){
  LSystem.RemountRW();
  LiquidSettings.runRootCommand("String_Node_Str");
  LiquidSettings.runRootCommand("String_Node_Str");
  LiquidSettings.runRootCommand("String_Node_Str");
  LiquidSettings.runRootCommand("String_Node_Str");
  LiquidSettings.runRootCommand("String_Node_Str");
  LSystem.RemountROnly();
  Editor editor=prefs.edit();
  editor.putBoolean("String_Node_Str",true);
  editor.commit();
  new StartSystem().startsystem(myactivity);
  return true;
}
Program: 83564
Project: 83564
Buggy source:
@Override public boolean onPreferenceChange(Preference preference,Object newValue){
  NetworkMode.switchnetworkmode(myactivity);
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreferenceChange(Preference preference,Object newValue){
  Editor editor=prefs.edit();
  editor.putString("String_Node_Str",newValue.toString());
  editor.commit();
  NetworkMode.switchnetworkmode(myactivity);
  return true;
}
Program: 83566
Project: 83566
Buggy source:
public LRBlockData(int id,byte data,Direction dir,boolean saving){
  this.id=id;
  this.data=data;
  this.dir=dir;
  if (saving) {
    return;
  }
 else {
    setPlaceDirection();
  }
}

Fixed version (ground truth):
public LRBlockData(int id,byte data,Direction dir,boolean saving){
  this.id=id;
  this.data=data;
  this.dir=dir;
  if (!saving) {
    setPlaceDirection();
  }
}