summaryrefslogtreecommitdiffstats
path: root/base/common/src
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-05-18 11:44:45 -0400
committerAde Lee <alee@redhat.com>2012-05-24 23:08:07 -0400
commita6fca9587905f455c4b0306b02d77334a295305e (patch)
treeeddf6a64341dafd126467d2abccdbbd7c8f05a72 /base/common/src
parent739c50ee20704128e0bf4605ba7ca392d95070a2 (diff)
downloadpki-a6fca9587905f455c4b0306b02d77334a295305e.tar.gz
pki-a6fca9587905f455c4b0306b02d77334a295305e.tar.xz
pki-a6fca9587905f455c4b0306b02d77334a295305e.zip
Fixes for Coverity Defects of Category : FB.BC_VACUOUS_INSTANCEOF
Diffstat (limited to 'base/common/src')
-rw-r--r--base/common/src/com/netscape/cmscore/base/SimpleProperties.java3
-rw-r--r--base/common/src/com/netscape/cmscore/ldap/LdapRequestListener.java9
-rw-r--r--base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java3
-rw-r--r--base/common/src/com/netscape/cmscore/request/ExtDataHashtable.java6
4 files changed, 6 insertions, 15 deletions
diff --git a/base/common/src/com/netscape/cmscore/base/SimpleProperties.java b/base/common/src/com/netscape/cmscore/base/SimpleProperties.java
index f8a5cf4d0..fb399e0c6 100644
--- a/base/common/src/com/netscape/cmscore/base/SimpleProperties.java
+++ b/base/common/src/com/netscape/cmscore/base/SimpleProperties.java
@@ -348,9 +348,8 @@ public class SimpleProperties extends Hashtable<String, String> {
*/
public String getProperty(String key) {
String oval = super.get(key);
- String sval = (oval instanceof String) ? oval : null;
- return ((sval == null) && (defaults != null)) ? defaults.getProperty(key) : sval;
+ return ((oval == null) && (defaults != null)) ? defaults.getProperty(key) : oval;
}
/**
diff --git a/base/common/src/com/netscape/cmscore/ldap/LdapRequestListener.java b/base/common/src/com/netscape/cmscore/ldap/LdapRequestListener.java
index c9180630f..79131244a 100644
--- a/base/common/src/com/netscape/cmscore/ldap/LdapRequestListener.java
+++ b/base/common/src/com/netscape/cmscore/ldap/LdapRequestListener.java
@@ -271,8 +271,7 @@ class LdapRenewalListener implements IRequestListener {
return;
}
- if (certs[0] instanceof X509CertImpl)
- acceptX509(r, certs);
+ acceptX509(r, certs);
}
public void acceptX509(IRequest r, Certificate[] certs) {
@@ -333,8 +332,7 @@ class LdapRevocationListener implements IRequestListener {
return;
}
- if (certs[0] instanceof X509CertImpl)
- acceptX509(r, certs);
+ acceptX509(r, certs);
}
public void acceptX509(IRequest r, Certificate[] revcerts) {
@@ -445,8 +443,7 @@ class LdapUnrevocationListener implements IRequestListener {
return;
}
- if (certs[0] instanceof X509CertImpl)
- acceptX509(r, certs);
+ acceptX509(r, certs);
}
public void acceptX509(IRequest r, Certificate[] certs) {
diff --git a/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java b/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
index baf86da31..d717d9732 100644
--- a/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
+++ b/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
@@ -316,8 +316,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
try {
rule = (IPolicyRule)
Class.forName(classpath).newInstance();
- if (rule instanceof IPolicyRule)
- rule.setInstanceName(instanceName);
+ rule.setInstanceName(instanceName);
rule.init(this, c);
} catch (Throwable e) {
mAuthority.log(ILogger.LL_FAILURE,
diff --git a/base/common/src/com/netscape/cmscore/request/ExtDataHashtable.java b/base/common/src/com/netscape/cmscore/request/ExtDataHashtable.java
index 44197b406..b7bd43793 100644
--- a/base/common/src/com/netscape/cmscore/request/ExtDataHashtable.java
+++ b/base/common/src/com/netscape/cmscore/request/ExtDataHashtable.java
@@ -53,11 +53,7 @@ public class ExtDataHashtable<V> extends Hashtable<String, V> {
}
public V put(String oKey, V val) {
- if (oKey instanceof String) {
- String key = oKey;
- return super.put(key.toLowerCase(), val);
- }
- return super.put(oKey, val);
+ return super.put(oKey.toLowerCase(), val);
}
public void putAll(Map<? extends String, ? extends V> map) {