nus-yam/ex-repair huggingface dataset:
Program: 36837
Project: 36837
Buggy source:
/** 
 * Analagous to <code>java.lang.ClassLoader.getResourceAsStream()</code>, this method allows a <code>BeanContext</code> implementation to interpose behavior between the child <code>Component</code> and underlying <code>ClassLoader</code>.
 * @param name the resource name
 * @param bcc the specified child
 * @return an <code>InputStream</code> for reading the resource,or <code>null</code> if the resource could not be found.
 * @throws <code>IllegalArgumentException</code> ifthe resource is not valid
 */
InputStream getResourceAsStream(String name,BeanContextChild bcc) throws IllegalArgumentException ;

Fixed version (ground truth):
/** 
 * Analagous to <code>java.lang.ClassLoader.getResourceAsStream()</code>, this method allows a <code>BeanContext</code> implementation to interpose behavior between the child <code>Component</code> and underlying <code>ClassLoader</code>.
 * @param name the resource name
 * @param bcc the specified child
 * @return an <code>InputStream</code> for reading the resource,or <code>null</code> if the resource could not be found.
 * @throws IllegalArgumentException ifthe resource is not valid
 */
InputStream getResourceAsStream(String name,BeanContextChild bcc) throws IllegalArgumentException ;
Program: 36838
Project: 36838
Buggy source:
/** 
 * Instantiate the javaBean named as a child of this <code>BeanContext</code>. The implementation of the JavaBean is derived from the value of the beanName parameter, and is defined by the <code>java.beans.Beans.instantiate()</code> method.
 * @param beanName The name of the JavaBean to instantiateas a child of this <code>BeanContext</code>
 * @throws <code>IOException</code>
 * @throws <code>ClassNotFoundException</code> if the class identifiedby the beanName parameter is not found
 */
Object instantiateChild(String beanName) throws IOException, ClassNotFoundException ;

Fixed version (ground truth):
/** 
 * Instantiate the javaBean named as a child of this <code>BeanContext</code>. The implementation of the JavaBean is derived from the value of the beanName parameter, and is defined by the <code>java.beans.Beans.instantiate()</code> method.
 * @return a javaBean named as a child of this<code>BeanContext</code>
 * @param beanName The name of the JavaBean to instantiateas a child of this <code>BeanContext</code>
 * @throws IOException if an IO problem occurs
 * @throws ClassNotFoundException if the class identifiedby the beanName parameter is not found
 */
Object instantiateChild(String beanName) throws IOException, ClassNotFoundException ;
Program: 36839
Project: 36839
Buggy source:
/** 
 * Returns a   {@link BinaryOperator} which returns the greater of two elementsaccording to the specified  {@code Comparator}
 * @param comparator a {@code Comparator} for comparing the two values
 * @return a {@code BinaryOperator} which returns the greater of its operands,according to the supplied  {@code Comparator}
 * @throws NullPointerException if the argument is null
 */
public static <T>BinaryOperator<T> maxBy(Comparator<? super T> comparator){
  Objects.requireNonNull(comparator);
  return (a,b) -> comparator.compare(a,b) >= 0 ? a : b;
}

Fixed version (ground truth):
/** 
 * Returns a   {@link BinaryOperator} which returns the greater of two elementsaccording to the specified  {@code Comparator}
 * @param < T > the type of values to be compared and returned
 * @param comparator a {@code Comparator} for comparing the two values
 * @return a {@code BinaryOperator} which returns the greater of its operands,according to the supplied  {@code Comparator}
 * @throws NullPointerException if the argument is null
 */
public static <T>BinaryOperator<T> maxBy(Comparator<? super T> comparator){
  Objects.requireNonNull(comparator);
  return (a,b) -> comparator.compare(a,b) >= 0 ? a : b;
}
Program: 36840
Project: 36840
Buggy source:
/** 
 * Returns a   {@link BinaryOperator} which returns the lesser of two elementsaccording to the specified  {@code Comparator}
 * @param comparator a {@code Comparator} for comparing the two values
 * @return a {@code BinaryOperator} which returns the lesser of its operands,according to the supplied  {@code Comparator}
 * @throws NullPointerException if the argument is null
 */
public static <T>BinaryOperator<T> minBy(Comparator<? super T> comparator){
  Objects.requireNonNull(comparator);
  return (a,b) -> comparator.compare(a,b) <= 0 ? a : b;
}

