[英]How to disable IntelliJ IDEA annoying inspections (JAVA)
版本:IntelliJ IDEA 社区版 2020.1.2
Intellij 中发生错误,但 Eclipse 没有。
根据下面的代码,变量是 StringBuilder ,可以 append 和 integer 或书上的 int 。
但为什么 Intellij 向我显示此错误? 如何禁用检查并使红线消失。
顺便说一句,该代码在 eclipse 中看起来不错。
我的相同代码
public class test123 {
public static void main(String[] args) {
StringBuilder msg = new StringBuilder();
Double rate = new Double(123);
msg.append(rate == 0 ? (rate == 0 ? 0 : "-" + rate) : String.valueOf(Math.round(rate*100)).replace("0", "") + "折");
System.out.printf("yyuu:"+msg.toString());
}
}
问题似乎是 IntelliJ IDEA 错误,javac 和 eclipse 编译器编译代码没有错误,尽管编辑器显示错误。
请关注为该错误创建的问题: https://youtrack.jetbrains.com/issue/IDEA-244854
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.