Skip to content

Commit 1d29e0f

Browse files
committed
minor cleanup for jdk serializer mapping
1 parent 24d2a6c commit 1d29e0f

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

src/main/java/com/fasterxml/jackson/databind/deser/std/JdkDeserializers.java

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,31 @@ public class JdkDeserializers
2121
StackTraceElement.class,
2222
ByteBuffer.class
2323
};
24-
for (Class<?> cls : types) {
25-
_classNames.add(cls.getName());
26-
}
27-
for (Class<?> cls : FromStringDeserializer.types()) {
28-
_classNames.add(cls.getName());
29-
}
24+
for (Class<?> cls : types) { _classNames.add(cls.getName()); }
25+
for (Class<?> cls : FromStringDeserializer.types()) { _classNames.add(cls.getName()); }
3026
}
3127

3228
public static JsonDeserializer<?> find(Class<?> rawType, String clsName)
3329
{
34-
if (!_classNames.contains(clsName)) {
35-
return null;
36-
}
37-
JsonDeserializer<?> d = FromStringDeserializer.findDeserializer(rawType);
38-
if (d != null) {
39-
return d;
40-
}
41-
if (rawType == UUID.class) {
42-
return new UUIDDeserializer();
43-
}
44-
if (rawType == StackTraceElement.class) {
45-
return new StackTraceElementDeserializer();
46-
}
47-
if (rawType == AtomicBoolean.class) {
48-
// (note: AtomicInteger/Long work due to single-arg constructor. For now?
49-
return new AtomicBooleanDeserializer();
50-
}
51-
if (rawType == ByteBuffer.class) {
52-
return new ByteBufferDeserializer();
53-
}
54-
// should never occur
55-
throw new IllegalArgumentException("Internal error: can't find deserializer for "+clsName);
30+
if (_classNames.contains(clsName)) {
31+
JsonDeserializer<?> d = FromStringDeserializer.findDeserializer(rawType);
32+
if (d != null) {
33+
return d;
34+
}
35+
if (rawType == UUID.class) {
36+
return new UUIDDeserializer();
37+
}
38+
if (rawType == StackTraceElement.class) {
39+
return new StackTraceElementDeserializer();
40+
}
41+
if (rawType == AtomicBoolean.class) {
42+
// (note: AtomicInteger/Long work due to single-arg constructor. For now?
43+
return new AtomicBooleanDeserializer();
44+
}
45+
if (rawType == ByteBuffer.class) {
46+
return new ByteBufferDeserializer();
47+
}
48+
}
49+
return null;
5650
}
5751
}

0 commit comments

Comments
 (0)