You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2011/04/07 06:39:34 UTC
svn commit: r1089736 - in
/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3: ./
exception/ math/ reflect/ text/
Author: bayard
Date: Thu Apr 7 04:39:33 2011
New Revision: 1089736
URL: http://svn.apache.org/viewvc?rev=1089736&view=rev
Log:
Adding NOPMD tags for various empty catch blocks
Modified:
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java?rev=1089736&r1=1089735&r2=1089736&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java Thu Apr 7 04:39:33 2011
@@ -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
}
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java?rev=1089736&r1=1089735&r2=1089736&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java Thu Apr 7 04:39:33 2011
@@ -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
}
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java?rev=1089736&r1=1089735&r2=1089736&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java Thu Apr 7 04:39:33 2011
@@ -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
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java?rev=1089736&r1=1089735&r2=1089736&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java Thu Apr 7 04:39:33 2011
@@ -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;
/*
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java?rev=1089736&r1=1089735&r2=1089736&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java Thu Apr 7 04:39:33 2011
@@ -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;
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java?rev=1089736&r1=1089735&r2=1089736&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java Thu Apr 7 04:39:33 2011
@@ -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
}
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java?rev=1089736&r1=1089735&r2=1089736&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java Thu Apr 7 04:39:33 2011
@@ -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;
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java?rev=1089736&r1=1089735&r2=1089736&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java Thu Apr 7 04:39:33 2011
@@ -345,7 +345,7 @@ public class ExtendedMessageFormat exten
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.
}