nus-yam/ex-repair huggingface dataset:
Program: 2901
Project: 2901
Buggy source:
@Override public StateEnum onExit(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder,Object decisionInformation) throws DecodingException {
  IcapMessage message=icapMessageDecoder.message;
  Encapsulated encapsulated=message.getEncapsulatedHeader();
  if (message instanceof IcapRequest && ((IcapRequest)message).getMethod().equals(IcapMethod.OPTIONS)) {
    if (encapsulated.containsEntry(IcapMessageElementEnum.OPTBODY)) {
      return StateEnum.READ_CHUNK_SIZE_STATE;
    }
 else {
      return null;
    }
  }
 else {
    IcapMessageElementEnum entry=encapsulated.getNextEntry();
    if (entry != null) {
      if (entry.equals(IcapMessageElementEnum.REQHDR)) {
        return StateEnum.READ_HTTP_REQUEST_INITIAL_AND_HEADERS;
      }
 else       if (entry.equals(IcapMessageElementEnum.RESHDR)) {
        return StateEnum.READ_HTTP_RESPONSE_INITIAL_AND_HEADERS;
      }
 else       if (entry.equals(IcapMessageElementEnum.REQBODY)) {
        return StateEnum.READ_CHUNK_SIZE_STATE;
      }
 else       if (entry.equals(IcapMessageElementEnum.RESBODY)) {
        return StateEnum.READ_CHUNK_SIZE_STATE;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public StateEnum onExit(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder,Object decisionInformation) throws DecodingException {
  IcapMessage message=icapMessageDecoder.message;
  Encapsulated encapsulated=message.getEncapsulatedHeader();
  if (message instanceof IcapRequest && ((IcapRequest)message).getMethod().equals(IcapMethod.OPTIONS)) {
    if (encapsulated != null && encapsulated.containsEntry(IcapMessageElementEnum.OPTBODY)) {
      return StateEnum.READ_CHUNK_SIZE_STATE;
    }
 else {
      return null;
    }
  }
 else {
    IcapMessageElementEnum entry=encapsulated.getNextEntry();
    if (entry != null) {
      if (entry.equals(IcapMessageElementEnum.REQHDR)) {
        return StateEnum.READ_HTTP_REQUEST_INITIAL_AND_HEADERS;
      }
 else       if (entry.equals(IcapMessageElementEnum.RESHDR)) {
        return StateEnum.READ_HTTP_RESPONSE_INITIAL_AND_HEADERS;
      }
 else       if (entry.equals(IcapMessageElementEnum.REQBODY)) {
        return StateEnum.READ_CHUNK_SIZE_STATE;
      }
 else       if (entry.equals(IcapMessageElementEnum.RESBODY)) {
        return StateEnum.READ_CHUNK_SIZE_STATE;
      }
    }
  }
  return null;
}
Program: 2902
Project: 2902
Buggy source:
@Override public StateReturnValue execute(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder) throws DecodingException {
  List<String[]> headerList=IcapDecoderUtil.readHeaders(buffer,icapMessageDecoder.maxIcapHeaderSize);
  icapMessageDecoder.message.clearHeaders();
  for (  String[] header : headerList) {
    icapMessageDecoder.message.addHeader(header[0],header[1]);
  }
  validateMandatoryMessageHeaders(icapMessageDecoder.message,icapMessageDecoder.isDecodingResponse());
  Encapsulated encapsulated=new Encapsulated(icapMessageDecoder.message.getHeader(IcapHeaders.Names.ENCAPSULATED));
  icapMessageDecoder.message.setEncapsulatedHeader(encapsulated);
  if (icapMessageDecoder.message instanceof IcapRequest && ((IcapRequest)icapMessageDecoder.message).getMethod().equals(IcapMethod.OPTIONS)) {
    return StateReturnValue.createRelevantResult(icapMessageDecoder.message);
  }
 else   if (!encapsulated.containsEntry(IcapMessageElementEnum.REQHDR) & !encapsulated.containsEntry(IcapMessageElementEnum.RESHDR)) {
    return StateReturnValue.createRelevantResult(icapMessageDecoder.message);
  }
  return StateReturnValue.createIrrelevantResult();
}

Fixed version (ground truth):
@Override public StateReturnValue execute(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder) throws DecodingException {
  List<String[]> headerList=IcapDecoderUtil.readHeaders(buffer,icapMessageDecoder.maxIcapHeaderSize);
  icapMessageDecoder.message.clearHeaders();
  for (  String[] header : headerList) {
    icapMessageDecoder.message.addHeader(header[0],header[1]);
  }
  boolean isRequest=icapMessageDecoder.message instanceof IcapRequest;
  boolean isOptionsRequest=isRequest && ((IcapRequest)icapMessageDecoder.message).getMethod().equals(IcapMethod.OPTIONS);
  validateMandatoryMessageHeaders(icapMessageDecoder.message,icapMessageDecoder.isDecodingResponse(),isOptionsRequest);
  Encapsulated encapsulated=null;
  String headerValue=icapMessageDecoder.message.getHeader(IcapHeaders.Names.ENCAPSULATED);
  if (headerValue != null) {
    encapsulated=new Encapsulated(icapMessageDecoder.message.getHeader(IcapHeaders.Names.ENCAPSULATED));
    icapMessageDecoder.message.setEncapsulatedHeader(encapsulated);
  }
  if (isOptionsRequest) {
    return StateReturnValue.createRelevantResult(icapMessageDecoder.message);
  }
 else   if (encapsulated != null && !encapsulated.containsEntry(IcapMessageElementEnum.REQHDR) & !encapsulated.containsEntry(IcapMessageElementEnum.RESHDR)) {
    return StateReturnValue.createRelevantResult(icapMessageDecoder.message);
  }
  return StateReturnValue.createIrrelevantResult();
}
Program: 2903
Project: 2903
Buggy source:
/** 
 * removes all headers with the same name from the list.
 * @param name Icap message header name
 */
public void removeHeader(String name){
  if (base == null || base.after == null) {
    base=null;
    return;
  }
  Entry entry=base.after;
  while (entry != null) {
    if (identicalKeys(entry.getKey(),name)) {
      Entry before=entry.before;
      Entry after=entry.after;
      before.after=after;
      after.before=before;
      entry=after;
    }
 else {
      entry=entry.after;
    }
  }
  if (identicalKeys(base.getKey(),name)) {
    base=base.after;
    base.before=null;
  }
}

Fixed version (ground truth):
/** 
 * removes all headers with the same name from the list.
 * @param name Icap message header name
 */
public void removeHeader(String name){
  if (base == null) {
    return;
  }
  Entry entry=null;
  if (base.after == null) {
    if (identicalKeys(base.getKey(),name)) {
      base=null;
      return;
    }
  }
 else {
    entry=base.after;
  }
  while (entry != null) {
    if (identicalKeys(entry.getKey(),name)) {
      Entry before=entry.before;
      Entry after=entry.after;
      before.after=after;
      after.before=before;
      entry=after;
    }
 else {
      entry=entry.after;
    }
  }
  if (identicalKeys(base.getKey(),name)) {
    base=base.after;
    base.before=null;
  }
}
Program: 2904
Project: 2904
Buggy source:
/** 
 * reports that a given entry was processed and that the @see Encapsulated#getNextEntry() can now return the next entry in line or null if no more are present.
 * @param entryName the entry that was procesed.
 */
public void setEntryAsProcessed(IcapMessageElementEnum entryName){
  Entry entry=getEntryByName(entryName);
  entry.setIsProcessed();
}

Fixed version (ground truth):
/** 
 * reports that a given entry was processed and that the @see Encapsulated#getNextEntry() can now return the next entry in line or null if no more are present.
 * @param entryName the entry that was procesed.
 */
public void setEntryAsProcessed(IcapMessageElementEnum entryName){
  Entry entry=getEntryByName(entryName);
  if (entry != null) {
    entry.setIsProcessed();
  }
}
Program: 2905
Project: 2905
Buggy source:
/** 
 * parses the chunk size from a line.
 * @param line
 * @return -1 if the chunk size indicates that a preview message is early terminated.
 */
public static int getChunkSize(String line){
  String hex=line.trim();
  if (hex.equals(IcapCodecUtil.IEOF_SEQUENCE_STRING)) {
    return -1;
  }
  for (int i=0; i < hex.length(); i++) {
    char c=hex.charAt(i);
    if (c == ';' || Character.isWhitespace(c) || Character.isISOControl(c)) {
      hex=hex.substring(0,i);
      break;
    }
  }
  return Integer.parseInt(hex,16);
}

Fixed version (ground truth):
/** 
 * parses the chunk size from a line.
 * @param line
 * @return -1 if the chunk size indicates that a preview message is early terminated.
 */
public static int getChunkSize(String line) throws DecodingException {
  String hex=line.trim();
  if (hex.equals(IcapCodecUtil.IEOF_SEQUENCE_STRING)) {
    return -1;
  }
  for (int i=0; i < hex.length(); i++) {
    char c=hex.charAt(i);
    if (c == ';' || Character.isWhitespace(c) || Character.isISOControl(c)) {
      hex=hex.substring(0,i);
      break;
    }
  }
  try {
    return Integer.parseInt(hex,16);
  }
 catch (  NumberFormatException nfe) {
    throw new DecodingException(nfe);
  }
}
Program: 2906
Project: 2906
Buggy source:
/** 
 * set the decoders message to NULL and the next checkpoint to @see   {@link StateEnum#SKIP_CONTROL_CHARS}
 * @return the message which was set to null in the instance.
 */
protected Object reset(){
  Object message=this.message;
  this.message=null;
  checkpoint(StateEnum.SKIP_CONTROL_CHARS);
  return message;
}

Fixed version (ground truth):
/** 
 * set the decoders message to NULL and the next checkpoint to @see   {@link StateEnum#SKIP_CONTROL_CHARS}
 */
private void reset(){
  this.message=null;
  checkpoint(StateEnum.SKIP_CONTROL_CHARS);
}
Program: 2907
Project: 2907
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,StateEnum stateEnumValue) throws Exception {
  if (stateEnumValue != null) {
    try {
      State state=stateEnumValue.getState();
      LOG.debug("String_Node_Str" + state + ']');
      state.onEntry(buffer,this);
      StateReturnValue returnValue=state.execute(buffer,this);
      LOG.debug("String_Node_Str" + state + "String_Node_Str"+ returnValue+ "String_Node_Str");
      StateEnum nextState=state.onExit(buffer,this,returnValue.getDecisionInformation());
      LOG.debug("String_Node_Str" + nextState + "String_Node_Str");
      if (nextState != null) {
        checkpoint(nextState);
      }
 else {
        checkpoint();
      }
      if (returnValue.isRelevant()) {
        return returnValue.getValue();
      }
    }
 catch (    DecodingException e) {
      reset();
      throw e;
    }
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,StateEnum stateEnumValue) throws Exception {
  if (stateEnumValue != null) {
    try {
      State state=stateEnumValue.getState();
      LOG.debug("String_Node_Str" + state + ']');
      state.onEntry(buffer,this);
      StateReturnValue returnValue=state.execute(buffer,this);
      LOG.debug("String_Node_Str" + state + "String_Node_Str"+ returnValue+ "String_Node_Str");
      StateEnum nextState=state.onExit(buffer,this,returnValue.getDecisionInformation());
      LOG.debug("String_Node_Str" + nextState + "String_Node_Str");
      if (nextState != null) {
        checkpoint(nextState);
      }
 else {
        reset();
      }
      if (returnValue.isRelevant()) {
        return returnValue.getValue();
      }
    }
 catch (    DecodingException e) {
      reset();
      throw e;
    }
  }
  return null;
}
Program: 2908
Project: 2908
Buggy source:
/** 
 * parses a valid icap protocol version string.
 * @param text the version (ICAP/1.0)
 */
private IcapVersion(String text){
  if (text == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Matcher m=VERSION_PATTERN.matcher(text.trim().toUpperCase());
  if (!m.matches()) {
    throw new IllegalArgumentException("String_Node_Str" + text);
  }
  protocolName=m.group(1);
  major=Integer.parseInt(m.group(2));
  minor=Integer.parseInt(m.group(3));
  this.text=text;
}

Fixed version (ground truth):
/** 
 * parses a valid icap protocol version string.
 * @param text the version (ICAP/1.0)
 */
private IcapVersion(String text){
  if (text == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Matcher m=VERSION_PATTERN.matcher(text.trim().toUpperCase());
  if (!m.matches()) {
    throw new IllegalArgumentException("String_Node_Str" + text + "String_Node_Str");
  }
  protocolName=m.group(1);
  major=Integer.parseInt(m.group(2));
  minor=Integer.parseInt(m.group(3));
  this.text=text;
}
Program: 2910
Project: 2910
Buggy source:
@Override public StateEnum onExit(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder,Object decisionInformation) throws DecodingException {
  IcapMessage message=icapMessageDecoder.message;
  if (message == null) {
    return null;
  }
  Encapsulated encapsulated=message.getEncapsulatedHeader();
  if (message.getMethod().equals(IcapMethod.OPTIONS)) {
    if (encapsulated.containsEntry(IcapMessageElementEnum.OPTBODY)) {
      return StateEnum.READ_CHUNK_SIZE_STATE;
    }
 else {
      return null;
    }
  }
 else {
    IcapMessageElementEnum entry=encapsulated.getNextEntry();
    if (entry != null) {
      if (entry.equals(IcapMessageElementEnum.REQHDR)) {
        return StateEnum.READ_HTTP_REQUEST_INITIAL_AND_HEADERS;
      }
 else       if (entry.equals(IcapMessageElementEnum.RESHDR)) {
        return StateEnum.READ_HTTP_RESPONSE_INITIAL_AND_HEADERS;
      }
 else       if (entry.equals(IcapMessageElementEnum.REQBODY)) {
        return StateEnum.READ_CHUNK_SIZE_STATE;
      }
 else       if (entry.equals(IcapMessageElementEnum.RESBODY)) {
        return StateEnum.READ_CHUNK_SIZE_STATE;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public StateEnum onExit(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder,Object decisionInformation) throws DecodingException {
  IcapMessage message=icapMessageDecoder.message;
  Encapsulated encapsulated=message.getEncapsulatedHeader();
  if (message.getMethod().equals(IcapMethod.OPTIONS)) {
    if (encapsulated.containsEntry(IcapMessageElementEnum.OPTBODY)) {
      return StateEnum.READ_CHUNK_SIZE_STATE;
    }
 else {
      return null;
    }
  }
 else {
    IcapMessageElementEnum entry=encapsulated.getNextEntry();
    if (entry != null) {
      if (entry.equals(IcapMessageElementEnum.REQHDR)) {
        return StateEnum.READ_HTTP_REQUEST_INITIAL_AND_HEADERS;
      }
 else       if (entry.equals(IcapMessageElementEnum.RESHDR)) {
        return StateEnum.READ_HTTP_RESPONSE_INITIAL_AND_HEADERS;
      }
 else       if (entry.equals(IcapMessageElementEnum.REQBODY)) {
        return StateEnum.READ_CHUNK_SIZE_STATE;
      }
 else       if (entry.equals(IcapMessageElementEnum.RESBODY)) {
        return StateEnum.READ_CHUNK_SIZE_STATE;
      }
    }
  }
  return null;
}
Program: 2911
Project: 2911
Buggy source:
@Override public StateReturnValue execute(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder) throws DecodingException {
  List<String[]> headerList=IcapDecoderUtil.readHeaders(buffer,icapMessageDecoder.maxIcapHeaderSize);
  icapMessageDecoder.message.clearHeaders();
  for (  String[] header : headerList) {
    icapMessageDecoder.message.addHeader(header[0],header[1]);
  }
  validateMandatoryMessageHeaders(icapMessageDecoder.message,icapMessageDecoder.isDecodingResponse());
  Encapsulated encapsulated=new Encapsulated(icapMessageDecoder.message.getHeader(IcapHeader.Names.ENCAPSULATED));
  icapMessageDecoder.message.setEncapsulatedHeader(encapsulated);
  if (icapMessageDecoder.message.getMethod().equals(IcapMethod.OPTIONS)) {
    return StateReturnValue.createRelevantResult(icapMessageDecoder.message);
  }
 else   if (!encapsulated.containsEntry(IcapMessageElementEnum.REQHDR) & !encapsulated.containsEntry(IcapMessageElementEnum.RESHDR)) {
    return StateReturnValue.createRelevantResult(icapMessageDecoder.reset());
  }
  return StateReturnValue.createIrrelevantResult();
}

Fixed version (ground truth):
@Override public StateReturnValue execute(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder) throws DecodingException {
  List<String[]> headerList=IcapDecoderUtil.readHeaders(buffer,icapMessageDecoder.maxIcapHeaderSize);
  icapMessageDecoder.message.clearHeaders();
  for (  String[] header : headerList) {
    icapMessageDecoder.message.addHeader(header[0],header[1]);
  }
  validateMandatoryMessageHeaders(icapMessageDecoder.message,icapMessageDecoder.isDecodingResponse());
  Encapsulated encapsulated=new Encapsulated(icapMessageDecoder.message.getHeader(IcapHeader.Names.ENCAPSULATED));
  icapMessageDecoder.message.setEncapsulatedHeader(encapsulated);
  if (icapMessageDecoder.message.getMethod().equals(IcapMethod.OPTIONS)) {
    return StateReturnValue.createRelevantResult(icapMessageDecoder.message);
  }
 else   if (!encapsulated.containsEntry(IcapMessageElementEnum.REQHDR) & !encapsulated.containsEntry(IcapMessageElementEnum.RESHDR)) {
    return StateReturnValue.createRelevantResult(icapMessageDecoder.message);
  }
  return StateReturnValue.createIrrelevantResult();
}
Program: 2912
Project: 2912
Buggy source:
@Test public void testChunkSize(){
  String line="String_Node_Str";
  assertEquals("String_Node_Str",51,IcapDecoderUtil.getChunkSize(line));
}

Fixed version (ground truth):
@Test public void testChunkSize() throws DecodingException {
  String line="String_Node_Str";
  assertEquals("String_Node_Str",51,IcapDecoderUtil.getChunkSize(line));
}
Program: 2913
Project: 2913
Buggy source:
@Test public void testIEOFChunkSize(){
  String line="String_Node_Str";
  assertEquals("String_Node_Str",-1,IcapDecoderUtil.getChunkSize(line));
}

Fixed version (ground truth):
@Test public void testIEOFChunkSize() throws DecodingException {
  String line="String_Node_Str";
  assertEquals("String_Node_Str",-1,IcapDecoderUtil.getChunkSize(line));
}
Program: 2914
Project: 2914
Buggy source:
@Test public void testChunkSizeWithTrailingWhitespace(){
  String line="String_Node_Str";
  assertEquals("String_Node_Str",0,IcapDecoderUtil.getChunkSize(line));
}

Fixed version (ground truth):
@Test public void testChunkSizeWithTrailingWhitespace() throws DecodingException {
  String line="String_Node_Str";
  assertEquals("String_Node_Str",0,IcapDecoderUtil.getChunkSize(line));
}
Program: 2915
Project: 2915
Buggy source:
@Test public void testChunkSizeWithTrailingSemicolon(){
  String line="String_Node_Str";
  assertEquals("String_Node_Str",0,IcapDecoderUtil.getChunkSize(line));
}

Fixed version (ground truth):
@Test public void testChunkSizeWithTrailingSemicolon() throws DecodingException {
  String line="String_Node_Str";
  assertEquals("String_Node_Str",0,IcapDecoderUtil.getChunkSize(line));
}
Program: 2916
Project: 2916
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,StateEnum stateEnumValue) throws Exception {
  buffer=new AnaylsisChannelBuffer(buffer);
  State state=stateEnumValue.getState();
  LOG.debug("String_Node_Str" + state + ']');
  state.onEntry(buffer,this);
  StateReturnValue returnValue=state.execute(buffer,this);
  LOG.debug("String_Node_Str" + state + "String_Node_Str"+ returnValue+ "String_Node_Str");
  StateEnum nextState=state.onExit(buffer,this,returnValue.getDecisionInformation());
  LOG.debug("String_Node_Str" + nextState + "String_Node_Str");
  if (nextState != null) {
    checkpoint(nextState);
  }
  if (returnValue.isRelevant()) {
    return returnValue.getValue();
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,StateEnum stateEnumValue) throws Exception {
  if (stateEnumValue != null) {
    State state=stateEnumValue.getState();
    LOG.debug("String_Node_Str" + state + ']');
    state.onEntry(buffer,this);
    StateReturnValue returnValue=state.execute(buffer,this);
    LOG.debug("String_Node_Str" + state + "String_Node_Str"+ returnValue+ "String_Node_Str");
    StateEnum nextState=state.onExit(buffer,this,returnValue.getDecisionInformation());
    LOG.debug("String_Node_Str" + nextState + "String_Node_Str");
    if (nextState != null) {
      checkpoint(nextState);
    }
 else {
      checkpoint();
    }
    if (returnValue.isRelevant()) {
      return returnValue.getValue();
    }
  }
  return null;
}
Program: 2919
Project: 2919
Buggy source:
protected void setupTricklePipeline(ServerBootstrap serverBootstrap,ClientBootstrap clientBootstrap,Handler serverHandler,Handler clientHandler){
  serverBootstrap.getPipeline().addLast("String_Node_Str",new IcapRequestDecoder());
  serverBootstrap.getPipeline().addLast("String_Node_Str",new IcapResponseEncoder());
  serverBootstrap.getPipeline().addLast("String_Node_Str",(SimpleChannelUpstreamHandler)serverHandler);
  clientBootstrap.getPipeline().addLast("String_Node_Str",new TrickleDownstreamHandler(5,3));
  clientBootstrap.getPipeline().addLast("String_Node_Str",new IcapRequestEncoder());
  clientBootstrap.getPipeline().addLast("String_Node_Str",new IcapResponseDecoder());
  clientBootstrap.getPipeline().addLast("String_Node_Str",(SimpleChannelUpstreamHandler)clientHandler);
}

Fixed version (ground truth):
protected void setupTricklePipeline(ServerBootstrap serverBootstrap,ClientBootstrap clientBootstrap,Handler serverHandler,Handler clientHandler){
  serverBootstrap.getPipeline().addLast("String_Node_Str",new IcapRequestDecoder());
  serverBootstrap.getPipeline().addLast("String_Node_Str",new IcapResponseEncoder());
  serverBootstrap.getPipeline().addLast("String_Node_Str",(SimpleChannelUpstreamHandler)serverHandler);
  clientBootstrap.getPipeline().addLast("String_Node_Str",new TrickleDownstreamHandler(20,3));
  clientBootstrap.getPipeline().addLast("String_Node_Str",new IcapRequestEncoder());
  clientBootstrap.getPipeline().addLast("String_Node_Str",new IcapResponseDecoder());
  clientBootstrap.getPipeline().addLast("String_Node_Str",(SimpleChannelUpstreamHandler)clientHandler);
}
Program: 2920
Project: 2920
Buggy source:
public void sendREQMODWithPreviewThroughAggregatorPipleline(){
  try {
    runSocketTest(new SendREQMODWithPreviewAggregatorServerHandler(),new SendREQMODWithPreviewClientHandler(),new Object[]{DataMockery.createREQMODWithPreviewAnnouncementIcapMessage(),DataMockery.createREQMODWithPreviewIcapChunk(),DataMockery.createREQMODWithPreviewLastIcapChunk()},PipelineType.AGGREGATOR);
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void sendREQMODWithPreviewThroughAggregatorPipleline(){
  try {
    runSocketTest(new SendREQMODWithPreviewAggregatorServerHandler(),new SendREQMODWithPreviewClientHandler(),new Object[]{DataMockery.createREQMODWithPreviewAnnouncementIcapMessage(),DataMockery.createREQMODWithPreviewIcapChunk(),DataMockery.createREQMODWithPreviewLastIcapChunk()},PipelineType.AGGREGATOR);
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
    fail("String_Node_Str");
  }
}
Program: 2921
Project: 2921
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,StateEnum stateEnumValue) throws Exception {
  State state=stateEnumValue.getState();
  System.out.print(stateEnumValue.name() + "String_Node_Str");
  state.onEntry(buffer,this);
  StateReturnValue returnValue=state.execute(buffer,this);
  if (returnValue == null) {
    System.out.print("String_Node_Str");
  }
 else {
    System.out.print(returnValue.toString() + "String_Node_Str");
  }
  StateEnum nextState=state.onExit(buffer,this,returnValue.getDecisionInformation());
  System.out.println(nextState);
  if (nextState != null) {
    checkpoint(nextState);
  }
 else {
    checkpoint();
  }
  if (returnValue.isRelevant()) {
    return returnValue.getValue();
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,StateEnum stateEnumValue) throws Exception {
  State state=stateEnumValue.getState();
  System.out.print(stateEnumValue.name() + "String_Node_Str");
  state.onEntry(buffer,this);
  StateReturnValue returnValue=state.execute(buffer,this);
  if (returnValue == null) {
    System.out.print("String_Node_Str");
  }
 else {
    System.out.print(returnValue.toString() + "String_Node_Str");
  }
  StateEnum nextState=state.onExit(buffer,this,returnValue.getDecisionInformation());
  System.out.println(nextState);
  if (nextState != null) {
    checkpoint(nextState);
  }
  if (returnValue.isRelevant()) {
    return returnValue.getValue();
  }
  return null;
}
Program: 2922
Project: 2922
Buggy source:
private int correctBufferIndex(ChannelBuffer buffer){
  buffer.readerIndex(buffer.readerIndex() - IcapCodecUtil.IEOF_SEQUENCE.length);
  int counter=0;
  for (; ; ) {
    counter++;
    byte next=buffer.getByte(buffer.readerIndex() - 1);
    if (next == IcapCodecUtil.CR) {
      counter++;
      if (buffer.getByte(buffer.readerIndex() - 1) == IcapCodecUtil.LF) {
        break;
      }
    }
 else     if (next == IcapCodecUtil.LF) {
      break;
    }
  }
  buffer.readerIndex(buffer.readerIndex() - counter);
  return counter;
}

Fixed version (ground truth):
/** 
 * This method steps back across the given token length and the prepending newline characters ('\r' & '\n')  until the end of a chunk is reached.
 * @return the amount of newline characters that the index is put back. (classically: 1 '\n')
 */
private int correctBufferIndex(ChannelBuffer buffer,int size){
  buffer.readerIndex(buffer.readerIndex() - size);
  int counter=0;
  for (; ; ) {
    counter++;
    byte next=buffer.getByte(buffer.readerIndex() - counter);
    if (next == IcapCodecUtil.CR) {
      counter++;
      if (buffer.getByte(buffer.readerIndex() - counter) == IcapCodecUtil.LF) {
        break;
      }
    }
 else     if (next == IcapCodecUtil.LF) {
      break;
    }
  }
  buffer.readerIndex(buffer.readerIndex() - counter);
  return counter;
}
Program: 2924
Project: 2924
Buggy source:
@Override public int compareTo(Entry entry){
  if (entry.getName().equals(EntryName.NULLBODY)) {
    return 1;
  }
  return this.position.compareTo(entry.position);
}

Fixed version (ground truth):
@Override public int compareTo(Entry entry){
  return this.position.compareTo(entry.position);
}
Program: 2925
Project: 2925
Buggy source:
@Test public void runTest(){
  try {
    super.runDecoderTest(new Handler(),new DefaultIcapRequest(IcapVersion.ICAP_1_0,IcapMethod.OPTIONS,"String_Node_Str"));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void runTest(){
  try {
    super.runDecoderTest(new Handler(),new DefaultIcapRequest(IcapVersion.ICAP_1_0,IcapMethod.OPTIONS,"String_Node_Str"));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2926
Project: 2926
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,StateEnum stateEnumValue) throws Exception {
  State state=stateEnumValue.getState();
  state.onEntry(buffer,this);
  StateReturnValue returnValue=state.execute(buffer,this);
  StateEnum nextState=state.onExit(buffer,this,returnValue.getDecisionInformation());
  if (nextState != null) {
    checkpoint(nextState);
  }
 else {
    checkpoint();
  }
  if (returnValue.isRelevant()) {
    return returnValue.getValue();
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,StateEnum stateEnumValue) throws Exception {
  State state=stateEnumValue.getState();
  System.out.println(stateEnumValue.name());
  state.onEntry(buffer,this);
  StateReturnValue returnValue=state.execute(buffer,this);
  StateEnum nextState=state.onExit(buffer,this,returnValue.getDecisionInformation());
  if (nextState != null) {
    checkpoint(nextState);
  }
 else {
    checkpoint();
  }
  if (returnValue.isRelevant()) {
    return returnValue.getValue();
  }
  return null;
}
Program: 2927
Project: 2927
Buggy source:
@Override public StateEnum onExit(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder,Object decisionInformation) throws Exception {
  IcapMessage message=icapMessageDecoder.message;
  Encapsulated encapsulated=message.getEncapsulatedHeader();
  if (message.getMethod().equals(IcapMethod.OPTIONS)) {
    return StateEnum.OPTIONS_REQUEST_ACTION_STATE;
  }
  EntryName entry=encapsulated.getNextEntry();
  if (entry != null) {
    if (entry.equals(EntryName.REQHDR)) {
      return StateEnum.READ_HTTP_REQUEST_INITIAL_AND_HEADERS;
    }
    if (entry.equals(EntryName.RESHDR)) {
      return StateEnum.READ_HTTP_RESPONSE_INITIAL_AND_HEADERS;
    }
    if (entry.equals(EntryName.REQBODY) | entry.equals(EntryName.RESBODY)) {
      return StateEnum.BODY_PROCESSING_DECISION_STATE;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public StateEnum onExit(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder,Boolean decisionInformation) throws Exception {
  IcapMessage message=icapMessageDecoder.message;
  Encapsulated encapsulated=message.getEncapsulatedHeader();
  if (message.getMethod().equals(IcapMethod.OPTIONS) & decisionInformation) {
    return StateEnum.BODY_PROCESSING_DECISION_STATE;
  }
 else {
    if (message.getMethod().equals(IcapMethod.OPTIONS)) {
      return null;
    }
    EntryName entry=encapsulated.getNextEntry();
    if (entry != null) {
      if (entry.equals(EntryName.REQHDR)) {
        return StateEnum.READ_HTTP_REQUEST_INITIAL_AND_HEADERS;
      }
      if (entry.equals(EntryName.RESHDR)) {
        return StateEnum.READ_HTTP_RESPONSE_INITIAL_AND_HEADERS;
      }
      if (entry.equals(EntryName.REQBODY) | entry.equals(EntryName.RESBODY)) {
        return StateEnum.BODY_PROCESSING_DECISION_STATE;
      }
    }
  }
  return null;
}
Program: 2928
Project: 2928
Buggy source:
@Override public StateReturnValue execute(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder) throws Exception {
  List<String[]> headerList=IcapDecoderUtil.readHeaders(buffer,icapMessageDecoder.maxIcapHeaderSize);
  icapMessageDecoder.message.clearHeaders();
  for (  String[] header : headerList) {
    icapMessageDecoder.message.addHeader(header[0],header[1]);
  }
  if (!icapMessageDecoder.message.containsHeader(IcapHeaders.Names.HOST)) {
    throw new Error("String_Node_Str");
  }
  if (!icapMessageDecoder.message.containsHeader(IcapHeaders.Names.ENCAPSULATED)) {
    throw new Error("String_Node_Str");
  }
  Encapsulated encapsulated=Encapsulated.parseHeader(icapMessageDecoder.message.getHeader(IcapHeaders.Names.ENCAPSULATED));
  icapMessageDecoder.message.setEncapsulatedHeader(encapsulated);
  return StateReturnValue.createIrrelevantResult();
}

Fixed version (ground truth):
@Override public StateReturnValue execute(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder) throws Exception {
  List<String[]> headerList=IcapDecoderUtil.readHeaders(buffer,icapMessageDecoder.maxIcapHeaderSize);
  icapMessageDecoder.message.clearHeaders();
  for (  String[] header : headerList) {
    icapMessageDecoder.message.addHeader(header[0],header[1]);
  }
  if (!icapMessageDecoder.message.containsHeader(IcapHeaders.Names.HOST)) {
    throw new Error("String_Node_Str");
  }
  if (!icapMessageDecoder.message.containsHeader(IcapHeaders.Names.ENCAPSULATED)) {
    throw new Error("String_Node_Str");
  }
  Encapsulated encapsulated=Encapsulated.parseHeader(icapMessageDecoder.message.getHeader(IcapHeaders.Names.ENCAPSULATED));
  icapMessageDecoder.message.setEncapsulatedHeader(encapsulated);
  if (icapMessageDecoder.message.getMethod().equals(IcapMethod.OPTIONS) & icapMessageDecoder.message.getEncapsulatedHeader().containsEntry(EntryName.OPTBODY)) {
    return StateReturnValue.createIrrelevantResultWithDecisionInformation(Boolean.TRUE);
  }
  return StateReturnValue.createRelevantResultWithDecisionInformation(icapMessageDecoder.message,Boolean.FALSE);
}
Program: 2929
Project: 2929
Buggy source:
public StateReturnValue(boolean relevance,Object value,Object decisionInformation){
  this.relevance=relevance;
  this.value=value;
}

Fixed version (ground truth):
public StateReturnValue(boolean relevance,Object value,Object decisionInformation){
  this.relevance=relevance;
  this.value=value;
  this.decisionInformation=decisionInformation;
}
Program: 2930
Project: 2930
Buggy source:
public static final ChannelBuffer createWhiteSpacePrefixedOPTIONSRequest(){
  StringBuilder builder=new StringBuilder();
  addLine(builder,"String_Node_Str");
  addLine(builder,"String_Node_Str");
  addLine(builder,null);
  return ChannelBuffers.wrappedBuffer(builder.toString().getBytes());
}

Fixed version (ground truth):
public static final ChannelBuffer createWhiteSpacePrefixedOPTIONSRequest(){
  StringBuilder builder=new StringBuilder();
  addLine(builder,"String_Node_Str");
  addLine(builder,"String_Node_Str");
  addLine(builder,"String_Node_Str");
  addLine(builder,null);
  return ChannelBuffers.wrappedBuffer(builder.toString().getBytes());
}
Program: 2931
Project: 2931
Buggy source:
public static final ChannelBuffer createOPTIONSRequest(){
  StringBuilder builder=new StringBuilder();
  addLine(builder,"String_Node_Str");
  addLine(builder,"String_Node_Str");
  addLine(builder,null);
  return ChannelBuffers.wrappedBuffer(builder.toString().getBytes());
}

Fixed version (ground truth):
public static final ChannelBuffer createOPTIONSRequest(){
  StringBuilder builder=new StringBuilder();
  addLine(builder,"String_Node_Str");
  addLine(builder,"String_Node_Str");
  addLine(builder,"String_Node_Str");
  addLine(builder,null);
  return ChannelBuffers.wrappedBuffer(builder.toString().getBytes());
}
Program: 2932
Project: 2932
Buggy source:
@Test public void decodeREQMODRequestWithNullBody(){
  embedder.offer(DataMockery.createREQMODWithGetRequestNoBody());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
}

Fixed version (ground truth):
@Test public void decodeREQMODRequestWithNullBody(){
  embedder.offer(DataMockery.createREQMODWithGetRequestNoBody());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
  DataMockery.assertCreateREQMODWithGetRequestNoBody(result);
}
Program: 2933
Project: 2933
Buggy source:
@Test public void stripPrefixingWhitespacesFromMessage(){
  embedder.offer(DataMockery.createWhiteSpacePrefixedOPTIONSRequest());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
}

Fixed version (ground truth):
@Test public void stripPrefixingWhitespacesFromMessage(){
  embedder.offer(DataMockery.createWhiteSpacePrefixedOPTIONSRequest());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
  DataMockery.assertCreateWhiteSpacePrefixedOPTIONSRequest(result);
}
Program: 2934
Project: 2934
Buggy source:
@Test public void decodeRESPMODRequestWithNullBodyAndReverseRequestAlignement(){
  embedder.offer(DataMockery.createRESPMODWithGetRequestNoBodyAndReverseRequestAlignement());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
}

Fixed version (ground truth):
@Test public void decodeRESPMODRequestWithNullBodyAndReverseRequestAlignement(){
  embedder.offer(DataMockery.createRESPMODWithGetRequestNoBodyAndReverseRequestAlignement());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
  DataMockery.assertCreateRESPMODWithGetRequestNoBodyAndReverseRequestAlignement(result);
}
Program: 2935
Project: 2935
Buggy source:
public void decodeOPTIONRequestTest(){
  embedder.offer(DataMockery.createOPTIONSRequest());
  IcapMessage result=embedder.poll();
  assertEquals(true,true);
}

Fixed version (ground truth):
@Test public void decodeOPTIONRequestTest(){
  embedder.offer(DataMockery.createOPTIONSRequest());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
  DataMockery.assertCreateOPTIONSRequest(result);
}
Program: 2936
Project: 2936
Buggy source:
@Test public void decodeRESPMODRequestWithNullBody(){
  embedder.offer(DataMockery.createRESPMODWithGetRequestNoBody());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
}

Fixed version (ground truth):
@Test public void decodeRESPMODRequestWithNullBody(){
  embedder.offer(DataMockery.createRESPMODWithGetRequestNoBody());
  IcapMessage result=embedder.poll();
  assertNotNull("String_Node_Str",result);
  DataMockery.assertCreateRESPMODWithGetRequestNoBody(result);
}
Program: 2937
Project: 2937
Buggy source:
@Override public String toString(){
  StringBuilder buf=new StringBuilder();
  buf.append(getClass().getSimpleName());
  buf.append("String_Node_Str");
  buf.append(getProtocolVersion().getText());
  buf.append(')');
  buf.append(StringUtil.NEWLINE);
  appendHeaders(buf);
  if (httpRequest != null) {
    buf.append("String_Node_Str").append(StringUtil.NEWLINE);
    buf.append(httpRequest.toString());
  }
  if (httpResponse != null) {
    buf.append("String_Node_Str").append(StringUtil.NEWLINE);
    buf.append(httpResponse.toString());
  }
  if (getPreview() != null) {
    buf.append("String_Node_Str");
    buf.append(preview.toString());
  }
  buf.setLength(buf.length() - StringUtil.NEWLINE.length());
  return buf.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder buf=new StringBuilder();
  buf.append(getClass().getSimpleName());
  buf.append("String_Node_Str");
  buf.append(getProtocolVersion().getText());
  buf.append(')');
  buf.append(StringUtil.NEWLINE);
  appendHeaders(buf);
  if (httpRequest != null) {
    buf.append("String_Node_Str").append(StringUtil.NEWLINE);
    buf.append(httpRequest.toString());
  }
  if (httpResponse != null) {
    buf.append("String_Node_Str").append(StringUtil.NEWLINE);
    buf.append(httpResponse.toString());
  }
  if (getPreview() != null) {
    buf.append("String_Node_Str");
    buf.append(preview.toString());
  }
  return buf.toString();
}
Program: 2938
Project: 2938
Buggy source:
@Before public void setUp(){
  embedder=new DecoderEmbedder<ChannelBuffer>(new IcapMessageDecoder());
}

Fixed version (ground truth):
@Before public void setUp(){
  embedder=new DecoderEmbedder<ChannelBuffer>(new IcapRequestDecoder());
}
Program: 2939
Project: 2939
Buggy source:
private void sendShoutMessage(){
  String userName="String_Node_Str";
  String recip=tbPhoneNumber.getString();
  String msg=tbMessage.getString();
  ShoutController sc=new ShoutController();
  String data=sc.buildShoutData(userName);
  try {
    sc.sendSMSShout(recip,msg,data);
    ErrorAlert eAlert=new ErrorAlert("String_Node_Str","String_Node_Str",null,this);
    eAlert.show();
  }
 catch (  Exception e) {
    ErrorAlert eAlert=new ErrorAlert("String_Node_Str","String_Node_Str",null,this);
    eAlert.show();
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void sendShoutMessage(){
  String userName="String_Node_Str";
  String recip=tbPhoneNumber.getString();
  String msg=tbMessage.getString();
  ShoutController sc=new ShoutController();
  String data=sc.buildDataMessage(userName);
  try {
    sc.sendSMSShout(recip,msg,data);
    ErrorAlert eAlert=new ErrorAlert("String_Node_Str","String_Node_Str",null,this);
    eAlert.show();
  }
 catch (  Exception e) {
    ErrorAlert eAlert=new ErrorAlert("String_Node_Str","String_Node_Str",null,this);
    eAlert.show();
    e.printStackTrace();
  }
}
Program: 2940
Project: 2940
Buggy source:
public void wipingFileSuccess(String path){
  successCount++;
  _lsCanvas.setLargeString(l10n.getString(L10nConstants.keys.WIPE_STATUS_WIPING_WORD) + currentType + "String_Node_Str"+ successCount);
}

Fixed version (ground truth):
public void wipingFileSuccess(String path){
  successCount++;
  _lsCanvas.setLargeString(l10n.getString(L10nConstants.keys.WIPE_STATUS_WIPING_WORD) + "String_Node_Str" + path);
}
Program: 2941
Project: 2941
Buggy source:
public void onClick(Component c){
  successCount=0;
  errCount=0;
  new Thread(this).start();
}

Fixed version (ground truth):
public void onClick(Component c){
  successCount=0;
  errCount=0;
  thread=new Thread(this);
  thread.start();
}
Program: 2942
Project: 2942
Buggy source:
/** 
 * Constructs a screen that shows a <code>TextBox</code> component in action.
 * @param previous is the screen to return to once this done.
 */
public WipeManualForm(ITCMainMIDlet midlet){
  _midlet=midlet;
  try {
    _prefs=new Preferences(ITCConstants.PANIC_PREFS_DB);
  }
 catch (  RecordStoreException e) {
    Logger.error(ITCConstants.TAG,"String_Node_Str" + e,e);
  }
  setTitle(l10n.getString(L10nConstants.keys.TITLE_WIPE_MANUAL));
  Label label=new Label();
  label.setLabel(l10n.getString(L10nConstants.keys.WIPE_WARNING_MSG));
  label.setHorizontalAlignment(Graphics.LEFT);
  append(label);
  _cbContacts=new CheckBox();
  _cbContacts.setLabel(l10n.getString(L10nConstants.keys.WIPE_MENU_CONTACTS));
  _cbContacts.setChecked(false);
  append(_cbContacts);
  _cbPhotos=new CheckBox();
  _cbPhotos.setLabel(l10n.getString(L10nConstants.keys.WIPE_MENU_PHOTOS));
  _cbPhotos.setChecked(false);
  append(_cbPhotos);
  _cbAllStorage=new CheckBox();
  _cbAllStorage.setLabel(l10n.getString(L10nConstants.keys.WIPE_MENU_FILES));
  _cbAllStorage.setChecked(false);
  append(_cbAllStorage);
  _cbCalendar=new CheckBox();
  _cbCalendar.setLabel(l10n.getString(L10nConstants.keys.WIPE_MENU_CALENDAR));
  _cbCalendar.setChecked(false);
  append(_cbCalendar);
  Button btn=new Button();
  btn.setOnClickListener(this);
  btn.setLabel(l10n.getString(L10nConstants.keys.MENU_WIPE_NOW));
  append(btn);
  load();
}

Fixed version (ground truth):
/** 
 * Constructs a screen that shows a <code>TextBox</code> component in action.
 * @param previous is the screen to return to once this done.
 */
public WipeManualForm(ITCMainMIDlet midlet){
  _midlet=midlet;
  try {
    _prefs=new Preferences(ITCConstants.PANIC_PREFS_DB);
  }
 catch (  RecordStoreException e) {
    Logger.error(ITCConstants.TAG,"String_Node_Str" + e,e);
  }
  setTitle(l10n.getString(L10nConstants.keys.TITLE_WIPE_MANUAL));
  Label label=new Label();
  label.setLabel(l10n.getString(L10nConstants.keys.WIPE_WARNING_MSG));
  label.setHorizontalAlignment(Graphics.LEFT);
  append(label);
  _cbContacts=new CheckBox();
  _cbContacts.setLabel(l10n.getString(L10nConstants.keys.WIPE_MENU_CONTACTS));
  _cbContacts.setChecked(false);
  append(_cbContacts);
  _cbCalendar=new CheckBox();
  _cbCalendar.setLabel(l10n.getString(L10nConstants.keys.WIPE_MENU_CALENDAR));
  _cbCalendar.setChecked(false);
  append(_cbCalendar);
  _cbPhotos=new CheckBox();
  _cbPhotos.setLabel(l10n.getString(L10nConstants.keys.WIPE_MENU_PHOTOS));
  _cbPhotos.setChecked(false);
  append(_cbPhotos);
  _cbAllStorage=new CheckBox();
  _cbAllStorage.setLabel(l10n.getString(L10nConstants.keys.WIPE_MENU_FILES));
  _cbAllStorage.setChecked(false);
  append(_cbAllStorage);
  _cbZeroStorage=new CheckBox();
  _cbZeroStorage.setLabel("String_Node_Str");
  _cbZeroStorage.setChecked(false);
  append(_cbZeroStorage);
  Button btn=new Button();
  btn.setOnClickListener(this);
  btn.setLabel(l10n.getString(L10nConstants.keys.MENU_WIPE_NOW));
  append(btn);
  load();
}
Program: 2944
Project: 2944
Buggy source:
public void commandAction(Command command,Displayable displayable){
  if (command == _cmdExit) {
    _wControl.cancel();
    _midlet.notifyDestroyed();
  }
}

Fixed version (ground truth):
public void commandAction(Command command,Displayable displayable){
  if (command == _cmdExit) {
    try {
      thread.interrupt();
    }
 catch (    Exception e) {
    }
    _midlet.showMainForm();
  }
}
Program: 2945
Project: 2945
Buggy source:
public void wipingFileError(String path,String err){
  errCount++;
  _lsCanvas.setLargeString(l10n.getString(L10nConstants.keys.WIPE_STATUS_WIPING_WORD) + currentType + "String_Node_Str"+ errCount);
}

Fixed version (ground truth):
public void wipingFileError(String path,String err){
  errCount++;
  _lsCanvas.setLargeString(l10n.getString(L10nConstants.keys.WIPE_STATUS_WIPING_WORD) + "String_Node_Str" + path+ "String_Node_Str"+ err);
}
Program: 2946
Project: 2946
Buggy source:
public LargeStringCanvas(String largeString){
  _largeString=largeString;
}

Fixed version (ground truth):
public LargeStringCanvas(String largeString){
  _largeString=processString(largeString);
}
Program: 2947
Project: 2947
Buggy source:
public void setLargeString(String largeString){
  _largeString=largeString;
  repaint();
}

Fixed version (ground truth):
public void setLargeString(String largeString){
  _largeString=processString(largeString);
  repaint();
}
Program: 2948
Project: 2948
Buggy source:
protected void paint(Graphics graphics){
  graphics.setColor(0,0,0);
  graphics.fillRect(0,0,getWidth(),getHeight());
  graphics.setColor(255,255,255);
  graphics.setFont(Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_LARGE));
  StringTokenizer st=new StringTokenizer(_largeString,"String_Node_Str");
  int startY=getHeight() / 2;
  while (st.hasMoreTokens()) {
    graphics.drawString(st.nextToken(),getWidth() / 2,startY,Graphics.HCENTER | Graphics.BASELINE);
    startY+=graphics.getFont().getHeight() + 3;
  }
}

Fixed version (ground truth):
protected void paint(Graphics graphics){
  graphics.setColor(0,0,0);
  graphics.fillRect(0,0,getWidth(),getHeight());
  graphics.setColor(255,255,255);
  graphics.setFont(Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_LARGE));
  StringTokenizer st=new StringTokenizer(_largeString,NEWLINE);
  int startY=getHeight() / 2;
  while (st.hasMoreTokens()) {
    graphics.drawString(st.nextToken(),getWidth() / 2,startY,Graphics.HCENTER | Graphics.BASELINE);
    startY+=graphics.getFont().getHeight() + 3;
  }
}
Program: 2949
Project: 2949
Buggy source:
public void run(){
  persist();
  WipeController wc=new WipeController();
  boolean wipePermsOk=wc.checkAllPermissions();
  if (wipePermsOk) {
    _midlet.showAlert(l10n.getString(L10nConstants.keys.SETUP_TITLE),l10n.getString(L10nConstants.keys.WIPE_MESSAGE_SAVED),_midlet.getNextScreenIdx());
  }
 else {
    _midlet.showAlert(l10n.getString(L10nConstants.keys.TITLE_ERROR),l10n.getString(L10nConstants.keys.ERROR_PIM_DATA),_midlet.getCurrentScreenIdx());
  }
}

Fixed version (ground truth):
public void run(){
  persist();
  WipeController wc=new WipeController();
  boolean wipePermsOk=false;
  try {
    Preferences prefs=new Preferences(PanicConstants.PANIC_PREFS_DB);
    String prefBool=prefs.get(PanicConstants.PREFS_KEY_WIPE_CONTACTS);
    boolean wipeContacts=(prefBool != null && prefBool.equals("String_Node_Str"));
    prefBool=prefs.get(PanicConstants.PREFS_KEY_WIPE_EVENTS);
    boolean wipeEvents=(prefBool != null && prefBool.equals("String_Node_Str"));
    prefBool=prefs.get(PanicConstants.PREFS_KEY_WIPE_PHOTOS);
    boolean wipePhotos=(prefBool != null && prefBool.equals("String_Node_Str"));
    prefBool=prefs.get(PanicConstants.PREFS_KEY_WIPE_ALL_FILES);
    boolean wipeAllFiles=(prefBool != null && prefBool.equals("String_Node_Str"));
    wipePermsOk=wc.checkPermissions(wipeContacts,wipeEvents,wipePhotos,wipeAllFiles);
  }
 catch (  Exception e) {
    wipePermsOk=false;
  }
 finally {
    if (wipePermsOk) {
      _midlet.showAlert(l10n.getString(L10nConstants.keys.SETUP_TITLE),l10n.getString(L10nConstants.keys.WIPE_MESSAGE_SAVED),_midlet.getNextScreenIdx());
    }
 else {
      _midlet.showAlert(l10n.getString(L10nConstants.keys.TITLE_ERROR),l10n.getString(L10nConstants.keys.ERROR_PIM_DATA),_midlet.getCurrentScreenIdx());
    }
  }
}
Program: 2952
Project: 2952
Buggy source:
private void doWipe(){
  checkedFolders=new ArrayList<File>();
  wc=new WipeController(getBaseContext());
  wc.wipePIMData(wipeSelector.get(0).getSelected(),wipeSelector.get(1).getSelected(),wipeSelector.get(2).getSelected(),wipeSelector.get(3).getSelected(),checkedFolders);
}

Fixed version (ground truth):
private void doWipe(){
  wc=new WipeController(getBaseContext());
  wc.wipePIMData(wipeSelector.get(0).getSelected(),wipeSelector.get(1).getSelected(),wipeSelector.get(2).getSelected(),wipeSelector.get(3).getSelected(),checkedFolders);
}