Hi, The checkstyle check should allow for these kinds of checks but since our core module had so many files, we didn't have time to go through them & fix them. Can you log a jira item for this & we can take care of it smaller chunks...
- Balaji -----Original Message----- From: Dain Sundstrom [mailto:[EMAIL PROTECTED] Sent: Friday, October 20, 2006 7:21 PM To: yoko-dev@incubator.apache.org Subject: Static fields and intialization I just committed a fix to a bug caused by static field initialization (YOKO-196). The bug was cause by a static initalizer calling a static method which accessed a static field. I was getting a NullPointerException because the static field was null because the static field was declared after the initializer. For example: public class Test { static { foo(); } private static final Object bar = new Object(); private static void foo() { System.out.println(bar); } public static void main(String[] args) throws Exception { foo(); } } This problem type of problem is very difficult to find and is easily avoided by putting all field declarations at the top of the file followed by any static initializers. What do you think of changing the coding standards to have all fields at the top of the file? -dain