static
.
An instance initializer may be static if it does not reference any of its class' non-static members. Static initializers are executed once the class is resolved, while instance initializers are executed on each instantiation of the class.
Example:
class A {
public static String CONSTANT;
{
CONSTANT = "Hello";
}
}
After the quick-fix is applied:
class A {
public static String CONSTANT;
static {
CONSTANT = "Hello"; //now initialized only once per class
}
}