mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
RedundantExplicitCloseInspection: support parentheses in close(); fixed support of resource expression; check field qualifiers
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
class MyAutoCloseable implements AutoCloseable {
|
||||
@Override
|
||||
void close() {
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Remove redundant close" "true"
|
||||
|
||||
class MyAutoCloseable implements AutoCloseable {
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class RemoveTry {
|
||||
final MyAutoCloseable ac;
|
||||
|
||||
public void main(RemoveTry other) {
|
||||
try(other.ac) {
|
||||
System.out.println("asdasd");
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Remove redundant close" "true"
|
||||
|
||||
class MyAutoCloseable implements AutoCloseable {
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class RemoveTry {
|
||||
public static void main(MyAutoCloseable ac) {
|
||||
try(ac) {
|
||||
System.out.println("asdasd");
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
class MyAutoCloseable implements AutoCloseable {
|
||||
@Override
|
||||
void close() {
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ class RemoveTry {
|
||||
public static void main(String[] args) {
|
||||
try(MyAutoCloseable ac = new MyAutoCloseable()) {
|
||||
System.out.println("asdasd");
|
||||
ac.close<caret>();
|
||||
(ac).close<caret>();
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// "Remove redundant close" "false"
|
||||
|
||||
class MyAutoCloseable implements AutoCloseable {
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class RemoveTry {
|
||||
final MyAutoCloseable ac;
|
||||
|
||||
public void main(RemoveTry other) {
|
||||
try(other.ac) {
|
||||
System.out.println("asdasd");
|
||||
this.ac.clo<caret>se();
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// "Remove redundant close" "true"
|
||||
|
||||
class MyAutoCloseable implements AutoCloseable {
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class RemoveTry {
|
||||
final MyAutoCloseable ac;
|
||||
|
||||
public void main(RemoveTry other) {
|
||||
try(other.ac) {
|
||||
System.out.println("asdasd");
|
||||
other.ac.clo<caret>se();
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Remove redundant close" "true"
|
||||
|
||||
class MyAutoCloseable implements AutoCloseable {
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class RemoveTry {
|
||||
public static void main(MyAutoCloseable ac) {
|
||||
try(ac) {
|
||||
System.out.println("asdasd");
|
||||
(ac).close<caret>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user