[java] "Surround with try-with-resources" template ditched in favor of intention action (IDEA-149130, IDEA-152348)

This commit is contained in:
Roman Shevchenko
2016-03-03 10:28:22 +01:00
parent ca28f9a0d5
commit 1f6af9e047
11 changed files with 202 additions and 106 deletions
@@ -0,0 +1,7 @@
import java.io.*;
class C {
void m(File file) throws IOException {
<caret>new FileInputStream(file);
}
}
@@ -0,0 +1,7 @@
import java.io.*;
class C {
void m(File file) throws IOException {
new FileInputStream(file)<caret>
}
}
@@ -0,0 +1,8 @@
import java.io.*;
class C {
void m(File file) throws IOException {
try (FileInputStream fileInputStream = new FileInputStream(file)) {
}
}
}
@@ -0,0 +1,8 @@
import java.io.*;
class C {
void m(File file) throws IOException {
try (FileInputStream fileInputStream = new FileInputStream(file)) {
}
}
}
@@ -0,0 +1,8 @@
import java.io.*;
import java.net.*;
class C {
public void read(URLConnection connection) {
InputStream stream = connection.getInputStream();<caret>
}
}
@@ -0,0 +1,9 @@
import java.io.*;
import java.net.*;
class C {
public void read(URLConnection connection) {
try (InputStream stream = connection.getInputStream()) {<caret>
}
}
}