Program: 2909
Project: 2909
Buggy source:
@Override public StateReturnValue execute(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder) throws DecodingException {
  String line=IcapDecoderUtil.readLine(buffer,icapMessageDecoder.maxInitialLineLength);
  int chunkSize=IcapDecoderUtil.getChunkSize(line);
  icapMessageDecoder.currentChunkSize=chunkSize;
  if (chunkSize == -1) {
    icapMessageDecoder.currentChunkSize=0;
    IcapDecoderUtil.readLine(buffer,Integer.MAX_VALUE);
    return StateReturnValue.createRelevantResultWithDecisionInformation(new DefaultIcapChunkTrailer(true,true),DecisionState.IS_LAST_PREVIEW_CHUNK);
  }
 else   if (chunkSize == 0) {
    byte previewByte=buffer.getByte(buffer.readerIndex() + 1);
    if (previewByte == IcapCodecUtil.CR | previewByte == IcapCodecUtil.LF) {
      IcapDecoderUtil.readLine(buffer,10);
      if (icapMessageDecoder.message.isPreviewMessage()) {
        return StateReturnValue.createRelevantResultWithDecisionInformation(new DefaultIcapChunkTrailer(true,false),DecisionState.IS_LAST_PREVIEW_CHUNK);
      }
 else {
        return StateReturnValue.createRelevantResultWithDecisionInformation(new DefaultIcapChunkTrailer(icapMessageDecoder.message.isPreviewMessage(),false),DecisionState.IS_LAST_CHUNK);
      }
    }
 else {
      return StateReturnValue.createIrrelevantResultWithDecisionInformation(DecisionState.READ_TRAILING_HEADERS);
    }
  }
 else {
    icapMessageDecoder.currentChunkSize=chunkSize;
    if (chunkSize >= icapMessageDecoder.maxChunkSize) {
      return StateReturnValue.createIrrelevantResultWithDecisionInformation(DecisionState.READ_HUGE_CHUNK_IN_SMALER_CHUNKS);
    }
 else {
      return StateReturnValue.createIrrelevantResultWithDecisionInformation(DecisionState.READ_CHUNK);
    }
  }
}

Fixed version (ground truth):
@Override public StateReturnValue execute(ChannelBuffer buffer,IcapMessageDecoder icapMessageDecoder) throws DecodingException {
  int chunkSize=0;
  String previewLine=IcapDecoderUtil.previewLine(buffer,icapMessageDecoder.maxInitialLineLength);
  try {
    chunkSize=IcapDecoderUtil.getChunkSize(previewLine);
    IcapDecoderUtil.readLine(buffer,icapMessageDecoder.maxInitialLineLength);
  }
 catch (  DecodingException de) {
    return StateReturnValue.createIrrelevantResultWithDecisionInformation(DecisionState.RESET);
  }
  icapMessageDecoder.currentChunkSize=chunkSize;
  if (chunkSize > 0) {
    if (chunkSize >= icapMessageDecoder.maxChunkSize) {
      return StateReturnValue.createIrrelevantResultWithDecisionInformation(DecisionState.READ_HUGE_CHUNK_IN_SMALER_CHUNKS);
    }
 else {
      return StateReturnValue.createIrrelevantResultWithDecisionInformation(DecisionState.READ_CHUNK);
    }
  }
 else   if (chunkSize == -1) {
    icapMessageDecoder.currentChunkSize=0;
    IcapDecoderUtil.readLine(buffer,Integer.MAX_VALUE);
    return StateReturnValue.createRelevantResultWithDecisionInformation(new DefaultIcapChunkTrailer(true,true),DecisionState.IS_LAST_PREVIEW_CHUNK);
  }
 else   if (chunkSize == 0) {
    if (!checkForLineBreak(buffer)) {
      return StateReturnValue.createIrrelevantResultWithDecisionInformation(DecisionState.READ_TRAILING_HEADERS);
    }
    IcapDecoderUtil.readLine(buffer,10);
    if (icapMessageDecoder.message.isPreviewMessage()) {
      return StateReturnValue.createRelevantResultWithDecisionInformation(new DefaultIcapChunkTrailer(true,false),DecisionState.IS_LAST_PREVIEW_CHUNK);
    }
 else {
      return StateReturnValue.createRelevantResultWithDecisionInformation(new DefaultIcapChunkTrailer(icapMessageDecoder.message.isPreviewMessage(),false),DecisionState.IS_LAST_CHUNK);
    }
  }
 else {
    return StateReturnValue.createIrrelevantResultWithDecisionInformation(DecisionState.RESET);
  }
}