Fixed version (ground truth):
/** 
 * Returns a   {@link BinaryOperator} which returns the lesser of two elementsaccording to the specified  {@code Comparator}
 * @param < T > the type of values to be compared and returned
 * @param comparator a {@code Comparator} for comparing the two values
 * @return a {@code BinaryOperator} which returns the lesser of its operands,according to the supplied  {@code Comparator}
 * @throws NullPointerException if the argument is null
 */
public static <T>BinaryOperator<T> minBy(Comparator<? super T> comparator){
  Objects.requireNonNull(comparator);
  return (a,b) -> comparator.compare(a,b) <= 0 ? a : b;
}
Program: 36841
Project: 36841
Buggy source:
/** 
 * Returns a   {@code Function} whose {@code apply} method returns its input.
 * @param < T > the type of the input and output objects to the function
 */
static <T>Function<T,T> identity(){
  return t -> t;
}

Fixed version (ground truth):
/** 
 * Returns a   {@code Function} whose {@code apply} method returns its input.
 * @param < T > the type of the input and output objects to the function
 * @return a {@code Function} whose {@code apply} method returns its input
 */
static <T>Function<T,T> identity(){
  return t -> t;
}
Program: 36842
Project: 36842
Buggy source:
/** 
 * Returns a unary operator that provides its input value as the result.
 * @return a unary operator that provides its input value as the result
 */
static <T>UnaryOperator<T> identity(){
  return t -> t;
}

Fixed version (ground truth):
/** 
 * Returns a unary operator that provides its input value as the result.
 * @param < T > the type of the input and output objects to the function
 * @return a unary operator that provides its input value as the result
 */
static <T>UnaryOperator<T> identity(){
  return t -> t;
}
Program: 36843
Project: 36843
Buggy source:
/** 
 * Inserts the specified element at the front of this deque unless it would violate capacity restrictions.  When using a capacity-restricted deque, this method is generally preferable to the   {@link #addFirst} method,which can fail to insert an element only by throwing an exception.
 * @param e the element to add
 * @return <tt>true</tt> if the element was added to this deque, else<tt>false</tt>
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
boolean offerFirst(E e);

Fixed version (ground truth):
/** 
 * Inserts the specified element at the front of this deque unless it would violate capacity restrictions.  When using a capacity-restricted deque, this method is generally preferable to the   {@link #addFirst} method,which can fail to insert an element only by throwing an exception.
 * @param e the element to add
 * @return {@code true} if the element was added to this deque, else{@code false}
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
boolean offerFirst(E e);
Program: 36844
Project: 36844
Buggy source:
/** 
 * Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returns <tt>null</tt> if this deque is empty. <p>This method is equivalent to   {@link #pollFirst()}.
 * @return the first element of this deque, or <tt>null</tt> ifthis deque is empty
 */
E poll();

Fixed version (ground truth):
/** 
 * Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returns  {@code null} if this deque is empty.<p>This method is equivalent to  {@link #pollFirst()}.
 * @return the first element of this deque, or {@code null} ifthis deque is empty
 */
E poll();
Program: 36845
Project: 36845
Buggy source:
/** 
 * Retrieves and removes the last element of this deque, or returns <tt>null</tt> if this deque is empty.
 * @return the tail of this deque, or <tt>null</tt> if this deque is empty
 */
E pollLast();

Fixed version (ground truth):
/** 
 * Retrieves and removes the last element of this deque, or returns   {@code null} if this deque is empty.
 * @return the tail of this deque, or {@code null} if this deque is empty
 */
E pollLast();
Program: 36846
Project: 36846
Buggy source:
/** 
 * Removes the first occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the first element <tt>e</tt> such that <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt> (if such an element exists). Returns <tt>true</tt> if this deque contained the specified element (or equivalently, if this deque changed as a result of the call). <p>This method is equivalent to   {@link #removeFirstOccurrence}.
 * @param o element to be removed from this deque, if present
 * @return <tt>true</tt> if an element was removed as a result of this call
 * @throws ClassCastException if the class of the specified elementis incompatible with this deque (<a href="Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>)
 */
boolean remove(Object o);

Fixed version (ground truth):
/** 
 * Removes the first occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the first element   {@code e} such that<tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt> (if such an element exists). Returns  {@code true} if this deque contained the specified element(or equivalently, if this deque changed as a result of the call). <p>This method is equivalent to  {@link #removeFirstOccurrence(Object)}.
 * @param o element to be removed from this deque, if present
 * @return {@code true} if an element was removed as a result of this call
 * @throws ClassCastException if the class of the specified elementis incompatible with this deque (<a href="Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>)
 */
