From 3db26bff365de7d2d4e7fc45ad31b8104c78a0ae Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 25 Mar 2008 05:38:00 +0000 Subject: Fixes for bugs as reported by FindBugs. --- .../com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java | 5 +++++ .../java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo') 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 @@ -91,6 +91,11 @@ class DerivedIndexesTrigger extends Trig updateValues(storable, state); } + @Override + public int hashCode() { + return mFetcher.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { 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 extends AbstractRepository 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; } } -- cgit v1.2.3