From b0a7e3cf4a65ea95c79cf002596428d0aed2e26e Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Tue, 22 May 2007 23:30:15 +0000
Subject: [PATCH] Remove the dependence on AspectJ for all non method-entry and method-exit related debug messages. All debug statements will now work w/o  weaving enabled. However, method-entry and method-exit debug messages work only with weaving enabled.

---
 opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java |   57 ++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java b/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java
index ed30b5c..03476fc 100644
--- a/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java
+++ b/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java
@@ -32,8 +32,6 @@
 
 import org.opends.server.types.*;
 
-import static org.opends.server.loggers.debug.DebugLogger.*;
-import static org.opends.server.loggers.debug.DebugLogger.debugError;
 import static org.opends.server.messages.JebMessages.
     MSGID_JEB_MISSING_DN2ID_RECORD;
 import static org.opends.server.messages.JebMessages.
@@ -42,6 +40,8 @@
     MSGID_JEB_REBUILD_INSERT_ENTRY_FAILED;
 import static org.opends.server.messages.MessageHandler.getMessage;
 import static org.opends.server.loggers.ErrorLogger.logError;
+import static org.opends.server.loggers.debug.DebugLogger.*;
+import org.opends.server.loggers.debug.DebugTracer;
 import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString;
 
 
@@ -51,6 +51,11 @@
 public class IndexRebuildThread extends DirectoryThread
 {
   /**
+   * The tracer object for the debug logger.
+   */
+  private static final DebugTracer TRACER = getTracer();
+
+  /**
    * The entry container.
    */
   EntryContainer ec = null;
@@ -175,7 +180,8 @@
       //TODO: throw error
       if(debugEnabled())
       {
-        debugError("No index type specified. Rebuild process terminated.");
+        TRACER.debugError("No index type specified. Rebuild process " +
+            "terminated.");
       }
 
       return;
@@ -185,7 +191,8 @@
       //TODO: throw error
       if(debugEnabled())
       {
-        debugError("No attribute index specified. Rebuild process terminated.");
+        TRACER.debugError("No attribute index specified. Rebuild process " +
+            "terminated.");
       }
 
       return;
@@ -196,7 +203,7 @@
       //TODO: throw error
       if(debugEnabled())
       {
-        debugError("No index specified. Rebuild process terminated.");
+        TRACER.debugError("No index specified. Rebuild process terminated.");
       }
 
       return;
@@ -207,8 +214,9 @@
       totalEntries = getTotalEntries();
       if(debugEnabled())
       {
-        debugInfo("Initiating rebuild of the %s indexType/database", indexName);
-        debugVerbose("%d entries will be rebuilt", totalEntries);
+        TRACER.debugInfo("Initiating rebuild of the %s indexType/database",
+                         indexName);
+        TRACER.debugVerbose("%d entries will be rebuilt", totalEntries);
       }
 
       switch(indexType)
@@ -228,7 +236,7 @@
 
       if(debugEnabled())
       {
-        debugVerbose("Rebuilt %d entries", rebuiltEntries);
+        TRACER.debugVerbose("Rebuilt %d entries", rebuiltEntries);
       }
     }
     catch(Exception e)
@@ -241,7 +249,7 @@
 
       if(debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
     }
 
@@ -302,7 +310,7 @@
             duplicatedEntries++;
             if(debugEnabled())
             {
-              debugInfo("Unable to insert entry with DN %s and ID %d " +
+              TRACER.debugInfo("Unable to insert entry with DN %s and ID %d " +
                   "into the DN2ID database because it already exists.",
                         entry.getDN().toString(), entryID.longValue());
             }
@@ -324,7 +332,7 @@
 
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, e);
+            TRACER.debugCaught(DebugLogLevel.ERROR, e);
           }
         }
       }
@@ -391,7 +399,7 @@
             duplicatedEntries++;
             if(debugEnabled())
             {
-              debugInfo("Unable to insert entry with DN %s and ID %d " +
+              TRACER.debugInfo("Unable to insert entry with DN %s and ID %d " +
                   "into the DN2URI database because it already exists.",
                         entry.getDN().toString(), entryID.longValue());
             }
@@ -413,7 +421,7 @@
 
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, e);
+            TRACER.debugCaught(DebugLogLevel.ERROR, e);
           }
         }
       }
@@ -493,8 +501,8 @@
                 if(debugEnabled())
                 {
                   duplicatedEntries++;
-                  debugInfo("Unable to insert entry with DN %s and ID %d " +
-                      "into the DN2Subtree database because it already " +
+                  TRACER.debugInfo("Unable to insert entry with DN %s and " +
+                      "ID %d into the DN2Subtree database because it already " +
                       "exists.",
                             entry.getDN().toString(), entryID.longValue());
                 }
@@ -526,7 +534,7 @@
 
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, e);
+            TRACER.debugCaught(DebugLogLevel.ERROR, e);
           }
         }
       }
@@ -644,10 +652,9 @@
               if(debugEnabled())
               {
                 duplicatedEntries++;
-                debugInfo("Unable to insert entry with DN %s and ID %d " +
-                    "into the DN2Subtree database because it already " +
-                    "exists.",
-                          entry.getDN().toString(), entryID.longValue());
+                TRACER.debugInfo("Unable to insert entry with DN %s and ID " +
+                    "%d into the DN2Subtree database because it already " +
+                    "exists.", entry.getDN().toString(), entryID.longValue());
               }
             }
           }
@@ -670,7 +677,7 @@
 
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, e);
+            TRACER.debugCaught(DebugLogLevel.ERROR, e);
           }
         }
       }
@@ -735,7 +742,7 @@
             if(debugEnabled())
             {
               duplicatedEntries++;
-              debugInfo("Unable to insert entry with DN %s and ID %d " +
+              TRACER.debugInfo("Unable to insert entry with DN %s and ID %d " +
                   "into the DN2Subtree database because it already " +
                   "exists.",
                         entry.getDN().toString(), entryID.longValue());
@@ -756,7 +763,7 @@
 
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, e);
+            TRACER.debugCaught(DebugLogLevel.ERROR, e);
           }
         }
       }
@@ -821,7 +828,7 @@
             if(debugEnabled())
             {
               duplicatedEntries++;
-              debugInfo("Unable to insert entry with DN %s and ID %d " +
+              TRACER.debugInfo("Unable to insert entry with DN %s and ID %d " +
                   "into the DN2Subtree database because it already " +
                   "exists.",
                         entry.getDN().toString(), entryID.longValue());
@@ -842,7 +849,7 @@
 
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, e);
+            TRACER.debugCaught(DebugLogLevel.ERROR, e);
           }
         }
       }

--
Gitblit v1.10.0