Program: 155966
Project: 155966
Buggy source:
private Object decodeCan(Channel channel,SocketAddress remoteAddress,String sentence) throws ParseException {
  Position position=new Position();
  position.setProtocol(getProtocolName());
  int index=0;
  String[] values=sentence.split("String_Node_Str");
  index+=1;
  index+=1;
  DeviceSession deviceSession=getDeviceSession(channel,remoteAddress,values[index++]);
  position.setDeviceId(deviceSession.getDeviceId());
  index+=1;
  index+=1;
  index+=1;
  long reportMask=Long.parseLong(values[index++],16);
  if (BitUtil.check(reportMask,0)) {
    position.set(Position.KEY_VIN,values[index++]);
  }
  if (BitUtil.check(reportMask,1)) {
    position.set(Position.KEY_IGNITION,Integer.parseInt(values[index++]) > 0);
  }
  if (BitUtil.check(reportMask,2)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,3)) {
    position.set("String_Node_Str",Double.parseDouble(values[index++]));
  }
  if (BitUtil.check(reportMask,5)) {
    position.set(Position.KEY_RPM,Integer.parseInt(values[index++]));
  }
  if (BitUtil.check(reportMask,4)) {
    position.set(Position.KEY_OBD_SPEED,UnitsConverter.knotsFromKph(Integer.parseInt(values[index++])));
  }
  if (BitUtil.check(reportMask,6)) {
    position.set(Position.KEY_COOLANT_TEMP,Integer.parseInt(values[index++]));
  }
  if (BitUtil.check(reportMask,7)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,8)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,9)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,10)) {
    if (!values[index++].isEmpty()) {
      position.set(Position.KEY_THROTTLE,Integer.parseInt(values[index - 1]));
    }
  }
  if (BitUtil.check(reportMask,11)) {
    position.set(Position.KEY_HOURS,Double.parseDouble(values[index++]));
  }
  if (BitUtil.check(reportMask,12)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,13)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,14)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,15)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,16)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,17)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,18)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,19)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,20)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,21)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,29)) {
    index+=1;
  }
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  if (BitUtil.check(reportMask,30)) {
    position.setValid(Integer.parseInt(values[index++]) > 0);
    if (!values[index].isEmpty()) {
      position.setSpeed(UnitsConverter.knotsFromKph(Double.parseDouble(values[index++])));
      position.setCourse(Integer.parseInt(values[index++]));
      position.setAltitude(Double.parseDouble(values[index++]));
      position.setLongitude(Double.parseDouble(values[index++]));
      position.setLatitude(Double.parseDouble(values[index++]));
      position.setTime(dateFormat.parse(values[index++]));
    }
 else {
      index+=6;
      getLastLocation(position,null);
    }
  }
 else {
    getLastLocation(position,null);
  }
  if (BitUtil.check(reportMask,31)) {
    index+=4;
  }
  index+=1;
  if (ignoreFixTime) {
    position.setTime(dateFormat.parse(values[index]));
  }
 else {
    position.setDeviceTime(dateFormat.parse(values[index]));
  }
  return position;
}

Fixed version (ground truth):
private Object decodeCan(Channel channel,SocketAddress remoteAddress,String sentence) throws ParseException {
  Position position=new Position();
  position.setProtocol(getProtocolName());
  int index=0;
  String[] values=sentence.split("String_Node_Str");
  index+=1;
  index+=1;
  DeviceSession deviceSession=getDeviceSession(channel,remoteAddress,values[index++]);
  position.setDeviceId(deviceSession.getDeviceId());
  index+=1;
  index+=1;
  index+=1;
  long reportMask=Long.parseLong(values[index++],16);
  if (BitUtil.check(reportMask,0)) {
    position.set(Position.KEY_VIN,values[index++]);
  }
  if (BitUtil.check(reportMask,1)) {
    position.set(Position.KEY_IGNITION,Integer.parseInt(values[index++]) > 0);
  }
  if (BitUtil.check(reportMask,2)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,3)) {
    position.set("String_Node_Str",Double.parseDouble(values[index++]));
  }
  if (BitUtil.check(reportMask,5)) {
    position.set(Position.KEY_RPM,Integer.parseInt(values[index++]));
  }
  if (BitUtil.check(reportMask,4)) {
    position.set(Position.KEY_OBD_SPEED,UnitsConverter.knotsFromKph(Integer.parseInt(values[index++])));
  }
  if (BitUtil.check(reportMask,6)) {
    position.set(Position.KEY_COOLANT_TEMP,Integer.parseInt(values[index++]));
  }
  if (BitUtil.check(reportMask,7)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,8)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,9)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,10) && !values[index++].isEmpty()) {
    position.set(Position.KEY_THROTTLE,Integer.parseInt(values[index - 1]));
  }
  if (BitUtil.check(reportMask,11)) {
    position.set(Position.KEY_HOURS,Double.parseDouble(values[index++]));
  }
  if (BitUtil.check(reportMask,12)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,13)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,14)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,15)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,16)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,17)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,18)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,19)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,20)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,21)) {
    index+=1;
  }
  if (BitUtil.check(reportMask,29)) {
    index+=1;
  }
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  if (BitUtil.check(reportMask,30)) {
    position.setValid(Integer.parseInt(values[index++]) > 0);
    if (!values[index].isEmpty()) {
      position.setSpeed(UnitsConverter.knotsFromKph(Double.parseDouble(values[index++])));
      position.setCourse(Integer.parseInt(values[index++]));
      position.setAltitude(Double.parseDouble(values[index++]));
      position.setLongitude(Double.parseDouble(values[index++]));
      position.setLatitude(Double.parseDouble(values[index++]));
      position.setTime(dateFormat.parse(values[index++]));
    }
 else {
      index+=6;
      getLastLocation(position,null);
    }
  }
 else {
    getLastLocation(position,null);
  }
  if (BitUtil.check(reportMask,31)) {
    index+=4;
  }
  index+=1;
  if (ignoreFixTime) {
    position.setTime(dateFormat.parse(values[index]));
  }
 else {
    position.setDeviceTime(dateFormat.parse(values[index]));
  }
  return position;
}