nus-yam/ex-repair huggingface dataset:
Program: 124458
Project: 124458
Buggy source:
private String configureEvaluation(Class<?> interface1,Class<?> scriptHelperClass,CtMethod method,String body,CtClass returnType) throws NotFoundException {
  if (!typeIsEqual(returnType,Void.class) && !typeIsEqual(returnType,void.class)) {
    if (typeIsEqual(returnType,Boolean.class) || typeIsEqual(returnType,boolean.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     if (typeIsEqual(returnType,Integer.class) || typeIsEqual(returnType,int.class) || typeIsEqual(returnType,Short.class)|| typeIsEqual(returnType,short.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     if (typeIsEqual(returnType,Double.class) || typeIsEqual(returnType,double.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     if (typeIsEqual(returnType,String.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     body=createBodyForReference(interface1,scriptHelperClass,method,body,returnType);
  }
 else   body=body.replace("String_Node_Str",scriptHelperClass.getName() + "String_Node_Str");
  return body;
}

Fixed version (ground truth):
private String configureEvaluation(Class<?> interface1,Class<?> scriptHelperClass,CtMethod method,String body,CtClass returnType) throws NotFoundException {
  if (!typeIsEqual(returnType,Void.class) && !typeIsEqual(returnType,void.class)) {
    if (typeIsEqual(returnType,Boolean.class) || typeIsEqual(returnType,boolean.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     if (typeIsEqual(returnType,Integer.class) || typeIsEqual(returnType,int.class) || typeIsEqual(returnType,Short.class)|| typeIsEqual(returnType,short.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     if (typeIsEqual(returnType,Double.class) || typeIsEqual(returnType,double.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     if (typeIsEqual(returnType,Float.class) || typeIsEqual(returnType,float.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     if (typeIsEqual(returnType,String.class))     body=body.replace("String_Node_Str","String_Node_Str" + scriptHelperClass.getName() + "String_Node_Str");
 else     body=createBodyForReference(interface1,scriptHelperClass,method,body,returnType);
  }
 else   body=body.replace("String_Node_Str",scriptHelperClass.getName() + "String_Node_Str");
  return body;
}
Program: 124459
Project: 124459
Buggy source:
/** 
 * Constructs an empty list with the specified initial capacity.
 */
public ArrayList(int initialCapacity){
  initialCapacity++;
}

Fixed version (ground truth):
/** 
 * Constructs an empty list with the specified initial capacity.
 */
public ArrayList(int initialCapacity){
  this();
  initialCapacity++;
}
Program: 124460
Project: 124460
Buggy source:
public String toString(){
  ScriptHelper.put("String_Node_Str",value,this);
  return (String)ScriptHelper.eval("String_Node_Str",this);
}

Fixed version (ground truth):
public static String toString(float f){
  return f + "String_Node_Str";
}
Program: 124461
Project: 124461
Buggy source:
public Class getClass(){
  String className=(String)ScriptHelper.eval("String_Node_Str",this);
  try {
    return Class.forName(className);
  }
 catch (  ClassNotFoundException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public Class getClass(){
  String className=(String)ScriptHelper.eval("String_Node_Str",this);
  className=className.replace("String_Node_Str","String_Node_Str");
  try {
    return Class.forName(className);
  }
 catch (  ClassNotFoundException e) {
    throw new RuntimeException(e);
  }
}
Program: 124462
Project: 124462
Buggy source:
public static Object executeMethod(String className,String methodName,Object... args){
  try {
    if (classLoader == null) {
      ClassLoader lastContextClassLoader=Thread.currentThread().getContextClassLoader();
      classLoader=lastContextClassLoader;
      DragomeConfigurator configurator=ServiceLocator.getInstance().getConfigurator();
      if (configurator != null) {
        ClassLoader parentClassloader=ClassTransformerDragomeWebSocketHandler.class.getClassLoader();
        classLoader=configurator.getNewClassloaderInstance(parentClassloader,parentClassloader);
      }
    }
    Thread.currentThread().setContextClassLoader(classLoader);
    Class<?> loadClass=classLoader.loadClass(className);
    for (    Method method : loadClass.getMethods()) {
      if (method.getName().equals(methodName))       return method.invoke(loadClass.newInstance(),args);
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  return null;
}

Fixed version (ground truth):
public static Object executeMethod(String className,String methodName,Object... args){
  try {
    if (classLoader == null) {
      ClassLoader lastContextClassLoader=Thread.currentThread().getContextClassLoader();
      classLoader=lastContextClassLoader;
      DragomeConfigurator configurator=ServiceLocator.getInstance().getConfigurator();
      if (configurator != null) {
        ClassLoader parentClassloader=ClassTransformerDragomeWebSocketHandler.class.getClassLoader();
        classLoader=configurator.getNewClassloaderInstance(parentClassloader,parentClassloader);
      }
    }
    Thread.currentThread().setContextClassLoader(classLoader);
    Class<?> loadClass=classLoader.loadClass(className);
    for (    Method method : loadClass.getMethods()) {
      if (method.getName().equals(methodName))       return method.invoke(loadClass.newInstance(),args);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
  return null;
}
Program: 124463
Project: 124463
Buggy source:
public void init(InstrumentationDragomeConfigurator... configurators){
  includedPaths.clear();
  loadedFromParent.clear();
  this.configurators=Arrays.asList(configurators);
  for (  InstrumentationDragomeConfigurator configurator : this.configurators)   if (configurator.isEnabled()) {
    includedPaths.addAll(configurator.getIncludedPaths());
    loadedFromParent.addAll(configurator.getLoadedFromParent());
  }
}

Fixed version (ground truth):
public void init(InstrumentationDragomeConfigurator... configurators){
  this.configurators=Arrays.asList(configurators);
  for (  InstrumentationDragomeConfigurator configurator : this.configurators)   if (configurator.isEnabled()) {
    includedPaths.addAll(configurator.getIncludedPaths());
    loadedFromParent.addAll(configurator.getLoadedFromParent());
  }
}
Program: 124464
Project: 124464
Buggy source:
public BytecodeTransformer getBytecodeTransformer(){
  return null;
}

Fixed version (ground truth):
public BytecodeTransformer getBytecodeTransformer(){
  return new BytecodeTransformer(){
    public byte[] transform(    String className,    byte[] bytecode){
      return bytecode;
    }
    public boolean requiresTransformation(    String className){
      return false;
    }
  }
;
}
Program: 124465
Project: 124465
Buggy source:
public Object run(){
  int i=classname.lastIndexOf('.');
  if (i > 0) {
    String packageName=classname.substring(0,i);
    Package pkg=getPackage(packageName);
    if (pkg == null) {
      definePackage(packageName,null,null,null,null,null,null,null);
    }
  }
  byte[] newData;
  if (!bytecodeTransformer.requiresTransformation(classname) || loadingClass.contains(classname))   newData=classData;
 else {
    loadingClass.add(classname);
    Thread.currentThread().setContextClassLoader(last);
    newData=bytecodeTransformer.transform(classname,classData);
    Thread.currentThread().setContextClassLoader(DragomeInstrumentationClassLoader.this);
  }
  ProtectionDomain domain=this.getClass().getProtectionDomain();
  return defineClass(classname,newData,0,newData.length,domain);
}

Fixed version (ground truth):
public Object run(){
  int i=classname.lastIndexOf('.');
  if (i > 0) {
    String packageName=classname.substring(0,i);
    Package pkg=getPackage(packageName);
    if (pkg == null) {
      definePackage(packageName,null,null,null,null,null,null,null);
    }
  }
  byte[] newData;
  if (bytecodeTransformer == null || !bytecodeTransformer.requiresTransformation(classname) || loadingClass.contains(classname))   newData=classData;
 else {
    loadingClass.add(classname);
    Thread.currentThread().setContextClassLoader(last);
    newData=bytecodeTransformer.transform(classname,classData);
    Thread.currentThread().setContextClassLoader(DragomeInstrumentationClassLoader.this);
  }
  ProtectionDomain domain=this.getClass().getProtectionDomain();
  return defineClass(classname,newData,0,newData.length,domain);
}
Program: 124466
Project: 124466
Buggy source:
/** 
 * Define a class given its bytes
 * @param classData the bytecode data for the class
 * @param classname the name of the class
 * @return the Class instance created from the given data
 */
public Class defineClassFromData(final byte[] classData,final String classname){
  return (Class)AccessController.doPrivileged(new PrivilegedAction(){
    public Object run(){
      int i=classname.lastIndexOf('.');
      if (i > 0) {
        String packageName=classname.substring(0,i);
        Package pkg=getPackage(packageName);
        if (pkg == null) {
          definePackage(packageName,null,null,null,null,null,null,null);
        }
      }
      byte[] newData;
      if (!bytecodeTransformer.requiresTransformation(classname) || loadingClass.contains(classname))       newData=classData;
 else {
        loadingClass.add(classname);
        Thread.currentThread().setContextClassLoader(last);
        newData=bytecodeTransformer.transform(classname,classData);
        Thread.currentThread().setContextClassLoader(DragomeInstrumentationClassLoader.this);
      }
      ProtectionDomain domain=this.getClass().getProtectionDomain();
      return defineClass(classname,newData,0,newData.length,domain);
    }
  }
,acc);
}

Fixed version (ground truth):
/** 
 * Define a class given its bytes
 * @param classData the bytecode data for the class
 * @param classname the name of the class
 * @return the Class instance created from the given data
 */
public Class defineClassFromData(final byte[] classData,final String classname){
  return (Class)AccessController.doPrivileged(new PrivilegedAction(){
    public Object run(){
      int i=classname.lastIndexOf('.');
      if (i > 0) {
        String packageName=classname.substring(0,i);
        Package pkg=getPackage(packageName);
        if (pkg == null) {
          definePackage(packageName,null,null,null,null,null,null,null);
        }
      }
      byte[] newData;
      if (bytecodeTransformer == null || !bytecodeTransformer.requiresTransformation(classname) || loadingClass.contains(classname))       newData=classData;
 else {
        loadingClass.add(classname);
        Thread.currentThread().setContextClassLoader(last);
        newData=bytecodeTransformer.transform(classname,classData);
        Thread.currentThread().setContextClassLoader(DragomeInstrumentationClassLoader.this);
      }
      ProtectionDomain domain=this.getClass().getProtectionDomain();
      return defineClass(classname,newData,0,newData.length,domain);
    }
  }
,acc);
}
Program: 124467
Project: 124467
Buggy source:
public Timer setTimeout(final Runnable runnable,int milliseconds){
  setupTimer(runnable);
  ScriptHelper.put("String_Node_Str",milliseconds,this);
  id=ScriptHelper.eval("String_Node_Str",this);
  return this;
}

Fixed version (ground truth):
public Timer setTimeout(final Runnable runnable,int milliseconds){
  Runnable runnableForDebugging=Window.wrapRunnableForDebugging(runnable);
  ScriptHelper.put("String_Node_Str",runnableForDebugging,this);
  ScriptHelper.put("String_Node_Str",milliseconds,this);
  id=ScriptHelper.eval("String_Node_Str",this);
  return this;
}
Program: 124468
Project: 124468
Buggy source:
public Timer setInterval(final Runnable runnable,int milliseconds){
  setupTimer(runnable);
  ScriptHelper.put("String_Node_Str",milliseconds,this);
  id=ScriptHelper.eval("String_Node_Str",this);
  return this;
}

Fixed version (ground truth):
public Timer setInterval(final Runnable runnable,int milliseconds){
  Runnable runnableForDebugging=Window.wrapRunnableForDebugging(runnable);
  ScriptHelper.put("String_Node_Str",runnableForDebugging,this);
  ScriptHelper.put("String_Node_Str",milliseconds,this);
  id=ScriptHelper.eval("String_Node_Str",this);
  return this;
}
Program: 124469
Project: 124469
Buggy source:
private CtClass generateCtClass(String className,Class<?> interface1){
  try {
    ClassPool pool=ClassPool.getDefault();
    CtClass cc=pool.makeClass(className);
    CtClass resolveCtClass=resolveCtClass(interface1);
    cc.addInterface(resolveCtClass);
    Class<?> scriptHelperClass=ScriptHelper.class;
    StringBuilder constructorBody=new StringBuilder();
    constructorBody.append(scriptHelperClass.getName() + "String_Node_Str");
    constructorBody.append(scriptHelperClass.getName() + "String_Node_Str");
    CtClass objectCtClass=resolveCtClass(Object.class);
    addConstructors(cc,constructorBody,objectCtClass);
    for (    CtMethod method : resolveCtClass.getMethods())     if (!method.getDeclaringClass().equals(objectCtClass))     cc.addMethod(createDelegateMethod(interface1,cc,scriptHelperClass,method));
    return cc;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private CtClass generateCtClass(String className,Class<?> interface1){
  try {
    ClassPool pool=ClassPool.getDefault();
    CtClass cc=pool.makeClass(className);
    CtClass resolveCtClass=resolveCtClass(interface1);
    cc.addInterface(resolveCtClass);
    Class<?> scriptHelperClass=ScriptHelper.class;
    pool.insertClassPath(new ClassClassPath(Object.class));
    pool.insertClassPath(new ClassClassPath(scriptHelperClass));
    StringBuilder constructorBody=new StringBuilder();
    constructorBody.append(scriptHelperClass.getName() + "String_Node_Str");
    constructorBody.append(scriptHelperClass.getName() + "String_Node_Str");
    CtClass objectCtClass=resolveCtClass(Object.class);
    addConstructors(cc,constructorBody,objectCtClass);
    for (    CtMethod method : resolveCtClass.getMethods())     if (!method.getDeclaringClass().equals(objectCtClass))     cc.addMethod(createDelegateMethod(interface1,cc,scriptHelperClass,method));
    return cc;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 124470
Project: 124470
Buggy source:
/** 
 * Returns an Long object holding the specified value. Calls to this method may be generated by the autoboxing feature.
 */
public static Long valueOf(long value){
  return new Long(value);
}

Fixed version (ground truth):
public static Long valueOf(String aValue){
  return new Long(aValue);
}
Program: 124472
Project: 124472
Buggy source:
@Override public void execute() throws MojoExecutionException, MojoFailureException {
  getLog().info("String_Node_Str" + destinationDirectory);
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  try {
    compile();
  }
 catch (  RuntimeException e) {
    throw e;
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void execute() throws MojoExecutionException, MojoFailureException {
  getLog().info("String_Node_Str" + destinationDirectory);
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResource("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  copyResourceMinifyJS("String_Node_Str","String_Node_Str");
  try {
    compile();
  }
 catch (  RuntimeException e) {
    throw e;
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 124473
Project: 124473
Buggy source:
public Element getElementBySelector(String selector){
  ScriptHelper.put("String_Node_Str",selector,this);
  Object object=ScriptHelper.eval("String_Node_Str",this);
  Element result=JsDelegateFactory.createFrom(object,Element.class);
  return result;
}

Fixed version (ground truth):
public Element getElementBySelector(String selector){
  ScriptHelper.put("String_Node_Str",selector,this);
  Object object=ScriptHelper.eval("String_Node_Str",this);
  Element result=null;
  if (object != null)   result=JsDelegateFactory.createFrom(object,Element.class);
  return result;
}
Program: 124475
Project: 124475
Buggy source:
private boolean addSuperStaticMethods(Writer writer,boolean first) throws IOException {
  if (superUnit != null)   for (  MemberUnit member : superUnit.getDeclaredMembers()) {
    if (member.getData() != null && member.getData().startsWith(STATIC_MEMBER) && member instanceof MethodUnit && !isClinit(member)) {
      String methodData=member.getData().replace(STATIC_MEMBER,"String_Node_Str");
      String substring=methodData.substring(0,methodData.indexOf("String_Node_Str"));
      String methodName=substring.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
      substring+="String_Node_Str" + methodName + "String_Node_Str";
      if (!first)       writer.write("String_Node_Str");
      writer.write(substring);
      first=false;
    }
  }
  return first;
}

Fixed version (ground truth):
private boolean addSuperStaticMethods(Writer writer,boolean first,List<MemberUnit> staticMethods) throws IOException {
  if (superUnit != null)   for (  MemberUnit member : superUnit.getDeclaredMembers()) {
    if (member.getData() != null && member.getData().startsWith(STATIC_MEMBER)) {
      if (member instanceof MethodUnit) {
        if (!isClinit(member))         if (!containsSignature(member.getSignature(),staticMethods)) {
          addMemberUnit(member);
          String methodData=member.getData().replace(STATIC_MEMBER,"String_Node_Str");
          String substring=methodData.substring(0,methodData.indexOf("String_Node_Str"));
          String methodName=substring.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
          substring+="String_Node_Str" + methodName + "String_Node_Str";
          if (!first)           writer.write("String_Node_Str");
          writer.write(substring);
          first=false;
        }
      }
    }
  }
  return first;
}
Program: 124476
Project: 124476
Buggy source:
public static void addClassName(Element element,String className){
  String classes=element.getAttribute("String_Node_Str");
  if (!classes.contains(className)) {
    classes+="String_Node_Str" + className;
    element.setAttribute("String_Node_Str",classes.trim());
  }
}

Fixed version (ground truth):
public static void addClassName(Element element,String className){
  String classes=element.getAttribute("String_Node_Str");
  if (classes == null)   classes="String_Node_Str";
  if (!classes.contains(className)) {
    classes+="String_Node_Str" + className;
    element.setAttribute("String_Node_Str",classes.trim());
  }
}
Program: 124477
Project: 124477
Buggy source:
public void styleChanged(Style style){
  String entityId=DragomeEntityManager.getEntityId(style.getVisualComponent());
  Element element=ServiceLocator.getInstance().getDomHandler().getElementBySelector("String_Node_Str" + AbstractHTMLComponentRenderer.COMPONENT_ID_ATTRIBUTE + "String_Node_Str"+ entityId+ "String_Node_Str");
  if (element != null) {
    if (!style.isSynchronized()) {
      String result=(element.getAttribute("String_Node_Str") + (style.getName() != null ? "String_Node_Str" + style.getName() : "String_Node_Str")).trim();
      style.setName(deDup(result));
      style.setSynchronized(true);
    }
 else {
      if (style.getName().trim().length() > 0)       element.setAttribute("String_Node_Str",style.getName());
 else       element.removeAttribute("String_Node_Str");
      if (style.isEnabled())       element.removeAttribute("String_Node_Str");
 else       element.setAttribute("String_Node_Str","String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void styleChanged(Style style){
  String entityId=DragomeEntityManager.getEntityId(style.getVisualComponent());
  Element element=ServiceLocator.getInstance().getDomHandler().getElementBySelector("String_Node_Str" + AbstractHTMLComponentRenderer.COMPONENT_ID_ATTRIBUTE + "String_Node_Str"+ entityId+ "String_Node_Str");
  if (element != null) {
    String name=style.getName();
    if (!style.isSynchronized()) {
      String result=(element.getAttribute("String_Node_Str") + (name != null ? "String_Node_Str" + name : "String_Node_Str")).trim();
      style.setName(deDup(result));
      style.setSynchronized(true);
    }
 else {
      if (name != null && name.trim().length() > 0)       element.setAttribute("String_Node_Str",name);
 else       element.removeAttribute("String_Node_Str");
      if (style.isEnabled())       element.removeAttribute("String_Node_Str");
 else       element.setAttribute("String_Node_Str","String_Node_Str");
    }
  }
}
Program: 124478
Project: 124478
Buggy source:
public Object invokeWithArguments(Object... arguments) throws Throwable {
  ScriptHelper.put("String_Node_Str",lookup.getSpecialCaller(),this);
  ScriptHelper.put("String_Node_Str",arguments,this);
  ScriptHelper.put("String_Node_Str",x,this);
  ScriptHelper.put("String_Node_Str",lookup.getMethod(),this);
  Object o=ScriptHelper.eval("String_Node_Str",this);
  return o;
}

Fixed version (ground truth):
public Object invokeWithArguments(Object... args) throws Throwable {
  ScriptHelper.put("String_Node_Str",lookup.getSpecialCaller(),this);
  ScriptHelper.put("String_Node_Str",args,this);
  ScriptHelper.put("String_Node_Str",x,this);
  ScriptHelper.put("String_Node_Str",lookup.getMethod(),this);
  Object o=ScriptHelper.eval("String_Node_Str",this);
  return o;
}
Program: 124479
Project: 124479
Buggy source:
public void run(){
  Object object=DragomeEntityManager.get(id);
  if (object instanceof EventListener)   processElementEvent(eventType,arguments,(EventListener)object,id);
}

Fixed version (ground truth):
public void run(){
  Object object=DragomeEntityManager.get(id);
  if (object instanceof EventListener)   processElementEvent(eventType,args,(EventListener)object,id);
}
Program: 124480
Project: 124480
Buggy source:
public void eventPerformedById(final String eventType,final String id,final Object arguments){
  runOnlySynchronized(new Runnable(){
    public void run(){
      Object object=DragomeEntityManager.get(id);
      if (object instanceof EventListener)       processElementEvent(eventType,arguments,(EventListener)object,id);
    }
    private void processElementEvent(    final String eventType,    final Object arguments,    EventListener browserEventListener,    String id){
      browserEventListener.handleEvent(eventType.startsWith("String_Node_Str") ? new KeyboardEventImpl(eventType,(int)arguments) : new EventImpl(eventType));
    }
  }
);
}

Fixed version (ground truth):
public void eventPerformedById(final String eventType,final String id,final Object args){
  runOnlySynchronized(new Runnable(){
    public void run(){
      Object object=DragomeEntityManager.get(id);
      if (object instanceof EventListener)       processElementEvent(eventType,args,(EventListener)object,id);
    }
    private void processElementEvent(    final String eventType,    final Object args,    EventListener browserEventListener,    String id){
      browserEventListener.handleEvent(eventType.startsWith("String_Node_Str") ? new KeyboardEventImpl(eventType,(int)args) : new EventImpl(eventType));
    }
  }
);
}
Program: 124481
Project: 124481
Buggy source:
private void processElementEvent(final String eventType,final Object arguments,EventListener browserEventListener,String id){
  browserEventListener.handleEvent(eventType.startsWith("String_Node_Str") ? new KeyboardEventImpl(eventType,(int)arguments) : new EventImpl(eventType));
}

Fixed version (ground truth):
private void processElementEvent(final String eventType,final Object args,EventListener browserEventListener,String id){
  browserEventListener.handleEvent(eventType.startsWith("String_Node_Str") ? new KeyboardEventImpl(eventType,(int)args) : new EventImpl(eventType));
}
Program: 124482
Project: 124482
Buggy source:
public Object invokeWithArguments(Object... arguments) throws Throwable {
  ScriptHelper.put("String_Node_Str",lookup.getSpecialCaller(),this);
  ScriptHelper.put("String_Node_Str",arguments,this);
  ScriptHelper.put("String_Node_Str",x,this);
  ScriptHelper.put("String_Node_Str",lookup.getMethod(),this);
  Object o=ScriptHelper.eval("String_Node_Str",this);
  return o;
}

Fixed version (ground truth):
public Object invokeWithArguments(Object... args) throws Throwable {
  ScriptHelper.put("String_Node_Str",lookup.getSpecialCaller(),this);
  ScriptHelper.put("String_Node_Str",args,this);
  ScriptHelper.put("String_Node_Str",x,this);
  ScriptHelper.put("String_Node_Str",lookup.getMethod(),this);
  Object o=ScriptHelper.eval("String_Node_Str",this);
  return o;
}
Program: 124483
Project: 124483
Buggy source:
public Method getMethod(String name,Class... parameterTypes) throws NoSuchMethodException, SecurityException {
  Method foundMethod=foundMethods.get(name);
  if (foundMethod == null) {
    Method[] declaredMethods=getMethods();
    for (    Method method : declaredMethods) {
      if (method.getName().equals(name))       foundMethods.put(name,foundMethod=method);
    }
  }
  if (foundMethod == null)   throw new NoSuchMethodException(getName() + "String_Node_Str" + name+ argumentTypesToString(parameterTypes));
  return foundMethod;
}

Fixed version (ground truth):
public Method getMethod(String name,Class... parameterTypes) throws NoSuchMethodException, SecurityException {
  Method foundMethod=foundMethods.get(name);
  if (foundMethod == null) {
    Method[] declaredMethods=getMethods();
    for (    Method method : declaredMethods) {
      if (method.getName().equals(name) && (foundMethod == null || foundMethod.getReturnType().isAssignableFrom(method.getReturnType())))       foundMethods.put(name,foundMethod=method);
    }
  }
  if (foundMethod == null)   throw new NoSuchMethodException(getName() + "String_Node_Str" + name+ argumentTypesToString(parameterTypes));
  return foundMethod;
}
Program: 124484
Project: 124484
Buggy source:
/** 
 * Determines if the class or interface represented by this Class object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified Class parameter.
 */
public boolean isAssignableFrom(Class<?> otherClass){
  Class<?>[] interfaces=getInterfaces();
  if (otherClass == null)   throw new NullPointerException();
  ScriptHelper.put("String_Node_Str",otherClass,this);
  return ScriptHelper.evalBoolean("String_Node_Str",this);
}

Fixed version (ground truth):
/** 
 * Determines if the class or interface represented by this Class object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified Class parameter.
 */
public boolean isAssignableFrom(Class<?> otherClass){
  Class<?>[] interfaces=getInterfaces();
  if (otherClass == null)   throw new NullPointerException();
  if (otherClass.isInterface() && Object.class.equals(this))   return true;
  ScriptHelper.put("String_Node_Str",otherClass,this);
  return ScriptHelper.evalBoolean("String_Node_Str",this);
}
Program: 124485
Project: 124485
Buggy source:
@MethodAlias(alias="String_Node_Str") public static void addTypeAnnotation(String className,String annotationClassName,String annotationKey,String annotationValue){
  try {
    Class<?> type=ServiceLocator.getInstance().getReflectionService().forName(className);
    Class<? extends Annotation> annotationClass=(Class<? extends Annotation>)ServiceLocator.getInstance().getReflectionService().forName(annotationClassName);
    AnnotationContainer map=getAnnotationsByType(annotationClass);
    map.add(type,annotationKey,annotationValue);
    annotations.add(className + "String_Node_Str" + annotationClassName+ "String_Node_Str"+ annotationKey+ "String_Node_Str"+ annotationValue);
  }
 catch (  Exception e) {
    Logger.getLogger(AnnotationsHelper.class.getName()).log(Level.FINEST,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
@MethodAlias(alias="String_Node_Str") public static void addTypeAnnotation(String className,String annotationClassName,String annotationKey,String annotationValue){
  try {
    ServiceLocator.getInstance().setClientSideEnabled(true);
    Class<?> type=ServiceLocator.getInstance().getReflectionService().forName(className);
    Class<? extends Annotation> annotationClass=(Class<? extends Annotation>)ServiceLocator.getInstance().getReflectionService().forName(annotationClassName);
    AnnotationContainer map=getAnnotationsByType(annotationClass);
    map.add(type,annotationKey,annotationValue);
    annotations.add(className + "String_Node_Str" + annotationClassName+ "String_Node_Str"+ annotationKey+ "String_Node_Str"+ annotationValue);
  }
 catch (  Exception e) {
    Logger.getLogger(AnnotationsHelper.class.getName()).log(Level.FINEST,"String_Node_Str",e);
  }
}
Program: 124486
Project: 124486
Buggy source:
public void init() throws ServletException {
  compile();
}

Fixed version (ground truth):
public void init() throws ServletException {
  try {
    compile();
  }
 catch (  URISyntaxException e) {
    throw new RuntimeException(e);
  }
}
Program: 124487
Project: 124487
Buggy source:
private void compile(){
  final StringBuilder classPath=new StringBuilder();
  ClassLoader c=getClass().getClassLoader();
  URLClassLoader u=(URLClassLoader)c;
  URL[] urls=u.getURLs();
  String classesFolder="String_Node_Str";
  for (  URL i : urls) {
    String string=i.toString();
    boolean isClassesFolder=string.endsWith("String_Node_Str") || string.endsWith("String_Node_Str");
    boolean addToClasspath=ServiceLocator.getInstance().getConfigurator().filterClassPath(string);
    if (isClassesFolder || addToClasspath)     classPath.append(i.getPath() + "String_Node_Str");
    if (isClassesFolder)     classesFolder=string;
    LOGGER.log(Level.INFO,"String_Node_Str" + i);
  }
  final String path=new java.io.File(classesFolder).getParentFile().getParentFile().getPath().replace("String_Node_Str","String_Node_Str") + "String_Node_Str";
  final String classesFolder2=classesFolder.replace("String_Node_Str","String_Node_Str");
  new Thread(){
    public void run(){
      WatchDir.main(new String[]{"String_Node_Str",classesFolder2},classPath.toString(),path);
    }
  }
.start();
}

Fixed version (ground truth):
private void compile() throws URISyntaxException {
  final StringBuilder classPath=new StringBuilder();
  ClassLoader c=getClass().getClassLoader();
  URLClassLoader u=(URLClassLoader)c;
  URL[] urls=u.getURLs();
  String classesFolder="String_Node_Str";
  for (  URL i : urls) {
    String classPathEntry=new File(i.toURI()).toString();
    boolean isClassesFolder=i.toString().endsWith("String_Node_Str") || i.toString().endsWith("String_Node_Str");
    boolean addToClasspath=ServiceLocator.getInstance().getConfigurator().filterClassPath(classPathEntry);
    if (isClassesFolder || addToClasspath)     classPath.append(classPathEntry + "String_Node_Str");
    if (isClassesFolder)     classesFolder=classPathEntry;
    LOGGER.log(Level.INFO,"String_Node_Str" + classPathEntry);
  }
  final String path=new File(new java.io.File(classesFolder).getParentFile().getParentFile().toURI()).toString() + File.separator + "String_Node_Str";
  LOGGER.log(Level.INFO,"String_Node_Str" + path);
  final String classesFolder2=classesFolder;
  new Thread(){
    public void run(){
      WatchDir.main(new String[]{"String_Node_Str",classesFolder2},classPath.toString(),path);
    }
  }
.start();
}
Program: 124488
Project: 124488
Buggy source:
public static void compileWithMainClass(String classPath,String target){
  try {
    Project.singleton=null;
    String classpathElements=classPath;
    Assembly assembly=new Assembly();
    assembly.setEntryPointClassName(mainClass.getName());
    assembly.setTargetLocation(new File(target));
    DragomeConfigurator configurator=ServiceLocator.getInstance().getConfigurator();
    DragomeJsCompiler compiler=new DragomeJsCompiler(configurator.getDefaultCompilerType());
    compiler.addClasspathElements(classpathElements);
    compiler.addClasspathFilter(new FileFilter(){
      public boolean accept(      File pathname){
        return !pathname.toString().contains("String_Node_Str");
      }
    }
);
    if (configurator != null)     compiler.setBytecodeTransformer(configurator.getBytecodeTransformer());
    compiler.addAssembly(assembly);
    compiler.setGenerateLineNumbers(false);
    compiler.setCompression(false);
    compiler.execute();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void compileWithMainClass(String classPath,String target){
  try {
    Project.singleton=null;
    String classpathElements=classPath;
    Assembly assembly=new Assembly();
    assembly.setEntryPointClassName(mainClass.getName());
    assembly.setTargetLocation(new File(target));
    DragomeConfigurator configurator=ServiceLocator.getInstance().getConfigurator();
    DragomeJsCompiler compiler=new DragomeJsCompiler(configurator.getDefaultCompilerType());
    compiler.addClasspathElements(classpathElements);
    compiler.addClasspathFilter(new FileFilter(){
      public boolean accept(      File pathname){
        return !pathname.toString().contains(File.separator + "String_Node_Str");
      }
    }
);
    if (configurator != null)     compiler.setBytecodeTransformer(configurator.getBytecodeTransformer());
    compiler.addAssembly(assembly);
    compiler.setGenerateLineNumbers(false);
    compiler.setCompression(false);
    compiler.execute();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 124489
Project: 124489
Buggy source:
public boolean accept(File pathname){
  return !pathname.toString().contains("String_Node_Str");
}

Fixed version (ground truth):
public boolean accept(File pathname){
  return !pathname.toString().contains(File.separator + "String_Node_Str");
}
Program: 124490
Project: 124490
Buggy source:
public void messageReceived(String aMessage){
  String[] split=aMessage.split("String_Node_Str");
  queue.addMessage(Integer.parseInt(split[1]),aMessage);
}

Fixed version (ground truth):
public void messageReceived(String aMessage){
  int separatorIndex=aMessage.lastIndexOf("String_Node_Str");
  queue.addMessage(Integer.parseInt(aMessage.substring(separatorIndex + 1)),aMessage);
}
Program: 124491
Project: 124491
Buggy source:
private static String getPropertyName(String methodName){
  if (methodName.startsWith("String_Node_Str") || methodName.startsWith("String_Node_Str"))   return methodName.toLowerCase().charAt(3) + methodName.substring(4);
 else   if (methodName.startsWith("String_Node_Str"))   return methodName.toLowerCase().charAt(2) + methodName.substring(3);
  return null;
}

Fixed version (ground truth):
private static String getPropertyName(String methodName){
  if (methodName.length() > 3 && (methodName.startsWith("String_Node_Str") || methodName.startsWith("String_Node_Str")))   return methodName.toLowerCase().charAt(3) + methodName.substring(4);
 else   if (methodName.length() > 2 && methodName.startsWith("String_Node_Str"))   return methodName.toLowerCase().charAt(2) + methodName.substring(3);
  return "String_Node_Str";
}
Program: 124492
Project: 124492
Buggy source:
public void onValueChange(ValueChangeEvent<Object> event){
  String value=(String)event.getValue();
  textFieldElement.setAttribute("String_Node_Str",value);
  ScriptHelper.put("String_Node_Str",textFieldElement,this);
  ScriptHelper.put("String_Node_Str",value,this);
  ScriptHelper.evalNoResult("String_Node_Str",this);
}

Fixed version (ground truth):
public void onValueChange(ValueChangeEvent<Object> event){
  String value=visualTextField.getRenderer().render(event.getValue());
  textFieldElement.setAttribute("String_Node_Str",value);
  ScriptHelper.put("String_Node_Str",textFieldElement,this);
  ScriptHelper.put("String_Node_Str",value,this);
  ScriptHelper.evalNoResult("String_Node_Str",this);
}
Program: 124495
Project: 124495
Buggy source:
public <S>RepeaterBuilder<S,T> toList(final List<S> list){
  final ValueModelDelegator<T,List<S>> valueModelDelegator=new ValueModelDelegator<T,List<S>>(model);
  NullMutableValueModel<List<S>> valueSource=new NullMutableValueModel<List<S>>(){
    public List<S> getDelegatedValue(){
      if (list instanceof ObservableList) {
        ObservableList<S> listWrapper=(ObservableList<S>)list;
        listWrapper.setListChangeListener(new ListChangedListener(){
          public void listChanged(){
            valueModelDelegator.fireValueChangeEvent();
          }
        }
);
      }
      return list;
    }
  }
;
  valueModelDelegator.setValueSource(valueSource);
  BindingSync.addCondition(valueModelDelegator);
  return new RepeaterBuilder<S,T>(valueModelDelegator,template,model,panel);
}

Fixed version (ground truth):
public <S>RepeaterBuilder<S,T> toList(final List<S> list){
  final ValueModelDelegator<T,List<S>> valueModelDelegator=new ValueModelDelegator<T,List<S>>(model);
  addListenerIfObservable(valueModelDelegator,list);
  NullMutableValueModel<List<S>> valueSource=new NullMutableValueModel<List<S>>(){
    public List<S> getDelegatedValue(){
      return list;
    }
  }
;
  valueModelDelegator.setValueSource(valueSource);
  BindingSync.addCondition(valueModelDelegator);
  return new RepeaterBuilder<S,T>(valueModelDelegator,template,model,panel);
}
Program: 124496
Project: 124496
Buggy source:
public <S>RepeaterBuilder<S,T> toListProperty(Getter<T,List<S>> getter){
  final List<S> list=getter.get(model);
  return toList(list);
}

Fixed version (ground truth):
public <S>RepeaterBuilder<S,T> toListProperty(final Getter<T,List<S>> getter){
  final ValueModelDelegator<T,List<S>> valueModelDelegator=new ValueModelDelegator<T,List<S>>(model);
  List<S> list=getter.get(model);
  addListenerIfObservable(valueModelDelegator,list);
  NullMutableValueModel<List<S>> valueSource=new NullMutableValueModel<List<S>>(){
    public List<S> getDelegatedValue(){
      return getter.get(model);
    }
  }
;
  valueModelDelegator.setValueSource(valueSource);
  BindingSync.addCondition(valueModelDelegator);
  return new RepeaterBuilder<S,T>(valueModelDelegator,template,model,panel);
}
Program: 124497
Project: 124497
Buggy source:
public static void compileWithMainClass(String classPath,String target){
  try {
    Project.singleton=null;
    String classpathElements=classPath;
    Assembly assembly=new Assembly();
    assembly.setEntryPointClassName(mainClass.getName());
    assembly.setTargetLocation(new File(target));
    DragomeJsCompiler compiler=new DragomeJsCompiler();
    compiler.addClasspathElements(classpathElements);
    compiler.addClasspathFilter(new FileFilter(){
      public boolean accept(      File pathname){
        return !pathname.toString().contains("String_Node_Str");
      }
    }
);
    DragomeConfigurator configurator=ServiceLocator.getInstance().getConfigurator();
    if (configurator != null)     compiler.setBytecodeTransformer(configurator.getBytecodeTransformer());
    compiler.addAssembly(assembly);
    compiler.setGenerateLineNumbers(false);
    compiler.setCompression(false);
    compiler.execute();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void compileWithMainClass(String classPath,String target){
  try {
    Project.singleton=null;
    String classpathElements=classPath;
    Assembly assembly=new Assembly();
    assembly.setEntryPointClassName(mainClass.getName());
    assembly.setTargetLocation(new File(target));
    DragomeConfigurator configurator=ServiceLocator.getInstance().getConfigurator();
    DragomeJsCompiler compiler=new DragomeJsCompiler(configurator.getDefaultCompilerType());
    compiler.addClasspathElements(classpathElements);
    compiler.addClasspathFilter(new FileFilter(){
      public boolean accept(      File pathname){
        return !pathname.toString().contains("String_Node_Str");
      }
    }
);
    if (configurator != null)     compiler.setBytecodeTransformer(configurator.getBytecodeTransformer());
    compiler.addAssembly(assembly);
    compiler.setGenerateLineNumbers(false);
    compiler.setCompression(false);
    compiler.execute();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 124498
Project: 124498
Buggy source:
public void run(){
  try {
    String id=EventDispatcherHelper.getEventTargetId(event);
    Object arguments=null;
    ScriptHelper.put("String_Node_Str",event,this);
    String eventType=(String)ScriptHelper.eval("String_Node_Str",this);
    ServiceLocator instance=ServiceLocator.getInstance();
    EventDispatcher eventDispatcher=instance.getEventDispatcher();
    eventDispatcher.eventPerformedById(eventType,id,arguments);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    String id=EventDispatcherHelper.getEventTargetId(event);
    Object arguments=null;
    ScriptHelper.put("String_Node_Str",event,this);
    String eventType=(String)ScriptHelper.eval("String_Node_Str",this);
    boolean isKeyEvent=eventType.equals("String_Node_Str") || eventType.equals("String_Node_Str") || eventType.equals("String_Node_Str");
    if (isKeyEvent) {
      ScriptHelper.put("String_Node_Str",EventDispatcherHelper.getEventTarget(event),this);
      ScriptHelper.eval("String_Node_Str",this);
      int code=ScriptHelper.evalInt("String_Node_Str",this);
      arguments=code;
    }
    ServiceLocator instance=ServiceLocator.getInstance();
    EventDispatcher eventDispatcher=instance.getEventDispatcher();
    eventDispatcher.eventPerformedById(eventType,id,arguments);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 124499
Project: 124499
Buggy source:
public void setValue(T value,boolean fireEvents){
  boolean changed=this.value != null ? !this.value.equals(value) : value == null;
  this.value=value;
  if (fireEvents && changed)   fireValueChange(value);
}

Fixed version (ground truth):
public void setValue(T value,boolean fireEvents){
  boolean changed=this.value != null ? !this.value.equals(value) : value != null;
  this.value=value;
  if (fireEvents && changed)   fireValueChange(value);
}
Program: 124500
Project: 124500
Buggy source:
public void mergeWith(Element element){
  String id=DragomeEntityManager.add(visualImage);
  element.setAttribute("String_Node_Str",visualImage.getValue());
  element.setAttribute(COMPONENT_ID_ATTRIBUTE,id);
  addListeners(visualImage,element);
}

Fixed version (ground truth):
public void mergeWith(Element element){
  String id=DragomeEntityManager.add(visualImage);
  if (visualImage.getValue() != null)   element.setAttribute("String_Node_Str",visualImage.getValue());
  element.setAttribute(COMPONENT_ID_ATTRIBUTE,id);
  addListeners(visualImage,element);
}
Program: 124501
Project: 124501
Buggy source:
public Canvas<Element> render(final VisualImage visualImage){
  Canvas<Element> canvas=ServiceLocator.getInstance().getTemplateManager().getCanvasFactory().createCanvas();
  canvas.setContent(new MergeableElement(){
    public void mergeWith(    Element element){
      String id=DragomeEntityManager.add(visualImage);
      element.setAttribute("String_Node_Str",visualImage.getValue());
      element.setAttribute(COMPONENT_ID_ATTRIBUTE,id);
      addListeners(visualImage,element);
    }
  }
);
  return canvas;
}

Fixed version (ground truth):
public Canvas<Element> render(final VisualImage visualImage){
  Canvas<Element> canvas=ServiceLocator.getInstance().getTemplateManager().getCanvasFactory().createCanvas();
  canvas.setContent(new MergeableElement(){
    public void mergeWith(    Element element){
      String id=DragomeEntityManager.add(visualImage);
      if (visualImage.getValue() != null)       element.setAttribute("String_Node_Str",visualImage.getValue());
      element.setAttribute(COMPONENT_ID_ATTRIBUTE,id);
      addListeners(visualImage,element);
    }
  }
);
  return canvas;
}
Program: 124502
Project: 124502
Buggy source:
@Override public void onResume(){
  super.onResume();
  loaderManager.initLoader(ID_BALANCE_LOADER,null,balanceLoaderCallbacks);
  loaderManager.initLoader(ID_RATE_LOADER,null,rateLoaderCallbacks);
  loaderManager.initLoader(ID_BLOCKCHAIN_STATE_LOADER,null,blockchainStateLoaderCallbacks);
  updateView();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  loaderManager.initLoader(ID_BALANCE_LOADER,null,balanceLoaderCallbacks);
  loaderManager.initLoader(ID_RATE_LOADER,null,rateLoaderCallbacks);
  if (!initComplete) {
    loaderManager.initLoader(ID_BLOCKCHAIN_STATE_LOADER,null,blockchainStateLoaderCallbacks);
    initComplete=true;
  }
 else   loaderManager.restartLoader(ID_BLOCKCHAIN_STATE_LOADER,null,blockchainStateLoaderCallbacks);
  updateView();
}
Program: 124504
Project: 124504
Buggy source:
private void afterLoadWallet(){
  wallet.autosaveToFile(walletFile,Constants.Files.WALLET_AUTOSAVE_DELAY_MS,TimeUnit.MILLISECONDS,null);
  wallet.cleanup();
  if (!getFileStreamPath(Constants.Files.WALLET_KEY_BACKUP_PROTOBUF).exists())   backupWallet();
}

Fixed version (ground truth):
private void afterLoadWallet(){
  wallet.autosaveToFile(walletFile,Constants.Files.WALLET_AUTOSAVE_DELAY_MS,TimeUnit.MILLISECONDS,null);
  try {
    wallet.cleanup();
  }
 catch (  IllegalStateException x) {
    if (x.getMessage().contains("String_Node_Str")) {
      File blockChainFile=new File(getDir("String_Node_Str",Context.MODE_PRIVATE),Constants.Files.BLOCKCHAIN_FILENAME);
      blockChainFile.delete();
    }
 else     throw x;
  }
  if (!getFileStreamPath(Constants.Files.WALLET_KEY_BACKUP_PROTOBUF).exists())   backupWallet();
}
Program: 124505
Project: 124505
Buggy source:
public static void showSoftKeyboard(Activity activity,View view){
  if (view.requestFocus()) {
    InputMethodManager imm=(InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
    boolean isShowing=imm.showSoftInput(view,InputMethodManager.SHOW_IMPLICIT);
    if (!isShowing) {
      activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
    }
  }
}

Fixed version (ground truth):
public static void showSoftKeyboard(Activity activity,View view){
  if (activity != null && view.requestFocus()) {
    InputMethodManager imm=(InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
    boolean isShowing=imm.showSoftInput(view,InputMethodManager.SHOW_IMPLICIT);
    if (!isShowing) {
      activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
    }
  }
}