Skip to content

Commit 1fdb431

Browse files
committed
Start work on fixing #120, first for int/long, afterburner, 2.12
1 parent baea709 commit 1fdb431

File tree

10 files changed

+1369
-321
lines changed

10 files changed

+1369
-321
lines changed

afterburner/src/main/java/com/fasterxml/jackson/module/afterburner/deser/OptimizedSettableBeanProperty.java

+244-92
Large diffs are not rendered by default.

afterburner/src/test/java/com/fasterxml/jackson/module/afterburner/AfterburnerTestBase.java

+44
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,34 @@ public abstract class AfterburnerTestBase extends junit.framework.TestCase
1616

1717
public enum ABC { A, B, C; }
1818

19+
protected static class BooleanWrapper {
20+
public Boolean b;
21+
22+
public BooleanWrapper() { }
23+
public BooleanWrapper(Boolean value) { b = value; }
24+
}
25+
26+
protected static class IntWrapper {
27+
public int i;
28+
29+
public IntWrapper() { }
30+
public IntWrapper(int value) { i = value; }
31+
}
32+
33+
protected static class LongWrapper {
34+
public long l;
35+
36+
public LongWrapper() { }
37+
public LongWrapper(long value) { l = value; }
38+
}
39+
40+
protected static class DoubleWrapper {
41+
public double d;
42+
43+
public DoubleWrapper() { }
44+
public DoubleWrapper(double value) { d = value; }
45+
}
46+
1947
// since 2.8
2048
public static class Point {
2149
public int x, y;
@@ -257,10 +285,26 @@ protected void verifyException(Throwable e, String... matches)
257285
*/
258286

259287
public String quote(String str) {
288+
return q(str);
289+
}
290+
291+
public String q(String str) {
260292
return '"'+str+'"';
261293
}
262294

263295
protected static String aposToQuotes(String json) {
296+
return a2q(json);
297+
}
298+
299+
protected static String a2q(String json) {
264300
return json.replace("'", "\"");
265301
}
302+
303+
protected byte[] utf8Bytes(String str) {
304+
try {
305+
return str.getBytes("UTF-8");
306+
} catch (IOException e) {
307+
throw new IllegalArgumentException(e);
308+
}
309+
}
266310
}

0 commit comments

Comments
 (0)