[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Error when final fields (constants) not initialized at declaration

Java allows the following (at least till v1.4), but JDT marks both lines with errors, without the possibility to suppress it in Preferences -> Java -> Compiler -> Errors/Warnings:

MyClass
  {
  private final String MY_CONSTANT; // msg: "The empty final field MY_CONSTANT is possibly not initialized"

  MyClass()
    {
    MY_CONSTANT = "MyValue"; // msg: "The final field MyClass.MY_CONSTANT cannot be assigned"
    }
  }

Geri