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); } } }