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-email.git


The following commit(s) were added to refs/heads/master by this push:
     new 855dcf0  Add PMD check and remove unnecessary parentheses
855dcf0 is described below

commit 855dcf0f09ab07fbdf67d7e471432a8b89eecb72
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Jun 9 08:26:41 2022 -0400

    Add PMD check and remove unnecessary parentheses
---
 pom.xml                                               | 2 +-
 src/main/java/org/apache/commons/mail/EmailUtils.java | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index ed894b7..a4c570d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -323,7 +323,7 @@
     </properties> 
 
     <build>
-        <defaultGoal>clean verify apache-rat:check japicmp:cmp spotbugs:check 
javadoc:javadoc</defaultGoal>
+        <defaultGoal>clean verify apache-rat:check japicmp:cmp pmd:check 
spotbugs:check javadoc:javadoc</defaultGoal>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
diff --git a/src/main/java/org/apache/commons/mail/EmailUtils.java 
b/src/main/java/org/apache/commons/mail/EmailUtils.java
index 1bf9f0c..d97435a 100644
--- a/src/main/java/org/apache/commons/mail/EmailUtils.java
+++ b/src/main/java/org/apache/commons/mail/EmailUtils.java
@@ -254,8 +254,8 @@ final class EmailUtils
                 ch = chars[random.nextInt(gap) + start];
             }
 
-            if ((letters && numbers && Character.isLetterOrDigit(ch)) || 
(letters && Character.isLetter(ch))
-                            || (numbers && Character.isDigit(ch)) || (!letters 
&& !numbers))
+            if (letters && numbers && Character.isLetterOrDigit(ch) || letters 
&& Character.isLetter(ch)
+                            || numbers && Character.isDigit(ch) || !letters && 
!numbers)
             {
                 buffer.append(ch);
             }
@@ -309,7 +309,7 @@ final class EmailUtils
             else
             {
                 builder.append(ESCAPE_CHAR);
-                final char hex1 = Character.toUpperCase(Character.forDigit((b 
>> 4) & 0xF, RADIX));
+                final char hex1 = Character.toUpperCase(Character.forDigit(b 
>> 4 & 0xF, RADIX));
                 final char hex2 = Character.toUpperCase(Character.forDigit(b & 
0xF, RADIX));
                 builder.append(hex1);
                 builder.append(hex2);

Reply via email to