Skip to content

Commit

Permalink
Fix ErrorProne warnings.
Browse files Browse the repository at this point in the history
Fixes #26.
  • Loading branch information
Capstan committed Oct 25, 2019
1 parent 25173c7 commit ad8a25d
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/github/fge/jackson/JacksonUtils.java
Original file line number Diff line number Diff line change
@@ -95,11 +95,11 @@ public static JsonNodeFactory nodeFactory()
*/
public static Map<String, JsonNode> asMap(final JsonNode node)
{
final Map<String, JsonNode> ret = Maps.newHashMap();
if (!node.isObject())
return Collections.emptyMap();
return ret;

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

Map.Entry<String, JsonNode> entry;

Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@
import com.github.fge.msgsimple.load.MessageBundles;
import com.google.common.collect.ImmutableList;

import javax.annotation.concurrent.Immutable;
import java.nio.CharBuffer;
import java.util.List;
import javax.annotation.concurrent.Immutable;


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

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

/**
* The cooked representation of that token
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ public final boolean equals(final Object obj)
return false;
if (this == obj)
return true;
if (getClass() != obj.getClass())
if (!(obj instanceof TokenResolver))
return false;
final TokenResolver<?> other = (TokenResolver<?>) obj;
return token.equals(other.token);
Original file line number Diff line number Diff line change
@@ -29,9 +29,9 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;

import javax.annotation.concurrent.ThreadSafe;
import java.util.Iterator;
import java.util.List;
import javax.annotation.concurrent.ThreadSafe;

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

0 comments on commit ad8a25d

Please sign in to comment.