nus-yam/ex-repair huggingface dataset:
Program: 53729
Project: 53729
Buggy source:
private String getRequestParameter(HttpServletRequest request,int eachLimit,int totalLimit){
  Enumeration<?> attrs=request.getParameterNames();
  final StringBuilder params=new StringBuilder(64);
  while (attrs.hasMoreElements()) {
    if (params.length() != 0) {
      params.append('&');
    }
    if (params.length() > totalLimit) {
      params.append("String_Node_Str");
      return params.toString();
    }
    String key=attrs.nextElement().toString();
    params.append(StringUtils.drop(key,eachLimit));
    params.append("String_Node_Str");
    Object value=request.getParameter(key);
    if (value != null) {
      params.append(StringUtils.drop(StringUtils.toString(value),eachLimit));
    }
  }
  return params.toString();
}

Fixed version (ground truth):
private String getRequestParameter(Request request,int eachLimit,int totalLimit){
  Enumeration<?> attrs=request.getParameterNames();
  final StringBuilder params=new StringBuilder(64);
  while (attrs.hasMoreElements()) {
    if (params.length() != 0) {
      params.append('&');
    }
    if (params.length() > totalLimit) {
      params.append("String_Node_Str");
      return params.toString();
    }
    String key=attrs.nextElement().toString();
    params.append(StringUtils.drop(key,eachLimit));
    params.append("String_Node_Str");
    Object value=request.getParameter(key);
    if (value != null) {
      params.append(StringUtils.drop(StringUtils.toString(value),eachLimit));
    }
  }
  return params.toString();
}
Program: 53731
Project: 53731
Buggy source:
private void setTraceMetadata(final HttpServletRequest request,final Trace trace){
  if (traceAccessor.isApplicable(request)) {
    traceAccessor.set(request,trace);
  }
}

Fixed version (ground truth):
private void setTraceMetadata(final Request request,final Trace trace){
  if (traceAccessor.isApplicable(request)) {
    traceAccessor.set(request,trace);
  }
}
Program: 53732
Project: 53732
Buggy source:
private void recordRootSpan(final SpanRecorder recorder,final HttpServletRequest request){
  recorder.recordServiceType(JettyConstants.JETTY);
  final String requestURL=request.getRequestURI();
  recorder.recordRpcName(requestURL);
  final int port=request.getServerPort();
  final String endPoint=request.getServerName() + "String_Node_Str" + port;
  recorder.recordEndPoint(endPoint);
  final String remoteAddr=request.getRemoteAddr();
  recorder.recordRemoteAddress(remoteAddr);
  if (!recorder.isRoot()) {
    recordParentInfo(recorder,request);
  }
  recorder.recordApi(JETTY_SYNC_API_TAG);
}

Fixed version (ground truth):
private void recordRootSpan(final SpanRecorder recorder,final Request request){
  recorder.recordServiceType(JettyConstants.JETTY);
  final String requestURL=request.getRequestURI();
  recorder.recordRpcName(requestURL);
  final int port=request.getServerPort();
  final String endPoint=request.getServerName() + "String_Node_Str" + port;
  recorder.recordEndPoint(endPoint);
  final String remoteAddr=request.getRemoteAddr();
  recorder.recordRemoteAddress(remoteAddr);
  if (!recorder.isRoot()) {
    recordParentInfo(recorder,request);
  }
  recorder.recordApi(JETTY_SYNC_API_TAG);
}
Program: 53733
Project: 53733
Buggy source:
private boolean samplingEnable(HttpServletRequest request){
  final String samplingFlag=request.getHeader(Header.HTTP_SAMPLED.toString());
  if (isDebug) {
    logger.debug("String_Node_Str",samplingFlag);
  }
  return SamplingFlagUtils.isSamplingFlag(samplingFlag);
}

Fixed version (ground truth):
private boolean samplingEnable(Request request){
  final String samplingFlag=request.getHeader(Header.HTTP_SAMPLED.toString());
  if (isDebug) {
    logger.debug("String_Node_Str",samplingFlag);
  }
  return SamplingFlagUtils.isSamplingFlag(samplingFlag);
}
Program: 53734
Project: 53734
Buggy source:
private void recordParentInfo(SpanRecorder recorder,HttpServletRequest request){
  String parentApplicationName=request.getHeader(Header.HTTP_PARENT_APPLICATION_NAME.toString());
  if (parentApplicationName != null) {
    final String host=request.getHeader(Header.HTTP_HOST.toString());
    if (host != null) {
      recorder.recordAcceptorHost(host);
    }
 else {
      recorder.recordAcceptorHost(NetworkUtils.getHostFromURL(request.getRequestURL().toString()));
    }
    final String type=request.getHeader(Header.HTTP_PARENT_APPLICATION_TYPE.toString());
    final short parentApplicationType=NumberUtils.parseShort(type,ServiceType.UNDEFINED.getCode());
    recorder.recordParentApplication(parentApplicationName,parentApplicationType);
  }
}

Fixed version (ground truth):
private void recordParentInfo(SpanRecorder recorder,Request request){
  String parentApplicationName=request.getHeader(Header.HTTP_PARENT_APPLICATION_NAME.toString());
  if (parentApplicationName != null) {
    final String host=request.getHeader(Header.HTTP_HOST.toString());
    if (host != null) {
      recorder.recordAcceptorHost(host);
    }
 else {
      recorder.recordAcceptorHost(NetworkUtils.getHostFromURL(request.getRequestURL().toString()));
    }
    final String type=request.getHeader(Header.HTTP_PARENT_APPLICATION_TYPE.toString());
    final short parentApplicationType=NumberUtils.parseShort(type,ServiceType.UNDEFINED.getCode());
    recorder.recordParentApplication(parentApplicationName,parentApplicationType);
  }
}
Program: 53735
Project: 53735
Buggy source:
@Override public void after(Object target,Object[] args,Object result,Throwable throwable){
  if (isDebug) {
    logger.afterInterceptor(target,args,result,throwable);
  }
  final Trace trace=traceContext.currentRawTraceObject();
  if (trace == null) {
    return;
  }
  if (!trace.canSampled()) {
    traceContext.removeTraceObject();
    return;
  }
  try {
    SpanEventRecorder recorder=trace.currentSpanEventRecorder();
    final HttpChannel<?> channel=(HttpChannel<?>)args[0];
    final HttpServletRequest request=(HttpServletRequest)channel.getRequest();
    final String parameters=getRequestParameter(request,64,512);
    if (parameters != null && parameters.length() > 0) {
      recorder.recordAttribute(AnnotationKey.HTTP_PARAM,parameters);
    }
    recorder.recordApi(methodDescriptor);
    recorder.recordException(throwable);
  }
 catch (  Throwable th) {
    if (logger.isWarnEnabled()) {
      logger.warn("String_Node_Str",th.getMessage(),th);
    }
  }
 finally {
    traceContext.removeTraceObject();
    deleteTrace(trace,target,args,result,throwable);
  }
}

