View by Classes

Findings - Overview

info Result of integer multiplication cast to long (Findbugs)

Further info on the wiki.

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; } 
or
 
	static final long MILLISECONDS_PER_DAY = 24L*3600*1000;
	long convertDaysToMilliseconds(int days) { return days * MILLISECONDS_PER_DAY; } 

5org.jcoderz.commons.util.Base64UtilTest
Result of integer multiplication cast to long in org.jcoderz.commons.util.Base64UtilTest.xxxtestDecodePerformance() (test code) [182],
Result of integer multiplication cast to long in org.jcoderz.commons.util.Base64UtilTest.xxxtestEncodePerformance() (test code) [133],
Result of integer multiplication cast to long in org.jcoderz.commons.util.Base64UtilTest.xxxtestEncodePerformance2() (test code) [165],
Result of integer multiplication cast to long in org.jcoderz.commons.util.Base64UtilTest.xxxtestEncodePerformanceRef() (test code) [117],
Result of integer multiplication cast to long in org.jcoderz.commons.util.Base64UtilTest.xxxtestEncodePerformanceRef2() (test code) [149]