summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/amazon/carbonado/spi/StorableGenerator.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/main/java/com/amazon/carbonado/spi/StorableGenerator.java b/src/main/java/com/amazon/carbonado/spi/StorableGenerator.java
index 4972bfa..f63a260 100644
--- a/src/main/java/com/amazon/carbonado/spi/StorableGenerator.java
+++ b/src/main/java/com/amazon/carbonado/spi/StorableGenerator.java
@@ -645,10 +645,10 @@ public final class StorableGenerator<S extends Storable> {
// Store loaded join result here.
LocalVariable join = b.createLocalVariable(name, type);
- // Check if any internal properties may be null, but
- // the matching external property is primitive. If so,
- // load each of these special internal values and check
- // if null. If so, short-circuit the load and use null
+ // Check if any internal properties are nullable, but
+ // the matching external property is not. If so, load
+ // each of these special internal values and check if
+ // null. If null, short-circuit the load and use null
// as the join result.
Label shortCircuit = b.createLabel();
@@ -658,8 +658,7 @@ public final class StorableGenerator<S extends Storable> {
for (int i=0; i<count; i++) {
StorableProperty internal = property.getInternalJoinElement(i);
StorableProperty external = property.getExternalJoinElement(i);
- if (!internal.getType().isPrimitive() &&
- external.getType().isPrimitive()) {
+ if (internal.isNullable() && !external.isNullable()) {
break nullPossible;
}
}
@@ -669,9 +668,7 @@ public final class StorableGenerator<S extends Storable> {
for (int i=0; i<count; i++) {
StorableProperty internal = property.getInternalJoinElement(i);
StorableProperty external = property.getExternalJoinElement(i);
- if (!internal.getType().isPrimitive() &&
- external.getType().isPrimitive()) {
-
+ if (internal.isNullable() && !external.isNullable()) {
if (mGenMode == GEN_ABSTRACT) {
b.loadThis();
b.loadField(internal.getName(),