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. --- .../com/amazon/carbonado/info/OrderedProperty.java | 3 --- .../carbonado/info/StorableIntrospector.java | 22 +++++++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/info') diff --git a/src/main/java/com/amazon/carbonado/info/OrderedProperty.java b/src/main/java/com/amazon/carbonado/info/OrderedProperty.java index 2e54e81..0cb0a3b 100644 --- a/src/main/java/com/amazon/carbonado/info/OrderedProperty.java +++ b/src/main/java/com/amazon/carbonado/info/OrderedProperty.java @@ -18,10 +18,7 @@ package com.amazon.carbonado.info; -import java.io.Externalizable; import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; import java.io.Serializable; import org.cojen.util.WeakCanonicalSet; diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java index ebcffb5..80d263a 100644 --- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java @@ -339,7 +339,7 @@ public class StorableIntrospector { } } } - + return candidate; } @@ -1042,7 +1042,7 @@ public class StorableIntrospector { if (sequence != null) { sequenceName = sequence.value(); } - + if (join == null) { if (errorMessages.size() > 0) { return null; @@ -1640,6 +1640,8 @@ public class StorableIntrospector { } private static class SimpleProperty implements StorableProperty { + private static final long serialVersionUID = 6599542401516624863L; + private static final ChainedProperty[] EMPTY_CHAIN_ARRAY = new ChainedProperty[0]; private final BeanProperty mBeanProperty; @@ -1895,11 +1897,13 @@ public class StorableIntrospector { return mAdapter; } + @Override public int hashCode() { return (getName().hashCode() * 31 + getType().getName().hashCode()) * 31 + getEnclosingType().getName().hashCode(); } + @Override public boolean equals(Object obj) { if (this == obj) { return true; @@ -1915,6 +1919,7 @@ public class StorableIntrospector { return false; } + @Override public String toString() { StringBuilder b = new StringBuilder(); try { @@ -2190,6 +2195,8 @@ public class StorableIntrospector { } private static final class JoinProperty extends SimpleProperty { + private static final long serialVersionUID = 5617446241872193369L; + private final Class mJoinedType; // Just the names of the join properties, held here until properties @@ -2225,38 +2232,47 @@ public class StorableIntrospector { mExternalNames = external; } + @Override public boolean isJoin() { return true; } + @Override public boolean isOneToOneJoin() { return mOneToOne; } + @Override public Class getJoinedType() { return mJoinedType; } + @Override public int getJoinElementCount() { return mInternal.length; } + @Override public StorableProperty getInternalJoinElement(int index) { return mInternal[index]; } + @Override public StorableProperty[] getInternalJoinElements() { return mInternal.clone(); } + @Override public StorableProperty getExternalJoinElement(int index) { return mExternal[index]; } + @Override public StorableProperty[] getExternalJoinElements() { return mExternal.clone(); } + @Override public boolean isQuery() { return getType() == Query.class; } @@ -2610,7 +2626,7 @@ public class StorableIntrospector { oneToOneCheck: { Set internalPrimaryKey = new HashSet (mEnclosingInfo.getPrimaryKeyProperties().values()); - + for (int i=0; i