nus-yam/ex-repair huggingface dataset:
Program: 51041
Project: 51041
Buggy source:
public void run(){
  double acc=0, meanAcc=0, f=0;
  double[][] matrix=kernel.compute(dataSet.getGraphs());
  for (int i=0; i < seeds.length; i++) {
    kernel.shuffle(matrix,seeds[i]);
    dataSet.shuffle(seeds[i]);
    double[] target=LibSVM.createTargets(dataSet.getLabels());
    double[] prediction=LibSVM.crossValidate(matrix,target,10,cs);
    acc+=LibSVM.computeAccuracy(target,prediction);
    f+=LibSVM.computeF1(target,prediction);
  }
  accuracy=acc / seeds.length;
  f1=f / seeds.length;
  output.println(dataSet.getLabel());
  output.println(kernel.getLabel() + "String_Node_Str" + Arrays.toString(seeds)+ "String_Node_Str"+ Arrays.toString(cs));
  output.print("String_Node_Str" + accuracy);
  output.print("String_Node_Str" + f1);
  output.println("String_Node_Str");
  output.flush();
  results.setLabel(dataSet.getLabel() + "String_Node_Str" + Arrays.toString(seeds)+ "String_Node_Str"+ Arrays.toString(cs)+ "String_Node_Str"+ kernel.getLabel());
  results.setAccuracy(accuracy);
  results.setF1(f1);
}

Fixed version (ground truth):
public void run(){
  double acc=0, meanAcc=0, f=0;
  double[][] matrix=kernel.compute(dataSet.getGraphs());
  for (int i=0; i < seeds.length; i++) {
    matrix=kernel.shuffle(matrix,seeds[i]);
    dataSet.shuffle(seeds[i]);
    double[] target=LibSVM.createTargets(dataSet.getLabels());
    double[] prediction=LibSVM.crossValidate(matrix,target,10,cs);
    acc+=LibSVM.computeAccuracy(target,prediction);
    f+=LibSVM.computeF1(target,prediction);
  }
  accuracy=acc / seeds.length;
  f1=f / seeds.length;
  output.println(dataSet.getLabel());
  output.println(kernel.getLabel() + "String_Node_Str" + Arrays.toString(seeds)+ "String_Node_Str"+ Arrays.toString(cs));
  output.print("String_Node_Str" + accuracy);
  output.print("String_Node_Str" + f1);
  output.println("String_Node_Str");
  output.flush();
  results.setLabel(dataSet.getLabel() + "String_Node_Str" + Arrays.toString(seeds)+ "String_Node_Str"+ Arrays.toString(cs)+ "String_Node_Str"+ kernel.getLabel());
  results.setAccuracy(accuracy);
  results.setF1(f1);
}
Program: 51042
Project: 51042
Buggy source:
public void shuffle(double[][] kernel,long seed){
  Double[][] kernelDouble=convert2DoubleObjects(kernel);
  for (int i=0; i < kernel.length; i++) {
    Collections.shuffle(Arrays.asList(kernelDouble[i]),new Random(seed));
  }
  Collections.shuffle(Arrays.asList(kernelDouble),new Random(seed));
  kernel=convert2DoublePrimitives(kernelDouble);
}

Fixed version (ground truth):
public double[][] shuffle(double[][] kernel,long seed){
  Double[][] kernelDouble=convert2DoubleObjects(kernel);
  for (int i=0; i < kernel.length; i++) {
    Collections.shuffle(Arrays.asList(kernelDouble[i]),new Random(seed));
  }
  Collections.shuffle(Arrays.asList(kernelDouble),new Random(seed));
  return convert2DoublePrimitives(kernelDouble);
}
Program: 51045
Project: 51045
Buggy source:
/** 
 * Reads a graph from a basic tab-separated value file. The file can contain  comments on lines that start with a '#', and edges in the form of two  whitespace separated labels. Empty lines are ignored.
 * @param tsFile
 * @return
 * @throws FileNotFoundException 
 */
public static UndirectedGraph<Vertex<String>,Edge<String>> graphFromTSV(File file) throws IOException {
  UndirectedSparseGraph<Vertex<String>,Edge<String>> graph=new UndirectedSparseGraph<Vertex<String>,Edge<String>>();
  BufferedReader reader=new BufferedReader(new FileReader(file));
  String line;
  int i=0;
  int edges=0;
  do {
    line=reader.readLine();
    i++;
    if (line == null)     continue;
    if (line.trim().isEmpty())     continue;
    if (line.trim().startsWith("String_Node_Str"))     continue;
    String[] split=line.split("String_Node_Str");
    if (split.length < 2)     throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
    String a, b;
    a=split[0];
    b=split[1];
    Vertex<String> av=new Vertex<String>(a), bv=new Vertex<String>(b);
    graph.addEdge(new Edge<String>("String_Node_Str" + edges++),Arrays.asList(av,bv));
    if (edges % 10000 == 0)     System.out.print("String_Node_Str" + edges + "String_Node_Str");
  }
 while (line != null);
  System.out.println("String_Node_Str" + edges + "String_Node_Str");
  return graph;
}

Fixed version (ground truth):
/** 
 * Reads a graph from a basic tab-separated value file. The file can contain  comments on lines that start with a '#', and edges in the form of two  whitespace separated labels. Empty lines are ignored.
 * @param tsFile
 * @return
 * @throws FileNotFoundException 
 */
