From 124f908ca8dbfc5755943107fe6657a2d0aaed33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 12:36:57 -0300 Subject: [PATCH] Properly log when the impossible happens --- .../pmd/lang/rule/xpath/impl/AttributeAxisIterator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java index 4337f25a13..01c1642aa7 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java @@ -132,8 +132,8 @@ public class AttributeAxisIterator implements Iterator { try { Class elementKlass = Class.forName(((ParameterizedType) t).getActualTypeArguments()[0].getTypeName()); return CONSIDERED_RETURN_TYPES.contains(elementKlass) || elementKlass.isEnum(); - } catch (ClassNotFoundException ignored) { - // should never happen + } catch (ClassNotFoundException e) { + throw AssertionUtil.shouldNotReachHere("Method '" + method + "' should return a known type, but: " + e, e); } } }