summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado
diff options
context:
space:
mode:
authorTobias Holgers <tholgers@users.sourceforge.net>2009-06-16 22:27:57 +0000
committerTobias Holgers <tholgers@users.sourceforge.net>2009-06-16 22:27:57 +0000
commit2304be6285502e10fe9201409274541500c4a081 (patch)
tree9cfc7b9038fda40f94a44ceb1d70e1c6d573b1fa /src/main/java/com/amazon/carbonado
parent16076fc8e7f4922e924eee0f1c14bc8b86a89bb9 (diff)
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.
Diffstat (limited to 'src/main/java/com/amazon/carbonado')
-rw-r--r--src/main/java/com/amazon/carbonado/gen/StorableGenerator.java6
1 files changed, 3 insertions, 3 deletions
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<S extends Storable> {
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<S extends Storable> {
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<S extends Storable> {
}
if ((mask <<= 2) == 0) {
- mask = 3;
+ mask = PROPERTY_STATE_MASK;
stateBits = null;
}
}