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 2019/10/04 16:23:21 UTC

[tomcat] branch master updated (85bb000 -> cf0ec7e)

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

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


    from 85bb000  Catch <jsp:useBean> module export issues at compile time if configured to do so
     new df58c90  Polish. Formatting.
     new 73eb797  Polish
     new cf0ec7e  Also skip interfaces reported via onStartup()

The 3 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:
 .../MbeansDescriptorsIntrospectionSource.java      | 86 +++++++++++-----------
 java/org/apache/tomcat/websocket/server/WsSci.java |  5 +-
 2 files changed, 48 insertions(+), 43 deletions(-)


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


[tomcat] 03/03: Also skip interfaces reported via onStartup()

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

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

commit cf0ec7e92a5cda342f32efa6a1cff46f8dfd4baa
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 4 17:22:54 2019 +0100

    Also skip interfaces reported via onStartup()
---
 java/org/apache/tomcat/websocket/server/WsSci.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/server/WsSci.java b/java/org/apache/tomcat/websocket/server/WsSci.java
index 88d2462..6f98f43 100644
--- a/java/org/apache/tomcat/websocket/server/WsSci.java
+++ b/java/org/apache/tomcat/websocket/server/WsSci.java
@@ -62,8 +62,9 @@ public class WsSci implements ServletContainerInitializer {
             for (Class<?> clazz : clazzes) {
                 int modifiers = clazz.getModifiers();
                 if (!Modifier.isPublic(modifiers) ||
-                        Modifier.isAbstract(modifiers)) {
-                    // Non-public or abstract - skip it.
+                        Modifier.isAbstract(modifiers) ||
+                        Modifier.isInterface(modifiers)) {
+                    // Non-public, abstract or interface - skip it.
                     continue;
                 }
                 // Protect against scanning the WebSocket API JARs


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


[tomcat] 01/03: Polish. Formatting.

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

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

commit df58c90b3fd06b5028ebd8c2525fd65d6ee96c32
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 4 16:17:39 2019 +0100

    Polish. Formatting.
---
 .../MbeansDescriptorsIntrospectionSource.java      | 83 ++++++++++++----------
 1 file changed, 44 insertions(+), 39 deletions(-)

diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
index 630bde3..451ed92 100644
--- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
+++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
@@ -183,7 +183,7 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
     }
 
     /**
-     * Process the methods and extract 'attributes', methods, etc
+     * Process the methods and extract 'attributes', methods, etc.
      *
      * @param realClass The class to process
      * @param methods The methods to process
@@ -192,76 +192,81 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
      * @param setAttMap The settable attributes map
      * @param invokeAttMap The invokable attributes map
      */
-    private void initMethods(Class<?> realClass,
-                             Method methods[],
-                             Hashtable<String,Method> attMap,
-                             Hashtable<String,Method> getAttMap,
-                             Hashtable<String,Method> setAttMap,
-                             Hashtable<String,Method> invokeAttMap)
-    {
+    private void initMethods(Class<?> realClass, Method methods[], Hashtable<String,Method> attMap,
+            Hashtable<String,Method> getAttMap, Hashtable<String,Method> setAttMap,
+            Hashtable<String,Method> invokeAttMap) {
+
         for (int j = 0; j < methods.length; ++j) {
-            String name=methods[j].getName();
+            String name = methods[j].getName();
 
-            if( Modifier.isStatic(methods[j].getModifiers()))
+            if (Modifier.isStatic(methods[j].getModifiers())) {
                 continue;
-            if( ! Modifier.isPublic( methods[j].getModifiers() ) ) {
-                if( log.isDebugEnabled())
+            }
+            if (!Modifier.isPublic(methods[j].getModifiers())) {
+                if (log.isDebugEnabled()) {
                     log.debug("Not public " + methods[j] );
+                }
                 continue;
             }
-            if( methods[j].getDeclaringClass() == Object.class )
+            if (methods[j].getDeclaringClass() == Object.class) {
                 continue;
+            }
             Class<?> params[] = methods[j].getParameterTypes();
 
-            if( name.startsWith( "get" ) && params.length==0) {
+            if (name.startsWith("get") && params.length==0) {
                 Class<?> ret = methods[j].getReturnType();
-                if( ! supportedType( ret ) ) {
-                    if( log.isDebugEnabled() )
+                if (!supportedType(ret)) {
+                    if (log.isDebugEnabled()) {
                         log.debug("Unsupported type " + methods[j]);
+                    }
                     continue;
                 }
-                name=unCapitalize( name.substring(3));
+                name=unCapitalize(name.substring(3));
 
-                getAttMap.put( name, methods[j] );
+                getAttMap.put(name, methods[j]);
                 // just a marker, we don't use the value
-                attMap.put( name, methods[j] );
-            } else if( name.startsWith( "is" ) && params.length==0) {
+                attMap.put(name, methods[j]);
+            } else if(name.startsWith("is") && params.length == 0) {
                 Class<?> ret = methods[j].getReturnType();
-                if( Boolean.TYPE != ret  ) {
-                    if( log.isDebugEnabled() )
+                if (Boolean.TYPE != ret) {
+                    if (log.isDebugEnabled()) {
                         log.debug("Unsupported type " + methods[j] + " " + ret );
+                    }
                     continue;
                 }
-                name=unCapitalize( name.substring(2));
+                name = unCapitalize(name.substring(2));
 
-                getAttMap.put( name, methods[j] );
+                getAttMap.put(name, methods[j]);
                 // just a marker, we don't use the value
-                attMap.put( name, methods[j] );
+                attMap.put(name, methods[j]);
 
-            } else if( name.startsWith( "set" ) && params.length==1) {
-                if( ! supportedType( params[0] ) ) {
-                    if( log.isDebugEnabled() )
+            } else if (name.startsWith("set") && params.length == 1) {
+                if (!supportedType(params[0])) {
+                    if (log.isDebugEnabled()) {
                         log.debug("Unsupported type " + methods[j] + " " + params[0]);
+                    }
                     continue;
                 }
-                name=unCapitalize( name.substring(3));
-                setAttMap.put( name, methods[j] );
-                attMap.put( name, methods[j] );
+                name = unCapitalize(name.substring(3));
+                setAttMap.put(name, methods[j]);
+                attMap.put(name, methods[j]);
             } else {
-                if( params.length == 0 ) {
-                    if( specialMethods.get( methods[j].getName() ) != null )
+                if (params.length == 0) {
+                    if (specialMethods.get(methods[j].getName()) != null) {
                         continue;
-                    invokeAttMap.put( name, methods[j]);
+                    }
+                    invokeAttMap.put(name, methods[j]);
                 } else {
-                    boolean supported=true;
-                    for( int i=0; i<params.length; i++ ) {
-                        if( ! supportedType( params[i])) {
-                            supported=false;
+                    boolean supported = true;
+                    for (int i = 0; i < params.length; i++ ) {
+                        if (!supportedType(params[i])) {
+                            supported = false;
                             break;
                         }
                     }
-                    if( supported )
+                    if (supported) {
                         invokeAttMap.put( name, methods[j]);
+                    }
                 }
             }
         }


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


[tomcat] 02/03: Polish

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

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

commit 73eb797bcdea892dcea6fbeff80f61b955a5a6eb
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 4 16:44:11 2019 +0100

    Polish
---
 .../util/modeler/modules/MbeansDescriptorsIntrospectionSource.java     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
index 451ed92..83b80e1 100644
--- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
+++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
@@ -91,8 +91,7 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
 
     // ------------ Implementation for non-declared introspection classes
 
-    private static final Hashtable<String,String> specialMethods =
-            new Hashtable<>();
+    private static final Hashtable<String,String> specialMethods = new Hashtable<>();
     static {
         specialMethods.put( "preDeregister", "");
         specialMethods.put( "postDeregister", "");


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