summaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2012-01-11 23:02:18 +0000
committerBrian S. O'Neill <bronee@gmail.com>2012-01-11 23:02:18 +0000
commit655b0625fa801fa8fc8e91d7b08300ada531c34e (patch)
tree6a47dd140546cc51b5acb3962f7b6e7629ba77cf /src/main/java/com
parent80a4155021e36bccfd0f1a461c59f801cf685f4c (diff)
Make encoding strategy equals method symmetric in the face of subclassing.
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/amazon/carbonado/raw/CompressedEncodingStrategy.java2
-rw-r--r--src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/raw/CompressedEncodingStrategy.java b/src/main/java/com/amazon/carbonado/raw/CompressedEncodingStrategy.java
index c8e913e..42bd9e3 100644
--- a/src/main/java/com/amazon/carbonado/raw/CompressedEncodingStrategy.java
+++ b/src/main/java/com/amazon/carbonado/raw/CompressedEncodingStrategy.java
@@ -83,7 +83,7 @@ public class CompressedEncodingStrategy<S extends Storable> extends GenericEncod
if (this == obj) {
return true;
}
- if (CompressedEncodingStrategy.class.equals(obj)) {
+ if (obj != null && obj.getClass() == this.getClass()) {
CompressedEncodingStrategy other = (CompressedEncodingStrategy) obj;
return super.equals(obj) && mCompressionType.equals(other.mCompressionType);
}
diff --git a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java
index 6f3139e..ef8ef84 100644
--- a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java
+++ b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java
@@ -424,7 +424,7 @@ public class GenericEncodingStrategy<S extends Storable> {
if (this == obj) {
return true;
}
- if (GenericEncodingStrategy.class.equals(obj)) {
+ if (obj != null && obj.getClass() == this.getClass()) {
GenericEncodingStrategy other = (GenericEncodingStrategy) obj;
return mType == other.mType
&& mKeyPrefixPadding == other.mKeyPrefixPadding