Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: valud ==> value; minor grammar tweaks

...

  • A valid object or null
  • An integer indicating a positive valudvalue, or -1 to indicate that an error occurred
  • An array of valid objects or null indicating no valid objects

...

In Java, the best way to indicate an exceptional situation is by throwing an exception rather than by returning an error code. Exceptions cannot are propagated across scopes and cannot be ignored in the same way that error codes can, and exceptions are propagated across scopes. When using exceptions, the error-detection and error-handling code is kept separate from the main flow of control. Also, exceptions can be used in situations where error codes cannot be returned (in constructors, for example).

...

Given the comparatively rare occurrence of in-band error indicators in Java, it may be possible to compile a list of all methods that use them and automatically detect their use. However, detecting the safe use of in-band error indicators is not feasible in full generality.

Bibliography

...