Skip to content

Commit ad8a25d

Browse files
committed
Fix ErrorProne warnings.
Fixes #26.
1 parent 25173c7 commit ad8a25d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/main/java/com/github/fge/jackson/JacksonUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ public static JsonNodeFactory nodeFactory()
9595
*/
9696
public static Map<String, JsonNode> asMap(final JsonNode node)
9797
{
98+
final Map<String, JsonNode> ret = Maps.newHashMap();
9899
if (!node.isObject())
99-
return Collections.emptyMap();
100+
return ret;
100101

101102
final Iterator<Map.Entry<String, JsonNode>> iterator = node.fields();
102-
final Map<String, JsonNode> ret = Maps.newHashMap();
103103

104104
Map.Entry<String, JsonNode> entry;
105105

src/main/java/com/github/fge/jackson/jsonpointer/ReferenceToken.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import com.github.fge.msgsimple.load.MessageBundles;
2424
import com.google.common.collect.ImmutableList;
2525

26-
import javax.annotation.concurrent.Immutable;
2726
import java.nio.CharBuffer;
2827
import java.util.List;
28+
import javax.annotation.concurrent.Immutable;
2929

3030

3131
/**
@@ -55,14 +55,14 @@ public final class ReferenceToken
5555
/**
5656
* List of encoding characters in a cooked token
5757
*/
58-
private static final List<Character> ENCODED = ImmutableList.of('0', '1');
58+
private static final ImmutableList<Character> ENCODED = ImmutableList.of('0', '1');
5959

6060
/**
6161
* List of sequences to encode in a raw token
6262
*
6363
* <p>This list and {@link #ENCODED} have matching indices on purpose.</p>
6464
*/
65-
private static final List<Character> DECODED = ImmutableList.of('~', '/');
65+
private static final ImmutableList<Character> DECODED = ImmutableList.of('~', '/');
6666

6767
/**
6868
* The cooked representation of that token

src/main/java/com/github/fge/jackson/jsonpointer/TokenResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public final boolean equals(final Object obj)
9090
return false;
9191
if (this == obj)
9292
return true;
93-
if (getClass() != obj.getClass())
93+
if (!(obj instanceof TokenResolver))
9494
return false;
9595
final TokenResolver<?> other = (TokenResolver<?>) obj;
9696
return token.equals(other.token);

src/main/java/com/github/fge/jackson/jsonpointer/TreePointer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
import com.google.common.collect.ImmutableList;
3030
import com.google.common.collect.Lists;
3131

32-
import javax.annotation.concurrent.ThreadSafe;
3332
import java.util.Iterator;
3433
import java.util.List;
34+
import javax.annotation.concurrent.ThreadSafe;
3535

3636
/**
3737
* A pointer into a {@link TreeNode}
@@ -174,7 +174,7 @@ public final boolean equals(final Object obj)
174174
return false;
175175
if (this == obj)
176176
return true;
177-
if (getClass() != obj.getClass())
177+
if (!(obj instanceof TreePointer))
178178
return false;
179179
final TreePointer<?> other = (TreePointer<?>) obj;
180180
return tokenResolvers.equals(other.tokenResolvers);

0 commit comments

Comments
 (0)