nus-yam/ex-repair huggingface dataset:
Program: 71253
Project: 71253
Buggy source:
/** 
 * Returns a   {@code MemoryUsage} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData}must contain the following attributes: <blockquote> <table border="1"> <caption style="display:none">The attributes and the types the given CompositeData contains</caption> <tr> <th style="text-align:left">Attribute Name</th> <th style="text-align:left">Type</th> </tr> <tr> <td>init</td> <td>  {@code java.lang.Long}</td> </tr> <tr> <td>used</td> <td>  {@code java.lang.Long}</td> </tr> <tr> <td>committed</td> <td>  {@code java.lang.Long}</td> </tr> <tr> <td>max</td> <td>  {@code java.lang.Long}</td> </tr> </table> </blockquote>
 * @param cd {@code CompositeData} representing a {@code MemoryUsage}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code MemoryUsage} with the attributes describedabove.
 * @return a {@code MemoryUsage} object represented by {@code cd}if   {@code cd} is not {@code null};  {@code null} otherwise.
 */
public static MemoryUsage from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryUsageCompositeData) {
    return ((MemoryUsageCompositeData)cd).getMemoryUsage();
  }
 else {
    return new MemoryUsage(cd);
  }
}

Fixed version (ground truth):
/** 
 * Returns a   {@code MemoryUsage} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData}must contain the following attributes: <table class="striped" style="margin-left:2em;"> <caption style="display:none">The attributes and the types the given CompositeData contains</caption> <thead> <tr> <th scope="col">Attribute Name</th> <th scope="col">Type</th> </tr> </thead> <tbody style="text-align:left"> <tr> <th scope="row">init</th> <td>  {@code java.lang.Long}</td> </tr> <tr> <th scope="row">used</th> <td>  {@code java.lang.Long}</td> </tr> <tr> <th scope="row">committed</th> <td>  {@code java.lang.Long}</td> </tr> <tr> <th scope="row">max</th> <td>  {@code java.lang.Long}</td> </tr> </tbody> </table>
 * @param cd {@code CompositeData} representing a {@code MemoryUsage}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code MemoryUsage} with the attributes describedabove.
 * @return a {@code MemoryUsage} object represented by {@code cd}if   {@code cd} is not {@code null};  {@code null} otherwise.
 */
public static MemoryUsage from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryUsageCompositeData) {
    return ((MemoryUsageCompositeData)cd).getMemoryUsage();
  }
 else {
    return new MemoryUsage(cd);
  }
}
Program: 71255
Project: 71255
Buggy source:
/** 
 * Gets the DER-encoded OCTET string for the extension value (<em>extnValue</em>) identified by the passed-in   {@code oid}String. The   {@code oid} string isrepresented by a set of nonnegative whole numbers separated by periods. <p>For example:<br> <table class="plain"> <caption style="display:none">Examples of OIDs and extension names</caption> <thead> <tr> <th>OID <em>(Object Identifier)</em></th> <th>Extension Name</th></tr> </thead> <tbody> <tr><td>2.5.29.14</td> <td>SubjectKeyIdentifier</td></tr> <tr><td>2.5.29.15</td> <td>KeyUsage</td></tr> <tr><td>2.5.29.16</td> <td>PrivateKeyUsage</td></tr> <tr><td>2.5.29.17</td> <td>SubjectAlternativeName</td></tr> <tr><td>2.5.29.18</td> <td>IssuerAlternativeName</td></tr> <tr><td>2.5.29.19</td> <td>BasicConstraints</td></tr> <tr><td>2.5.29.30</td> <td>NameConstraints</td></tr> <tr><td>2.5.29.33</td> <td>PolicyMappings</td></tr> <tr><td>2.5.29.35</td> <td>AuthorityKeyIdentifier</td></tr> <tr><td>2.5.29.36</td> <td>PolicyConstraints</td></tr> </tbody> </table>
 * @param oid the Object Identifier value for the extension.
 * @return the DER-encoded octet string of the extension value ornull if it is not present.
 */
public byte[] getExtensionValue(String oid);

Fixed version (ground truth):
/** 
 * Gets the DER-encoded OCTET string for the extension value (<em>extnValue</em>) identified by the passed-in   {@code oid}String. The   {@code oid} string isrepresented by a set of nonnegative whole numbers separated by periods. <p>For example:<br> <table class="striped"> <caption style="display:none">Examples of OIDs and extension names</caption> <thead> <tr> <th scope="col">OID <em>(Object Identifier)</em></th> <th scope="col">Extension Name</th></tr> </thead> <tbody style="text-align:left"> <tr><th scope="row">2.5.29.14</th> <td>SubjectKeyIdentifier</td></tr> <tr><th scope="row">2.5.29.15</th> <td>KeyUsage</td></tr> <tr><th scope="row">2.5.29.16</th> <td>PrivateKeyUsage</td></tr> <tr><th scope="row">2.5.29.17</th> <td>SubjectAlternativeName</td></tr> <tr><th scope="row">2.5.29.18</th> <td>IssuerAlternativeName</td></tr> <tr><th scope="row">2.5.29.19</th> <td>BasicConstraints</td></tr> <tr><th scope="row">2.5.29.30</th> <td>NameConstraints</td></tr> <tr><th scope="row">2.5.29.33</th> <td>PolicyMappings</td></tr> <tr><th scope="row">2.5.29.35</th> <td>AuthorityKeyIdentifier</td></tr> <tr><th scope="row">2.5.29.36</th> <td>PolicyConstraints</td></tr> </tbody> </table>
 * @param oid the Object Identifier value for the extension.
 * @return the DER-encoded octet string of the extension value ornull if it is not present.
 */
public byte[] getExtensionValue(String oid);
Program: 71256
Project: 71256
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: 71259
Project: 71259
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: 71261
Project: 71261
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: 71263
Project: 71263
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: 71264
Project: 71264
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: 71268
Project: 71268
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: 71269
Project: 71269
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: 71271
Project: 71271
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: 71273
Project: 71273
Buggy source:
List<Pair<String,String>> getHeaders(){
  return headers;
}

Fixed version (ground truth):
Collection<Pair<String,String>> getHeaders(){
  return headers;
}
Program: 71274
Project: 71274
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: 71275
Project: 71275
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: 71276
Project: 71276
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: 71277
Project: 71277
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: 71278
Project: 71278
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: 71280
Project: 71280
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: 71281
Project: 71281
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: 71283
Project: 71283
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: 71284
Project: 71284
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: 71285
Project: 71285
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: 71291
Project: 71291
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: 71293
Project: 71293
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: 71295
Project: 71295
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: 71296
Project: 71296
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: 71297
Project: 71297
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: 71298
Project: 71298
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: 71299
Project: 71299
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: 71302
Project: 71302
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;
}