summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pom.xml7
-rw-r--r--src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java8
2 files changed, 12 insertions, 3 deletions
diff --git a/pom.xml b/pom.xml
index 7669f28..4b31d91 100644
--- a/pom.xml
+++ b/pom.xml
@@ -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;