diff --git a/runtime/Java/src/org/antlr/v4/runtime/Recognizer.java b/runtime/Java/src/org/antlr/v4/runtime/Recognizer.java index 35f7aee95..1d99ee451 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/Recognizer.java +++ b/runtime/Java/src/org/antlr/v4/runtime/Recognizer.java @@ -64,10 +64,12 @@ public abstract class Recognizer { * * Provide a dummy return value here to support backward compatibility. * - * For interpreters, we don't know their serialized ATN despite having - * created the interpreter from it. + * For interpreters, we don't know their serialized ATN despite having + * created the interpreter from it. */ - public String getSerializedATN() { return null; } + public String getSerializedATN() { + throw new UnsupportedOperationException("there is no serialized ATN"); + } /** For debugging and other purposes, might want the grammar name. * Have ANTLR generate an implementation for this method.