public static UndirectedGraph<Vertex<String>,Edge<String>> graphFromTSV(File file) throws IOException {
  Map<String,Vertex<String>> map=new HashMap<String,Vertex<String>>();
  UndirectedSparseGraph<Vertex<String>,Edge<String>> graph=new UndirectedSparseGraph<Vertex<String>,Edge<String>>();
  BufferedReader reader=new BufferedReader(new FileReader(file));
  String line;
  int i=0;
  int edges=0;
  do {
    line=reader.readLine();
    i++;
    if (line == null)     continue;
    if (line.trim().isEmpty())     continue;
    if (line.trim().startsWith("String_Node_Str"))     continue;
    String[] split=line.split("String_Node_Str");
    if (split.length < 2)     throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
    String a, b;
    a=split[0];
    b=split[1];
    Vertex<String> av=vertex(a,map), bv=vertex(b,map);
    graph.addEdge(new Edge<String>("String_Node_Str" + edges++),Arrays.asList(av,bv));
    if (edges % 10000 == 0)     System.out.print("String_Node_Str" + edges + "String_Node_Str");
  }
 while (line != null);
  System.out.println("String_Node_Str" + edges + "String_Node_Str");
  return graph;
}
Program: 51049
Project: 51049
Buggy source:
public LinkPredictionExperiment(LinkPredictionDataSet dataSet,GraphKernel kernelA,GraphKernel kernelB,double weightA,double weightB,long[] seeds,double[] cs,OutputStream outputStream){
  this.dataSet=dataSet;
  this.kernelA=kernelA;
  this.kernelB=kernelB;
  this.weightA=weightA;
  this.weightB=weightB;
  this.seeds=seeds;
  this.cs=cs;
  output=new PrintWriter(outputStream);
  results=new ExperimentResults();
  results.setAccuracy(new Result());
  results.setF1(new Result());
  results.setAveragePrecision(new Result());
  results.setrPrecision(new Result());
}

Fixed version (ground truth):
public LinkPredictionExperiment(LinkPredictionDataSet dataSet,GraphKernel kernelA,GraphKernel kernelB,double weightA,double weightB,long[] seeds,double[] cs,OutputStream outputStream){
  this.dataSet=dataSet;
  this.kernelA=kernelA;
  this.kernelB=kernelB;
  this.weightA=weightA;
  this.weightB=weightB;
  this.seeds=seeds;
  this.cs=cs;
  output=new PrintWriter(outputStream);
  results=new ExperimentResults();
  results.setAccuracy(new Result());
  results.setF1(new Result());
  results.setAveragePrecision(new Result());
  results.setrPrecision(new Result());
  results.setNdcg(new Result());
}
Program: 51054
Project: 51054
Buggy source:
public Map<Pair<DirectedGraph<Vertex<String>,Edge<String>>>,Boolean> getLabels(){
  return labels;
}

Fixed version (ground truth):
public Map<Pair<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>>,Boolean> getLabels(){
  return labels;
}
Program: 51055
Project: 51055
Buggy source:
public List<DirectedGraph<Vertex<String>,Edge<String>>> getGraphsA(){
  return graphsA;
}

Fixed version (ground truth):
public List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> getGraphsA(){
  return graphsA;
}
Program: 51056
Project: 51056
Buggy source:
public List<DirectedGraph<Vertex<String>,Edge<String>>> getGraphsB(){
  return graphsB;
}

Fixed version (ground truth):
public List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> getGraphsB(){
  return graphsB;
}
Program: 51057
Project: 51057
Buggy source:
public LinkPredictionDataSet(String label,List<DirectedGraph<Vertex<String>,Edge<String>>> graphsA,List<DirectedGraph<Vertex<String>,Edge<String>>> graphsB,List<Vertex<String>> rootVerticesA,List<Vertex<String>> rootVerticesB,Map<Pair<DirectedGraph<Vertex<String>,Edge<String>>>,Boolean> labels){
  super();
  this.label=label;
  this.graphsA=graphsA;
  this.graphsB=graphsB;
  this.rootVerticesA=rootVerticesA;
  this.rootVerticesB=rootVerticesB;
  this.labels=labels;
}

Fixed version (ground truth):
public LinkPredictionDataSet(String label,List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> graphsA,List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> graphsB,Map<Pair<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>>,Boolean> labels){
  super();
  this.label=label;
  this.graphsA=graphsA;
  this.graphsB=graphsB;
  this.labels=labels;
}
Program: 51058
Project: 51058
Buggy source:
public void shuffle(long seed){
  Collections.shuffle(graphsA,new Random(seed));
  Collections.shuffle(graphsB,new Random(seed));
  Collections.shuffle(rootVerticesA,new Random(seed));
  Collections.shuffle(rootVerticesB,new Random(seed));
}

Fixed version (ground truth):
public void shuffle(long seed){
  Collections.shuffle(graphsA,new Random(seed));
  Collections.shuffle(graphsB,new Random(seed));
}
Program: 51059
Project: 51059
Buggy source:
private double[][] combineTestKernels(double[][] matrixA,double[][] matrixB){
  double[][] matrix=new double[testSet.size()][trainSet.size()];
  Pair<DirectedGraph<Vertex<String>,Edge<String>>> pairA, pairB;
  for (int i=0; i < testSet.size(); i++) {
    pairA=testSet.get(i);
    for (int j=i; j < trainSet.size(); j++) {
      pairB=trainSet.get(j);
      matrix[i][j]=weightA * matrixA[testGraphsA.indexOf(pairA.getFirst())][trainGraphsA.indexOf(pairB.getFirst())] + weightB * matrixB[testGraphsB.indexOf(pairA.getSecond())][trainGraphsB.indexOf(pairB.getSecond())];
    }
  }
  return matrix;
}

Fixed version (ground truth):
private double[][] combineTestKernels(double[][] matrixA,double[][] matrixB){
  double[][] matrix=new double[testSet.size()][trainSet.size()];
  Pair<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> pairA, pairB;
  for (int i=0; i < testSet.size(); i++) {
    pairA=testSet.get(i);
    for (int j=i; j < trainSet.size(); j++) {
      pairB=trainSet.get(j);
      matrix[i][j]=weightA * matrixA[testGraphsA.indexOf(pairA.getFirst())][trainGraphsA.indexOf(pairB.getFirst())] + weightB * matrixB[testGraphsB.indexOf(pairA.getSecond())][trainGraphsB.indexOf(pairB.getSecond())];
    }
  }
  return matrix;
}
Program: 51061
Project: 51061
Buggy source:
private double[][] combineTrainKernels(double[][] matrixA,double[][] matrixB){
  double[][] matrix=new double[trainSet.size()][trainSet.size()];
  Pair<DirectedGraph<Vertex<String>,Edge<String>>> pairA, pairB;
  for (int i=0; i < trainSet.size(); i++) {
    pairA=trainSet.get(i);
    for (int j=i; j < trainSet.size(); j++) {
      pairB=trainSet.get(j);
      matrix[i][j]=weightA * matrixA[trainGraphsA.indexOf(pairA.getFirst())][trainGraphsA.indexOf(pairB.getFirst())] + weightB * matrixB[trainGraphsB.indexOf(pairA.getSecond())][trainGraphsB.indexOf(pairB.getSecond())];
      matrix[j][i]=matrix[i][j];
    }
  }
  return matrix;
}

