nus-yam/ex-repair huggingface dataset:
Program: 76787
Project: 76787
Buggy source:
/** 
 * Log a message, specifying source class, method, and resource bundle, with associated Throwable information. <p> If the logger is currently enabled for the given message  {@code level} then the given arguments are stored in a {@code LogRecord}which is forwarded to all registered output handlers. <p> The   {@code msg} string is localized using the given resource bundle.If the resource bundle is  {@code null}, then the   {@code msg} string is notlocalized. <p> Note that the  {@code thrown} argument is stored in the {@code LogRecord}{@code thrown} property, rather than the {@code LogRecord}{@code parameters} property.  Thus it isprocessed specially by output  {@code Formatter} objects and is not treatedas a formatting parameter to the  {@code LogRecord} {@code message}property. <p>
 * @param level   One of the message level identifiers, e.g., {@code SEVERE}
 * @param bundle  Resource bundle to localize {@code msg}; can be   {@code null}.
 * @param msg     The string message (or a key in the message catalog)
 * @param thrown  Throwable associated with the log message.
 * @since 9
 */
public void logrb(Level level,ResourceBundle bundle,String msg,Throwable thrown){
  if (!isLoggable(level)) {
    return;
  }
  LogRecord lr=new LogRecord(level,msg);
  lr.setThrown(thrown);
  doLog(lr,bundle);
}

Fixed version (ground truth):
/** 
 * Log a message, specifying source class, method, and resource bundle, with associated Throwable information. <p> If the logger is currently enabled for the given message  {@code level} then the given arguments are stored in a {@code LogRecord}which is forwarded to all registered output handlers. <p> The   {@code msg} string is localized using the given resource bundle.If the resource bundle is  {@code null}, then the   {@code msg} string is notlocalized. <p> Note that the  {@code thrown} argument is stored in the {@code LogRecord}{@code thrown} property, rather than the {@code LogRecord}{@code parameters} property.  Thus it isprocessed specially by output  {@code Formatter} objects and is not treatedas a formatting parameter to the  {@code LogRecord} {@code message}property.
 * @param level   One of the message level identifiers, e.g., {@code SEVERE}
 * @param bundle  Resource bundle to localize {@code msg}; can be   {@code null}.
 * @param msg     The string message (or a key in the message catalog)
 * @param thrown  Throwable associated with the log message.
 * @since 9
 */
public void logrb(Level level,ResourceBundle bundle,String msg,Throwable thrown){
  if (!isLoggable(level)) {
    return;
  }
  LogRecord lr=new LogRecord(level,msg);
  lr.setThrown(thrown);
  doLog(lr,bundle);
}
Program: 76788
Project: 76788
Buggy source:
/** 
 * Determines if the specified character is ISO-LATIN-1 white space. This method returns   {@code true} for the following fivecharacters only: <table class="borderless"> <caption style="display:none">truechars</caption> <tbody> <tr><td> {@code '\t'}</td>            <td>  {@code U+0009}</td> <td>  {@code HORIZONTAL TABULATION}</td></tr> <tr><td>  {@code '\n'}</td>            <td>  {@code U+000A}</td> <td>  {@code NEW LINE}</td></tr> <tr><td>  {@code '\f'}</td>            <td>  {@code U+000C}</td> <td>  {@code FORM FEED}</td></tr> <tr><td>  {@code '\r'}</td>            <td>  {@code U+000D}</td> <td>  {@code CARRIAGE RETURN}</td></tr> <tr><td>  {@code ' '}</td>  <td>  {@code U+0020}</td> <td>  {@code SPACE}</td></tr> </tbody> </table>
 * @param ch   the character to be tested.
 * @return     {@code true} if the character is ISO-LATIN-1 whitespace;  {@code false} otherwise.
 * @see Character#isSpaceChar(char)
 * @see Character#isWhitespace(char)
 * @deprecated Replaced by isWhitespace(char).
 */
@Deprecated(since="String_Node_Str") public static boolean isSpace(char ch){
  return (ch <= 0x0020) && (((((1L << 0x0009) | (1L << 0x000A) | (1L << 0x000C)| (1L << 0x000D)| (1L << 0x0020)) >> ch) & 1L) != 0);
}

Fixed version (ground truth):
/** 
 * Determines if the specified character is ISO-LATIN-1 white space. This method returns   {@code true} for the following fivecharacters only: <table class="striped"> <caption style="display:none">truechars</caption> <thead> <tr><th scope="col">Character <th scope="col">Code <th scope="col">Name </thead> <tbody> <tr><th scope="row"> {@code '\t'}</th>            <td>  {@code U+0009}</td> <td>  {@code HORIZONTAL TABULATION}</td></tr> <tr><th scope="row">  {@code '\n'}</th>            <td>  {@code U+000A}</td> <td>  {@code NEW LINE}</td></tr> <tr><th scope="row">  {@code '\f'}</th>            <td>  {@code U+000C}</td> <td>  {@code FORM FEED}</td></tr> <tr><th scope="row">  {@code '\r'}</th>            <td>  {@code U+000D}</td> <td>  {@code CARRIAGE RETURN}</td></tr> <tr><th scope="row">  {@code ' '}</th>  <td>  {@code U+0020}</td> <td>  {@code SPACE}</td></tr> </tbody> </table>
 * @param ch   the character to be tested.
 * @return     {@code true} if the character is ISO-LATIN-1 whitespace;  {@code false} otherwise.
 * @see Character#isSpaceChar(char)
 * @see Character#isWhitespace(char)
 * @deprecated Replaced by isWhitespace(char).
 */
