nus-yam/ex-repair huggingface dataset:
Program: 37033
Project: 37033
Buggy source:
/** 
 * Return the kind of this tag. similar or synonymous tags.  For most tags, <code>kind()&nbsp;==&nbsp;name()</code>; the following table lists those cases where there is more than one tag of a given kind: <p> <table border="1" cellpadding="4" cellspacing="0"> <tr><th><tt> kind()  </tt></th>  <th><tt> name()      </tt></th></tr> <tr><td><tt> @throws </tt></td>  <td><tt> @throws     </tt></td></tr> <tr><td><tt> @throws </tt></td>  <td><tt> @exception  </tt></td></tr> <tr><td><tt> @see    </tt></td>  <td><tt> @see        </tt></td></tr> <tr><td><tt> @see    </tt></td>  <td><tt> @link       </tt></td></tr> <tr><td><tt> @see    </tt></td>  <td><tt> @linkplain  </tt></td></tr> <tr><td><tt> @serial </tt></td>  <td><tt> @serial     </tt></td></tr> <tr><td><tt> @serial </tt></td>  <td><tt> @serialData </tt></td></tr> </table>
 */
String kind();

Fixed version (ground truth):
/** 
 * Return the kind of this tag. For most tags, <code>kind()&nbsp;==&nbsp;name()</code>; the following table lists those cases where there is more than one tag of a given kind: <p> <table border="1" cellpadding="4" cellspacing="0" summary="related tags"> <tr><th>  {@code kind()  }</th>  <th>  {@code name()      }</th></tr> <tr><td>  {@code @throws }</td>  <td>  {@code @throws     }</td></tr> <tr><td>  {@code @throws }</td>  <td>  {@code @exception  }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @see        }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @link       }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @linkplain  }</td></tr> <tr><td>  {@code @serial }</td>  <td>  {@code @serial     }</td></tr> <tr><td>  {@code @serial }</td>  <td>  {@code @serialData }</td></tr> </table>
 * @return the kind of this tag.
 */
String kind();
Program: 37034
Project: 37034
Buggy source:
/** 
 * Return the name of this tag.  The name is the string starting with "@" that is used in a doc comment, such as <code>@return</code>.  For inline tags, such as <code>{&#064;link}</code>, the curly brackets are not part of the name, so in this example the name would be simply <code>@link</code>.
 */
String name();

Fixed version (ground truth):
/** 
 * Return the name of this tag.  The name is the string starting with "@" that is used in a doc comment, such as <code>@return</code>.  For inline tags, such as <code>{&#064;link}</code>, the curly brackets are not part of the name, so in this example the name would be simply <code>@link</code>.
 * @return the name of this tag
 */
String name();
Program: 37035
Project: 37035
Buggy source:
/** 
 * Return the containing   {@link Doc} of this Tag element.
 */
Doc holder();

Fixed version (ground truth):
/** 
 * Return the containing   {@link Doc} of this Tag element.
 * @return the containing {@link Doc} of this Tag element
 */
Doc holder();
Program: 37036
Project: 37036
Buggy source:
/** 
 * Return the text of this tag, that is, portion beyond tag name.
 */
String text();

Fixed version (ground truth):
/** 
 * Return the text of this tag, that is, the portion beyond tag name.
 * @return the text of this tag
 */
String text();
Program: 37037
Project: 37037
Buggy source:
BasicLookupHelper(Name name,Type site,List<Type> argtypes,List<Type> typeargtypes){
  super(name,site,argtypes,typeargtypes,MethodResolutionPhase.VARARITY);
}

Fixed version (ground truth):
BasicLookupHelper(Name name,Type site,List<Type> argtypes,List<Type> typeargtypes,MethodResolutionPhase maxPhase){
  super(name,site,argtypes,typeargtypes,maxPhase);
}
Program: 37039
Project: 37039
Buggy source:
/** 
 * Resolve operator.
 * @param pos       The position to use for error reporting.
 * @param optag     The tag of the operation tree.
 * @param env       The environment current at the operation.
 * @param argtypes  The types of the operands.
 */
Symbol resolveOperator(DiagnosticPosition pos,JCTree.Tag optag,Env<AttrContext> env,List<Type> argtypes){
  MethodResolutionContext prevResolutionContext=currentResolutionContext;
  try {
    currentResolutionContext=new MethodResolutionContext();
    Name name=treeinfo.operatorName(optag);
    env.info.pendingResolutionPhase=currentResolutionContext.step=BASIC;
    Symbol sym=findMethod(env,syms.predefClass.type,name,argtypes,null,false,false,true);
    if (boxingEnabled && sym.kind >= WRONG_MTHS)     env.info.pendingResolutionPhase=currentResolutionContext.step=BOX;
    sym=findMethod(env,syms.predefClass.type,name,argtypes,null,true,false,true);
    return accessMethod(sym,pos,env.enclClass.sym.type,name,false,argtypes,null);
  }
  finally {
    currentResolutionContext=prevResolutionContext;
  }
}

Fixed version (ground truth):
/** 
 * Resolve operator.
 * @param pos       The position to use for error reporting.
 * @param optag     The tag of the operation tree.
 * @param env       The environment current at the operation.
 * @param argtypes  The types of the operands.
 */
