Skip to content

Commit

Permalink
Fixed java.util.Properties not being deserialized propertly.
Browse files Browse the repository at this point in the history
  • Loading branch information
essiembre committed Aug 30, 2024
1 parent 716b388 commit d9d9f2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private Class<?> fieldType(Class<?> annotType, JavaType containedType) {
if (containedType != null) {
return containedType.getRawClass();
}
return null;
return Object.class;
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package com.norconex.commons.lang.bean.jackson;

import java.util.Map;
import java.util.Properties;

import com.fasterxml.jackson.databind.module.SimpleModule;
import com.norconex.commons.lang.bean.BeanMapper;
Expand All @@ -33,6 +34,8 @@ public class JsonXmlMapModule extends SimpleModule {
public JsonXmlMapModule() {
this.addSerializer((Class<Map<?, ?>>) (Class<?>) Map.class,
new JsonXmlMapSerializer<>());
this.addDeserializer((Class<Map<?, ?>>) (Class<?>) Properties.class,
new JsonXmlMapDeserializer<>());
this.addDeserializer(Map.class, new JsonXmlMapDeserializer<>());
}
}

0 comments on commit d9d9f2d

Please sign in to comment.