Commit 3872f912 authored by Johannes Mey's avatar Johannes Mey
Browse files

close JSON parser after deserialization

parent 126dbbe3
Pipeline #3201 passed with stage
in 1 minute and 13 seconds
...@@ -1212,6 +1212,7 @@ aspect Serializer { ...@@ -1212,6 +1212,7 @@ aspect Serializer {
sb.append(ind(3) + "com.fasterxml.jackson.core.JsonFactory factory = mapper.getFactory();\n"); sb.append(ind(3) + "com.fasterxml.jackson.core.JsonFactory factory = mapper.getFactory();\n");
sb.append(ind(3) + "com.fasterxml.jackson.core.JsonParser parser = factory.createParser(file);\n"); sb.append(ind(3) + "com.fasterxml.jackson.core.JsonParser parser = factory.createParser(file);\n");
sb.append(ind(3) + getID() + " result = deserialize((com.fasterxml.jackson.databind.JsonNode)mapper.readTree(parser));\n"); sb.append(ind(3) + getID() + " result = deserialize((com.fasterxml.jackson.databind.JsonNode)mapper.readTree(parser));\n");
sb.append(ind(3) + "parser.close();\n");
sb.append(ind(3) + "return result;\n"); sb.append(ind(3) + "return result;\n");
sb.append(ind(2) + "} catch (java.io.IOException e) {\n"); sb.append(ind(2) + "} catch (java.io.IOException e) {\n");
sb.append(ind(3) + "throw new DeserializationException(\"unable to deserialize \" + file.getAbsolutePath(), e);\n"); sb.append(ind(3) + "throw new DeserializationException(\"unable to deserialize \" + file.getAbsolutePath(), e);\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment