Closed GoogleCodeExporter closed 9 years ago
The working condition is:
if ((o instanceof Enum) && ((Enum<?>)o).getDeclaringClass().isEnum()) return o;
Original comment by thomas.h...@customweb.ch
on 21 Jul 2013 at 6:59
public enum TestEnum
{
A("a"), B("b"), C("c");
private String name;
private TestEnum(String name)
{
this.name = name;
}
public static Object o = new Object();
}
public void testCloneEnumInMapIssue20()
{
Map<Integer, TestEnum> m = new HashMap<Integer, TestEnum>();
m.put(1, TestEnum.A);
m.put(2, TestEnum.B);
m.put(3, TestEnum.C);
cloner.deepClone(m);
}
The test passes without any problems. Any idea how to make it fail?
Original comment by kostas.k...@googlemail.com
on 6 Aug 2013 at 8:11
I use a Enum with some abstract method:
public enum TestEnum
{
A("a") {
public String someMethod() {
return "Some String from A";
}
},
B("b") {
public String someMethod() {
return "Some String from B";
}
},
C("c"){
public String someMethod() {
return "Some String from C";
}
};
private final String name;
private TestEnum(String name)
{
this.name = name;
}
public abstract String someMethod();
public static Object o = new Object();
}
Original comment by thomas.h...@customweb.ch
on 7 Aug 2013 at 6:17
I couldn't reproduce your exception but I got issues when I have enum
inheritance.
I've uploaded 1.9.1-SNAPSHOT in sonatype snapshot repository and you can give
it a try.
https://oss.sonatype.org/content/repositories/snapshots/
Original comment by kostas.k...@googlemail.com
on 7 Aug 2013 at 8:06
I assume this is fixed.
Original comment by kostas.k...@googlemail.com
on 20 Aug 2013 at 8:08
Sorry. Yes, I have test it!
Original comment by thomas.h...@customweb.ch
on 20 Aug 2013 at 8:21
Original issue reported on code.google.com by
thomas.h...@customweb.ch
on 20 Jul 2013 at 9:40Attachments: