Program: 156050
Project: 156050
Buggy source:
@Override protected Object decode(Channel channel,SocketAddress remoteAddress,Object msg) throws Exception {
  Parser parser=new Parser(PATTERN,(String)msg);
  if (!parser.matches()) {
    return null;
  }
  Position position=new Position();
  position.setProtocol(getProtocolName());
  position.set(Position.KEY_TYPE,parser.nextInt());
  if (!identify(parser.next(),channel,remoteAddress)) {
    return null;
  }
  position.setDeviceId(getDeviceId());
  DateBuilder dateBuilder=new DateBuilder().setDateReverse(parser.nextInt(),parser.nextInt(),parser.nextInt()).setTime(parser.nextInt(),parser.nextInt(),parser.nextInt());
  position.setTime(dateBuilder.getDate());
  if ("String_Node_Str".equals(parser.next())) {
    position.setValid(true);
  }
 else {
    position.setValid(false);
  }
  position.setLatitude(parser.nextCoordinate(CoordinateFormat.DEG_MIN_MIN_HEM));
  position.setLongitude(parser.nextCoordinate(CoordinateFormat.DEG_MIN_MIN_HEM));
  position.setSpeed(parser.nextDouble());
  position.setCourse(parser.nextDouble());
  position.set(Position.KEY_SATELLITES,parser.nextInt());
  position.set(Position.KEY_GSM,parser.nextInt());
  parser.next();
  position.set(Position.KEY_POWER,parser.nextInt());
  position.set(Position.KEY_BATTERY,parser.nextDouble());
  position.set(Position.KEY_ALARM,parser.nextInt());
  parser.nextInt();
  parser.nextInt();
  position.set(Position.KEY_IGNITION,parser.nextInt());
  position.set(Position.KEY_OUTPUT,parser.nextInt());
  position.set(Position.PREFIX_ADC + 1,parser.nextInt());
  position.set(Position.PREFIX_ADC + 2,parser.nextInt());
  position.set(Position.KEY_VERSION,parser.next());
  position.set(Position.KEY_ARCHIVE,parser.next().equals("String_Node_Str"));
  parser.next();
  return position;
}

Fixed version (ground truth):
@Override protected Object decode(Channel channel,SocketAddress remoteAddress,Object msg) throws Exception {
  Parser parser=new Parser(PATTERN,(String)msg);
  if (!parser.matches()) {
    return null;
  }
  Position position=new Position();
  position.setProtocol(getProtocolName());
  position.set(Position.KEY_TYPE,parser.nextInt());
  if (!identify(parser.next(),channel,remoteAddress)) {
    return null;
  }
  position.setDeviceId(getDeviceId());
  DateBuilder dateBuilder=new DateBuilder().setDateReverse(parser.nextInt(),parser.nextInt(),parser.nextInt()).setTime(parser.nextInt(),parser.nextInt(),parser.nextInt());
  position.setTime(dateBuilder.getDate());
  position.setValid(parser.next().equals("String_Node_Str"));
  position.setLatitude(parser.nextCoordinate(CoordinateFormat.DEG_MIN_MIN_HEM));
  position.setLongitude(parser.nextCoordinate(CoordinateFormat.DEG_MIN_MIN_HEM));
  position.setSpeed(parser.nextDouble());
  position.setCourse(parser.nextDouble());
  position.set(Position.KEY_SATELLITES,parser.nextInt());
  position.set(Position.KEY_GSM,parser.nextInt());
  parser.next();
  position.set(Position.KEY_POWER,parser.nextInt());
  position.set(Position.KEY_BATTERY,parser.nextDouble());
  position.set(Position.KEY_ALARM,parser.nextInt());
  parser.nextInt();
  parser.nextInt();
  position.set(Position.KEY_IGNITION,parser.nextInt());
  position.set(Position.KEY_OUTPUT,parser.nextInt());
  position.set(Position.PREFIX_ADC + 1,parser.nextInt());
  position.set(Position.PREFIX_ADC + 2,parser.nextInt());
  position.set(Position.KEY_VERSION,parser.next());
  position.set(Position.KEY_ARCHIVE,parser.next().equals("String_Node_Str"));
  parser.next();
  return position;
}