@@ -77,31 +77,29 @@ protected JavaType _typeFromId(String id, TypeFactory typeFactory)
77
77
78
78
protected final String _idFrom (Object value , Class <?> cls )
79
79
{
80
- // [JACKSON-380] Need to ensure that "enum subtypes" work too
80
+ // Need to ensure that "enum subtypes" work too
81
81
if (Enum .class .isAssignableFrom (cls )) {
82
82
if (!cls .isEnum ()) { // means that it's sub-class of base enum, so:
83
83
cls = cls .getSuperclass ();
84
84
}
85
85
}
86
86
String str = cls .getName ();
87
87
if (str .startsWith ("java.util" )) {
88
- /* 25-Jan-2009, tatu: There are some internal classes that
89
- * we can not access as is. We need better mechanism; for
90
- * now this has to do...
91
- */
92
- /* Enum sets and maps are problematic since we MUST know
93
- * type of contained enums, to be able to deserialize.
94
- * In addition, EnumSet is not a concrete type either
95
- */
88
+ // 25-Jan-2009, tatu: There are some internal classes that we can not access as is.
89
+ // We need better mechanism; for now this has to do...
90
+
91
+ // Enum sets and maps are problematic since we MUST know type of
92
+ // contained enums, to be able to deserialize.
93
+ // In addition, EnumSet is not a concrete type either
96
94
if (value instanceof EnumSet <?>) { // Regular- and JumboEnumSet...
97
95
Class <?> enumClass = ClassUtil .findEnumType ((EnumSet <?>) value );
98
96
// not optimal: but EnumSet is not a customizable type so this is sort of ok
99
- str = TypeFactory . defaultInstance () .constructCollectionType (EnumSet .class , enumClass ).toCanonical ();
97
+ str = _typeFactory .constructCollectionType (EnumSet .class , enumClass ).toCanonical ();
100
98
} else if (value instanceof EnumMap <?,?>) {
101
99
Class <?> enumClass = ClassUtil .findEnumType ((EnumMap <?,?>) value );
102
100
Class <?> valueClass = Object .class ;
103
101
// not optimal: but EnumMap is not a customizable type so this is sort of ok
104
- str = TypeFactory . defaultInstance () .constructMapType (EnumMap .class , enumClass , valueClass ).toCanonical ();
102
+ str = _typeFactory .constructMapType (EnumMap .class , enumClass , valueClass ).toCanonical ();
105
103
} else {
106
104
String end = str .substring (9 );
107
105
if ((end .startsWith (".Arrays$" ) || end .startsWith (".Collections$" ))
0 commit comments