Skip to content

Commit 4704603

Browse files
committed
Warnings clean up
1 parent 442d2f0 commit 4704603

File tree

10 files changed

+18
-17
lines changed

10 files changed

+18
-17
lines changed

jakarta-jsonp/src/main/java/com/fasterxml/jackson/datatype/jsonp/JsonValueSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void serializeWithType(JsonValue value, JsonGenerator g, SerializerProvid
5050
TypeSerializer typeSer)
5151
throws IOException
5252
{
53-
g.setCurrentValue(value);
53+
g.assignCurrentValue(value);
5454
// 25-Jul-2017, tatu: This may look wrong, but since we don't really know impl
5555
// classes we need to demote type to generic one, first: and as importantly,
5656
// need to claim that we don't really know shape to use (since that can vary

joda-money/src/main/java/com/fasterxml/jackson/datatype/jodamoney/AmountConverter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package com.fasterxml.jackson.datatype.jodamoney;
22

3+
import java.math.BigDecimal;
4+
35
import org.joda.money.CurrencyUnit;
46
import org.joda.money.Money;
57

6-
import java.math.BigDecimal;
7-
88
/**
99
* Common interface for amount conversion strategies used by {@link Money} (de)serializer.
1010
* Allows conversion of {@code Money} to implementation-specific representation of its amount,
1111
* and back to {@code Money}.
1212
*/
13-
interface AmountConverter {
14-
13+
interface AmountConverter
14+
{
1515
Object fromMoney(Money money);
1616

1717
Money toMoney(CurrencyUnit currencyUnit, BigDecimal amount);

joda-money/src/main/java/com/fasterxml/jackson/datatype/jodamoney/JodaMoneySerializerBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract class JodaMoneySerializerBase<T> extends StdSerializer<T>
2020
public void serializeWithType(T value, JsonGenerator g, SerializerProvider provider,
2121
TypeSerializer typeSer) throws IOException
2222
{
23-
g.setCurrentValue(value);
23+
g.assignCurrentValue(value);
2424
// NOTE: we do not actually know the exact shape (or, rather, it varies by settings
2525
// and so should not claim particular shape) -- but need to make sure NOT to report
2626
// as `Shape.OBJECT` or `Shape.ARRAY`

joda-money/src/main/java/com/fasterxml/jackson/datatype/jodamoney/MinorCurrencyUnitAmountConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
* {@link Money#getAmountMinorLong() minor units as a long} (such as {@code 1234} for
1212
* {@code Money.parse("USD 12.34")}), and back to {@code Money} from this representation.
1313
*/
14-
final class MinorCurrencyUnitAmountConverter implements AmountConverter {
15-
14+
final class MinorCurrencyUnitAmountConverter implements AmountConverter
15+
{
1616
private static final MinorCurrencyUnitAmountConverter INSTANCE = new MinorCurrencyUnitAmountConverter();
1717

1818
static MinorCurrencyUnitAmountConverter getInstance() {

joda-money/src/main/java/com/fasterxml/jackson/datatype/jodamoney/MoneySerializer.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package com.fasterxml.jackson.datatype.jodamoney;
22

3+
import java.io.IOException;
4+
5+
import org.joda.money.Money;
6+
37
import com.fasterxml.jackson.core.JsonGenerator;
48
import com.fasterxml.jackson.core.JsonToken;
59
import com.fasterxml.jackson.core.type.WritableTypeId;
610
import com.fasterxml.jackson.databind.SerializerProvider;
711
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
8-
import org.joda.money.Money;
9-
10-
import java.io.IOException;
1112

1213
import static java.util.Objects.requireNonNull;
1314

@@ -46,7 +47,7 @@ public void serializeWithType(Money value, JsonGenerator g,
4647
SerializerProvider context,
4748
TypeSerializer typeSer) throws IOException
4849
{
49-
g.setCurrentValue(value);
50+
g.assignCurrentValue(value);
5051
WritableTypeId typeIdDef = typeSer.writeTypePrefix(g,
5152
typeSer.typeId(value, JsonToken.START_OBJECT));
5253
_writeFields(value, g, context);

json-org/src/main/java/com/fasterxml/jackson/datatype/jsonorg/JSONArraySerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void serialize(JSONArray value, JsonGenerator g, SerializerProvider provi
3939
public void serializeWithType(JSONArray value, JsonGenerator g, SerializerProvider provider,
4040
TypeSerializer typeSer) throws IOException
4141
{
42-
g.setCurrentValue(value);
42+
g.assignCurrentValue(value);
4343
WritableTypeId typeIdDef = typeSer.writeTypePrefix(g,
4444
typeSer.typeId(value, JsonToken.START_ARRAY));
4545
serializeContents(value, g, provider);

json-org/src/main/java/com/fasterxml/jackson/datatype/jsonorg/JSONObjectDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public JSONObject deserialize(JsonParser p, DeserializationContext ctxt)
3737
t = p.nextToken();
3838
}
3939
for (; t == JsonToken.FIELD_NAME; t = p.nextToken()) {
40-
String fieldName = p.getCurrentName();
40+
String fieldName = p.currentName();
4141
t = p.nextToken();
4242
try {
4343
switch (t) {

json-org/src/main/java/com/fasterxml/jackson/datatype/jsonorg/JSONObjectSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void serialize(JSONObject value, JsonGenerator g, SerializerProvider prov
4040
public void serializeWithType(JSONObject value, JsonGenerator g, SerializerProvider provider,
4141
TypeSerializer typeSer) throws IOException
4242
{
43-
g.setCurrentValue(value);
43+
g.assignCurrentValue(value);
4444
WritableTypeId typeIdDef = typeSer.writeTypePrefix(g,
4545
typeSer.typeId(value, JsonToken.START_OBJECT));
4646
serializeContents(value, g, provider);

jsr-353/src/main/java/com/fasterxml/jackson/datatype/jsr353/JsonValueDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected JsonObject _deserializeObject(JsonParser p, DeserializationContext ctx
101101
{
102102
JsonObjectBuilder b = _builderFactory.createObjectBuilder();
103103
while (p.nextToken() != JsonToken.END_OBJECT) {
104-
String name = p.getCurrentName();
104+
String name = p.currentName();
105105
JsonToken t = p.nextToken();
106106
switch (t) {
107107
case START_ARRAY:

jsr-353/src/main/java/com/fasterxml/jackson/datatype/jsr353/JsonValueSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void serializeWithType(JsonValue value, JsonGenerator g, SerializerProvid
5050
TypeSerializer typeSer)
5151
throws IOException
5252
{
53-
g.setCurrentValue(value);
53+
g.assignCurrentValue(value);
5454
// 25-Jul-2017, tatu: This may look wrong, but since we don't really know impl
5555
// classes we need to demote type to generic one, first: and as importantly,
5656
// need to claim that we don't really know shape to use (since that can vary

0 commit comments

Comments
 (0)