diff options
author | Tobias Holgers <tholgers@users.sourceforge.net> | 2009-04-22 17:37:20 +0000 |
---|---|---|
committer | Tobias Holgers <tholgers@users.sourceforge.net> | 2009-04-22 17:37:20 +0000 |
commit | 54b03e4b3ce8ef1a294c23c4369579c7043f2287 (patch) | |
tree | 560fbd0c67f3a64c77af645b2c228f71de7203a8 /src/main/java/com/amazon | |
parent | 423b9acc47e05b6574e46665633352d8b42fea9a (diff) |
Do not encode suffix in encodeSearchKeyPrefix
Diffstat (limited to 'src/main/java/com/amazon')
-rw-r--r-- | src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java index d89aca5..b7356d7 100644 --- a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java +++ b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java @@ -738,8 +738,10 @@ public class GenericEncodingStrategy<S extends Storable> { }
}
- boolean doPartial = mode == Mode.SERIAL
- || mode == Mode.KEY && (partialStartVar != null || partialEndVar != null);
+ boolean doPartial =
+ mode == Mode.SERIAL ||
+ (mode == Mode.KEY && partialStartVar != null) ||
+ (mode == Mode.KEY && (properties.length == 0 || partialEndVar != null));
// Calculate exactly how many bytes are needed to encode. The length
// is composed of a static and a variable amount. The variable amount
@@ -751,7 +753,7 @@ public class GenericEncodingStrategy<S extends Storable> { // against runtime partial start value.
staticLength += prefix + generationPrefix;
}
- if (mode != Mode.KEY || partialEndVar == null) {
+ if (mode != Mode.KEY || (properties.length != 0 && partialEndVar == null)) {
// Only include suffix as static if no runtime check is needed
// against runtime partial end value.
staticLength += suffix;
|