Fixed version (ground truth):
private double[][] combineTrainKernels(double[][] matrixA,double[][] matrixB){
  double[][] matrix=new double[trainSet.size()][trainSet.size()];
  Pair<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> pairA, pairB;
  for (int i=0; i < trainSet.size(); i++) {
    pairA=trainSet.get(i);
    for (int j=i; j < trainSet.size(); j++) {
      pairB=trainSet.get(j);
      matrix[i][j]=weightA * matrixA[trainGraphsA.indexOf(pairA.getFirst())][trainGraphsA.indexOf(pairB.getFirst())] + weightB * matrixB[trainGraphsB.indexOf(pairA.getSecond())][trainGraphsB.indexOf(pairB.getSecond())];
      matrix[j][i]=matrix[i][j];
    }
  }
  return matrix;
}
Program: 51064
Project: 51064
Buggy source:
public ClassificationExperiment(GraphClassificationDataSet dataSet,GraphKernel kernel,long[] seeds,double[] cs,OutputStream outputStream){
  this.dataSet=dataSet;
  this.kernel=kernel;
  this.seeds=seeds;
  this.cs=cs;
  output=new PrintWriter(outputStream);
  results=new ExperimentResults();
}

Fixed version (ground truth):
public ClassificationExperiment(GraphClassificationDataSet dataSet,GraphKernel kernel,long[] seeds,double[] cs,OutputStream outputStream){
  this.dataSet=new GraphClassificationDataSet(dataSet);
  this.kernel=kernel;
  this.seeds=seeds;
  this.cs=cs;
  output=new PrintWriter(outputStream);
  results=new ExperimentResults();
}
Program: 51065
Project: 51065
Buggy source:
public static GraphClassificationDataSet createClassificationDataSet(RDFDataSet rdfDataSet,String property,List<String> blackList,int depth,boolean includeInverse,boolean includeInference){
  List<DirectedGraph<Vertex<String>,Edge<String>>> graphs=new ArrayList<DirectedGraph<Vertex<String>,Edge<String>>>();
  List<String> labels=new ArrayList<String>();
  List<Vertex<String>> rootVertices=new ArrayList<Vertex<String>>();
  StringBuffer label=new StringBuffer();
  label.append(rdfDataSet.getLabel());
  label.append("String_Node_Str");
  label.append(property);
  label.append("String_Node_Str");
  label.append(depth);
  label.append("String_Node_Str");
  label.append(includeInverse);
  label.append("String_Node_Str");
  label.append(includeInference);
  List<Statement> triples=rdfDataSet.getStatementsFromStrings(null,property,null,false);
  for (  Statement triple : triples) {
    if (triple.getSubject() instanceof URI) {
      DirectedGraph<Vertex<String>,Edge<String>> graph=GraphFactory.createDirectedGraph(rdfDataSet.getSubGraph((URI)triple.getSubject(),depth,includeInverse,includeInference));
      graphs.add(graph);
      labels.add(triple.getObject().toString());
      rootVertices.add(findVertex(graph,triple.getSubject().toString()));
      Graphs.removeVerticesAndEdges(graph,null,blackList);
    }
  }
  return new GraphClassificationDataSet(label.toString(),graphs,labels,rootVertices);
}

Fixed version (ground truth):
public static GraphClassificationDataSet createClassificationDataSet(RDFDataSet rdfDataSet,String property,List<String> blackList,int depth,boolean includeInverse,boolean includeInference){
  List<DirectedGraph<Vertex<String>,Edge<String>>> graphs=new ArrayList<DirectedGraph<Vertex<String>,Edge<String>>>();
  List<String> labels=new ArrayList<String>();
  List<Vertex<String>> rootVertices=new ArrayList<Vertex<String>>();
  StringBuffer label=new StringBuffer();
  label.append(rdfDataSet.getLabel());
  label.append("String_Node_Str");
  label.append(property);
  label.append("String_Node_Str");
  label.append(depth);
  label.append("String_Node_Str");
  label.append(includeInverse);
  label.append("String_Node_Str");
  label.append(includeInference);
  List<Statement> triples=rdfDataSet.getStatementsFromStrings(null,property,null,false);
  for (  Statement triple : triples) {
    if (triple.getSubject() instanceof URI) {
      DirectedGraph<Vertex<String>,Edge<String>> graph=GraphFactory.createDirectedGraph(rdfDataSet.getSubGraph((URI)triple.getSubject(),depth,includeInverse,includeInference));
      graphs.add(graph);
      labels.add(triple.getObject().toString());
      rootVertices.add(findVertex(graph,triple.getSubject().toString()));
      Graphs.removeVerticesAndEdges(graph,null,blackList);
    }
  }
  return new GraphClassificationDataSet(label.toString(),graphs,labels,Collections.unmodifiableList(rootVertices));
}
Program: 51066
Project: 51066
Buggy source:
public GraphClassificationDataSet(String label,List<DirectedGraph<Vertex<String>,Edge<String>>> graphs,List<String> labels,List<Vertex<String>> rootVertices){
  super();
  this.label=label;
  this.graphs=graphs;
  this.labels=labels;
  this.rootVertices=rootVertices;
}

Fixed version (ground truth):
public GraphClassificationDataSet(GraphClassificationDataSet set){
  this.label=new String(set.getLabel());
  this.graphs=new ArrayList<DirectedGraph<Vertex<String>,Edge<String>>>(set.getGraphs());
  this.labels=new ArrayList<String>(set.getLabels());
  this.rootVertices=new ArrayList<Vertex<String>>(set.getRootVertices());
}
Program: 51069
Project: 51069
Buggy source:
public void testHTTPDigestAuthFilter(){
  startServer(Resource.class);
  Client c=Client.create();
  c.addFilter(new HTTPDigestAuthFilter(DIGEST_TEST_LOGIN,DIGEST_TEST_PASS));
  WebResource r=c.resource(getUri().path("String_Node_Str").build());
  ClientResponse response=r.get(ClientResponse.class);
  assertTrue(response.getStatus() == 200);
}

