nus-yam/ex-repair huggingface dataset:
Program: 124420
Project: 124420
Buggy source:
/** 
 * Advances to the next token.
 */
private void advanceToken(){
  if (nextChar < 0) {
    next=null;
    return;
  }
  try {
    int state=0;
    StringBuilder value=new StringBuilder();
    int tLine=line;
    int tLineOffset=lineOffset;
    int _fakeNextChar=nextChar > 127 ? NFA.UNICODE_ESCAPE : nextChar;
    while (dfa.transitions[state].containsKey(_fakeNextChar)) {
      if (nextChar < 0)       value.append((char)nextChar);
 else       value.appendCodePoint(nextChar);
      state=dfa.transitions[state].get(_fakeNextChar);
      line=reader.line;
      lineOffset=reader.lineOffset;
      nextChar=reader.read();
      _fakeNextChar=nextChar > 127 ? NFA.UNICODE_ESCAPE : nextChar;
    }
    if (line < 0)     throw new IllegalStateException("String_Node_Str");
    if (dfa.finals[state] != CompiledDFA.NOFINAL) {
      if (state == 0)       throw new TokenException(file,line,lineOffset,(char)nextChar);
      next=process(new Token(value.toString(),dfa.finals[state],new ZenPosition(file,tLine,tLineOffset)));
    }
 else {
      if (nextChar < 0 && value.length() == 0) {
        return;
      }
      throw new TokenException(file,line,lineOffset,(char)nextChar);
    }
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Advances to the next token.
 */
private void advanceToken(){
  if (nextChar < 0) {
    next=null;
    return;
  }
  try {
    int state=0;
    StringBuilder value=new StringBuilder();
    int tLine=line;
    int tLineOffset=lineOffset;
    while (dfa.transitions[state].containsKey(nextChar)) {
      value.append((char)nextChar);
      state=dfa.transitions[state].get(nextChar);
      line=reader.line;
      lineOffset=reader.lineOffset;
      nextChar=reader.read();
    }
    if (line < 0)     throw new IllegalStateException("String_Node_Str");
    if (dfa.finals[state] != CompiledDFA.NOFINAL) {
      if (state == 0)       throw new TokenException(file,line,lineOffset,(char)nextChar);
      next=process(new Token(value.toString(),dfa.finals[state],new ZenPosition(file,tLine,tLineOffset)));
    }
 else {
      if (nextChar < 0 && value.length() == 0) {
        return;
      }
      throw new TokenException(file,line,lineOffset,(char)nextChar);
    }
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
}
Program: 124422
Project: 124422
Buggy source:
@Override public void compile(IEnvironmentMethod environment){
  Expression cList=list.compile(environment,ZenType.ANYARRAY).eval(environment);
  ZenType listType=cList.getType();
  IZenIterator iterator=listType.makeIterator(varnames.length,environment);
  if (iterator == null) {
    environment.error(getPosition(),"String_Node_Str" + varnames.length + "String_Node_Str");
    return;
  }
  MethodOutput methodOutput=environment.getOutput();
  environment.getOutput().position(getPosition());
  IEnvironmentMethod local=new EnvironmentScope(environment);
  int[] localVariables=new int[varnames.length];
  for (int i=0; i < localVariables.length; i++) {
    SymbolLocal localVar=new SymbolLocal(iterator.getType(i),true);
    local.putValue(varnames[i],localVar,getPosition());
    localVariables[i]=local.getLocal(localVar);
  }
  cList.compile(true,environment);
  iterator.compileStart(localVariables);
  Label repeat=new Label();
  Label exit=new Label();
  methodOutput.label(repeat);
  iterator.compilePreIterate(localVariables,exit);
  body.compile(local);
  iterator.compilePostIterate(localVariables,exit,repeat);
  methodOutput.label(exit);
  iterator.compileEnd();
}

Fixed version (ground truth):
@Override public void compile(IEnvironmentMethod environment){
  Expression cList=list.compile(environment,ZenType.ANYARRAY).eval(environment);
  ZenType listType=cList.getType();
  IZenIterator iterator=listType.makeIterator(varnames.length,environment);
  if (iterator == null) {
    environment.error(getPosition(),"String_Node_Str" + varnames.length + "String_Node_Str");
    return;
  }
  MethodOutput methodOutput=environment.getOutput();
  environment.getOutput().position(getPosition());
  IEnvironmentMethod local=new EnvironmentScope(environment);
  int[] localVariables=new int[varnames.length];
  for (int i=0; i < localVariables.length; i++) {
    SymbolLocal localVar=new SymbolLocal(iterator.getType(i),true);
    local.putValue(varnames[i],localVar,getPosition());
    localVariables[i]=local.getLocal(localVar);
  }
  cList.compile(true,environment);
  iterator.compileStart(localVariables);
  Label repeat=new Label();
  Label exit=new Label();
  methodOutput.label(repeat);
  iterator.compilePreIterate(localVariables,exit);
  body.compile(local);
  iterator.compilePostIterate(localVariables,exit,repeat);
  methodOutput.label(exit);
}
Program: 124423
Project: 124423
Buggy source:
@Override public void signalLockError(){
  MineTweakerAPI.getLogger().logError("String_Node_Str");
  if (Minecraft.isGuiEnabled()) {
    Minecraft.getMinecraft().displayGuiScreen(new GuiCannotRemodify("String_Node_Str","String_Node_Str","String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void signalLockError(){
  MineTweakerAPI.getLogger().logError("String_Node_Str");
  if (Minecraft.isGuiEnabled()) {
  }
}
Program: 124424
Project: 124424
Buggy source:
@Override public int getBurnTime(ItemStack fuel){
  IItemStack stack=new MCItemStack(fuel);
  String name=fuel.getUnlocalizedName();
  if (quickList.containsKey(name)) {
    for (    SetFuelPattern override : quickList.get(name)) {
      if (override.getPattern().matches(stack)) {
        return override.getValue();
      }
    }
  }
  int max=0;
  for (  IFuelHandler handler : original) {
    max=Math.max(max,handler.getBurnTime(fuel));
  }
  return max;
}

Fixed version (ground truth):
@Override public int getBurnTime(ItemStack fuel){
  if (quickList.containsKey(fuel.getItem())) {
    IItemStack stack=MineTweakerMC.getIItemStack(fuel);
    for (    SetFuelPattern override : quickList.get(fuel.getItem())) {
      if (override.getPattern().matches(stack)) {
        return override.getValue();
      }
    }
  }
  int max=0;
  for (  IFuelHandler handler : original) {
    max=Math.max(max,handler.getBurnTime(fuel));
  }
  return max;
}
Program: 124425
Project: 124425
Buggy source:
public void removeFuelPattern(SetFuelPattern pattern){
  for (  IItemStack item : pattern.getPattern().getItems()) {
    if (!quickList.containsKey(item.getName())) {
      quickList.put(item.getName(),new ArrayList<SetFuelPattern>());
    }
    quickList.get(item.getName()).add(pattern);
  }
}

Fixed version (ground truth):
public void removeFuelPattern(SetFuelPattern pattern){
  for (  IItemStack item : pattern.getPattern().getItems()) {
    ItemStack itemStack=MineTweakerMC.getItemStack(item);
    Item mcItem=itemStack.getItem();
    if (quickList.containsKey(mcItem)) {
      quickList.get(mcItem).remove(pattern);
    }
  }
}
Program: 124426
Project: 124426
Buggy source:
public void addFuelPattern(SetFuelPattern pattern){
  List<IItemStack> items=pattern.getPattern().getItems();
  if (items == null) {
    MineTweakerAPI.logError("String_Node_Str");
    return;
  }
  for (  IItemStack item : pattern.getPattern().getItems()) {
    if (!quickList.containsKey(item.getName())) {
      quickList.put(item.getName(),new ArrayList<SetFuelPattern>());
    }
    quickList.get(item.getName()).add(pattern);
  }
}

Fixed version (ground truth):
public void addFuelPattern(SetFuelPattern pattern){
  List<IItemStack> items=pattern.getPattern().getItems();
  if (items == null) {
    MineTweakerAPI.logError("String_Node_Str");
    return;
  }
  for (  IItemStack item : pattern.getPattern().getItems()) {
    ItemStack itemStack=MineTweakerMC.getItemStack(item);
    Item mcItem=itemStack.getItem();
    if (!quickList.containsKey(mcItem)) {
      quickList.put(mcItem,new ArrayList<SetFuelPattern>());
    }
    quickList.get(mcItem).add(pattern);
  }
}
Program: 124427
Project: 124427
Buggy source:
@Override public int getBurnTime(ItemStack fuel){
  IItemStack stack=getIItemStack(fuel);
  String name=fuel.getUnlocalizedName();
  if (quickList.containsKey(name)) {
    for (    SetFuelPattern override : quickList.get(name)) {
      if (override.getPattern().matches(stack)) {
        return override.getValue();
      }
    }
  }
  int max=0;
  for (  IFuelHandler handler : original) {
    max=Math.max(max,handler.getBurnTime(fuel));
  }
  return max;
}

Fixed version (ground truth):
@Override public int getBurnTime(ItemStack fuel){
  if (quickList.containsKey(fuel.getItem())) {
    IItemStack stack=MineTweakerMC.getIItemStack(fuel);
    for (    SetFuelPattern override : quickList.get(fuel.getItem())) {
      if (override.getPattern().matches(stack)) {
        return override.getValue();
      }
    }
  }
  int max=0;
  for (  IFuelHandler handler : original) {
    max=Math.max(max,handler.getBurnTime(fuel));
  }
  return max;
}
Program: 124428
Project: 124428
Buggy source:
public void removeFuelPattern(SetFuelPattern pattern){
  for (  IItemStack item : pattern.getPattern().getItems()) {
    if (!quickList.containsKey(item.getName())) {
      quickList.put(item.getName(),new ArrayList<SetFuelPattern>());
    }
    quickList.get(item.getName()).add(pattern);
  }
}

Fixed version (ground truth):
public void removeFuelPattern(SetFuelPattern pattern){
  for (  IItemStack item : pattern.getPattern().getItems()) {
    ItemStack itemStack=MineTweakerMC.getItemStack(item);
    Item mcItem=itemStack.getItem();
    if (quickList.containsKey(mcItem)) {
      quickList.get(mcItem).remove(pattern);
    }
  }
}
Program: 124429
Project: 124429
Buggy source:
public void addFuelPattern(SetFuelPattern pattern){
  List<IItemStack> items=pattern.getPattern().getItems();
  if (items == null) {
    MineTweakerAPI.logError("String_Node_Str");
    return;
  }
  for (  IItemStack item : pattern.getPattern().getItems()) {
    if (!quickList.containsKey(item.getName())) {
      quickList.put(item.getName(),new ArrayList<SetFuelPattern>());
    }
    quickList.get(item.getName()).add(pattern);
  }
}

Fixed version (ground truth):
public void addFuelPattern(SetFuelPattern pattern){
  List<IItemStack> items=pattern.getPattern().getItems();
  if (items == null) {
    MineTweakerAPI.logError("String_Node_Str");
    return;
  }
  for (  IItemStack item : pattern.getPattern().getItems()) {
    ItemStack itemStack=MineTweakerMC.getItemStack(item);
    Item mcItem=itemStack.getItem();
    if (!quickList.containsKey(mcItem)) {
      quickList.put(mcItem,new ArrayList<SetFuelPattern>());
    }
    quickList.get(mcItem).add(pattern);
  }
}
Program: 124430
Project: 124430
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;
    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);
    Set<CtMethod> methods=findAllMethods(resolveCtClass,new HashSet<CtMethod>());
    for (    CtMethod method : methods) {
      DelegateCode annotation=(DelegateCode)method.getAnnotation(DelegateCode.class);
      if (annotation != null && annotation.ignore())       continue;
      if (!method.getDeclaringClass().equals(objectCtClass))       cc.addMethod(createDelegateMethod(interface1,cc,scriptHelperClass,method,annotation));
    }
    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);
    cc.addInterface(resolveCtClass(Keep.class));
    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);
    Set<CtMethod> methods=findAllMethods(resolveCtClass,new HashSet<CtMethod>());
    for (    CtMethod method : methods) {
      DelegateCode annotation=(DelegateCode)method.getAnnotation(DelegateCode.class);
      if (annotation != null && annotation.ignore())       continue;
      if (!method.getDeclaringClass().equals(objectCtClass))       cc.addMethod(createDelegateMethod(interface1,cc,scriptHelperClass,method,annotation));
    }
    return cc;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 124431
Project: 124431
Buggy source:
/** 
 * Returns the enum constant of the specified enum type with the specified name. Note: This method (signature only) is required by the JDK compiler!
 */
public static <T extends Enum<T>>T valueOf(Class<T> enumType,String name){
  ScriptHelper.put("String_Node_Str",enumType,null);
  ScriptHelper.put("String_Node_Str",name,null);
  return (T)ScriptHelper.eval("String_Node_Str",null);
}

Fixed version (ground truth):
/** 
 * Returns the enum constant of the specified enum type with the specified name. Note: This method (signature only) is required by the JDK compiler!
 */
public static <T extends Enum<T>>T valueOf(Class<T> enumType,String name){
  String enumDragomeName=NamingUtils.javaToDragomeNotation(enumType);
  ScriptHelper.put("String_Node_Str",enumType,null);
  ScriptHelper.put("String_Node_Str",enumDragomeName,null);
  ScriptHelper.put("String_Node_Str",name,null);
  return (T)ScriptHelper.eval("String_Node_Str",null);
}
Program: 124432
Project: 124432
Buggy source:
/** 
 * Creates a matcher that will match the given input against this pattern.
 */
public Matcher matcher(CharSequence input){
  return new Matcher(ScriptHelper.eval("String_Node_Str",this),input);
}

Fixed version (ground truth):
/** 
 * Creates a matcher that will match the given input against this pattern.
 */
public Matcher matcher(CharSequence input){
  regex=regex.replace("String_Node_Str","String_Node_Str");
  return new Matcher(ScriptHelper.eval("String_Node_Str",this),input);
}
Program: 124433
Project: 124433
Buggy source:
protected void runChild(FrameworkMethod child,RunNotifier notifier){
  Description spec1=Description.createTestDescription(clazz,child.getName());
  String sourceCode="String_Node_Str" + javaToDragomeNotation(clazz) + "String_Node_Str"+ javaMethodNameToDragomeNotation(child.getName())+ "String_Node_Str";
  ScriptResult executeJavaScript=page.executeJavaScript(sourceCode);
  String resultSource="String_Node_Str";
  executeJavaScript=page.executeJavaScript(resultSource);
  notifier.fireTestStarted(spec1);
  if (executeJavaScript.getJavaScriptResult().toString().equals("String_Node_Str"))   notifier.fireTestFailure(new Failure(spec1,new Exception("String_Node_Str")));
 else   notifier.fireTestFinished(spec1);
  failed=false;
}

Fixed version (ground truth):
protected void runChild(FrameworkMethod child,RunNotifier notifier){
  Description spec1=Description.createTestDescription(clazz,child.getName());
  String sourceCode="String_Node_Str" + NamingUtils.javaToDragomeNotation(clazz) + "String_Node_Str"+ javaMethodNameToDragomeNotation(child.getName())+ "String_Node_Str";
  ScriptResult executeJavaScript=page.executeJavaScript(sourceCode);
  String resultSource="String_Node_Str";
  executeJavaScript=page.executeJavaScript(resultSource);
  notifier.fireTestStarted(spec1);
  if (executeJavaScript.getJavaScriptResult().toString().equals("String_Node_Str"))   notifier.fireTestFailure(new Failure(spec1,new Exception("String_Node_Str")));
 else   notifier.fireTestFinished(spec1);
  failed=false;
}
Program: 124434
Project: 124434
Buggy source:
public static void compileWithMainClass(Classpath classPath,String target){
  ServiceLocator serviceLocator=ServiceLocator.getInstance();
  DragomeConfigurator configurator=serviceLocator.getConfigurator();
  String mainClassName=VisualActivity.class.getName();
  CompilerType defaultCompilerType=configurator.getDefaultCompilerType();
  BytecodeTransformer bytecodeTransformer=configurator.getBytecodeTransformer();
  ClasspathFileFilter classpathFilter=configurator.getClasspathFilter();
  if (classpathFilter == null)   classpathFilter=new DefaultClasspathFileFilter();
  BytecodeToJavascriptCompiler bytecodeToJavascriptCompiler=WebServiceLocator.getInstance().getBytecodeToJavascriptCompiler();
  configurator.sortClassPath(classPath);
  classPath=process(classPath,configurator);
  List<ClasspathEntry> extraClasspath=configurator.getExtraClasspath(classPath);
  classPath.addEntries(extraClasspath);
  BytecodeToJavascriptCompilerConfiguration compilerConfiguration=new BytecodeToJavascriptCompilerConfiguration(classPath,target,mainClassName,defaultCompilerType,bytecodeTransformer,classpathFilter,configurator.isCheckingCast(),configurator.isCaching());
  bytecodeToJavascriptCompiler.configure(compilerConfiguration);
  bytecodeToJavascriptCompiler.compile();
}

Fixed version (ground truth):
public static void compileWithMainClass(Classpath classPath,String target){
  ServiceLocator serviceLocator=ServiceLocator.getInstance();
  DragomeConfigurator configurator=serviceLocator.getConfigurator();
  String mainClassName=VisualActivity.class.getName();
  CompilerType defaultCompilerType=configurator.getDefaultCompilerType();
  BytecodeTransformer bytecodeTransformer=configurator.getBytecodeTransformer();
  ClasspathFileFilter classpathFilter=configurator.getClasspathFilter();
  if (classpathFilter == null)   classpathFilter=new DefaultClasspathFileFilter();
  BytecodeToJavascriptCompiler bytecodeToJavascriptCompiler=WebServiceLocator.getInstance().getBytecodeToJavascriptCompiler();
  List<ClasspathEntry> extraClasspath=configurator.getExtraClasspath(classPath);
  classPath.addEntries(extraClasspath);
  configurator.sortClassPath(classPath);
  classPath=process(classPath,configurator);
  BytecodeToJavascriptCompilerConfiguration compilerConfiguration=new BytecodeToJavascriptCompilerConfiguration(classPath,target,mainClassName,defaultCompilerType,bytecodeTransformer,classpathFilter,configurator.isCheckingCast(),configurator.isCaching());
  bytecodeToJavascriptCompiler.configure(compilerConfiguration);
  bytecodeToJavascriptCompiler.compile();
}
Program: 124435
Project: 124435
Buggy source:
private String normalizeAccess(FieldAccess fr){
  String prefix="String_Node_Str";
  if (fr.getFirstChild() instanceof FieldRead) {
    FieldRead fieldRead=(FieldRead)fr.getFirstChild();
  }
  if (fr.getType() == null && "String_Node_Str".equals(fr.getName()))   prefix="String_Node_Str";
  String name=prefix + fr.getName();
  if (!fr.getName().matches("String_Node_Str")) {
    return "String_Node_Str" + name + FIELD_TYPE_SEPARATOR+ normalizeExpression(fr.getFieldType())+ "String_Node_Str";
  }
  return "String_Node_Str" + name + FIELD_TYPE_SEPARATOR+ normalizeExpression(fr.getFieldType());
}

Fixed version (ground truth):
private String normalizeAccess(FieldAccess fr){
  String prefix="String_Node_Str";
  if (fr.getFirstChild() instanceof FieldRead) {
    FieldRead fieldRead=(FieldRead)fr.getFirstChild();
  }
  if (fr.getType() == null && "String_Node_Str".equals(fr.getName()))   prefix="String_Node_Str";
  String name=prefix + fr.getName();
  String name2=name;
  if (!prefix.equals("String_Node_Str"))   name2+=FIELD_TYPE_SEPARATOR + normalizeExpression(fr.getFieldType());
  if (!fr.getName().matches("String_Node_Str")) {
    return "String_Node_Str" + name2 + "String_Node_Str";
  }
  return "String_Node_Str" + name2;
}
Program: 124436
Project: 124436
Buggy source:
private void bracket(ASTNode node,InfixExpression.Operator op){
  if ((node instanceof InfixExpression && ((InfixExpression)node).getOperator() == op) || node instanceof NumberLiteral || node instanceof NullLiteral|| node instanceof FieldAccess|| node instanceof VariableBinding) {
    node.visit(this);
  }
 else {
    print("String_Node_Str");
    node.visit(this);
    print("String_Node_Str");
  }
}

Fixed version (ground truth):
private void bracket(ASTNode node,InfixExpression.Operator op){
  boolean b=false;
  if (b || node instanceof NumberLiteral || node instanceof NullLiteral|| node instanceof FieldAccess|| node instanceof VariableBinding) {
    node.visit(this);
  }
 else {
    print("String_Node_Str");
    node.visit(this);
    print("String_Node_Str");
  }
}
Program: 124437
Project: 124437
Buggy source:
private void bracket(ASTNode node,InfixExpression.Operator op){
  if ((node instanceof InfixExpression && ((InfixExpression)node).getOperator() == op) || node instanceof NumberLiteral || node instanceof NullLiteral|| node instanceof FieldAccess|| node instanceof VariableBinding) {
    node.visit(this);
  }
 else {
    print("String_Node_Str");
    node.visit(this);
    print("String_Node_Str");
  }
}

Fixed version (ground truth):
private void bracket(ASTNode node,InfixExpression.Operator op){
  boolean b=false;
  if (b || node instanceof NumberLiteral || node instanceof NullLiteral|| node instanceof FieldAccess|| node instanceof VariableBinding) {
    node.visit(this);
  }
 else {
    print("String_Node_Str");
    node.visit(this);
    print("String_Node_Str");
  }
}
Program: 124440
Project: 124440
Buggy source:
public String getSubTypeExtractorFor(Class<?> interface1,String methodName){
  if (interface1.equals(HTMLCanvasElement.class) && methodName.equals("String_Node_Str"))   return "String_Node_Str";
 else   if (methodName.equals("String_Node_Str") || methodName.equals("String_Node_Str"))   return "String_Node_Str";
  return null;
}

Fixed version (ground truth):
public String getSubTypeExtractorFor(Class<?> interface1,String methodName){
  if (HTMLCanvasElement.class.isAssignableFrom(interface1) && methodName.equals("String_Node_Str"))   return "String_Node_Str";
 else   if (methodName.equals("String_Node_Str") || methodName.equals("String_Node_Str"))   return "String_Node_Str";
  return null;
}
Program: 124441
Project: 124441
Buggy source:
public Class<? extends SubTypeFactory> getSubTypeFactoryClassFor(Class<?> interface1,String methodName){
  if (methodName.equals("String_Node_Str") || methodName.equals("String_Node_Str"))   return NodeSubTypeFactory.class;
 else   if (interface1.equals(HTMLCanvasElement.class) && methodName.equals("String_Node_Str"))   return ContextSubTypeFactory.class;
  return null;
}

Fixed version (ground truth):
public Class<? extends SubTypeFactory> getSubTypeFactoryClassFor(Class<?> interface1,String methodName){
  if (methodName.equals("String_Node_Str") || methodName.equals("String_Node_Str"))   return NodeSubTypeFactory.class;
 else   if (HTMLCanvasElement.class.isAssignableFrom(interface1) && methodName.equals("String_Node_Str"))   return ContextSubTypeFactory.class;
  return null;
}
Program: 124442
Project: 124442
Buggy source:
@SuppressWarnings("String_Node_Str") public static <T>T createFrom(Object instance,Class<T> type){
  try {
    ScriptHelper.put("String_Node_Str",instance,null);
    if (type.equals(Float.class))     return (T)new Float(ScriptHelper.evalFloat("String_Node_Str",null));
 else     if (type.equals(Integer.class))     return (T)new Integer(ScriptHelper.evalInt("String_Node_Str",null));
 else     if (type.equals(Double.class))     return (T)new Double(ScriptHelper.evalDouble("String_Node_Str",null));
 else     if (type.equals(Long.class))     return (T)new Long(ScriptHelper.evalLong("String_Node_Str",null));
 else     if (type.equals(Boolean.class))     return (T)new Boolean(ScriptHelper.evalBoolean("String_Node_Str",null));
 else     if (type.equals(Short.class))     return (T)new Short((short)ScriptHelper.evalInt("String_Node_Str",null));
 else     if (type.equals(String.class))     return (T)ScriptHelper.eval("String_Node_Str",null);
 else {
      String delegateClassName=JsDelegateGenerator.createDelegateClassName(type.getName());
      Class<?> class2=Class.forName(delegateClassName);
      Object newInstance=class2.newInstance();
      ScriptHelper.put("String_Node_Str",newInstance,null);
      ScriptHelper.eval("String_Node_Str",null);
      return (T)newInstance;
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T>T createFrom(Object instance,Class<T> type){
  try {
    if (instance == null)     return null;
    ScriptHelper.put("String_Node_Str",instance,null);
    if (type.equals(Float.class))     return (T)new Float(ScriptHelper.evalFloat("String_Node_Str",null));
 else     if (type.equals(Integer.class))     return (T)new Integer(ScriptHelper.evalInt("String_Node_Str",null));
 else     if (type.equals(Double.class))     return (T)new Double(ScriptHelper.evalDouble("String_Node_Str",null));
 else     if (type.equals(Long.class))     return (T)new Long(ScriptHelper.evalLong("String_Node_Str",null));
 else     if (type.equals(Boolean.class))     return (T)new Boolean(ScriptHelper.evalBoolean("String_Node_Str",null));
 else     if (type.equals(Short.class))     return (T)new Short((short)ScriptHelper.evalInt("String_Node_Str",null));
 else     if (type.equals(String.class))     return (T)ScriptHelper.eval("String_Node_Str",null);
 else {
      String delegateClassName=JsDelegateGenerator.createDelegateClassName(type.getName());
      Class<?> class2=Class.forName(delegateClassName);
      Object newInstance=class2.newInstance();
      ScriptHelper.put("String_Node_Str",newInstance,null);
      ScriptHelper.eval("String_Node_Str",null);
      return (T)newInstance;
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 124443
Project: 124443
Buggy source:
public static <T>T createFromNode(Object instance,Class<T> type){
  try {
    String delegateClassName=JsDelegateGenerator.createDelegateClassName(type.getName());
    Class<?> class2=Class.forName(delegateClassName);
    Object newInstance=class2.newInstance();
    ScriptHelper.put("String_Node_Str",newInstance,null);
    ScriptHelper.put("String_Node_Str",instance,null);
    ScriptHelper.eval("String_Node_Str",null);
    return (T)newInstance;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public static <T>T createFromNode(Object instance,Class<T> type){
  try {
    if (instance == null)     return null;
    String delegateClassName=JsDelegateGenerator.createDelegateClassName(type.getName());
    Class<?> class2=Class.forName(delegateClassName);
    Object newInstance=class2.newInstance();
    ScriptHelper.put("String_Node_Str",newInstance,null);
    ScriptHelper.put("String_Node_Str",instance,null);
    ScriptHelper.eval("String_Node_Str",null);
    return (T)newInstance;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 124444
Project: 124444
Buggy source:
public String getSubTypeExtractorFor(Class<?> interface1,String methodName){
  if (interface1.equals(HTMLCanvasElement.class) && methodName.equals("String_Node_Str"))   return "String_Node_Str";
 else   if (methodName.equals("String_Node_Str") || methodName.equals("String_Node_Str"))   return "String_Node_Str";
  return null;
}

Fixed version (ground truth):
public String getSubTypeExtractorFor(Class<?> interface1,String methodName){
  if (HTMLCanvasElement.class.isAssignableFrom(interface1) && methodName.equals("String_Node_Str"))   return "String_Node_Str";
 else   if (methodName.equals("String_Node_Str") || methodName.equals("String_Node_Str"))   return "String_Node_Str";
  return null;
}
Program: 124445
Project: 124445
Buggy source:
public Class<? extends SubTypeFactory> getSubTypeFactoryClassFor(Class<?> interface1,String methodName){
  if (methodName.equals("String_Node_Str") || methodName.equals("String_Node_Str"))   return NodeSubTypeFactory.class;
 else   if (interface1.equals(HTMLCanvasElement.class) && methodName.equals("String_Node_Str"))   return ContextSubTypeFactory.class;
  return null;
}

Fixed version (ground truth):
public Class<? extends SubTypeFactory> getSubTypeFactoryClassFor(Class<?> interface1,String methodName){
  if (methodName.equals("String_Node_Str") || methodName.equals("String_Node_Str"))   return NodeSubTypeFactory.class;
 else   if (HTMLCanvasElement.class.isAssignableFrom(interface1) && methodName.equals("String_Node_Str"))   return ContextSubTypeFactory.class;
  return null;
}
Program: 124446
Project: 124446
Buggy source:
@SuppressWarnings("String_Node_Str") public static <T>T createFrom(Object instance,Class<T> type){
  try {
    ScriptHelper.put("String_Node_Str",instance,null);
    if (type.equals(Float.class))     return (T)new Float(ScriptHelper.evalFloat("String_Node_Str",null));
 else     if (type.equals(Integer.class))     return (T)new Integer(ScriptHelper.evalInt("String_Node_Str",null));
 else     if (type.equals(Double.class))     return (T)new Double(ScriptHelper.evalDouble("String_Node_Str",null));
 else     if (type.equals(Long.class))     return (T)new Long(ScriptHelper.evalLong("String_Node_Str",null));
 else     if (type.equals(Boolean.class))     return (T)new Boolean(ScriptHelper.evalBoolean("String_Node_Str",null));
 else     if (type.equals(Short.class))     return (T)new Short((short)ScriptHelper.evalInt("String_Node_Str",null));
 else     if (type.equals(String.class))     return (T)ScriptHelper.eval("String_Node_Str",null);
 else {
      String delegateClassName=JsDelegateGenerator.createDelegateClassName(type.getName());
      Class<?> class2=Class.forName(delegateClassName);
      Object newInstance=class2.newInstance();
      ScriptHelper.put("String_Node_Str",newInstance,null);
      ScriptHelper.eval("String_Node_Str",null);
      return (T)newInstance;
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T>T createFrom(Object instance,Class<T> type){
  try {
    if (instance == null)     return null;
    ScriptHelper.put("String_Node_Str",instance,null);
    if (type.equals(Float.class))     return (T)new Float(ScriptHelper.evalFloat("String_Node_Str",null));
 else     if (type.equals(Integer.class))     return (T)new Integer(ScriptHelper.evalInt("String_Node_Str",null));
 else     if (type.equals(Double.class))     return (T)new Double(ScriptHelper.evalDouble("String_Node_Str",null));
 else     if (type.equals(Long.class))     return (T)new Long(ScriptHelper.evalLong("String_Node_Str",null));
 else     if (type.equals(Boolean.class))     return (T)new Boolean(ScriptHelper.evalBoolean("String_Node_Str",null));
 else     if (type.equals(Short.class))     return (T)new Short((short)ScriptHelper.evalInt("String_Node_Str",null));
 else     if (type.equals(String.class))     return (T)ScriptHelper.eval("String_Node_Str",null);
 else {
      String delegateClassName=JsDelegateGenerator.createDelegateClassName(type.getName());
      Class<?> class2=Class.forName(delegateClassName);
      Object newInstance=class2.newInstance();
      ScriptHelper.put("String_Node_Str",newInstance,null);
      ScriptHelper.eval("String_Node_Str",null);
      return (T)newInstance;
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 124447
Project: 124447
Buggy source:
public static <T>T createFromNode(Object instance,Class<T> type){
  try {
    String delegateClassName=JsDelegateGenerator.createDelegateClassName(type.getName());
    Class<?> class2=Class.forName(delegateClassName);
    Object newInstance=class2.newInstance();
    ScriptHelper.put("String_Node_Str",newInstance,null);
    ScriptHelper.put("String_Node_Str",instance,null);
    ScriptHelper.eval("String_Node_Str",null);
    return (T)newInstance;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public static <T>T createFromNode(Object instance,Class<T> type){
  try {
    if (instance == null)     return null;
    String delegateClassName=JsDelegateGenerator.createDelegateClassName(type.getName());
    Class<?> class2=Class.forName(delegateClassName);
    Object newInstance=class2.newInstance();
    ScriptHelper.put("String_Node_Str",newInstance,null);
    ScriptHelper.put("String_Node_Str",instance,null);
    ScriptHelper.eval("String_Node_Str",null);
    return (T)newInstance;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 124448
Project: 124448
Buggy source:
@MethodAlias(alias="String_Node_Str") public static void executeMainClass() throws Exception {
  try {
    WebServiceLocator.getInstance().setClientSideEnabled(true);
    ServiceLocator.getInstance().setConfigurator(getConfigurator());
    ParametersHandler parametersHandler=ServiceLocator.getInstance().getParametersHandler();
    String className=parametersHandler.getParameter("String_Node_Str");
    if (className == null || className.trim().length() == 0) {
      String requestURL=parametersHandler.getRequestURL();
      List<AnnotationEntry> annotationEntries=AnnotationsHelper.getAnnotationsByType(PageAlias.class).getEntries();
      for (      AnnotationEntry annotationEntry : annotationEntries) {
        if (annotationEntry.getAnnotationKey().equals("String_Node_Str") && requestURL.contains(annotationEntry.getAnnotationValue()))         className=annotationEntry.getType().getName();
      }
    }
    launch(className);
  }
 catch (  Exception e) {
    alert("String_Node_Str" + e.getMessage());
    throw e;
  }
}

Fixed version (ground truth):
@MethodAlias(alias="String_Node_Str") public static void executeMainClass() throws Exception {
  try {
    WebServiceLocator.getInstance().setClientSideEnabled(true);
    ServiceLocator.getInstance().setConfigurator(getConfigurator());
    ParametersHandler parametersHandler=ServiceLocator.getInstance().getParametersHandler();
    String className=parametersHandler.getParameter("String_Node_Str");
    if (className == null || className.trim().length() == 0) {
      String requestURL=parametersHandler.getRequestURL();
      List<AnnotationEntry> annotationEntries=new ArrayList<>(AnnotationsHelper.getAnnotationsByType(PageAlias.class).getEntries());
      className=findDiscovererPage(className,annotationEntries);
      if (className == null)       for (      AnnotationEntry annotationEntry : annotationEntries) {
        boolean isUnique=annotationEntries.size() == 1;
        boolean urlContainsAlias=requestURL.contains(annotationEntry.getAnnotationValue());
        boolean isAliasKey=annotationEntry.getAnnotationKey().equals("String_Node_Str");
        if (isUnique || (isAliasKey && urlContainsAlias))         className=annotationEntry.getType().getName();
      }
    }
    launch(className);
  }
 catch (  Exception e) {
    alert("String_Node_Str" + e.getMessage());
    throw e;
  }
}
Program: 124449
Project: 124449
Buggy source:
@MethodAlias(alias="String_Node_Str") public static void executeMainClass() throws Exception {
  try {
    WebServiceLocator.getInstance().setClientSideEnabled(true);
    ServiceLocator.getInstance().setConfigurator(getConfigurator());
    ParametersHandler parametersHandler=ServiceLocator.getInstance().getParametersHandler();
    String className=parametersHandler.getParameter("String_Node_Str");
    if (className == null || className.trim().length() == 0) {
      String requestURL=parametersHandler.getRequestURL();
      List<AnnotationEntry> annotationEntries=AnnotationsHelper.getAnnotationsByType(PageAlias.class).getEntries();
      for (      AnnotationEntry annotationEntry : annotationEntries) {
        boolean isUnique=annotationEntries.size() == 2 && !"String_Node_Str".equals(annotationEntry.getAnnotationValue());
        if (isUnique || (annotationEntry.getAnnotationKey().equals("String_Node_Str") && requestURL.contains(annotationEntry.getAnnotationValue())))         className=annotationEntry.getType().getName();
      }
    }
    launch(className);
  }
 catch (  Exception e) {
    alert("String_Node_Str" + e.getMessage());
    throw e;
  }
}

Fixed version (ground truth):
@MethodAlias(alias="String_Node_Str") public static void executeMainClass() throws Exception {
  try {
    WebServiceLocator.getInstance().setClientSideEnabled(true);
    ServiceLocator.getInstance().setConfigurator(getConfigurator());
    ParametersHandler parametersHandler=ServiceLocator.getInstance().getParametersHandler();
    String className=parametersHandler.getParameter("String_Node_Str");
    if (className == null || className.trim().length() == 0) {
      String requestURL=parametersHandler.getRequestURL();
      List<AnnotationEntry> annotationEntries=AnnotationsHelper.getAnnotationsByType(PageAlias.class).getEntries();
      for (      AnnotationEntry annotationEntry : annotationEntries) {
        if (annotationEntry.getAnnotationKey().equals("String_Node_Str") && requestURL.contains(annotationEntry.getAnnotationValue()))         className=annotationEntry.getType().getName();
      }
    }
    launch(className);
  }
 catch (  Exception e) {
    alert("String_Node_Str" + e.getMessage());
    throw e;
  }
}
Program: 124451
Project: 124451
Buggy source:
private void writeClinit(int depth,Writer writer,MemberUnit clinitMethod,List<MemberUnit> staticMethods) throws IOException {
  String superStaticFields=createSuperStaticFieldsReferences(depth,clinitMethod,staticMethods);
  if (clinitMethod != null) {
    String name=DragomeJavaScriptGenerator.normalizeExpression(clinitMethod.getDeclaringClass().getName());
    String replace=clinitMethod.getData().replace("String_Node_Str",name + "String_Node_Str");
    replace=replace.replace("String_Node_Str","String_Node_Str");
    replace=replace.substring(0,replace.length() - 2) + "String_Node_Str";
    String memberData=clinitMethod.getData();
    clinitMethod.setData(replace.replace(STATIC_MEMBER,"String_Node_Str"));
    clinitMethod.write(depth,writer);
    clinitMethod.setData(memberData);
    String modifyMethodName=DragomeJavaScriptGenerator.normalizeExpression(clinitMethod.getSignature());
    project.getClinits().add("String_Node_Str" + name + "String_Node_Str");
  }
 else {
    String replace="String_Node_Str" + superStaticFields + "String_Node_Str";
    writer.write(replace);
  }
}

Fixed version (ground truth):
private void writeClinit(int depth,Writer writer,MemberUnit clinitMethod,List<MemberUnit> staticMethods) throws IOException {
  String superStaticFields=createSuperStaticFieldsReferences(depth,clinitMethod,staticMethods);
  if (clinitMethod != null) {
    String name=DragomeJavaScriptGenerator.normalizeExpression(clinitMethod.getDeclaringClass().getName());
    String replace=clinitMethod.getData().replace("String_Node_Str",name + "String_Node_Str");
    replace=replace.replaceFirst("String_Node_Str","String_Node_Str" + superStaticFields.replace("String_Node_Str","String_Node_Str"));
    replace=replace.substring(0,replace.length() - 2) + "String_Node_Str";
    String memberData=clinitMethod.getData();
    clinitMethod.setData(replace.replace(STATIC_MEMBER,"String_Node_Str"));
    clinitMethod.write(depth,writer);
    clinitMethod.setData(memberData);
    String modifyMethodName=DragomeJavaScriptGenerator.normalizeExpression(clinitMethod.getSignature());
    project.getClinits().add("String_Node_Str" + name + "String_Node_Str");
  }
 else {
    String replace="String_Node_Str" + superStaticFields + "String_Node_Str";
    writer.write(replace);
  }
}
Program: 124455
Project: 124455
Buggy source:
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(){
      DirectoryWatcher.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();
  if (c instanceof URLClassLoader) {
    URLClassLoader urlClassLoader=(URLClassLoader)c;
    URL[] urls=urlClassLoader.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(){
        DirectoryWatcher.main(new String[]{"String_Node_Str",classesFolder2},classPath.toString(),path);
      }
    }
.start();
  }
 else   LOGGER.log(Level.SEVERE,"String_Node_Str");
}
Program: 124456
Project: 124456
Buggy source:
private String normalizeAccess(FieldAccess fr){
  String prefix="String_Node_Str";
  if (fr.getFirstChild() instanceof FieldRead) {
    FieldRead fieldRead=(FieldRead)fr.getFirstChild();
  }
  if ("String_Node_Str".equals(fr.getName())) {
    if (!fr.getTypeBinding().equals(Type.UNKNOWN))     System.out.println("String_Node_Str");
    prefix="String_Node_Str";
  }
  String name=prefix + fr.getName();
  if (!fr.getName().matches("String_Node_Str")) {
    return "String_Node_Str" + name + "String_Node_Str";
  }
  return "String_Node_Str" + name;
}

Fixed version (ground truth):
private String normalizeAccess(FieldAccess fr){
  String prefix="String_Node_Str";
  if (fr.getFirstChild() instanceof FieldRead) {
    FieldRead fieldRead=(FieldRead)fr.getFirstChild();
  }
  if ("String_Node_Str".equals(fr.getName())) {
    prefix="String_Node_Str";
  }
  String name=prefix + fr.getName();
  if (!fr.getName().matches("String_Node_Str")) {
    return "String_Node_Str" + name + "String_Node_Str";
  }
  return "String_Node_Str" + name;
}
Program: 124457
Project: 124457
Buggy source:
private void writeClinit(int depth,Writer writer,MemberUnit clinitMethod,List<MemberUnit> staticMethods) throws IOException {
  String superStaticFields=createSuperStaticFieldsReferences(depth,clinitMethod,staticMethods);
  if (clinitMethod != null) {
    String name=DragomeJavaScriptGenerator.normalizeExpression(clinitMethod.getDeclaringClass().getName());
    String replace=clinitMethod.getData().replace("String_Node_Str",name + "String_Node_Str");
    replace=replace.replace("String_Node_Str","String_Node_Str" + superStaticFields);
    replace=replace.substring(0,replace.length() - 2) + "String_Node_Str";
    String memberData=clinitMethod.getData();
    clinitMethod.setData(replace.replace(STATIC_MEMBER,"String_Node_Str"));
    clinitMethod.write(depth,writer);
    clinitMethod.setData(memberData);
    String modifyMethodName=DragomeJavaScriptGenerator.normalizeExpression(clinitMethod.getSignature());
    project.getClinits().add("String_Node_Str" + name + "String_Node_Str");
  }
 else {
    String replace="String_Node_Str" + superStaticFields + "String_Node_Str";
    writer.write(replace);
  }
}

Fixed version (ground truth):
private void writeClinit(int depth,Writer writer,MemberUnit clinitMethod,List<MemberUnit> staticMethods) throws IOException {
  String superStaticFields=createSuperStaticFieldsReferences(depth,clinitMethod,staticMethods);
  if (clinitMethod != null) {
    String name=DragomeJavaScriptGenerator.normalizeExpression(clinitMethod.getDeclaringClass().getName());
    String replace=clinitMethod.getData().replace("String_Node_Str",name + "String_Node_Str");
    replace=replace.replaceFirst("String_Node_Str","String_Node_Str" + superStaticFields.replace("String_Node_Str","String_Node_Str"));
    replace=replace.substring(0,replace.length() - 2) + "String_Node_Str";
    String memberData=clinitMethod.getData();
    clinitMethod.setData(replace.replace(STATIC_MEMBER,"String_Node_Str"));
    clinitMethod.write(depth,writer);
    clinitMethod.setData(memberData);
    String modifyMethodName=DragomeJavaScriptGenerator.normalizeExpression(clinitMethod.getSignature());
    project.getClinits().add("String_Node_Str" + name + "String_Node_Str");
  }
 else {
    String replace="String_Node_Str" + superStaticFields + "String_Node_Str";
    writer.write(replace);
  }
}