@Deprecated(since="String_Node_Str") public static boolean isSpace(char ch){
  return (ch <= 0x0020) && (((((1L << 0x0009) | (1L << 0x000A) | (1L << 0x000C)| (1L << 0x000D)| (1L << 0x0020)) >> ch) & 1L) != 0);
}
Program: 76791
Project: 76791
Buggy source:
/** 
 * Splits this string around matches of the given <a href="../util/regex/Pattern.html#sum">regular expression</a>. <p> This method works as if by invoking the two-argument   {@link #split(String,int) split} method with the given expression and a limitargument of zero.  Trailing empty strings are therefore not included in the resulting array. <p> The string  {@code "boo:and:foo"}, for example, yields the following results with these expressions: <blockquote><table class="plain"> <caption style="display:none">Split examples showing regex and result</caption> <thead> <tr> <th>Regex</th> <th>Result</th> </tr> </thead> <tbody> <tr><td style="text-align:center">:</td> <td>  {@code} "boo", "and", "foo" }}</td></tr> <tr><td style="text-align:center">o</td> <td> {@code} "b", "", ":and:f" }}</td></tr> </tbody> </table></blockquote>
 * @param regex the delimiting regular expression
 * @return  the array of strings computed by splitting this stringaround matches of the given regular expression
 * @throws PatternSyntaxException if the regular expression's syntax is invalid
 * @see java.util.regex.Pattern
 * @since 1.4
 * @spec JSR-51
 */
public String[] split(String regex){
  return split(regex,0);
}

Fixed version (ground truth):
/** 
 * Splits this string around matches of the given <a href="../util/regex/Pattern.html#sum">regular expression</a>. <p> This method works as if by invoking the two-argument   {@link #split(String,int) split} method with the given expression and a limitargument of zero.  Trailing empty strings are therefore not included in the resulting array. <p> The string  {@code "boo:and:foo"}, for example, yields the following results with these expressions: <blockquote><table class="plain"> <caption style="display:none">Split examples showing regex and result</caption> <thead> <tr> <th scope="col">Regex</th> <th scope="col">Result</th> </tr> </thead> <tbody> <tr><th scope="row" style="text-weight:normal">:</th> <td>  {@code} "boo", "and", "foo" }}</td></tr> <tr><th scope="row" style="text-weight:normal">o</th> <td> {@code} "b", "", ":and:f" }}</td></tr> </tbody> </table></blockquote>
 * @param regex the delimiting regular expression
 * @return  the array of strings computed by splitting this stringaround matches of the given regular expression
 * @throws PatternSyntaxException if the regular expression's syntax is invalid
 * @see java.util.regex.Pattern
 * @since 1.4
 * @spec JSR-51
 */
public String[] split(String regex){
  return split(regex,0);
}
Program: 76793
Project: 76793
Buggy source:
/** 
 * Indicates that the caller is momentarily unable to progress, until the occurrence of one or more actions on the part of other activities. By invoking this method within each iteration of a spin-wait loop construct, the calling thread indicates to the runtime that it is busy-waiting. The runtime may take action to improve the performance of invoking spin-wait loop constructions. <p>
 * @apiNote As an example consider a method in a class that spins in a loop until some flag is set outside of that method. A call to the  {@code onSpinWait}method should be placed inside the spin loop. <pre>  {@code}class EventHandler  volatile boolean eventNotificationNotReceived; void waitForEventAndHandleIt() { while ( eventNotificationNotReceived ) { java.lang.Thread.onSpinWait(); } readAndProcessEvent(); } void readAndProcessEvent() { // Read event from some source and process it . . . } } }</pre> <p> The code above would remain correct even if the   {@code onSpinWait}method was not called at all. However on some architectures the Java Virtual Machine may issue the processor instructions to address such code patterns in a more beneficial way. <p>
 * @since 9
 */
@HotSpotIntrinsicCandidate public static void onSpinWait(){
}

Fixed version (ground truth):
/** 
 * Indicates that the caller is momentarily unable to progress, until the occurrence of one or more actions on the part of other activities. By invoking this method within each iteration of a spin-wait loop construct, the calling thread indicates to the runtime that it is busy-waiting. The runtime may take action to improve the performance of invoking spin-wait loop constructions.
 * @apiNote As an example consider a method in a class that spins in a loop until some flag is set outside of that method. A call to the  {@code onSpinWait}method should be placed inside the spin loop. <pre>  {@code}class EventHandler  volatile boolean eventNotificationNotReceived; void waitForEventAndHandleIt() { while ( eventNotificationNotReceived ) { java.lang.Thread.onSpinWait(); } readAndProcessEvent(); } void readAndProcessEvent() { // Read event from some source and process it . . . } } }</pre> <p> The code above would remain correct even if the   {@code onSpinWait}method was not called at all. However on some architectures the Java Virtual Machine may issue the processor instructions to address such code patterns in a more beneficial way.
 * @since 9
 */
@HotSpotIntrinsicCandidate public static void onSpinWait(){
}
Program: 76794
Project: 76794
Buggy source:
/** 
 * Create and return the default parameter map for this  {@code ExecutionControlProvider}. The map can optionally be modified; Modified or unmodified it can be passed to  {@link #generate(jdk.jshell.spi.ExecutionEnv,java.util.Map) }. <table> <caption>Parameters</caption> <tr> <th>Parameter</th> <th>Description</th> <th>Constant Field</th> </tr> <tr> <td>remoteAgent</td> <td>the remote agent to launch</td> <td>  {@link #PARAM_REMOTE_AGENT}</td> </tr> <tr> <td>timeout</td> <td>milliseconds before connect timeout</td> <td>  {@link #PARAM_TIMEOUT}</td> </tr> <tr> <td>launch</td> <td>"true" for JDI controlled launch</td> <td>  {@link #PARAM_LAUNCH}</td> </tr> <tr> <td>hostname</td> <td>connect to the named of the local host ("" for discovered)</td> <td>  {@link #PARAM_HOST_NAME}</td> </tr> </table>
 * @return the default parameter map
 */
@Override public Map<String,String> defaultParameters(){
  Map<String,String> dp=new HashMap<>();
  dp.put(PARAM_REMOTE_AGENT,RemoteExecutionControl.class.getName());
  dp.put(PARAM_TIMEOUT,"String_Node_Str" + DEFAULT_TIMEOUT);
  dp.put(PARAM_HOST_NAME,"String_Node_Str");
  dp.put(PARAM_LAUNCH,"String_Node_Str");
  return dp;
}

