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

gbellato
05.36.2007 8d3bc0c156b478950741452a4b518c5659b26ae8
Fix for issue 1879 : null pointer Exception when running on a machine with 
badly configure named resolution.

The fix is simply to check for null pointers when calling the shutdown method
of the replication server and the setSoTimeout of the replicationBroker.

The fix is simple enough so that I did not feel the need to build a test case.
2 files modified
15 ■■■■■ changed files
opends/src/server/org/opends/server/replication/plugin/ReplicationBroker.java 3 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServer.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/ReplicationBroker.java
@@ -727,8 +727,11 @@
  public void setSoTimeout(int timeout) throws SocketException
  {
    this.timeout = timeout;
    if (session != null)
    {
    session.setSoTimeout(timeout);
  }
  }
  /**
   * Get the name of the replicationServer to which this broker is currently
opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -424,19 +424,18 @@
    shutdown = true;
    // shutdown the connect thread
    try
    if (myConnectThread != null)
    {
      myConnectThread.interrupt();
    } catch (NullPointerException e)
    {
      // FIXME To be investigated the conditions
      // where myConnectThread can be null here
    }
    // shutdown the listener thread
    try
    {
      if (listenSocket != null)
      {
      listenSocket.close();
      }
    } catch (IOException e)
    {
      // replication Server service is closing anyway.
@@ -448,7 +447,10 @@
      replicationCache.shutdown();
    }
    if (dbEnv != null)
    {
    dbEnv.shutdown();
    }
    DirectoryServer.deregisterMonitorProvider(getMonitorInstanceName());
  }