diff options
-rw-r--r-- | pom.xml | 7 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java | 8 |
2 files changed, 12 insertions, 3 deletions
@@ -127,6 +127,13 @@ <email>peter_carbon@users.sourceforge.net</email>
<organization>Amazon Technologies, Inc.</organization>
</developer>
+
+ <developer>
+ <name>Tobias Holgers</name>
+ <id>tholgers</id>
+ <email>tholgers@users.sourceforge.net</email>
+ <organization>Amazon Technologies, Inc.</organization>
+ </developer>
</developers>
<contributors>
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;
|