Fixed version (ground truth):
/** 
 * Create and return the default parameter map for this  {@code ExecutionControlProvider}. The map can optionally be modified; Modified or unmodified it can be passed to  {@link #generate(jdk.jshell.spi.ExecutionEnv,java.util.Map) }. <table class="striped"> <caption>Parameters</caption> <thead> <tr> <th scope="col">Parameter</th> <th scope="col">Description</th> <th scope="col">Constant Field</th> </tr> </thead> <tbody> <tr> <th scope="row">remoteAgent</th> <td>the remote agent to launch</td> <td>  {@link #PARAM_REMOTE_AGENT}</td> </tr> <tr> <th scope="row">timeout</th> <td>milliseconds before connect timeout</td> <td>  {@link #PARAM_TIMEOUT}</td> </tr> <tr> <th scope="row">launch</th> <td>"true" for JDI controlled launch</td> <td>  {@link #PARAM_LAUNCH}</td> </tr> <tr> <th scope="row">hostname</th> <td>connect to the named of the local host ("" for discovered)</td> <td>  {@link #PARAM_HOST_NAME}</td> </tr> </tbody> </table>
 * @return the default parameter map
 */
@Override public Map<String,String> defaultParameters(){
  Map<String,String> dp=new HashMap<>();
  dp.put(PARAM_REMOTE_AGENT,RemoteExecutionControl.class.getName());
  dp.put(PARAM_TIMEOUT,"String_Node_Str" + DEFAULT_TIMEOUT);
  dp.put(PARAM_HOST_NAME,"String_Node_Str");
  dp.put(PARAM_LAUNCH,"String_Node_Str");
  return dp;
}
Program: 76798
Project: 76798
Buggy source:
@Override public void connect() throws IOException, InterruptedException {
  delegate.connect();
  HttpRequestImpl req=new HttpRequestImpl("String_Node_Str",client,address);
  Exchange<?> connectExchange=new Exchange<>(req,null);
  Response r=connectExchange.responseImpl(delegate);
  if (r.statusCode() != 200) {
    throw new IOException("String_Node_Str");
  }
  connected=true;
}

Fixed version (ground truth):
@Override public void connect() throws IOException, InterruptedException {
  delegate.connect();
  HttpRequestImpl req=new HttpRequestImpl("String_Node_Str",client,address);
  MultiExchange<Void,Void> mul=new MultiExchange<>(req,client,BodyHandler.<Void>discard(null));
  Exchange<Void> connectExchange=new Exchange<>(req,mul);
  Response r=connectExchange.responseImpl(delegate);
  if (r.statusCode() != 200) {
    throw new IOException("String_Node_Str");
  }
  connected=true;
}
Program: 76799
Project: 76799
Buggy source:
/** 
 * Sends a whole Text message with characters from the given   {@code CharSequence}. <p> This is a convenience method. For the general case, use   {@link #sendText(CharSequence,boolean)}. <p> Returns a   {@code CompletableFuture<WebSocket>} which completesnormally when the message has been sent or completes exceptionally if an error occurs. <p> The  {@code CharSequence} must not be modified until the returned{@code CompletableFuture} completes (either normally or exceptionally).<p> The returned  {@code CompletableFuture} can complete exceptionallywith: <ul> <li>  {@link IllegalArgumentException} -if  {@code message} is a malformed UTF-16 sequence<li>  {@link IllegalStateException} -if the  {@code WebSocket} is closed;or if a Close message has been sent; or if there is an outstanding send operation; or if a previous Binary message was sent with  {@code isLast == false}<li>   {@link IOException} -if an I/O error occurs during this operation; or if the  {@code WebSocket} has been closed due to an error;</ul>
 * @param message the message
 * @return a {@code CompletableFuture} with this {@code WebSocket}
 */
default CompletableFuture<WebSocket> sendText(CharSequence message){
  return sendText(message,true);
}

Fixed version (ground truth):
/** 
 * Sends a Text message with characters from the given   {@code CharSequence}. <p> Returns a   {@code CompletableFuture<WebSocket>} which completesnormally when the message has been sent or completes exceptionally if an error occurs. <p> The  {@code CharSequence} must not be modified until the returned{@code CompletableFuture} completes (either normally or exceptionally).<p> The returned  {@code CompletableFuture} can complete exceptionallywith: <ul> <li>  {@link IllegalArgumentException} -if  {@code message} is a malformed UTF-16 sequence<li>  {@link IllegalStateException} -if the  {@code WebSocket} is closed;or if a Close message has been sent; or if there is an outstanding send operation; or if a previous Binary message was sent with  {@code isLast == false}<li>   {@link IOException} -if an I/O error occurs during this operation; or if the  {@code WebSocket} has been closed due to an error;</ul>
 * @implNote This implementation does not accept partial UTF-16 sequences.In case such a sequence is passed, a returned  {@code CompletableFuture}completes exceptionally with   {@code IOException}.
 * @param message the message
 * @param isLast {@code true} if this is the last part of the message,{@code false} otherwise
 * @return a {@code CompletableFuture} with this {@code WebSocket}
 */
CompletableFuture<WebSocket> sendText(CharSequence message,boolean isLast);
Program: 76801
Project: 76801
Buggy source:
/** 
 * Closes the   {@code WebSocket} abruptly.<p> This method may be invoked at any time. This method closes the underlying TCP connection and puts the  {@code WebSocket} into a closedstate. <p> As the result  {@link Listener#onClose(WebSocket,int,String) Listener.onClose} will be invoked with the status code {@link #CLOSED_ABNORMALLY} unless either {@code onClose} or {@link Listener#onError(WebSocket,Throwable) onError} has been invoked before.In which case no additional invocation will happen. <p> If the  {@code WebSocket} is already closed then invoking this methodhas no effect.
 * @throws IOException if an I/O error occurs
 */
void abort() throws IOException ;

Fixed version (ground truth):
/** 
 * Closes the   {@code WebSocket} abruptly.<p> This method may be invoked at any time. This method closes the underlying TCP connection and puts the  {@code WebSocket} into a closedstate. <p> As the result  {@link Listener#onClose(WebSocket,int,String) Listener.onClose} will be invoked unless either {@code onClose} or {@link Listener#onError(WebSocket,Throwable) onError} has been invoked before.In which case no additional invocation will happen. <p> If the  {@code WebSocket} is already closed then invoking this methodhas no effect.
 * @throws IOException if an I/O error occurs
 */
