You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2021/04/20 13:54:56 UTC

[tomcat] branch master updated: Skip interfaces for HandlesTypes

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3fc0c3d  Skip interfaces for HandlesTypes
3fc0c3d is described below

commit 3fc0c3d395cd3b3c01f9c4fbb8cd47cb3b36c276
Author: remm <re...@apache.org>
AuthorDate: Tue Apr 20 15:54:17 2021 +0200

    Skip interfaces for HandlesTypes
    
    BZ 65256.
    Although a bit unclear in the specification, I don't see a use for
    returning interfaces.
---
 java/org/apache/catalina/startup/ContextConfig.java | 7 ++++---
 webapps/docs/changelog.xml                          | 4 ++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java
index 058d412..b57ceda 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -2383,9 +2383,10 @@ public class ContextConfig implements LifecycleListener {
             return;
         }
 
-        if ((javaClass.getAccessFlags() &
-                org.apache.tomcat.util.bcel.Const.ACC_ANNOTATION) != 0) {
-            // Skip annotations.
+        if ((javaClass.getAccessFlags()
+                & (org.apache.tomcat.util.bcel.Const.ACC_ANNOTATION
+                        | org.apache.tomcat.util.bcel.Const.ACC_INTERFACE)) != 0) {
+            // Skip annotations or interfaces
             return;
         }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index dc81afa..900f782 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -129,6 +129,10 @@
         resulting in one of the deployments failing and errors being reported.
         (markt)
       </fix>
+      <fix>
+        <bug>65256</bug>: HandlesTypes class sets should not include
+        interfaces. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">

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


Re: [tomcat] branch master updated: Skip interfaces for HandlesTypes

Posted by Mark Thomas <ma...@apache.org>.
On 20/04/2021 14:54, remm@apache.org wrote:
> This is an automated email from the ASF dual-hosted git repository.
> 
> remm pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
> 
> 
> The following commit(s) were added to refs/heads/master by this push:
>       new 3fc0c3d  Skip interfaces for HandlesTypes
> 3fc0c3d is described below
> 
> commit 3fc0c3d395cd3b3c01f9c4fbb8cd47cb3b36c276
> Author: remm <re...@apache.org>
> AuthorDate: Tue Apr 20 15:54:17 2021 +0200
> 
>      Skip interfaces for HandlesTypes
>      
>      BZ 65256.
>      Although a bit unclear in the specification, I don't see a use for
>      returning interfaces.

I can't see a use either at the moment but I think the balance is more 
towards including them rather than excluding them.

My reasoning is:

1. Section 8.2.4 of the Servlet spec has the following text:

"... express interest in classes ... if if extends / implements one of 
those classes ..."

The second use of "classes" in the quote above clearly means types 
because of the use of "implements". That suggests the first reference 
means types as well.


2. I can't find anything in the Servlet 3.0 EG discussion that indicates 
interfaces are meant to be excluded.


3. It is trivial for applications to filter out interfaces if they don't 
want them.


My primary concern is that this might break backwards compatibility for 
some users with no easy way to fix it - particularly if the breakage is 
in a library used by the app.

Maybe it would be worth a discussion in the Jakarta Servlet project first?

Mark

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