From 0bd39994718c15ec7b6690217219f12fd24aae42 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 26 Aug 2007 16:33:40 +0000 Subject: Yanked out support for filtering against one-to-many join properties. It needs to be redesigned. --- .../carbonado/cursor/FilteredCursorGenerator.java | 87 ++++------------------ 1 file changed, 13 insertions(+), 74 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/cursor') diff --git a/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java b/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java index 71aaf5b..7762885 100644 --- a/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java +++ b/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java @@ -38,7 +38,6 @@ import org.cojen.util.ClassInjector; import org.cojen.util.WeakIdentityMap; import com.amazon.carbonado.Cursor; -import com.amazon.carbonado.Query; import com.amazon.carbonado.Storable; import com.amazon.carbonado.filter.AndFilter; @@ -168,11 +167,7 @@ class FilteredCursorGenerator { isAllowedBuilder.storeLocal(storableVar); } - CodeGen cg = new CodeGen(cf, ctorBuilder, isAllowedBuilder, storableVar); - filter.accept(cg, null); - - // Finish static initializer. (if any) - cg.finish(); + filter.accept(new CodeGen(cf, ctorBuilder, isAllowedBuilder, storableVar), null); // Finish constructor. ctorBuilder.returnVoid(); @@ -241,7 +236,6 @@ class FilteredCursorGenerator { private static class CodeGen extends Visitor { private static String FIELD_PREFIX = "value$"; - private static String FILTER_FIELD_PREFIX = "filter$"; private final ClassFile mClassFile; private final CodeBuilder mCtorBuilder; @@ -252,8 +246,6 @@ class FilteredCursorGenerator { private int mPropertyOrdinal; - private CodeBuilder mInitBuilder; - CodeGen(ClassFile cf, CodeBuilder ctorBuilder, CodeBuilder isAllowedBuilder, LocalVariable storableVar) { @@ -265,12 +257,6 @@ class FilteredCursorGenerator { mScopeStack.push(new Scope(null, null)); } - public void finish() { - if (mInitBuilder != null) { - mInitBuilder.returnVoid(); - } - } - public Object visit(OrFilter filter, Object param) { Label failLocation = mIsAllowedBuilder.createLabel(); // Inherit success location to short-circuit if 'or' test succeeds. @@ -316,72 +302,25 @@ class FilteredCursorGenerator { b = mIsAllowedBuilder; b.loadLocal(mStorableVar); loadProperty(b, chained.getPrimeProperty()); + for (int i=0; i