moa icon indicating copy to clipboard operation
moa copied to clipboard

MOAObject measureByteSize() could return negative value if the size is > 2^31-1

Open nuwangunasekara opened this issue 2 years ago • 1 comments

MOAObject measureByteSize() could return negative value if the size is > 2^31-1:

`

public interface MOAObject extends Serializable {

/**
 * Gets the memory size of this object.
 *
 * @return the memory size of this object
 */
public int measureByteSize();

/**
 * This method produces a copy of this object.
 *
 * @return a copy of this object
 */
public MOAObject copy();

/**
 * Returns a string representation of this object.
 * Used in <code>AbstractMOAObject.toString</code>
 * to give a string representation of the object.
 *
 * @param sb	the stringbuilder to add the description
 * @param indent	the number of characters to indent
 */
public void getDescription(StringBuilder sb, int indent);

} `

nuwangunasekara avatar Mar 07 '23 09:03 nuwangunasekara

Patch with relevant changes to support models with size greater than 2^31-1: moa_measureByteSize.patch

nuwangunasekara avatar Mar 10 '23 02:03 nuwangunasekara