boolean remove(Object o);
Program: 36847
Project: 36847
Buggy source:
/** 
 * Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning <tt>true</tt> upon success and <tt>false</tt> if no space is currently available.  When using a capacity-restricted deque, this method is generally preferable to the   {@link #add} method, which can fail toinsert an element only by throwing an exception. <p>This method is equivalent to  {@link #offerLast}.
 * @param e the element to add
 * @return <tt>true</tt> if the element was added to this deque, else<tt>false</tt>
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
boolean offer(E e);

Fixed version (ground truth):
/** 
 * Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning  {@code true} upon success and {@code false} if no space is currentlyavailable.  When using a capacity-restricted deque, this method is generally preferable to the  {@link #add} method, which can fail toinsert an element only by throwing an exception. <p>This method is equivalent to  {@link #offerLast}.
 * @param e the element to add
 * @return {@code true} if the element was added to this deque, else{@code false}
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
boolean offer(E e);
Program: 36848
Project: 36848
Buggy source:
/** 
 * Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions. When using a capacity-restricted deque, it is generally preferable to use method   {@link #offerLast}. <p>This method is equivalent to   {@link #add}.
 * @param e the element to add
 * @throws IllegalStateException if the element cannot be added at thistime due to capacity restrictions
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
void addLast(E e);

Fixed version (ground truth):
/** 
 * Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions, throwing an   {@code IllegalStateException} if no space is currentlyavailable.  When using a capacity-restricted deque, it is generally preferable to use method  {@link #offerLast}. <p>This method is equivalent to   {@link #add}.
 * @param e the element to add
 * @throws IllegalStateException if the element cannot be added at thistime due to capacity restrictions
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
void addLast(E e);
Program: 36849
Project: 36849
Buggy source:
/** 
 * Removes the last occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the last element <tt>e</tt> such that <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt> (if such an element exists). Returns <tt>true</tt> if this deque contained the specified element (or equivalently, if this deque changed as a result of the call).
 * @param o element to be removed from this deque, if present
 * @return <tt>true</tt> if an element was removed as a result of this call
 * @throws ClassCastException if the class of the specified elementis incompatible with this deque (<a href="Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>)
 */
boolean removeLastOccurrence(Object o);

Fixed version (ground truth):
/** 
 * Removes the last occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the last element   {@code e} such that<tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt> (if such an element exists). Returns  {@code true} if this deque contained the specified element(or equivalently, if this deque changed as a result of the call).
 * @param o element to be removed from this deque, if present
 * @return {@code true} if an element was removed as a result of this call
 * @throws ClassCastException if the class of the specified elementis incompatible with this deque (<a href="Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>)
 */
boolean removeLastOccurrence(Object o);
Program: 36850
Project: 36850
Buggy source:
/** 
 * Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning <tt>true</tt> upon success and throwing an <tt>IllegalStateException</tt> if no space is currently available. When using a capacity-restricted deque, it is generally preferable to use   {@link #offer(Object) offer}. <p>This method is equivalent to   {@link #addLast}.
 * @param e the element to add
 * @return <tt>true</tt> (as specified by {@link Collection#add})
 * @throws IllegalStateException if the element cannot be added at thistime due to capacity restrictions
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
boolean add(E e);

Fixed version (ground truth):
/** 
 * Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning  {@code true} upon success and throwing an{@code IllegalStateException} if no space is currently available.When using a capacity-restricted deque, it is generally preferable to use  {@link #offer(Object) offer}. <p>This method is equivalent to   {@link #addLast}.
 * @param e the element to add
 * @return {@code true} (as specified by {@link Collection#add})
 * @throws IllegalStateException if the element cannot be added at thistime due to capacity restrictions
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
boolean add(E e);
Program: 36851
Project: 36851
Buggy source:
/** 
 * Retrieves, but does not remove, the first element of this deque, or returns <tt>null</tt> if this deque is empty.
 * @return the head of this deque, or <tt>null</tt> if this deque is empty
 */
E peekFirst();

Fixed version (ground truth):
/** 
 * Retrieves, but does not remove, the first element of this deque, or returns   {@code null} if this deque is empty.
 * @return the head of this deque, or {@code null} if this deque is empty
 */
E peekFirst();
Program: 36852
Project: 36852
Buggy source:
/** 
 * Retrieves, but does not remove, the last element of this deque, or returns <tt>null</tt> if this deque is empty.
 * @return the tail of this deque, or <tt>null</tt> if this deque is empty
 */
E peekLast();

Fixed version (ground truth):
/** 
 * Retrieves, but does not remove, the last element of this deque, or returns   {@code null} if this deque is empty.
 * @return the tail of this deque, or {@code null} if this deque is empty
 */
E peekLast();
Program: 36853
Project: 36853
Buggy source:
/** 
 * Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, returning <tt>true</tt> upon success and throwing an <tt>IllegalStateException</tt> if no space is currently available. <p>This method is equivalent to   {@link #addFirst}.
 * @param e the element to push
 * @throws IllegalStateException if the element cannot be added at thistime due to capacity restrictions
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
void push(E e);

Fixed version (ground truth):
/** 
 * Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, throwing an  {@code IllegalStateException} if no space is currently available.<p>This method is equivalent to  {@link #addFirst}.
 * @param e the element to push
 * @throws IllegalStateException if the element cannot be added at thistime due to capacity restrictions
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
void push(E e);
Program: 36854
Project: 36854
Buggy source:
/** 
 * Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque), or returns <tt>null</tt> if this deque is empty. <p>This method is equivalent to   {@link #peekFirst()}.
 * @return the head of the queue represented by this deque, or<tt>null</tt> if this deque is empty
 */
E peek();

Fixed version (ground truth):
/** 
 * Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque), or returns   {@code null} if this deque is empty.<p>This method is equivalent to  {@link #peekFirst()}.
 * @return the head of the queue represented by this deque, or{@code null} if this deque is empty
 */
E peek();
Program: 36855
Project: 36855
Buggy source:
/** 
 * Inserts the specified element at the end of this deque unless it would violate capacity restrictions.  When using a capacity-restricted deque, this method is generally preferable to the   {@link #addLast} method,which can fail to insert an element only by throwing an exception.
 * @param e the element to add
 * @return <tt>true</tt> if the element was added to this deque, else<tt>false</tt>
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
boolean offerLast(E e);

Fixed version (ground truth):
/** 
 * Inserts the specified element at the end of this deque unless it would violate capacity restrictions.  When using a capacity-restricted deque, this method is generally preferable to the   {@link #addLast} method,which can fail to insert an element only by throwing an exception.
 * @param e the element to add
 * @return {@code true} if the element was added to this deque, else{@code false}
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
boolean offerLast(E e);
Program: 36856
Project: 36856
Buggy source:
/** 
 * Returns <tt>true</tt> if this deque contains the specified element. More formally, returns <tt>true</tt> if and only if this deque contains at least one element <tt>e</tt> such that <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
 * @param o element whose presence in this deque is to be tested
 * @return <tt>true</tt> if this deque contains the specified element
 * @throws ClassCastException if the type of the specified elementis incompatible with this deque (<a href="Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>)
 */
boolean contains(Object o);

Fixed version (ground truth):
/** 
 * Returns   {@code true} if this deque contains the specified element.More formally, returns  {@code true} if and only if this deque containsat least one element  {@code e} such that<tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
 * @param o element whose presence in this deque is to be tested
 * @return {@code true} if this deque contains the specified element
 * @throws ClassCastException if the type of the specified elementis incompatible with this deque (<a href="Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>)
 */
boolean contains(Object o);
Program: 36857
Project: 36857
Buggy source:
/** 
 * Retrieves and removes the first element of this deque, or returns <tt>null</tt> if this deque is empty.
 * @return the head of this deque, or <tt>null</tt> if this deque is empty
 */
E pollFirst();

Fixed version (ground truth):
/** 
 * Retrieves and removes the first element of this deque, or returns   {@code null} if this deque is empty.
 * @return the head of this deque, or {@code null} if this deque is empty
 */
E pollFirst();
Program: 36858
Project: 36858
Buggy source:
/** 
 * Removes the first occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the first element <tt>e</tt> such that <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt> (if such an element exists). Returns <tt>true</tt> if this deque contained the specified element (or equivalently, if this deque changed as a result of the call).
 * @param o element to be removed from this deque, if present
 * @return <tt>true</tt> if an element was removed as a result of this call
 * @throws ClassCastException if the class of the specified elementis incompatible with this deque (<a href="Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>)
 */
boolean removeFirstOccurrence(Object o);

Fixed version (ground truth):
/** 
 * Removes the first occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the first element   {@code e} such that<tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt> (if such an element exists). Returns  {@code true} if this deque contained the specified element(or equivalently, if this deque changed as a result of the call).
 * @param o element to be removed from this deque, if present
 * @return {@code true} if an element was removed as a result of this call
 * @throws ClassCastException if the class of the specified elementis incompatible with this deque (<a href="Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>)
 */
