Open Marcono1234 opened 3 years ago
The method RuntimeUtils.getAsReferenceWrapper(...) can cause precision loss:
RuntimeUtils.getAsReferenceWrapper(...)
Short.valueOf(String)
instanceof Number
primitiveValue()
Number
Double
Integer
The method
RuntimeUtils.getAsReferenceWrapper(...)
can cause precision loss:Short.valueOf(String)
(see also #29)instanceof Number
call is made and afterwards the respectiveprimitiveValue()
is called, e.g.: https://github.com/shannah/Java-Objective-C-Bridge/blob/473221aeef8f12ca9a659d899f3ca7092aed27ef/src/main/java/ca/weblite/objc/RuntimeUtils.java#L822 This can cause precision loss when the argument is of typeNumber
but 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.