nus-yam/ex-repair huggingface dataset:
Program: 71690
Project: 71690
Buggy source:
/** 
 * Returns the names of the annotation types supported by this processor.  An element of the result may be the canonical (fully qualified) name of a supported annotation type. Alternately it may be of the form &quot;<tt><i>name</i>.*</tt>&quot; representing the set of all annotation types with canonical names beginning with &quot;<tt><i>name.</i></tt>&quot;.  Finally,   {@code "*"} by itself represents the set of all annotation types,including the empty set.  Note that a processor should not claim  {@code "*"} unless it is actually processing all files;claiming unnecessary annotations may cause a performance slowdown in some environments. <p>Each string returned in the set must be accepted by the following grammar: <blockquote> <dl> <dt><i>SupportedAnnotationTypeString:</i> <dd><i>TypeName</i> <i>DotStar</i><sub><i>opt</i></sub> <dd><tt>*</tt> <p> <dt><i>DotStar:</i> <dd><tt>.</tt> <tt>*</tt> </dl> </blockquote> where <i>TypeName</i> is as defined in <cite>The Java&trade; Language Specification</cite>.
 * @return the names of the annotation types supported by this processor
 * @see javax.annotation.processing.SupportedAnnotationTypes
 * @jls 3.8 Identifiers
 * @jls 6.5.5 Meaning of Type Names
 */
Set<String> getSupportedAnnotationTypes();

Fixed version (ground truth):
/** 
 * Returns the names of the annotation types supported by this processor.  An element of the result may be the canonical (fully qualified) name of a supported annotation type. Alternately it may be of the form &quot;<tt><i>name</i>.*</tt>&quot; representing the set of all annotation types with canonical names beginning with &quot;<tt><i>name.</i></tt>&quot;.  Finally,   {@code "*"} by itself represents the set of all annotation types,including the empty set.  Note that a processor should not claim  {@code "*"} unless it is actually processing all files;claiming unnecessary annotations may cause a performance slowdown in some environments. <p>Each string returned in the set must be accepted by the following grammar: <blockquote> <dl> <dt><i>SupportedAnnotationTypeString:</i> <dd><i>TypeName</i> <i>DotStar</i><sub><i>opt</i></sub> <dd><tt>*</tt> <dt><i>DotStar:</i> <dd><tt>.</tt> <tt>*</tt> </dl> </blockquote> where <i>TypeName</i> is as defined in <cite>The Java&trade; Language Specification</cite>.
 * @return the names of the annotation types supported by this processor
 * @see javax.annotation.processing.SupportedAnnotationTypes
 * @jls 3.8 Identifiers
 * @jls 6.5.5 Meaning of Type Names
 */
Set<String> getSupportedAnnotationTypes();
Program: 71691
Project: 71691
Buggy source:
/** 
 * Returns the options recognized by this processor.  An implementation of the processing tool must provide a way to pass processor-specific options distinctly from options passed to the tool itself, see   {@link ProcessingEnvironment#getOptions getOptions}. <p>Each string returned in the set must be a period separated sequence of   {@linkplain javax.lang.model.SourceVersion#isIdentifier identifiers}: <blockquote> <dl> <dt><i>SupportedOptionString:</i> <dd><i>Identifiers</i> <p> <dt><i>Identifiers:</i> <dd> <i>Identifier</i> <dd> <i>Identifier</i>   {@code .} <i>Identifiers</i><p> <dt><i>Identifier:</i> <dd>Syntactic identifier, including keywords and literals </dl> </blockquote> <p> A tool might use this information to determine if any options provided by a user are unrecognized by any processor, in which case it may wish to report a warning.
 * @return the options recognized by this processor or anempty collection if none
 * @see javax.annotation.processing.SupportedOptions
 */
Set<String> getSupportedOptions();

Fixed version (ground truth):
/** 
 * Returns the options recognized by this processor.  An implementation of the processing tool must provide a way to pass processor-specific options distinctly from options passed to the tool itself, see   {@link ProcessingEnvironment#getOptions getOptions}. <p>Each string returned in the set must be a period separated sequence of   {@linkplain javax.lang.model.SourceVersion#isIdentifier identifiers}: <blockquote> <dl> <dt><i>SupportedOptionString:</i> <dd><i>Identifiers</i> <dt><i>Identifiers:</i> <dd> <i>Identifier</i> <dd> <i>Identifier</i>   {@code .} <i>Identifiers</i><dt><i>Identifier:</i> <dd>Syntactic identifier, including keywords and literals </dl> </blockquote> <p> A tool might use this information to determine if any options provided by a user are unrecognized by any processor, in which case it may wish to report a warning.
 * @return the options recognized by this processor or anempty collection if none
 * @see javax.annotation.processing.SupportedOptions
 */
Set<String> getSupportedOptions();
Program: 71693
Project: 71693
Buggy source:
/** 
 * Discards the referral about to be processed. A call to this method should be followed by a call to <code>getReferralContext</code> to allow the processing of other referrals to continue. The following code fragment shows a typical usage pattern. <p><blockquote><pre> } catch (ReferralException e) { if (!shallIFollow(e.getReferralInfo())) { if (!e.skipReferral()) { return; } } ctx = e.getReferralContext(); } </pre></blockquote>
 * @return true If more referral processing is pending; false otherwise.
 */
public abstract boolean skipReferral();

