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/schema/GeneralizedTimeSyntax.java | 43 +++++++++++++------------------------------
1 files changed, 13 insertions(+), 30 deletions(-)
diff --git a/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java b/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java
index d9e20cd..cece249 100644
--- a/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java
+++ b/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.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.schema;
@@ -49,7 +49,9 @@
import org.opends.server.types.ErrorLogSeverity;
import org.opends.server.types.ResultCode;
-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 org.opends.server.types.DebugLogLevel;
import static org.opends.server.loggers.Error.*;
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.SchemaMessages.*;
@@ -68,11 +70,6 @@
public class GeneralizedTimeSyntax
extends AttributeSyntax
{
- /**
- * The fully-qualified name of this class for debugging purposes.
- */
- private static final String CLASS_NAME =
- "org.opends.server.schema.GeneralizedTimeSyntax";
@@ -128,7 +125,6 @@
{
super();
- assert debugConstructor(CLASS_NAME);
}
@@ -146,8 +142,6 @@
public void initializeSyntax(ConfigEntry configEntry)
throws ConfigException
{
- assert debugEnter(CLASS_NAME, "initializeSyntax",
- String.valueOf(configEntry));
defaultEqualityMatchingRule =
DirectoryServer.getEqualityMatchingRule(EMR_GENERALIZED_TIME_OID);
@@ -186,7 +180,6 @@
*/
public String getSyntaxName()
{
- assert debugEnter(CLASS_NAME, "getSyntaxName");
return SYNTAX_GENERALIZED_TIME_NAME;
}
@@ -200,7 +193,6 @@
*/
public String getOID()
{
- assert debugEnter(CLASS_NAME, "getOID");
return SYNTAX_GENERALIZED_TIME_OID;
}
@@ -214,7 +206,6 @@
*/
public String getDescription()
{
- assert debugEnter(CLASS_NAME, "getDescription");
return SYNTAX_GENERALIZED_TIME_DESCRIPTION;
}
@@ -231,7 +222,6 @@
*/
public EqualityMatchingRule getEqualityMatchingRule()
{
- assert debugEnter(CLASS_NAME, "getEqualityMatchingRule");
return defaultEqualityMatchingRule;
}
@@ -248,7 +238,6 @@
*/
public OrderingMatchingRule getOrderingMatchingRule()
{
- assert debugEnter(CLASS_NAME, "getOrderingMatchingRule");
return defaultOrderingMatchingRule;
}
@@ -265,7 +254,6 @@
*/
public SubstringMatchingRule getSubstringMatchingRule()
{
- assert debugEnter(CLASS_NAME, "getSubstringMatchingRule");
return defaultSubstringMatchingRule;
}
@@ -282,7 +270,6 @@
*/
public ApproximateMatchingRule getApproximateMatchingRule()
{
- assert debugEnter(CLASS_NAME, "getApproximateMatchingRule");
// Approximate matching will not be allowed by default.
return null;
@@ -305,8 +292,6 @@
public boolean valueIsAcceptable(ByteString value,
StringBuilder invalidReason)
{
- assert debugEnter(CLASS_NAME, "valueIsAcceptable", String.valueOf(value),
- "java.lang.StringBuilder");
// Get the value as a string and verify that it is at least long enough for
@@ -906,8 +891,6 @@
private boolean hasValidOffset(String value, int startPos,
StringBuilder invalidReason)
{
- assert debugEnter(CLASS_NAME, "hasValidOffset", String.valueOf(value),
- String.valueOf(startPos), "java.lang.StringBuilder");
int offsetLength = value.length() - startPos;
@@ -1034,7 +1017,6 @@
*/
public static String format(Date d)
{
- assert debugEnter(CLASS_NAME, "formatGeneralizedTime", String.valueOf(d));
dateFormatLock.lock();
@@ -1059,7 +1041,6 @@
*/
public static String format(long t)
{
- assert debugEnter(CLASS_NAME, "formatGeneralizedTime", String.valueOf(t));
dateFormatLock.lock();
@@ -1086,8 +1067,6 @@
*/
public static AttributeValue createGeneralizedTimeValue(long time)
{
- assert debugEnter(CLASS_NAME, "createGeneralizedTimeValue",
- String.valueOf(time));
String valueString;
@@ -1099,7 +1078,10 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "createGeneralizedTimeValue", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
// This should never happen.
valueString = null;
@@ -1130,8 +1112,6 @@
public static long decodeGeneralizedTimeValue(ByteString normalizedValue)
throws DirectoryException
{
- assert debugEnter(CLASS_NAME, "decodeGeneralizedTimeValue",
- String.valueOf(normalizedValue));
String valueString = normalizedValue.stringValue();
try
@@ -1154,9 +1134,12 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "decodeGeneralizedTimeValue", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
- int msgID = MSGID_ATTR_SYNTAX_GENERALIZED_TIME_CANNOT_PARSE;
+ int msgID = MSGID_ATTR_SYNTAX_GENERALIZED_TIME_CANNOT_PARSE;
String message = getMessage(msgID, valueString, String.valueOf(e));
throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
--
Gitblit v1.10.0