diff --git a/store/src/main/java/com/nytimes/android/external/store/base/impl/BarCode.java b/store/src/main/java/com/nytimes/android/external/store/base/impl/BarCode.java index 4c042d7..3bd2e1f 100644 --- a/store/src/main/java/com/nytimes/android/external/store/base/impl/BarCode.java +++ b/store/src/main/java/com/nytimes/android/external/store/base/impl/BarCode.java @@ -43,14 +43,17 @@ public final class BarCode implements Serializable { if (this == object) { return true; } + if (!(object instanceof BarCode)) { return false; } + BarCode barCode = (BarCode) object; if (!key.equals(barCode.key)) { return false; } + if (!type.equals(barCode.type)) { return false; } diff --git a/store/src/main/java/com/nytimes/android/external/store/base/impl/RealInternalStore.java b/store/src/main/java/com/nytimes/android/external/store/base/impl/RealInternalStore.java index 6535a14..0260962 100644 --- a/store/src/main/java/com/nytimes/android/external/store/base/impl/RealInternalStore.java +++ b/store/src/main/java/com/nytimes/android/external/store/base/impl/RealInternalStore.java @@ -99,11 +99,9 @@ final class RealInternalStore implements InternalStore { @Override public Observable call() { return cache(barCode); - } }) .onErrorResumeNext(new OnErrorResumeWithEmpty()); - } private Observable cache(@Nonnull final BarCode barCode) { @@ -203,7 +201,6 @@ final class RealInternalStore implements InternalStore { .flatMap(new Func1>() { @Override public Observable call(Raw raw) { - //Log.i(TAG,"writing and then reading from Persister"); return persister().write(barCode, raw) .flatMap(new Func1>() { @Nonnull @@ -224,7 +221,6 @@ final class RealInternalStore implements InternalStore { } void notifySubscribers(Parsed data) { - //Log.d(TAG,"notify stream subscribers of fresh data"); subject.onNext(data); } @@ -303,7 +299,6 @@ final class RealInternalStore implements InternalStore { * @return memory persister size */ private long getCacheSize() { -// return memCache.size(); return 100; } diff --git a/store/src/main/java/com/nytimes/android/external/store/base/impl/StoreBuilder.java b/store/src/main/java/com/nytimes/android/external/store/base/impl/StoreBuilder.java index 345f0b5..9f2aa11 100644 --- a/store/src/main/java/com/nytimes/android/external/store/base/impl/StoreBuilder.java +++ b/store/src/main/java/com/nytimes/android/external/store/base/impl/StoreBuilder.java @@ -92,6 +92,7 @@ public class StoreBuilder { if (persister == null) { persister = new NoopPersister<>(); } + InternalStore internalStore; if (memCache == null) { @@ -99,7 +100,7 @@ public class StoreBuilder { } else { internalStore = new RealInternalStore<>(fetcher, persister, new NoopParserFunc(), memCache); } - return new RealStore<>(internalStore); + return new RealStore<>(internalStore); } }