void abort() throws IOException ;
Program: 76803
Project: 76803
Buggy source:
List<Pair<String,String>> getHeaders(){
  return headers;
}

Fixed version (ground truth):
Collection<Pair<String,String>> getHeaders(){
  return headers;
}
Program: 76804
Project: 76804
Buggy source:
@Override public Builder subprotocols(String mostPreferred,String... lesserPreferred){
  requireNonNull(mostPreferred,"String_Node_Str");
  requireNonNull(lesserPreferred,"String_Node_Str");
  List<String> subprotocols=new LinkedList<>();
  for (int i=0; i < lesserPreferred.length; i++) {
    String p=lesserPreferred[i];
    requireNonNull(p,"String_Node_Str" + i + "String_Node_Str");
    subprotocols.add(p);
  }
  subprotocols.add(0,mostPreferred);
  this.subprotocols.clear();
  this.subprotocols.addAll(subprotocols);
  return this;
}

Fixed version (ground truth):
@Override public Builder subprotocols(String mostPreferred,String... lesserPreferred){
  requireNonNull(mostPreferred,"String_Node_Str");
  requireNonNull(lesserPreferred,"String_Node_Str");
  List<String> subprotocols=new LinkedList<>();
  subprotocols.add(mostPreferred);
  for (int i=0; i < lesserPreferred.length; i++) {
    String p=lesserPreferred[i];
    requireNonNull(p,"String_Node_Str" + i + "String_Node_Str");
    subprotocols.add(p);
  }
  this.subprotocols.clear();
  this.subprotocols.addAll(subprotocols);
  return this;
}
Program: 76805
Project: 76805
Buggy source:
/** 
 * Return the serialField tags in this FieldDoc item.
 * @return an array of <tt>SerialFieldTag</tt> objects containingall  {@code @serialField} tags.
 */
SerialFieldTag[] serialFieldTags();

Fixed version (ground truth):
/** 
 * Return the serialField tags in this FieldDoc item.
 * @return an array of {@code SerialFieldTag} objects containingall  {@code @serialField} tags.
 */
SerialFieldTag[] serialFieldTags();
Program: 76806
Project: 76806
Buggy source:
/** 
 * Tests whether this method overrides another. The overridden method may be one declared in a superclass or a superinterface (unlike   {@link #overriddenMethod()}). <p> When a non-abstract method overrides an abstract one, it is also said to <i>implement</i> the other.
 * @param meth  the other method to examine
 * @return <tt>true</tt> if this method overrides the other
 * @since 1.5
 */
boolean overrides(MethodDoc meth);

Fixed version (ground truth):
/** 
 * Tests whether this method overrides another. The overridden method may be one declared in a superclass or a superinterface (unlike   {@link #overriddenMethod()}). <p> When a non-abstract method overrides an abstract one, it is also said to <i>implement</i> the other.
 * @param meth  the other method to examine
 * @return {@code true} if this method overrides the other
 * @since 1.5
 */
boolean overrides(MethodDoc meth);
Program: 76807
Project: 76807
Buggy source:
/** 
 * Return the kind of this tag. For most tags,  {@code kind() == name()}; the following table lists those cases where there is more than one tag of a given kind: <table border="1" cellpadding="4" cellspacing="0" summary="related tags"> <tr><th>  {@code kind()  }</th>  <th>  {@code name()      }</th></tr> <tr><td>  {@code @throws }</td>  <td>  {@code @throws     }</td></tr> <tr><td>  {@code @throws }</td>  <td>  {@code @exception  }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @see        }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @link       }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @linkplain  }</td></tr> <tr><td>  {@code @serial }</td>  <td>  {@code @serial     }</td></tr> <tr><td>  {@code @serial }</td>  <td>  {@code @serialData }</td></tr> </table>
 * @return the kind of this tag.
 */
String kind();

Fixed version (ground truth):
/** 
 * Return the kind of this tag. For most tags,  {@code kind() == name()}; the following table lists those cases where there is more than one tag of a given kind: <table border="1"> <caption>Related Tags</caption> <tr><th>  {@code kind()  }</th>  <th>  {@code name()      }</th></tr> <tr><td>  {@code @throws }</td>  <td>  {@code @throws     }</td></tr> <tr><td>  {@code @throws }</td>  <td>  {@code @exception  }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @see        }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @link       }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @linkplain  }</td></tr> <tr><td>  {@code @serial }</td>  <td>  {@code @serial     }</td></tr> <tr><td>  {@code @serial }</td>  <td>  {@code @serialData }</td></tr> </table>
 * @return the kind of this tag.
 */
String kind();
Program: 76808
Project: 76808
Buggy source:
/** 
 * Create and return the default parameter map for this  {@code ExecutionControlProvider}. The map can optionally be modified; Modified or unmodified it can be passed to  {@link #generate(jdk.jshell.spi.ExecutionEnv,java.util.Map) }. <table summary="Parameters"> <tr> <th>Parameter</th> <th>Description</th> <th>Constant Field</th> </tr> <tr> <td>remoteAgent</td> <td>the remote agent to launch</td> <td>  {@link #PARAM_REMOTE_AGENT}</td> </tr> <tr> <td>timeout</td> <td>milliseconds before connect timeout</td> <td>  {@link #PARAM_TIMEOUT}</td> </tr> <tr> <td>launch</td> <td>"true" for JDI controlled launch</td> <td>  {@link #PARAM_LAUNCH}</td> </tr> <tr> <td>hostname</td> <td>connect to the named of the local host ("" for discovered)</td> <td>  {@link #PARAM_HOST_NAME}</td> </tr> </table>
 * @return the default parameter map
 */
@Override public Map<String,String> defaultParameters(){
  Map<String,String> dp=new HashMap<>();
  dp.put(PARAM_REMOTE_AGENT,RemoteExecutionControl.class.getName());
  dp.put(PARAM_TIMEOUT,"String_Node_Str" + DEFAULT_TIMEOUT);
  dp.put(PARAM_HOST_NAME,"String_Node_Str");
  dp.put(PARAM_LAUNCH,"String_Node_Str");
  return dp;
}