boolean removeFirstOccurrence(Object o);
Program: 36859
Project: 36859
Buggy source:
/** 
 * Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions. When using a capacity-restricted deque, it is generally preferable to use method   {@link #offerFirst}.
 * @param e the element to add
 * @throws IllegalStateException if the element cannot be added at thistime due to capacity restrictions
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
void addFirst(E e);

Fixed version (ground truth):
/** 
 * Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, throwing an   {@code IllegalStateException} if no space is currentlyavailable.  When using a capacity-restricted deque, it is generally preferable to use method  {@link #offerFirst}.
 * @param e the element to add
 * @throws IllegalStateException if the element cannot be added at thistime due to capacity restrictions
 * @throws ClassCastException if the class of the specified elementprevents it from being added to this deque
 * @throws NullPointerException if the specified element is null and thisdeque does not permit null elements
 * @throws IllegalArgumentException if some property of the specifiedelement prevents it from being added to this deque
 */
void addFirst(E e);
Program: 36860
Project: 36860
Buggy source:
/** 
 * <p> If passed to the appropriate variant of java.beans.Beans.instantiate this method will be called in order to associate the newly instantiated Applet (JavaBean) with its AppletContext, AppletStub, and Container. </p> <p> Conformant implementations shall: <ol> <li> Associate the newly instantiated Applet with the appropriate AppletContext. <li> Instantiate an AppletStub() and associate that AppletStub with the Applet via an invocation of setStub(). <li> If BeanContext parameter is null, then it shall associate the Applet with its appropriate Container by adding that Applet to its Container via an invocation of add(). If the BeanContext parameter is non-null, then it is the responsibility of the BeanContext to associate the Applet with its Container during the subsequent invocation of its addChildren() method. </ol> </p>
 * @param newAppletBean  The newly instantiated JavaBean
 * @param bCtxt          The BeanContext intended for this Applet, ornull.
 */
void initialize(Applet newAppletBean,BeanContext bCtxt);

Fixed version (ground truth):
/** 
 * <p> If passed to the appropriate variant of java.beans.Beans.instantiate this method will be called in order to associate the newly instantiated Applet (JavaBean) with its AppletContext, AppletStub, and Container. </p> <p> Conformant implementations shall: <ol> <li> Associate the newly instantiated Applet with the appropriate AppletContext. <li> Instantiate an AppletStub() and associate that AppletStub with the Applet via an invocation of setStub(). <li> If BeanContext parameter is null, then it shall associate the Applet with its appropriate Container by adding that Applet to its Container via an invocation of add(). If the BeanContext parameter is non-null, then it is the responsibility of the BeanContext to associate the Applet with its Container during the subsequent invocation of its addChildren() method. </ol>
 * @param newAppletBean  The newly instantiated JavaBean
 * @param bCtxt          The BeanContext intended for this Applet, ornull.
 */
void initialize(Applet newAppletBean,BeanContext bCtxt);
Program: 36861
Project: 36861
Buggy source:
/** 
 * From a given bean, obtain an object representing a specified type view of that source object. <p> The result may be the same object or a different object.  If the requested target view isn't available then the given bean is returned. <p> This method is provided in Beans 1.0 as a hook to allow the addition of more flexible bean behaviour in the future.
 * @param bean        Object from which we want to obtain a view.
 * @param targetType  The type of view we'd like to get.
 */
public static Object getInstanceOf(Object bean,Class<?> targetType){
  return bean;
}

Fixed version (ground truth):
/** 
 * From a given bean, obtain an object representing a specified type view of that source object. <p> The result may be the same object or a different object.  If the requested target view isn't available then the given bean is returned. <p> This method is provided in Beans 1.0 as a hook to allow the addition of more flexible bean behaviour in the future.
 * @return an object representing a specified type view of thesource object
 * @param bean        Object from which we want to obtain a view.
 * @param targetType  The type of view we'd like to get.
 */
