Skip to content

Commit 973e493

Browse files
committed
Add a test for #580
1 parent 4899c28 commit 973e493

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

release-notes/CREDITS-2.x

+3
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ Alessio Soldano (asoldano@github)
115115
Arnaud Roger (arnaudroger@github)
116116
* Contributed #359: FilteringGeneratorDelegate does not override writeStartObject(Object forValue)
117117
(2.8.8)
118+
* Reported, contributed fix for #580: FilteringGeneratorDelegate writeRawValue delegate
119+
to `writeRaw()` instead of `writeRawValue()`
120+
(2.10.2)
118121
119122
Wil Selwood (wselwood@github)
120123
* Reported #382: ArrayIndexOutOfBoundsException from UTF32Reader.read on invalid input

release-notes/VERSION-2.x

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ JSON library.
1414
=== Releases ===
1515
------------------------------------------------------------------------
1616

17+
2.9.11 (not yet released)
18+
19+
#580: FilteringGeneratorDelegate writeRawValue delegate to `writeRaw()`
20+
instead of `writeRawValue()`
21+
(reported by Arnaud R)
22+
1723
2.9.10 (21-Sep-2019)
1824

1925
#540: UTF8StreamJsonParser: fix byte to int conversion for malformed escapes

src/test/java/com/fasterxml/jackson/core/filter/BasicGeneratorFilteringTest.java

+16
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,20 @@ public void testWriteStartObjectWithObject() throws Exception
337337
gen.close();
338338
assertEquals(aposToQuotes("{'field1':{},'field2':'val2'}"), w.toString());
339339
}
340+
341+
// [core#580]
342+
public void testRawValueDelegation() throws Exception
343+
{
344+
StringWriter w = new StringWriter();
345+
FilteringGeneratorDelegate gen = new FilteringGeneratorDelegate(JSON_F.createGenerator(w),
346+
TokenFilter.INCLUDE_ALL, true, true);
347+
348+
gen.writeStartArray();
349+
gen.writeRawValue(new char[] { '1'}, 0, 1);
350+
gen.writeRawValue(new char[] { '2'}, 0, 1);
351+
gen.writeEndArray();
352+
353+
gen.close();
354+
assertEquals("[1,2]", w.toString());
355+
}
340356
}

0 commit comments

Comments
 (0)