Fixed version (ground truth):
/** 
 * Create and return the default parameter map for this  {@code ExecutionControlProvider}. The map can optionally be modified; Modified or unmodified it can be passed to  {@link #generate(jdk.jshell.spi.ExecutionEnv,java.util.Map) }. <table> <caption>Parameters</caption> <tr> <th>Parameter</th> <th>Description</th> <th>Constant Field</th> </tr> <tr> <td>remoteAgent</td> <td>the remote agent to launch</td> <td>  {@link #PARAM_REMOTE_AGENT}</td> </tr> <tr> <td>timeout</td> <td>milliseconds before connect timeout</td> <td>  {@link #PARAM_TIMEOUT}</td> </tr> <tr> <td>launch</td> <td>"true" for JDI controlled launch</td> <td>  {@link #PARAM_LAUNCH}</td> </tr> <tr> <td>hostname</td> <td>connect to the named of the local host ("" for discovered)</td> <td>  {@link #PARAM_HOST_NAME}</td> </tr> </table>
 * @return the default parameter map
 */
@Override public Map<String,String> defaultParameters(){
  Map<String,String> dp=new HashMap<>();
  dp.put(PARAM_REMOTE_AGENT,RemoteExecutionControl.class.getName());
  dp.put(PARAM_TIMEOUT,"String_Node_Str" + DEFAULT_TIMEOUT);
  dp.put(PARAM_HOST_NAME,"String_Node_Str");
  dp.put(PARAM_LAUNCH,"String_Node_Str");
  return dp;
}
Program: 76810
Project: 76810
Buggy source:
/** 
 * Returns the fields, methods, constructors, and member types that are directly declared in this class or interface. This includes any   {@linkplain Elements.Origin#MANDATED mandated} elements such as the (implicit) default constructorand the implicit  {@code values} and {@code valueOf} methods ofan enum type.
 * @apiNote As a particular instance of the {@linkplain javax.lang.model.element general accuracy requirements} and theordering behavior required of this interface, the list of enclosed elements will be returned in the natural order for the originating source of information about the type.  For example, if the information about the type is originating from a source file, the elements will be returned in source code order. (However, in that case the the ordering of elements, such as a default constructor, is not specified.)
 * @return the enclosed elements in proper order, or an empty list if none
 * @jls 8.8.9 Default Constructor
 * @jls 8.9.3 Enum Members
 */
@Override List<? extends Element> getEnclosedElements();

Fixed version (ground truth):
/** 
 * Returns the fields, methods, constructors, and member types that are directly declared in this class or interface. This includes any   {@linkplain Elements.Origin#MANDATED mandated} elements such as the (implicit) default constructorand the implicit  {@code values} and {@code valueOf} methods ofan enum type.
 * @apiNote As a particular instance of the {@linkplain javax.lang.model.element general accuracy requirements} and theordering behavior required of this interface, the list of enclosed elements will be returned in the natural order for the originating source of information about the type.  For example, if the information about the type is originating from a source file, the elements will be returned in source code order. (However, in that case the the ordering of  {@linkplain Elements.Origin#MANDATED implicitly declared} elements, such asdefault constructors, is not specified.)
 * @return the enclosed elements in proper order, or an empty list if none
 * @jls 8.8.9 Default Constructor
 * @jls 8.9.3 Enum Members
 */
@Override List<? extends Element> getEnclosedElements();
Program: 76811
Project: 76811
Buggy source:
/** 
 * If the processor class is annotated with   {@link SupportedAnnotationTypes}, return an unmodifiable set with the same set of strings as the annotation.  If the class is not so annotated, an empty set is returned. If the   {@link ProcessingEvironment#getSourceVersion sourceversion} does not support modules, in other words if it is lessthan or equal to  {@link SourceVersion#RELEASE_8 RELEASE_8}, then any leading   {@link Processor#getSupportedAnnotationTypes module prefixes} are stripped from the names.
 * @return the names of the annotation types supported by thisprocessor, or an empty set if none
 */
public Set<String> getSupportedAnnotationTypes(){
  SupportedAnnotationTypes sat=this.getClass().getAnnotation(SupportedAnnotationTypes.class);
  boolean initialized=isInitialized();
  if (sat == null) {
    if (initialized)     processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING,"String_Node_Str" + "String_Node_Str" + this.getClass().getName() + "String_Node_Str");
    return Collections.emptySet();
  }
 else {
    boolean stripModulePrefixes=initialized && processingEnv.getSourceVersion().compareTo(SourceVersion.RELEASE_8) <= 0;
    return arrayToSet(sat.value(),stripModulePrefixes);
  }
}

Fixed version (ground truth):
/** 
 * If the processor class is annotated with   {@link SupportedAnnotationTypes}, return an unmodifiable set with the same set of strings as the annotation.  If the class is not so annotated, an empty set is returned. If the   {@link ProcessingEnvironment#getSourceVersion sourceversion} does not support modules, in other words if it is lessthan or equal to  {@link SourceVersion#RELEASE_8 RELEASE_8}, then any leading   {@link Processor#getSupportedAnnotationTypes module prefixes} are stripped from the names.
 * @return the names of the annotation types supported by thisprocessor, or an empty set if none
 */
public Set<String> getSupportedAnnotationTypes(){
  SupportedAnnotationTypes sat=this.getClass().getAnnotation(SupportedAnnotationTypes.class);
  boolean initialized=isInitialized();
  if (sat == null) {
    if (initialized)     processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING,"String_Node_Str" + "String_Node_Str" + this.getClass().getName() + "String_Node_Str");
    return Collections.emptySet();
  }
 else {
    boolean stripModulePrefixes=initialized && processingEnv.getSourceVersion().compareTo(SourceVersion.RELEASE_8) <= 0;
    return arrayToSet(sat.value(),stripModulePrefixes);
  }
}
Program: 76813
Project: 76813
Buggy source:
/** 
 * Returns the module of an element.  The module of a module is itself. If there is no module for the element, null is returned. One situation where there is no module for an element is if the environment does not include modules, such as an annotation processing environment configured for a   {@linkplain ProcessingEnvironment#getSourceVersion source version} without modules.      
 * @param type the element being examined
 * @return the module of an element
 * @since 9
 */