Fixed version (ground truth):
/** 
 * Discards the referral about to be processed. A call to this method should be followed by a call to <code>getReferralContext</code> to allow the processing of other referrals to continue. The following code fragment shows a typical usage pattern. <blockquote><pre> } catch (ReferralException e) { if (!shallIFollow(e.getReferralInfo())) { if (!e.skipReferral()) { return; } } ctx = e.getReferralContext(); } </pre></blockquote>
 * @return true If more referral processing is pending; false otherwise.
 */
public abstract boolean skipReferral();
Program: 71694
Project: 71694
Buggy source:
/** 
 * Retries the referral currently being processed. A call to this method should be followed by a call to <code>getReferralContext</code> to allow the current referral to be retried. The following code fragment shows a typical usage pattern. <p><blockquote><pre> } catch (ReferralException e) { while (true) { try { ctx = e.getReferralContext(env); break; } catch (NamingException ne) { if (! shallIRetry()) { return; } // modify environment properties (env), if necessary e.retryReferral(); } } } </pre></blockquote>
 */
public abstract void retryReferral();

Fixed version (ground truth):
/** 
 * Retries the referral currently being processed. A call to this method should be followed by a call to <code>getReferralContext</code> to allow the current referral to be retried. The following code fragment shows a typical usage pattern. <blockquote><pre> } catch (ReferralException e) { while (true) { try { ctx = e.getReferralContext(env); break; } catch (NamingException ne) { if (! shallIRetry()) { return; } // modify environment properties (env), if necessary e.retryReferral(); } } } </pre></blockquote>
 */
public abstract void retryReferral();
Program: 71695
Project: 71695
Buggy source:
private void checkPackageAccess(Class<?> cls,ProtectionDomain pd){
  final SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    if (ReflectUtil.isNonPublicProxyClass(cls)) {
      for (      Class intf : cls.getInterfaces()) {
        checkPackageAccess(intf,pd);
      }
      return;
    }
    final String name=cls.getName();
    final int i=name.lastIndexOf('.');
    if (i != -1) {
      AccessController.doPrivileged(new PrivilegedAction<Void>(){
        public Void run(){
          sm.checkPackageAccess(name.substring(0,i));
          return null;
        }
      }
,new AccessControlContext(new ProtectionDomain[]{pd}));
    }
  }
  domains.add(pd);
}

Fixed version (ground truth):
private void checkPackageAccess(Class<?> cls,ProtectionDomain pd){
  final SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    if (ReflectUtil.isNonPublicProxyClass(cls)) {
      for (      Class<?> intf : cls.getInterfaces()) {
        checkPackageAccess(intf,pd);
      }
      return;
    }
    final String name=cls.getName();
    final int i=name.lastIndexOf('.');
    if (i != -1) {
      AccessController.doPrivileged(new PrivilegedAction<Void>(){
        public Void run(){
          sm.checkPackageAccess(name.substring(0,i));
          return null;
        }
      }
,new AccessControlContext(new ProtectionDomain[]{pd}));
    }
  }
  domains.add(pd);
}
Program: 71697
Project: 71697
Buggy source:
/** 
 * Remove all stale entries, everywhere. 
 */
private void removeStaleEntries(){
  Entry[] cache=getCache();
  removeStaleEntries(cache,0,cache.length + PROBE_LIMIT - 1);
}

Fixed version (ground truth):
/** 
 * Remove all stale entries, everywhere. 
 */
private void removeStaleEntries(){
  Entry<?>[] cache=getCache();
  removeStaleEntries(cache,0,cache.length + PROBE_LIMIT - 1);
}
Program: 71698
Project: 71698
Buggy source:
/** 
 * Returns the stack depth of the most recently executing method from a class defined using a non-system class loader.  A non-system class loader is defined as being a class loader that is not equal to the system class loader (as returned by   {@link ClassLoader#getSystemClassLoader}) or one of its ancestors. <p> This method will return -1 in the following three cases:<p> <ol> <li>All methods on the execution stack are from classes defined using the system class loader or one of its ancestors. <li>All methods on the execution stack up to the first "privileged" caller (see   {@link java.security.AccessController#doPrivileged}) are from classes defined using the system class loader or one of its ancestors. <li> A call to <code>checkPermission</code> with <code>java.security.AllPermission</code> does not result in a SecurityException. </ol>
 * @return the depth on the stack frame of the most recent occurrence ofa method from a class defined using a non-system class loader.
 * @deprecated This type of security checking is not recommended.It is recommended that the <code>checkPermission</code> call be used instead.
 * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
 * @see #checkPermission(java.security.Permission) checkPermission
 */
@Deprecated protected int classLoaderDepth(){
  int depth=classLoaderDepth0();
  if (depth != -1) {
    if (hasAllPermission())     depth=-1;
 else     depth--;
  }
  return depth;
}

Fixed version (ground truth):
/** 
 * Returns the stack depth of the most recently executing method from a class defined using a non-system class loader.  A non-system class loader is defined as being a class loader that is not equal to the system class loader (as returned by   {@link ClassLoader#getSystemClassLoader}) or one of its ancestors. <p> This method will return -1 in the following three cases: <ol> <li>All methods on the execution stack are from classes defined using the system class loader or one of its ancestors. <li>All methods on the execution stack up to the first "privileged" caller (see   {@link java.security.AccessController#doPrivileged}) are from classes defined using the system class loader or one of its ancestors. <li> A call to <code>checkPermission</code> with <code>java.security.AllPermission</code> does not result in a SecurityException. </ol>
 * @return the depth on the stack frame of the most recent occurrence ofa method from a class defined using a non-system class loader.
 * @deprecated This type of security checking is not recommended.It is recommended that the <code>checkPermission</code> call be used instead.
 * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
 * @see #checkPermission(java.security.Permission) checkPermission
 */
