nus-yam/ex-repair huggingface dataset:
Program: 36351
Project: 36351
Buggy source:
/** 
 * Returns <code>true</code> if this <code>RenderingHints</code> contains a mapping for the specified key.
 * @param key key whose presence in this<code>RenderingHints</code> is to be tested.
 * @return <code>true</code> if this <code>RenderingHints</code>contains a mapping for the specified key.
 * @exception <code>ClassCastException</code> if the key can notbe cast to <code>RenderingHints.Key</code>
 */
public boolean containsKey(Object key){
  return hintmap.containsKey((Key)key);
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if this {@code RenderingHints}contains a mapping for the specified key.
 * @param key key whose presence in this{@code RenderingHints} is to be tested.
 * @return {@code true} if this {@code RenderingHints}contains a mapping for the specified key.
 * @exception ClassCastException if the key can notbe cast to  {@code RenderingHints.Key}
 */
public boolean containsKey(Object key){
  return hintmap.containsKey((Key)key);
}
Program: 36352
Project: 36352
Buggy source:
/** 
 * Maps the specified <code>key</code> to the specified <code>value</code> in this <code>RenderingHints</code> object. Neither the key nor the value can be <code>null</code>. The value can be retrieved by calling the <code>get</code> method with a key that is equal to the original key.
 * @param key     the rendering hint key.
 * @param value   the rendering hint value.
 * @return     the previous value of the specified key in this objector <code>null</code> if it did not have one.
 * @exception <code>NullPointerException</code> if the key is<code>null</code>.
 * @exception <code>ClassCastException</code> if the key can notbe cast to <code>RenderingHints.Key</code>
 * @exception <code>IllegalArgumentException</code> if the{@link Key#isCompatibleValue(java.lang.Object) Key.isCompatibleValue()}method of the specified key returns false for the specified value
 * @see #get(Object)
 */
public Object put(Object key,Object value){
  if (!((Key)key).isCompatibleValue(value)) {
    throw new IllegalArgumentException(value + "String_Node_Str" + key);
  }
  return hintmap.put((Key)key,value);
}

Fixed version (ground truth):
/** 
 * Maps the specified   {@code key} to the specified{@code value} in this {@code RenderingHints} object.Neither the key nor the value can be  {@code null}. The value can be retrieved by calling the   {@code get} methodwith a key that is equal to the original key.
 * @param key     the rendering hint key.
 * @param value   the rendering hint value.
 * @return     the previous value of the specified key in this objector  {@code null} if it did not have one.
 * @exception NullPointerException if the key is{@code null}.
 * @exception ClassCastException if the key can notbe cast to  {@code RenderingHints.Key}
 * @exception IllegalArgumentException if the{@link Key#isCompatibleValue(java.lang.Object) Key.isCompatibleValue()}method of the specified key returns false for the specified value
 * @see #get(Object)
 */
public Object put(Object key,Object value){
  if (!((Key)key).isCompatibleValue(value)) {
    throw new IllegalArgumentException(value + "String_Node_Str" + key);
  }
  return hintmap.put((Key)key,value);
}
Program: 36353
Project: 36353
Buggy source:
/** 
 * Removes the key and its corresponding value from this <code>RenderingHints</code> object. This method does nothing if the key is not in this <code>RenderingHints</code> object.
 * @param key   the rendering hints key that needs to be removed
 * @exception <code>ClassCastException</code> if the key can notbe cast to <code>RenderingHints.Key</code>
 * @return  the value to which the key had previously been mapped in this<code>RenderingHints</code> object, or <code>null</code> if the key did not have a mapping.
 */
public Object remove(Object key){
  return hintmap.remove((Key)key);
}

Fixed version (ground truth):
/** 
 * Removes the key and its corresponding value from this  {@code RenderingHints} object. This method does nothing if thekey is not in this  {@code RenderingHints} object.
 * @param key   the rendering hints key that needs to be removed
 * @exception ClassCastException if the key can notbe cast to  {@code RenderingHints.Key}
 * @return  the value to which the key had previously been mapped in this{@code RenderingHints} object, or {@code null}if the key did not have a mapping.
 */
public Object remove(Object key){
  return hintmap.remove((Key)key);
}
Program: 36354
Project: 36354
Buggy source:
/** 
 * Returns the value to which the specified key is mapped.
 * @param key   a rendering hint key
 * @return  the value to which the key is mapped in this object or<code>null</code> if the key is not mapped to any value in this object.
 * @exception <code>ClassCastException</code> if the key can notbe cast to <code>RenderingHints.Key</code>
 * @see #put(Object,Object)
 */
public Object get(Object key){
  return hintmap.get((Key)key);
}

Fixed version (ground truth):
/** 
 * Returns the value to which the specified key is mapped.
 * @param key   a rendering hint key
 * @return  the value to which the key is mapped in this object or{@code null} if the key is not mapped to any value inthis object.
 * @exception ClassCastException if the key can notbe cast to  {@code RenderingHints.Key}
 * @see #put(Object,Object)
 */
public Object get(Object key){
  return hintmap.get((Key)key);
}
Program: 36355
Project: 36355
Buggy source:
/** 
 * Copies all of the mappings from the specified <code>Map</code> to this <code>RenderingHints</code>.  These mappings replace any mappings that this <code>RenderingHints</code> had for any of the keys currently in the specified <code>Map</code>.
 * @param m the specified <code>Map</code>
 * @exception <code>ClassCastException</code> class of a key or valuein the specified <code>Map</code> prevents it from being stored in this <code>RenderingHints</code>.
 * @exception <code>IllegalArgumentException</code> some aspectof a key or value in the specified <code>Map</code> prevents it from being stored in this <code>RenderingHints</code>.
 */
public void putAll(Map<?,?> m){
  if (RenderingHints.class.isInstance(m)) {
    for (    Map.Entry<?,?> entry : m.entrySet())     hintmap.put(entry.getKey(),entry.getValue());
  }
 else {
    for (    Map.Entry<?,?> entry : m.entrySet())     put(entry.getKey(),entry.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Copies all of the mappings from the specified   {@code Map}to this   {@code RenderingHints}.  These mappings replace any mappings that this   {@code RenderingHints} had for anyof the keys currently in the specified  {@code Map}.
 * @param m the specified {@code Map}
 * @exception ClassCastException class of a key or valuein the specified  {@code Map} prevents it from beingstored in this  {@code RenderingHints}.
 * @exception IllegalArgumentException some aspectof a key or value in the specified  {@code Map}prevents it from being stored in this   {@code RenderingHints}.
 */
public void putAll(Map<?,?> m){
  if (RenderingHints.class.isInstance(m)) {
    for (    Map.Entry<?,?> entry : m.entrySet())     hintmap.put(entry.getKey(),entry.getValue());
  }
 else {
    for (    Map.Entry<?,?> entry : m.entrySet())     put(entry.getKey(),entry.getValue());
  }
}
Program: 36356
Project: 36356
Buggy source:
/** 
 * Returns the String before a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text >= 0
 * @return the letter, word, or sentence, null for an invalid indexor part
 * @since 1.3
 */
public String getBeforeIndex(int part,int index){
  if (index < 0 || index > getCharCount() - 1) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    if (index == 0) {
      return null;
    }
  try {
    return getText(index - 1,1);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.WORD:
try {
  String s=getText(0,getCharCount());
  BreakIterator words=BreakIterator.getWordInstance(getLocale());
  words.setText(s);
  int end=words.following(index);
  end=words.previous();
  int start=words.previous();
  if (start == BreakIterator.DONE) {
    return null;
  }
  return s.substring(start,end);
}
 catch (BadLocationException e) {
  return null;
}
case AccessibleText.SENTENCE:
try {
String s=getText(0,getCharCount());
BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
sentence.setText(s);
int end=sentence.following(index);
end=sentence.previous();
int start=sentence.previous();
if (start == BreakIterator.DONE) {
  return null;
}
return s.substring(start,end);
}
 catch (BadLocationException e) {
return null;
}
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Returns the String before a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text &gt;= 0
 * @return the letter, word, or sentence, null for an invalid indexor part
 * @since 1.3
 */
public String getBeforeIndex(int part,int index){
  if (index < 0 || index > getCharCount() - 1) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    if (index == 0) {
      return null;
    }
  try {
    return getText(index - 1,1);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.WORD:
try {
  String s=getText(0,getCharCount());
  BreakIterator words=BreakIterator.getWordInstance(getLocale());
  words.setText(s);
  int end=words.following(index);
  end=words.previous();
  int start=words.previous();
  if (start == BreakIterator.DONE) {
    return null;
  }
  return s.substring(start,end);
}
 catch (BadLocationException e) {
  return null;
}
case AccessibleText.SENTENCE:
try {
String s=getText(0,getCharCount());
BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
sentence.setText(s);
int end=sentence.following(index);
end=sentence.previous();
int start=sentence.previous();
if (start == BreakIterator.DONE) {
  return null;
}
return s.substring(start,end);
}
 catch (BadLocationException e) {
return null;
}
default :
return null;
}
}
Program: 36357
Project: 36357
Buggy source:
/** 
 * Returns the String at a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text >= 0
 * @return the letter, word, or sentence,null for an invalid index or part
 * @since 1.3
 */
public String getAtIndex(int part,int index){
  if (index < 0 || index >= getCharCount()) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    try {
      return getText(index,1);
    }
 catch (    BadLocationException e) {
      return null;
    }
case AccessibleText.WORD:
  try {
    String s=getText(0,getCharCount());
    BreakIterator words=BreakIterator.getWordInstance(getLocale());
    words.setText(s);
    int end=words.following(index);
    return s.substring(words.previous(),end);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.SENTENCE:
try {
  String s=getText(0,getCharCount());
  BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
  sentence.setText(s);
  int end=sentence.following(index);
  return s.substring(sentence.previous(),end);
}
 catch (BadLocationException e) {
  return null;
}
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Returns the String at a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text &gt;= 0
 * @return the letter, word, or sentence,null for an invalid index or part
 * @since 1.3
 */
public String getAtIndex(int part,int index){
  if (index < 0 || index >= getCharCount()) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    try {
      return getText(index,1);
    }
 catch (    BadLocationException e) {
      return null;
    }
case AccessibleText.WORD:
  try {
    String s=getText(0,getCharCount());
    BreakIterator words=BreakIterator.getWordInstance(getLocale());
    words.setText(s);
    int end=words.following(index);
    return s.substring(words.previous(),end);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.SENTENCE:
try {
  String s=getText(0,getCharCount());
  BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
  sentence.setText(s);
  int end=sentence.following(index);
  return s.substring(sentence.previous(),end);
}
 catch (BadLocationException e) {
  return null;
}
default :
return null;
}
}
Program: 36358
Project: 36358
Buggy source:
/** 
 * Sets the <code>contentAreaFilled</code> property. If <code>true</code> the button will paint the content area.  If you wish to have a transparent button, such as an icon only button, for example, then you should set this to <code>false</code>. Do not call <code>setOpaque(false)</code>. The default value for the the <code>contentAreaFilled</code> property is <code>true</code>. <p> This function may cause the component's opaque property to change. <p> The exact behavior of calling this function varies on a component-by-component and L&F-by-L&F basis.
 * @param b if true, the content should be filled; if falsethe content area is not filled
 * @see #isContentAreaFilled
 * @see #setOpaque
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the button should paint the content area or leave it transparent.
 */
public void setContentAreaFilled(boolean b){
  boolean oldValue=contentAreaFilled;
  contentAreaFilled=b;
  contentAreaFilledSet=true;
  firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY,oldValue,contentAreaFilled);
  if (b != oldValue) {
    repaint();
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>contentAreaFilled</code> property. If <code>true</code> the button will paint the content area.  If you wish to have a transparent button, such as an icon only button, for example, then you should set this to <code>false</code>. Do not call <code>setOpaque(false)</code>. The default value for the the <code>contentAreaFilled</code> property is <code>true</code>. <p> This function may cause the component's opaque property to change. <p> The exact behavior of calling this function varies on a component-by-component and L&amp;F-by-L&amp;F basis.
 * @param b if true, the content should be filled; if falsethe content area is not filled
 * @see #isContentAreaFilled
 * @see #setOpaque
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the button should paint the content area or leave it transparent.
 */
public void setContentAreaFilled(boolean b){
  boolean oldValue=contentAreaFilled;
  contentAreaFilled=b;
  contentAreaFilledSet=true;
  firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY,oldValue,contentAreaFilled);
  if (b != oldValue) {
    repaint();
  }
}
Program: 36359
Project: 36359
Buggy source:
/** 
 * Returns the L&F object that renders this component.
 * @return the ButtonUI object
 * @see #setUI
 */
public ButtonUI getUI(){
  return (ButtonUI)ui;
}

Fixed version (ground truth):
/** 
 * Returns the L&amp;F object that renders this component.
 * @return the ButtonUI object
 * @see #setUI
 */
public ButtonUI getUI(){
  return (ButtonUI)ui;
}
Program: 36361
Project: 36361
Buggy source:
/** 
 * Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events.  After the initial mouse press occurs (and action event generated) any subsequent mouse press events which occur on intervals less than the threshhold will be ignored and no corresponding action event generated.  By default the threshhold is 0, which means that for each mouse press, an action event will be fired, no matter how quickly the mouse clicks occur.  In buttons where this behavior is not desirable (for example, the "OK" button in a dialog), this threshhold should be set to an appropriate positive value.
 * @see #getMultiClickThreshhold
 * @param threshhold the amount of time required between mousepress events to generate corresponding action events
 * @exception IllegalArgumentException if threshhold < 0
 * @since 1.4
 */
public void setMultiClickThreshhold(long threshhold){
  if (threshhold < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.multiClickThreshhold=threshhold;
}

Fixed version (ground truth):
/** 
 * Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events.  After the initial mouse press occurs (and action event generated) any subsequent mouse press events which occur on intervals less than the threshhold will be ignored and no corresponding action event generated.  By default the threshhold is 0, which means that for each mouse press, an action event will be fired, no matter how quickly the mouse clicks occur.  In buttons where this behavior is not desirable (for example, the "OK" button in a dialog), this threshhold should be set to an appropriate positive value.
 * @see #getMultiClickThreshhold
 * @param threshhold the amount of time required between mousepress events to generate corresponding action events
 * @exception IllegalArgumentException if threshhold &lt; 0
 * @since 1.4
 */
public void setMultiClickThreshhold(long threshhold){
  if (threshhold < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.multiClickThreshhold=threshhold;
}
Program: 36362
Project: 36362
Buggy source:
/** 
 * Sets the <code>borderPainted</code> property. If <code>true</code> and the button has a border, the border is painted. The default value for the <code>borderPainted</code> property is <code>true</code>. <p/> Some look and feels might not support the <code>borderPainted</code> property, in which case they ignore this.
 * @param b if true and border property is not <code>null</code>,the border is painted
 * @see #isBorderPainted
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the border should be painted.
 */
public void setBorderPainted(boolean b){
  boolean oldValue=paintBorder;
  paintBorder=b;
  borderPaintedSet=true;
  firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY,oldValue,paintBorder);
  if (b != oldValue) {
    revalidate();
    repaint();
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>borderPainted</code> property. If <code>true</code> and the button has a border, the border is painted. The default value for the <code>borderPainted</code> property is <code>true</code>. <p> Some look and feels might not support the <code>borderPainted</code> property, in which case they ignore this.
 * @param b if true and border property is not <code>null</code>,the border is painted
 * @see #isBorderPainted
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the border should be painted.
 */
public void setBorderPainted(boolean b){
  boolean oldValue=paintBorder;
  paintBorder=b;
  borderPaintedSet=true;
  firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY,oldValue,paintBorder);
  if (b != oldValue) {
    revalidate();
    repaint();
  }
}
Program: 36363
Project: 36363
Buggy source:
/** 
 * Sets the L&F object that renders this component.
 * @param ui the <code>ButtonUI</code> L&F object
 * @see #getUI
 * @beaninfo bound: true hidden: true attribute: visualUpdate true description: The UI object that implements the LookAndFeel.
 */
public void setUI(ButtonUI ui){
  super.setUI(ui);
  if (disabledIcon instanceof UIResource) {
    setDisabledIcon(null);
  }
  if (disabledSelectedIcon instanceof UIResource) {
    setDisabledSelectedIcon(null);
  }
}

Fixed version (ground truth):
/** 
 * Sets the L&amp;F object that renders this component.
 * @param ui the <code>ButtonUI</code> L&amp;F object
 * @see #getUI
 * @beaninfo bound: true hidden: true attribute: visualUpdate true description: The UI object that implements the LookAndFeel.
 */
public void setUI(ButtonUI ui){
  super.setUI(ui);
  if (disabledIcon instanceof UIResource) {
    setDisabledIcon(null);
  }
  if (disabledSelectedIcon instanceof UIResource) {
    setDisabledSelectedIcon(null);
  }
}
Program: 36364
Project: 36364
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: 36366
Project: 36366
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: 36367
Project: 36367
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: 36368
Project: 36368
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: 36369
Project: 36369
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: 36370
Project: 36370
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: 36371
Project: 36371
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: 36372
Project: 36372
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: 36373
Project: 36373
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: 36374
Project: 36374
Buggy source:
ClassLoader getSharedLoader(){
  return sharedLoader;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") ClassLoader getSharedLoader(){
  return sharedLoader;
}
Program: 36375
Project: 36375
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: 36376
Project: 36376
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: 36377
Project: 36377
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: 36378
Project: 36378
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: 36379
Project: 36379
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: 36380
Project: 36380
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: 36381
Project: 36381
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: 36382
Project: 36382
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: 36383
Project: 36383
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: 36384
Project: 36384
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: 36385
Project: 36385
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: 36386
Project: 36386
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: 36387
Project: 36387
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: 36388
Project: 36388
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: 36389
Project: 36389
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: 36390
Project: 36390
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: 36391
Project: 36391
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: 36392
Project: 36392
Buggy source:
ClassLoader getSharedLoader(){
  return sharedLoader;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") ClassLoader getSharedLoader(){
  return sharedLoader;
}
Program: 36393
Project: 36393
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){
}