From f6a000c1d8ae0a652ff1612a373a0a119de5855c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 22 Jun 2016 10:40:40 +0200 Subject: [PATCH] Cleared some "Possible Null-Pointer Dereferencing"-warnings --- src/main/java/de/juplo/jackson/SimpleMapper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/juplo/jackson/SimpleMapper.java b/src/main/java/de/juplo/jackson/SimpleMapper.java index 914fd5f..d7f108c 100644 --- a/src/main/java/de/juplo/jackson/SimpleMapper.java +++ b/src/main/java/de/juplo/jackson/SimpleMapper.java @@ -332,7 +332,10 @@ public abstract class SimpleMapper { JsonToken token = parser.getCurrentToken(); if (token == null) + { fail(parser, "unexpected EOF"); + return null; // << Will never be reached, because fail always throws an exception + } switch (token) { @@ -346,7 +349,7 @@ public abstract class SimpleMapper case VALUE_NULL: return null; } - fail(parser, "unexpected token " + token.toString()); + fail(parser, "unexpected token " + token); return null; // << Will never be reached, because fail always throws an exception } -- 2.20.1