This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new dceed1be7 Better way to deal with ignored exceptions and PMD checks.
dceed1be7 is described below

commit dceed1be7f279b29702e7a88b2449c88d7bcdb2f
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Jun 13 23:02:14 2022 -0400

    Better way to deal with ignored exceptions and PMD checks.
    
    Gets rid of output like:
    <suppressedviolation
    
filename="...\src\main\java\org\apache\commons\lang3\reflect\MemberUtils.java"
    suppressiontype="nopmd" msg="Avoid empty catch blocks" usermsg="
    "></suppressedviolation>
---
 src/main/java/org/apache/commons/lang3/text/StrLookup.java | 4 ++--
 src/main/java/org/apache/commons/lang3/time/DateUtils.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/text/StrLookup.java 
b/src/main/java/org/apache/commons/lang3/text/StrLookup.java
index fb009e66e..aef5268b4 100644
--- a/src/main/java/org/apache/commons/lang3/text/StrLookup.java
+++ b/src/main/java/org/apache/commons/lang3/text/StrLookup.java
@@ -172,8 +172,8 @@ public abstract class StrLookup<V> {
             if (!key.isEmpty()) {
                 try {
                     return System.getProperty(key);
-                } catch (final SecurityException scex) {
-                    // Squelched. All lookup(String) will return null.
+                } catch (final SecurityException ignored) {
+                    // ignored, all lookup(String) will return null.
                 }
             }
             return null;
diff --git a/src/main/java/org/apache/commons/lang3/time/DateUtils.java 
b/src/main/java/org/apache/commons/lang3/time/DateUtils.java
index 33c61dcad..78fb6b964 100644
--- a/src/main/java/org/apache/commons/lang3/time/DateUtils.java
+++ b/src/main/java/org/apache/commons/lang3/time/DateUtils.java
@@ -374,7 +374,7 @@ public class DateUtils {
                 if (fdp.parse(str, pos, calendar) && pos.getIndex() == 
str.length()) {
                     return calendar.getTime();
                 }
-            } catch (final IllegalArgumentException ignore) {
+            } catch (final IllegalArgumentException ignored) {
                 // leniency is preventing calendar from being set
             }
             pos.setIndex(0);

Reply via email to