Joe Soltzberg

61%
Flag icon
The doc comment should enumerate all of the method’s preconditions, which are the things that have to be true in order for a client to invoke it, and its postconditions, which are the things that will be true after the invocation has completed successfully. Typically, preconditions are described implicitly by the @throws tags for unchecked exceptions; each unchecked exception corresponds to a precondition violation. Also, preconditions can be specified along with the affected parameters in their @param tags.
Joe Soltzberg
I wish there was just an @precondition and @postcondition
Effective Java
Rate this book
Clear rating
Open Preview