Code format rule for adding the 'this' reference to instance field access
Does IntelliJ IDEA 10.5 Ultimate support this feature? That is to say, does it have a code formatting / clean up routine which qualifies access to instance fields with the this reference?
Example:
private String instanceField;
...
String getInstanceField()
{
return instanceField;
}
ctrl + alt + l
private String instanceField;
...
String getInstanceField()
{
return this.instanceField;
}
Thanks!
请先登录再写评论。
Hello Matthew,
Code formatting in IntelliJ IDEA generally does not modify anything other
than whitespaces. What you need is the inspection 'Instance field access
not qualified with "this"'. You can enable it in Settings | Inspections and
run it on your project to see all places where "this" should be added.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi Matthew,
No, it's not possible to add 'this.' clarification during formatting.
Denis
Thanks Dmitry, your solution was more than sufficient to meet my needs; Cheers!