File tree Expand file tree Collapse file tree 1 file changed +7
-20
lines changed
src/main/java/com/github/fabienrenaud/jjb Expand file tree Collapse file tree 1 file changed +7
-20
lines changed Original file line number Diff line number Diff line change 11package com .github .fabienrenaud .jjb ;
22
3+ import com .dslplatform .json .JsonWriter ;
4+
35import javax .json .spi .JsonProvider ;
46import java .io .ByteArrayOutputStream ;
57
@@ -35,25 +37,10 @@ public static com.dslplatform.json.JsonWriter dslJsonWriter() {
3537 return writer ;
3638 }
3739
38- private static final ThreadLocal <ByteArrayOutputStream > THREAD_BYTE_ARRAY_OUTPUT_STREAM = new ThreadLocal <ByteArrayOutputStream >() {
39- @ Override
40- protected ByteArrayOutputStream initialValue () {
41- return new ByteArrayOutputStream ();
42- }
43- };
44-
45- private static final ThreadLocal <StringBuilder > THREAD_STRING_BUILDER = new ThreadLocal <StringBuilder >() {
46- @ Override
47- protected StringBuilder initialValue () {
48- return new StringBuilder ();
49- }
50- };
51-
52- private static final ThreadLocal <com .dslplatform .json .JsonWriter > THREAD_DSL_WRITER = new ThreadLocal <com .dslplatform .json .JsonWriter >() {
53- @ Override
54- protected com .dslplatform .json .JsonWriter initialValue () {
55- return new com .dslplatform .json .JsonWriter ();
56- }
57- };
40+ private static final ThreadLocal <ByteArrayOutputStream > THREAD_BYTE_ARRAY_OUTPUT_STREAM = ThreadLocal .withInitial (ByteArrayOutputStream ::new );
41+
42+ private static final ThreadLocal <StringBuilder > THREAD_STRING_BUILDER = ThreadLocal .withInitial (StringBuilder ::new );
43+
44+ private static final ThreadLocal <com .dslplatform .json .JsonWriter > THREAD_DSL_WRITER = ThreadLocal .withInitial (JsonWriter ::new );
5845
5946}
You can’t perform that action at this time.
0 commit comments