[英]How to disable IntelliJ IDEA annoying inspections (JAVA)
version: IntelliJ IDEA Community Edition 2020.1.2版本:IntelliJ IDEA 社区版 2020.1.2
There is an error that occurred in Intellij but Eclipse not. Intellij 中发生错误,但 Eclipse 没有。
According to the below code, the variable is StringBuilder and it's okay to append an integer or an int by the book.根据下面的代码,变量是 StringBuilder ,可以 append 和 integer 或书上的 int 。
But why Intellij shows me this error?但为什么 Intellij 向我显示此错误? How to disable the inspections and make the red line disappeaded.如何禁用检查并使红线消失。
By the way, that code looks fine in eclipse.顺便说一句,该代码在 eclipse 中看起来不错。
my sameaple code我的相同代码
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());
}
} }
The issue seems to be the IntelliJ IDEA bug, javac and eclipse compilers compile the code without errors, though Editor shows the error.问题似乎是 IntelliJ IDEA 错误,javac 和 eclipse 编译器编译代码没有错误,尽管编辑器显示错误。
Please follow the issue created for the bug: https://youtrack.jetbrains.com/issue/IDEA-244854请关注为该错误创建的问题: https://youtrack.jetbrains.com/issue/IDEA-244854
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.