diff --git a/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java b/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java index b4eb5542..151a909f 100644 --- a/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java +++ b/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java @@ -34,6 +34,8 @@ //This class represents either the Json tokenizer and the Json parser. public class JsonStreamParserImpl extends JohnzonJsonParserImpl implements JsonChars { + private static final Event[] EVENT_VALUES = Event.values(); + private final boolean autoAdjust; //the main buffer where the stream will be buffered @@ -384,8 +386,8 @@ protected final char readNextNonWhitespaceChar(char c) { @Override public Event currentEvent() { - return previousEvent >= 0 && previousEvent < Event.values().length - ? Event.values()[previousEvent] + return previousEvent >= 0 && previousEvent < EVENT_VALUES.length + ? EVENT_VALUES[previousEvent] : null; }