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 3. Declarations and Initialization (DCL)

Rules

Image

Risk Assessment Summary

Image

DCL00-J. Prevent class initialization cycles

According to the Java Language Specification (JLS), §12.4, “Initialization of Classes and Interfaces” [JLS 2005]:

Initialization of a class consists of executing its static initializers and the initializers for static fields (class variables) declared in the class.

In other words, the presence of a static field triggers the initialization of a class. However, a static field could also depend on the initialization of another ...

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