Java: Improve the inspection "Multiple occurrences of the same expression" (IDEA-207247)

This commit is contained in:
Pavel Dolgov
2019-02-14 17:00:49 +03:00
parent a996802cd9
commit 7ccc4710eb
3 changed files with 23 additions and 4 deletions
@@ -0,0 +1,18 @@
import java.io.*;
class C {
void testConstructor(String path) {
File a = <weak_warning descr="Multiple occurrences of 'new File(path)'">new File(path)</weak_warning>;
File b = <weak_warning descr="Multiple occurrences of 'new File(path)'">new File(path)</weak_warning>;
}
void testMethods(String path) throws IOException {
File f = new File(path);
boolean a = f.createNewFile();
boolean b = f.createNewFile();
boolean c = f.delete();
boolean d = f.delete();
}
}