From 455897cc245b67d929f409a93cfa7106e835cc1f Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 01 Mar 2007 03:27:06 +0000
Subject: [PATCH] This removes old debug logging framework method calls that are going to be automatically instrumented by AspectJ. Non instrumented debug method calls are updated to use the new debug framework methods. However, the new debug logging framework is not yet active as the Aspects are not weaved in. After this revision, debug logging will be disabled in the server until the new AOP framework is complete. 

---
 opends/src/server/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java |   36 ++++++++++++++----------------------
 1 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/opends/src/server/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java b/opends/src/server/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java
index 723e010..caedf00 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Portions Copyright 2006 Sun Microsystems, Inc.
+ *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
  */
 package org.opends.server.protocols.ldap;
 
@@ -36,8 +36,10 @@
 import org.opends.server.protocols.asn1.ASN1OctetString;
 import org.opends.server.protocols.asn1.ASN1Sequence;
 import org.opends.server.types.SearchResultReference;
+import org.opends.server.types.DebugLogLevel;
 
-import static org.opends.server.loggers.Debug.*;
+import static org.opends.server.loggers.debug.DebugLogger.debugCought;
+import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
 import static org.opends.server.messages.MessageHandler.*;
 import static org.opends.server.messages.ProtocolMessages.*;
 import static org.opends.server.protocols.ldap.LDAPConstants.*;
@@ -54,11 +56,6 @@
 public class SearchResultReferenceProtocolOp
        extends ProtocolOp
 {
-  /**
-   * The fully-qualified name of this class to use for debugging purposes.
-   */
-  private static final String CLASS_NAME =
-       "org.opends.server.protocols.ldap.SearchResultReferenceProtocolOp";
 
 
 
@@ -75,7 +72,6 @@
    */
   public SearchResultReferenceProtocolOp(List<String> referralURLs)
   {
-    assert debugConstructor(CLASS_NAME, String.valueOf(referralURLs));
 
     if (referralURLs == null)
     {
@@ -98,7 +94,6 @@
    */
   public SearchResultReferenceProtocolOp(SearchResultReference searchReference)
   {
-    assert debugConstructor(CLASS_NAME, String.valueOf(searchReference));
 
     referralURLs = searchReference.getReferralURLs();
     if (referralURLs == null)
@@ -118,7 +113,6 @@
    */
   public List<String> getReferralURLs()
   {
-    assert debugEnter(CLASS_NAME, "getReferralURLs");
 
     return referralURLs;
   }
@@ -132,7 +126,6 @@
    */
   public byte getType()
   {
-    assert debugEnter(CLASS_NAME, "getType");
 
     return OP_TYPE_SEARCH_RESULT_REFERENCE;
   }
@@ -146,7 +139,6 @@
    */
   public String getProtocolOpName()
   {
-    assert debugEnter(CLASS_NAME, "getProtocolOpName");
 
     return "Search Result Reference";
   }
@@ -161,7 +153,6 @@
    */
   public ASN1Element encode()
   {
-    assert debugEnter(CLASS_NAME, "encode");
 
     ArrayList<ASN1Element> elements =
          new ArrayList<ASN1Element>(referralURLs.size());
@@ -191,8 +182,6 @@
                      decodeSearchReference(ASN1Element element)
          throws LDAPException
   {
-    assert debugEnter(CLASS_NAME, "decodeSearchReference",
-                      String.valueOf(element));
 
     ArrayList<ASN1Element> elements;
     try
@@ -201,9 +190,12 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "decodeSearchReference", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
-      int    msgID   = MSGID_LDAP_SEARCH_REFERENCE_DECODE_SEQUENCE;
+      int msgID = MSGID_LDAP_SEARCH_REFERENCE_DECODE_SEQUENCE;
       String message = getMessage(msgID, String.valueOf(e));
       throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
     }
@@ -219,9 +211,12 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "decodeSearchReference", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
-      int    msgID   = MSGID_LDAP_SEARCH_REFERENCE_DECODE_URLS;
+      int msgID = MSGID_LDAP_SEARCH_REFERENCE_DECODE_URLS;
       String message = getMessage(msgID, String.valueOf(e));
       throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
     }
@@ -240,7 +235,6 @@
    */
   public void toString(StringBuilder buffer)
   {
-    assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder");
 
     buffer.append("SearchReference(referralURLs={");
 
@@ -271,8 +265,6 @@
    */
   public void toString(StringBuilder buffer, int indent)
   {
-    assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder",
-                      String.valueOf(indent));
 
     StringBuilder indentBuf = new StringBuilder(indent);
     for (int i=0 ; i < indent; i++)

--
Gitblit v1.10.0