mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
25.46.2013 189dc60c70ae330716a034c936ecb52e21ba8ed9
StaticUtils.java:
Added close(ServerSocket...), this is crying for Java 7.
1 files modified
32 ■■■■■ changed files
opends/src/server/org/opends/server/util/StaticUtils.java 32 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/StaticUtils.java
@@ -4724,6 +4724,38 @@
  }
  /**
   * Closes the provided {@link ServerSocket}s ignoring any errors which
   * occurred.
   * <p>
   * With java 7 we will be able to use {@link StaticUtils#close(Closeable...)}
   * </p>
   *
   * @param sockets
   *          The sockets to be closed, which may be <code>null</code>.
   */
  public static void close(ServerSocket... sockets)
  {
    if (sockets == null)
    {
      return;
    }
    for (ServerSocket socket : sockets)
    {
      if (socket != null)
      {
        try
        {
          socket.close();
        }
        catch (IOException ignored)
        {
          // Ignore.
        }
      }
    }
  }
  /**
   * Closes the provided {@link InitialLdapContext}s ignoring any errors which
   * occurred.
   *