You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/11/12 18:12:11 UTC

[commons-email] branch master updated: Address SpotBugs issue on GitHub

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 719fd67  Address SpotBugs issue on GitHub
719fd67 is described below

commit 719fd67774eb22bf4186a8dfe689d1630fc627e8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 12 13:12:06 2022 -0500

    Address SpotBugs issue on GitHub
    
    These do not show up locally for me
---
 pom.xml                                                             | 4 ++--
 .../apache/commons/mail/resolver/DataSourceClassPathResolver.java   | 6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index d9229fe..3bf85ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -316,8 +316,8 @@
         
         <powermock.version>2.0.9</powermock.version>
         <easymock.version>4.3</easymock.version>
-        <commons.spotbugs.plugin.version>4.7.2.0</commons.spotbugs.plugin.version>
-        <commons.spotbugs.impl.version>4.7.2</commons.spotbugs.impl.version>    
+        <commons.spotbugs.plugin.version>4.7.3.0</commons.spotbugs.plugin.version>
+        <commons.spotbugs.impl.version>4.7.3</commons.spotbugs.impl.version>    
         <commons.jacoco.version>0.8.8</commons.jacoco.version>
     </properties> 
 
diff --git a/src/main/java/org/apache/commons/mail/resolver/DataSourceClassPathResolver.java b/src/main/java/org/apache/commons/mail/resolver/DataSourceClassPathResolver.java
index 8154144..c52c90f 100644
--- a/src/main/java/org/apache/commons/mail/resolver/DataSourceClassPathResolver.java
+++ b/src/main/java/org/apache/commons/mail/resolver/DataSourceClassPathResolver.java
@@ -82,8 +82,6 @@ public class DataSourceClassPathResolver extends DataSourceBaseResolver
     @Override
     public DataSource resolve(final String resourceLocation, final boolean isLenient) throws IOException
     {
-        DataSource result = null;
-
         try
         {
             if (!isCid(resourceLocation) && !isHttpUrl(resourceLocation))
@@ -102,10 +100,10 @@ public class DataSourceClassPathResolver extends DataSourceBaseResolver
                     // EMAIL-125: set the name of the DataSource to the normalized resource URL
                     // similar to other DataSource implementations, e.g. FileDataSource, URLDataSource
                     ds.setName(DataSourceClassPathResolver.class.getResource(resourceName).toString());
-                    result = ds;
+                    return ds;
                 }
             }
-            return result;
+            return null;
         }
         catch (final IOException e)
         {