Fixed version (ground truth):
public void testHTTPDigestAuthFilter(){
  final String path="String_Node_Str";
  testRequest(path);
}
Program: 51070
Project: 51070
Buggy source:
@GET public Response get1(){
  if (context.getRequest().getHeaderValue("String_Node_Str") == null) {
    return Response.status(401).header("String_Node_Str","String_Node_Str" + DIGEST_TEST_REALM + "String_Node_Str"+ "String_Node_Str"+ DIGEST_TEST_NONCE+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ DIGEST_TEST_DOMAIN+ "String_Node_Str").build();
  }
 else {
    String authHeader=context.getRequest().getHeaderValue("String_Node_Str");
    String HA1=concatMD5(DIGEST_TEST_LOGIN,DIGEST_TEST_REALM,DIGEST_TEST_PASS);
    String HA2=concatMD5("String_Node_Str",context.getRequest().getRequestUri().getPath().toString());
    String response=concatMD5(HA1,DIGEST_TEST_NONCE,getDigestAuthHeaderValue(authHeader,"String_Node_Str"),getDigestAuthHeaderValue(authHeader,"String_Node_Str"),getDigestAuthHeaderValue(authHeader,"String_Node_Str"),HA2);
    if (response.equals(getDigestAuthHeaderValue(authHeader,"String_Node_Str"))) {
      return Response.ok().build();
    }
 else {
      return Response.status(401).build();
    }
  }
}

Fixed version (ground truth):
@GET public Response get1(){
  return verify();
}
Program: 51071
Project: 51071
Buggy source:
public QueryParamException(Throwable cause,String name,String defaultStringValue){
  super(cause,QueryParam.class,name,defaultStringValue);
}

Fixed version (ground truth):
public QueryParamException(Throwable cause,String name,String defaultStringValue){
  super(cause,Responses.CLIENT_ERROR,QueryParam.class,name,defaultStringValue);
}
Program: 51072
Project: 51072
Buggy source:
/** 
 * Sets the request or access token.
 */
public void setToken(String token){
  put(TOKEN,token);
}

Fixed version (ground truth):
/** 
 * Sets the request or access token.
 */
public void setToken(String token){
  if (token == null) {
    remove(TOKEN);
  }
 else {
    put(TOKEN,token);
  }
}
Program: 51073
Project: 51073
Buggy source:
public final void writeList(Class<?> elementType,Collection<?> t,MediaType mediaType,Charset c,Marshaller m,OutputStream entityStream) throws JAXBException, IOException {
  final String rootElement=getRootElementName(elementType);
  final String cName=c.name();
  entityStream.write(String.format("String_Node_Str",cName).getBytes(cName));
  String property="String_Node_Str";
  String header;
  try {
    header=(String)m.getProperty(property);
  }
 catch (  PropertyException e) {
    property="String_Node_Str";
    try {
      header=(String)m.getProperty(property);
    }
 catch (    PropertyException ex) {
      header=null;
      Logger.getLogger(XMLListElementProvider.class.getName()).log(Level.WARNING,"String_Node_Str");
    }
  }
  if (header != null) {
    m.setProperty(property,"String_Node_Str");
    entityStream.write(header.getBytes(cName));
  }
  entityStream.write(String.format("String_Node_Str",rootElement).getBytes(cName));
  for (  Object o : t)   m.marshal(o,entityStream);
  entityStream.write(String.format("String_Node_Str",rootElement).getBytes(cName));
}

Fixed version (ground truth):
@Override public final void writeList(Class<?> elementType,Collection<?> t,MediaType mediaType,Charset c,Marshaller m,OutputStream entityStream) throws JAXBException, IOException {
  final String rootElement=getRootElementName(elementType);
  final String cName=c.name();
  entityStream.write(String.format("String_Node_Str",cName).getBytes(cName));
  String property="String_Node_Str";
  String header;
  try {
    header=(String)m.getProperty(property);
  }
 catch (  PropertyException e) {
    property="String_Node_Str";
    try {
      header=(String)m.getProperty(property);
    }
 catch (    PropertyException ex) {
      header=null;
      Logger.getLogger(XMLListElementProvider.class.getName()).log(Level.WARNING,"String_Node_Str");
    }
  }
  if (header != null) {
    m.setProperty(property,"String_Node_Str");
    entityStream.write(header.getBytes(cName));
  }
  entityStream.write(String.format("String_Node_Str",rootElement).getBytes(cName));
  for (  Object o : t)   m.marshal(o,entityStream);
  entityStream.write(String.format("String_Node_Str",rootElement).getBytes(cName));
}
Program: 51075
Project: 51075
Buggy source:
@Override public boolean isReadable(Class<?> type,Type genericType,Annotation annotations[],MediaType mediaType){
  if (type == List.class || type == Collection.class) {
    return verifyGenericType(genericType) && isSupported(mediaType);
  }
 else   if (type.isArray()) {
    return verifyArrayType(type) && isSupported(mediaType);
  }
 else   return false;
}

Fixed version (ground truth):
@Override public boolean isReadable(Class<?> type,Type genericType,Annotation annotations[],MediaType mediaType){
  if (verifyCollectionSubclass(type)) {
    return verifyGenericType(genericType) && isSupported(mediaType);
  }
 else   if (type.isArray()) {
    return verifyArrayType(type) && isSupported(mediaType);
  }
 else   return false;
}
Program: 51076
Project: 51076
Buggy source:
@Override public boolean isWriteable(Class<?> type,Type genericType,Annotation annotations[],MediaType mediaType){
  if (List.class.isAssignableFrom(type)) {
    return verifyGenericType(genericType) && isSupported(mediaType);
  }
 else   if (type.isArray()) {
    return verifyArrayType(type) && isSupported(mediaType);
  }
 else   return false;
}

Fixed version (ground truth):
@Override public boolean isWriteable(Class<?> type,Type genericType,Annotation annotations[],MediaType mediaType){
  if (Collection.class.isAssignableFrom(type)) {
    return verifyGenericType(genericType) && isSupported(mediaType);
  }
 else   if (type.isArray()) {
    return verifyArrayType(type) && isSupported(mediaType);
  }
 else   return false;
}
Program: 51077
Project: 51077
Buggy source:
public void testJAXBListRepresentationMediaType(){
  initiateWebApplication(JAXBListResourceMediaType.class);
  WebResource r=resource("String_Node_Str");
  Collection<JAXBBean> a=r.get(new GenericType<Collection<JAXBBean>>(){
  }
);
  Collection<JAXBBean> b=r.type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
}