public static Object getInstanceOf(Object bean,Class<?> targetType){
  return bean;
}
Program: 36865
Project: 36865
Buggy source:
/** 
 * If the value property of this instance is not already set, this method dynamically finds the method with the specified methodName on this target with these arguments and calls it. The result of the method invocation is first copied into the value property of this expression and then returned as the result of <code>getValue</code>. If the value property was already set, either by a call to <code>setValue</code> or a previous call to <code>getValue</code> then the value property is returned without either looking up or calling the method. <p> The value property of an <code>Expression</code> is set to a unique private (non-<code>null</code>) value by default and this value is used as an internal indication that the method has not yet been called. A return value of <code>null</code> replaces this default value in the same way that any other value would, ensuring that expressions are never evaluated more than once. <p> See the <code>excecute</code> method for details on how methods are chosen using the dynamic types of the target and arguments.
 * @see Statement#execute
 * @see #setValue
 * @return The result of applying this method to these arguments.
 */
public Object getValue() throws Exception {
  if (value == unbound) {
    setValue(invoke());
  }
  return value;
}

Fixed version (ground truth):
/** 
 * If the value property of this instance is not already set, this method dynamically finds the method with the specified methodName on this target with these arguments and calls it. The result of the method invocation is first copied into the value property of this expression and then returned as the result of <code>getValue</code>. If the value property was already set, either by a call to <code>setValue</code> or a previous call to <code>getValue</code> then the value property is returned without either looking up or calling the method. <p> The value property of an <code>Expression</code> is set to a unique private (non-<code>null</code>) value by default and this value is used as an internal indication that the method has not yet been called. A return value of <code>null</code> replaces this default value in the same way that any other value would, ensuring that expressions are never evaluated more than once. <p> See the <code>execute</code> method for details on how methods are chosen using the dynamic types of the target and arguments.
 * @see Statement#execute
 * @see #setValue
 * @return The result of applying this method to these arguments.
 * @throws Exception if the method with the specified methodNamethrows an exception
 */
public Object getValue() throws Exception {
  if (value == unbound) {
    setValue(invoke());
  }
  return value;
}
Program: 36866
Project: 36866
Buggy source:
/** 
 * Sets the method that should be used to read an indexed property value.
 * @param readMethod The new indexed read method.
 */
public synchronized void setIndexedReadMethod(Method readMethod) throws IntrospectionException {
  setIndexedPropertyType(findIndexedPropertyType(readMethod,getIndexedWriteMethod0()));
  setIndexedReadMethod0(readMethod);
}

Fixed version (ground truth):
/** 
 * Sets the method that should be used to read an indexed property value.
 * @param readMethod The new indexed read method.
 * @throws IntrospectionException if an exception occurs duringintrospection.
 */
public synchronized void setIndexedReadMethod(Method readMethod) throws IntrospectionException {
  setIndexedPropertyType(findIndexedPropertyType(readMethod,getIndexedWriteMethod0()));
  setIndexedReadMethod0(readMethod);
}
Program: 36867
Project: 36867
Buggy source:
/** 
 * Sets the method that should be used to write an indexed property value.
 * @param writeMethod The new indexed write method.
 */
public synchronized void setIndexedWriteMethod(Method writeMethod) throws IntrospectionException {
  Class<?> type=findIndexedPropertyType(getIndexedReadMethod(),writeMethod);
  setIndexedPropertyType(type);
  setIndexedWriteMethod0(writeMethod);
}

Fixed version (ground truth):
/** 
 * Sets the method that should be used to write an indexed property value.
 * @param writeMethod The new indexed write method.
 * @throws IntrospectionException if an exception occurs duringintrospection.
 */
public synchronized void setIndexedWriteMethod(Method writeMethod) throws IntrospectionException {
  Class<?> type=findIndexedPropertyType(getIndexedReadMethod(),writeMethod);
  setIndexedPropertyType(type);
  setIndexedWriteMethod0(writeMethod);
}
Program: 36869
Project: 36869
Buggy source:
/** 
 * Sets the method that should be used to write the property value.
 * @param writeMethod The new write method.
 */
public synchronized void setWriteMethod(Method writeMethod) throws IntrospectionException {
  if (writeMethod == null) {
    writeMethodName=null;
    writeMethodRef=null;
    return;
  }
  setPropertyType(findPropertyType(getReadMethod(),writeMethod));
  setClass0(writeMethod.getDeclaringClass());
  writeMethodName=writeMethod.getName();
  this.writeMethodRef=getSoftReference(writeMethod);
  setTransient(writeMethod.getAnnotation(Transient.class));
}

Fixed version (ground truth):
/** 
 * Sets the method that should be used to write the property value.
 * @param writeMethod The new write method.
 * @throws IntrospectionException if the write method is invalid
 */
