![](/img/trans.png)
[英]Intellij Idea - automatically add final keyword to the generated variables
[英]IntelliJ IDEA, turn off insertion of 'final' keyword before instance variables on format/save (JAVA)
我一生无法找到可以在IntelliJ IDEA中的实例变量上关闭'final'关键字插入的地方。
基本上,IntelliJ会检查是否将实例字段分配给它,以及是否不是将其自动定型为最终值。 通常这不是问题,但是我正在进行序列化,并且出现了问题。
作为参考(我声明):
private HashSet<Integer> removedIndex = new HashSet<>();
IntelliJ做到了:
private final HashSet<Integer> removedIndex = new HashSet<>();
谢谢你的帮助!
听起来您正在使用“ 保存操作插件” 。 要禁用此行为...
Preferences > Other Settings > Save Actions
Add final to field
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.