|
9 | 9 | import java.util.concurrent.atomic.AtomicReference;
|
10 | 10 |
|
11 | 11 | import com.fasterxml.jackson.annotation.*;
|
12 |
| - |
13 | 12 | import com.fasterxml.jackson.core.*;
|
14 | 13 | import com.fasterxml.jackson.core.io.CharacterEscapes;
|
15 | 14 | import com.fasterxml.jackson.core.io.SegmentedStringWriter;
|
16 | 15 | import com.fasterxml.jackson.core.type.ResolvedType;
|
17 | 16 | import com.fasterxml.jackson.core.type.TypeReference;
|
18 | 17 | import com.fasterxml.jackson.core.util.*;
|
19 |
| - |
20 | 18 | import com.fasterxml.jackson.databind.cfg.BaseSettings;
|
21 | 19 | import com.fasterxml.jackson.databind.cfg.ContextAttributes;
|
22 | 20 | import com.fasterxml.jackson.databind.cfg.HandlerInstantiator;
|
@@ -2838,6 +2836,10 @@ protected final void _configAndWriteValue(JsonGenerator jgen, Object value)
|
2838 | 2836 | * will not mask exception that is pending)
|
2839 | 2837 | */
|
2840 | 2838 | if (!closed) {
|
| 2839 | + /* 04-Mar-2014, tatu: But! Let's try to prevent auto-closing of |
| 2840 | + * structures, which typically causes more damage. |
| 2841 | + */ |
| 2842 | + jgen.disable(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT); |
2841 | 2843 | try {
|
2842 | 2844 | jgen.close();
|
2843 | 2845 | } catch (IOException ioe) { }
|
@@ -2869,6 +2871,9 @@ protected final void _configAndWriteValue(JsonGenerator jgen, Object value, Clas
|
2869 | 2871 | jgen.close();
|
2870 | 2872 | } finally {
|
2871 | 2873 | if (!closed) {
|
| 2874 | + // 04-Mar-2014, tatu: But! Let's try to prevent auto-closing of |
| 2875 | + // structures, which typically causes more damage. |
| 2876 | + jgen.disable(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT); |
2872 | 2877 | try {
|
2873 | 2878 | jgen.close();
|
2874 | 2879 | } catch (IOException ioe) { }
|
@@ -2897,6 +2902,9 @@ private final void _configAndWriteCloseable(JsonGenerator jgen, Object value, Se
|
2897 | 2902 | * been closed
|
2898 | 2903 | */
|
2899 | 2904 | if (jgen != null) {
|
| 2905 | + // 04-Mar-2014, tatu: But! Let's try to prevent auto-closing of |
| 2906 | + // structures, which typically causes more damage. |
| 2907 | + jgen.disable(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT); |
2900 | 2908 | try {
|
2901 | 2909 | jgen.close();
|
2902 | 2910 | } catch (IOException ioe) { }
|
|
0 commit comments