Then you go too far and try something weird and exotic like, oh, I don't know:
int sucker = thisMethodReallyReturnsAnIntegerNotAnInt();
No squiggly red line in your Eclipse editor. Cool! That must mean this will work! Because Java has static typing, and you can count on that! Yea you!
The problem is, it will work. It will work very nearly all the time. It will work until your method returns a
null
instead of an actual Integer
. At which point you'll get a NullPointerException buried in your Struts 2 / OGNL / JSP project's Eclipse console stack trace, followed by a two-hour detour into the debugger wondering what the heck is going on. I mean after all, your code compiled, right? It worked for the first hour, right? Static typing is good, right? Autoboxing works, right?Not that you're bitter.