|
1 | 1 | package com.fasterxml.jackson.core.sym;
|
2 | 2 |
|
3 | 3 | import java.io.*;
|
| 4 | +import java.lang.reflect.Field; |
4 | 5 |
|
5 | 6 | import com.fasterxml.jackson.core.*;
|
6 | 7 |
|
7 | 8 | /**
|
8 | 9 | * Unit test(s) to verify that handling of (byte-based) symbol tables
|
9 |
| - * is working. Created to verify fix to [JACKSON-5] (although not very |
10 |
| - * good at catching it...). |
| 10 | + * is working. |
11 | 11 | */
|
12 | 12 | public class TestByteBasedSymbols
|
13 | 13 | extends com.fasterxml.jackson.core.BaseTest
|
@@ -97,7 +97,29 @@ public void testAuxMethodsWithNewSymboTable() throws Exception
|
97 | 97 | */
|
98 | 98 | assertNotNull(nc.toString());
|
99 | 99 | }
|
100 |
| - |
| 100 | + |
| 101 | + // as per name, for [core#207] |
| 102 | + public void testIssue207() throws Exception |
| 103 | + { |
| 104 | + ByteQuadsCanonicalizer nc = ByteQuadsCanonicalizer.createRoot(-523743345); |
| 105 | + Field byteSymbolCanonicalizerField = JsonFactory.class.getDeclaredField("_byteSymbolCanonicalizer"); |
| 106 | + byteSymbolCanonicalizerField.setAccessible(true); |
| 107 | + JsonFactory jsonF = new JsonFactory(); |
| 108 | + byteSymbolCanonicalizerField.set(jsonF, nc); |
| 109 | + |
| 110 | + StringBuilder stringBuilder = new StringBuilder(); |
| 111 | + stringBuilder.append("{\n"); |
| 112 | + stringBuilder.append(" \"expectedGCperPosition\": null"); |
| 113 | + for (int i = 0; i < 60; ++i) { |
| 114 | + stringBuilder.append(",\n \"").append(i + 1).append("\": null"); |
| 115 | + } |
| 116 | + stringBuilder.append("\n}"); |
| 117 | + |
| 118 | + JsonParser p = jsonF.createParser(stringBuilder.toString().getBytes("UTF-8")); |
| 119 | + while (p.nextToken() != null) { } |
| 120 | + p.close(); |
| 121 | + } |
| 122 | + |
101 | 123 | /*
|
102 | 124 | /**********************************************************
|
103 | 125 | /* Helper methods
|
|
0 commit comments