ModuleElement getModuleOf(Element type);

Fixed version (ground truth):
/** 
 * Returns the module of an element.  The module of a module is itself. If there is no module for the element, null is returned. One situation where there is no module for an element is if the environment does not include modules, such as an annotation processing environment configured for a   {@linkplain javax.annotation.processing.ProcessingEnvironment#getSourceVersion source version} without modules.
 * @param type the element being examined
 * @return the module of an element
 * @since 9
 */
ModuleElement getModuleOf(Element type);
Program: 76814
Project: 76814
Buggy source:
/** 
 * Returns a module element given its fully qualified name. If the named module cannot be found, null is returned. One situation where a module cannot be found is if the environment does not include modules, such as an annotation processing environment configured for a   {@linkplain ProcessingEnvironment#getSourceVersion source version} without modules.      
 * @param name  the name
 * @return the named module element, or {@code null} if it cannot be found
 * @since 9
 */
ModuleElement getModuleElement(CharSequence name);

Fixed version (ground truth):
/** 
 * Returns a module element given its fully qualified name. If the named module cannot be found, null is returned. One situation where a module cannot be found is if the environment does not include modules, such as an annotation processing environment configured for a   {@linkplain javax.annotation.processing.ProcessingEnvironment#getSourceVersion source version} without modules.
 * @param name  the name
 * @return the named module element, or {@code null} if it cannot be found
 * @since 9
 */
ModuleElement getModuleElement(CharSequence name);
Program: 76815
Project: 76815
Buggy source:
@Override public void visitRequires(JCRequires tree){
  if (tree.directive != null) {
    chk.checkDeprecated(tree.moduleName.pos(),msym,tree.directive.module);
    msym.directives=msym.directives.prepend(tree.directive);
  }
}

Fixed version (ground truth):
@Override public void visitRequires(JCRequires tree){
  if (tree.directive != null && allModules().contains(tree.directive.module)) {
    chk.checkDeprecated(tree.moduleName.pos(),msym,tree.directive.module);
    msym.directives=msym.directives.prepend(tree.directive);
  }
}
Program: 76821
Project: 76821
Buggy source:
private Constructor<T> getConstructor0(Class<?>[] parameterTypes,int which) throws NoSuchMethodException {
  Constructor<T>[] constructors=privateGetDeclaredConstructors((which == Member.PUBLIC));
  for (  Constructor<T> constructor : constructors) {
    if (arrayContentsEq(parameterTypes,constructor.getParameterTypes())) {
      return getReflectionFactory().copyConstructor(constructor);
    }
  }
  throw new NoSuchMethodException(getName() + "String_Node_Str" + argumentTypesToString(parameterTypes));
}

Fixed version (ground truth):
private Constructor<T> getConstructor0(Class<?>[] parameterTypes,int which) throws NoSuchMethodException {
  ReflectionFactory fact=getReflectionFactory();
  Constructor<T>[] constructors=privateGetDeclaredConstructors((which == Member.PUBLIC));
  for (  Constructor<T> constructor : constructors) {
    if (arrayContentsEq(parameterTypes,fact.getExecutableSharedParameterTypes(constructor))) {
      return constructor;
    }
  }
  throw new NoSuchMethodException(getName() + "String_Node_Str" + argumentTypesToString(parameterTypes));
}
Program: 76823
Project: 76823
Buggy source:
private Method[] privateGetPublicMethods(){
  Method[] res;
  ReflectionData<T> rd=reflectionData();
  if (rd != null) {
    res=rd.publicMethods;
    if (res != null)     return res;
  }
  MethodArray methods=new MethodArray();
{
    Method[] tmp=privateGetDeclaredMethods(true);
    methods.addAll(tmp);
  }
  MethodArray inheritedMethods=new MethodArray();
  for (  Class<?> i : getInterfaces()) {
    inheritedMethods.addInterfaceMethods(i.privateGetPublicMethods());
  }
  if (!isInterface()) {
    Class<?> c=getSuperclass();
    if (c != null) {
      MethodArray supers=new MethodArray();
      supers.addAll(c.privateGetPublicMethods());
      for (int i=0; i < supers.length(); i++) {
        Method m=supers.get(i);
        if (m != null && !Modifier.isAbstract(m.getModifiers()) && !m.isDefault()) {
          inheritedMethods.removeByNameAndDescriptor(m);
        }
      }
      supers.addAll(inheritedMethods);
      inheritedMethods=supers;
    }
  }
  for (int i=0; i < methods.length(); i++) {
    Method m=methods.get(i);
    inheritedMethods.removeByNameAndDescriptor(m);
  }
  methods.addAllIfNotPresent(inheritedMethods);
  methods.removeLessSpecifics();
  methods.compactAndTrim();
  res=methods.getArray();
  if (rd != null) {
    rd.publicMethods=res;
  }
  return res;
}

Fixed version (ground truth):
private Method[] privateGetPublicMethods(){
  Method[] res;
  ReflectionData<T> rd=reflectionData();
  if (rd != null) {
    res=rd.publicMethods;
    if (res != null)     return res;
  }
  PublicMethods pms=new PublicMethods();
  for (  Method m : privateGetDeclaredMethods(true)) {
    pms.merge(m);
  }
  Class<?> sc=getSuperclass();
  if (sc != null) {
    for (    Method m : sc.privateGetPublicMethods()) {
      pms.merge(m);
    }
  }
  for (  Class<?> intf : getInterfaces(false)) {
    for (    Method m : intf.privateGetPublicMethods()) {
      if (!Modifier.isStatic(m.getModifiers())) {
        pms.merge(m);
      }
    }
  }
  res=pms.toArray();
  if (rd != null) {
    rd.publicMethods=res;
  }
  return res;
}
Program: 76825
Project: 76825
Buggy source:
/** 
 * Returns a   {@code Method} object that reflects the specified publicmember method of the class or interface represented by this {@code Class} object.
 * @param name the name of the method
 * @param parameterTypes the list of parameters
 * @return the {@code Method} object that matches the specified{@code name} and {@code parameterTypes};   {@code null}if the method is not found or the name is "&lt;init&gt;"or "&lt;clinit&gt;".
 */
