-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
The method RuntimeUtils.getAsReferenceWrapper(...) can cause precision loss:
val = new Integer(Integer.parseInt((String)val)).shortValue();
This should very likely useShort.valueOf(String)(see also Remove redundant primitive boxing in RuntimeUtils.getAsReferenceWrapper(...) #29)- There are multiple cases where an
instanceof Numbercall is made and afterwards the respectiveprimitiveValue()is called, e.g.:
val = ((Number)val).intValue();
This can cause precision loss when the argument is of typeNumberbut is a larger type or conversion from floating point to integer type is performed, e.g.Double->Integer
Not sure if this can be easily made safer without breaking backward compability.
Metadata
Metadata
Assignees
Labels
No labels