O'Reilly logo

The CERT® Oracle® Secure Coding Standard for Java™ by David Svoboda, Dean F. Sutherland, Robert C. Seacord, Dhruv Mohindra, Fred Long

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Methods (MET)

Rules

Image

Risk Assessment Summary

Image

MET00-J. Validate method arguments

Validate method arguments to ensure that they fall within the bounds of the method’s intended design. This practice ensures that operations on the method’s parameters yield valid results. Failure to validate method arguments can result in incorrect calculations, runtime exceptions, violation of class invariants, and inconsistent object state.

Redundant testing of arguments by both the caller and the callee is a style of defensive programming that is largely ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required