File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
modules/ProtocolLib/src/main/java/com/comphenix/protocol/updater Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,7 @@ public void run() {
97
97
private static final byte [] API_KEY = ("key=98BE0FE67F88AB82B4C197FAF1DC3B69206EFDCC4D3B80FC83A00037510B99B4&resource=" + ID ).getBytes (Charsets .UTF_8 );
98
98
99
99
public String getSpigotVersion () throws IOException {
100
- Closer closer = Closer .create ();
101
-
102
- try {
100
+ try (Closer closer = Closer .create ()) {
103
101
HttpURLConnection con = (HttpURLConnection ) new URL (API_URL ).openConnection ();
104
102
con .setDoOutput (true );
105
103
con .setRequestMethod (ACTION );
@@ -108,8 +106,6 @@ public String getSpigotVersion() throws IOException {
108
106
InputStreamReader isr = closer .register (new InputStreamReader (con .getInputStream ()));
109
107
BufferedReader br = closer .register (new BufferedReader (isr ));
110
108
return br .readLine ();
111
- } finally {
112
- closer .close ();
113
109
}
114
110
}
115
111
You can’t perform that action at this time.
0 commit comments