From 9516aa8db8085f0fa983117ef4af952dfa8ae3f1 Mon Sep 17 00:00:00 2001
From: pgamba <pgamba@localhost>
Date: Thu, 25 Oct 2007 13:06:57 +0000
Subject: [PATCH] Fix 2487 Server does not update properly the task entry when trying to initialize cn=schema between two servers

---
 opends/src/server/org/opends/server/tasks/InitializeTask.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/tasks/InitializeTask.java b/opends/src/server/org/opends/server/tasks/InitializeTask.java
index 5d5649f..02552df 100644
--- a/opends/src/server/org/opends/server/tasks/InitializeTask.java
+++ b/opends/src/server/org/opends/server/tasks/InitializeTask.java
@@ -185,11 +185,10 @@
   /**
    * Set the state for the current task.
    *
-   * @param newState The new state value to set
    * @param de  When the new state is different from COMPLETED_SUCCESSFULLY
    * this is the exception that contains the cause of the failure.
    */
-  public void setState(TaskState newState, DirectoryException de)
+  public void updateTaskCompletionState(DirectoryException de)
   {
     try
     {
@@ -197,11 +196,15 @@
       {
         initTaskError = de.getMessageObject();
       }
+      if (de == null)
+        initState =  TaskState.COMPLETED_SUCCESSFULLY;
+      else
+        initState =  TaskState.STOPPED_BY_ERROR;
+
       if (debugEnabled())
       {
-        TRACER.debugInfo("InitializeTask/setState: %s", newState);
+        TRACER.debugInfo("InitializeTask/setState: %s", initState);
       }
-      initState = newState;
       synchronized (initState)
       {
         initState.notify();

--
Gitblit v1.10.0