@Deprecated protected int classLoaderDepth(){
  int depth=classLoaderDepth0();
  if (depth != -1) {
    if (hasAllPermission())     depth=-1;
 else     depth--;
  }
  return depth;
}
Program: 71700
Project: 71700
Buggy source:
/** 
 * Throws a <code>SecurityException</code> if the calling thread is not allowed to access the system property with the specified <code>key</code> name. <p> This method is used by the <code>getProperty</code> method of class <code>System</code>. <p> This method calls <code>checkPermission</code> with the <code>PropertyPermission(key, "read")</code> permission. <p> <p> If you override this method, then you should make a call to <code>super.checkPropertyAccess</code> at the point the overridden method would normally throw an exception.
 * @param key   a system property key.
 * @exception SecurityException  if the calling thread does not havepermission to access the specified system property.
 * @exception NullPointerException if the <code>key</code> argument is<code>null</code>.
 * @exception IllegalArgumentException if <code>key</code> is empty.
 * @see java.lang.System#getProperty(java.lang.String)
 * @see #checkPermission(java.security.Permission) checkPermission
 */
public void checkPropertyAccess(String key){
  checkPermission(new PropertyPermission(key,SecurityConstants.PROPERTY_READ_ACTION));
}

Fixed version (ground truth):
/** 
 * Throws a <code>SecurityException</code> if the calling thread is not allowed to access the system property with the specified <code>key</code> name. <p> This method is used by the <code>getProperty</code> method of class <code>System</code>. <p> This method calls <code>checkPermission</code> with the <code>PropertyPermission(key, "read")</code> permission. <p> If you override this method, then you should make a call to <code>super.checkPropertyAccess</code> at the point the overridden method would normally throw an exception.
 * @param key   a system property key.
 * @exception SecurityException  if the calling thread does not havepermission to access the specified system property.
 * @exception NullPointerException if the <code>key</code> argument is<code>null</code>.
 * @exception IllegalArgumentException if <code>key</code> is empty.
 * @see java.lang.System#getProperty(java.lang.String)
 * @see #checkPermission(java.security.Permission) checkPermission
 */
public void checkPropertyAccess(String key){
  checkPermission(new PropertyPermission(key,SecurityConstants.PROPERTY_READ_ACTION));
}
Program: 71701
Project: 71701
Buggy source:
/** 
 * Returns the class loader of the most recently executing method from a class defined using a non-system class loader. A non-system class loader is defined as being a class loader that is not equal to the system class loader (as returned by   {@link ClassLoader#getSystemClassLoader}) or one of its ancestors. <p> This method will return <code>null</code> in the following three cases:<p> <ol> <li>All methods on the execution stack are from classes defined using the system class loader or one of its ancestors. <li>All methods on the execution stack up to the first "privileged" caller (see   {@link java.security.AccessController#doPrivileged}) are from classes defined using the system class loader or one of its ancestors. <li> A call to <code>checkPermission</code> with <code>java.security.AllPermission</code> does not result in a SecurityException. </ol>
 * @return  the class loader of the most recent occurrence on the stackof a method from a class defined using a non-system class loader.
 * @deprecated This type of security checking is not recommended.It is recommended that the <code>checkPermission</code> call be used instead.
 * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
 * @see #checkPermission(java.security.Permission) checkPermission
 */
@Deprecated protected ClassLoader currentClassLoader(){
  ClassLoader cl=currentClassLoader0();
  if ((cl != null) && hasAllPermission())   cl=null;
  return cl;
}

Fixed version (ground truth):
/** 
 * Returns the class loader of the most recently executing method from a class defined using a non-system class loader. A non-system class loader is defined as being a class loader that is not equal to the system class loader (as returned by   {@link ClassLoader#getSystemClassLoader}) or one of its ancestors. <p> This method will return <code>null</code> in the following three cases: <ol> <li>All methods on the execution stack are from classes defined using the system class loader or one of its ancestors. <li>All methods on the execution stack up to the first "privileged" caller (see   {@link java.security.AccessController#doPrivileged}) are from classes defined using the system class loader or one of its ancestors. <li> A call to <code>checkPermission</code> with <code>java.security.AllPermission</code> does not result in a SecurityException. </ol>
 * @return  the class loader of the most recent occurrence on the stackof a method from a class defined using a non-system class loader.
 * @deprecated This type of security checking is not recommended.It is recommended that the <code>checkPermission</code> call be used instead.
 * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
 * @see #checkPermission(java.security.Permission) checkPermission
 */
