nus-yam/ex-repair huggingface dataset:
Program: 88708
Project: 88708
Buggy source:
protected static DgEnvironmentFactory setupEnvironment(){
  DgEnvironmentFactory.reset();
  envFactory=new DgEnvironmentFactory();
  if (useCachedOps && !Utils2.isNullOrEmpty(opsCache)) {
    envFactory.getDgEnvironment().operations=opsCache;
  }
 else {
    addRegexMatchOperation(envFactory);
    addROperation(envFactory);
    addMOperation(envFactory);
    addTOperation(envFactory);
    addSOperation(envFactory);
    addNOperation(envFactory);
    addExpressionOperations(envFactory);
    opsCache=envFactory.getDgEnvironment().operations;
  }
  return envFactory;
}

Fixed version (ground truth):
protected static DgEnvironmentFactory setupEnvironment(){
  DgEnvironmentFactory.reset();
  envFactory=new DgEnvironmentFactory();
  if (useCachedOps && !Utils2.isNullOrEmpty(opsCache)) {
    envFactory.getDgEnvironment().operations.addAll(opsCache);
  }
 else {
    addRegexMatchOperation(envFactory);
    addROperation(envFactory);
    addMOperation(envFactory);
    addTOperation(envFactory);
    addSOperation(envFactory);
    addNOperation(envFactory);
    addExpressionOperations(envFactory);
    opsCache=envFactory.getDgEnvironment().operations;
  }
  return envFactory;
}
Program: 88709
Project: 88709
Buggy source:
/** 
 * Collect all objects of type Element in each of the results of evaluating the query expression on each of the elements.
 * @param elements contexts for evaluating the expression
 * @param cba the collect action containing the expression
 * @return a List of Elements
 */
