Program: 156028
Project: 156028
Buggy source:
@Override protected Object decode(Channel channel,SocketAddress remoteAddress,Object msg) throws Exception {
  String sentence=(String)msg;
  Parser parser=new Parser(PATTERN,sentence);
  if (!parser.matches()) {
    return null;
  }
  Position position=new Position();
  position.setProtocol(getProtocolName());
  String type=parser.next();
  if (type.startsWith("String_Node_Str")) {
    if (channel != null) {
      channel.write("String_Node_Str" + type.substring(3) + "String_Node_Str");
    }
  }
  position.set(Position.KEY_ALARM,decodeAlarm(type));
  DeviceSession deviceSession=getDeviceSession(channel,remoteAddress,parser.next());
  if (deviceSession == null) {
    return null;
  }
  position.setDeviceId(deviceSession.getDeviceId());
  DateBuilder dateBuilder=new DateBuilder().setTime(parser.nextInt(),parser.nextInt(),parser.nextInt(),parser.nextInt());
  position.setValid(parser.next().equals("String_Node_Str"));
  position.setLatitude(parser.nextCoordinate());
  position.setLongitude(parser.nextCoordinate());
  position.setSpeed(parser.nextDouble());
  position.setCourse(parser.nextDouble());
  dateBuilder.setDateReverse(parser.nextInt(),parser.nextInt(),parser.nextInt());
  position.setTime(dateBuilder.getDate());
  position.set(Position.KEY_INPUT,parser.next());
  position.set(Position.KEY_OUTPUT,parser.next());
  if (parser.hasNext()) {
    String[] values=parser.next().split("String_Node_Str");
    for (int i=0; i < values.length; i++) {
      position.set(Position.PREFIX_ADC + (i + 1),Integer.parseInt(values[i],16));
    }
  }
  position.set(Position.KEY_ODOMETER,parser.nextInt());
  position.set(Position.KEY_RFID,parser.next());
  if (parser.hasNext()) {
    int value=parser.nextInt(16);
    position.set(Position.KEY_BATTERY,value >> 8);
    position.set(Position.KEY_GSM,(value >> 4) & 0xf);
    position.set(Position.KEY_SATELLITES,value & 0xf);
  }
  return position;
}

Fixed version (ground truth):
@Override protected Object decode(Channel channel,SocketAddress remoteAddress,Object msg) throws Exception {
  String sentence=(String)msg;
  Parser parser=new Parser(PATTERN,sentence);
  if (!parser.matches()) {
    return null;
  }
  Position position=new Position();
  position.setProtocol(getProtocolName());
  String type=parser.next();
  if (type.startsWith("String_Node_Str") && channel != null) {
    channel.write("String_Node_Str" + type.substring(3) + "String_Node_Str");
  }
  position.set(Position.KEY_ALARM,decodeAlarm(type));
  DeviceSession deviceSession=getDeviceSession(channel,remoteAddress,parser.next());
  if (deviceSession == null) {
    return null;
  }
  position.setDeviceId(deviceSession.getDeviceId());
  DateBuilder dateBuilder=new DateBuilder().setTime(parser.nextInt(),parser.nextInt(),parser.nextInt(),parser.nextInt());
  position.setValid(parser.next().equals("String_Node_Str"));
  position.setLatitude(parser.nextCoordinate());
  position.setLongitude(parser.nextCoordinate());
  position.setSpeed(parser.nextDouble());
  position.setCourse(parser.nextDouble());
  dateBuilder.setDateReverse(parser.nextInt(),parser.nextInt(),parser.nextInt());
  position.setTime(dateBuilder.getDate());
  position.set(Position.KEY_INPUT,parser.next());
  position.set(Position.KEY_OUTPUT,parser.next());
  if (parser.hasNext()) {
    String[] values=parser.next().split("String_Node_Str");
    for (int i=0; i < values.length; i++) {
      position.set(Position.PREFIX_ADC + (i + 1),Integer.parseInt(values[i],16));
    }
  }
  position.set(Position.KEY_ODOMETER,parser.nextInt());
  position.set(Position.KEY_RFID,parser.next());
  if (parser.hasNext()) {
    int value=parser.nextInt(16);
    position.set(Position.KEY_BATTERY,value >> 8);
    position.set(Position.KEY_GSM,(value >> 4) & 0xf);
    position.set(Position.KEY_SATELLITES,value & 0xf);
  }
  return position;
}