Skip to content

Commit f33c19d

Browse files
committed
debug-level explicative warning about non-jsonable data
1 parent e6c959f commit f33c19d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/java/autocompchem/datacollections/NamedData.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ public NamedData deserialize(JsonElement json, Type typeOfT,
832832
JsonDeserializationContext context)
833833
throws JsonParseException
834834
{
835+
Logger logger = LogManager.getLogger(NamedDataDeserializer.class);
835836
JsonObject jo = json.getAsJsonObject();
836837
Object joValue = null;
837838
NamedDataType joType = NamedDataType.STRING;
@@ -846,11 +847,11 @@ public NamedData deserialize(JsonElement json, Type typeOfT,
846847
// We do this here to avoid nesting the exception in the switch block
847848
if (!jsonable.contains(joType))
848849
{
849-
System.err.println("Type '" + joType + "' is not "
850-
+ "serializable to JSON. Returning null for '"
850+
logger.debug("WARNING: Type '" + joType
851+
+ "' is not deserializable from JSON. "
852+
+ "Returning null for '"
851853
+ reference + "'");
852-
return new NamedData(jo.get("reference").getAsString(),
853-
joType, null);
854+
return new NamedData(reference, joType, null);
854855
}
855856

856857
//NB: this list of cases must reflect the content of "jsonable"

0 commit comments

Comments
 (0)