Skip to content

Commit d1a8e71

Browse files
committed
Warnings clean up
1 parent 2d67b15 commit d1a8e71

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515

1616
// [databind#4639] 2.18.1 : regression when using @JsonAnySetter outside of @JsonCreator
1717
public class AnySetterFieldWithCreator4639Test
18-
extends DatabindTestUtil
18+
extends DatabindTestUtil
1919
{
20-
2120
public static class Bean {
22-
private int b;
23-
private int d;
21+
int b;
22+
int d;
2423

2524
@JsonAnySetter
26-
private Map<String, ?> any;
25+
Map<String, ?> any;
2726

2827
@JsonCreator
2928
public Bean(@JsonProperty("b") int b, @JsonProperty("d") int d) {

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class SingleImmutableFieldCreatorTest
1818
extends DatabindTestUtil
1919
{
2020
static class ImmutableId {
21-
private final int id;
21+
final int id;
2222

2323
public ImmutableId(int id) { this.id = id; }
2424

@@ -28,7 +28,7 @@ public int getId() {
2828
}
2929

3030
static class ImmutableIdWithEmptyConstuctor {
31-
private final int id;
31+
final int id;
3232

3333
public ImmutableIdWithEmptyConstuctor() { this(-1); }
3434

@@ -40,7 +40,7 @@ public int getId() {
4040
}
4141

4242
static class ImmutableIdWithJsonCreatorAnnotation {
43-
private final int id;
43+
final int id;
4444

4545
@JsonCreator
4646
public ImmutableIdWithJsonCreatorAnnotation(int id) { this.id = id; }
@@ -51,7 +51,8 @@ public int getId() {
5151
}
5252

5353
static class ImmutableIdWithJsonPropertyFieldAnnotation {
54-
@JsonProperty("id") private final int id;
54+
@JsonProperty("id")
55+
final int id;
5556

5657
public ImmutableIdWithJsonPropertyFieldAnnotation(int id) { this.id = id; }
5758

@@ -61,7 +62,7 @@ public int getId() {
6162
}
6263

6364
static class ImmutableIdWithJsonPropertyConstructorAnnotation {
64-
private final int id;
65+
final int id;
6566

6667
public ImmutableIdWithJsonPropertyConstructorAnnotation(@JsonProperty("id") int id) { this.id = id; }
6768

src/test/java/com/fasterxml/jackson/databind/ser/TestConfig.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,16 @@ public void testProviderConfig() throws Exception
152152
DefaultSerializerProvider prov = (DefaultSerializerProvider) mapper.getSerializerProvider();
153153
assertEquals(0, prov.cachedSerializersCount());
154154
// and then should get one constructed for:
155-
Map<String,Object> result = this.writeAndMap(mapper, new AnnoBean());
155+
Map<String,Object> result = writeAndMap(mapper, new AnnoBean());
156156
assertEquals(2, result.size());
157157
assertEquals(Integer.valueOf(1), result.get("x"));
158158
assertEquals(Integer.valueOf(2), result.get("y"));
159159

160-
/* Note: it is 2 because we'll also get serializer for basic 'int', not
161-
* just AnnoBean
162-
*/
163-
/* 12-Jan-2010, tatus: Actually, probably more, if and when we typing
164-
* aspects are considered (depending on what is cached)
165-
*/
160+
// Note: it is 2 because we'll also get serializer for basic 'int', not
161+
// just AnnoBean
162+
163+
// 12-Jan-2010, tatus: Actually, probably more, if and when we typing
164+
// aspects are considered (depending on what is cached)
166165
int count = prov.cachedSerializersCount();
167166
if (count < 2) {
168167
fail("Should have at least 2 cached serializers, got "+count);

src/test/java/com/fasterxml/jackson/databind/testutil/failure/JacksonTestFailureExpectedInterceptor.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.fasterxml.jackson.databind.testutil.failure;
22

3+
import java.lang.reflect.Method;
4+
35
import org.junit.jupiter.api.extension.ExtensionContext;
46
import org.junit.jupiter.api.extension.InvocationInterceptor;
57
import org.junit.jupiter.api.extension.ReflectiveInvocationContext;
68

7-
import java.lang.reflect.Method;
8-
import java.util.List;
9-
109
/**
1110
* Custom {@link InvocationInterceptor} that intercepts test method invocation.
1211
* To pass the test ***only if*** test fails with an exception, and fail the test otherwise.
@@ -16,11 +15,11 @@
1615
public class JacksonTestFailureExpectedInterceptor
1716
implements InvocationInterceptor
1817
{
19-
2018
@Override
2119
public void interceptTestMethod(Invocation<Void> invocation,
22-
ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext)
23-
throws Throwable {
20+
ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext)
21+
throws Throwable
22+
{
2423
try {
2524
invocation.proceed();
2625
} catch (Throwable t) {
@@ -34,7 +33,7 @@ private void handleUnexpectePassingTest(ReflectiveInvocationContext<Method> invo
3433
// Collect information we need
3534
Object targetClass = invocationContext.getTargetClass();
3635
Object testMethod = invocationContext.getExecutable().getName();
37-
List<Object> arguments = invocationContext.getArguments();
36+
//List<Object> arguments = invocationContext.getArguments();
3837

3938
// Create message
4039
String message = String.format("Test method %s.%s() passed, but should have failed", targetClass, testMethod);

src/test/java/com/fasterxml/jackson/databind/testutil/failure/JacksonTestShouldFailException.java

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
public class JacksonTestShouldFailException
1111
extends RuntimeException
1212
{
13+
private static final long serialVersionUID = 1L;
14+
1315
public JacksonTestShouldFailException(String msg) {
1416
super(msg);
1517
}

src/test/java/com/fasterxml/jackson/databind/tofix/JacksonBuilderCreatorSubtype4742Test.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
// [databind#4742] Deserialization with Builder, External type id,
2020
// @JsonCreator not yet implemented
2121
public class JacksonBuilderCreatorSubtype4742Test
22-
extends DatabindTestUtil
22+
extends DatabindTestUtil
2323
{
24-
2524
public static class Animals {
2625
@JsonProperty("animals")
2726
public List<Animal> animals;
@@ -64,11 +63,13 @@ public static class BuilderImpl extends Builder {
6463
private String kind;
6564
private AnimalProperties properties;
6665

66+
@Override
6767
public BuilderImpl kind(String kind) {
6868
this.kind = kind;
6969
return this;
7070
}
7171

72+
@Override
7273
public BuilderImpl properties(AnimalProperties properties) {
7374
this.properties = properties;
7475
return this;
@@ -107,12 +108,11 @@ public String toString() {
107108
}
108109
}
109110

110-
final ObjectMapper MAPPER = newJsonMapper();
111+
private final ObjectMapper MAPPER = newJsonMapper();
111112

112113
@JacksonTestFailureExpected
113114
@Test
114-
public void testDeser()
115-
throws Exception
115+
public void testDeser() throws Exception
116116
{
117117
final Animals animals = MAPPER.readValue(
118118
"{\n" +

0 commit comments

Comments
 (0)