Fixed version (ground truth):
public void testJAXBListRepresentationMediaType(){
  initiateWebApplication(JAXBListResourceMediaType.class);
  WebResource r=resource("String_Node_Str");
  Collection<JAXBBean> a=r.get(new GenericType<Collection<JAXBBean>>(){
  }
);
  Collection<JAXBBean> b=r.type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  a=new LinkedList(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Queue<JAXBBean>>(){
  }
,new GenericEntity<Queue<JAXBBean>>((Queue)a){
  }
);
  assertEquals(a,b);
  a=new HashSet(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Set<JAXBBean>>(){
  }
,new GenericEntity<Set<JAXBBean>>((Set)a){
  }
);
  Comparator<JAXBBean> c=new Comparator<JAXBBean>(){
    @Override public int compare(    JAXBBean t,    JAXBBean t1){
      return t.value.compareTo(t1.value);
    }
  }
;
  TreeSet t1=new TreeSet(c), t2=new TreeSet(c);
  t1.addAll(a);
  t2.addAll(b);
  assertEquals(t1,t2);
  Stack s=new Stack();
  s.addAll(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Stack<JAXBBean>>(){
  }
,new GenericEntity<Stack<JAXBBean>>(s){
  }
);
  assertEquals(s,b);
  a=new MyArrayList(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<MyArrayList<JAXBBean>>(){
  }
,new GenericEntity<MyArrayList<JAXBBean>>((MyArrayList)a){
  }
);
  assertEquals(a,b);
}
Program: 51078
Project: 51078
Buggy source:
/** 
 * TODO, the unmarshalling fails.
 */
public void testJAXBListRepresentationFastInfoset(){
  initiateWebApplication(JAXBListResourceFastInfoset.class);
  WebResource r=resource("String_Node_Str");
  r.addFilter(new LoggingFilter());
  Collection<JAXBBean> a=r.get(new GenericType<Collection<JAXBBean>>(){
  }
);
  Collection<JAXBBean> b=r.type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
}

Fixed version (ground truth):
/** 
 * TODO, the unmarshalling fails.
 */
public void testJAXBListRepresentationFastInfoset(){
  initiateWebApplication(JAXBListResourceFastInfoset.class);
  WebResource r=resource("String_Node_Str");
  r.addFilter(new LoggingFilter());
  Collection<JAXBBean> a=r.get(new GenericType<Collection<JAXBBean>>(){
  }
);
  Collection<JAXBBean> b=r.type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  a=new LinkedList(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Queue<JAXBBean>>(){
  }
,new GenericEntity<Queue<JAXBBean>>((Queue)a){
  }
);
  assertEquals(a,b);
  a=new HashSet(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Set<JAXBBean>>(){
  }
,new GenericEntity<Set<JAXBBean>>((Set)a){
  }
);
  Comparator<JAXBBean> c=new Comparator<JAXBBean>(){
    @Override public int compare(    JAXBBean t,    JAXBBean t1){
      return t.value.compareTo(t1.value);
    }
  }
;
  TreeSet t1=new TreeSet(c), t2=new TreeSet(c);
  t1.addAll(a);
  t2.addAll(b);
  assertEquals(t1,t2);
  Stack s=new Stack();
  s.addAll(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Stack<JAXBBean>>(){
  }
,new GenericEntity<Stack<JAXBBean>>(s){
  }
);
  assertEquals(s,b);
  a=new MyArrayList(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<MyArrayList<JAXBBean>>(){
  }
,new GenericEntity<MyArrayList<JAXBBean>>((MyArrayList)a){
  }
);
  assertEquals(a,b);
}
Program: 51079
Project: 51079
Buggy source:
public void testJAXBListRepresentationJSON() throws Exception {
  initiateWebApplication(JAXBListResourceJSON.class);
  WebResource r=resource("String_Node_Str");
  Collection<JAXBBean> a=r.get(new GenericType<Collection<JAXBBean>>(){
  }
);
  Collection<JAXBBean> b=r.type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
}

Fixed version (ground truth):
public void testJAXBListRepresentationJSON() throws Exception {
  initiateWebApplication(JAXBListResourceJSON.class);
  WebResource r=resource("String_Node_Str");
  Collection<JAXBBean> a=r.get(new GenericType<Collection<JAXBBean>>(){
  }
);
  Collection<JAXBBean> b=r.type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Collection<JAXBBean>>(){
  }
,new GenericEntity<Collection<JAXBBean>>(a){
  }
);
  assertEquals(a,b);
  a=new LinkedList(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Queue<JAXBBean>>(){
  }
,new GenericEntity<Queue<JAXBBean>>((Queue)a){
  }
);
  assertEquals(a,b);
  a=new HashSet(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Set<JAXBBean>>(){
  }
,new GenericEntity<Set<JAXBBean>>((Set)a){
  }
);
  Comparator<JAXBBean> c=new Comparator<JAXBBean>(){
    @Override public int compare(    JAXBBean t,    JAXBBean t1){
      return t.value.compareTo(t1.value);
    }
  }
;
  TreeSet t1=new TreeSet(c), t2=new TreeSet(c);
  t1.addAll(a);
  t2.addAll(b);
  assertEquals(t1,t2);
  Stack s=new Stack();
  s.addAll(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<Stack<JAXBBean>>(){
  }
,new GenericEntity<Stack<JAXBBean>>(s){
  }
);
  assertEquals(s,b);
  a=new MyArrayList(a);
  b=r.path("String_Node_Str").type("String_Node_Str").post(new GenericType<MyArrayList<JAXBBean>>(){
  }
,new GenericEntity<MyArrayList<JAXBBean>>((MyArrayList)a){
  }
);
  assertEquals(a,b);
}
Program: 51081
Project: 51081
Buggy source:
private T _getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  ConstructorInjectablePair<T> cip=getConstructor();
  if (cip == null || cip.is.size() == 0) {
    return c.newInstance();
  }
 else {
    if (cip.is.contains(null)) {
      for (int i=0; i < cip.is.size(); i++) {
        if (cip.is.get(i) == null) {
          Errors.missingDependency(cip.con,i);
        }
      }
    }
    Object[] params=new Object[cip.is.size()];
    int i=0;
    for (    Injectable injectable : cip.is) {
      if (injectable != null)       params[i++]=injectable.getValue();
    }
    return cip.con.newInstance(params);
  }
}