@Deprecated protected ClassLoader currentClassLoader(){
  ClassLoader cl=currentClassLoader0();
  if ((cl != null) && hasAllPermission())   cl=null;
  return cl;
}
Program: 71702
Project: 71702
Buggy source:
/** 
 * Returns the class of the most recently executing method from a class defined using a non-system class loader. A non-system class loader is defined as being a class loader that is not equal to the system class loader (as returned by   {@link ClassLoader#getSystemClassLoader}) or one of its ancestors. <p> This method will return <code>null</code> in the following three cases:<p> <ol> <li>All methods on the execution stack are from classes defined using the system class loader or one of its ancestors. <li>All methods on the execution stack up to the first "privileged" caller (see   {@link java.security.AccessController#doPrivileged}) are from classes defined using the system class loader or one of its ancestors. <li> A call to <code>checkPermission</code> with <code>java.security.AllPermission</code> does not result in a SecurityException. </ol>
 * @return  the class  of the most recent occurrence on the stackof a method from a class defined using a non-system class loader.
 * @deprecated This type of security checking is not recommended.It is recommended that the <code>checkPermission</code> call be used instead.
 * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
 * @see #checkPermission(java.security.Permission) checkPermission
 */
@Deprecated protected Class<?> currentLoadedClass(){
  Class<?> c=currentLoadedClass0();
  if ((c != null) && hasAllPermission())   c=null;
  return c;
}

Fixed version (ground truth):
/** 
 * Returns the class of the most recently executing method from a class defined using a non-system class loader. A non-system class loader is defined as being a class loader that is not equal to the system class loader (as returned by   {@link ClassLoader#getSystemClassLoader}) or one of its ancestors. <p> This method will return <code>null</code> in the following three cases: <ol> <li>All methods on the execution stack are from classes defined using the system class loader or one of its ancestors. <li>All methods on the execution stack up to the first "privileged" caller (see   {@link java.security.AccessController#doPrivileged}) are from classes defined using the system class loader or one of its ancestors. <li> A call to <code>checkPermission</code> with <code>java.security.AllPermission</code> does not result in a SecurityException. </ol>
 * @return  the class  of the most recent occurrence on the stackof a method from a class defined using a non-system class loader.
 * @deprecated This type of security checking is not recommended.It is recommended that the <code>checkPermission</code> call be used instead.
 * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
 * @see #checkPermission(java.security.Permission) checkPermission
 */
@Deprecated protected Class<?> currentLoadedClass(){
  Class<?> c=currentLoadedClass0();
  if ((c != null) && hasAllPermission())   c=null;
  return c;
}
Program: 71703
Project: 71703
Buggy source:
/** 
 * Call a JavaScript function member of this object.
 * @param name name of the member function to call
 * @param args arguments to be passed to the member function
 * @return result of call
 */
