[英]Is there any way to add “this” key word automatically to class fields in Intellij Idea?
For example, instead of this: 例如,代替此:
public String getName(){
return name;
}
I want to get this: 我想得到这个:
public String getName(){
return this.name;
}
It appears I used such setting in Eclipse, but I can't find it for Idea... 看来我在Eclipse中使用了这样的设置,但是我在Idea中找不到它。
Yes, you can use an inspection for that. 是的,您可以为此进行检查。
Now IntelliJ Idea will highlight not qualified access and you can refactor ( ALT - ENTER under linux) to fix the issue (see capture below) 现在,IntelliJ Idea将突出显示不合格的访问权限,您可以重构(在Linux下为ALT - ENTER )来解决此问题(请参见下面的捕获)
(screenshots from IntelliJ Idea 12 under linux) (来自Linux下的IntelliJ Idea 12的屏幕截图)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.