Fixed version (ground truth):
private T _getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  ConstructorInjectablePair<T> cip=getConstructor();
  if (cip == null || cip.is.isEmpty()) {
    return c.newInstance();
  }
 else {
    if (cip.is.contains(null)) {
      for (int i=0; i < cip.is.size(); i++) {
        if (cip.is.get(i) == null) {
          Errors.missingDependency(cip.con,i);
        }
      }
    }
    Object[] params=new Object[cip.is.size()];
    int i=0;
    for (    Injectable injectable : cip.is) {
      if (injectable != null)       params[i++]=injectable.getValue();
    }
    return cip.con.newInstance(params);
  }
}
Program: 51082
Project: 51082
Buggy source:
public int compare(ConstructorInjectablePair<T> o1,ConstructorInjectablePair<T> o2){
  int p=Collections.frequency(o1.is,null) - Collections.frequency(o2.is,null);
  if (p != 0)   return p;
  return o2.con.getParameterTypes().length - o1.con.getParameterTypes().length;
}

Fixed version (ground truth):
@Override public int compare(ConstructorInjectablePair<T> o1,ConstructorInjectablePair<T> o2){
  int p=Collections.frequency(o1.is,null) - Collections.frequency(o2.is,null);
  if (p != 0)   return p;
  return o2.con.getParameterTypes().length - o1.con.getParameterTypes().length;
}
Program: 51083
Project: 51083
Buggy source:
public ComponentConstructor(InjectableProviderContext ipc,Class<T> c,ComponentInjector<T> ci){
  this.ipc=ipc;
  this.c=c;
  this.ci=ci;
  this.postConstruct=getPostConstructMethod(c);
}

Fixed version (ground truth):
public ComponentConstructor(InjectableProviderContext ipc,Class<T> c,ComponentInjector<T> ci){
  this.ipc=ipc;
  this.c=c;
  this.ci=ci;
  this.postConstructs=getPostConstructMethods(c);
}
Program: 51084
Project: 51084
Buggy source:
/** 
 * Get a new instance.
 * @return a new instance.
 */
public T getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  final int modifiers=c.getModifiers();
  if (!Modifier.isPublic(modifiers)) {
    Errors.nonPublicClass(c);
  }
  if (Modifier.isAbstract(modifiers)) {
    if (Modifier.isInterface(modifiers)) {
      Errors.interfaceClass(c);
    }
 else {
      Errors.abstractClass(c);
    }
  }
  if (c.getEnclosingClass() != null && !Modifier.isStatic(modifiers)) {
    Errors.innerClass(c);
  }
  if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers)) {
    if (c.getConstructors().length == 0) {
      Errors.nonPublicConstructor(c);
    }
  }
  final T t=_getInstance();
  ci.inject(t);
  if (postConstruct != null)   postConstruct.invoke(t);
  return t;
}

Fixed version (ground truth):
/** 
 * Get a new instance.
 * @return a new instance.
 */
public T getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  final int modifiers=c.getModifiers();
  if (!Modifier.isPublic(modifiers)) {
    Errors.nonPublicClass(c);
  }
  if (Modifier.isAbstract(modifiers)) {
    if (Modifier.isInterface(modifiers)) {
      Errors.interfaceClass(c);
    }
 else {
      Errors.abstractClass(c);
    }
  }
  if (c.getEnclosingClass() != null && !Modifier.isStatic(modifiers)) {
    Errors.innerClass(c);
  }
  if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers)) {
    if (c.getConstructors().length == 0) {
      Errors.nonPublicConstructor(c);
    }
  }
  final T t=_getInstance();
  ci.inject(t);
  for (  Method postConstruct : postConstructs) {
    postConstruct.invoke(t);
  }
  return t;
}
Program: 51085
Project: 51085
Buggy source:
public void destroy(Object o) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  if (preDestroy != null)   preDestroy.invoke(o);
}

Fixed version (ground truth):
public void destroy(Object o) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  for (  Method preDestroy : preDestroys) {
    preDestroy.invoke(o);
  }
}
Program: 51086
Project: 51086
Buggy source:
/** 
 * Create a component destructor.
 * @param c the class of instances to destruct.
 */
public ComponentDestructor(Class c){
  this.preDestroy=getPreDestroyMethod(c);
}

Fixed version (ground truth):
/** 
 * Create a component destructor.
 * @param c the class of instances to destruct.
 */
public ComponentDestructor(Class c){
  this.preDestroys=getPreDestroyMethods(c);
}
Program: 51087
Project: 51087
Buggy source:
public MultivaluedParameterExtractor getWithoutDefaultValue(Parameter p){
  return process(w,null,p.getParameterClass(),p.getParameterType(),p.getAnnotations(),p.getSourceName());
}

Fixed version (ground truth):
@Override public MultivaluedParameterExtractor getWithoutDefaultValue(Parameter p){
  return process(w,null,p.getParameterClass(),p.getParameterType(),p.getAnnotations(),p.getSourceName());
}
Program: 51088
Project: 51088
Buggy source:
public MultivaluedParameterExtractor get(Parameter p){
  return process(w,p.getDefaultValue(),p.getParameterClass(),p.getParameterType(),p.getAnnotations(),p.getSourceName());
}

Fixed version (ground truth):
@Override public MultivaluedParameterExtractor get(Parameter p){
  return process(w,p.getDefaultValue(),p.getParameterClass(),p.getParameterType(),p.getAnnotations(),p.getSourceName());
}
Program: 51089
Project: 51089
Buggy source:
public String getName(){
  return parameter;
}

Fixed version (ground truth):
@Override public String getName(){
  return parameter;
}
Program: 51090
Project: 51090
Buggy source:
public Object extract(MultivaluedMap<String,String> parameters){
  String v=parameters.getFirst(parameter);
  if (v != null && !v.trim().isEmpty()) {
    return getValue(v);
  }
 else   if (defaultValue != null) {
    return defaultValue;
  }
  return defaultDefaultValue;
}

