...
There are 22 possible narrowing primitive conversions in Java. According to the Java Language Specification, §5.1.3, "Narrowing Primitive Conversions" ,:
short
tobyte
orchar
char
tobyte
orshort
int
tobyte
,short
, orchar
long
tobyte
,short
,char
, orint
float
tobyte
,short
,char
,int
, orlong
double
tobyte
,short
,char
,int
,long
, orfloat
...
INT31-C. Ensure that integer conversions do not result in lost or misinterpreted data | ||||
| FLP34-C. Ensure that floating point conversions are within range of the new type | |||
INT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted data | ||||
| FLP34-CPP. Ensure that floating point conversions are within range of the new type | |||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8bd2f1c3e8aa4431-8aeb5d68-452a4a49-84ca91ac-bff6d268af4711c9220eff51"><ac:plain-text-body><![CDATA[ | [ISO/IEC TR 24772:2010 | http://www.aitcnet.org/isai/] | "Numeric Conversion Errors [FLC]" | ]]></ac:plain-text-body></ac:structured-macro> |
CWE-681, "Incorrect Conversion between Numeric Types" | ||||
| CWE-197, "Numeric Truncation Error" |
...