Program: 155994
Project: 155994
Buggy source:
private void decodeD(Position position,ChannelBuffer buf,int selector,int event){
  if ((selector & 0x0008) != 0) {
    position.setValid((buf.readUnsignedByte() & 0x40) != 0);
  }
 else {
    getLastLocation(position,null);
  }
  if ((selector & 0x0004) != 0) {
    buf.skipBytes(4);
  }
  if ((selector & 0x0008) != 0) {
    position.setTime(new Date(buf.readUnsignedInt() * 1000));
    position.setLatitude(buf.readInt() / 1000000.0);
    position.setLongitude(buf.readInt() / 1000000.0);
    position.set(Position.KEY_SATELLITES_VISIBLE,buf.readUnsignedByte());
  }
  if ((selector & 0x0010) != 0) {
    position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));
    position.set("String_Node_Str",buf.readUnsignedByte());
    position.setCourse(buf.readUnsignedByte() * 2.0);
  }
  if ((selector & 0x0040) != 0) {
    position.set(Position.KEY_INPUT,buf.readUnsignedByte());
  }
  if ((selector & 0x0020) != 0) {
    position.set(Position.PREFIX_ADC + 1,buf.readUnsignedShort());
    position.set(Position.PREFIX_ADC + 2,buf.readUnsignedShort());
    position.set(Position.PREFIX_ADC + 3,buf.readUnsignedShort());
    position.set(Position.PREFIX_ADC + 4,buf.readUnsignedShort());
  }
  if ((selector & 0x8000) != 0) {
    position.set(Position.KEY_POWER,buf.readUnsignedShort() / 1000.0);
    position.set(Position.KEY_BATTERY,buf.readUnsignedShort());
  }
  if ((selector & 0x10000) != 0) {
    buf.readUnsignedShort();
    buf.readUnsignedInt();
  }
  if ((selector & 0x20000) != 0) {
    buf.readUnsignedShort();
    buf.readUnsignedInt();
  }
  if ((selector & 0x0080) != 0) {
    position.set("String_Node_Str",buf.readUnsignedInt());
  }
  if ((selector & 0x0100) != 0) {
    position.set("String_Node_Str",buf.readUnsignedInt());
  }
  if ((selector & 0x0040) != 0) {
    position.set(Position.KEY_OUTPUT,buf.readUnsignedByte());
  }
  if ((selector & 0x0200) != 0) {
    position.set(Position.KEY_RFID,(((long)buf.readUnsignedShort()) << 32) + buf.readUnsignedInt());
  }
  if ((selector & 0x0400) != 0) {
    buf.readUnsignedByte();
  }
  if ((selector & 0x0800) != 0) {
    position.setAltitude(buf.readShort());
  }
  if ((selector & 0x2000) != 0) {
    buf.readUnsignedShort();
  }
  if ((selector & 0x4000) != 0) {
    buf.skipBytes(8);
  }
  if ((selector & 0x80000) != 0) {
    buf.skipBytes(11);
  }
  if ((selector & 0x1000) != 0) {
    decodeEventData(position,buf,event);
  }
  if (Context.getConfig().getBoolean(getProtocolName() + "String_Node_Str") && buf.readable() && (selector & 0x1000) != 0 && event == EVENT_DATA) {
    decodeCanData(buf,position);
  }
}

Fixed version (ground truth):
private void decodeD(Position position,ChannelBuffer buf,int selector,int event){
  if ((selector & 0x0008) != 0) {
    position.setValid((buf.readUnsignedByte() & 0x40) != 0);
  }
 else {
    getLastLocation(position,null);
  }
  if ((selector & 0x0004) != 0) {
    buf.skipBytes(4);
  }
  if ((selector & 0x0008) != 0) {
    position.setTime(new Date(buf.readUnsignedInt() * 1000));
    position.setLatitude(buf.readInt() / 1000000.0);
    position.setLongitude(buf.readInt() / 1000000.0);
    position.set(Position.KEY_SATELLITES_VISIBLE,buf.readUnsignedByte());
  }
  if ((selector & 0x0010) != 0) {
    position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));
    position.set("String_Node_Str",buf.readUnsignedByte());
    position.setCourse(buf.readUnsignedByte() * 2.0);
  }
  if ((selector & 0x0040) != 0) {
    position.set(Position.KEY_INPUT,buf.readUnsignedByte());
  }
  if ((selector & 0x0020) != 0) {
    position.set(Position.PREFIX_ADC + 1,buf.readUnsignedShort());
    position.set(Position.PREFIX_ADC + 2,buf.readUnsignedShort());
    position.set(Position.PREFIX_ADC + 3,buf.readUnsignedShort());
    position.set(Position.PREFIX_ADC + 4,buf.readUnsignedShort());
  }
  if ((selector & 0x8000) != 0) {
    position.set(Position.KEY_POWER,buf.readUnsignedShort() * 0.001);
    position.set(Position.KEY_BATTERY,buf.readUnsignedShort() * 0.001);
  }
  if ((selector & 0x10000) != 0) {
    buf.readUnsignedShort();
    buf.readUnsignedInt();
  }
  if ((selector & 0x20000) != 0) {
    buf.readUnsignedShort();
    buf.readUnsignedInt();
  }
  if ((selector & 0x0080) != 0) {
    position.set("String_Node_Str",buf.readUnsignedInt());
  }
  if ((selector & 0x0100) != 0) {
    position.set("String_Node_Str",buf.readUnsignedInt());
  }
  if ((selector & 0x0040) != 0) {
    position.set(Position.KEY_OUTPUT,buf.readUnsignedByte());
  }
  if ((selector & 0x0200) != 0) {
    position.set(Position.KEY_RFID,(((long)buf.readUnsignedShort()) << 32) + buf.readUnsignedInt());
  }
  if ((selector & 0x0400) != 0) {
    buf.readUnsignedByte();
  }
  if ((selector & 0x0800) != 0) {
    position.setAltitude(buf.readShort());
  }
  if ((selector & 0x2000) != 0) {
    buf.readUnsignedShort();
  }
  if ((selector & 0x4000) != 0) {
    buf.skipBytes(8);
  }
  if ((selector & 0x80000) != 0) {
    buf.skipBytes(11);
  }
  if ((selector & 0x1000) != 0) {
    decodeEventData(position,buf,event);
  }
  if (Context.getConfig().getBoolean(getProtocolName() + "String_Node_Str") && buf.readable() && (selector & 0x1000) != 0 && event == EVENT_DATA) {
    decodeCanData(buf,position);
  }
}