nus-yam/ex-repair huggingface dataset:
Program: 35764
Project: 35764
Buggy source:
public void runBatchPerfTest(boolean scalarsOnly){
  List<SimpleEntity> list=new ArrayList<>(numberEntities);
  for (int i=0; i < numberEntities; i++) {
    list.add(createEntity(scalarsOnly));
  }
  startBenchmark("String_Node_Str");
  box.put(list);
  stopBenchmark();
  for (  SimpleEntity entity : list) {
    if (scalarsOnly) {
      setRandomScalars(entity);
    }
 else {
      setRandomValues(entity);
    }
  }
  startBenchmark("String_Node_Str");
  box.put(list);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  List<SimpleEntity> reloaded=box.getAll();
  stopBenchmark();
  startBenchmark("String_Node_Str");
  accessAll(reloaded);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  box.removeAll();
  stopBenchmark();
}

Fixed version (ground truth):
public void runBatchPerfTest(boolean scalarsOnly){
  List<SimpleEntity> list=new ArrayList<>(numberEntities);
  for (int i=0; i < numberEntities; i++) {
    list.add(createEntity(scalarsOnly));
  }
  startBenchmark("String_Node_Str");
  box.put(list);
  stopBenchmark();
  for (  SimpleEntity entity : list) {
    if (scalarsOnly) {
      setRandomScalars(entity);
    }
 else {
      setRandomValues(entity);
    }
  }
  startBenchmark("String_Node_Str");
  box.put(list);
  stopBenchmark();
  list=null;
  startBenchmark("String_Node_Str");
  List<SimpleEntity> reloaded=box.getAll();
  stopBenchmark();
  startBenchmark("String_Node_Str");
  accessAll(reloaded);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  box.remove(reloaded);
  stopBenchmark();
}
Program: 35765
Project: 35765
Buggy source:
@Override public String getArrayType(String type){
  return "String_Node_Str" + type + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getArrayType(String type){
  String result=toCamelCase(type);
  return "String_Node_Str" + result + "String_Node_Str";
}
Program: 35766
Project: 35766
Buggy source:
@Override public String getClassName(String jsonKey){
  String result;
  int nonCharPos=getNoCharPosition(jsonKey);
  if (nonCharPos != -1) {
    result=jsonKey.substring(0,nonCharPos) + StringUtils.capitalize(jsonKey.substring(nonCharPos + 1));
  }
 else {
    result=jsonKey;
  }
  return StringUtils.capitalize(result);
}

Fixed version (ground truth):
@Override public String getClassName(String jsonKey){
  String result=toCamelCase(jsonKey);
  return StringUtils.capitalize(result);
}
Program: 35767
Project: 35767
Buggy source:
@Override public String getFieldName(String jsonName){
  String result;
  int nonCharPos=getNoCharPosition(jsonName);
  if (nonCharPos != -1) {
    result=jsonName.substring(0,nonCharPos) + StringUtils.capitalize(jsonName.substring(nonCharPos + 1));
  }
 else {
    result=jsonName;
  }
  return result;
}

Fixed version (ground truth):
@Override public String getFieldName(String jsonName){
  String result=toCamelCase(jsonName);
  return result;
}
Program: 35771
Project: 35771
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: 35772
Project: 35772
Buggy source:
List<Pair<String,String>> getHeaders(){
  return headers;
}

Fixed version (ground truth):
Collection<Pair<String,String>> getHeaders(){
  return headers;
}
Program: 35773
Project: 35773
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: 35774
Project: 35774
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: 35775
Project: 35775
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: 35776
Project: 35776
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: 35777
Project: 35777
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: 35779
Project: 35779
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: 35780
Project: 35780
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: 35781
Project: 35781
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: 35782
Project: 35782
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: 35784
Project: 35784
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: 35785
Project: 35785
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: 35786
Project: 35786
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: 35788
Project: 35788
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: 35797
Project: 35797
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: 35799
Project: 35799
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: 35801
Project: 35801
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: 35802
Project: 35802
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: 35803
Project: 35803
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: 35804
Project: 35804
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: 35805
Project: 35805
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: 35808
Project: 35808
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: 35811
Project: 35811
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: 35812
Project: 35812
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: 35813
Project: 35813
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: 35815
Project: 35815
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: 35817
Project: 35817
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: 35819
Project: 35819
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: 35820
Project: 35820
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: 35821
Project: 35821
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: 35822
Project: 35822
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: 35823
Project: 35823
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: 35826
Project: 35826
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;
}