mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
Resource declaration and assignment conflicts highlighting
This commit is contained in:
+6
-16
@@ -27,24 +27,14 @@ class C {
|
||||
System.out.println(r1);
|
||||
}
|
||||
|
||||
try (MyResource r2 = <warning descr="Variable 'r2' initializer 'new MyResource()' is redundant">new MyResource()</warning>) {
|
||||
r2 = null; // todo: check for NPE
|
||||
System.out.println(r2);
|
||||
}
|
||||
MyResource r2 = null;
|
||||
System.out.println(r2);
|
||||
try (r2 = <warning descr="The value 'new MyResource()' assigned to r2 is never used">new MyResource()</warning>) { }
|
||||
|
||||
MyResource r3 = null;
|
||||
System.out.println(r3);
|
||||
try (r3 = <warning descr="The value 'new MyResource()' assigned to r3 is never used">new MyResource()</warning>) { }
|
||||
try (MyResource <warning descr="Variable 'r3' is never used">r3</warning> = new MyResource()) { }
|
||||
|
||||
try (MyResource <warning descr="Variable 'r4' is never used">r4</warning> = new MyResource()) { }
|
||||
|
||||
try (MyResource r5 = new MyResource()) {
|
||||
System.out.println(r5);
|
||||
r5 = <warning descr="The value 'new MyResource()' assigned to r5 is never used">new MyResource()</warning>;
|
||||
}
|
||||
|
||||
MyResource <warning descr="Variable 'r6' is never assigned">r6</warning>;
|
||||
try (MyResource r = <error descr="Variable 'r6' might not have been initialized">r6</error>) {
|
||||
MyResource <warning descr="Variable 'r4' is never assigned">r4</warning>;
|
||||
try (MyResource r = <error descr="Variable 'r4' might not have been initialized">r4</error>) {
|
||||
System.out.println(r);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user