mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-87991 Static type checking false negative ignoring automatic type conversion
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ public class FileEqualsUsageInspection extends InternalInspection {
|
||||
if (clazz == null) return;
|
||||
|
||||
String methodName = method.getName();
|
||||
if ("java.io.File".equals(clazz.getQualifiedName())
|
||||
if (CommonClassNames.JAVA_IO_FILE.equals(clazz.getQualifiedName())
|
||||
&& ("equals".equals(methodName) || "compareTo".equals(methodName) || "hashCode".equals(methodName))) {
|
||||
holder.registerProblem(methodExpression,
|
||||
"Do not use File.equals/hashCode/compareTo as they don't honor case-sensitivity on MacOS. Use FileUtil.filesEquals/fileHashCode/compareFiles instead",
|
||||
|
||||
@@ -87,4 +87,5 @@ public interface CommonClassNames {
|
||||
@NonNls String JAVA_LANG_INVOKE_MH_POLYMORPHIC = "java.lang.invoke.MethodHandle.PolymorphicSignature";
|
||||
String TARGET_ANNOTATION_FQ_NAME = "java.lang.annotation.Target";
|
||||
@NonNls String JAVA_LANG_RUNNABLE = "java.lang.Runnable";
|
||||
@NonNls String JAVA_IO_FILE = "java.io.File";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user