tristan/jsonld-java — Issue #11: Jackson call in JSONUtils closes Writer
Author: ansell
Created: 2012-03-09 06:52:57+00:00
State: open

The JSONUtils.write method calls a Jackson method that closes the writer.

ObjectMapper objectMapper = new ObjectMapper();
objectMapper.writeValue(w, jsonObject);

The offending location is in jackson-mapper-asl:

if (cfg.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
_configAndWriteCloseable(jgen, value, cfg);

This seems to imply that we could disable the CLOSE_CLOSEABLE feature in a configuration.