public static List<Element> collectByExpression(List<Element> elements,String query,boolean iterate){
  List<Element> res=new ArrayList<Element>();
  if (iterate)   res.addAll(collectByExpression(elements,query));
 else {
    for (    Element e : elements) {
      res.addAll(collectByExpression(e,query));
    }
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Collect all objects of type Element in each of the results of evaluating the query expression on each of the elements.
 * @param elements contexts for evaluating the expression
 * @param cba the collect action containing the expression
 * @return a List of Elements
 */
public static List<Element> collectByExpression(List<Element> elements,String query,boolean iterate){
  List<Element> res=new ArrayList<Element>();
  if (!iterate)   res.addAll(collectByExpression(elements,query));
 else {
    for (    Element e : elements) {
      res.addAll(collectByExpression(e,query));
    }
  }
  return res;
}
Program: 88710
Project: 88710
Buggy source:
/** 
 * Utility for adding custom OCL operations (defined by a DgOperation)
 * @param dgOperation
 */
public void addDgOperation(DgOperation dgOperation){
  if (!operations.contains(dgOperation)) {
    EOperation eoperation=EcoreFactory.eINSTANCE.createEOperation();
    eoperation.setName(dgOperation.getName());
    EClassifier type=dgOperation.getReturnType();
    if (type == null)     type=OCLStandardLibraryImpl.INSTANCE.getOclAny();
    eoperation.setEType(type);
    for (    EParameter parm : dgOperation.getParameters()) {
      eoperation.getEParameters().add(parm);
    }
    EAnnotation annotation=EcoreFactory.eINSTANCE.createEAnnotation();
    annotation.setSource(dgOperation.getAnnotationName());
    eoperation.getEAnnotations().add(annotation);
    type=dgOperation.getCallerType();
    if (type == null)     type=OCLStandardLibraryImpl.INSTANCE.getOclAny();
    try {
      addHelperOperation(dgOperation.getCallerType(),eoperation);
      operationNames.add(dgOperation.getName());
      operations.add(dgOperation);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Utility for adding custom OCL operations (defined by a DgOperation)
 * @param dgOperation
 */
public void addDgOperation(DgOperation dgOperation){
  if (!operations.contains(dgOperation)) {
    EOperation eoperation=EcoreFactory.eINSTANCE.createEOperation();
    eoperation.setName(dgOperation.getName());
    EClassifier type=dgOperation.getReturnType();
    if (type == null)     type=OCLStandardLibraryImpl.INSTANCE.getOclAny();
    eoperation.setEType(type);
    for (    EParameter parm : dgOperation.getParameters()) {
      eoperation.getEParameters().add(parm);
    }
    EAnnotation annotation=EcoreFactory.eINSTANCE.createEAnnotation();
    annotation.setSource(dgOperation.getAnnotationName());
    eoperation.getEAnnotations().add(annotation);
    type=dgOperation.getCallerType();
    if (type == null)     type=OCLStandardLibraryImpl.INSTANCE.getOclAny();
    try {
      if (dgOperation.getCallerType() == null) {
        Debug.error(false,"String_Node_Str" + dgOperation + "String_Node_Str");
        dgOperation.setCallerType(OCLStandardLibraryImpl.INSTANCE.getOclAny());
      }
      addHelperOperation(dgOperation.getCallerType(),eoperation);
      operationNames.add(dgOperation.getName());
      operations.add(dgOperation);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 88711
Project: 88711
Buggy source:
public void addStringParameter(EParameter parameter){
  addParameter(parameter,OCLStandardLibraryImpl.INSTANCE.getString());
  this.parameters.add(parameter);
}

Fixed version (ground truth):
public void addStringParameter(EParameter parameter){
  addParameter(parameter,OCLStandardLibraryImpl.INSTANCE.getString());
}
Program: 88712
Project: 88712
Buggy source:
public void setCallerType(EClassifier callerType){
  this.callerType=callerType;
}

Fixed version (ground truth):
@Override public void setCallerType(EClassifier callerType){
  this.callerType=callerType;
}
Program: 88713
Project: 88713
Buggy source:
public void setReturnType(EClassifier returnType){
  this.returnType=returnType;
}

Fixed version (ground truth):
@Override public void setReturnType(EClassifier returnType){
  this.returnType=returnType;
}
Program: 88714
Project: 88714
Buggy source:
protected static void addRegexMatchOperation(DgEnvironmentFactory envFactory){
  DgOperationInstance doi=new DgOperationInstance();
  doi.setName("String_Node_Str");
  doi.setAnnotationName("String_Node_Str");
  EParameter parm=EcoreFactory.eINSTANCE.createEParameter();
  parm.setName("String_Node_Str");
  doi.addParameter(parm);
  doi.setOperation(new CallOperation(){
    @Override public Object callOperation(    Object source,    Object[] args){
      Pattern pattern=Pattern.compile((String)args[0]);
      Matcher matcher=pattern.matcher((String)source);
      return matcher.matches() ? matcher.group() : null;
    }
  }
);
  envFactory.getDgEnvironment().addDgOperation(doi);
  envFactory.getDgEvaluationEnvironment().addDgOperation(doi);
}

Fixed version (ground truth):
protected static void addRegexMatchOperation(DgEnvironmentFactory envFactory){
  DgOperationInstance doi=new DgOperationInstance();
  doi.setName("String_Node_Str");
  doi.setAnnotationName("String_Node_Str");
  EParameter parm=EcoreFactory.eINSTANCE.createEParameter();
  parm.setName("String_Node_Str");
  parm.setEType(OCLStandardLibraryImpl.INSTANCE.getString());
  doi.addStringParameter(parm);
  doi.setCallerType(OCLStandardLibraryImpl.INSTANCE.getString());
  doi.setReturnType(OCLStandardLibraryImpl.INSTANCE.getString());
  doi.setOperation(new CallOperation(){
    @Override public Object callOperation(    Object source,    Object[] args){
      Pattern pattern=Pattern.compile((String)args[0]);
      Matcher matcher=pattern.matcher((String)source);
      return matcher.matches() ? matcher.group() : null;
    }
  }
);
  envFactory.getDgEnvironment().addDgOperation(doi);
  envFactory.getDgEvaluationEnvironment().addDgOperation(doi);
}
Program: 88715
Project: 88715
Buggy source:
protected static DgEnvironmentFactory setupEnvironment(){
  DgEnvironmentFactory.reset();
  envFactory=new DgEnvironmentFactory();
  addROperation(envFactory);
  addMOperation(envFactory);
  addTOperation(envFactory);
  addSOperation(envFactory);
  addNOperation(envFactory);
  return envFactory;
}

Fixed version (ground truth):
protected static DgEnvironmentFactory setupEnvironment(){
  DgEnvironmentFactory.reset();
  envFactory=new DgEnvironmentFactory();
  addRegexMatchOperation(envFactory);
  addROperation(envFactory);
  addMOperation(envFactory);
  addTOperation(envFactory);
  addSOperation(envFactory);
  addNOperation(envFactory);
  return envFactory;
}
Program: 88716
Project: 88716
Buggy source:
public static List<Package> getPackagesOfType(Package root,String typeName,Set<Element> seen){
  if (root == null)   return null;
  Pair<Boolean,Set<Element>> p=Utils2.seen(root,true,seen);
  if (p.first)   return Utils2.getEmptyList();
  seen=p.second;
  List<Package> pkgs=new ArrayList<Package>();
  if (isTypeOf(root,typeName)) {
    pkgs.add(root);
  }
  if (root.getNestedPackage() != null) {
    for (    Package pkg : root.getNestedPackage()) {
      pkgs.addAll(getPackagesOfType(pkg,typeName,seen));
    }
  }
  return pkgs;
}

Fixed version (ground truth):
/** 
 * @param root top-level Package
 * @param typeName the name or regular expression pattern of the type name on which to filter collected packages; this type name could be a stereotype, EClass, or Java class name
 * @param seen a set of already visited Elements to avoid revisiting them in infinite cycles
 * @return all Packages, including root, top-level Packages within root, andtheir nested packages, that also have a type matching typeName (exactly or as a pattern)
 */
public static List<Package> getPackagesOfType(Package root,String typeName,Set<Element> seen){
  if (root == null)   return null;
  Pair<Boolean,Set<Element>> p=Utils2.seen(root,true,seen);
  if (p.first)   return Utils2.getEmptyList();
  seen=p.second;
  List<Package> pkgs=new ArrayList<Package>();
  if (isTypeOf(root,typeName)) {
    pkgs.add(root);
  }
  if (root.getNestedPackage() != null) {
    for (    Package pkg : root.getNestedPackage()) {
      pkgs.addAll(getPackagesOfType(pkg,typeName,seen));
    }
  }
  return pkgs;
}
Program: 88717
Project: 88717
Buggy source:
public static boolean isTypeOf(Object o,String typeName){
  GetCallOperation op=new GetCallOperation(CallReturnType.TYPE,true,true);
  Object result=op.callOperation(o,new Object[]{typeName});
  return EmfUtils.matches(result,typeName);
}

Fixed version (ground truth):
/** 
 * @param object the object to test for a match
 * @param typeName regular expression String according to Pattern
 * @return whether the name of the object's Stereotype, EClass, or Javaclass matches the typeName regular expression pattern
 */
public static boolean isTypeOf(Object object,String typeName){
  GetCallOperation op=new GetCallOperation(CallReturnType.TYPE,true,true);
  Object result=op.callOperation(object,new Object[]{typeName});
  if (result instanceof Collection && ((Collection<?>)result).size() == 1) {
    if (matches(((Collection<?>)result).iterator().next(),typeName))     return true;
  }
  return matches(result,typeName);
}
Program: 88718
Project: 88718
Buggy source:
@Override public Object callOperation(Object source,Object[] args){
  Object result=null;
  try {
    result=evaluateQueryNoSetup(source,expression,isVerboseDefault());
  }
 catch (  Throwable e) {
  }
  return result;
}

Fixed version (ground truth):
@Override public Object callOperation(Object source,Object[] args){
  Object result=null;
  try {
    result=evaluateQuery(source,expression,isVerboseDefault());
  }
 catch (  Throwable e) {
    Debug.error(true,false,e.getLocalizedMessage());
  }
  return result;
}
Program: 88719
Project: 88719
Buggy source:
protected static void addExpressionOperation(final String opName,final String expression,DgEnvironmentFactory envFactory){
  DgOperationInstance doi=new DgOperationInstance();
  doi.setName(opName);
  doi.setAnnotationName("String_Node_Str");
  doi.setCallerType(OCLStandardLibraryImpl.INSTANCE.getOclAny());
  doi.setReturnType(OCLStandardLibraryImpl.INSTANCE.getOclAny());
  doi.setOperation(new CallOperation(){
    @Override public Object callOperation(    Object source,    Object[] args){
      Object result=null;
      try {
        result=evaluateQueryNoSetup(source,expression,isVerboseDefault());
      }
 catch (      Throwable e) {
      }
      return result;
    }
  }
);
  envFactory.getDgEnvironment().addDgOperation(doi);
  envFactory.getDgEvaluationEnvironment().addDgOperation(doi);
}

Fixed version (ground truth):
protected static void addExpressionOperation(final String opName,final String expression,DgEnvironmentFactory envFactory){
  DgOperationInstance doi=new DgOperationInstance();
  doi.setName(opName);
  doi.setAnnotationName("String_Node_Str");
  doi.setCallerType(OCLStandardLibraryImpl.INSTANCE.getOclAny());
  doi.setReturnType(OCLStandardLibraryImpl.INSTANCE.getOclAny());
  doi.setOperation(new CallOperation(){
    @Override public Object callOperation(    Object source,    Object[] args){
      Object result=null;
      try {
        result=evaluateQuery(source,expression,isVerboseDefault());
      }
 catch (      Throwable e) {
        Debug.error(true,false,e.getLocalizedMessage());
      }
      return result;
    }
  }
);
  envFactory.getDgEnvironment().addDgOperation(doi);
  envFactory.getDgEvaluationEnvironment().addDgOperation(doi);
}
Program: 88720
Project: 88720
Buggy source:
/** 
 * Find Expressions in ExpressionLibraries and add them as blackbox shortcuts.
 * @param envFactory
 */
protected static void addExpressionOperations(DgEnvironmentFactory envFactory){
  ArrayList<Element> expressions=new ArrayList<Element>();
  List<Package> pkgs=Utils.getPackagesOfType(DocGen3Profile.expressionLibrary);
  Stereotype exprStereotype=Utils.getStereotype(DocGen3Profile.expressionChoosable);
  for (  Package pkg : pkgs) {
    List<Element> owned=Utils.collectOwnedElements(pkg,0);
    List<Element> moreExprs=Utils.filterElementsByStereotype(owned,exprStereotype,true,true);
    expressions.addAll(moreExprs);
  }
  for (  Element expr : expressions) {
    String name=Utils.getName(expr);
    String exprString=queryElementToStringExpression(expr);
    String errorMsg=checkParsable(exprString);
    if (!Utils2.isNullOrEmpty(name) && errorMsg == null)     try {
      addExpressionOperation(name,exprString,envFactory);
    }
 catch (    Throwable e) {
      errorMsg=e.getLocalizedMessage();
    }
    if (errorMsg != null) {
      Debug.error(true,false,"String_Node_Str" + name + "String_Node_Str"+ exprString+ "String_Node_Str"+ errorMsg);
    }
  }
}

Fixed version (ground truth):
/** 
 * Find Expressions in ExpressionLibraries and add them as blackbox shortcuts.
 * @param envFactory
 */
protected static void addExpressionOperations(DgEnvironmentFactory envFactory){
  ArrayList<Element> expressions=new ArrayList<Element>();
  List<Package> pkgs=Utils.getPackagesOfType(DocGen3Profile.expressionLibrary);
  Stereotype exprStereotype=Utils.getStereotype(DocGen3Profile.expressionChoosable);
  for (  Package pkg : pkgs) {
    List<Element> owned=Utils.collectOwnedElements(pkg,0);
    List<Element> moreExprs=Utils.filterElementsByStereotype(owned,exprStereotype,true,true);
    expressions.addAll(moreExprs);
  }
  for (  Element expr : expressions) {
    String name=Utils.getName(expr);
    String exprString=queryElementToStringExpression(expr);
    String errorMsg=null;
    if (!Utils2.isNullOrEmpty(name) && errorMsg == null)     try {
      addExpressionOperation(name,exprString,envFactory);
    }
 catch (    Throwable e) {
      errorMsg=e.getLocalizedMessage();
    }
    if (errorMsg != null) {
      Debug.error(true,false,"String_Node_Str" + name + "String_Node_Str"+ exprString+ "String_Node_Str"+ errorMsg);
    }
  }
}
Program: 88721
Project: 88721
Buggy source:
public static void outln(String s){
  log(s,true,false);
}

Fixed version (ground truth):
public static void outln(String s){
  MdDebug.log(s,true,false);
}
Program: 88722
Project: 88722
Buggy source:
public static void errln(String s){
  log(s,true,true,Color.RED);
}

Fixed version (ground truth):
public static void errln(String s){
  MdDebug.log(s,true,true,Color.RED);
}
Program: 88723
Project: 88723
Buggy source:
public static synchronized void turnOn(){
  on=true;
  gl=getGuiLog();
}

Fixed version (ground truth):
public static synchronized void turnOn(){
  on=true;
  MdDebug.gl=MdDebug.getGuiLog();
}
Program: 88724
Project: 88724
Buggy source:
public static void err(String s){
  log(s,false,true);
}

Fixed version (ground truth):
public static void err(String s){
  MdDebug.log(s,false,true);
}
Program: 88725
Project: 88725
Buggy source:
public static void out(String s){
  log(s,false,false);
}

Fixed version (ground truth):
public static void out(String s){
  MdDebug.log(s,false,false);
}
Program: 88726
Project: 88726
Buggy source:
public static <T1 extends Comparable<T1>,T2 extends Comparable<T2>,T3 extends Comparable<T3>,T4>T4 put(Map<T1,Map<T2,Map<T3,T4>>> map,T1 t1,T2 t2,T3 t3,T4 t4){
  if (Debug.errorOnNull("String_Node_Str",map,t1,t2,t3,t4)) {
    return null;
  }
  Map<T2,Map<T3,T4>> innerMap=map.get(t1);
  if (innerMap == null) {
    innerMap=new TreeMap<T2,Map<T3,T4>>();
    map.put(t1,innerMap);
  }
  return put(innerMap,t2,t3,t4);
}

Fixed version (ground truth):
public static <T1,T2,T3,T4>T4 put(Map<T1,Map<T2,Map<T3,T4>>> map,T1 t1,T2 t2,T3 t3,T4 t4){
  if (Debug.errorOnNull("String_Node_Str",map,t1,t2,t3,t4)) {
    return null;
  }
  Map<T2,Map<T3,T4>> innerMap=map.get(t1);
  if (innerMap == null) {
    innerMap=new TreeMap<T2,Map<T3,T4>>(CompareUtils.GenericComparator.instance());
    map.put(t1,innerMap);
  }
  return put(innerMap,t2,t3,t4);
}
Program: 88727
Project: 88727
Buggy source:
public static <T1 extends Comparable<T1>,T2 extends Comparable<T2>,T3 extends Comparable<T3>,T4>T4 get(Map<T1,Map<T2,Map<T3,T4>>> map,T1 t1,T2 t2,T3 t3){
  if (Debug.errorOnNull("String_Node_Str",map,t1,t2,t3)) {
    return null;
  }
  Map<T2,Map<T3,T4>> innerMap=map.get(t1);
  if (innerMap != null) {
    return get(innerMap,t2,t3);
  }
  return null;
}

Fixed version (ground truth):
public static <T1,T2,T3,T4>T4 get(Map<T1,Map<T2,Map<T3,T4>>> map,T1 t1,T2 t2,T3 t3){
  if (Debug.errorOnNull("String_Node_Str",map,t1,t2,t3)) {
    return null;
  }
  Map<T2,Map<T3,T4>> innerMap=map.get(t1);
  if (innerMap != null) {
    return get(innerMap,t2,t3);
  }
  return null;
}
Program: 88728
Project: 88728
Buggy source:
public void actionPerformed(ActionEvent e){
  GUILog gl=Application.getInstance().getGUILog();
  GetMethod gm=null;
  try {
    String response=null;
    Boolean recurse=Utils.getUserYesNoAnswer("String_Node_Str");
    if (recurse == null)     return;
    String url=ViewEditUtils.getUrl();
    if (url == null)     return;
    gl.log("String_Node_Str");
    DocumentValidator dv=new DocumentValidator(doc);
    dv.validateDocument();
    if (dv.isFatal()) {
      dv.printErrors();
      return;
    }
    DocumentGenerator dg=new DocumentGenerator(doc,dv,null);
    Document dge=dg.parseDocument(true,recurse);
    dv.printErrors();
    (new PostProcessor()).process(dge);
    ProgressStatusRunner.runWithProgressStatus(new ViewExporter(dge,doc,recurse,true,url),"String_Node_Str",true,0);
  }
 catch (  Exception ex) {
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    ex.printStackTrace(pw);
    gl.log(sw.toString());
    ex.printStackTrace();
  }
 finally {
    if (gm != null)     gm.releaseConnection();
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  GUILog gl=Application.getInstance().getGUILog();
  GetMethod gm=null;
  DocumentValidator dv=null;
  try {
    String response=null;
    Boolean recurse=Utils.getUserYesNoAnswer("String_Node_Str");
    if (recurse == null)     return;
    String url=ViewEditUtils.getUrl();
    if (url == null)     return;
    gl.log("String_Node_Str");
    dv=new DocumentValidator(doc);
    dv.validateDocument();
    if (dv.isFatal()) {
      dv.printErrors();
      return;
    }
    DocumentGenerator dg=new DocumentGenerator(doc,dv,null);
    Document dge=dg.parseDocument(true,recurse);
    (new PostProcessor()).process(dge);
    ProgressStatusRunner.runWithProgressStatus(new ViewExporter(dge,doc,recurse,true,url),"String_Node_Str",true,0);
  }
 catch (  Exception ex) {
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    ex.printStackTrace(pw);
    gl.log(sw.toString());
    ex.printStackTrace();
  }
 finally {
    if (gm != null)     gm.releaseConnection();
    if (dv != null)     dv.printErrors();
  }
}
Program: 88730
Project: 88730
Buggy source:
public void actionPerformed(ActionEvent e){
  GUILog gl=Application.getInstance().getGUILog();
  PostMethod pm=null;
  try {
    DocumentValidator dv=new DocumentValidator(doc);
    dv.validateDocument();
    if (dv.isFatal()) {
      dv.printErrors();
      return;
    }
    DocumentGenerator dg=new DocumentGenerator(doc,dv,null);
    Document dge=dg.parseDocument(true,true);
    dv.printErrors();
    ViewHierarchyVisitor vhv=new ViewHierarchyVisitor();
    dge.accept(vhv);
    String post=vhv.getResult().toJSONString();
    String url=ViewEditUtils.getUrl();
    if (url == null)     return;
    gl.log("String_Node_Str");
    String posturl=url + "String_Node_Str" + doc.getID()+ "String_Node_Str";
    pm=new PostMethod(posturl);
    pm.setRequestHeader("String_Node_Str","String_Node_Str");
    pm.setRequestEntity(JsonRequestEntity.create(post));
    HttpClient client=new HttpClient();
    ViewEditUtils.setCredentials(client);
    gl.log("String_Node_Str");
    client.executeMethod(pm);
    String response=pm.getResponseBodyAsString();
    if (response.equals("String_Node_Str"))     gl.log("String_Node_Str");
 else     gl.log(response);
  }
 catch (  Exception ex) {
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    ex.printStackTrace(pw);
    gl.log(sw.toString());
    ex.printStackTrace();
  }
 finally {
    if (pm != null)     pm.releaseConnection();
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  GUILog gl=Application.getInstance().getGUILog();
  PostMethod pm=null;
  DocumentValidator dv=null;
  try {
    dv=new DocumentValidator(doc);
    dv.validateDocument();
    if (dv.isFatal()) {
      dv.printErrors();
      return;
    }
    DocumentGenerator dg=new DocumentGenerator(doc,dv,null);
    Document dge=dg.parseDocument(true,true);
    dv.printErrors();
    ViewHierarchyVisitor vhv=new ViewHierarchyVisitor();
    dge.accept(vhv);
    String post=vhv.getResult().toJSONString();
    String url=ViewEditUtils.getUrl();
    if (url == null) {
      dv.printErrors();
      return;
    }
    gl.log("String_Node_Str");
    String posturl=url + "String_Node_Str" + doc.getID()+ "String_Node_Str";
    pm=new PostMethod(posturl);
    pm.setRequestHeader("String_Node_Str","String_Node_Str");
    pm.setRequestEntity(JsonRequestEntity.create(post));
    HttpClient client=new HttpClient();
    ViewEditUtils.setCredentials(client);
    gl.log("String_Node_Str");
    client.executeMethod(pm);
    String response=pm.getResponseBodyAsString();
    if (response.equals("String_Node_Str"))     gl.log("String_Node_Str");
 else     gl.log(response);
  }
 catch (  Exception ex) {
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    ex.printStackTrace(pw);
    gl.log(sw.toString());
    ex.printStackTrace();
  }
 finally {
    if (pm != null)     pm.releaseConnection();
  }
  if (dv != null)   dv.printErrors();
}
Program: 88731
Project: 88731
Buggy source:
public void actionPerformed(ActionEvent e){
  GUILog gl=Application.getInstance().getGUILog();
  try {
    DocumentValidator dv=new DocumentValidator(doc);
    dv.validateDocument();
    if (dv.isFatal()) {
      dv.printErrors();
      return;
    }
    DocumentGenerator dg=new DocumentGenerator(doc,dv,null);
    Document dge=dg.parseDocument();
    dv.printErrors();
    boolean genNewImage=dge.getGenNewImage();
    (new PostProcessor()).process(dge);
    JFileChooser choose=new JFileChooser();
    choose.setDialogTitle("String_Node_Str");
    int retval=choose.showSaveDialog(null);
    if (retval == JFileChooser.APPROVE_OPTION) {
      if (choose.getSelectedFile() != null) {
        File savefile=choose.getSelectedFile();
        String userName=savefile.getName();
        String filename=userName;
        if (userName.length() < 4 || !userName.endsWith("String_Node_Str"))         filename=userName + "String_Node_Str";
        File dir=savefile.getParentFile();
        File realfile=new File(dir,filename);
        ProgressStatusRunner.runWithProgressStatus(new DocumentWriter(dge,realfile,genNewImage,dir),"String_Node_Str",true,0);
      }
    }
  }
 catch (  Exception ex) {
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    ex.printStackTrace(pw);
    gl.log(sw.toString());
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  GUILog gl=Application.getInstance().getGUILog();
  DocumentValidator dv=new DocumentValidator(doc);
  try {
    dv.validateDocument();
    if (dv.isFatal()) {
      dv.printErrors();
      return;
    }
    DocumentGenerator dg=new DocumentGenerator(doc,dv,null);
    Document dge=dg.parseDocument();
    boolean genNewImage=dge.getGenNewImage();
    (new PostProcessor()).process(dge);
    JFileChooser choose=new JFileChooser();
    choose.setDialogTitle("String_Node_Str");
    int retval=choose.showSaveDialog(null);
    if (retval == JFileChooser.APPROVE_OPTION) {
      if (choose.getSelectedFile() != null) {
        File savefile=choose.getSelectedFile();
        String userName=savefile.getName();
        String filename=userName;
        if (userName.length() < 4 || !userName.endsWith("String_Node_Str"))         filename=userName + "String_Node_Str";
        File dir=savefile.getParentFile();
        File realfile=new File(dir,filename);
        ProgressStatusRunner.runWithProgressStatus(new DocumentWriter(dge,realfile,genNewImage,dir),"String_Node_Str",true,0);
      }
    }
  }
 catch (  Exception ex) {
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    ex.printStackTrace(pw);
    gl.log(sw.toString());
    ex.printStackTrace();
  }
  dv.printErrors();
}
Program: 88732
Project: 88732
Buggy source:
@Override public void windowOpened(WindowEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  if (e.getComponent() instanceof Dialog) {
    if (!((Dialog)e.getComponent()).isResizable()) {
      ((Dialog)e.getComponent()).setResizable(true);
    }
  }
}

Fixed version (ground truth):
@Override public void windowOpened(WindowEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Dialog d=getDialog(e);
  if (d != null) {
    if (!d.isResizable()) {
      d.setResizable(true);
    }
  }
}
Program: 88733
Project: 88733
Buggy source:
public void show(){
  try {
    SwingUtilities.invokeLater(this);
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
}

Fixed version (ground truth):
public void show(){
  try {
    SwingUtilities.invokeLater(this);
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
  Window w=RequestFocusListener.getWindow(editableListPanel);
  if (RequestFocusListener.locationOnClose != null)   w.setLocation(RequestFocusListener.locationOnClose);
 else   w.setLocation(1000,1000);
  if (RequestFocusListener.sizeOnClose != null)   w.setSize(RequestFocusListener.sizeOnClose);
 else   w.setLocation(1000,1000);
  if (w instanceof Dialog)   ((Dialog)w).setResizable(true);
  Debug.outln("String_Node_Str" + w);
}
Program: 88734
Project: 88734
Buggy source:
@Override public void componentResized(ComponentEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  size=e.getComponent().getSize();
  location=e.getComponent().getLocation();
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
}

Fixed version (ground truth):
@Override public void componentResized(ComponentEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Window w=RequestFocusListener.getWindow(e.getComponent());
  size=w.getSize();
  location=w.getLocation();
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Debug.outln("String_Node_Str" + w);
  Debug.outln("String_Node_Str" + w);
}
Program: 88735
Project: 88735
Buggy source:
@Override public void windowClosing(WindowEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  size=e.getComponent().getSize();
  location=e.getComponent().getLocation();
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
}

Fixed version (ground truth):
@Override public void windowClosing(WindowEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Window w=RequestFocusListener.getWindow(e.getComponent());
  size=w.getSize();
  location=w.getLocation();
  locationOnClose=location;
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Debug.outln("String_Node_Str" + w);
  Debug.outln("String_Node_Str" + w);
}
Program: 88736
Project: 88736
Buggy source:
@Override public void componentMoved(ComponentEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  size=e.getComponent().getSize();
  location=e.getComponent().getLocation();
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  if (e.getComponent() instanceof Dialog) {
    if (!((Dialog)e.getComponent()).isResizable()) {
      ((Dialog)e.getComponent()).setResizable(true);
    }
  }
}

Fixed version (ground truth):
@Override public void componentMoved(ComponentEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Window w=RequestFocusListener.getWindow(e.getComponent());
  size=w.getSize();
  location=w.getLocation();
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Dialog d=getDialog(e);
  if (d != null) {
    if (!d.isResizable()) {
      d.setResizable(true);
    }
  }
  Debug.outln("String_Node_Str" + w);
  Debug.outln("String_Node_Str" + w);
}
Program: 88737
Project: 88737
Buggy source:
@Override public void componentHidden(ComponentEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  if (e.getComponent() instanceof Dialog) {
    if (!((Dialog)e.getComponent()).isResizable()) {
      ((Dialog)e.getComponent()).setResizable(true);
    }
  }
}

Fixed version (ground truth):
@Override public void componentHidden(ComponentEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Window w=getTopComponentOfType(e.getComponent(),Window.class);
  Dialog d=getDialog(e);
  if (d != null) {
    if (!d.isResizable()) {
      d.setResizable(true);
    }
  }
}
Program: 88739
Project: 88739
Buggy source:
@Override public void componentShown(ComponentEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  if (e.getComponent() instanceof Dialog) {
    if (!((Dialog)e.getComponent()).isResizable()) {
      ((Dialog)e.getComponent()).setResizable(true);
    }
  }
}

Fixed version (ground truth):
@Override public void componentShown(ComponentEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Window w=getTopComponentOfType(e.getComponent(),Window.class);
  if (locationOnClose != null) {
    w.setLocation(locationOnClose);
  }
  if (sizeOnClose != null) {
    w.setSize(sizeOnClose);
  }
  Dialog d=getDialog(e);
  if (d != null) {
    if (!d.isResizable()) {
      d.setResizable(true);
    }
  }
}
Program: 88740
Project: 88740
Buggy source:
@Override public void windowClosed(WindowEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
}

Fixed version (ground truth):
@Override public void windowClosed(WindowEvent e){
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Window w=RequestFocusListener.getWindow(e.getComponent());
  size=w.getSize();
  location=w.getLocation();
  locationOnClose=location;
  Debug.outln("String_Node_Str" + size + "String_Node_Str"+ location);
  Debug.outln("String_Node_Str" + w);
  Debug.outln("String_Node_Str" + w);
}
Program: 88741
Project: 88741
Buggy source:
public void setResultPanel(Object result){
  System.out.println("String_Node_Str" + result + "String_Node_Str");
  if (resultPane instanceof JEditorPane) {
    if (result == null)     result="String_Node_Str";
    ((JEditorPane)resultPane).setText(result.toString());
  }
 else {
    JComponent newResultPane=null;
    if (result instanceof JComponent) {
      newResultPane=(JComponent)result;
    }
 else     if (result instanceof Icon) {
      newResultPane=new JLabel((Icon)result);
    }
 else {
      newResultPane=createEditorPane(result == null ? "String_Node_Str" : result.toString());
    }
    if (newResultPane != null) {
      resultScrollPane.remove(resultPane);
      resultPane=newResultPane;
      System.out.println("String_Node_Str");
      resultScrollPane.add(resultPane);
    }
  }
  if (this.isVisible()) {
    System.out.println("String_Node_Str");
    setVisible(false);
    setVisible(true);
  }
 else {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public void setResultPanel(Object result){
  System.out.println("String_Node_Str" + result + "String_Node_Str");
  if (resultPane instanceof JEditorPane) {
    if (result == null)     result="String_Node_Str";
    ((JEditorPane)resultPane).setText(result.toString());
  }
 else {
    JComponent newResultPane=null;
    if (result instanceof JComponent) {
      newResultPane=(JComponent)result;
    }
 else     if (result instanceof Icon) {
      newResultPane=new JLabel((Icon)result);
    }
 else {
      newResultPane=createEditorPane(result == null ? "String_Node_Str" : result.toString());
    }
    if (newResultPane != null) {
      resultScrollPane.remove(resultPane);
      resultPane=newResultPane;
      resultScrollPane.add(resultPane);
    }
  }
  if (this.isVisible()) {
    Debug.outln("String_Node_Str");
    setVisible(false);
    setVisible(true);
  }
 else {
    Debug.outln("String_Node_Str");
  }
}
Program: 88742
Project: 88742
Buggy source:
/** 
 * singleView: whether to only parse the passed in view recurse: only if singleView is true, whether to process all children views these options are to accommodate normal docgen to docbook xml and view editor export options
 */
public Document parseDocument(boolean singleView,boolean recurse){
  if (StereotypesHelper.hasStereotypeOrDerived(start,sysmlview)) {
    if (start instanceof Package || StereotypesHelper.hasStereotype(start,DocGen3Profile.documentViewStereotype) || GeneratorUtils.findStereotypedRelationship(start,DocGen3Profile.firstStereotype) != null || GeneratorUtils.findStereotypedRelationship(start,DocGen3Profile.nextStereotype) != null || GeneratorUtils.findStereotypedRelationship(start,DocGen3Profile.nosectionStereotype) != null) {
      ViewParser vp=new ViewParser(this,singleView,recurse,doc,start);
      vp.parse();
    }
 else {
      ProductViewParser vp=new ProductViewParser(this,singleView,recurse,doc,start);
      vp.parse();
    }
  }
 else   if (StereotypesHelper.hasStereotypeOrDerived(start,DocGen3Profile.documentStereotype) && start instanceof Activity)   parseActivityOrStructuredNode(start,doc);
 else {
  }
  docMetadata();
  for (  DocGenElement e : doc.getChildren()) {
    if (e instanceof Section)     ((Section)e).isChapter(true);
  }
  return doc;
}

Fixed version (ground truth):
/** 
 * singleView: whether to only parse the passed in view recurse: only if singleView is true, whether to process all children views these options are to accommodate normal docgen to docbook xml and view editor export options
 */
public Document parseDocument(boolean singleView,boolean recurse){
  if (StereotypesHelper.hasStereotypeOrDerived(start,sysmlview)) {
    if (start instanceof Package || start instanceof Diagram || StereotypesHelper.hasStereotype(start,DocGen3Profile.documentViewStereotype)|| GeneratorUtils.findStereotypedRelationship(start,DocGen3Profile.firstStereotype) != null || GeneratorUtils.findStereotypedRelationship(start,DocGen3Profile.nextStereotype) != null || GeneratorUtils.findStereotypedRelationship(start,DocGen3Profile.nosectionStereotype) != null) {
      ViewParser vp=new ViewParser(this,singleView,recurse,doc,start);
      vp.parse();
    }
 else {
      ProductViewParser vp=new ProductViewParser(this,singleView,recurse,doc,start);
      vp.parse();
    }
  }
 else   if (StereotypesHelper.hasStereotypeOrDerived(start,DocGen3Profile.documentStereotype) && start instanceof Activity)   parseActivityOrStructuredNode(start,doc);
 else {
  }
  docMetadata();
  for (  DocGenElement e : doc.getChildren()) {
    if (e instanceof Section)     ((Section)e).isChapter(true);
  }
  return doc;
}
Program: 88747
Project: 88747
Buggy source:
/** 
 * Initializes this instance and adds a description to the fix.
 * @param diag		the diagram to fix.
 * @param pattern	the pattern to load.
 */
public FixPatternMismatchSelect(DiagramPresentationElement diag,JSONObject pattern,HashSet<String> typesToRepair){
  super("String_Node_Str","String_Node_Str",0);
  this.diagToFix=diag;
  this.pattern=pattern;
  this.typesToRepair=typesToRepair;
}

Fixed version (ground truth):
/** 
 * Initializes this instance and adds a description to the fix.
 * @param diag		the diagram to fix.
 * @param pattern	the pattern to load.
 */
public FixPatternMismatchSelect(Project project,DiagramPresentationElement diag,JSONObject pattern,HashSet<String> typesToRepair){
  super("String_Node_Str","String_Node_Str",0);
  this.project=project;
  this.diagToFix=diag;
  this.pattern=pattern;
  this.typesToRepair=typesToRepair;
}
Program: 88748
Project: 88748
Buggy source:
@SuppressWarnings("String_Node_Str") public void addSumRow(){
  List<Object> sumRow=new ArrayList<Object>();
  double f;
  boolean foundSumable=false;
  for (  List<Object> c : table) {
    f=0;
    for (    Object l : c) {
      if (l instanceof List<?>) {
        for (        Object item : (List<Object>)l) {
          if (item instanceof Float || item instanceof Double || item instanceof Integer) {
            foundSumable=true;
            f+=(Double)item;
          }
 else           if (item instanceof LiteralInteger) {
            foundSumable=true;
            f+=new Double(ModelHelper.getValueString((ValueSpecification)item));
          }
        }
      }
    }
    List<Object> bucket=new ArrayList<Object>();
    if (foundSumable) {
      bucket.add(f);
    }
 else {
      bucket.add(irrelevantEntry);
    }
    sumRow.add(bucket);
    foundSumable=false;
  }
  addRow(sumRow);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void addSumRow(){
  List<Object> sumRow=new ArrayList<Object>();
  double f;
  boolean foundSumable=false;
  for (  List<Object> c : table) {
    f=0;
    for (    Object l : c) {
      if (l instanceof List<?>) {
        for (        Object item : (List<Object>)l) {
          if (item instanceof Float || item instanceof Double || item instanceof Integer) {
            foundSumable=true;
            f+=(Double)item;
          }
 else           if (item instanceof LiteralInteger || item instanceof LiteralReal) {
            foundSumable=true;
            f+=new Double(ModelHelper.getValueString((ValueSpecification)item));
          }
        }
      }
    }
    List<Object> bucket=new ArrayList<Object>();
    if (foundSumable) {
      bucket.add(f);
    }
 else {
      bucket.add(irrelevantEntry);
    }
    sumRow.add(bucket);
    foundSumable=false;
  }
  addRow(sumRow);
}
Program: 88749
Project: 88749
Buggy source:
private List<Object> handlePropertyCell(Property dProp,Element cell){
  Element myOwner=dProp.getOwner();
  List<Object> rSlots=new ArrayList<Object>();
  if (myOwner instanceof Stereotype) {
    ValueSpecification pDefault=null;
    if (dProp != null) {
      rSlots.addAll(StereotypesHelper.getStereotypePropertyValue(cell,(Stereotype)myOwner,(Property)dProp));
      pDefault=dProp.getDefaultValue();
    }
    if (rSlots.size() < 1 && pDefault != null) {
      rSlots.add(pDefault);
    }
    return rSlots;
  }
  Collection<Element> rOwned=cell.getOwnedElement();
  for (  Object o : rOwned) {
    if (((Element)o) instanceof Property && ((Property)o).getName().equals(dProp.getName())) {
      rSlots.add((Object)((Property)o).getDefaultValue());
    }
  }
  return rSlots;
}

Fixed version (ground truth):
private List<Object> handlePropertyCell(Property dProp,Element cell){
  Element myOwner=dProp.getOwner();
  List<Object> rSlots=new ArrayList<Object>();
  if (myOwner instanceof Stereotype && StereotypesHelper.hasStereotype(cell,(Stereotype)myOwner)) {
    ValueSpecification pDefault=null;
    if (dProp != null) {
      rSlots.addAll(StereotypesHelper.getStereotypePropertyValue(cell,(Stereotype)myOwner,(Property)dProp));
      pDefault=dProp.getDefaultValue();
    }
    if (rSlots.size() < 1 && pDefault != null) {
      rSlots.add(pDefault);
    }
    return rSlots;
  }
  Collection<Element> rOwned=cell.getOwnedElement();
  for (  Object o : rOwned) {
    if (((Element)o) instanceof Property && ((Property)o).getName().equals(dProp.getName())) {
      rSlots.add((Object)((Property)o).getDefaultValue());
    }
  }
  return rSlots;
}
Program: 88750
Project: 88750
Buggy source:
public List<Object> handleAttributeCell(Object dAttr,Element cell){
  List<Object> rSlots=new ArrayList<Object>();
  if (dAttr != null && ((EnumerationLiteral)dAttr).getName().equals("String_Node_Str")) {
    if (cell instanceof NamedElement) {
      rSlots.add(((NamedElement)cell).getName());
    }
 else {
      rSlots.add(cell.getHumanName());
    }
  }
  if (dAttr != null && ((EnumerationLiteral)dAttr).getName().equals("String_Node_Str")) {
    rSlots.add(ModelHelper.getComment(cell));
  }
  if (dAttr != null && ((EnumerationLiteral)dAttr).getName().equals("String_Node_Str")) {
    if (cell instanceof Property) {
      rSlots.add(((Property)cell).getDefaultValue());
    }
 else     if (cell instanceof Slot) {
      rSlots.add(((Slot)cell).getValue());
    }
  }
  return rSlots;
}

Fixed version (ground truth):
public List<Object> handleAttributeCell(Object dAttr,Element cell){
  List<Object> rSlots=new ArrayList<Object>();
  if (dAttr != null && ((EnumerationLiteral)dAttr).getName().equals("String_Node_Str")) {
    if (cell instanceof NamedElement) {
      rSlots.add(((NamedElement)cell).getName());
    }
 else {
      rSlots.add(cell.getHumanName());
    }
  }
  if (dAttr != null && ((EnumerationLiteral)dAttr).getName().equals("String_Node_Str")) {
    rSlots.add(ModelHelper.getComment(cell));
  }
  if (dAttr != null && ((EnumerationLiteral)dAttr).getName().equals("String_Node_Str")) {
    if (cell instanceof Property) {
      rSlots.add(((Property)cell).getDefaultValue());
    }
 else     if (cell instanceof Slot) {
      rSlots.addAll(((Slot)cell).getValue());
    }
  }
  return rSlots;
}
Program: 88751
Project: 88751
Buggy source:
public static DBTableEntry getStereotypePropertyEntry(Element e,Property p,boolean forViewEditor){
  List<Object> results=Utils.getStereotypePropertyValues(e,p);
  return getEntryFromList(results,false,forViewEditor);
}

Fixed version (ground truth):
public static DBTableEntry getStereotypePropertyEntry(Element e,Property p,boolean forViewEditor){
  List<Object> results=Utils.getStereotypePropertyValues(e,p);
  return getTableEntryFromList(results,false,forViewEditor);
}
Program: 88752
Project: 88752
Buggy source:
public List<List<DocumentElement>> getBody(Diagram d,List<Element> rowElements,List<String> columnIds,DiagramTableTool dtt,boolean forViewEditor){
  List<List<DocumentElement>> res=new ArrayList<List<DocumentElement>>();
  for (  Element e : rowElements) {
    if (skipIfNoDoc && ModelHelper.getComment(e).trim().equals("String_Node_Str"))     continue;
    List<DocumentElement> row=new ArrayList<DocumentElement>();
    int count=0;
    for (    String cid : columnIds) {
      if (count == 0) {
        count++;
        continue;
      }
      row.add(Common.getEntryFromList(getTableValues(dtt.getCellValue(d,e,cid)),false,forViewEditor));
    }
    res.add(row);
  }
  return res;
}

Fixed version (ground truth):
public List<List<DocumentElement>> getBody(Diagram d,List<Element> rowElements,List<String> columnIds,DiagramTableTool dtt,boolean forViewEditor){
  List<List<DocumentElement>> res=new ArrayList<List<DocumentElement>>();
  for (  Element e : rowElements) {
    if (skipIfNoDoc && ModelHelper.getComment(e).trim().equals("String_Node_Str"))     continue;
    List<DocumentElement> row=new ArrayList<DocumentElement>();
    int count=0;
    for (    String cid : columnIds) {
      if (count == 0) {
        count++;
        continue;
      }
      row.add(Common.getTableEntryFromList(getTableValues(dtt.getCellValue(d,e,cid)),false,forViewEditor));
    }
    res.add(row);
  }
  return res;
}
Program: 88753
Project: 88753
Buggy source:
/** 
 * Import database
 */
public void importDatabase(String filename) throws IOException {
  String internalDbPath=getDatabasePath(this.context);
  String internalSpPath="String_Node_Str";
  close();
  Log.w("String_Node_Str",Constants.BACKUPPATH + "String_Node_Str" + filename);
  try {
    File newDb=new File(Constants.BACKUPPATH + "String_Node_Str" + filename);
    File oldDb=new File(internalDbPath);
    File newSp=new File(Constants.BACKUPPATH + "String_Node_Str" + filename+ "String_Node_Str");
    File oldSp=new File(internalSpPath);
    copyFile(newDb,oldDb);
    copyFile(newSp,oldSp);
  }
 catch (  IOException e) {
    Log.e(TAG,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Import database
 */
public void importDatabase(String filename) throws IOException {
  String internalDbPath=getDatabasePath(this.context);
  String internalSpPath="String_Node_Str";
  close();
  Log.w("String_Node_Str",Constants.BACKUPPATH + "String_Node_Str" + filename);
  File newDb=new File(Constants.BACKUPPATH + "String_Node_Str" + filename);
  File oldDb=new File(internalDbPath);
  File newSp=new File(Constants.BACKUPPATH + "String_Node_Str" + filename+ "String_Node_Str");
  File oldSp=new File(internalSpPath);
  try {
    copyFile(newDb,oldDb);
    copyFile(newSp,oldSp);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 88754
Project: 88754
Buggy source:
/** 
 * Export database
 */
public void exportDatabase(String filename) throws IOException {
  String internalDbPath=getDatabasePath(this.context);
  String internalSpPath="String_Node_Str";
  close();
  try {
    File newDb=new File(Constants.BACKUPPATH + "String_Node_Str" + filename+ "String_Node_Str");
    File oldDb=new File(internalDbPath);
    File newSp=new File(Constants.BACKUPPATH + "String_Node_Str" + filename+ "String_Node_Str");
    File oldSp=new File(internalSpPath);
    copyFile(oldDb,newDb);
    copyFile(oldSp,newSp);
  }
 catch (  IOException e) {
    Log.e(TAG,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Export database
 */
public void exportDatabase(String filename) throws IOException {
  String internalDbPath=getDatabasePath(this.context);
  String internalSpPath="String_Node_Str";
  close();
  try {
    File newDb=new File(Constants.BACKUPPATH + "String_Node_Str" + filename);
    File oldDb=new File(internalDbPath);
    File newSp=new File(Constants.BACKUPPATH + "String_Node_Str" + filename+ "String_Node_Str");
    File oldSp=new File(internalSpPath);
    copyFile(oldDb,newDb);
    copyFile(oldSp,newSp);
  }
 catch (  IOException e) {
    Log.e(TAG,e.getMessage());
  }
}