Fixed version (ground truth):
@Override public Object extract(MultivaluedMap<String,String> parameters){
  String v=parameters.getFirst(parameter);
  if (v != null && !v.trim().isEmpty()) {
    return getValue(v);
  }
 else   if (defaultValue != null) {
    return defaultValue;
  }
  return defaultDefaultValue;
}
Program: 51091
Project: 51091
Buggy source:
public String getDefaultStringValue(){
  return defaultStringValue;
}

Fixed version (ground truth):
@Override public String getDefaultStringValue(){
  return defaultStringValue;
}
Program: 51092
Project: 51092
Buggy source:
private static void workOutPostConstructPreDestroy(AbstractResource resource){
  Class postConstruct=ReflectionHelper.classForName("String_Node_Str");
  if (postConstruct == null)   return;
  Class preDestroy=ReflectionHelper.classForName("String_Node_Str");
  final MethodList methodList=new MethodList(resource.getResourceClass(),true);
  for (  AnnotatedMethod m : methodList.hasAnnotation(postConstruct).hasNumParams(0).hasReturnType(void.class)) {
    ReflectionHelper.setAccessibleMethod(m.getMethod());
    resource.getPostConstructMethods().add(m.getMethod());
  }
  for (  AnnotatedMethod m : methodList.hasAnnotation(preDestroy).hasNumParams(0).hasReturnType(void.class)) {
    ReflectionHelper.setAccessibleMethod(m.getMethod());
    resource.getPreDestroyMethods().add(m.getMethod());
  }
}

Fixed version (ground truth):
private static void workOutPostConstructPreDestroy(AbstractResource resource){
  Class postConstruct=ReflectionHelper.classForName("String_Node_Str");
  if (postConstruct == null)   return;
  Class preDestroy=ReflectionHelper.classForName("String_Node_Str");
  final MethodList methodList=new MethodList(resource.getResourceClass(),true);
  HashSet<String> names=new HashSet<String>();
  for (  AnnotatedMethod m : methodList.hasAnnotation(postConstruct).hasNumParams(0).hasReturnType(void.class)) {
    Method method=m.getMethod();
    if (names.add(method.getName())) {
      ReflectionHelper.setAccessibleMethod(method);
      resource.getPostConstructMethods().add(0,method);
    }
  }
  names=new HashSet<String>();
  for (  AnnotatedMethod m : methodList.hasAnnotation(preDestroy).hasNumParams(0).hasReturnType(void.class)) {
    Method method=m.getMethod();
    if (names.add(method.getName())) {
      ReflectionHelper.setAccessibleMethod(method);
      resource.getPreDestroyMethods().add(method);
    }
  }
}
Program: 51093
Project: 51093
Buggy source:
public Object construct(HttpContext hc) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  final Object o=_construct(hc);
  rci.inject(hc,o);
  if (postConstruct != null)   postConstruct.invoke(o);
  return o;
}

Fixed version (ground truth):
public Object construct(HttpContext hc) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  final Object o=_construct(hc);
  rci.inject(hc,o);
  for (  Method postConstruct : postConstructs) {
    postConstruct.invoke(o);
  }
  return o;
}
Program: 51094
Project: 51094
Buggy source:
public ResourceComponentConstructor(ServerInjectableProviderContext sipc,ComponentScope scope,AbstractResource ar){
  this.c=ar.getResourceClass();
  final int modifiers=c.getModifiers();
  if (!Modifier.isPublic(modifiers)) {
    Errors.nonPublicClass(c);
  }
  if (Modifier.isAbstract(modifiers)) {
    if (Modifier.isInterface(modifiers)) {
      Errors.interfaceClass(c);
    }
 else {
      Errors.abstractClass(c);
    }
  }
  if (c.getEnclosingClass() != null && !Modifier.isStatic(modifiers)) {
    Errors.innerClass(c);
  }
  if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers)) {
    if (c.getConstructors().length == 0) {
      Errors.nonPublicConstructor(c);
    }
  }
  this.rci=new ResourceComponentInjector(sipc,scope,ar);
  if (ar.getPostConstructMethods().size() > 0) {
    this.postConstruct=ar.getPostConstructMethods().get(0);
  }
 else {
    this.postConstruct=null;
  }
  ConstructorInjectablePair cip=getConstructor(sipc,scope,ar);
  if (cip == null) {
    this.constructor=null;
    this.injectables=null;
  }
 else   if (cip.is.isEmpty()) {
    this.constructor=cip.con;
    this.injectables=null;
  }
 else {
    if (cip.is.contains(null)) {
      for (int i=0; i < cip.is.size(); i++) {
        if (cip.is.get(i) == null) {
          Errors.missingDependency(cip.con,i);
        }
      }
    }
    this.constructor=cip.con;
    this.injectables=AbstractHttpContextInjectable.transform(cip.is);
  }
}

Fixed version (ground truth):
public ResourceComponentConstructor(ServerInjectableProviderContext sipc,ComponentScope scope,AbstractResource ar){
  this.c=ar.getResourceClass();
  final int modifiers=c.getModifiers();
  if (!Modifier.isPublic(modifiers)) {
    Errors.nonPublicClass(c);
  }
  if (Modifier.isAbstract(modifiers)) {
    if (Modifier.isInterface(modifiers)) {
      Errors.interfaceClass(c);
    }
 else {
      Errors.abstractClass(c);
    }
  }
  if (c.getEnclosingClass() != null && !Modifier.isStatic(modifiers)) {
    Errors.innerClass(c);
  }
  if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers)) {
    if (c.getConstructors().length == 0) {
      Errors.nonPublicConstructor(c);
    }
  }
  this.rci=new ResourceComponentInjector(sipc,scope,ar);
  this.postConstructs.addAll(ar.getPostConstructMethods());
  ConstructorInjectablePair cip=getConstructor(sipc,scope,ar);
  if (cip == null) {
    this.constructor=null;
    this.injectables=null;
  }
 else   if (cip.is.isEmpty()) {
    this.constructor=cip.con;
    this.injectables=null;
  }
 else {
    if (cip.is.contains(null)) {
      for (int i=0; i < cip.is.size(); i++) {
        if (cip.is.get(i) == null) {
          Errors.missingDependency(cip.con,i);
        }
      }
    }
    this.constructor=cip.con;
    this.injectables=AbstractHttpContextInjectable.transform(cip.is);
  }
}
Program: 51095
Project: 51095
Buggy source:
public void destroy(Object o) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  if (preDestroy != null)   preDestroy.invoke(o);
}

