diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml
index 61f9c5fddf..f6a221708b 100644
--- a/antlr4-wrapper.xml
+++ b/antlr4-wrapper.xml
@@ -51,7 +51,7 @@
value="((${visitor-name}<? super P, ? extends R>) visitor)" />
R acceptVisitor(AstVisitor super P, ? extends R> visitor, P data) {
// override me
- return visitor.visitNode(this, data);
+ throw new IllegalArgumentException("Unsupported visitor" + visitor + " for node " + this);
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractJavaNode.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractJavaNode.java
index a50522a092..79681561a4 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractJavaNode.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractJavaNode.java
@@ -38,7 +38,7 @@ public abstract class AbstractJavaNode extends AbstractJjtreeNode R acceptVisitor(JavaVisitor super P, ? extends R> visitor, P data);
diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/AbstractJspNode.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/AbstractJspNode.java
index d325167911..a0c2c53c57 100644
--- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/AbstractJspNode.java
+++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/AbstractJspNode.java
@@ -18,7 +18,7 @@ abstract class AbstractJspNode extends AbstractJjtreeNode R acceptVisitor(JspVisitor super P, ? extends R> visitor, P data);
diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/AbstractScalaNode.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/AbstractScalaNode.java
index caf0f8e2c0..3f4810296a 100644
--- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/AbstractScalaNode.java
+++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/AbstractScalaNode.java
@@ -38,7 +38,7 @@ abstract class AbstractScalaNode R acceptVisitor(ScalaParserVisitor super P, ? extends R> visitor, P data);