IDEA-87991 Static type checking false negative ignoring automatic type conversion

This commit is contained in:
Maxim.Medvedev
2012-07-02 15:50:46 +04:00
parent a0aeb09b81
commit 68c017caef
8 changed files with 81 additions and 11 deletions
@@ -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",