summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/synthetic
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado/synthetic')
-rw-r--r--src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java b/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java
index 2c9c0dc..0832aa9 100644
--- a/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java
+++ b/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java
@@ -493,23 +493,22 @@ public class SyntheticStorableReferenceBuilder<S extends Storable>
continue;
}
- if (prop.getReadMethod() == null) {
- throw new SupportException
- ("Property does not have a public accessor method: " + prop);
- }
- if (prop.getWriteMethod() == null) {
- throw new SupportException
- ("Property does not have a public mutator method: " + prop);
- }
-
TypeDesc propType = TypeDesc.forClass(prop.getType());
if (toMasterPk) {
+ if (prop.getWriteMethod() == null) {
+ throw new SupportException
+ ("Property does not have a public mutator method: " + prop);
+ }
b.loadLocal(b.getParameter(0));
b.loadThis();
b.invokeVirtual(prop.getReadMethodName(), propType, null);
b.invoke(prop.getWriteMethod());
} else if (methodName.equals(mCopyFromMasterMethodName)) {
+ if (prop.getReadMethod() == null) {
+ throw new SupportException
+ ("Property does not have a public accessor method: " + prop);
+ }
b.loadThis();
b.loadLocal(b.getParameter(0));
b.invoke(prop.getReadMethod());