Adding NOPMD tags for various empty catch blocks

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1089736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2011-04-07 04:39:33 +00:00
parent 4c690103f1
commit d6fe7f6789
8 changed files with 25 additions and 24 deletions

View File

@ -117,7 +117,7 @@ public class SerializationUtils {
if (out != null) {
out.close();
}
} catch (IOException ex) {
} catch (IOException ex) { // NOPMD
// ignore close exception
}
}
@ -173,7 +173,7 @@ public class SerializationUtils {
if (in != null) {
in.close();
}
} catch (IOException ex) {
} catch (IOException ex) { // NOPMD
// ignore close exception
}
}

View File

@ -203,20 +203,20 @@ public class ExceptionUtils {
Method method = null;
try {
method = throwable.getClass().getMethod(methodName, (Class[]) null);
} catch (NoSuchMethodException ignored) {
} catch (NoSuchMethodException ignored) { // NOPMD
// exception ignored
} catch (SecurityException ignored) {
} catch (SecurityException ignored) { // NOPMD
// exception ignored
}
if (method != null && Throwable.class.isAssignableFrom(method.getReturnType())) {
try {
return (Throwable) method.invoke(throwable, ArrayUtils.EMPTY_OBJECT_ARRAY);
} catch (IllegalAccessException ignored) {
} catch (IllegalAccessException ignored) { // NOPMD
// exception ignored
} catch (IllegalArgumentException ignored) {
} catch (IllegalArgumentException ignored) { // NOPMD
// exception ignored
} catch (InvocationTargetException ignored) {
} catch (InvocationTargetException ignored) { // NOPMD
// exception ignored
}
}

View File

@ -504,8 +504,8 @@ public class NumberUtils {
&& (numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) || isDigits(numeric))) {
try {
return createLong(numeric);
} catch (NumberFormatException nfe) {
//Too big for a long
} catch (NumberFormatException nfe) { // NOPMD
// Too big for a long
}
return createBigInteger(numeric);
@ -521,7 +521,7 @@ public class NumberUtils {
return f;
}
} catch (NumberFormatException nfe) {
} catch (NumberFormatException nfe) { // NOPMD
// ignore the bad number
}
//$FALL-THROUGH$
@ -532,12 +532,12 @@ public class NumberUtils {
if (!(d.isInfinite() || (d.floatValue() == 0.0D && !allZeros))) {
return d;
}
} catch (NumberFormatException nfe) {
} catch (NumberFormatException nfe) { // NOPMD
// ignore the bad number
}
try {
return createBigDecimal(numeric);
} catch (NumberFormatException e) {
} catch (NumberFormatException e) { // NOPMD
// ignore the bad number
}
//$FALL-THROUGH$
@ -557,12 +557,12 @@ public class NumberUtils {
//Must be an int,long,bigint
try {
return createInteger(str);
} catch (NumberFormatException nfe) {
} catch (NumberFormatException nfe) { // NOPMD
// ignore the bad number
}
try {
return createLong(str);
} catch (NumberFormatException nfe) {
} catch (NumberFormatException nfe) { // NOPMD
// ignore the bad number
}
return createBigInteger(str);
@ -575,7 +575,7 @@ public class NumberUtils {
if (!(f.isInfinite() || (f.floatValue() == 0.0F && !allZeros))) {
return f;
}
} catch (NumberFormatException nfe) {
} catch (NumberFormatException nfe) { // NOPMD
// ignore the bad number
}
try {
@ -583,7 +583,7 @@ public class NumberUtils {
if (!(d.isInfinite() || (d.doubleValue() == 0.0D && !allZeros))) {
return d;
}
} catch (NumberFormatException nfe) {
} catch (NumberFormatException nfe) { // NOPMD
// ignore the bad number
}

View File

@ -261,7 +261,7 @@ public class ConstructorUtils {
Constructor<T> ctor = cls.getConstructor(parameterTypes);
MemberUtils.setAccessibleWorkaround(ctor);
return ctor;
} catch (NoSuchMethodException e) { /* SWALLOW */
} catch (NoSuchMethodException e) { // NOPMD - Swallow
}
Constructor<T> result = null;
/*

View File

@ -106,7 +106,7 @@ public class FieldUtils {
}
}
return field;
} catch (NoSuchFieldException ex) {
} catch (NoSuchFieldException ex) { // NOPMD
// ignore
}
}
@ -127,7 +127,7 @@ public class FieldUtils {
+ "; a matching field exists on two or more implemented interfaces.");
}
match = test;
} catch (NoSuchFieldException ex) {
} catch (NoSuchFieldException ex) { // NOPMD
// ignore
}
}
@ -176,7 +176,8 @@ public class FieldUtils {
}
}
return field;
} catch (NoSuchFieldException e) {
} catch (NoSuchFieldException e) { // NOPMD
// ignore
}
return null;
}

View File

@ -60,7 +60,7 @@ abstract class MemberUtils {
&& isPackageAccess(m.getDeclaringClass().getModifiers())) {
try {
o.setAccessible(true);
} catch (SecurityException e) {
} catch (SecurityException e) { // NOPMD
// ignore in favor of subsequent IllegalAccessException
}
}

View File

@ -465,7 +465,7 @@ public class MethodUtils {
try {
method = interfaces[i].getDeclaredMethod(methodName,
parameterTypes);
} catch (NoSuchMethodException e) {
} catch (NoSuchMethodException e) { // NOPMD
/*
* Swallow, if no method is found after the loop then this
* method returns null.
@ -511,7 +511,7 @@ public class MethodUtils {
Method method = cls.getMethod(methodName, parameterTypes);
MemberUtils.setAccessibleWorkaround(method);
return method;
} catch (NoSuchMethodException e) { /* SWALLOW */
} catch (NoSuchMethodException e) { /* SWALLOW - NOPMD */
}
// search through all methods
Method bestMatch = null;

View File

@ -345,7 +345,7 @@ public class ExtendedMessageFormat extends MessageFormat {
if ((c == START_FMT || c == END_FE) && result.length() > 0) {
try {
return Integer.parseInt(result.toString());
} catch (NumberFormatException e) {
} catch (NumberFormatException e) { // NOPMD
// we've already ensured only digits, so unless something
// outlandishly large was specified we should be okay.
}