Community
Participate
Working Groups
1. Given a class: class A { private final String a; public A(String a) { } } 2: Save this class. Eclipse will put an error marker on the ctor's parameter list, saying the final field "a" has not been initialized. 3. Put the cursor on the "a" parameter and open the quick fix list; the "Assign parameter to new field" quick fix should be available, but isn't.
Move to JDT/UI
moving to jdt.core The error range is on the constructor. Coulnd't you put it on the field name? Otherwise I have to evaluate again where the field is that is not initialized. I could look at the IProblem arguments to get the field name, but I try to avoid that to not force the IProblem to exacly spec what is where in the arguments.
No, the compiler is analyzing each constructor separately, and blames these which are not setting the field. The fix could be to only assign field in one of the constructors. So you could propose 2 fixes: - initialize in declaration - initialize in constructor
Martin, I opt to defer this for 3.1.
not for 3.1
*** Bug 101624 has been marked as a duplicate of this bug. ***
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.