From 4783adc14c2d6b96260052d3b634eafa500c6ddf 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. 

---
 opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesControl.java |   35 ++++++++++++-----------------------
 1 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesControl.java b/opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesControl.java
index 2a9d385..796bb55 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesControl.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesControl.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.controls;
 
@@ -38,8 +38,10 @@
 import org.opends.server.types.AttributeType;
 import org.opends.server.types.AttributeValue;
 import org.opends.server.types.Control;
+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.util.ServerConstants.*;
@@ -56,11 +58,6 @@
 public class MatchedValuesControl
        extends Control
 {
-  /**
-   * The fully-qualified name of this class for debugging purposes.
-   */
-  private static final String CLASS_NAME =
-       "org.opends.server.controls.MatchedValuesControl";
 
 
 
@@ -83,8 +80,6 @@
   {
     super(OID_MATCHED_VALUES, isCritical, encodeValue(filters));
 
-    assert debugConstructor(CLASS_NAME, String.valueOf(isCritical),
-                            String.valueOf(filters));
 
     this.filters = filters;
   }
@@ -106,8 +101,6 @@
   {
     super(oid, isCritical, encodeValue(filters));
 
-    assert debugConstructor(CLASS_NAME, String.valueOf(isCritical),
-                            String.valueOf(filters));
 
     this.filters = filters;
   }
@@ -132,8 +125,6 @@
   {
     super(oid, isCritical, encodedValue);
 
-    assert debugConstructor(CLASS_NAME, String.valueOf(isCritical),
-                            String.valueOf(filters));
 
     this.filters = filters;
   }
@@ -151,8 +142,6 @@
   private static ASN1OctetString
                       encodeValue(ArrayList<MatchedValuesFilter> filters)
   {
-    assert debugEnter(CLASS_NAME, "encodeValue",
-                      String.valueOf(filters));
 
 
     ArrayList<ASN1Element> elements =
@@ -183,7 +172,6 @@
   public static MatchedValuesControl decodeControl(Control control)
          throws LDAPException
   {
-    assert debugEnter(CLASS_NAME, "decodeControl", String.valueOf(control));
 
 
     if (! control.hasValue())
@@ -202,7 +190,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "decodeControl", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       int    msgID   = MSGID_MATCHEDVALUES_CANNOT_DECODE_VALUE_AS_SEQUENCE;
       String message = getMessage(msgID, stackTraceToSingleLineString(e));
@@ -239,7 +230,6 @@
    */
   public ArrayList<MatchedValuesFilter> getFilters()
   {
-    assert debugEnter(CLASS_NAME, "getFilters");
 
     return filters;
   }
@@ -259,8 +249,6 @@
    */
   public boolean valueMatches(AttributeType type, AttributeValue value)
   {
-    assert debugEnter(CLASS_NAME, "valueMatches", String.valueOf(type),
-                      String.valueOf(value));
 
     for (MatchedValuesFilter f : filters)
     {
@@ -273,7 +261,10 @@
       }
       catch (Exception e)
       {
-        assert debugException(CLASS_NAME, "valueMatches", e);
+        if (debugEnabled())
+        {
+          debugCought(DebugLogLevel.ERROR, e);
+        }
       }
     }
 
@@ -291,7 +282,6 @@
    */
   public String toString()
   {
-    assert debugEnter(CLASS_NAME, "toString");
 
     StringBuilder buffer = new StringBuilder();
     toString(buffer);
@@ -308,7 +298,6 @@
    */
   public void toString(StringBuilder buffer)
   {
-    assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder");
 
     if (filters.size() == 1)
     {

--
Gitblit v1.10.0