diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2008-03-25 05:38:00 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2008-03-25 05:38:00 +0000 |
commit | 3db26bff365de7d2d4e7fc45ad31b8104c78a0ae (patch) | |
tree | a32ea36c3e356311559d984a4d61524193869f55 /src/main/java/com/amazon/carbonado/repo | |
parent | 5ad29e976d528214c6e26065f2fb39126a5ae10a (diff) |
Fixes for bugs as reported by FindBugs.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java | 5 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java b/src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java index 21c7215..9e69935 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java @@ -92,6 +92,11 @@ class DerivedIndexesTrigger<S extends Storable, D extends Storable> extends Trig }
@Override
+ public int hashCode() {
+ return mFetcher.hashCode();
+ }
+
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java index 4bf4e2b..f12a58e 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java @@ -553,8 +553,12 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> break;
}
- if (mSuspendUntil != Long.MIN_VALUE) {
- if (System.currentTimeMillis() < mSuspendUntil) {
+ long suspendUntil;
+ synchronized (this) {
+ suspendUntil = mSuspendUntil;
+ }
+ if (suspendUntil != Long.MIN_VALUE) {
+ if (System.currentTimeMillis() < suspendUntil) {
continue;
}
}
|