Symbol resolveOperator(DiagnosticPosition pos,JCTree.Tag optag,Env<AttrContext> env,List<Type> argtypes){
  MethodResolutionContext prevResolutionContext=currentResolutionContext;
  try {
    currentResolutionContext=new MethodResolutionContext();
    Name name=treeinfo.operatorName(optag);
    return lookupMethod(env,pos,syms.predefClass,currentResolutionContext,new BasicLookupHelper(name,syms.predefClass.type,argtypes,null,BOX){
      @Override Symbol lookup(      Env<AttrContext> env,      MethodResolutionPhase phase){
        return findMethod(env,site,name,argtypes,typeargtypes,phase.isBoxingRequired(),phase.isVarargsRequired(),true);
      }
      @Override Symbol access(      Env<AttrContext> env,      DiagnosticPosition pos,      Symbol location,      Symbol sym){
        return accessMethod(sym,pos,env.enclClass.sym.type,name,false,argtypes,null);
      }
    }
);
  }
  finally {
    currentResolutionContext=prevResolutionContext;
  }
}
Program: 37040
Project: 37040
Buggy source:
String computeKey(Element e){
  StringBuilder buf=new StringBuilder();
  while (e != null) {
    buf.append(e.toString());
    e=e.getEnclosingElement();
  }
  buf.append(jfo.getName());
  return buf.toString();
}

Fixed version (ground truth):
String computeKey(Element e){
  StringBuilder buf=new StringBuilder();
  if (predefTranslationMap.containsKey(e.getSimpleName().toString())) {
    buf.append("String_Node_Str");
    String replacedName=predefTranslationMap.get(e.getSimpleName().toString());
    buf.append(e.toString().replace(e.getSimpleName().toString(),replacedName));
  }
 else   if (e.getSimpleName().toString().startsWith("String_Node_Str")) {
    buf.append("String_Node_Str");
    buf.append(e.toString());
  }
 else {
    while (e != null) {
      buf.append(e.toString());
      e=e.getEnclosingElement();
    }
    buf.append(jfo.getName());
  }
  return buf.toString();
}
Program: 37041
Project: 37041
Buggy source:
protected ResolveHarness(JavaFileObject jfo){
  this.jfo=jfo;
  this.diagProcessors=new DiagnosticProcessor[]{new VerboseResolutionNoteProcessor(),new VerboseDeferredInferenceNoteProcessor(),new ErrorProcessor()};
}

Fixed version (ground truth):
protected ResolveHarness(JavaFileObject jfo){
  this.jfo=jfo;
  this.diagProcessors=new DiagnosticProcessor[]{new VerboseResolutionNoteProcessor(),new VerboseDeferredInferenceNoteProcessor(),new ErrorProcessor()};
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
  predefTranslationMap.put("String_Node_Str","String_Node_Str");
}
Program: 37042
Project: 37042
Buggy source:
BasicLookupHelper(Name name,Type site,List<Type> argtypes,List<Type> typeargtypes){
  super(name,site,argtypes,typeargtypes,MethodResolutionPhase.VARARITY);
}

Fixed version (ground truth):
BasicLookupHelper(Name name,Type site,List<Type> argtypes,List<Type> typeargtypes,MethodResolutionPhase maxPhase){
  super(name,site,argtypes,typeargtypes,maxPhase);
}
Program: 37044
Project: 37044
Buggy source:
/** 
 * Resolve operator.
 * @param pos       The position to use for error reporting.
 * @param optag     The tag of the operation tree.
 * @param env       The environment current at the operation.
 * @param argtypes  The types of the operands.
 */
Symbol resolveOperator(DiagnosticPosition pos,JCTree.Tag optag,Env<AttrContext> env,List<Type> argtypes){
  MethodResolutionContext prevResolutionContext=currentResolutionContext;
  try {
    currentResolutionContext=new MethodResolutionContext();
    Name name=treeinfo.operatorName(optag);
    env.info.pendingResolutionPhase=currentResolutionContext.step=BASIC;
    Symbol sym=findMethod(env,syms.predefClass.type,name,argtypes,null,false,false,true);
    if (boxingEnabled && sym.kind >= WRONG_MTHS)     env.info.pendingResolutionPhase=currentResolutionContext.step=BOX;
    sym=findMethod(env,syms.predefClass.type,name,argtypes,null,true,false,true);
    return accessMethod(sym,pos,env.enclClass.sym.type,name,false,argtypes,null);
  }
  finally {
    currentResolutionContext=prevResolutionContext;
  }
}

Fixed version (ground truth):
/** 
 * Resolve operator.
 * @param pos       The position to use for error reporting.
 * @param optag     The tag of the operation tree.
 * @param env       The environment current at the operation.
 * @param argtypes  The types of the operands.
 */
Symbol resolveOperator(DiagnosticPosition pos,JCTree.Tag optag,Env<AttrContext> env,List<Type> argtypes){
  MethodResolutionContext prevResolutionContext=currentResolutionContext;
  try {
    currentResolutionContext=new MethodResolutionContext();
    Name name=treeinfo.operatorName(optag);
    return lookupMethod(env,pos,syms.predefClass,currentResolutionContext,new BasicLookupHelper(name,syms.predefClass.type,argtypes,null,BOX){
      @Override Symbol lookup(      Env<AttrContext> env,      MethodResolutionPhase phase){
        return findMethod(env,site,name,argtypes,typeargtypes,phase.isBoxingRequired(),phase.isVarargsRequired(),true);
      }
      @Override Symbol access(      Env<AttrContext> env,      DiagnosticPosition pos,      Symbol location,      Symbol sym){
        return accessMethod(sym,pos,env.enclClass.sym.type,name,false,argtypes,null);
      }
    }
);
  }
  finally {
    currentResolutionContext=prevResolutionContext;
  }
}
Program: 37045
Project: 37045
Buggy source:
/** 
 * Convenience method equivalent to   {@code v.scan(e, null)}.
 * @return the result of scanning {@code e}.
 */
public final R scan(Element e){
  return scan(e,null);
}

Fixed version (ground truth):
/** 
 * Convenience method equivalent to   {@code v.scan(e, null)}.
 * @param e the element to scan
 * @return the result of scanning {@code e}.
 */
public final R scan(Element e){
  return scan(e,null);
}
Program: 37046
Project: 37046
Buggy source:
/** 
 * Return a name with the same sequence of characters as the argument.
 * @param cs the character sequence to return as a name
 */
Name getName(CharSequence cs);

