Created
February 24, 2016 19:21
-
-
Save anonymous/f19684aa2d1a740751b0 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
jInt = createObject("java", "java.lang.Integer"); | |
jLong = createObject("java", "java.lang.Long"); | |
writeDump({IntegerMaximum = jInt.MAX_VALUE, LongMaximum=jLong.MAX_VALUE}); | |
// this works, because the result is still within the bounds of java.lang.Integer | |
writeDump({IntegerDivisionResult = (jInt.MAX_VALUE \ 1)}); | |
// this fails, because the result exceeds the bounds of java.lang.Integer | |
try { | |
writeDump({LongResult= (jLong.MAX_VALUE \ 1)}); | |
} | |
catch(any e) { | |
writeDump(e); | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment