From 2304be6285502e10fe9201409274541500c4a081 Mon Sep 17 00:00:00 2001 From: Tobias Holgers Date: Tue, 16 Jun 2009 22:27:57 +0000 Subject: Fixed copying of @Derived(shouldCopy=true) which was skipped when stateBits variable was non-null from a previously copied property. Used PROPERTY_STATE_MASK where appropriate instead of PROPERTY_STATE_DIRTY and constant 3, all have value 3. --- src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java index f6a41ca..caa5fbd 100644 --- a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java +++ b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java @@ -1871,7 +1871,7 @@ public final class StorableGenerator { LocalVariable target = CodeBuilderUtil.uneraseGenericParameter(b, storableTypeDesc, 0); LocalVariable stateBits = null; - int mask = PROPERTY_STATE_DIRTY; + int mask = PROPERTY_STATE_MASK; for (StorableProperty property : mAllProperties.values()) { // Decide if property should be part of the copy. @@ -1902,7 +1902,7 @@ public final class StorableGenerator { addSkipIndependent(b, target, property, skipCopy); } - if (stateBits != null) { + if (stateBits != null && !property.isDerived()) { // Skip property if uninitialized. b.loadLocal(stateBits); b.loadConstant(mask); @@ -1938,7 +1938,7 @@ public final class StorableGenerator { } if ((mask <<= 2) == 0) { - mask = 3; + mask = PROPERTY_STATE_MASK; stateBits = null; } } -- cgit v1.2.3