From a4db0f39e257950a5c89203452c1184c7080e5bd Mon Sep 17 00:00:00 2001 From: Abhishek Koneru Date: Fri, 18 May 2012 13:17:34 -0400 Subject: Fixes for Coverity Defects of Category : FB.DM_NUMBER_CTOR, FB.DM_STRING_CTOR, FB.DM_STRING_VOID_CTOR --- base/common/src/com/netscape/cmscore/base/SimpleProperties.java | 3 ++- base/common/src/com/netscape/cmscore/notification/EmailTemplate.java | 3 ++- base/common/src/com/netscape/cmscore/security/PWUtil.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'base/common/src/com/netscape') diff --git a/base/common/src/com/netscape/cmscore/base/SimpleProperties.java b/base/common/src/com/netscape/cmscore/base/SimpleProperties.java index fb399e0c6..527b4f694 100644 --- a/base/common/src/com/netscape/cmscore/base/SimpleProperties.java +++ b/base/common/src/com/netscape/cmscore/base/SimpleProperties.java @@ -191,7 +191,8 @@ public class SimpleProperties extends Hashtable { if (whiteSpaceChars.indexOf(nextLine.charAt(startIndex)) == -1) break; nextLine = nextLine.substring(startIndex, nextLine.length()); - line = new String(loppedLine + nextLine); + + line = loppedLine + nextLine; } // Find start of key int len = line.length(); diff --git a/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java b/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java index bd56ec608..86c232630 100644 --- a/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java +++ b/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java @@ -43,7 +43,7 @@ public class EmailTemplate implements IEmailTemplate { *==========================================================*/ /* private variables */ - private String mTemplateFile = new String(); + private String mTemplateFile = ""; private ILogger mLogger = CMS.getLogger(); /* public vaiables */ @@ -59,6 +59,7 @@ public class EmailTemplate implements IEmailTemplate { * @param templateFile File name of the template including the full path and * file extension */ + public EmailTemplate(String templatePath) { mTemplateFile = templatePath; } diff --git a/base/common/src/com/netscape/cmscore/security/PWUtil.java b/base/common/src/com/netscape/cmscore/security/PWUtil.java index 3938bf5d2..fa0de3c4b 100644 --- a/base/common/src/com/netscape/cmscore/security/PWUtil.java +++ b/base/common/src/com/netscape/cmscore/security/PWUtil.java @@ -26,7 +26,7 @@ public class PWUtil { throws PasswordCallback.GiveUpException { StringBuffer buf = new StringBuffer(); - String passwordString = new String(); + String passwordString = ""; int c; try { -- cgit