public Object callMember(String name,Object... args){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Call a JavaScript function member of this object.
 * @param name name of the member function to call
 * @param args arguments to be passed to the member function
 * @return result of call
 */
public Object callMember(final String name,final Object... args){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 71704
Project: 71704
Buggy source:
/** 
 * Does this object have a named member?
 * @param name name of member
 * @return true if this object has a member of the given name
 */
public boolean hasMember(String name){
  return false;
}

Fixed version (ground truth):
/** 
 * Does this object have a named member?
 * @param name name of member
 * @return true if this object has a member of the given name
 */
public boolean hasMember(final String name){
  return false;
}
Program: 71705
Project: 71705
Buggy source:
/** 
 * Retrieves a named member of this JavaScript object.
 * @param name of member
 * @return member
 */
public Object getMember(String name){
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieves a named member of this JavaScript object.
 * @param name of member
 * @return member
 */
public Object getMember(final String name){
  return null;
}
Program: 71706
Project: 71706
Buggy source:
/** 
 * Call this object as a JavaScript function. This is equivalent to 'func.apply(thiz, args)' in JavaScript.
 * @param thiz 'this' object to be passed to the function
 * @param args arguments to method
 * @return result of call
 */
public Object call(Object thiz,Object... args){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Call this object as a JavaScript function. This is equivalent to 'func.apply(thiz, args)' in JavaScript.
 * @param thiz 'this' object to be passed to the function
 * @param args arguments to method
 * @return result of call
 */
public Object call(final Object thiz,final Object... args){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 71707
Project: 71707
Buggy source:
/** 
 * Remove a named member from this JavaScript object
 * @param name name of the member
 */
public void removeMember(String name){
}

Fixed version (ground truth):
/** 
 * Remove a named member from this JavaScript object
 * @param name name of the member
 */
public void removeMember(final String name){
}
Program: 71708
Project: 71708
Buggy source:
/** 
 * Set an indexed member in this JavaScript object
 * @param index index of the member slot
 * @param value value of the member
 */
public void setSlot(int index,Object value){
}

Fixed version (ground truth):
/** 
 * Set an indexed member in this JavaScript object
 * @param index index of the member slot
 * @param value value of the member
 */
public void setSlot(final int index,final Object value){
}
Program: 71709
Project: 71709
Buggy source:
/** 
 * Retrieves an indexed member of this JavaScript object.
 * @param index index slot to retrieve
 * @return member
 */
public Object getSlot(int index){
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieves an indexed member of this JavaScript object.
 * @param index index slot to retrieve
 * @return member
 */
public Object getSlot(final int index){
  return null;
}
Program: 71710
Project: 71710
Buggy source:
/** 
 * Does this object have a indexed property?
 * @param slot index to check
 * @return true if this object has a slot
 */
public boolean hasSlot(int slot){
  return false;
}

Fixed version (ground truth):
/** 
 * Does this object have a indexed property?
 * @param slot index to check
 * @return true if this object has a slot
 */
public boolean hasSlot(final int slot){
  return false;
}
Program: 71711
Project: 71711
Buggy source:
/** 
 * Set a named member in this JavaScript object
 * @param name  name of the member
 * @param value value of the member
 */
public void setMember(String name,Object value){
}

Fixed version (ground truth):
/** 
 * Set a named member in this JavaScript object
 * @param name  name of the member
 * @param value value of the member
 */
public void setMember(final String name,final Object value){
}
Program: 71712
Project: 71712
Buggy source:
/** 
 * Evaluate a JavaScript expression.
 * @param s JavaScript expression to evaluate
 * @return evaluation result
 */
public Object eval(String s){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Evaluate a JavaScript expression.
 * @param s JavaScript expression to evaluate
 * @return evaluation result
 */
public Object eval(final String s){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 71713
Project: 71713
Buggy source:
/** 
 * Call this 'constructor' JavaScript function to create a new object. This is equivalent to 'new func(arg1, arg2...)' in JavaScript.
 * @param args arguments to method
 * @return result of constructor call
 */
public Object newObject(Object... args){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Call this 'constructor' JavaScript function to create a new object. This is equivalent to 'new func(arg1, arg2...)' in JavaScript.
 * @param args arguments to method
 * @return result of constructor call
 */
public Object newObject(final Object... args){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 71714
Project: 71714
Buggy source:
@Override public Object eval(final ScriptContext ctxt) throws ScriptException {
  final ScriptObject global=getNashornGlobalFrom(ctxt);
  if (func.getScope() == global) {
    return evalImpl(func,ctxt,global);
  }
 else {
    return evalImpl(compileImpl(source,ctxt),ctxt,global);
  }
}

Fixed version (ground truth):
@Override public Object eval(final ScriptContext ctxt) throws ScriptException {
  final ScriptObject globalObject=getNashornGlobalFrom(ctxt);
  if (func.getScope() == globalObject) {
    return evalImpl(func,ctxt,globalObject);
  }
  return evalImpl(compileImpl(source,ctxt),ctxt,globalObject);
}
Program: 71715
Project: 71715
Buggy source:
private CompiledScript asCompiledScript(final Source source) throws ScriptException {
  final ScriptFunction func=compileImpl(source,context);
  return new CompiledScript(){
    @Override public Object eval(    final ScriptContext ctxt) throws ScriptException {
      final ScriptObject global=getNashornGlobalFrom(ctxt);
      if (func.getScope() == global) {
        return evalImpl(func,ctxt,global);
      }
 else {
        return evalImpl(compileImpl(source,ctxt),ctxt,global);
      }
    }
    @Override public ScriptEngine getEngine(){
      return NashornScriptEngine.this;
    }
  }
;
}

Fixed version (ground truth):
private CompiledScript asCompiledScript(final Source source) throws ScriptException {
  final ScriptFunction func=compileImpl(source,context);
  return new CompiledScript(){
    @Override public Object eval(    final ScriptContext ctxt) throws ScriptException {
      final ScriptObject globalObject=getNashornGlobalFrom(ctxt);
      if (func.getScope() == globalObject) {
        return evalImpl(func,ctxt,globalObject);
      }
      return evalImpl(compileImpl(source,ctxt),ctxt,globalObject);
    }
    @Override public ScriptEngine getEngine(){
      return NashornScriptEngine.this;
    }
  }
;
}
Program: 71716
Project: 71716
Buggy source:
public ArrayType getArrayType(){
  if (elementType.isInteger()) {
    return Type.INT_ARRAY;
  }
 else   if (elementType.isLong()) {
    return Type.LONG_ARRAY;
  }
 else   if (elementType.isNumeric()) {
    return Type.NUMBER_ARRAY;
  }
 else {
    return Type.OBJECT_ARRAY;
  }
}

Fixed version (ground truth):
/** 
 * Get the array element type as Java format, e.g. [I
 * @return array element type
 */
public ArrayType getArrayType(){
  if (elementType.isInteger()) {
    return Type.INT_ARRAY;
  }
 else   if (elementType.isLong()) {
    return Type.LONG_ARRAY;
  }
 else   if (elementType.isNumeric()) {
    return Type.NUMBER_ARRAY;
  }
 else {
    return Type.OBJECT_ARRAY;
  }
}
Program: 71717
Project: 71717
Buggy source:
@Override public boolean isOfContext(final Context context){
  return this.context == context;
}

Fixed version (ground truth):
@Override public boolean isOfContext(final Context ctxt){
  return this.context == ctxt;
}
Program: 71718
Project: 71718
Buggy source:
/** 
 * Nashorn extension: Error.captureStackTrace. Capture stack trace at the point of call into the Error object provided.
 * @param self self reference
 * @param errorObj the error object
 * @return undefined
 */
@Function(attributes=Attribute.NOT_ENUMERABLE,where=Where.CONSTRUCTOR) public static Object captureStackTrace(final Object self,final Object errorObj){
  Global.checkObject(errorObj);
  final ScriptObject sobj=(ScriptObject)errorObj;
  final ECMAException exp=new ECMAException(sobj,null);
  sobj.delete("String_Node_Str",false);
  final ScriptFunction getStack=ScriptFunctionImpl.makeFunction("String_Node_Str",GET_STACK);
  final ScriptFunction setStack=ScriptFunctionImpl.makeFunction("String_Node_Str",SET_STACK);
  sobj.addOwnProperty("String_Node_Str",Attribute.NOT_ENUMERABLE,getStack,setStack);
  return UNDEFINED;
}

Fixed version (ground truth):
/** 
 * Nashorn extension: Error.captureStackTrace. Capture stack trace at the point of call into the Error object provided.
 * @param self self reference
 * @param errorObj the error object
 * @return undefined
 */
@SuppressWarnings("String_Node_Str") @Function(attributes=Attribute.NOT_ENUMERABLE,where=Where.CONSTRUCTOR) public static Object captureStackTrace(final Object self,final Object errorObj){
  Global.checkObject(errorObj);
  final ScriptObject sobj=(ScriptObject)errorObj;
  new ECMAException(sobj,null);
  sobj.delete("String_Node_Str",false);
  final ScriptFunction getStack=ScriptFunctionImpl.makeFunction("String_Node_Str",GET_STACK);
  final ScriptFunction setStack=ScriptFunctionImpl.makeFunction("String_Node_Str",SET_STACK);
  sobj.addOwnProperty("String_Node_Str",Attribute.NOT_ENUMERABLE,getStack,setStack);
  return UNDEFINED;
}
Program: 71719
Project: 71719
Buggy source:
ClassLoader getSharedLoader(){
  return sharedLoader;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") ClassLoader getSharedLoader(){
  return sharedLoader;
}
Program: 71720
Project: 71720
Buggy source:
/** 
 * Constructor A logger can be paired with a property, e.g.   {@code --log:codegen:info} is equivalent to {@code -Dnashorn.codegen.log}
 * @param loggerName name of logger - this is the unique key with which it can be identified
 * @param property   system property activating the logger on {@code info} level
 */
public DebugLogger(final String loggerName,final String property){
  if (property != null && Options.getBooleanProperty(property)) {
    this.logger=Logging.getOrCreateLogger(loggerName,Level.INFO);
  }
 else {
    this.logger=Logging.getLogger(loggerName);
  }
  this.isEnabled=logger.getLevel() != Level.OFF;
}

Fixed version (ground truth):
/** 
 * Constructor A logger can be paired with a property, e.g.   {@code --log:codegen:info} is equivalent to {@code -Dnashorn.codegen.log}
 * @param loggerName name of logger - this is the unique key with which it can be identified
 * @param property   system property activating the logger on {@code info} level
 */
public DebugLogger(final String loggerName,final String property){
}
Program: 71721
Project: 71721
Buggy source:
/** 
 * Check if the logger is above of the level of detail given
 * @see java.util.logging.Level
 * @param level logging level
 * @return true if level is above the given one
 */
public boolean levelAbove(final Level level){
  return logger.getLevel().intValue() > level.intValue();
}

Fixed version (ground truth):
/** 
 * Check if the logger is above of the level of detail given
 * @see java.util.logging.Level
 * @param level logging level
 * @return true if level is above the given one
 */
public boolean levelAbove(final Level level){
  return getLevel().intValue() > level.intValue();
}
Program: 71722
Project: 71722
Buggy source:
/** 
 * Is this global of the given Context?
 * @return true if this global belongs to the given Context
 */
public boolean isOfContext(Context context);

Fixed version (ground truth):
/** 
 * Is this global of the given Context?
 * @param ctxt the context
 * @return true if this global belongs to the given Context
 */
public boolean isOfContext(final Context ctxt);
Program: 71723
Project: 71723
Buggy source:
private Node leaveCmp(final BinaryNode binaryNode){
  ensureTypeNotUnknown(binaryNode.lhs());
  ensureTypeNotUnknown(binaryNode.rhs());
  return end(ensureSymbol(Type.BOOLEAN,binaryNode));
}

Fixed version (ground truth):
private Node leaveCmp(final BinaryNode binaryNode){
  ensureTypeNotUnknown(binaryNode.lhs());
  ensureTypeNotUnknown(binaryNode.rhs());
  Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  ensureSymbol(widest,binaryNode.lhs());
  ensureSymbol(widest,binaryNode.rhs());
  return end(ensureSymbol(Type.BOOLEAN,binaryNode));
}
Program: 71724
Project: 71724
Buggy source:
@Override public Node leaveNEW(final UnaryNode unaryNode){
  return end(ensureSymbol(Type.OBJECT,unaryNode));
}

Fixed version (ground truth):
@Override public Node leaveNEW(final UnaryNode unaryNode){
  return end(ensureSymbol(Type.OBJECT,unaryNode.setRHS(((CallNode)unaryNode.rhs()).setIsNew())));
}
Program: 71725
Project: 71725
Buggy source:
/** 
 * Eg. var d = 17; var e; e = d; //initially typed as int for node type, should retype as double e = object; var d = 17; var e; e -= d; //initially type number, should number remain with a final conversion supplied by Store. ugly, but the computation result of the sub is numeric e = object;
 */
@SuppressWarnings("String_Node_Str") @Override public Node leaveBinaryNode(final BinaryNode binaryNode){
  final Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  BinaryNode newBinaryNode=binaryNode;
switch (binaryNode.tokenType()) {
default :
    if (!binaryNode.isAssignment() || binaryNode.isSelfModifying()) {
      break;
    }
  newBinaryNode=newBinaryNode.setLHS(widen(newBinaryNode.lhs(),widest));
case ADD:
newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
}
return newBinaryNode;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Node leaveBinaryNode(final BinaryNode binaryNode){
  final Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  BinaryNode newBinaryNode=binaryNode;
  if (isAdd(binaryNode)) {
    newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
    if (newBinaryNode.getType().isObject() && !isAddString(newBinaryNode)) {
      return new RuntimeNode(newBinaryNode,Request.ADD);
    }
  }
 else   if (binaryNode.isComparison()) {
    final Expression lhs=newBinaryNode.lhs();
    final Expression rhs=newBinaryNode.rhs();
    Type cmpWidest=Type.widest(lhs.getType(),rhs.getType());
    boolean newRuntimeNode=false, finalized=false;
switch (newBinaryNode.tokenType()) {
case EQ_STRICT:
case NE_STRICT:
      if (lhs.getType().isBoolean() != rhs.getType().isBoolean()) {
        newRuntimeNode=true;
        cmpWidest=Type.OBJECT;
        finalized=true;
      }
default :
    if (newRuntimeNode || cmpWidest.isObject()) {
      return new RuntimeNode(newBinaryNode,Request.requestFor(binaryNode)).setIsFinal(finalized);
    }
  break;
}
return newBinaryNode;
}
 else {
if (!binaryNode.isAssignment() || binaryNode.isSelfModifying()) {
return newBinaryNode;
}
checkThisAssignment(binaryNode);
newBinaryNode=newBinaryNode.setLHS(widen(newBinaryNode.lhs(),widest));
newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
}
return newBinaryNode;
}
Program: 71727
Project: 71727
Buggy source:
private void branchOptimizer(final Expression node,final Label label,final boolean state){
  if (!(node instanceof TernaryNode)) {
    if (node instanceof BinaryNode) {
      branchOptimizer((BinaryNode)node,label,state);
      return;
    }
    if (node instanceof UnaryNode) {
      branchOptimizer((UnaryNode)node,label,state);
      return;
    }
  }
  load(node);
  method.convert(Type.BOOLEAN);
  if (state) {
    method.ifne(label);
  }
 else {
    method.ifeq(label);
  }
}

Fixed version (ground truth):
private void branchOptimizer(final Expression node,final Label label,final boolean state){
  if (!(node instanceof TernaryNode)) {
    if (node instanceof BinaryNode) {
      branchOptimizer((BinaryNode)node,label,state);
      return;
    }
    if (node instanceof UnaryNode) {
      branchOptimizer((UnaryNode)node,label,state);
      return;
    }
  }
  codegen.load(node);
  method.convert(Type.BOOLEAN);
  if (state) {
    method.ifne(label);
  }
 else {
    method.ifeq(label);
  }
}
Program: 71728
Project: 71728
Buggy source:
/** 
 * Returns the identification string associated with this <code>GraphicsDevice</code>. <p> A particular program might use more than one <code>GraphicsDevice</code> in a <code>GraphicsEnvironment</code>. This method returns a <code>String</code> identifying a particular <code>GraphicsDevice</code> in the local <code>GraphicsEnvironment</code>.  Although there is no public method to set this <code>String</code>, a programmer can use the <code>String</code> for debugging purposes.  Vendors of the Java<sup><font size=-2>TM</font></sup> Runtime Environment can format the return value of the <code>String</code>.  To determine how to interpret the value of the <code>String</code>, contact the vendor of your Java Runtime.  To find out who the vendor is, from your program, call the  {@link System#getProperty(String) getProperty} method of theSystem class with "java.vendor".
 * @return a <code>String</code> that is the identificationof this <code>GraphicsDevice</code>.
 */
public abstract String getIDstring();

Fixed version (ground truth):
/** 
 * Returns the identification string associated with this <code>GraphicsDevice</code>. <p> A particular program might use more than one <code>GraphicsDevice</code> in a <code>GraphicsEnvironment</code>. This method returns a <code>String</code> identifying a particular <code>GraphicsDevice</code> in the local <code>GraphicsEnvironment</code>.  Although there is no public method to set this <code>String</code>, a programmer can use the <code>String</code> for debugging purposes.  Vendors of the Java&trade; Runtime Environment can format the return value of the <code>String</code>.  To determine how to interpret the value of the <code>String</code>, contact the vendor of your Java Runtime.  To find out who the vendor is, from your program, call the  {@link System#getProperty(String) getProperty} method of theSystem class with "java.vendor".
 * @return a <code>String</code> that is the identificationof this <code>GraphicsDevice</code>.
 */
public abstract String getIDstring();
Program: 71729
Project: 71729
Buggy source:
/** 
 * Returns an array of design limits interleaved in the form [from->to] for each axis.  For example, design limits for weight could be from 0.1 to 1.0. The values are returned in the same order returned by <code>getDesignAxisNames</code>.
 * @return an array of design limits for each axis.
 */
public float[] getDesignAxisRanges();

Fixed version (ground truth):
/** 
 * Returns an array of design limits interleaved in the form [from&rarr;to] for each axis.  For example, design limits for weight could be from 0.1 to 1.0. The values are returned in the same order returned by <code>getDesignAxisNames</code>.
 * @return an array of design limits for each axis.
 */
public float[] getDesignAxisRanges();
Program: 71730
Project: 71730
Buggy source:
/** 
 * Returns an <code>int</code> that ORs together the values for all the ranges that will be shaped. <p> For example, to check if a shaper shapes to Arabic, you would use the following: <blockquote> <code>if ((shaper.getRanges() & shaper.ARABIC) != 0) { ... </code> </blockquote> <p>Note that this method supports only the bit mask-based ranges. Call   {@link #getRangeSet()} for the enum-based ranges.
 * @return the values for all the ranges to be shaped.
 */
public int getRanges(){
  return mask & ~CONTEXTUAL_MASK;
}

Fixed version (ground truth):
/** 
 * Returns an <code>int</code> that ORs together the values for all the ranges that will be shaped. <p> For example, to check if a shaper shapes to Arabic, you would use the following: <blockquote> <code>if ((shaper.getRanges() &amp; shaper.ARABIC) != 0) { ... </code> </blockquote> <p>Note that this method supports only the bit mask-based ranges. Call   {@link #getRangeSet()} for the enum-based ranges.
 * @return the values for all the ranges to be shaped.
 */
public int getRanges(){
  return mask & ~CONTEXTUAL_MASK;
}
Program: 71732
Project: 71732
Buggy source:
/** 
 * Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into the text of the start of the selection >= 0
 */
public int getSelectionStart(){
  return JTextComponent.this.getSelectionStart();
}

Fixed version (ground truth):
/** 
 * Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into the text of the start of the selection &ge; 0
 */
public int getSelectionStart(){
  return JTextComponent.this.getSelectionStart();
}
Program: 71733
Project: 71733
Buggy source:
/** 
 * Sets the selection end to the specified position.  The new end point is constrained to be at or after the current selection start. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionEnd the end position of the text >= 0
 * @beaninfo description: ending location of the selection.
 */
public void setSelectionEnd(int selectionEnd){
  select(getSelectionStart(),selectionEnd);
}

Fixed version (ground truth):
/** 
 * Sets the selection end to the specified position.  The new end point is constrained to be at or after the current selection start. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionEnd the end position of the text &ge; 0
 * @beaninfo description: ending location of the selection.
 */
public void setSelectionEnd(int selectionEnd){
  select(getSelectionStart(),selectionEnd);
}
Program: 71734
Project: 71734
Buggy source:
/** 
 * Sets the selection start to the specified position.  The new starting point is constrained to be before or at the current selection end. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionStart the start position of the text >= 0
 * @beaninfo description: starting location of the selection.
 */
public void setSelectionStart(int selectionStart){
  select(selectionStart,getSelectionEnd());
}

Fixed version (ground truth):
/** 
 * Sets the selection start to the specified position.  The new starting point is constrained to be before or at the current selection end. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionStart the start position of the text &ge; 0
 * @beaninfo description: starting location of the selection.
 */
public void setSelectionStart(int selectionStart){
  select(selectionStart,getSelectionEnd());
}
Program: 71736
Project: 71736
Buggy source:
/** 
 * Converts the given place in the view coordinate system to the nearest representative location in the model. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pt the location in the view to translate
 * @return the offset >= 0 from the start of the document,or -1 if the component does not yet have a positive size.
 * @see TextUI#viewToModel
 */
public int viewToModel(Point pt){
  return getUI().viewToModel(this,pt);
}

Fixed version (ground truth):
/** 
 * Converts the given place in the view coordinate system to the nearest representative location in the model. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pt the location in the view to translate
 * @return the offset &ge; 0 from the start of the document,or -1 if the component does not yet have a positive size.
 * @see TextUI#viewToModel
 */
public int viewToModel(Point pt){
  return getUI().viewToModel(this,pt);
}
Program: 71737
Project: 71737
Buggy source:
/** 
 * Returns the number of characters (valid indices)
 * @return the number of characters >= 0
 */
public int getCharCount(){
  return model.getLength();
}

Fixed version (ground truth):
/** 
 * Returns the number of characters (valid indices)
 * @return the number of characters &ge; 0
 */
public int getCharCount(){
  return model.getLength();
}
Program: 71738
Project: 71738
Buggy source:
/** 
 * Converts the given location in the model to a place in the view coordinate system. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pos the position >= 0
 * @return the coordinates as a rectangle, with (r.x, r.y) as the locationin the coordinate system, or null if the component does not yet have a positive size.
 * @exception BadLocationException if the given position does notrepresent a valid location in the associated document
 * @see TextUI#modelToView
 */
public Rectangle modelToView(int pos) throws BadLocationException {
  return getUI().modelToView(this,pos);
}

Fixed version (ground truth):
/** 
 * Converts the given location in the model to a place in the view coordinate system. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pos the position &ge; 0
 * @return the coordinates as a rectangle, with (r.x, r.y) as the locationin the coordinate system, or null if the component does not yet have a positive size.
 * @exception BadLocationException if the given position does notrepresent a valid location in the associated document
 * @see TextUI#modelToView
 */
public Rectangle modelToView(int pos) throws BadLocationException {
  return getUI().modelToView(this,pos);
}
Program: 71739
Project: 71739
Buggy source:
/** 
 * Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into teh text of the end of the selection >= 0
 */
public int getSelectionEnd(){
  return JTextComponent.this.getSelectionEnd();
}

Fixed version (ground truth):
/** 
 * Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into teh text of the end of the selection &ge; 0
 */
public int getSelectionEnd(){
  return JTextComponent.this.getSelectionEnd();
}