File tree Expand file tree Collapse file tree 3 files changed +7
-20
lines changed
google-http-client-jackson2/src
main/java/com/google/api/client/json/jackson2
test/java/com/google/api/client/json/jackson2 Expand file tree Collapse file tree 3 files changed +7
-20
lines changed Original file line number Diff line number Diff line change 3939public final class JacksonFactory extends JsonFactory {
4040
4141 /** JSON factory. */
42- private final com .fasterxml .jackson .core .JsonFactory factory ;
42+ private final com .fasterxml .jackson .core .JsonFactory factory =
43+ new com .fasterxml .jackson .core .JsonFactory ();
4344
44- public JacksonFactory () {
45- factory = new com .fasterxml .jackson .core .JsonFactory ();
45+ {
4646 // don't auto-close JSON content in order to ensure consistent behavior across JSON factories
4747 // TODO(rmistry): Should we disable the JsonGenerator.Feature.AUTO_CLOSE_TARGET feature?
4848 factory .configure (
Original file line number Diff line number Diff line change 3333 */
3434public class JacksonFactoryTest extends AbstractJsonFactoryTest {
3535
36- private static final String JSON_ENTRY_PRETTY ;
37- private static final String JSON_FEED_PRETTY ;
38-
39- static {
40- JSON_ENTRY_PRETTY =
41- "{"
42- + StringUtils .LINE_SEPARATOR
43- + " \" title\" : \" foo\" "
44- + StringUtils .LINE_SEPARATOR
45- + "}" ;
46- JSON_FEED_PRETTY =
36+ private static final String JSON_ENTRY_PRETTY =
37+ "{" + StringUtils .LINE_SEPARATOR + " \" title\" : \" foo\" " + StringUtils .LINE_SEPARATOR + "}" ;
38+ private static final String JSON_FEED_PRETTY =
4739 "{"
4840 + StringUtils .LINE_SEPARATOR
4941 + " \" entries\" : [ {"
@@ -57,7 +49,6 @@ public class JacksonFactoryTest extends AbstractJsonFactoryTest {
5749 + " } ]"
5850 + StringUtils .LINE_SEPARATOR
5951 + "}" ;
60- }
6152
6253 @ Override
6354 protected JsonFactory newFactory () {
Original file line number Diff line number Diff line change 2121
2222public class JacksonGeneratorTest extends AbstractJsonGeneratorTest {
2323
24- private static final JacksonFactory FACTORY ;
25-
26- static {
27- FACTORY = new JacksonFactory ();
28- }
24+ private static final JacksonFactory FACTORY = new JacksonFactory ();
2925
3026 @ Override
3127 protected JsonGenerator newGenerator (Writer writer ) throws IOException {
You can’t perform that action at this time.
0 commit comments