From 97af4be638e371a2f693bde2798fc233a143f3f9 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 29 Apr 2007 17:47:50 +0000 Subject: Merged in support for derived properties. --- .../com/amazon/carbonado/raw/GenericEncodingStrategy.java | 11 +++++++---- .../java/com/amazon/carbonado/raw/GenericStorableCodec.java | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/raw') diff --git a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java index cba6776..c0fa0af 100644 --- a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java +++ b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java @@ -19,7 +19,9 @@ package com.amazon.carbonado.raw; import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.Map; import org.cojen.classfile.CodeAssembler; @@ -397,14 +399,15 @@ public class GenericEncodingStrategy { Map> map = StorableIntrospector.examine(mType).getDataProperties(); - StorableProperty[] properties = new StorableProperty[map.size()]; + List> list = new ArrayList>(map.size()); - int ordinal = 0; for (StorableProperty property : map.values()) { - properties[ordinal++] = property; + if (!property.isDerived()) { + list.add(property); + } } - return properties; + return list.toArray(new StorableProperty[list.size()]); } protected StorablePropertyInfo checkSupport(StorableProperty property) diff --git a/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java b/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java index 43677f2..2532556 100644 --- a/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java +++ b/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java @@ -797,7 +797,7 @@ public class GenericStorableCodec implements StorableCodec