Fixed version (ground truth):
/** 
 * Return a name with the same sequence of characters as the argument.
 * @param cs the character sequence to return as a name
 * @return a name with the same sequence of characters as the argument
 */
Name getName(CharSequence cs);
Program: 37047
Project: 37047
Buggy source:
/** 
 * Returns the element corresponding to a type. The type may be a   {@code DeclaredType} or {@code TypeVariable}. Returns   {@code null} if the type is not one with acorresponding element.
 * @return the element corresponding to the given type
 */
Element asElement(TypeMirror t);

Fixed version (ground truth):
/** 
 * Returns the element corresponding to a type. The type may be a   {@code DeclaredType} or {@code TypeVariable}. Returns   {@code null} if the type is not one with acorresponding element.
 * @param t the type to map to an element
 * @return the element corresponding to the given type
 */
Element asElement(TypeMirror t);
Program: 37048
Project: 37048
Buggy source:
/** 
 * Convenience method equivalent to   {@code v.scan(e, null)}.
 * @return the result of scanning {@code e}.
 */
public final R scan(Element e){
  return scan(e,null);
}

Fixed version (ground truth):
/** 
 * Convenience method equivalent to   {@code v.scan(e, null)}.
 * @param e the element to scan
 * @return the result of scanning {@code e}.
 */
public final R scan(Element e){
  return scan(e,null);
}
Program: 37049
Project: 37049
Buggy source:
/** 
 * Return a name with the same sequence of characters as the argument.
 * @param cs the character sequence to return as a name
 */
Name getName(CharSequence cs);

Fixed version (ground truth):
/** 
 * Return a name with the same sequence of characters as the argument.
 * @param cs the character sequence to return as a name
 * @return a name with the same sequence of characters as the argument
 */
Name getName(CharSequence cs);
Program: 37050
Project: 37050
Buggy source:
/** 
 * Returns the element corresponding to a type. The type may be a   {@code DeclaredType} or {@code TypeVariable}. Returns   {@code null} if the type is not one with acorresponding element.
 * @return the element corresponding to the given type
 */
Element asElement(TypeMirror t);

Fixed version (ground truth):
/** 
 * Returns the element corresponding to a type. The type may be a   {@code DeclaredType} or {@code TypeVariable}. Returns   {@code null} if the type is not one with acorresponding element.
 * @param t the type to map to an element
 * @return the element corresponding to the given type
 */
