Bug: Result of integer multiplication cast to long
Pattern id: ICAST_INTEGER_MULTIPLY_CAST_TO_LONG, type: ICAST, category: STYLE
This code performs integer multiply and then converts the result to a long, as in:
long convertDaysToMilliseconds\(int days\) \{ return 1000\*3600\*24\*days; \}
If the multiplication is done using long arithmetic, you can avoid the possibility that the result will overflow. For example, you could fix the above code to:
long convertDaysToMilliseconds\(int days\) \{ return 1000L\*3600\*24\*days; \}
Fixing this eliminates 1 FindBugs issue
Patch sent for community review. During a 2 week period any
exploiter may comment on the patch, request changes or turn it
down completely (with good reason). For the time being the patch is part of the "Experimental" branch in CVS.
Patch against HEAD
The community review has completed and we received no substantial critisism. Therefore the patch has been approved and merged into the "HEAD" branch. The next release will pick it up.
The patch was picked up by release 2.1.6 and will therefore be closed.