Override toString in the enum we use for testing, to be sure we don't rely on
it in our internals. We actually do use the toString value, but only in constructing the cache key for a query, which should generally not result in badness, unless you override your enums to not return unique strings for different enum values. It's looking like the Postgres4 driver calls createArray with an Object[] full of enums, and it calls toString on the values in the array. I have an idea for how to fix that, which is coming up next.
This commit is contained in:
@@ -20,7 +20,14 @@ public class EnumKeyRecord extends PersistentRecord
|
||||
|
||||
public static final int SCHEMA_VERSION = 1;
|
||||
|
||||
public enum Type { A, B, C, D };
|
||||
public enum Type {
|
||||
A, B, C, D;
|
||||
|
||||
// override toString to be sure that we don't rely on it in our internals
|
||||
public String toString () {
|
||||
return "Type:" + name();
|
||||
}
|
||||
};
|
||||
|
||||
/** The type is key. */
|
||||
@Id public Type type;
|
||||
|
||||
Reference in New Issue
Block a user