Skip to content

Commit

Permalink
java: Fix CID 1386112 (Resource leak)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Apr 26, 2018
1 parent 63d5709 commit 62df5ae
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions java/com/google/scrollview/ScrollView.java
Expand Up @@ -371,9 +371,8 @@ public static void main(String[] args) {
intPattern = Pattern.compile("[0-9-][0-9]*");
floatPattern = Pattern.compile("[0-9-][0-9]*\\.[0-9]*");

try {
// Open a socket to listen on.
ServerSocket serverSocket = new ServerSocket(SERVER_PORT);
// Open a socket to listen on.
try (ServerSocket serverSocket = new ServerSocket(SERVER_PORT)) {
System.out.println("Socket started on port " + SERVER_PORT);

// Wait (blocking) for an incoming connection
Expand Down

0 comments on commit 62df5ae

Please sign in to comment.