servicecomb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wjm wjm <zzz...@gmail.com>
Subject how to suppress warning of "try.resource.not.referenced"
Date Fri, 26 Oct 2018 01:51:51 GMT
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;
    }
  }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message