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/util/LDIFWriter.java | 38 ++++++++------------------------------
1 files changed, 8 insertions(+), 30 deletions(-)
diff --git a/opends/src/server/org/opends/server/util/LDIFWriter.java b/opends/src/server/org/opends/server/util/LDIFWriter.java
index 686075e..234a275 100644
--- a/opends/src/server/org/opends/server/util/LDIFWriter.java
+++ b/opends/src/server/org/opends/server/util/LDIFWriter.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.util;
@@ -44,7 +44,9 @@
import org.opends.server.types.Modification;
import org.opends.server.types.RDN;
-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.util.StaticUtils.*;
import static org.opends.server.util.Validator.*;
@@ -56,10 +58,6 @@
*/
public final class LDIFWriter
{
- /**
- * The fully-qualified name of this class for debugging purposes.
- */
- private static final String CLASS_NAME = "org.opends.server.util.LDIFWriter";
// FIXME -- Add support for generating a hash when writing the data.
@@ -89,7 +87,6 @@
public LDIFWriter(LDIFExportConfig exportConfig)
throws IOException
{
- assert debugConstructor(CLASS_NAME, String.valueOf(exportConfig));
ensureNotNull(exportConfig);
this.exportConfig = exportConfig;
@@ -126,8 +123,6 @@
public void writeComment(String comment, int wrapColumn)
throws IOException
{
- assert debugEnter(CLASS_NAME, "writeComment", String.valueOf(comment),
- String.valueOf(wrapColumn));
ensureNotNull(comment);
@@ -223,7 +218,6 @@
*/
public boolean writeEntries(Collection <Entry> entries)
throws IOException, LDIFException {
- assert debugEnter(CLASS_NAME, "writeEntry", String.valueOf(entries));
boolean ret=true;
Iterator<Entry> i = entries.iterator();
@@ -251,7 +245,6 @@
public boolean writeEntry(Entry entry)
throws IOException, LDIFException
{
- assert debugEnter(CLASS_NAME, "writeEntry", String.valueOf(entry));
ensureNotNull(entry);
return entry.toLDIF(exportConfig);
@@ -272,8 +265,6 @@
public void writeAddChangeRecord(Entry entry)
throws IOException
{
- assert debugEnter(CLASS_NAME, "writeAddChangeRecord",
- String.valueOf(entry));
ensureNotNull(entry);
@@ -352,8 +343,6 @@
public void writeDeleteChangeRecord(Entry entry, boolean commentEntry)
throws IOException
{
- assert debugEnter(CLASS_NAME, "writeDeleteChangeRecord",
- String.valueOf(entry), String.valueOf(commentEntry));
ensureNotNull(entry);
@@ -433,8 +422,6 @@
public void writeModifyChangeRecord(DN dn, List<Modification> modifications)
throws IOException
{
- assert debugEnter(CLASS_NAME, "writeModifyChangeRecord", String.valueOf(dn),
- String.valueOf(modifications));
ensureNotNull(dn, modifications);
@@ -546,10 +533,6 @@
DN newSuperior)
throws IOException
{
- assert debugEnter(CLASS_NAME, "writeModifyDNChangeRecord",
- String.valueOf(dn), String.valueOf(newRDN),
- String.valueOf(deleteOldRDN),
- String.valueOf(newSuperior));
ensureNotNull(dn, newRDN);
@@ -619,7 +602,6 @@
public void flush()
throws IOException
{
- assert debugEnter(CLASS_NAME, "flush");
writer.flush();
}
@@ -634,7 +616,6 @@
public void close()
throws IOException
{
- assert debugEnter(CLASS_NAME, "close");
writer.flush();
writer.close();
@@ -657,9 +638,6 @@
public static void appendLDIFSeparatorAndValue(StringBuilder buffer,
byte[] valueBytes)
{
- assert debugEnter(CLASS_NAME, "appendLDIFSeparatorAndValue",
- "java.lang.StringBuilder",
- String.valueOf(valueBytes));
ensureNotNull(buffer, valueBytes);
@@ -689,7 +667,10 @@
catch (Exception e)
{
// This should never happen.
- assert debugException(CLASS_NAME, "appendLDIFSeparatorAndValue", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
buffer.append(new String(valueBytes));
}
}
@@ -713,9 +694,6 @@
boolean wrapLines, int wrapColumn)
throws IOException
{
- assert debugEnter(CLASS_NAME, "writeLDIFLine", String.valueOf(line),
- String.valueOf(writer), String.valueOf(wrapLines),
- String.valueOf(wrapColumn));
ensureNotNull(line, writer);
--
Gitblit v1.10.0