Method getMethodOrNull(String name,Class<?>... parameterTypes){
  return getMethod0(name,parameterTypes,true);
}

Fixed version (ground truth):
/** 
 * Returns a   {@code Method} object that reflects the specified publicmember method of the class or interface represented by this {@code Class} object.
 * @param name the name of the method
 * @param parameterTypes the list of parameters
 * @return the {@code Method} object that matches the specified{@code name} and {@code parameterTypes};   {@code null}if the method is not found or the name is "&lt;init&gt;"or "&lt;clinit&gt;".
 */
Method getMethodOrNull(String name,Class<?>... parameterTypes){
  Objects.requireNonNull(name);
  Method method=getMethod0(name,parameterTypes);
  return method == null ? null : getReflectionFactory().copyMethod(method);
}
Program: 76826
Project: 76826
Buggy source:
private Field getField0(String name) throws NoSuchFieldException {
  Field res;
  if ((res=searchFields(privateGetDeclaredFields(true),name)) != null) {
    return res;
  }
  Class<?>[] interfaces=getInterfaces();
  for (  Class<?> c : interfaces) {
    if ((res=c.getField0(name)) != null) {
      return res;
    }
  }
  if (!isInterface()) {
    Class<?> c=getSuperclass();
    if (c != null) {
      if ((res=c.getField0(name)) != null) {
        return res;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private Field getField0(String name){
  Field res;
  if ((res=searchFields(privateGetDeclaredFields(true),name)) != null) {
    return res;
  }
  Class<?>[] interfaces=getInterfaces(false);
  for (  Class<?> c : interfaces) {
    if ((res=c.getField0(name)) != null) {
      return res;
    }
  }
  if (!isInterface()) {
    Class<?> c=getSuperclass();
    if (c != null) {
      if ((res=c.getField0(name)) != null) {
        return res;
      }
    }
  }
  return null;
}
Program: 76827
Project: 76827
Buggy source:
void addAll(MethodArray ma){
  for (int i=0; i < ma.length(); i++) {
    add(ma.get(i));
  }
}

Fixed version (ground truth):
private static void addAll(Collection<Field> c,Field[] o){
  for (  Field f : o) {
    c.add(f);
  }
}
Program: 76828
Project: 76828
Buggy source:
private static Method searchMethods(Method[] methods,String name,Class<?>[] parameterTypes){
  Method res=null;
  String internedName=name.intern();
  for (  Method m : methods) {
    if (m.getName() == internedName && arrayContentsEq(parameterTypes,m.getParameterTypes()) && (res == null || res.getReturnType().isAssignableFrom(m.getReturnType())))     res=m;
  }
  return (res == null ? res : getReflectionFactory().copyMethod(res));
}

Fixed version (ground truth):
private static Method searchMethods(Method[] methods,String name,Class<?>[] parameterTypes){
  ReflectionFactory fact=getReflectionFactory();
  Method res=null;
  for (  Method m : methods) {
    if (m.getName().equals(name) && arrayContentsEq(parameterTypes,fact.getExecutableSharedParameterTypes(m)) && (res == null || (res.getReturnType() != m.getReturnType() && res.getReturnType().isAssignableFrom(m.getReturnType()))))     res=m;
  }
  return res;
}
Program: 76829
Project: 76829
Buggy source:
/** 
 * Returns the interfaces directly implemented by the class or interface represented by this object. <p>If this object represents a class, the return value is an array containing objects representing all interfaces directly implemented by the class.  The order of the interface objects in the array corresponds to the order of the interface names in the   {@code implements} clause ofthe declaration of the class represented by this object.  For example, given the declaration: <blockquote> {@code} class Shimmer implements FloorWax, DessertTopping ... }} </blockquote> suppose the value of  {@code s} is an instance of{@code Shimmer}; the value of the expression: <blockquote>  {@code s.getClass().getInterfaces()[0]}</blockquote> is the   {@code Class} object that represents interface{@code FloorWax}; and the value of: <blockquote>  {@code s.getClass().getInterfaces()[1]}</blockquote> is the   {@code Class} object that represents interface{@code DessertTopping}. <p>If this object represents an interface, the array contains objects representing all interfaces directly extended by the interface.  The order of the interface objects in the array corresponds to the order of the interface names in the   {@code extends} clause of the declaration ofthe interface represented by this object. <p>If this object represents a class or interface that implements no interfaces, the method returns an array of length 0. <p>If this object represents a primitive type or void, the method returns an array of length 0. <p>If this  {@code Class} object represents an array type, theinterfaces  {@code Cloneable} and {@code java.io.Serializable} arereturned in that order.
 * @return an array of interfaces directly implemented by this class
 */
public Class<?>[] getInterfaces(){
  ReflectionData<T> rd=reflectionData();
  if (rd == null) {
    return getInterfaces0();
  }
 else {
    Class<?>[] interfaces=rd.interfaces;
    if (interfaces == null) {
      interfaces=getInterfaces0();
      rd.interfaces=interfaces;
    }
    return interfaces.clone();
  }
}

Fixed version (ground truth):
private Class<?>[] getInterfaces(boolean cloneArray){
  ReflectionData<T> rd=reflectionData();
  if (rd == null) {
    return getInterfaces0();
  }
 else {
    Class<?>[] interfaces=rd.interfaces;
    if (interfaces == null) {
      interfaces=getInterfaces0();
      rd.interfaces=interfaces;
    }
    return cloneArray ? interfaces.clone() : interfaces;
  }
}
Program: 76832
Project: 76832
Buggy source:
private static Field searchFields(Field[] fields,String name){
  String internedName=name.intern();
  for (  Field field : fields) {
    if (field.getName() == internedName) {
      return getReflectionFactory().copyField(field);
    }
  }
  return null;
}

Fixed version (ground truth):
private static Field searchFields(Field[] fields,String name){
  for (  Field field : fields) {
    if (field.getName().equals(name)) {
      return field;
    }
  }
  return null;
}
Program: 76835
Project: 76835
Buggy source:
/** 
 * Returns a   {@code Constructor} object that reflects the specifiedpublic constructor of the class represented by this  {@code Class}object. The   {@code parameterTypes} parameter is an array of{@code Class} objects that identify the constructor's formalparameter types, in declared order. If this  {@code Class} object represents an inner classdeclared in a non-static context, the formal parameter types include the explicit enclosing instance as the first parameter. <p> The constructor to reflect is the public constructor of the class represented by this  {@code Class} object whose formal parametertypes match those specified by  {@code parameterTypes}.
 * @param parameterTypes the parameter array
 * @return the {@code Constructor} object of the public constructor thatmatches the specified  {@code parameterTypes}
 * @throws NoSuchMethodException if a matching method is not found.
 * @throws SecurityException If a security manager, <i>s</i>, is present and the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of  {@link SecurityManager#checkPackageAccess s.checkPackageAccess()} denies access to the packageof this class.
 * @since 1.1
 */
@CallerSensitive public Constructor<T> getConstructor(Class<?>... parameterTypes) throws NoSuchMethodException, SecurityException {
  checkMemberAccess(Member.PUBLIC,Reflection.getCallerClass(),true);
  return getConstructor0(parameterTypes,Member.PUBLIC);
}

Fixed version (ground truth):
/** 
 * Returns a   {@code Constructor} object that reflects the specifiedpublic constructor of the class represented by this  {@code Class}object. The   {@code parameterTypes} parameter is an array of{@code Class} objects that identify the constructor's formalparameter types, in declared order. If this  {@code Class} object represents an inner classdeclared in a non-static context, the formal parameter types include the explicit enclosing instance as the first parameter. <p> The constructor to reflect is the public constructor of the class represented by this  {@code Class} object whose formal parametertypes match those specified by  {@code parameterTypes}.
 * @param parameterTypes the parameter array
 * @return the {@code Constructor} object of the public constructor thatmatches the specified  {@code parameterTypes}
 * @throws NoSuchMethodException if a matching method is not found.
 * @throws SecurityException If a security manager, <i>s</i>, is present and the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of  {@link SecurityManager#checkPackageAccess s.checkPackageAccess()} denies access to the packageof this class.
 * @since 1.1
 */
@CallerSensitive public Constructor<T> getConstructor(Class<?>... parameterTypes) throws NoSuchMethodException, SecurityException {
  checkMemberAccess(Member.PUBLIC,Reflection.getCallerClass(),true);
  return getReflectionFactory().copyConstructor(getConstructor0(parameterTypes,Member.PUBLIC));
}
Program: 76836
Project: 76836
Buggy source:
private Method getMethod0(String name,Class<?>[] parameterTypes,boolean includeStaticMethods){
  MethodArray interfaceCandidates=new MethodArray(2);
  Method res=privateGetMethodRecursive(name,parameterTypes,includeStaticMethods,interfaceCandidates);
  if (res != null)   return res;
  interfaceCandidates.removeLessSpecifics();
  return interfaceCandidates.getFirst();
}

Fixed version (ground truth):
private Method getMethod0(String name,Class<?>[] parameterTypes){
  PublicMethods.MethodList res=getMethodsRecursive(name,parameterTypes == null ? EMPTY_CLASS_ARRAY : parameterTypes,true);
  return res == null ? null : res.getMostSpecific();
}
Program: 76837
Project: 76837
Buggy source:
public static void main(String[] args){
  Class[] l1={D1.class};
  test(A1.class.getMethods(),new ArrayList(Arrays.asList(l1)));
  Class[] l2={A2.class};
  test(A2.class.getMethods(),new ArrayList(Arrays.asList(l2)));
  Class[] l3={B3.class,C3.class};
  test(A3.class.getMethods(),new ArrayList(Arrays.asList(l3)));
  Class[] l4={B4.class,D4.class};
  test(A4.class.getMethods(),new ArrayList(Arrays.asList(l4)));
}

Fixed version (ground truth):
public static void main(String[] args){
  Class[] l1={D1.class};
  test(A1.class.getMethods(),new ArrayList(Arrays.asList(l1)));
  Class[] l2={A2.class};
  test(A2.class.getMethods(),new ArrayList(Arrays.asList(l2)));
  Class[] l3={B3.class,C3.class};
  test(A3.class.getMethods(),new ArrayList(Arrays.asList(l3)));
  Class[] l4={B4.class};
  test(A4.class.getMethods(),new ArrayList(Arrays.asList(l4)));
}
Program: 76838
Project: 76838
Buggy source:
void setContentBounds(WindowDimensions dims){
  XToolkit.awtLock();
  try {
    Rectangle newBounds=dims.getBounds();
    Insets in=dims.getInsets();
    if (in != null) {
      newBounds.setLocation(-in.left,-in.top);
    }
    if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
      insLog.fine("String_Node_Str",newBounds,getBounds());
    }
    boolean needHandleResize=!(newBounds.equals(getBounds()));
    reshape(newBounds);
    if (needHandleResize) {
      insLog.fine("String_Node_Str");
      handleResize(newBounds);
    }
  }
  finally {
    XToolkit.awtUnlock();
  }
  validateSurface();
}

Fixed version (ground truth):
void setContentBounds(WindowDimensions dims){
  XToolkit.awtLock();
  try {
    Rectangle newBounds=dims.getBounds();
    Insets in=dims.getInsets();
    if (in != null) {
      newBounds.setLocation(-in.left,-in.top);
    }
    if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
      insLog.fine("String_Node_Str",newBounds,getBounds());
    }
    boolean needHandleResize=!(newBounds.equals(getBounds()));
    boolean needPaint=width <= 0 || height <= 0;
    reshape(newBounds);
    if (needHandleResize) {
      insLog.fine("String_Node_Str");
      handleResize(newBounds);
    }
    if (needPaint) {
      postPaintEvent(target,0,0,newBounds.width,newBounds.height);
    }
  }
  finally {
    XToolkit.awtUnlock();
  }
}