You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/01/27 16:08:24 UTC

[tomcat] branch main updated (ce8621750e -> 1b34d17b7d)

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

markt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


    from ce8621750e Redirect no longer required for root mapping
     new 36996b7202 Add missing final (reported by SpotBugs)
     new c2f49d28a9 Remove unused code
     new 1f90e3ddeb Improve exception handling to avoid SpotBugs warning
     new 1b34d17b7d Ignore SpotBugs false positive

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/coyote/http2/Http2Parser.java       | 3 +--
 java/org/apache/naming/factory/SendMailFactory.java | 7 ++++++-
 java/org/apache/tomcat/util/buf/CharsetHolder.java  | 2 +-
 res/spotbugs/filter-false-positives.xml             | 6 ++++++
 4 files changed, 14 insertions(+), 4 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 03/04: Improve exception handling to avoid SpotBugs warning

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 1f90e3ddebae9e42e4859ab3149f594f2bdc5af9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 27 16:07:19 2023 +0000

    Improve exception handling to avoid SpotBugs warning
---
 java/org/apache/naming/factory/SendMailFactory.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/naming/factory/SendMailFactory.java b/java/org/apache/naming/factory/SendMailFactory.java
index 57b1fcd3f6..e961f47df7 100644
--- a/java/org/apache/naming/factory/SendMailFactory.java
+++ b/java/org/apache/naming/factory/SendMailFactory.java
@@ -26,6 +26,8 @@ import javax.naming.RefAddr;
 import javax.naming.Reference;
 import javax.naming.spi.ObjectFactory;
 
+import org.apache.tomcat.util.ExceptionUtils;
+
 import jakarta.mail.Session;
 import jakarta.mail.internet.InternetAddress;
 import jakarta.mail.internet.MimeMessage;
@@ -109,7 +111,10 @@ public class SendMailFactory implements ObjectFactory
                     message.setFrom(new InternetAddress(from));
                 }
                 message.setSubject("");
-            } catch (Exception e) {/*Ignore*/}
+            } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
+                // Otherwise ignore
+            }
             MimePartDataSource mds = new MimePartDataSource(message);
             return mds;
         } else { // We can't create an instance of the DataSource


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 04/04: Ignore SpotBugs false positive

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 1b34d17b7d77a715c18f777a047c44f0a9c91318
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 27 16:07:33 2023 +0000

    Ignore SpotBugs false positive
---
 res/spotbugs/filter-false-positives.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/res/spotbugs/filter-false-positives.xml b/res/spotbugs/filter-false-positives.xml
index dd4042b653..e7334c58c7 100644
--- a/res/spotbugs/filter-false-positives.xml
+++ b/res/spotbugs/filter-false-positives.xml
@@ -754,6 +754,12 @@
     <Field name="current"/>
     <Bug pattern="VO_VOLATILE_REFERENCE_TO_ARRAY"/>
   </Match>
+  <Match>
+    <!-- Not an issue. Initialisation is as intended. -->
+    <Class name="org.apache.catalina.tribes.util.JreCompat"/>
+    <Method name="&lt;clinit&gt;"/>
+    <Bug pattern="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION" />
+  </Match>
   <Match>
     <!-- Random is SecureRandom and will be used multiple times. -->
     <Class name="org.apache.catalina.tribes.util.UUIDGenerator"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/04: Add missing final (reported by SpotBugs)

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 36996b72022112eaa61217420f7975b6e9a491fc
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 27 15:44:53 2023 +0000

    Add missing final (reported by SpotBugs)
---
 java/org/apache/tomcat/util/buf/CharsetHolder.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/CharsetHolder.java b/java/org/apache/tomcat/util/buf/CharsetHolder.java
index 953925ce13..a7c8d2fc63 100755
--- a/java/org/apache/tomcat/util/buf/CharsetHolder.java
+++ b/java/org/apache/tomcat/util/buf/CharsetHolder.java
@@ -33,7 +33,7 @@ import java.nio.charset.Charset;
  */
 public class CharsetHolder {
 
-    public static CharsetHolder EMPTY = new CharsetHolder(null, null);
+    public static final CharsetHolder EMPTY = new CharsetHolder(null, null);
 
     public static CharsetHolder getInstance(String name) {
         if (name == null) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/04: Remove unused code

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit c2f49d28a99bfb5000086d8f7db7fd333c0e05bf
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 27 15:50:04 2023 +0000

    Remove unused code
---
 java/org/apache/coyote/http2/Http2Parser.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java b/java/org/apache/coyote/http2/Http2Parser.java
index 267869e064..8a2ac5f5d3 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -247,9 +247,8 @@ class Http2Parser {
             } else {
                 buffer.get(optional);
             }
-            int optionalPos = 0;
             if (padding) {
-                padLength = ByteUtil.getOneByte(optional, optionalPos++);
+                padLength = ByteUtil.getOneByte(optional, 0);
                 if (padLength >= payloadSize) {
                     throw new ConnectionException(sm.getString("http2Parser.processFrame.tooMuchPadding", connectionId,
                             Integer.toString(streamId), Integer.toString(padLength), Integer.toString(payloadSize)),


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org