Simplify logic in SpringSampleWarPlugin.

This commit is contained in:
John Blum
2022-06-22 12:29:09 -07:00
parent aac2836cb6
commit 57abbcd7a3

View File

@@ -116,9 +116,6 @@ class SpringSampleWarPlugin extends SpringSamplePlugin {
}
def static getRandomPort() {
ServerSocket serverSocket = new ServerSocket(0)
int port = serverSocket.localPort
serverSocket.close()
return port
new ServerSocket(0).withCloseable { it.localPort }
}
}