Element asElement(TypeMirror t);
Program: 37051
Project: 37051
Buggy source:
private static List<Archive> init(){
  List<Archive> result=new ArrayList<Archive>();
  String javaHome=System.getProperty("String_Node_Str");
  List<File> files=new ArrayList<File>();
  File jre=new File(javaHome,"String_Node_Str");
  File lib=new File(javaHome,"String_Node_Str");
  try {
    if (jre.exists() && jre.isDirectory()) {
      result.addAll(addJarFiles(new File(jre,"String_Node_Str")));
      result.addAll(addJarFiles(lib));
    }
 else     if (lib.exists() && lib.isDirectory()) {
      File classes=new File(javaHome,"String_Node_Str");
      if (classes.exists() && classes.isDirectory()) {
        result.add(new Archive(classes,ClassFileReader.newInstance(classes)));
      }
      result.addAll(addJarFiles(lib));
    }
 else {
      throw new RuntimeException("String_Node_Str" + javaHome + "String_Node_Str");
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  return result;
}

Fixed version (ground truth):
private static List<Archive> init(){
  List<Archive> result=new ArrayList<Archive>();
  String javaHome=System.getProperty("String_Node_Str");
  File jre=new File(javaHome,"String_Node_Str");
  File lib=new File(javaHome,"String_Node_Str");
  try {
    if (jre.exists() && jre.isDirectory()) {
      result.addAll(addJarFiles(new File(jre,"String_Node_Str")));
      result.addAll(addJarFiles(lib));
    }
 else     if (lib.exists() && lib.isDirectory()) {
      File classes=new File(javaHome,"String_Node_Str");
      if (classes.exists() && classes.isDirectory()) {
        result.add(new Archive(classes,ClassFileReader.newInstance(classes)));
      }
      result.addAll(addJarFiles(lib));
    }
 else {
      throw new RuntimeException("String_Node_Str" + javaHome + "String_Node_Str");
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  return result;
}
Program: 37054
Project: 37054
Buggy source:
private static List<Archive> init(){
  List<Archive> result=new ArrayList<Archive>();
  String javaHome=System.getProperty("String_Node_Str");
  List<File> files=new ArrayList<File>();
  File jre=new File(javaHome,"String_Node_Str");
  File lib=new File(javaHome,"String_Node_Str");
  try {
    if (jre.exists() && jre.isDirectory()) {
      result.addAll(addJarFiles(new File(jre,"String_Node_Str")));
      result.addAll(addJarFiles(lib));
    }
 else     if (lib.exists() && lib.isDirectory()) {
      File classes=new File(javaHome,"String_Node_Str");
      if (classes.exists() && classes.isDirectory()) {
        result.add(new Archive(classes,ClassFileReader.newInstance(classes)));
      }
      result.addAll(addJarFiles(lib));
    }
 else {
      throw new RuntimeException("String_Node_Str" + javaHome + "String_Node_Str");
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  return result;
}

Fixed version (ground truth):
private static List<Archive> init(){
  List<Archive> result=new ArrayList<Archive>();
  String javaHome=System.getProperty("String_Node_Str");
  File jre=new File(javaHome,"String_Node_Str");
  File lib=new File(javaHome,"String_Node_Str");
  try {
    if (jre.exists() && jre.isDirectory()) {
      result.addAll(addJarFiles(new File(jre,"String_Node_Str")));
      result.addAll(addJarFiles(lib));
    }
 else     if (lib.exists() && lib.isDirectory()) {
      File classes=new File(javaHome,"String_Node_Str");
      if (classes.exists() && classes.isDirectory()) {
        result.add(new Archive(classes,ClassFileReader.newInstance(classes)));
      }
      result.addAll(addJarFiles(lib));
    }
 else {
      throw new RuntimeException("String_Node_Str" + javaHome + "String_Node_Str");
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  return result;
}
Program: 37057
Project: 37057
Buggy source:
private void checkConfigPermission(){
  final SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new RuntimePermission("String_Node_Str"));
  }
}

Fixed version (ground truth):
private static void checkConfigPermission(){
  final SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new RuntimePermission("String_Node_Str"));
  }
}
Program: 37058
Project: 37058
Buggy source:
@Override protected void makeObject(final MethodEmitter m){
  final String className=SCRIPTFUNCTION_IMPL_OBJECT;
  m._new(className).dup();
  loadConstant(new RecompilableScriptFunctionData(functionNode,compiler.getCodeInstaller(),Compiler.binaryName(getClassName()),makeMap()));
  if (isLazy || functionNode.needsParentScope()) {
    m.loadScope();
  }
 else {
    m.loadNull();
  }
  m.invoke(constructorNoLookup(className,cparams));
}

Fixed version (ground truth):
@Override protected void makeObject(final MethodEmitter m){
  final String className=SCRIPTFUNCTION_IMPL_OBJECT;
  m._new(className).dup();
  loadConstant(new RecompilableScriptFunctionData(functionNode,compiler.getCodeInstaller(),Compiler.binaryName(getClassName()),makeMap()));
  if (isLazy || functionNode.needsParentScope()) {
    m.loadScope();
  }
 else {
    m.loadNull();
  }
  m.invoke(constructorNoLookup(className,RecompilableScriptFunctionData.class,ScriptObject.class));
}
Program: 37059
Project: 37059
Buggy source:
private void newFunctionObject(final FunctionNode functionNode){
  final boolean isLazy=functionNode.isLazy();
  final Class<?>[] cparams=new Class<?>[]{RecompilableScriptFunctionData.class,ScriptObject.class};
  new ObjectCreator(this,new ArrayList<String>(),new ArrayList<Symbol>(),false,false){
    @Override protected void makeObject(    final MethodEmitter m){
      final String className=SCRIPTFUNCTION_IMPL_OBJECT;
      m._new(className).dup();
      loadConstant(new RecompilableScriptFunctionData(functionNode,compiler.getCodeInstaller(),Compiler.binaryName(getClassName()),makeMap()));
      if (isLazy || functionNode.needsParentScope()) {
        m.loadScope();
      }
 else {
        m.loadNull();
      }
      m.invoke(constructorNoLookup(className,cparams));
    }
  }
.makeObject(method);
}

Fixed version (ground truth):
private void newFunctionObject(final FunctionNode functionNode){
  final boolean isLazy=functionNode.isLazy();
  new ObjectCreator(this,new ArrayList<String>(),new ArrayList<Symbol>(),false,false){
    @Override protected void makeObject(    final MethodEmitter m){
      final String className=SCRIPTFUNCTION_IMPL_OBJECT;
      m._new(className).dup();
      loadConstant(new RecompilableScriptFunctionData(functionNode,compiler.getCodeInstaller(),Compiler.binaryName(getClassName()),makeMap()));
      if (isLazy || functionNode.needsParentScope()) {
        m.loadScope();
      }
 else {
        m.loadNull();
      }
      m.invoke(constructorNoLookup(className,RecompilableScriptFunctionData.class,ScriptObject.class));
    }
  }
.makeObject(method);
}
Program: 37060
Project: 37060
Buggy source:
/** 
 * Check if this function's generated Java method needs a   {@code callee} parameter. Functions that need access totheir parent scope, functions that reference themselves, and non-strict functions that need an Arguments object (since it exposes  {@code arguments.callee} property) will need to have a callee parameter.We also conservatively need a callee if we have lazy children, i.e. nested function nodes that have not yet been evaluated. _They_ may need the callee and we don't know it
 * @return true if the function's generated Java method needs a {@code callee} parameter.
 */
public boolean needsCallee(){
  return hasLazyChildren() || needsParentScope() || needsSelfSymbol()|| (needsArguments() && !isStrictMode());
}

Fixed version (ground truth):
/** 
 * Check if this function's generated Java method needs a   {@code callee} parameter. Functions that need access totheir parent scope, functions that reference themselves, and non-strict functions that need an Arguments object (since it exposes  {@code arguments.callee} property) will need to have a callee parameter.
 * @return true if the function's generated Java method needs a {@code callee} parameter.
 */
public boolean needsCallee(){
  return needsParentScope() || needsSelfSymbol() || (needsArguments() && !isStrictMode());
}
Program: 37061
Project: 37061
Buggy source:
private void copyOptions(final ScriptObject options,final ScriptEnvironment scriptEnv){
  AccessController.doPrivileged(new PrivilegedAction<Void>(){
    public Void run(){
      for (      Field f : scriptEnv.getClass().getFields()) {
        try {
          options.set(f.getName(),f.get(scriptEnv),false);
        }
 catch (        final IllegalArgumentException|IllegalAccessException exp) {
          throw new RuntimeException(exp);
        }
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
private static void copyOptions(final ScriptObject options,final ScriptEnvironment scriptEnv){
  AccessController.doPrivileged(new PrivilegedAction<Void>(){
    @Override public Void run(){
      for (      Field f : scriptEnv.getClass().getFields()) {
        try {
          options.set(f.getName(),f.get(scriptEnv),false);
        }
 catch (        final IllegalArgumentException|IllegalAccessException exp) {
          throw new RuntimeException(exp);
        }
      }
      return null;
    }
  }
);
}
Program: 37062
Project: 37062
Buggy source:
public Void run(){
  for (  Field f : scriptEnv.getClass().getFields()) {
    try {
      options.set(f.getName(),f.get(scriptEnv),false);
    }
 catch (    final IllegalArgumentException|IllegalAccessException exp) {
      throw new RuntimeException(exp);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Void run(){
  for (  Field f : scriptEnv.getClass().getFields()) {
    try {
      options.set(f.getName(),f.get(scriptEnv),false);
    }
 catch (    final IllegalArgumentException|IllegalAccessException exp) {
      throw new RuntimeException(exp);
    }
  }
  return null;
}
Program: 37063
Project: 37063
Buggy source:
private synchronized Class<?> compile(final Source source,final ErrorManager errMan,final boolean strict){
  errMan.reset();
  GlobalObject global=null;
  Class<?> script;
  if (env._class_cache_size > 0) {
    global=(GlobalObject)Context.getGlobalTrusted();
    script=global.findCachedClass(source);
    if (script != null) {
      return script;
    }
  }
  final FunctionNode functionNode=new Parser(env,source,errMan,strict).parse();
  if (errors.hasErrors() || env._parse_only) {
    return null;
  }
  if (env._print_ast) {
    getErr().println(new ASTWriter(functionNode));
  }
  if (env._print_parse) {
    getErr().println(new PrintVisitor(functionNode));
  }
  final URL url=source.getURL();
  final ScriptLoader loader=env._loader_per_compile ? createNewLoader() : scriptLoader;
  final CodeSource cs=url == null ? null : new CodeSource(url,(CodeSigner[])null);
  final CodeInstaller<ScriptEnvironment> installer=new ContextCodeInstaller(this,loader,cs);
  final Compiler compiler=new Compiler(installer,functionNode,strict);
  compiler.compile();
  script=compiler.install();
  if (global != null) {
    global.cacheClass(source,script);
  }
  return script;
}

Fixed version (ground truth):
private synchronized Class<?> compile(final Source source,final ErrorManager errMan,final boolean strict){
  errMan.reset();
  GlobalObject global=null;
  Class<?> script;
  if (env._class_cache_size > 0) {
    global=(GlobalObject)Context.getGlobalTrusted();
    script=global.findCachedClass(source);
    if (script != null) {
      Compiler.LOG.fine("String_Node_Str" + source + "String_Node_Str");
      return script;
    }
  }
  final FunctionNode functionNode=new Parser(env,source,errMan,strict).parse();
  if (errors.hasErrors() || env._parse_only) {
    return null;
  }
  if (env._print_ast) {
    getErr().println(new ASTWriter(functionNode));
  }
  if (env._print_parse) {
    getErr().println(new PrintVisitor(functionNode));
  }
  final URL url=source.getURL();
  final ScriptLoader loader=env._loader_per_compile ? createNewLoader() : scriptLoader;
  final CodeSource cs=url == null ? null : new CodeSource(url,(CodeSigner[])null);
  final CodeInstaller<ScriptEnvironment> installer=new ContextCodeInstaller(this,loader,cs);
  final Compiler compiler=new Compiler(installer,functionNode,strict);
  compiler.compile();
  script=compiler.install();
  if (global != null) {
    global.cacheClass(source,script);
  }
  return script;
}
Program: 37064
Project: 37064
Buggy source:
/** 
 * Install a class for use by the Nashorn runtime
 * @param name Binary name of class.
 * @param data Class data bytes.
 * @param cs CodeSource code source of the class bytes.
 * @return Installed class.
 */
synchronized Class<?> installClass(final String name,final byte[] data,final CodeSource cs){
  if (cs == null) {
    return defineClass(name,data,0,data.length,new ProtectionDomain(null,getPermissions(null)));
  }
 else {
    return defineClass(name,data,0,data.length,cs);
  }
}

Fixed version (ground truth):
/** 
 * Install a class for use by the Nashorn runtime
 * @param name Binary name of class.
 * @param data Class data bytes.
 * @param cs CodeSource code source of the class bytes.
 * @return Installed class.
 */
synchronized Class<?> installClass(final String name,final byte[] data,final CodeSource cs){
  if (cs == null) {
    return defineClass(name,data,0,data.length,new ProtectionDomain(null,getPermissions(null)));
  }
  return defineClass(name,data,0,data.length,cs);
}
Program: 37065
Project: 37065
Buggy source:
/** 
 * Returns a method handle representing a constructor that takes a single argument of the source type (which, really, should be one of   {@link ScriptObject},   {@link ScriptFunction}, or   {@link Object}, and returns an instance of the adapter for the target type. Used to implement the function autoconverters as well as the Nashorn's JSR-223 script engine's   {@code getInterface()} method.
 * @param sourceType the source type; should be either {@link ScriptObject},   {@link ScriptFunction}, or  {@link Object}. In case of   {@code Object}, it will return a method handle that dispatches to either the script object or function constructor at invocation based on the actual argument.
 * @param targetType the target type, for which adapter instances will be created
 * @return the constructor method handle.
 * @throws Exception if anything goes wrong
 */
public static MethodHandle getConstructor(final Class<?> sourceType,final Class<?> targetType) throws Exception {
  final StaticClass adapterClass=getAdapterClassFor(new Class<?>[]{targetType});
  return AccessController.doPrivileged(new PrivilegedExceptionAction<MethodHandle>(){
    public MethodHandle run() throws Exception {
      return MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(NashornCallSiteDescriptor.get("String_Node_Str",MethodType.methodType(targetType,StaticClass.class,sourceType),0),false,adapterClass,null)).getInvocation(),adapterClass);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Returns a method handle representing a constructor that takes a single argument of the source type (which, really, should be one of   {@link ScriptObject},   {@link ScriptFunction}, or   {@link Object}, and returns an instance of the adapter for the target type. Used to implement the function autoconverters as well as the Nashorn's JSR-223 script engine's   {@code getInterface()} method.
 * @param sourceType the source type; should be either {@link ScriptObject},   {@link ScriptFunction}, or  {@link Object}. In case of   {@code Object}, it will return a method handle that dispatches to either the script object or function constructor at invocation based on the actual argument.
 * @param targetType the target type, for which adapter instances will be created
 * @return the constructor method handle.
 * @throws Exception if anything goes wrong
 */
public static MethodHandle getConstructor(final Class<?> sourceType,final Class<?> targetType) throws Exception {
  final StaticClass adapterClass=getAdapterClassFor(new Class<?>[]{targetType});
  return AccessController.doPrivileged(new PrivilegedExceptionAction<MethodHandle>(){
    @Override public MethodHandle run() throws Exception {
      return MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(NashornCallSiteDescriptor.get("String_Node_Str",MethodType.methodType(targetType,StaticClass.class,sourceType),0),false,adapterClass,null)).getInvocation(),adapterClass);
    }
  }
);
}
Program: 37066
Project: 37066
Buggy source:
@Override public RegExpMatcher match(final String str){
  if (pattern == null) {
    return null;
  }
  RegExpMatcher matcher=this.matcher;
  if (matcher == null || matcher.getInput() != str) {
    matcher=new DefaultMatcher(str);
    this.matcher=matcher;
  }
  return matcher;
}

Fixed version (ground truth):
@Override public RegExpMatcher match(final String str){
  if (pattern == null) {
    return null;
  }
  RegExpMatcher currentMatcher=this.matcher;
  if (currentMatcher == null || matcher.getInput() != str) {
    currentMatcher=new DefaultMatcher(str);
    this.matcher=currentMatcher;
  }
  return currentMatcher;
}
Program: 37067
Project: 37067
Buggy source:
@Override public RegExpMatcher match(final String input){
  if (regex == null) {
    return null;
  }
  RegExpMatcher matcher=this.matcher;
  if (matcher == null || input != matcher.getInput()) {
    matcher=new JoniMatcher(input);
    this.matcher=matcher;
  }
  return matcher;
}

Fixed version (ground truth):
@Override public RegExpMatcher match(final String input){
  if (regex == null) {
    return null;
  }
  RegExpMatcher currentMatcher=this.matcher;
  if (currentMatcher == null || input != currentMatcher.getInput()) {
    currentMatcher=new JoniMatcher(input);
    this.matcher=currentMatcher;
  }
  return currentMatcher;
}
Program: 37068
Project: 37068
Buggy source:
/** 
 * Throw a regexp parser exception.
 * @param key the message key
 * @param str string argument
 * @throws jdk.nashorn.internal.runtime.ParserException
 */
protected static void throwParserException(final String key,final String str) throws ParserException {
  throw new ParserException(ECMAErrors.getMessage("String_Node_Str" + key,str));
}

Fixed version (ground truth):
/** 
 * Throw a regexp parser exception.
 * @param key the message key
 * @param str string argument
 * @throws jdk.nashorn.internal.runtime.ParserException unconditionally
 */
protected static void throwParserException(final String key,final String str) throws ParserException {
  throw new ParserException(ECMAErrors.getMessage("String_Node_Str" + key,str));
}
Program: 37069
Project: 37069
Buggy source:
/** 
 * Creates a Regular expression from the given   {@code pattern} and {@code flags} strings.
 * @param pattern RegExp pattern string
 * @param flags RegExp flags string
 * @throws ParserException if flags is invalid or pattern string has syntax error.
 */
protected RegExp compile(final String pattern,final String flags) throws ParserException {
  return new DefaultRegExp(pattern,flags);
}

Fixed version (ground truth):
/** 
 * Creates a Regular expression from the given   {@code pattern} and {@code flags} strings.
 * @param pattern RegExp pattern string
 * @param flags   RegExp flags string
 * @return new RegExp
 * @throws ParserException if flags is invalid or pattern string has syntax error.
 */
protected RegExp compile(final String pattern,final String flags) throws ParserException {
  return new DefaultRegExp(pattern,flags);
}
Program: 37070
Project: 37070
Buggy source:
/** 
 * Compile a regexp with the given   {@code source} and {@code flags}.
 * @param pattern RegExp pattern string
 * @param flags  flag string
 * @throws ParserException if invalid source or flags
 */
public static RegExp create(final String pattern,final String flags){
  return instance.compile(pattern,flags);
}

Fixed version (ground truth):
/** 
 * Compile a regexp with the given   {@code source} and {@code flags}.
 * @param pattern RegExp pattern string
 * @param flags   flag string
 * @return new RegExp
 * @throws ParserException if invalid source or flags
 */
public static RegExp create(final String pattern,final String flags){
  return instance.compile(pattern,flags);
}
Program: 37071
Project: 37071
Buggy source:
/** 
 * Get the group with the given index or the empty string if group index is not valid.
 * @param index the group index
 * @return the group or ""
 */
public Object getGroup(int index){
  return index >= 0 && index < groups.length ? groups[index] : "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Get the group with the given index or the empty string if group index is not valid.
 * @param groupIndex the group index
 * @return the group or ""
 */
public Object getGroup(final int groupIndex){
  return groupIndex >= 0 && groupIndex < groups.length ? groups[groupIndex] : "String_Node_Str";
}
Program: 37072
Project: 37072
Buggy source:
private void checkConfigPermission(){
  final SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new RuntimePermission("String_Node_Str"));
  }
}

Fixed version (ground truth):
private static void checkConfigPermission(){
  final SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new RuntimePermission("String_Node_Str"));
  }
}
Program: 37073
Project: 37073
Buggy source:
@Override protected void makeObject(final MethodEmitter m){
  final String className=SCRIPTFUNCTION_IMPL_OBJECT;
  m._new(className).dup();
  loadConstant(new RecompilableScriptFunctionData(functionNode,compiler.getCodeInstaller(),Compiler.binaryName(getClassName()),makeMap()));
  if (isLazy || functionNode.needsParentScope()) {
    m.loadScope();
  }
 else {
    m.loadNull();
  }
  m.invoke(constructorNoLookup(className,cparams));
}

Fixed version (ground truth):
@Override protected void makeObject(final MethodEmitter m){
  final String className=SCRIPTFUNCTION_IMPL_OBJECT;
  m._new(className).dup();
  loadConstant(new RecompilableScriptFunctionData(functionNode,compiler.getCodeInstaller(),Compiler.binaryName(getClassName()),makeMap()));
  if (isLazy || functionNode.needsParentScope()) {
    m.loadScope();
  }
 else {
    m.loadNull();
  }
  m.invoke(constructorNoLookup(className,RecompilableScriptFunctionData.class,ScriptObject.class));
}
Program: 37074
Project: 37074
Buggy source:
private void newFunctionObject(final FunctionNode functionNode){
  final boolean isLazy=functionNode.isLazy();
  final Class<?>[] cparams=new Class<?>[]{RecompilableScriptFunctionData.class,ScriptObject.class};
  new ObjectCreator(this,new ArrayList<String>(),new ArrayList<Symbol>(),false,false){
    @Override protected void makeObject(    final MethodEmitter m){
      final String className=SCRIPTFUNCTION_IMPL_OBJECT;
      m._new(className).dup();
      loadConstant(new RecompilableScriptFunctionData(functionNode,compiler.getCodeInstaller(),Compiler.binaryName(getClassName()),makeMap()));
      if (isLazy || functionNode.needsParentScope()) {
        m.loadScope();
      }
 else {
        m.loadNull();
      }
      m.invoke(constructorNoLookup(className,cparams));
    }
  }
.makeObject(method);
}

Fixed version (ground truth):
private void newFunctionObject(final FunctionNode functionNode){
  final boolean isLazy=functionNode.isLazy();
  new ObjectCreator(this,new ArrayList<String>(),new ArrayList<Symbol>(),false,false){
    @Override protected void makeObject(    final MethodEmitter m){
      final String className=SCRIPTFUNCTION_IMPL_OBJECT;
      m._new(className).dup();
      loadConstant(new RecompilableScriptFunctionData(functionNode,compiler.getCodeInstaller(),Compiler.binaryName(getClassName()),makeMap()));
      if (isLazy || functionNode.needsParentScope()) {
        m.loadScope();
      }
 else {
        m.loadNull();
      }
      m.invoke(constructorNoLookup(className,RecompilableScriptFunctionData.class,ScriptObject.class));
    }
  }
.makeObject(method);
}
Program: 37075
Project: 37075
Buggy source:
/** 
 * Check if this function's generated Java method needs a   {@code callee} parameter. Functions that need access totheir parent scope, functions that reference themselves, and non-strict functions that need an Arguments object (since it exposes  {@code arguments.callee} property) will need to have a callee parameter.We also conservatively need a callee if we have lazy children, i.e. nested function nodes that have not yet been evaluated. _They_ may need the callee and we don't know it
 * @return true if the function's generated Java method needs a {@code callee} parameter.
 */
public boolean needsCallee(){
  return hasLazyChildren() || needsParentScope() || needsSelfSymbol()|| (needsArguments() && !isStrictMode());
}

Fixed version (ground truth):
/** 
 * Check if this function's generated Java method needs a   {@code callee} parameter. Functions that need access totheir parent scope, functions that reference themselves, and non-strict functions that need an Arguments object (since it exposes  {@code arguments.callee} property) will need to have a callee parameter.
 * @return true if the function's generated Java method needs a {@code callee} parameter.
 */
public boolean needsCallee(){
  return needsParentScope() || needsSelfSymbol() || (needsArguments() && !isStrictMode());
}
Program: 37076
Project: 37076
Buggy source:
private void copyOptions(final ScriptObject options,final ScriptEnvironment scriptEnv){
  AccessController.doPrivileged(new PrivilegedAction<Void>(){
    public Void run(){
      for (      Field f : scriptEnv.getClass().getFields()) {
        try {
          options.set(f.getName(),f.get(scriptEnv),false);
        }
 catch (        final IllegalArgumentException|IllegalAccessException exp) {
          throw new RuntimeException(exp);
        }
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
private static void copyOptions(final ScriptObject options,final ScriptEnvironment scriptEnv){
  AccessController.doPrivileged(new PrivilegedAction<Void>(){
    @Override public Void run(){
      for (      Field f : scriptEnv.getClass().getFields()) {
        try {
          options.set(f.getName(),f.get(scriptEnv),false);
        }
 catch (        final IllegalArgumentException|IllegalAccessException exp) {
          throw new RuntimeException(exp);
        }
      }
      return null;
    }
  }
);
}
Program: 37077
Project: 37077
Buggy source:
public Void run(){
  for (  Field f : scriptEnv.getClass().getFields()) {
    try {
      options.set(f.getName(),f.get(scriptEnv),false);
    }
 catch (    final IllegalArgumentException|IllegalAccessException exp) {
      throw new RuntimeException(exp);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Void run(){
  for (  Field f : scriptEnv.getClass().getFields()) {
    try {
      options.set(f.getName(),f.get(scriptEnv),false);
    }
 catch (    final IllegalArgumentException|IllegalAccessException exp) {
      throw new RuntimeException(exp);
    }
  }
  return null;
}
Program: 37078
Project: 37078
Buggy source:
private synchronized Class<?> compile(final Source source,final ErrorManager errMan,final boolean strict){
  errMan.reset();
  GlobalObject global=null;
  Class<?> script;
  if (env._class_cache_size > 0) {
    global=(GlobalObject)Context.getGlobalTrusted();
    script=global.findCachedClass(source);
    if (script != null) {
      return script;
    }
  }
  final FunctionNode functionNode=new Parser(env,source,errMan,strict).parse();
  if (errors.hasErrors() || env._parse_only) {
    return null;
  }
  if (env._print_ast) {
    getErr().println(new ASTWriter(functionNode));
  }
  if (env._print_parse) {
    getErr().println(new PrintVisitor(functionNode));
  }
  final URL url=source.getURL();
  final ScriptLoader loader=env._loader_per_compile ? createNewLoader() : scriptLoader;
  final CodeSource cs=url == null ? null : new CodeSource(url,(CodeSigner[])null);
  final CodeInstaller<ScriptEnvironment> installer=new ContextCodeInstaller(this,loader,cs);
  final Compiler compiler=new Compiler(installer,functionNode,strict);
  compiler.compile();
  script=compiler.install();
  if (global != null) {
    global.cacheClass(source,script);
  }
  return script;
}

Fixed version (ground truth):
private synchronized Class<?> compile(final Source source,final ErrorManager errMan,final boolean strict){
  errMan.reset();
  GlobalObject global=null;
  Class<?> script;
  if (env._class_cache_size > 0) {
    global=(GlobalObject)Context.getGlobalTrusted();
    script=global.findCachedClass(source);
    if (script != null) {
      Compiler.LOG.fine("String_Node_Str" + source + "String_Node_Str");
      return script;
    }
  }
  final FunctionNode functionNode=new Parser(env,source,errMan,strict).parse();
  if (errors.hasErrors() || env._parse_only) {
    return null;
  }
  if (env._print_ast) {
    getErr().println(new ASTWriter(functionNode));
  }
  if (env._print_parse) {
    getErr().println(new PrintVisitor(functionNode));
  }
  final URL url=source.getURL();
  final ScriptLoader loader=env._loader_per_compile ? createNewLoader() : scriptLoader;
  final CodeSource cs=url == null ? null : new CodeSource(url,(CodeSigner[])null);
  final CodeInstaller<ScriptEnvironment> installer=new ContextCodeInstaller(this,loader,cs);
  final Compiler compiler=new Compiler(installer,functionNode,strict);
  compiler.compile();
  script=compiler.install();
  if (global != null) {
    global.cacheClass(source,script);
  }
  return script;
}
Program: 37079
Project: 37079
Buggy source:
/** 
 * Install a class for use by the Nashorn runtime
 * @param name Binary name of class.
 * @param data Class data bytes.
 * @param cs CodeSource code source of the class bytes.
 * @return Installed class.
 */
synchronized Class<?> installClass(final String name,final byte[] data,final CodeSource cs){
  if (cs == null) {
    return defineClass(name,data,0,data.length,new ProtectionDomain(null,getPermissions(null)));
  }
 else {
    return defineClass(name,data,0,data.length,cs);
  }
}

Fixed version (ground truth):
/** 
 * Install a class for use by the Nashorn runtime
 * @param name Binary name of class.
 * @param data Class data bytes.
 * @param cs CodeSource code source of the class bytes.
 * @return Installed class.
 */
synchronized Class<?> installClass(final String name,final byte[] data,final CodeSource cs){
  if (cs == null) {
    return defineClass(name,data,0,data.length,new ProtectionDomain(null,getPermissions(null)));
  }
  return defineClass(name,data,0,data.length,cs);
}
Program: 37080
Project: 37080
Buggy source:
/** 
 * Returns a method handle representing a constructor that takes a single argument of the source type (which, really, should be one of   {@link ScriptObject},   {@link ScriptFunction}, or   {@link Object}, and returns an instance of the adapter for the target type. Used to implement the function autoconverters as well as the Nashorn's JSR-223 script engine's   {@code getInterface()} method.
 * @param sourceType the source type; should be either {@link ScriptObject},   {@link ScriptFunction}, or  {@link Object}. In case of   {@code Object}, it will return a method handle that dispatches to either the script object or function constructor at invocation based on the actual argument.
 * @param targetType the target type, for which adapter instances will be created
 * @return the constructor method handle.
 * @throws Exception if anything goes wrong
 */
public static MethodHandle getConstructor(final Class<?> sourceType,final Class<?> targetType) throws Exception {
  final StaticClass adapterClass=getAdapterClassFor(new Class<?>[]{targetType});
  return AccessController.doPrivileged(new PrivilegedExceptionAction<MethodHandle>(){
    public MethodHandle run() throws Exception {
      return MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(NashornCallSiteDescriptor.get("String_Node_Str",MethodType.methodType(targetType,StaticClass.class,sourceType),0),false,adapterClass,null)).getInvocation(),adapterClass);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Returns a method handle representing a constructor that takes a single argument of the source type (which, really, should be one of   {@link ScriptObject},   {@link ScriptFunction}, or   {@link Object}, and returns an instance of the adapter for the target type. Used to implement the function autoconverters as well as the Nashorn's JSR-223 script engine's   {@code getInterface()} method.
 * @param sourceType the source type; should be either {@link ScriptObject},   {@link ScriptFunction}, or  {@link Object}. In case of   {@code Object}, it will return a method handle that dispatches to either the script object or function constructor at invocation based on the actual argument.
 * @param targetType the target type, for which adapter instances will be created
 * @return the constructor method handle.
 * @throws Exception if anything goes wrong
 */
public static MethodHandle getConstructor(final Class<?> sourceType,final Class<?> targetType) throws Exception {
  final StaticClass adapterClass=getAdapterClassFor(new Class<?>[]{targetType});
  return AccessController.doPrivileged(new PrivilegedExceptionAction<MethodHandle>(){
    @Override public MethodHandle run() throws Exception {
      return MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(NashornCallSiteDescriptor.get("String_Node_Str",MethodType.methodType(targetType,StaticClass.class,sourceType),0),false,adapterClass,null)).getInvocation(),adapterClass);
    }
  }
);
}