Provides a quick fix to replace initialization of a field via assignment with a field initializer. The code is highlighted only if field initializer is located in the initializer and joining with the field declaration is likely to be safe. In other cases the inspection provides the quick fix without highlighting, as it may change the code semantics.

Example:

  class MyClass {
    static final int intConstant;
    
    static {
      intConstant = 10;
    }
  }
The quick fix will move the assigned value to the field initializer removing the class initializer section if possible:
  class MyClass {
    static final int intConstant = 10;
  }
Since 2017.2