Arithmetic Overflow Errors
807601May 20 2008 — edited May 20 2008I remember that when Java was first introduced, one of the major design goals of the language was to eliminate common programmer errors. For example, instead of trusting the programmer to read the documentation of a given function to learn that they needed to test for a negative return value as an error, java included a very rigorous exception handling requirement. The developer who wrote a method would declare which exceptions it could throw and those using the method were required to account for those exceptions.
I'm now starting to work with Java on a full time basis and was reviewing the arithmetic rules. I couldn't believe it when I discovered that overflowing an integer value doesn't cause an arithmetic overflow error!
Am I missing something, or is that a major deviation from the stated language design goals?!