From ab92f4ec859413b2d3612068dfb21d741fb389a3 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 6 May 2008 13:52:12 +0000 Subject: Code cleanup: add @Override annotations, remove unused imports, remove dead code and add @Deprecated annotations. --- .../amazon/carbonado/gen/StorableGenerator.java | 22 ++++++---------------- .../amazon/carbonado/gen/StorablePropertyMap.java | 1 - 2 files changed, 6 insertions(+), 17 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/gen') diff --git a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java index cb60349..e88ba39 100644 --- a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java +++ b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java @@ -25,8 +25,6 @@ import java.lang.ref.Reference; import java.lang.ref.SoftReference; import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.HashMap; -import java.util.IdentityHashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -316,7 +314,6 @@ public final class StorableGenerator { private final TypeDesc mSupportType; private final StorableInfo mInfo; private final Map> mAllProperties; - private final boolean mHasJoins; private final ClassInjector mClassInjector; private final ClassFile mClassFile; @@ -327,15 +324,6 @@ public final class StorableGenerator { mInfo = StorableIntrospector.examine(storableType); mAllProperties = mInfo.getAllProperties(); - boolean hasJoins = false; - for (StorableProperty property : mAllProperties.values()) { - if (property.isJoin()) { - hasJoins = true; - break; - } - } - mHasJoins = hasJoins; - mClassInjector = ClassInjector.create (storableType.getName(), storableType.getClassLoader()); mClassFile = CodeBuilderUtil.createStorableClassFile @@ -346,7 +334,7 @@ public final class StorableGenerator { private Class generateAndInjectClass() { generateClass(); Class abstractClass = mClassInjector.defineClass(mClassFile); - return (Class) abstractClass; + return abstractClass; } private void generateClass() { @@ -1743,6 +1731,7 @@ public final class StorableGenerator { } } + /* private static Method lookupMethod(Class type, MethodInfo mi) { MethodDesc desc = mi.getMethodDescriptor(); TypeDesc[] params = desc.getParameterTypes(); @@ -1759,6 +1748,7 @@ public final class StorableGenerator { return lookupMethod(type, mi.getName(), args); } + */ private static Method lookupMethod(Class type, String name, Class... args) { try { @@ -2392,7 +2382,7 @@ public final class StorableGenerator { private void addPropertyStateExtractMethod() { MethodInfo mi = mClassFile.addMethod(Modifiers.PRIVATE, PROPERTY_STATE_EXTRACT_METHOD_NAME, TypeDesc.INT, new TypeDesc[] {TypeDesc.STRING}); - + addPropertySwitch(new CodeBuilder(mi), SWITCH_FOR_STATE); } @@ -2739,7 +2729,7 @@ public final class StorableGenerator { GenericEncodingStrategy encoder = new GenericEncodingStrategy(mStorableType, null); CodeBuilder b = new CodeBuilder(mi); - + LocalVariable encodedVar; try { encodedVar = encoder.buildSerialEncoding(b, null); @@ -3049,7 +3039,7 @@ public final class StorableGenerator { invokeAppend(b, TypeDesc.STRING); // First pass, just print primary keys. - + LocalVariable commaCountVar = b.createLocalVariable(null, TypeDesc.INT); b.loadConstant(-1); b.storeLocal(commaCountVar); diff --git a/src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java b/src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java index cbf0d0b..ecdcce3 100644 --- a/src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java +++ b/src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java @@ -32,7 +32,6 @@ import java.util.Set; import org.cojen.util.SoftValuedHashMap; import com.amazon.carbonado.Storable; -import com.amazon.carbonado.info.StorableInfo; import com.amazon.carbonado.info.StorableIntrospector; import com.amazon.carbonado.info.StorableProperty; -- cgit v1.2.3