diff --git a/src/main/java/org/apache/commons/lang3/ClassUtils.java b/src/main/java/org/apache/commons/lang3/ClassUtils.java index bdd6e9ef1..a8ede1e56 100644 --- a/src/main/java/org/apache/commons/lang3/ClassUtils.java +++ b/src/main/java/org/apache/commons/lang3/ClassUtils.java @@ -567,7 +567,7 @@ public class ClassUtils { try { return getClass(classLoader, className.substring(0, lastDotIndex) + INNER_CLASS_SEPARATOR_CHAR + className.substring(lastDotIndex + 1), initialize); - } catch (final ClassNotFoundException ex2) { // NOPMD + } catch (final ClassNotFoundException ignored) { // ignore exception } } diff --git a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java index a44c59cf5..ae6b87928 100644 --- a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java +++ b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java @@ -743,7 +743,7 @@ public class NumberUtils { && (!numeric.isEmpty() && numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) || isDigits(numeric))) { try { return createLong(numeric); - } catch (final NumberFormatException nfe) { // NOPMD + } catch (final NumberFormatException ignored) { // Too big for a long } return createBigInteger(numeric); @@ -760,7 +760,7 @@ public class NumberUtils { return f; } - } catch (final NumberFormatException nfe) { // NOPMD + } catch (final NumberFormatException ignored) { // ignore the bad number } //$FALL-THROUGH$ @@ -771,12 +771,12 @@ public class NumberUtils { if (!(d.isInfinite() || d.doubleValue() == 0.0D && !isZero(mant, dec))) { return d; } - } catch (final NumberFormatException nfe) { // NOPMD + } catch (final NumberFormatException ignored) { // ignore the bad number } try { return createBigDecimal(numeric); - } catch (final NumberFormatException e) { // NOPMD + } catch (final NumberFormatException ignored) { // ignore the bad number } //$FALL-THROUGH$ @@ -796,12 +796,12 @@ public class NumberUtils { //Must be an Integer, Long, Biginteger try { return createInteger(str); - } catch (final NumberFormatException nfe) { // NOPMD + } catch (final NumberFormatException ignored) { // ignore the bad number } try { return createLong(str); - } catch (final NumberFormatException nfe) { // NOPMD + } catch (final NumberFormatException ignored) { // ignore the bad number } return createBigInteger(str); @@ -823,7 +823,7 @@ public class NumberUtils { } return b; } - } catch (final NumberFormatException nfe) { // NOPMD + } catch (final NumberFormatException ignored) { // ignore the bad number } return createBigDecimal(str); diff --git a/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java b/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java index 735ff611d..c8398a051 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java @@ -244,7 +244,8 @@ public class ConstructorUtils { // most of the time this works and it's much faster try { return MemberUtils.setAccessibleWorkaround(cls.getConstructor(parameterTypes)); - } catch (final NoSuchMethodException e) { // NOPMD - Swallow + } catch (final NoSuchMethodException ignored) { + // ignore } Constructor result = null; /* diff --git a/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java b/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java index 663dfe18b..5668fcef2 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java @@ -112,7 +112,7 @@ public class FieldUtils { field.setAccessible(true); } return field; - } catch (final NoSuchFieldException ex) { // NOPMD + } catch (final NoSuchFieldException ignored) { // ignore } } @@ -126,7 +126,7 @@ public class FieldUtils { Validate.isTrue(match == null, "Reference to field %s is ambiguous relative to %s" + "; a matching field exists on two or more implemented interfaces.", fieldName, cls); match = test; - } catch (final NoSuchFieldException ex) { // NOPMD + } catch (final NoSuchFieldException ignored) { // ignore } } @@ -177,7 +177,7 @@ public class FieldUtils { field.setAccessible(true); } return field; - } catch (final NoSuchFieldException e) { // NOPMD + } catch (final NoSuchFieldException ignored) { // ignore } return null; diff --git a/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java b/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java index 2592e2169..f79383913 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java @@ -61,7 +61,7 @@ final class MemberUtils { try { obj.setAccessible(true); return obj; - } catch (final SecurityException e) { // NOPMD + } catch (final SecurityException ignored) { // ignore in favor of subsequent IllegalAccessException } } diff --git a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java index 3f2db41ad..a4b77a38f 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java @@ -625,7 +625,7 @@ public class MethodUtils { try { return anInterface.getDeclaredMethod(methodName, parameterTypes); - } catch (final NoSuchMethodException e) { // NOPMD + } catch (final NoSuchMethodException ignored) { /* * Swallow, if no method is found after the loop then this * method returns null. @@ -668,7 +668,8 @@ public class MethodUtils { final String methodName, final Class... parameterTypes) { try { return MemberUtils.setAccessibleWorkaround(cls.getMethod(methodName, parameterTypes)); - } catch (final NoSuchMethodException e) { // NOPMD - Swallow the exception + } catch (final NoSuchMethodException ignored) { + // Swallow the exception } // search through all methods final Method[] methods = cls.getMethods(); diff --git a/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java b/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java index 0afa25253..d30ba9885 100644 --- a/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java +++ b/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java @@ -350,7 +350,7 @@ public class ExtendedMessageFormat extends MessageFormat { if ((c == START_FMT || c == END_FE) && result.length() > 0) { try { return Integer.parseInt(result.toString()); - } catch (final NumberFormatException e) { // NOPMD + } catch (final NumberFormatException ignored) { // we've already ensured only digits, so unless something // outlandishly large was specified we should be okay. }