public synchronized void setWriteMethod(Method writeMethod) throws IntrospectionException {
  if (writeMethod == null) {
    writeMethodName=null;
    writeMethodRef=null;
    return;
  }
  setPropertyType(findPropertyType(getReadMethod(),writeMethod));
  setClass0(writeMethod.getDeclaringClass());
  writeMethodName=writeMethod.getName();
  this.writeMethodRef=getSoftReference(writeMethod);
  setTransient(writeMethod.getAnnotation(Transient.class));
}
Program: 36870
Project: 36870
Buggy source:
/** 
 * Sets the method that should be used to read the property value.
 * @param readMethod The new read method.
 */
public synchronized void setReadMethod(Method readMethod) throws IntrospectionException {
  if (readMethod == null) {
    readMethodName=null;
    readMethodRef=null;
    return;
  }
  setPropertyType(findPropertyType(readMethod,getWriteMethod0()));
  setClass0(readMethod.getDeclaringClass());
  readMethodName=readMethod.getName();
  this.readMethodRef=getSoftReference(readMethod);
  setTransient(readMethod.getAnnotation(Transient.class));
}

Fixed version (ground truth):
/** 
 * Sets the method that should be used to read the property value.
 * @param readMethod The new read method.
 * @throws IntrospectionException if the read method is invalid
 */
public synchronized void setReadMethod(Method readMethod) throws IntrospectionException {
  if (readMethod == null) {
    readMethodName=null;
    readMethodRef=null;
    return;
  }
  setPropertyType(findPropertyType(readMethod,getWriteMethod0()));
  setClass0(readMethod.getDeclaringClass());
  readMethodName=readMethod.getName();
  this.readMethodRef=getSoftReference(readMethod);
  setTransient(readMethod.getAnnotation(Transient.class));
}
Program: 36871
Project: 36871
Buggy source:
/** 
 * Analagous to <code>java.lang.ClassLoader.getResource()</code>, this method allows a <code>BeanContext</code> implementation to interpose behavior between the child <code>Component</code> and underlying <code>ClassLoader</code>.
 * @param name the resource name
 * @param bcc the specified child
 * @return a <code>URL</code> for the namedresource for the specified child
 * @throws <code>IllegalArgumentException</code>if the resource is not valid
 */
URL getResource(String name,BeanContextChild bcc) throws IllegalArgumentException ;

Fixed version (ground truth):
/** 
 * Analagous to <code>java.lang.ClassLoader.getResource()</code>, this method allows a <code>BeanContext</code> implementation to interpose behavior between the child <code>Component</code> and underlying <code>ClassLoader</code>.
 * @param name the resource name
 * @param bcc the specified child
 * @return a <code>URL</code> for the namedresource for the specified child
 * @throws IllegalArgumentException if the resource is not valid
 */
URL getResource(String name,BeanContextChild bcc) throws IllegalArgumentException ;
Program: 36872
Project: 36872
Buggy source:
/** 
 * Adds the specified <code>BeanContextMembershipListener</code> to receive <code>BeanContextMembershipEvents</code> from this <code>BeanContext</code> whenever it adds or removes a child <code>Component</code>(s).
 * @param bcml the <code>BeanContextMembershipListener</code> to be added
 */
void addBeanContextMembershipListener(BeanContextMembershipListener bcml);

Fixed version (ground truth):
/** 
 * Adds the specified <code>BeanContextMembershipListener</code> to receive <code>BeanContextMembershipEvents</code> from this <code>BeanContext</code> whenever it adds or removes a child <code>Component</code>(s).
 * @param bcml the BeanContextMembershipListener to be added
 */
void addBeanContextMembershipListener(BeanContextMembershipListener bcml);
Program: 36873
Project: 36873
Buggy source:
/** 
 * Analagous to <code>java.lang.ClassLoader.getResourceAsStream()</code>, this method allows a <code>BeanContext</code> implementation to interpose behavior between the child <code>Component</code> and underlying <code>ClassLoader</code>.
 * @param name the resource name
 * @param bcc the specified child
 * @return an <code>InputStream</code> for reading the resource,or <code>null</code> if the resource could not be found.
 * @throws <code>IllegalArgumentException</code> ifthe resource is not valid
 */
InputStream getResourceAsStream(String name,BeanContextChild bcc) throws IllegalArgumentException ;

Fixed version (ground truth):
/** 
 * Analagous to <code>java.lang.ClassLoader.getResourceAsStream()</code>, this method allows a <code>BeanContext</code> implementation to interpose behavior between the child <code>Component</code> and underlying <code>ClassLoader</code>.
 * @param name the resource name
 * @param bcc the specified child
 * @return an <code>InputStream</code> for reading the resource,or <code>null</code> if the resource could not be found.
 * @throws IllegalArgumentException ifthe resource is not valid
 */
