Program: 72490
Project: 72490
Buggy source:
/** 
 * This generic method should call the   {@link EncodingHelpers} API providedby CERTI to handle type decoding operations for HLA value attribute that has been reflected.
 * @param hs The targeted HLA subcriber actor.
 * @param type The type to decode the token.
 * @param buffer The encoded value to decode.
 * @return The decoded value as an object.
 * @throws IllegalActionException If the token is not handled or thedecoding has failed.
 */
static public Object decodeHlaValue(HlaSubscriber hs,Type type,byte[] buffer) throws IllegalActionException {
  if (hs.useCertiMessageBuffer()) {
    ByteArrayInputStream bis=new ByteArrayInputStream(buffer);
    ByteArrayOutputStream bos=new ByteArrayOutputStream();
    MessageBuffer msgBuffer=new MessageBuffer(bis,bos);
    try {
      msgBuffer.receiveData();
    }
 catch (    Exception e) {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + e.getMessage());
    }
    if (type.equals(BaseType.BOOLEAN)) {
      return msgBuffer.readBoolean();
    }
 else     if (type.equals(BaseType.UNSIGNED_BYTE)) {
      return msgBuffer.readByte();
    }
 else     if (type.equals(BaseType.DOUBLE)) {
      return msgBuffer.readDouble();
    }
 else     if (type.equals(BaseType.FLOAT)) {
      return msgBuffer.readFloat();
    }
 else     if (type.equals(BaseType.INT)) {
      return msgBuffer.readInt();
    }
 else     if (type.equals(BaseType.LONG)) {
      return msgBuffer.readLong();
    }
 else     if (type.equals(BaseType.SHORT)) {
      return msgBuffer.readShort();
    }
 else     if (type.equals(BaseType.STRING)) {
      return msgBuffer.readString();
    }
 else {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
  }
  if (type.equals(BaseType.BOOLEAN)) {
    return EncodingHelpers.decodeBoolean(buffer);
  }
 else   if (type.equals(BaseType.UNSIGNED_BYTE)) {
    return EncodingHelpers.decodeByte(buffer);
  }
 else   if (type.equals(BaseType.DOUBLE)) {
    return EncodingHelpers.decodeDouble(buffer);
  }
 else   if (type.equals(BaseType.FLOAT)) {
    return EncodingHelpers.decodeFloat(buffer);
  }
 else   if (type.equals(BaseType.INT)) {
    return EncodingHelpers.decodeInt(buffer);
  }
 else   if (type.equals(BaseType.LONG)) {
    return EncodingHelpers.decodeLong(buffer);
  }
 else   if (type.equals(BaseType.SHORT)) {
    return EncodingHelpers.decodeShort(buffer);
  }
 else   if (type.equals(BaseType.STRING)) {
    return EncodingHelpers.decodeString(buffer);
  }
 else {
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * This generic method should call the   {@link EncodingHelpers} API providedby CERTI to handle type decoding operations for HLA value attribute that has been reflected.
 * @param hs The targeted HLA subcriber actor.
 * @param type The type to decode the token.
 * @param buffer The encoded value to decode.
 * @return The decoded value as an object.
 * @exception IllegalActionException If the token is not handled or thedecoding has failed.
 */
static public Object decodeHlaValue(HlaSubscriber hs,Type type,byte[] buffer) throws IllegalActionException {
  if (hs.useCertiMessageBuffer()) {
    ByteArrayInputStream bis=new ByteArrayInputStream(buffer);
    ByteArrayOutputStream bos=new ByteArrayOutputStream();
    MessageBuffer msgBuffer=new MessageBuffer(bis,bos);
    try {
      msgBuffer.receiveData();
    }
 catch (    Exception e) {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + e.getMessage());
    }
    if (type.equals(BaseType.BOOLEAN)) {
      return msgBuffer.readBoolean();
    }
 else     if (type.equals(BaseType.UNSIGNED_BYTE)) {
      return msgBuffer.readByte();
    }
 else     if (type.equals(BaseType.DOUBLE)) {
      return msgBuffer.readDouble();
    }
 else     if (type.equals(BaseType.FLOAT)) {
      return msgBuffer.readFloat();
    }
 else     if (type.equals(BaseType.INT)) {
      return msgBuffer.readInt();
    }
 else     if (type.equals(BaseType.LONG)) {
      return msgBuffer.readLong();
    }
 else     if (type.equals(BaseType.SHORT)) {
      return msgBuffer.readShort();
    }
 else     if (type.equals(BaseType.STRING)) {
      return msgBuffer.readString();
    }
 else {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
  }
  if (type.equals(BaseType.BOOLEAN)) {
    return EncodingHelpers.decodeBoolean(buffer);
  }
 else   if (type.equals(BaseType.UNSIGNED_BYTE)) {
    return EncodingHelpers.decodeByte(buffer);
  }
 else   if (type.equals(BaseType.DOUBLE)) {
    return EncodingHelpers.decodeDouble(buffer);
  }
 else   if (type.equals(BaseType.FLOAT)) {
    return EncodingHelpers.decodeFloat(buffer);
  }
 else   if (type.equals(BaseType.INT)) {
    return EncodingHelpers.decodeInt(buffer);
  }
 else   if (type.equals(BaseType.LONG)) {
    return EncodingHelpers.decodeLong(buffer);
  }
 else   if (type.equals(BaseType.SHORT)) {
    return EncodingHelpers.decodeShort(buffer);
  }
 else   if (type.equals(BaseType.STRING)) {
    return EncodingHelpers.decodeString(buffer);
  }
 else {
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str");
  }
}