Fixed version (ground truth):
@Override public void after(Object target,Object[] args,Object result,Throwable throwable){
  if (isDebug) {
    logger.afterInterceptor(target,args,result,throwable);
  }
  final Trace trace=traceContext.currentRawTraceObject();
  if (trace == null) {
    return;
  }
  if (!trace.canSampled()) {
    traceContext.removeTraceObject();
    return;
  }
  try {
    SpanEventRecorder recorder=trace.currentSpanEventRecorder();
    final HttpChannel<?> channel=(HttpChannel<?>)args[0];
    final Request request=channel.getRequest();
    final String parameters=getRequestParameter(request,64,512);
    if (parameters != null && parameters.length() > 0) {
      recorder.recordAttribute(AnnotationKey.HTTP_PARAM,parameters);
    }
    recorder.recordApi(methodDescriptor);
    recorder.recordException(throwable);
  }
 catch (  Throwable th) {
    if (logger.isWarnEnabled()) {
      logger.warn("String_Node_Str",th.getMessage(),th);
    }
  }
 finally {
    traceContext.removeTraceObject();
    deleteTrace(trace,target,args,result,throwable);
  }
}
Program: 53736
Project: 53736
Buggy source:
private void deleteTrace(Trace trace,Object target,Object[] args,Object result,Throwable throwable){
  trace.traceBlockEnd();
  trace.close();
  final HttpChannel<?> channel=(HttpChannel<?>)args[0];
  final HttpServletRequest request=(HttpServletRequest)channel.getRequest();
  setTraceMetadata(request,null);
}

Fixed version (ground truth):
private void deleteTrace(Trace trace,Object target,Object[] args,Object result,Throwable throwable){
  trace.traceBlockEnd();
  trace.close();
  final HttpChannel<?> channel=(HttpChannel<?>)args[0];
  final Request request=channel.getRequest();
  setTraceMetadata(request,null);
}
Program: 53737
Project: 53737
Buggy source:
/** 
 * Populate source trace from HTTP Header.
 * @param request
 * @return TraceId when it is possible to get a transactionId from Http header. if not possible return null
 */
