From 0b179c8de1cff6db33d5e7ac96e5df407dc83685 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 15 Mar 2013 09:59:17 +0800 Subject: [PATCH] IDEMPIERE-738 Reduce duplicate string reported by Eclipse Memory Analyzer. Fixed NPE reported in google group. --- org.adempiere.base/src/org/compiere/util/Msg.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/util/Msg.java b/org.adempiere.base/src/org/compiere/util/Msg.java index 7cc7f1f1f9..03ce19a900 100644 --- a/org.adempiere.base/src/org/compiere/util/Msg.java +++ b/org.adempiere.base/src/org/compiere/util/Msg.java @@ -529,12 +529,11 @@ public final class Msg DB.close(rs, pstmt); rs = null; pstmt = null; } - if (retStr != null) { - retStr = retStr.trim(); - cache.put(key, retStr); - return retStr; - } - return retStr; + + retStr = retStr == null ? "" : retStr.trim(); + cache.put(key, retStr); + return retStr; + } // getElement /**