Duplicate :
|
It would be helpful to add clarifying text describing the error behavior of methods that look up or return types and elements. In particular, it would be good to have a strong recommendation that errors due to external issues (as compared to errors in the implementation!) should generally not cause implementation-specific exceptions or overly broad standard unchecked throwable types, like Error or RuntimeException. Instead, suitably synthesized objects should be returned, that can be checked to determine whether they are "valid" or "erroneous".