I don't know of a compile-time options.
Puzzle 93: Class Warfare, in the Java Puzzlers book discusses this. There can be bugs produced since null does not get "inlined".
There's a workaround to refer to them via a do-nothing function, e.g.:
public class Words {
private Words() { }; // Uninstantiable
public static final String FIRST = ident("the");
public static final String SECOND = ident(null);
public static final String THIRD = ident("set");
private static String ident(String s) {
return s;
}
}
Obviously, this requires modifying your source code extensively. Not what you wanted...
Either buy the book, or see here for a more complete discussion