From 9f8bc22aa6b924a06a284582043dc3e912705f68 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 03 Feb 2014 14:07:31 +0000
Subject: [PATCH] Removed now useless calls to primitive wrapper's toString() on arguments of Logger.*(...) and ArgN.get(...).

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

diff --git a/opendj3-server-dev/replace.rb b/opendj3-server-dev/replace.rb
index 5f2607d..b320709 100755
--- a/opendj3-server-dev/replace.rb
+++ b/opendj3-server-dev/replace.rb
@@ -243,6 +243,19 @@
       ]
   }
 
+  LOGGER_MSG_ARGN_PRIMITIVE_TOSTRING = {
+    :dirs => JAVA_DIRS,
+    :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,
+        '\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,
+        '\1',
+      ]
+  }
+
   LOGGER_ISTRACEENABLED_TRACEEXCEPTION = {
     :dirs => JAVA_DIRS,
     :extensions => ["java"],
@@ -256,7 +269,7 @@
   }
 
   # List of replacements to run
-  REPLACEMENTS = [ LOGGER_TOSTRING ]
+  REPLACEMENTS = [ LOGGER_MSG_ARGN_PRIMITIVE_TOSTRING ]
 
 
   ################################### Processing methods ########################################

--
Gitblit v1.10.0