Skip to content

Commit cf74a70

Browse files
committed
Suppress some compile warnings
The resource can not be closed at this point, it will be closed later so we ignore the warning.
1 parent b6c0d64 commit cf74a70

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/web/BlueMapWebRequestHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public HttpResponse handle(HttpRequest request) {
8080
return response;
8181
}
8282

83+
@SuppressWarnings ("resource")
8384
private HttpResponse generateResponse(HttpRequest request) {
8485
String adress = request.getPath();
8586
if (adress.isEmpty()) adress = "/";

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/webserver/HttpResponse.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
package de.bluecolored.bluemap.core.webserver;
2626

2727
import java.io.ByteArrayInputStream;
28+
import java.io.Closeable;
2829
import java.io.IOException;
2930
import java.io.InputStream;
3031
import java.io.OutputStream;
@@ -39,7 +40,7 @@
3940

4041
import org.apache.commons.lang3.StringUtils;
4142

42-
public class HttpResponse {
43+
public class HttpResponse implements Closeable {
4344

4445
private String version;
4546
private HttpStatusCode statusCode;
@@ -112,6 +113,11 @@ public void write(OutputStream out) throws IOException {
112113
data.close();
113114
}
114115
}
116+
117+
@Override
118+
public void close() throws IOException {
119+
data.close();
120+
}
115121

116122
private void writeLine(OutputStreamWriter writer, String line) throws IOException {
117123
writer.write(line + "\r\n");

0 commit comments

Comments
 (0)