Skip to content

Commit 454b95f

Browse files
committed
Try to resolve Java 7 compilation issues
1 parent f3456f5 commit 454b95f

12 files changed

+19
-19
lines changed

src/test/java/com/fasterxml/jackson/databind/BaseMapTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ protected static ObjectMapper newObjectMapper() {
234234

235235
// @since 2.10
236236
protected static ObjectMapper.Builder objectMapperBuilder() {
237-
return (ObjectMapper.Builder) (Object) ObjectMapper.builder();
237+
return (ObjectMapper.Builder)(Object) ObjectMapper.builder();
238238
}
239239

240240
// @since 2.7

src/test/java/com/fasterxml/jackson/databind/deser/TestBasicAnnotations.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void testAnnotationsDisabled() throws Exception
195195
AnnoBean bean = MAPPER.readValue("{ \"y\" : 0 }", AnnoBean.class);
196196
assertEquals(0, bean.value);
197197

198-
ObjectMapper m = ObjectMapper.builder()
198+
ObjectMapper m = objectMapperBuilder()
199199
.configure(MapperFeature.USE_ANNOTATIONS, false)
200200
.build();
201201
// without annotations, should default to default bean-based name...
@@ -208,7 +208,7 @@ public void testEnumsWhenDisabled() throws Exception
208208
ObjectMapper m = new ObjectMapper();
209209
assertEquals(Alpha.B, m.readValue(quote("B"), Alpha.class));
210210

211-
m = ObjectMapper.builder()
211+
m = objectMapperBuilder()
212212
.configure(MapperFeature.USE_ANNOTATIONS, false)
213213
.build();
214214
// should still use the basic name handling here
@@ -217,7 +217,7 @@ public void testEnumsWhenDisabled() throws Exception
217217

218218
public void testNoAccessOverrides() throws Exception
219219
{
220-
ObjectMapper m = ObjectMapper.builder()
220+
ObjectMapper m = objectMapperBuilder()
221221
.disable(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS)
222222
.build();
223223
SimpleBean bean = m.readValue("{\"x\":1,\"y\":2}", SimpleBean.class);

src/test/java/com/fasterxml/jackson/databind/deser/TestSetterlessProperties.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void testSimpleSetterlessCollectionFailure()
6868
ObjectMapper m = new ObjectMapper();
6969
// by default, it should be enabled
7070
assertTrue(m.isEnabled(MapperFeature.USE_GETTERS_AS_SETTERS));
71-
m = ObjectMapper.builder()
71+
m = objectMapperBuilder()
7272
.configure(MapperFeature.USE_GETTERS_AS_SETTERS, false)
7373
.build();
7474
assertFalse(m.isEnabled(MapperFeature.USE_GETTERS_AS_SETTERS));
@@ -100,7 +100,7 @@ public void testSimpleSetterlessMapOk()
100100
public void testSimpleSetterlessMapFailure()
101101
throws Exception
102102
{
103-
ObjectMapper m = ObjectMapper.builder()
103+
ObjectMapper m = objectMapperBuilder()
104104
.configure(MapperFeature.USE_GETTERS_AS_SETTERS, false)
105105
.build();
106106
// so this should fail now without a setter
@@ -113,12 +113,12 @@ public void testSimpleSetterlessMapFailure()
113113
}
114114
}
115115

116-
/* Test for [JACKSON-328], precedence of "getter-as-setter" (for Lists) versus
116+
/* Test precedence of "getter-as-setter" (for Lists) versus
117117
* field for same property.
118118
*/
119119
public void testSetterlessPrecedence() throws Exception
120120
{
121-
ObjectMapper m = ObjectMapper.builder()
121+
ObjectMapper m = objectMapperBuilder()
122122
.configure(MapperFeature.USE_GETTERS_AS_SETTERS, true)
123123
.build();
124124
Dual value = m.readValue("{\"list\":[1,2,3]}, valueType)", Dual.class);

src/test/java/com/fasterxml/jackson/databind/deser/creators/CreatorPropertiesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void testConstructorPropertiesInference() throws Exception
9696
assertEquals(6, result.y);
9797

9898
// but change if configuration changed
99-
ObjectMapper mapper = ObjectMapper.builder()
99+
ObjectMapper mapper = objectMapperBuilder()
100100
.disable(MapperFeature.INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES)
101101
.build();
102102
// in which case fields are set directly:

src/test/java/com/fasterxml/jackson/databind/deser/creators/TestCreators3.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public String getName(){
135135

136136
public void testCreator541() throws Exception
137137
{
138-
ObjectMapper mapper = ObjectMapper.builder()
138+
ObjectMapper mapper = objectMapperBuilder()
139139
.disable(
140140
MapperFeature.AUTO_DETECT_CREATORS,
141141
MapperFeature.AUTO_DETECT_FIELDS,

src/test/java/com/fasterxml/jackson/databind/deser/jdk/JDKNumberDeserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void testTextualNullAsNumber() throws Exception
131131
verifyException(e, "Cannot coerce String \"null\"");
132132
}
133133

134-
ObjectMapper noCoerceMapper = ObjectMapper.builder()
134+
ObjectMapper noCoerceMapper = objectMapperBuilder()
135135
.disable(MapperFeature.ALLOW_COERCION_OF_SCALARS)
136136
.build();
137137
try {

src/test/java/com/fasterxml/jackson/databind/introspect/AutoDetect1947Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void setShouldNotBeDetected(String shouldNotBeDetected) {
3030
}
3131
public void testDisablingAll() throws Exception
3232
{
33-
ObjectMapper mapper = ObjectMapper.builder()
33+
ObjectMapper mapper = objectMapperBuilder()
3434
.disable(MapperFeature.AUTO_DETECT_SETTERS)
3535
.disable(MapperFeature.AUTO_DETECT_FIELDS)
3636
.disable(MapperFeature.AUTO_DETECT_GETTERS)

src/test/java/com/fasterxml/jackson/databind/introspect/TestNamingStrategyStd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,15 @@ public void testNamingWithObjectNode() throws Exception
363363

364364
public void testExplicitRename() throws Exception
365365
{
366-
ObjectMapper m = ObjectMapper.builder()
366+
ObjectMapper m = objectMapperBuilder()
367367
.propertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
368368
.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY)
369369
.build();
370370
// by default, renaming will not take place on explicitly named fields
371371
assertEquals(aposToQuotes("{'firstName':'Peter','lastName':'Venkman','user_age':'35'}"),
372372
m.writeValueAsString(new ExplicitBean()));
373373

374-
m = ObjectMapper.builder()
374+
m = objectMapperBuilder()
375375
.propertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
376376
.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY)
377377
.enable(MapperFeature.ALLOW_EXPLICIT_PROPERTY_RENAMING)

src/test/java/com/fasterxml/jackson/databind/introspect/TestPropertyConflicts.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void testRegularAndIsGetter() throws Exception
116116

117117
public void testInferredNameConflictsWithGetters() throws Exception
118118
{
119-
ObjectMapper mapper = ObjectMapper.builder()
119+
ObjectMapper mapper = objectMapperBuilder()
120120
.annotationIntrospector(new InferingIntrospector())
121121
.build();
122122
String json = mapper.writeValueAsString(new Infernal());
@@ -132,7 +132,7 @@ public void testInferredNameConflictsWithSetters() throws Exception
132132
}
133133

134134
public void testIssue541() throws Exception {
135-
ObjectMapper mapper = ObjectMapper.builder()
135+
ObjectMapper mapper = objectMapperBuilder()
136136
.disable(
137137
MapperFeature.AUTO_DETECT_CREATORS,
138138
MapperFeature.AUTO_DETECT_FIELDS,

src/test/java/com/fasterxml/jackson/databind/jsontype/TestGenericListSerialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void testSubTypesFor356() throws Exception
5454
embedded.add(new Child1());
5555
embedded.add(new Child2());
5656
input.setResult(embedded);
57-
ObjectMapper mapper = ObjectMapper.builder()
57+
ObjectMapper mapper = objectMapperBuilder()
5858
.configure(MapperFeature.USE_STATIC_TYPING, true)
5959
.build();
6060

src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedArraySerialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void testGenericArray() throws Exception
148148
assertEquals(EXP, MAPPER.writeValueAsString(input));
149149

150150
// then with static typing enabled:
151-
ObjectMapper m = ObjectMapper.builder()
151+
ObjectMapper m = objectMapperBuilder()
152152
.configure(MapperFeature.USE_STATIC_TYPING, true)
153153
.build();
154154
assertEquals(EXP, m.writeValueAsString(input));

src/test/java/com/fasterxml/jackson/databind/mixins/MapperMixinsCopy1998Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private String getString(MyModelRoot myModelInstance, ObjectMapper myObjectMappe
119119

120120
private ObjectMapper defaultMapper()
121121
{
122-
return ObjectMapper.builder()
122+
return objectMapperBuilder()
123123
.serializationInclusion(JsonInclude.Include.NON_EMPTY)
124124
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
125125
.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false)

0 commit comments

Comments
 (0)