summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cmscore
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-07-09 15:12:11 -0400
committerAde Lee <alee@redhat.com>2012-07-12 16:42:18 -0400
commit15ac6d2b8e83a73ac1f62ab0da0d6a85717f28fd (patch)
treef3bd2a816e816ad565f13ce90816a7fd7fb32454 /base/common/src/com/netscape/cmscore
parent9e4e40b80de0ba47702392b9ad6ccecf67496db7 (diff)
downloadpki-15ac6d2b8e83a73ac1f62ab0da0d6a85717f28fd.tar.gz
pki-15ac6d2b8e83a73ac1f62ab0da0d6a85717f28fd.tar.xz
pki-15ac6d2b8e83a73ac1f62ab0da0d6a85717f28fd.zip
NO_HASHCODE_OVERRIDDEN
Diffstat (limited to 'base/common/src/com/netscape/cmscore')
-rw-r--r--base/common/src/com/netscape/cmscore/apps/CMSEngine.java9
-rw-r--r--base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java4
-rw-r--r--base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java3
-rw-r--r--base/common/src/com/netscape/cmscore/request/RequestRepository.java2
-rw-r--r--base/common/src/com/netscape/cmscore/security/PWsdrCache.java10
5 files changed, 16 insertions, 12 deletions
diff --git a/base/common/src/com/netscape/cmscore/apps/CMSEngine.java b/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
index 13a8bb6bf..84afb8474 100644
--- a/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
+++ b/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
@@ -657,12 +657,11 @@ public class CMSEngine implements ICMSEngine {
try {
/* if the file is not there, create one */
File f = new File(path);
- if (!f.exists()) {
- f.createNewFile();
- }
- } catch (Exception e) {
+ f.createNewFile();
+ } catch (IOException e) {
+ CMS.debug("Cannot create file: " + path + " ." + e.toString());
+ throw new EBaseException("Cannot create file: " + path + " ." + e.toString());
}
-
return new FileConfigStore(path);
}
diff --git a/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java b/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
index 45807d6e9..1ec3c009a 100644
--- a/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
+++ b/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
@@ -173,7 +173,9 @@ public class ProfileSubsystem implements IProfileSubsystem {
mConfig.removeSubStore(id);
File file1 = new File(configPath);
- file1.delete();
+ if (!file1.delete()) {
+ CMS.debug("ProfileSubsystem: deleteProfile: Cannot delete the configuration file : " + configPath);
+ }
mProfileIds.removeElement(id);
mProfiles.remove(id);
mProfileClassIds.remove(id);
diff --git a/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java b/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java
index 0576bcf58..86debf3da 100644
--- a/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java
+++ b/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java
@@ -423,13 +423,12 @@ public class PKIJNDIRealm extends JNDIRealm {
String right = expBlock[1];
if (left != null) {
- left.trim();
+ left = left.trim();
} else {
return allowed;
}
//Massage the right hand side of this expression to be a legal string value.
if (right != null) {
- right.trim();
right = right.replace("\"", "");
right = right.trim();
} else {
diff --git a/base/common/src/com/netscape/cmscore/request/RequestRepository.java b/base/common/src/com/netscape/cmscore/request/RequestRepository.java
index ed18c7048..31edc31b0 100644
--- a/base/common/src/com/netscape/cmscore/request/RequestRepository.java
+++ b/base/common/src/com/netscape/cmscore/request/RequestRepository.java
@@ -174,7 +174,7 @@ class RequestRepository
}
}
- if (obj != null || (obj instanceof RepositoryRecord)) {
+ if (obj != null && (obj instanceof RepositoryRecord)) {
record = (RepositoryRecord) obj;
status = record.getPublishingStatus();
} else {
diff --git a/base/common/src/com/netscape/cmscore/security/PWsdrCache.java b/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
index 810605d41..e9c7af8e5 100644
--- a/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
+++ b/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
@@ -382,7 +382,9 @@ public class PWsdrCache {
if (tmpPWcache.exists()) {
// it wasn't removed?
- tmpPWcache.delete();
+ if (!tmpPWcache.delete()) {
+ debug("Could not delete the existing " + mPWcachedb + ".tmp file.");
+ }
tmpPWcache = new File(mPWcachedb + ".tmp");
}
outstream = new FileOutputStream(mPWcachedb + ".tmp");
@@ -417,10 +419,12 @@ public class PWsdrCache {
origFile.getCanonicalPath());
} catch (IOException e) {
CMS.debug("Unable to change file permissions on "
- + origFile.toString());
+ + origFile.toString());
}
}
- tmpPWcache.delete();
+ if (!tmpPWcache.delete()) {
+ debug("Could not delete the existing " + mPWcachedb + ".tmp file.");
+ }
debug("operation completed for " + mPWcachedb);
}
} catch (Exception exx) {