Hi Thomas.
> Sorry, I forgot to mention that, of course, this should be optional.
> My personal style is to use "this" whenever an instance variable is
> used. So, having it in setters but not in getters (which is what IDEA
> does at the moment) is kind of odd (and inconsistent on top of that).
IDEA's approach is to only use "this" when it is necessary:
public int getFoo() {
return foo; // unambiguous
}
public int setFoo( int foo ) {
this.foo = foo; // necessary to determine scope
}
Nothing inconsistent there.
I agree though that different people use "this" differently. Some people
use it wherever they refer to a field, some only when it is required
grammatically to identify scope. Maybe more useful than "use this. in
getters" would be a reformat option to prepend "this." to all references to
instance fields (and another to remove all unambiguous uses). Pretty useful
in tracking down scope bugs and cleaning up code.
Cheers,
Dan
***************************************************************************************
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.
If you have received this email in error please notify [EMAIL PROTECTED]
immediately.
This footnote also confirms that this email message has been swept for the
presence of computer viruses.
***************************************************************************************
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features