From e6066d274c3a935be7527d1904823b98b5a72079 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 03 Feb 2014 16:39:25 +0000
Subject: [PATCH] Replaced calls to LocalizedLogger.*(ArgN.get(...)) by calls to LocalizedLogger.*(ArgN, ...).

---
 opendj3-server-dev/replace.rb |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/opendj3-server-dev/replace.rb b/opendj3-server-dev/replace.rb
index b320709..8400ae2 100755
--- a/opendj3-server-dev/replace.rb
+++ b/opendj3-server-dev/replace.rb
@@ -227,7 +227,7 @@
     :extensions => ["java"],
     :replacements =>
       [
-        /(logger\.\s*(trace|debug|warn|info|error)\s*\([^;]*)\s*\.toString\(\)/m,
+        /(logger\.\s*(?:trace|debug|warn|info|error)\s*\([^;]*)\s*\.toString\(\)/m,
         '\1',
       ]
   }
@@ -238,7 +238,7 @@
     :replacements =>
       [
         # Need to fix removing the last parentheses
-        /(logger\.\s*(trace|debug|warn|info|error)\s*\([^;]*)\s*String\s*\.\s*valueOf\s*\(/m,
+        /(logger\.\s*(?:trace|debug|warn|info|error)\s*\([^;]*)\s*String\s*\.\s*valueOf\s*\(/m,
         '\1',
       ]
   }
@@ -248,7 +248,7 @@
     :extensions => ["java"],
     :replacements =>
       [
-        /(logger\.\s*(trace|debug|warn|info|error)\s*\([^;]*)\s*(Character|Byte|Boolean|Short|Integer|Long|Float|Double)\s*\.\s*toString\s*\(/m,
+        /(logger\.\s*(?:trace|debug|warn|info|error)\s*\([^;]*)\s*(Character|Byte|Boolean|Short|Integer|Long|Float|Double)\s*\.\s*toString\s*\(/m,
         '\1',
         # Need to fix removing the last parentheses
         /([A-Z0-9_]+\s*\.\s*get\s*\([^;]*)\s*(Character|Byte|Boolean|Short|Integer|Long|Float|Double)\s*\.\s*toString\s*\(/m,
@@ -256,6 +256,16 @@
       ]
   }
 
+  LOGGER_AND_ARGN_TO_LOGGER_ONLY = {
+    :dirs => JAVA_DIRS,
+    :extensions => ["java"],
+    :replacements =>
+      [
+        /(logger\.\s*(?:trace|debug|warn|info|error)\s*\()\s*([A-Z0-9_]+)\s*\.\s*get\s*\(([^;]+)\)([^;]+)/m,
+        '\1\2, \3\4',
+      ]
+  }
+
   LOGGER_ISTRACEENABLED_TRACEEXCEPTION = {
     :dirs => JAVA_DIRS,
     :extensions => ["java"],
@@ -269,7 +279,7 @@
   }
 
   # List of replacements to run
-  REPLACEMENTS = [ LOGGER_MSG_ARGN_PRIMITIVE_TOSTRING ]
+  REPLACEMENTS = [ LOGGER_AND_ARGN_TO_LOGGER_ONLY ]
 
 
   ################################### Processing methods ########################################

--
Gitblit v1.10.0