summaryrefslogtreecommitdiffstats
path: root/base/common
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-05-18 13:17:34 -0400
committerAde Lee <alee@redhat.com>2012-05-24 23:08:28 -0400
commita4db0f39e257950a5c89203452c1184c7080e5bd (patch)
tree2d3ebb818945db19450ed7c51e1c0e6b1582e6bc /base/common
parent307199314968b85059de62fbb694bd62b2502f46 (diff)
downloadpki-a4db0f39e257950a5c89203452c1184c7080e5bd.tar.gz
pki-a4db0f39e257950a5c89203452c1184c7080e5bd.tar.xz
pki-a4db0f39e257950a5c89203452c1184c7080e5bd.zip
Fixes for Coverity Defects of Category : FB.DM_NUMBER_CTOR, FB.DM_STRING_CTOR, FB.DM_STRING_VOID_CTOR
Diffstat (limited to 'base/common')
-rw-r--r--base/common/src/com/netscape/cmscore/base/SimpleProperties.java3
-rw-r--r--base/common/src/com/netscape/cmscore/notification/EmailTemplate.java3
-rw-r--r--base/common/src/com/netscape/cmscore/security/PWUtil.java2
-rw-r--r--base/common/test/com/netscape/cmscore/request/RequestTest.java6
4 files changed, 8 insertions, 6 deletions
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<String, String> {
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 {
diff --git a/base/common/test/com/netscape/cmscore/request/RequestTest.java b/base/common/test/com/netscape/cmscore/request/RequestTest.java
index 32c244033..0e98ab084 100644
--- a/base/common/test/com/netscape/cmscore/request/RequestTest.java
+++ b/base/common/test/com/netscape/cmscore/request/RequestTest.java
@@ -239,9 +239,9 @@ public class RequestTest extends CMSBaseTestCase {
public void testGetSetExtDataIntegerArray() {
Integer[] data = new Integer[] {
- new Integer(5),
- new Integer(23),
- new Integer(12)
+ Integer.valueOf(5),
+ Integer.valueOf(23),
+ Integer.valueOf(12)
};
assertTrue(request.setExtData("topkey1", data));
Integer[] retval = request.getExtDataInIntegerArray("topkey1");