if delete the red line, then even @SuppressWarnings("all")  can not
suppress this warning
must reference the variable?

public static boolean canTcpListen(InetAddress address, int port) {
    try (ServerSocket ss = new ServerSocket(port, 0, address)) {
      ss.getLocalPort();
      return true;
    } catch (IOException e) {
      return false;
    }
  }

Reply via email to