From 7f15889d92938272dc5918c6f445f1ca3edaa11b Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 21 Nov 2013 12:27:51 -0600 Subject: [PATCH] Make utility methods in ATNDeserializer static --- .../src/org/antlr/v4/runtime/atn/ATNDeserializer.java | 8 ++++---- .../Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java index a3fd7606c..2554b80c2 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java @@ -527,20 +527,20 @@ public class ATNDeserializer { } } - protected int toInt(char c) { + protected static int toInt(char c) { return c; } - protected int toInt32(char[] data, int offset) { + protected static int toInt32(char[] data, int offset) { return (int)data[offset] | ((int)data[offset + 1] << 16); } - protected long toLong(char[] data, int offset) { + protected static long toLong(char[] data, int offset) { long lowOrder = toInt32(data, offset) & 0x00000000FFFFFFFFL; return lowOrder | ((long)toInt32(data, offset + 2) << 32); } - protected UUID toUUID(char[] data, int offset) { + protected static UUID toUUID(char[] data, int offset) { long leastSigBits = toLong(data, offset); long mostSigBits = toLong(data, offset + 4); return new UUID(mostSigBits, leastSigBits); diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java index 71cb488a5..6cb95a6e0 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java @@ -145,7 +145,7 @@ public abstract class ATNSimulator { */ @Deprecated public static int toInt(char c) { - return new ATNDeserializer().toInt(c); + return ATNDeserializer.toInt(c); } /** @@ -153,7 +153,7 @@ public abstract class ATNSimulator { */ @Deprecated public static int toInt32(char[] data, int offset) { - return new ATNDeserializer().toInt32(data, offset); + return ATNDeserializer.toInt32(data, offset); } /** @@ -161,7 +161,7 @@ public abstract class ATNSimulator { */ @Deprecated public static long toLong(char[] data, int offset) { - return new ATNDeserializer().toLong(data, offset); + return ATNDeserializer.toLong(data, offset); } /** @@ -169,7 +169,7 @@ public abstract class ATNSimulator { */ @Deprecated public static UUID toUUID(char[] data, int offset) { - return new ATNDeserializer().toUUID(data, offset); + return ATNDeserializer.toUUID(data, offset); } /**