private TraceId populateTraceIdFromRequest(HttpServletRequest request){
  String transactionId=request.getHeader(Header.HTTP_TRACE_ID.toString());
  if (transactionId != null) {
    long parentSpanID=NumberUtils.parseLong(request.getHeader(Header.HTTP_PARENT_SPAN_ID.toString()),SpanId.NULL);
    long spanID=NumberUtils.parseLong(request.getHeader(Header.HTTP_SPAN_ID.toString()),SpanId.NULL);
    short flags=NumberUtils.parseShort(request.getHeader(Header.HTTP_FLAGS.toString()),(short)0);
    final TraceId id=traceContext.createTraceId(transactionId,parentSpanID,spanID,flags);
    if (isDebug) {
      logger.debug("String_Node_Str",id);
    }
    return id;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Populate source trace from HTTP Header.
 * @param request
 * @return TraceId when it is possible to get a transactionId from Http header. if not possible return null
 */
private TraceId populateTraceIdFromRequest(Request request){
  String transactionId=request.getHeader(Header.HTTP_TRACE_ID.toString());
  if (transactionId != null) {
    long parentSpanID=NumberUtils.parseLong(request.getHeader(Header.HTTP_PARENT_SPAN_ID.toString()),SpanId.NULL);
    long spanID=NumberUtils.parseLong(request.getHeader(Header.HTTP_SPAN_ID.toString()),SpanId.NULL);
    short flags=NumberUtils.parseShort(request.getHeader(Header.HTTP_FLAGS.toString()),(short)0);
    final TraceId id=traceContext.createTraceId(transactionId,parentSpanID,spanID,flags);
    if (isDebug) {
      logger.debug("String_Node_Str",id);
    }
    return id;
  }
 else {
    return null;
  }
}
Program: 53738
Project: 53738
Buggy source:
@Test public void testSerialize() throws Exception {
  PinpointObjectMapper mapper=new PinpointObjectMapper();
  mapper.afterPropertiesSet();
  AgentInfoBo.Builder agentInfoBuilder=new AgentInfoBo.Builder();
  agentInfoBuilder.setAgentId("String_Node_Str");
  agentInfoBuilder.setServiceTypeCode(ServiceType.TEST_STAND_ALONE.getCode());
  agentInfoBuilder.setServiceType(ServiceType.TEST_STAND_ALONE);
  agentInfoBuilder.setHostName("String_Node_Str");
  AgentInfoBo agentInfoBo=agentInfoBuilder.build();
  HashSet<AgentInfoBo> set=new HashSet<AgentInfoBo>();
  set.add(agentInfoBo);
  ServerBuilder builder=new ServerBuilder(null);
  builder.addAgentInfo(set);
  ServerInstanceList serverInstanceList=builder.build();
  ObjectWriter objectWriter=mapper.writerWithDefaultPrettyPrinter();
  String json=objectWriter.writeValueAsString(serverInstanceList);
  logger.debug(json);
}

Fixed version (ground truth):
@Test public void testSerialize() throws Exception {
  PinpointObjectMapper mapper=new PinpointObjectMapper();
  mapper.afterPropertiesSet();
  AgentInfoBo agentInfoBo=ServerInstanceListTest.createAgentInfo("String_Node_Str","String_Node_Str");
  HashSet<AgentInfoBo> agentInfoBoSet=new HashSet<AgentInfoBo>();
  agentInfoBoSet.add(agentInfoBo);
  ServerBuilder builder=new ServerBuilder();
  builder.addAgentInfo(agentInfoBoSet);
  ServerInstanceList serverInstanceList=builder.build();
  ObjectWriter objectWriter=mapper.writerWithDefaultPrettyPrinter();
  String json=objectWriter.writeValueAsString(serverInstanceList);
  logger.debug(json);
}
Program: 53739
Project: 53739
Buggy source:
private String toBindVariable(Map<Integer,String> bindValue){
  final String[] temp=new String[bindValue.size()];
  for (  Map.Entry<Integer,String> entry : bindValue.entrySet()) {
    Integer key=entry.getKey() - 1;
    if (temp.length <= key) {
      continue;
    }
    temp[key]=entry.getValue();
  }
  return BindValueUtils.bindValueToString(temp,maxSqlBindValueLength);
}

Fixed version (ground truth):
private String toBindVariable(Map<Integer,String> bindValue){
  return BindValueUtils.bindValueToString(bindValue,maxSqlBindValueLength);
}
Program: 53740
Project: 53740
Buggy source:
private String toBindVariable(Map<Integer,String> bindValue){
  final String[] temp=new String[bindValue.size()];
  for (  Map.Entry<Integer,String> entry : bindValue.entrySet()) {
    Integer key=entry.getKey() - 1;
    if (temp.length < key) {
      continue;
    }
    temp[key]=entry.getValue();
  }
  return BindValueUtils.bindValueToString(temp,maxSqlBindValueLength);
}

Fixed version (ground truth):
private String toBindVariable(Map<Integer,String> bindValue){
  return BindValueUtils.bindValueToString(bindValue,maxSqlBindValueLength);
}
Program: 53741
Project: 53741
Buggy source:
@Test public void testBindValueToString_null() throws Exception {
  String result=BindValueUtils.bindValueToString(null,10);
  Assert.assertEquals("String_Node_Str",result);
}

Fixed version (ground truth):
@Test public void testBindValueToString_null() throws Exception {
  String result=BindValueUtils.bindValueToString((String[])null,10);
  Assert.assertEquals("String_Node_Str",result);
}
Program: 53742
Project: 53742
Buggy source:
private void recordRootSpan(final Trace trace,final ThriftRequestProperty parentTraceInfo){
  SpanRecorder recorder=trace.getSpanRecorder();
  recorder.markBeforeTime();
  recorder.recordServiceType(THRIFT_SERVER);
  recorder.recordApi(this.thriftServerEntryMethodDescriptor);
  if (!trace.isRoot()) {
    recordParentInfo(recorder,parentTraceInfo);
  }
  trace.traceBlockBegin();
}

Fixed version (ground truth):
private void recordRootSpan(final Trace trace,final ThriftRequestProperty parentTraceInfo){
  SpanRecorder recorder=trace.getSpanRecorder();
  recorder.markBeforeTime();
  recorder.recordServiceType(THRIFT_SERVER);
  recorder.recordApi(this.thriftServerEntryMethodDescriptor);
  if (!trace.isRoot()) {
    recordParentInfo(recorder,parentTraceInfo);
  }
}
Program: 53743
Project: 53743
Buggy source:
private void appendServerInfo(Node node,LinkDataDuplexMap linkDataDuplexMap,AgentInfoService agentInfoService){
  final ServiceType nodeServiceType=node.getServiceType();
  if (nodeServiceType.isUnknown()) {
    return;
  }
  if (nodeServiceType.isTerminal()) {
    ServerBuilder builder=new ServerBuilder(matcherGroup);
    for (    LinkData linkData : linkDataDuplexMap.getSourceLinkDataList()) {
      Application toApplication=linkData.getToApplication();
      if (node.getApplication().equals(toApplication)) {
        builder.addCallHistogramList(linkData.getTargetList());
      }
    }
    ServerInstanceList serverInstanceList=builder.build();
    node.setServerInstanceList(serverInstanceList);
  }
 else   if (nodeServiceType.isWas()) {
    Set<AgentInfoBo> agentList=agentInfoService.selectAgent(node.getApplication().getName(),range);
    if (agentList.isEmpty()) {
      return;
    }
    logger.debug("String_Node_Str",node.getApplication(),agentList);
    ServerBuilder builder=new ServerBuilder(matcherGroup);
    agentList=filterAgentInfoByResponseData(agentList,node);
    builder.addAgentInfo(agentList);
    ServerInstanceList serverInstanceList=builder.build();
    node.setServerInstanceList(serverInstanceList);
  }
 else {
    node.setServerInstanceList(new ServerInstanceList());
  }
}

Fixed version (ground truth):
private void appendServerInfo(Node node,LinkDataDuplexMap linkDataDuplexMap,AgentInfoService agentInfoService){
  final ServiceType nodeServiceType=node.getServiceType();
  if (nodeServiceType.isUnknown()) {
    return;
  }
  if (nodeServiceType.isTerminal()) {
    ServerBuilder builder=new ServerBuilder(matcherGroup);
    for (    LinkData linkData : linkDataDuplexMap.getSourceLinkDataList()) {
      Application toApplication=linkData.getToApplication();
      if (node.getApplication().equals(toApplication)) {
        builder.addCallHistogramList(linkData.getTargetList());
      }
    }
    ServerInstanceList serverInstanceList=builder.build();
    node.setServerInstanceList(serverInstanceList);
  }
 else   if (nodeServiceType.isWas()) {
    Set<AgentInfoBo> agentList=agentInfoService.selectAgent(node.getApplication().getName(),range);
    if (agentList.isEmpty()) {
      logger.warn("String_Node_Str",node.getApplication());
      node.setServerInstanceList(new ServerInstanceList());
      return;
    }
    logger.debug("String_Node_Str",node.getApplication(),agentList);
    ServerBuilder builder=new ServerBuilder(matcherGroup);
    agentList=filterAgentInfoByResponseData(agentList,node);
    builder.addAgentInfo(agentList);
    ServerInstanceList serverInstanceList=builder.build();
    node.setServerInstanceList(serverInstanceList);
  }
 else {
    node.setServerInstanceList(new ServerInstanceList());
  }
}
Program: 53744
Project: 53744
Buggy source:
public void setServerInstanceList(ServerInstanceList serverInstanceList){
  this.serverInstanceList=serverInstanceList;
}

Fixed version (ground truth):
public void setServerInstanceList(ServerInstanceList serverInstanceList){
  if (serverInstanceList == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.serverInstanceList=serverInstanceList;
}
Program: 53745
Project: 53745
Buggy source:
private String getExceptionStackTrace(Throwable throwable){
  if (throwable == null) {
    return UNKNOWN;
  }
  StringBuilder stackTrace=new StringBuilder(128);
  stackTrace.append(throwable.toString()).append("String_Node_Str");
  for (  StackTraceElement traceElement : throwable.getStackTrace()) {
    stackTrace.append("String_Node_Str" + traceElement.toString()).append("String_Node_Str");
  }
  return stackTrace.toString();
}

Fixed version (ground truth):
private String getExceptionStackTrace(Throwable throwable){
  if (throwable == null) {
    return UNKNOWN;
  }
  StringBuilder stackTrace=new StringBuilder(128);
  stackTrace.append(throwable.toString());
  stackTrace.append("String_Node_Str");
  for (  StackTraceElement traceElement : throwable.getStackTrace()) {
    stackTrace.append("String_Node_Str" + traceElement.toString());
    stackTrace.append("String_Node_Str");
  }
  return stackTrace.toString();
}
Program: 53746
Project: 53746
Buggy source:
@ExceptionHandler(value=Exception.class) public ModelAndView defaultErrorHandler(HttpServletRequest request,Exception exception) throws Exception {
  ModelAndView mav=new ModelAndView();
  mav.addObject("String_Node_Str",createExceptionResource(request,exception));
  mav.setViewName(DEFAULT_ERROR_VIEW);
  return mav;
}

Fixed version (ground truth):
@ExceptionHandler(value=Exception.class) public ModelAndView defaultErrorHandler(HttpServletRequest request,Exception exception) throws Exception {
  logger.warn("String_Node_Str",exception.getMessage(),exception);
  ModelAndView mav=new ModelAndView();
  mav.addObject("String_Node_Str",createExceptionResource(request,exception));
  mav.setViewName(DEFAULT_ERROR_VIEW);
  return mav;
}
Program: 53747
Project: 53747
Buggy source:
@Override public void serialize(Link link,JsonGenerator jgen,SerializerProvider provider) throws IOException, JsonProcessingException {
  jgen.writeStartObject();
  jgen.writeStringField("String_Node_Str",link.getLinkName());
  jgen.writeStringField("String_Node_Str",link.getFrom().getNodeName());
  jgen.writeStringField("String_Node_Str",link.getTo().getNodeName());
  writeSimpleNode("String_Node_Str",link.getFrom(),jgen);
  writeSimpleNode("String_Node_Str",link.getTo(),jgen);
  Application filterApplication=link.getFilterApplication();
  jgen.writeStringField("String_Node_Str",filterApplication.getName());
  jgen.writeNumberField("String_Node_Str",filterApplication.getServiceTypeCode());
  jgen.writeStringField("String_Node_Str",filterApplication.getServiceType().getName());
  if (link.isWasToWasLink()) {
    writeWasToWasTargetRpcList(link,jgen);
  }
  Histogram histogram=link.getHistogram();
  jgen.writeNumberField("String_Node_Str",histogram.getTotalCount());
  jgen.writeNumberField("String_Node_Str",histogram.getErrorCount());
  jgen.writeNumberField("String_Node_Str",histogram.getSlowCount());
  jgen.writeObjectField("String_Node_Str",histogram);
  writeAgentHistogram("String_Node_Str",link.getSourceList(),jgen);
  writeAgentHistogram("String_Node_Str",link.getTargetList(),jgen);
  writeTimeSeriesHistogram(link,jgen);
  writeSourceAgentTimeSeriesHistogram(link,jgen);
  jgen.writeBooleanField("String_Node_Str",link.getLinkAlert());
  jgen.writeEndObject();
}

Fixed version (ground truth):
@Override public void serialize(Link link,JsonGenerator jgen,SerializerProvider provider) throws IOException, JsonProcessingException {
  jgen.writeStartObject();
  jgen.writeStringField("String_Node_Str",link.getLinkName());
  jgen.writeStringField("String_Node_Str",link.getFrom().getNodeName());
  jgen.writeStringField("String_Node_Str",link.getTo().getNodeName());
  writeAgentId("String_Node_Str",link.getFrom(),jgen);
  writeAgentId("String_Node_Str",link.getTo(),jgen);
  writeSimpleNode("String_Node_Str",link.getFrom(),jgen);
  writeSimpleNode("String_Node_Str",link.getTo(),jgen);
  Application filterApplication=link.getFilterApplication();
  jgen.writeStringField("String_Node_Str",filterApplication.getName());
  jgen.writeNumberField("String_Node_Str",filterApplication.getServiceTypeCode());
  jgen.writeStringField("String_Node_Str",filterApplication.getServiceType().getName());
  if (link.isWasToWasLink()) {
    writeWasToWasTargetRpcList(link,jgen);
  }
  Histogram histogram=link.getHistogram();
  jgen.writeNumberField("String_Node_Str",histogram.getTotalCount());
  jgen.writeNumberField("String_Node_Str",histogram.getErrorCount());
  jgen.writeNumberField("String_Node_Str",histogram.getSlowCount());
  jgen.writeObjectField("String_Node_Str",histogram);
  writeAgentHistogram("String_Node_Str",link.getSourceList(),jgen);
  writeAgentHistogram("String_Node_Str",link.getTargetList(),jgen);
  writeTimeSeriesHistogram(link,jgen);
  writeSourceAgentTimeSeriesHistogram(link,jgen);
  jgen.writeBooleanField("String_Node_Str",link.getLinkAlert());
  jgen.writeEndObject();
}
Program: 53750
Project: 53750
Buggy source:
@Override public boolean hasField(String name,String type){
  try {
    ctClass.getField(name,type);
  }
 catch (  NotFoundException e) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean hasField(String name,String type){
  try {
    ctClass.getField(name,JavaAssistUtils.toJvmSignature(type));
  }
 catch (  NotFoundException e) {
    return false;
  }
  return true;
}
Program: 53751
Project: 53751
Buggy source:
static String toJvmSignature(String javaType){
  if (javaType == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (javaType.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final int javaObjectArraySize=getJavaObjectArraySize(javaType);
  final int javaArrayLength=javaObjectArraySize * 2;
  String pureJavaType;
  if (javaObjectArraySize != 0) {
    pureJavaType=javaType.substring(0,javaType.length() - javaArrayLength);
  }
 else {
    pureJavaType=javaType;
  }
  final String signature=PRIMITIVE_JAVA_TO_JVM.get(pureJavaType);
  if (signature != null) {
    return appendJvmArray(signature,javaObjectArraySize);
  }
  return toJvmObject(javaObjectArraySize,pureJavaType);
}

Fixed version (ground truth):
public static String toJvmSignature(String javaType){
  if (javaType == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (javaType.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final int javaObjectArraySize=getJavaObjectArraySize(javaType);
  final int javaArrayLength=javaObjectArraySize * 2;
  String pureJavaType;
  if (javaObjectArraySize != 0) {
    pureJavaType=javaType.substring(0,javaType.length() - javaArrayLength);
  }
 else {
    pureJavaType=javaType;
  }
  final String signature=PRIMITIVE_JAVA_TO_JVM.get(pureJavaType);
  if (signature != null) {
    return appendJvmArray(signature,javaObjectArraySize);
  }
  return toJvmObject(javaObjectArraySize,pureJavaType);
}
Program: 53752
Project: 53752
Buggy source:
@Test public void testWriteValue() throws Exception {
  ObjectMapper mapper=new ObjectMapper();
  __POJO pojo=new __POJO();
  pojo.setName("String_Node_Str");
  String jsonStr=mapper.writeValueAsString(pojo);
  byte[] jsonByte=mapper.writeValueAsBytes(pojo);
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache(System.out);
  verifier.printBlocks(System.out);
  Constructor<?> omConstructor=ObjectMapper.class.getConstructor();
  Method writeval1=ObjectMapper.class.getMethod("String_Node_Str",Object.class);
  Method writeval2=ObjectMapper.class.getMethod("String_Node_Str",Object.class);
  ExpectedAnnotation length=annotation("String_Node_Str",18);
  verifier.verifyApi("String_Node_Str",omConstructor);
  verifier.verifyTraceBlock(BlockType.EVENT,"String_Node_Str",writeval1,null,null,null,null,length);
  verifier.verifyTraceBlock(BlockType.EVENT,"String_Node_Str",writeval2,null,null,null,null,length);
  verifier.verifyTraceBlockCount(0);
}

Fixed version (ground truth):
@Test public void testWriteValue() throws Exception {
  ObjectMapper mapper=new ObjectMapper();
  __POJO pojo=new __POJO();
  pojo.setName("String_Node_Str");
  String jsonStr=mapper.writeValueAsString(pojo);
  byte[] jsonByte=mapper.writeValueAsBytes(pojo);
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache(System.out);
  verifier.printBlocks(System.out);
  Constructor<?> omConstructor=ObjectMapper.class.getConstructor(JsonFactory.class,DefaultSerializerProvider.class,DefaultDeserializationContext.class);
  Constructor<?> omConstructor1=ObjectMapper.class.getConstructor();
  Method writeval1=ObjectMapper.class.getMethod("String_Node_Str",Object.class);
  Method writeval2=ObjectMapper.class.getMethod("String_Node_Str",Object.class);
  ExpectedAnnotation length=annotation("String_Node_Str",18);
  verifier.verifyApi("String_Node_Str",omConstructor);
  verifier.verifyApi("String_Node_Str",omConstructor1);
  verifier.verifyTraceBlock(BlockType.EVENT,"String_Node_Str",writeval1,null,null,null,null,length);
  verifier.verifyTraceBlock(BlockType.EVENT,"String_Node_Str",writeval2,null,null,null,null,length);
  verifier.verifyTraceBlockCount(0);
}
Program: 53753
Project: 53753
Buggy source:
@Test public void testConstructor() throws Exception {
  ObjectMapper mapper1=new ObjectMapper();
  ObjectMapper mapper2=new ObjectMapper(new JsonFactory());
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache(System.out);
  verifier.printBlocks(System.out);
  Constructor<?> omConstructor1=ObjectMapper.class.getConstructor();
  Constructor<?> omConstructor2=ObjectMapper.class.getConstructor(JsonFactory.class);
  verifier.verifyApi("String_Node_Str",omConstructor1);
  verifier.verifyApi("String_Node_Str",omConstructor2);
  verifier.verifyTraceBlockCount(0);
}

Fixed version (ground truth):
@Test public void testConstructor() throws Exception {
  ObjectMapper mapper1=new ObjectMapper();
  ObjectMapper mapper2=new ObjectMapper(new JsonFactory());
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache(System.out);
  verifier.printBlocks(System.out);
  Constructor<?> omConstructor=ObjectMapper.class.getConstructor(JsonFactory.class,DefaultSerializerProvider.class,DefaultDeserializationContext.class);
  Constructor<?> omConstructor1=ObjectMapper.class.getConstructor();
  Constructor<?> omConstructor2=ObjectMapper.class.getConstructor(JsonFactory.class);
  verifier.verifyApi("String_Node_Str",omConstructor);
  verifier.verifyApi("String_Node_Str",omConstructor1);
  verifier.verifyApi("String_Node_Str",omConstructor);
  verifier.verifyApi("String_Node_Str",omConstructor2);
  verifier.verifyTraceBlockCount(0);
}
Program: 53754
Project: 53754
Buggy source:
@Test public void testReadValue() throws Exception {
  ObjectMapper mapper=new ObjectMapper();
  String json_str="String_Node_Str";
  byte[] json_b=json_str.getBytes("String_Node_Str");
  __POJO pojo=mapper.readValue(json_str,__POJO.class);
  pojo=mapper.readValue(json_b,__POJO.class);
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache(System.out);
  verifier.printBlocks(System.out);
  Constructor<?> omConstructor=ObjectMapper.class.getConstructor();
  Method readval1=ObjectMapper.class.getMethod("String_Node_Str",String.class,Class.class);
  Method readval2=ObjectMapper.class.getMethod("String_Node_Str",byte[].class,Class.class);
  ExpectedAnnotation length=annotation("String_Node_Str",20);
  verifier.verifyApi("String_Node_Str",omConstructor);
  verifier.verifyTraceBlock(BlockType.EVENT,"String_Node_Str",readval1,null,null,null,null,length);
  verifier.verifyTraceBlock(BlockType.EVENT,"String_Node_Str",readval2,null,null,null,null,length);
  verifier.verifyTraceBlockCount(0);
}

Fixed version (ground truth):
@Test public void testReadValue() throws Exception {
  ObjectMapper mapper=new ObjectMapper();
  String json_str="String_Node_Str";
  byte[] json_b=json_str.getBytes("String_Node_Str");
  __POJO pojo=mapper.readValue(json_str,__POJO.class);
  pojo=mapper.readValue(json_b,__POJO.class);
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache(System.out);
  verifier.printBlocks(System.out);
  Constructor<?> omConstructor=ObjectMapper.class.getConstructor(JsonFactory.class,DefaultSerializerProvider.class,DefaultDeserializationContext.class);
  Constructor<?> omConstructor1=ObjectMapper.class.getConstructor();
  Method readval1=ObjectMapper.class.getMethod("String_Node_Str",String.class,Class.class);
  Method readval2=ObjectMapper.class.getMethod("String_Node_Str",byte[].class,Class.class);
  ExpectedAnnotation length=annotation("String_Node_Str",20);
  verifier.verifyApi("String_Node_Str",omConstructor);
  verifier.verifyApi("String_Node_Str",omConstructor1);
  verifier.verifyTraceBlock(BlockType.EVENT,"String_Node_Str",readval1,null,null,null,null,length);
  verifier.verifyTraceBlock(BlockType.EVENT,"String_Node_Str",readval2,null,null,null,null,length);
  verifier.verifyTraceBlockCount(0);
}
Program: 53755
Project: 53755
Buggy source:
@Override public void after(Object target,Object[] args,Object result,Throwable throwable){
  if (isDebug) {
    logger.afterInterceptor(target,args);
  }
  Trace trace=traceContext.currentTraceObject();
  if (trace == null) {
    return;
  }
  try {
    trace.recordApi(descriptor);
    trace.recordException(throwable);
    if (args[0] instanceof String) {
      trace.recordAttribute(ANNOTATION_KEY_LENGTH_VALUE,((String)args[0]).length());
    }
 else     if (args[0] instanceof byte[]) {
      trace.recordAttribute(ANNOTATION_KEY_LENGTH_VALUE,(new String((byte[])args[0])).length());
    }
 else     if (args[0] instanceof File) {
      trace.recordAttribute(ANNOTATION_KEY_LENGTH_VALUE,((File)args[0]).length());
    }
    trace.markAfterTime();
  }
  finally {
    trace.traceBlockEnd();
  }
}

Fixed version (ground truth):
@Override public void after(Object target,Object[] args,Object result,Throwable throwable){
  if (isDebug) {
    logger.afterInterceptor(target,args);
  }
  Trace trace=traceContext.currentTraceObject();
  if (trace == null) {
    return;
  }
  try {
    trace.recordApi(descriptor);
    trace.recordException(throwable);
    if (args[0] instanceof String) {
      trace.recordAttribute(ANNOTATION_KEY_LENGTH_VALUE,((String)args[0]).length());
    }
 else     if (args[0] instanceof byte[]) {
      trace.recordAttribute(ANNOTATION_KEY_LENGTH_VALUE,((byte[])args[0]).length);
    }
 else     if (args[0] instanceof File) {
      trace.recordAttribute(ANNOTATION_KEY_LENGTH_VALUE,((File)args[0]).length());
    }
    trace.markAfterTime();
  }
  finally {
    trace.traceBlockEnd();
  }
}
Program: 53756
Project: 53756
Buggy source:
@Test public void jsonToArrayTest() throws Exception {
  Method fromObject=JSONArray.class.getMethod("String_Node_Str",Object.class);
  Method toArray=JSONArray.class.getMethod("String_Node_Str",JSONArray.class);
  Method toString=JSONArray.class.getMethod("String_Node_Str");
  Method toCollection=JSONArray.class.getMethod("String_Node_Str",JSONArray.class);
  Method toList=JSONArray.class.getMethod("String_Node_Str",JSONArray.class);
  String test="String_Node_Str";
  JSONArray jsn=JSONArray.fromObject(test);
  toArray.invoke(null,jsn);
  jsn.toString();
  toCollection.invoke(null,jsn);
  toList.invoke(null,jsn);
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache(System.out);
  verifier.printBlocks(System.out);
  verifier.verifyApi("String_Node_Str",fromObject);
  verifier.verifyApi("String_Node_Str",toArray);
  verifier.verifyApi("String_Node_Str",toString);
  verifier.verifyApi("String_Node_Str",toCollection);
  verifier.verifyApi("String_Node_Str",toList);
  verifier.verifyTraceBlockCount(0);
}

Fixed version (ground truth):
@Test public void jsonToArrayTest() throws Exception {
  Method fromObject=JSONArray.class.getMethod("String_Node_Str",Object.class);
  Method toArray=JSONArray.class.getMethod("String_Node_Str",JSONArray.class);
  Method toString=JSONArray.class.getMethod("String_Node_Str");
  Method toCollection=null;
  try {
    toCollection=JSONArray.class.getMethod("String_Node_Str",JSONArray.class);
  }
 catch (  NoSuchMethodException e) {
  }
  Method toList=JSONArray.class.getMethod("String_Node_Str",JSONArray.class);
  String test="String_Node_Str";
  JSONArray jsn=JSONArray.fromObject(test);
  toArray.invoke(null,jsn);
  jsn.toString();
  if (toCollection != null) {
    toCollection.invoke(null,jsn);
  }
  toList.invoke(null,jsn);
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache(System.out);
  verifier.printBlocks(System.out);
  verifier.verifyApi("String_Node_Str",fromObject);
  verifier.verifyApi("String_Node_Str",toArray);
  verifier.verifyApi("String_Node_Str",toString);
  if (toCollection != null) {
    verifier.verifyApi("String_Node_Str",toCollection);
  }
  verifier.verifyApi("String_Node_Str",toList);
  verifier.verifyTraceBlockCount(0);
}
Program: 53758
Project: 53758
Buggy source:
public AbstractPinpointPluginTestSuite(Class<?> testClass) throws InitializationError, ArtifactResolutionException, DependencyResolutionException {
  super(testClass,Collections.<Runner>emptyList());
  PinpointAgent agent=testClass.getAnnotation(PinpointAgent.class);
  this.agentJar=resolveAgentPath(agent);
  PinpointConfig config=testClass.getAnnotation(PinpointConfig.class);
  this.configFile=config == null ? null : resolveConfigFileLocation(config.value());
  JvmArgument jvmArgument=testClass.getAnnotation(JvmArgument.class);
  this.jvmArguments=jvmArgument == null ? new String[0] : jvmArgument.value();
  JvmVersion jvmVersion=testClass.getAnnotation(JvmVersion.class);
  this.jvmVersions=jvmVersion == null ? DEFAULT_JVM_VERSIONS : jvmVersion.value();
  this.requiredLibraries=resolveRequiredLibraries();
  this.testClassLocation=resolveTestClassLocation(testClass);
  this.debug=isDebugMode();
}

Fixed version (ground truth):
public AbstractPinpointPluginTestSuite(Class<?> testClass) throws InitializationError, ArtifactResolutionException, DependencyResolutionException {
  super(testClass,Collections.<Runner>emptyList());
  PinpointAgent agent=testClass.getAnnotation(PinpointAgent.class);
  this.agentJar=resolveAgentPath(agent);
  PinpointConfig config=testClass.getAnnotation(PinpointConfig.class);
  this.configFile=config == null ? null : resolveConfigFileLocation(config.value());
  JvmArgument jvmArgument=testClass.getAnnotation(JvmArgument.class);
  this.jvmArguments=jvmArgument == null ? new String[0] : jvmArgument.value();
  JvmVersion jvmVersion=testClass.getAnnotation(JvmVersion.class);
  this.jvmVersions=jvmVersion == null ? new int[]{NO_JVM_VERSION} : jvmVersion.value();
  this.requiredLibraries=resolveRequiredLibraries();
  this.testClassLocation=resolveTestClassLocation(testClass);
  this.debug=isDebugMode();
}
Program: 53759
Project: 53759
Buggy source:
protected String getJavaExecutable(Integer version){
  StringBuilder builder=new StringBuilder();
  String javaHome;
  if (version == null) {
    javaHome=SystemProperty.INSTANCE.getProperty("String_Node_Str");
  }
 else {
    String envName="String_Node_Str" + version + "String_Node_Str";
    javaHome=SystemProperty.INSTANCE.getEnv(envName);
  }
  if (javaHome == null) {
    return null;
  }
  builder.append(javaHome);
  builder.append(File.separatorChar);
  builder.append("String_Node_Str");
  builder.append(File.separatorChar);
  builder.append("String_Node_Str");
  if (SystemProperty.INSTANCE.getProperty("String_Node_Str").contains("String_Node_Str")) {
    builder.append("String_Node_Str");
  }
  return builder.toString();
}

Fixed version (ground truth):
protected String getJavaExecutable(int version){
  StringBuilder builder=new StringBuilder();
  String javaHome;
  if (version == NO_JVM_VERSION) {
    javaHome=SystemProperty.INSTANCE.getProperty("String_Node_Str");
  }
 else {
    String envName="String_Node_Str" + version + "String_Node_Str";
    javaHome=SystemProperty.INSTANCE.getEnv(envName);
  }
  if (javaHome == null) {
    return null;
  }
  builder.append(javaHome);
  builder.append(File.separatorChar);
  builder.append("String_Node_Str");
  builder.append(File.separatorChar);
  builder.append("String_Node_Str");
  if (SystemProperty.INSTANCE.getProperty("String_Node_Str").contains("String_Node_Str")) {
    builder.append("String_Node_Str");
  }
  return builder.toString();
}
Program: 53760
Project: 53760
Buggy source:
@Override protected List<Runner> getChildren(){
  List<Runner> runners=new ArrayList<Runner>();
  try {
    for (    int ver : jvmVersions) {
      String javaExe=getJavaExecutable(ver);
      if (javaExe == null) {
        System.out.println("String_Node_Str" + ver + "String_Node_Str"+ ver);
        continue;
      }
      PinpointPluginTestContext context=new PinpointPluginTestContext(agentJar,configFile,requiredLibraries,getTestClass().getJavaClass(),testClassLocation,jvmArguments,debug,ver,javaExe);
      List<PinpointPluginTestInstance> cases=createTestCases(context);
      for (      PinpointPluginTestInstance c : cases) {
        runners.add(new PinpointPluginTestRunner(context,c));
      }
    }
  }
 catch (  Exception e) {
    System.out.println(e.getMessage());
    throw new RuntimeException("String_Node_Str",e);
  }
  return runners;
}

Fixed version (ground truth):
@Override protected List<Runner> getChildren(){
  List<Runner> runners=new ArrayList<Runner>();
  try {
    for (    int ver : jvmVersions) {
      String javaExe=getJavaExecutable(ver);
      if (javaExe == null) {
        System.out.println("String_Node_Str" + ver + "String_Node_Str"+ ver);
        continue;
      }
      PinpointPluginTestContext context=new PinpointPluginTestContext(agentJar,configFile,requiredLibraries,getTestClass().getJavaClass(),testClassLocation,jvmArguments,debug,ver,javaExe);
      List<PinpointPluginTestInstance> cases=createTestCases(context);
      for (      PinpointPluginTestInstance c : cases) {
        runners.add(new PinpointPluginTestRunner(context,c));
      }
    }
  }
 catch (  Exception e) {
    System.out.println(e.getMessage());
    throw new RuntimeException("String_Node_Str",e);
  }
  if (runners.isEmpty()) {
    throw new RuntimeException("String_Node_Str");
  }
  return runners;
}
Program: 53761
Project: 53761
Buggy source:
private FromToResponseFilter createFromToResponseFilter(FilterDescriptor descriptor,FilterHint hint){
  if (descriptor == null) {
    throw new NullPointerException("String_Node_Str");
  }
  List<ServiceType> fromServiceType=registry.findDesc(descriptor.getFromServiceType());
  if (fromServiceType == null) {
    throw new IllegalArgumentException("String_Node_Str" + descriptor.getFromServiceType());
  }
  String fromApplicationName=descriptor.getFromApplicationName();
  String fromAgentName=descriptor.getFromAgentName();
  List<ServiceType> toServiceType=registry.findDesc(descriptor.getToServiceType());
  if (toServiceType == null) {
    throw new IllegalArgumentException("String_Node_Str" + descriptor.getToServiceType());
  }
  String toApplicationName=descriptor.getToApplicationName();
  String toAgentName=descriptor.getToAgentName();
  Long fromResponseTime=descriptor.getResponseFrom();
  Long toResponseTime=descriptor.getResponseTo();
  Boolean includeFailed=descriptor.getIncludeException();
  return new FromToResponseFilter(fromServiceType,fromApplicationName,fromAgentName,toServiceType,toApplicationName,toAgentName,fromResponseTime,toResponseTime,includeFailed,hint);
}

Fixed version (ground truth):
private FromToResponseFilter createFromToResponseFilter(FilterDescriptor descriptor,FilterHint hint){
  if (descriptor == null) {
    throw new NullPointerException("String_Node_Str");
  }
  List<ServiceType> fromServiceType=registry.findDesc(descriptor.getFromServiceType());
  if (fromServiceType == null) {
    throw new IllegalArgumentException("String_Node_Str" + descriptor.getFromServiceType());
  }
  String fromApplicationName=descriptor.getFromApplicationName();
  String fromAgentName=descriptor.getFromAgentName();
  List<ServiceType> toServiceType=registry.findDesc(descriptor.getToServiceType());
  if (toServiceType == null) {
    throw new IllegalArgumentException("String_Node_Str" + descriptor.getToServiceType());
  }
  String toApplicationName=descriptor.getToApplicationName();
  String toAgentName=descriptor.getToAgentName();
  Long fromResponseTime=descriptor.getResponseFrom();
  Long toResponseTime=descriptor.getResponseTo();
  Boolean includeFailed=descriptor.getIncludeException();
  return new FromToResponseFilter(fromServiceType,fromApplicationName,fromAgentName,toServiceType,toApplicationName,toAgentName,fromResponseTime,toResponseTime,includeFailed,hint,this.registry);
}
Program: 53762
Project: 53762
Buggy source:
public boolean containApplicationEndpoint(String applicationName,String endPoint,int serviceTypeCode){
  if (!containApplicationHint(applicationName)) {
    return false;
  }
  List<Object> list=get(applicationName);
  for (int i=0; i < list.size(); i+=2) {
    if (endPoint.equals(list.get(i))) {
      if (serviceTypeCode == (Integer)list.get(i + 1)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean containApplicationEndpoint(String applicationName,String endPoint,int serviceTypeCode){
  if (!containApplicationHint(applicationName)) {
    return false;
  }
  if (endPoint == null) {
    return false;
  }
  List<Object> list=get(applicationName);
  for (int i=0; i < list.size(); i+=2) {
    if (endPoint.equals(list.get(i))) {
      if (serviceTypeCode == (Integer)list.get(i + 1)) {
        return true;
      }
    }
  }
  return false;
}
Program: 53763
Project: 53763
Buggy source:
public FromToResponseFilter(List<ServiceType> fromServiceList,String fromApplicationName,String fromAgentName,List<ServiceType> toServiceList,String toApplicationName,String toAgentName,Long fromResponseTime,Long toResponseTime,Boolean includeFailed,FilterHint hint){
  if (fromServiceList == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (fromApplicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (toServiceList == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (toApplicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (hint == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.fromServiceCode=fromServiceList;
  this.fromApplicationName=fromApplicationName;
  this.fromAgentName=fromAgentName;
  this.toServiceCode=toServiceList;
  this.toApplicationName=toApplicationName;
  this.toAgentName=toAgentName;
  this.fromResponseTime=fromResponseTime;
  this.toResponseTime=toResponseTime;
  this.includeFailed=includeFailed;
  this.hint=hint;
}

Fixed version (ground truth):
public FromToResponseFilter(List<ServiceType> fromServiceList,String fromApplicationName,String fromAgentName,List<ServiceType> toServiceList,String toApplicationName,String toAgentName,Long fromResponseTime,Long toResponseTime,Boolean includeFailed,FilterHint hint,ServiceTypeRegistryService registry){
  if (fromServiceList == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (fromApplicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (toServiceList == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (toApplicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (hint == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.fromServiceCode=fromServiceList;
  this.fromApplicationName=fromApplicationName;
  this.fromAgentName=fromAgentName;
  this.toServiceCode=toServiceList;
  this.toApplicationName=toApplicationName;
  this.toAgentName=toAgentName;
  this.fromResponseTime=fromResponseTime;
  this.toResponseTime=toResponseTime;
  this.includeFailed=includeFailed;
  this.hint=hint;
  this.registry=registry;
}
Program: 53764
Project: 53764
Buggy source:
private boolean isRpcClient(short serviceType){
  return ServiceTypeCategory.RPC.contains(serviceType);
}

Fixed version (ground truth):
private boolean isRpcClient(short serviceTypeCode){
  if (ServiceTypeCategory.RPC.contains(serviceTypeCode)) {
    ServiceType serviceType=this.registry.findServiceType(serviceTypeCode);
    return serviceType.isRecordStatistics();
  }
  return false;
}
Program: 53765
Project: 53765
Buggy source:
public static void lock(ClassLoader loader){
  LockInfo info=map.get(loader);
  if (info == null) {
    return;
  }
  while (!info.lock.tryLock()) {
    try {
      if (Thread.holdsLock(loader)) {
        loader.wait(0,1);
      }
    }
 catch (    InterruptedException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public static void lock(ClassLoader loader){
  LockInfo info=map.get(loader);
  if (info == null) {
    return;
  }
  while (!info.lock.tryLock()) {
    try {
      if (Thread.holdsLock(info.child)) {
        info.child.wait(0,1);
      }
 else       if (Thread.holdsLock(info.parent)) {
        info.parent.wait(0,1);
      }
    }
 catch (    InterruptedException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
}
Program: 53766
Project: 53766
Buggy source:
public Java6PluginClassLoader(URL[] urls,ClassLoader parent){
  super(urls,parent);
}

Fixed version (ground truth):
public Java6PluginClassLoader(URL[] urls,ClassLoader parent){
  super(urls,parent);
  ClassLoaderLock.register(parent,this);
}
Program: 53767
Project: 53767
Buggy source:
@Test public void testPadBytes() throws Exception {
  int TOTAL_LENGTH=20;
  int TEST_SIZE=10;
  int PAD_SIZE=TOTAL_LENGTH - TEST_SIZE;
  Buffer buffer=new AutomaticBuffer(10);
  byte[] test=new byte[10];
  random.nextBytes(test);
  buffer.putPadBytes(test,TOTAL_LENGTH);
  byte[] result=buffer.getBuffer();
  org.junit.Assert.assertEquals(result.length,TOTAL_LENGTH);
  org.junit.Assert.assertTrue("String_Node_Str",Bytes.equals(test,0,TEST_SIZE,result,0,TEST_SIZE));
  byte[] padBytes=new byte[TOTAL_LENGTH - TEST_SIZE];
  org.junit.Assert.assertTrue("String_Node_Str",Bytes.equals(padBytes,0,TEST_SIZE,result,TEST_SIZE,PAD_SIZE));
}

Fixed version (ground truth):
@Test public void testPadBytes() throws Exception {
  int TOTAL_LENGTH=20;
  int TEST_SIZE=10;
  Buffer buffer=new AutomaticBuffer(10);
  byte[] test=new byte[10];
  random.nextBytes(test);
  buffer.putPadBytes(test,TOTAL_LENGTH);
  byte[] result=buffer.getBuffer();
  org.junit.Assert.assertEquals(result.length,TOTAL_LENGTH);
  org.junit.Assert.assertTrue("String_Node_Str",Arrays.equals(Arrays.copyOfRange(test,0,TEST_SIZE),Arrays.copyOfRange(result,0,TEST_SIZE)));
  byte[] padBytes=new byte[TOTAL_LENGTH - TEST_SIZE];
  org.junit.Assert.assertTrue("String_Node_Str",Arrays.equals(Arrays.copyOfRange(padBytes,0,TEST_SIZE),Arrays.copyOfRange(result,TEST_SIZE,TOTAL_LENGTH)));
}