Given the class:
class Test {
public Test() {
Object obj = new Object();
obj.hashCode();
}
}
If you do an "introduce field" refactoring on obj and choose "Initialize in
class constructor" with "make final" ticked, it gives:
class Test {
private final Object obj;
public Test() {
obj.hashCode();
obj = new Object();
}
}
Which is a compile-time error since the final obj is being used before it is
initialized. If you don't choose "make final" it is potentially even worse
since the initialization occurs after the usage, but the compiler will not
pick this up.
I believe the fix to this is something like:
For "introduce field" with "initialize in class constructor":
If the line is in a constructor, place the initialization on this same line
in this constructor.
==============================================================================
This email and any files transmitted with it are confidential and intended solely for
the use of the individual or entity to whom they are addressed. All information is the
view of the individual and not necessarily the company. If you are not the intended
recipient you are hereby notified that any dissemination, distribution, or copying of
this communication and its attachments is strictly prohibited. If you have received
this email in error please notify:
[EMAIL PROTECTED]
==============================================================================
_______________________________________________
Eap-bugs mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-bugs