Fixed version (ground truth):
public void destroy(Object o) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  for (  Method preDestroy : preDestroys) {
    preDestroy.invoke(o);
  }
}
Program: 51096
Project: 51096
Buggy source:
public ResourceComponentDestructor(AbstractResource ar){
  if (ar.getPreDestroyMethods().size() > 0) {
    this.preDestroy=ar.getPreDestroyMethods().get(0);
  }
 else {
    this.preDestroy=null;
  }
}

Fixed version (ground truth):
public ResourceComponentDestructor(AbstractResource ar){
  preDestroys.addAll(ar.getPreDestroyMethods());
}
Program: 51097
Project: 51097
Buggy source:
public static CDIExtension getInitializedExtension(){
  try {
    InitialContext ic=InitialContextHelper.getInitialContext();
    if (ic == null) {
      throw new RuntimeException();
    }
    return (CDIExtension)ic.lookup(JNDI_CDIEXTENSION_NAME);
  }
 catch (  NamingException ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
public static CDIExtension getInitializedExtension(){
  try {
    InitialContext ic=InitialContextHelper.getInitialContext();
    if (ic == null) {
      throw new RuntimeException();
    }
    return (CDIExtension)lookupJerseyConfigJNDIContext(ic).lookup(JNDI_CDIEXTENSION_NAME);
  }
 catch (  NamingException ex) {
    throw new RuntimeException(ex);
  }
}
Program: 51099
Project: 51099
Buggy source:
void lateInitialize(){
  try {
    for (    InitializedLater object : toBeInitializedLater) {
      object.later();
    }
  }
  finally {
    if (!lookupExtensionInBeanManager) {
      try {
        InitialContext ic=InitialContextHelper.getInitialContext();
        if (ic != null) {
          ic.unbind(JNDI_CDIEXTENSION_NAME);
        }
      }
 catch (      NamingException ex) {
        throw new RuntimeException(ex);
      }
    }
  }
}

Fixed version (ground truth):
void lateInitialize(){
  try {
    for (    InitializedLater object : toBeInitializedLater) {
      object.later();
    }
  }
  finally {
    if (!lookupExtensionInBeanManager) {
      try {
        InitialContext ic=InitialContextHelper.getInitialContext();
        if (ic != null) {
          lookupJerseyConfigJNDIContext(ic).unbind(JNDI_CDIEXTENSION_NAME);
        }
      }
 catch (      NamingException ex) {
        throw new RuntimeException(ex);
      }
    }
  }
}
Program: 51100
Project: 51100
Buggy source:
public Object extract(MultivaluedMap<String,String> parameters){
  String v=parameters.getFirst(parameter);
  if (v != null) {
    return getValue(v);
  }
 else   if (defaultValue != null) {
    return defaultValue;
  }
  return defaultDefaultValue;
}

Fixed version (ground truth):
public Object extract(MultivaluedMap<String,String> parameters){
  String v=parameters.getFirst(parameter);
  if (v != null && !v.trim().isEmpty()) {
    return getValue(v);
  }
 else   if (defaultValue != null) {
    return defaultValue;
  }
  return defaultDefaultValue;
}
Program: 51101
Project: 51101
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + getMethod().getDeclaringClass().getSimpleName() + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + getResource().getResourceClass().getSimpleName() + "String_Node_Str";
}
Program: 51102
Project: 51102
Buggy source:
/** 
 * Match a URI against the template. <p> If the URI matches against the pattern then the template variable to value  map will be filled with template variables as keys and template values as  values. <p>
 * @param uri the uri to match against the template.
 * @param groupValues the list to store the values of a pattern's capturing groups is matching is successful. The values are stored  in the same order as the pattern's capturing groups.
 * @return true if the URI matches the template, otherwise false.
 * @throws IllegalArgumentException if the uri ortemplateVariableToValue is null.
 */
public final boolean match(CharSequence uri,List<String> groupValues) throws IllegalArgumentException {
  if (groupValues == null)   throw new IllegalArgumentException();
  return pattern.match(uri,groupValues);
}

Fixed version (ground truth):
/** 
 * Match a URI against the template. <p> If the URI matches against the pattern then the template variable to value  map will be filled with template variables as keys and template values as  values. <p>
 * @param uri the uri to match against the template.
 * @param groupValues the list to store the values of a pattern's capturing groups if matching is successful. The values are stored in the same order as the pattern's capturing groups.
 * @return true if the URI matches the template, otherwise false.
 * @throws IllegalArgumentException if the uri ortemplateVariableToValue is null.
 */
public final boolean match(CharSequence uri,List<String> groupValues) throws IllegalArgumentException {
  if (groupValues == null)   throw new IllegalArgumentException();
  return pattern.match(uri,groupValues);
}
Program: 51103
Project: 51103
Buggy source:
public DefaultClientConfig(Set<Class<?>> cs){
  providers.addAll(cs);
}

Fixed version (ground truth):
/** 
 * Create a new DefaultClientConfig instance
 * @param providers set of provider classes used during request processing.
 */
public DefaultClientConfig(Set<Class<?>> providers){
  this.providers.addAll(providers);
}
Program: 51104
Project: 51104
Buggy source:
public Object getProperty(String propertyName){
  return properties.get(propertyName);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Object getProperty(String propertyName){
  return properties.get(propertyName);
}
Program: 51105
Project: 51105
Buggy source:
public Map<String,Boolean> getFeatures(){
  return features;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Map<String,Boolean> getFeatures(){
  return features;
}
Program: 51106
Project: 51106
Buggy source:
public boolean getPropertyAsFeature(String name){
  Boolean v=(Boolean)getProperties().get(name);
  return (v != null) ? v : false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean getPropertyAsFeature(String name){
  Boolean v=(Boolean)getProperties().get(name);
  return (v != null) ? v : false;
}
Program: 51107
Project: 51107
Buggy source:
public Map<String,Object> getProperties(){
  return properties;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Map<String,Object> getProperties(){
  return properties;
}
Program: 51108
Project: 51108
Buggy source:
public Set<Object> getSingletons(){
  return providerInstances;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Set<Object> getSingletons(){
  return providerInstances;
}