InputStream getResourceAsStream(String name,BeanContextChild bcc) throws IllegalArgumentException ;
Program: 36874
Project: 36874
Buggy source:
/** 
 * Instantiate the javaBean named as a child of this <code>BeanContext</code>. The implementation of the JavaBean is derived from the value of the beanName parameter, and is defined by the <code>java.beans.Beans.instantiate()</code> method.
 * @param beanName The name of the JavaBean to instantiateas a child of this <code>BeanContext</code>
 * @throws <code>IOException</code>
 * @throws <code>ClassNotFoundException</code> if the class identifiedby the beanName parameter is not found
 */
Object instantiateChild(String beanName) throws IOException, ClassNotFoundException ;

Fixed version (ground truth):
/** 
 * Instantiate the javaBean named as a child of this <code>BeanContext</code>. The implementation of the JavaBean is derived from the value of the beanName parameter, and is defined by the <code>java.beans.Beans.instantiate()</code> method.
 * @return a javaBean named as a child of this<code>BeanContext</code>
 * @param beanName The name of the JavaBean to instantiateas a child of this <code>BeanContext</code>
 * @throws IOException if an IO problem occurs
 * @throws ClassNotFoundException if the class identifiedby the beanName parameter is not found
 */
Object instantiateChild(String beanName) throws IOException, ClassNotFoundException ;
Program: 36875
Project: 36875
Buggy source:
/** 
 * A static method to retrieve the named object. See   {@link #doLookup(Name)} for details.
 * @param name the name of the object to look up
 * @return  the object bound to <tt>name</tt>
 * @throws NamingException if a naming exception is encountered
 * @since 1.6
 */
@SuppressWarnings("String_Node_Str") public static <T>T doLookup(String name) throws NamingException {
  return (T)(new InitialContext()).lookup(name);
}

Fixed version (ground truth):
/** 
 * A static method to retrieve the named object. See   {@link #doLookup(Name)} for details.
 * @param < T > the type of the returned object
 * @param name the name of the object to look up
 * @return  the object bound to <tt>name</tt>
 * @throws NamingException if a naming exception is encountered
 * @since 1.6
 */
@SuppressWarnings("String_Node_Str") public static <T>T doLookup(String name) throws NamingException {
  return (T)(new InitialContext()).lookup(name);
}
Program: 36876
Project: 36876
Buggy source:
/** 
 * Determines whether obj is equal to this RefAddr. <p> obj is equal to this RefAddr all of these conditions are true <ul> non-null <li> instance of RefAddr <li> obj has the same address type as this RefAddr (using String.compareTo()) <li> both obj and this RefAddr's contents are null or they are equal (using the equals() test). </ul>
 * @param obj possibly null obj to check.
 * @return true if obj is equal to this refaddr; false otherwise.
 * @see #getContent
 * @see #getType
 */
public boolean equals(Object obj){
  if ((obj != null) && (obj instanceof RefAddr)) {
    RefAddr target=(RefAddr)obj;
    if (addrType.compareTo(target.addrType) == 0) {
      Object thisobj=this.getContent();
      Object thatobj=target.getContent();
      if (thisobj == thatobj)       return true;
      if (thisobj != null)       return thisobj.equals(thatobj);
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determines whether obj is equal to this RefAddr. <p> obj is equal to this RefAddr all of these conditions are true <ul> <li> non-null <li> instance of RefAddr <li> obj has the same address type as this RefAddr (using String.compareTo()) <li> both obj and this RefAddr's contents are null or they are equal (using the equals() test). </ul>
 * @param obj possibly null obj to check.
 * @return true if obj is equal to this refaddr; false otherwise.
 * @see #getContent
 * @see #getType
 */
public boolean equals(Object obj){
  if ((obj != null) && (obj instanceof RefAddr)) {
    RefAddr target=(RefAddr)obj;
    if (addrType.compareTo(target.addrType) == 0) {
      Object thisobj=this.getContent();
      Object thatobj=target.getContent();
      if (thisobj == thatobj)       return true;
      if (thisobj != null)       return thisobj.equals(thatobj);
    }
  }
  return false;
}
Program: 36877
Project: 36877
Buggy source:
protected ControlFactory(){
}

Fixed version (ground truth):
/** 
 * Creates a new instance of a control factory.
 */
protected ControlFactory(){
}