Program: 155972
Project: 155972
Buggy source:
private Position decode235(Channel channel,SocketAddress remoteAddress,String protocol,String[] values) throws ParseException {
  int index=0;
  String type=values[index++].substring(5);
  if (!type.equals("String_Node_Str") && !type.equals("String_Node_Str") && !type.equals("String_Node_Str")&& !type.equals("String_Node_Str")) {
    return null;
  }
  Position position=new Position();
  position.setProtocol(getProtocolName());
  if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    position.set(Position.KEY_ALARM,Position.ALARM_GENERAL);
  }
  DeviceSession deviceSession=getDeviceSession(channel,remoteAddress,values[index++]);
  if (deviceSession == null) {
    return null;
  }
  position.setDeviceId(deviceSession.getDeviceId());
  if (protocol.equals("String_Node_Str") || protocol.equals("String_Node_Str")) {
    index+=1;
  }
  position.set(Position.KEY_VERSION_FW,values[index++]);
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  position.setTime(dateFormat.parse(values[index++] + values[index++]));
  if (!protocol.equals("String_Node_Str")) {
    index+=1;
  }
  position.setLatitude(Double.parseDouble(values[index++]));
  position.setLongitude(Double.parseDouble(values[index++]));
  position.setSpeed(UnitsConverter.knotsFromKph(Double.parseDouble(values[index++])));
  position.setCourse(Double.parseDouble(values[index++]));
  position.set(Position.KEY_SATELLITES,Integer.parseInt(values[index++]));
  position.setValid(values[index++].equals("String_Node_Str"));
  position.set(Position.KEY_ODOMETER,Integer.parseInt(values[index++]));
  position.set(Position.KEY_POWER,Double.parseDouble(values[index++]));
  position.set(Position.PREFIX_IO + 1,values[index++]);
  index+=1;
  if (type.equals("String_Node_Str")) {
    position.set(Position.KEY_INDEX,Integer.parseInt(values[index++]));
  }
  if (hbm) {
    if (index < values.length) {
      position.set(Position.KEY_HOURS,Integer.parseInt(values[index++]));
    }
    if (index < values.length) {
      position.set(Position.KEY_BATTERY,Double.parseDouble(values[index++]));
    }
    if (index < values.length) {
      if (values[index++].equals("String_Node_Str")) {
        position.set(Position.KEY_ARCHIVE,true);
      }
    }
    if (includeAdc) {
      position.set(Position.PREFIX_ADC + 1,Double.parseDouble(values[index++]));
      position.set(Position.PREFIX_ADC + 2,Double.parseDouble(values[index++]));
      position.set(Position.PREFIX_ADC + 3,Double.parseDouble(values[index++]));
    }
    if (values.length - index >= 2) {
      String driverUniqueId=values[index++];
      if (values[index++].equals("String_Node_Str") && !driverUniqueId.isEmpty()) {
        position.set(Position.KEY_DRIVER_UNIQUE_ID,driverUniqueId);
      }
    }
    if (includeTemp) {
      for (int i=1; i <= 3; i++) {
        String temperature=values[index++];
        String value=temperature.substring(temperature.indexOf(':') + 1);
        if (!value.isEmpty()) {
          position.set(Position.PREFIX_TEMP + i,Double.parseDouble(value));
        }
      }
    }
  }
  return position;
}

Fixed version (ground truth):
private Position decode235(Channel channel,SocketAddress remoteAddress,String protocol,String[] values) throws ParseException {
  int index=0;
  String type=values[index++].substring(5);
  if (!type.equals("String_Node_Str") && !type.equals("String_Node_Str") && !type.equals("String_Node_Str")&& !type.equals("String_Node_Str")) {
    return null;
  }
  Position position=new Position();
  position.setProtocol(getProtocolName());
  if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    position.set(Position.KEY_ALARM,Position.ALARM_GENERAL);
  }
  DeviceSession deviceSession=getDeviceSession(channel,remoteAddress,values[index++]);
  if (deviceSession == null) {
    return null;
  }
  position.setDeviceId(deviceSession.getDeviceId());
  if (protocol.equals("String_Node_Str") || protocol.equals("String_Node_Str")) {
    index+=1;
  }
  position.set(Position.KEY_VERSION_FW,values[index++]);
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  position.setTime(dateFormat.parse(values[index++] + values[index++]));
  if (!protocol.equals("String_Node_Str")) {
    index+=1;
  }
  position.setLatitude(Double.parseDouble(values[index++]));
  position.setLongitude(Double.parseDouble(values[index++]));
  position.setSpeed(UnitsConverter.knotsFromKph(Double.parseDouble(values[index++])));
  position.setCourse(Double.parseDouble(values[index++]));
  position.set(Position.KEY_SATELLITES,Integer.parseInt(values[index++]));
  position.setValid(values[index++].equals("String_Node_Str"));
  position.set(Position.KEY_ODOMETER,Integer.parseInt(values[index++]));
  position.set(Position.KEY_POWER,Double.parseDouble(values[index++]));
  position.set(Position.PREFIX_IO + 1,values[index++]);
  index+=1;
  if (type.equals("String_Node_Str")) {
    position.set(Position.KEY_INDEX,Integer.parseInt(values[index++]));
  }
  if (hbm) {
    if (index < values.length) {
      position.set(Position.KEY_HOURS,Integer.parseInt(values[index++]));
    }
    if (index < values.length) {
      position.set(Position.KEY_BATTERY,Double.parseDouble(values[index++]));
    }
    if (index < values.length && values[index++].equals("String_Node_Str")) {
      position.set(Position.KEY_ARCHIVE,true);
    }
    if (includeAdc) {
      position.set(Position.PREFIX_ADC + 1,Double.parseDouble(values[index++]));
      position.set(Position.PREFIX_ADC + 2,Double.parseDouble(values[index++]));
      position.set(Position.PREFIX_ADC + 3,Double.parseDouble(values[index++]));
    }
    if (values.length - index >= 2) {
      String driverUniqueId=values[index++];
      if (values[index++].equals("String_Node_Str") && !driverUniqueId.isEmpty()) {
        position.set(Position.KEY_DRIVER_UNIQUE_ID,driverUniqueId);
      }
    }
    if (includeTemp) {
      for (int i=1; i <= 3; i++) {
        String temperature=values[index++];
        String value=temperature.substring(temperature.indexOf(':') + 1);
        if (!value.isEmpty()) {
          position.set(Position.PREFIX_TEMP + i,Double.parseDouble(value));
        }
      }
    }
  }
  return position;
}