This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new 373ba3e427 Cleanup 373ba3e427 is described below commit 373ba3e4270c76cce6e0d7d93e09218ed962ed16 Author: remm <r...@apache.org> AuthorDate: Mon Sep 18 12:36:33 2023 +0200 Cleanup Remove old comments. This is a part of Tomcat and is supported. Found by coverity. --- java/org/apache/tomcat/util/modeler/Registry.java | 19 ++++--------------- .../modules/MbeansDescriptorsDigesterSource.java | 6 ++++-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/java/org/apache/tomcat/util/modeler/Registry.java b/java/org/apache/tomcat/util/modeler/Registry.java index cd061ef929..bd473723ce 100644 --- a/java/org/apache/tomcat/util/modeler/Registry.java +++ b/java/org/apache/tomcat/util/modeler/Registry.java @@ -41,16 +41,6 @@ import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.modeler.modules.ModelerSource; import org.apache.tomcat.util.res.StringManager; -/* - Issues: - - exceptions - too many "throws Exception" - - double check the interfaces - - start removing the use of the experimental methods in tomcat, then remove - the methods ( before 1.1 final ) - - is the security enough to prevent Registry being used to avoid the - permission checks in the mbean server ? - */ - /** * Registry for modeler MBeans. * @@ -59,9 +49,6 @@ import org.apache.tomcat.util.res.StringManager; * * This class is itself an mbean. * - * IMPORTANT: public methods not marked with {@code @since x.x} are experimental - * or internal. Should not be used. - * * @author Craig R. McClanahan * @author Costin Manolache */ @@ -516,7 +503,7 @@ public class Registry implements RegistryMBean, MBeanRegistration { /** - * EXPERIMENTAL Convert a string to object, based on type. Used by several + * Convert a string to object, based on type. Used by several * components. We could provide some pluggability. It is here to keep things * consistent and avoid duplication in other tasks * @@ -548,7 +535,7 @@ public class Registry implements RegistryMBean, MBeanRegistration { /** - * Experimental. Load descriptors. + * Load descriptors. * * @param sourceType The source type * @param source The bean @@ -589,6 +576,8 @@ public class Registry implements RegistryMBean, MBeanRegistration { if (sourceType == null) { sourceType = "MbeansDescriptorsIntrospectionSource"; } + } else { + throw new IllegalArgumentException("Invalid source specified, must be either URL, File, Class or InputStream"); } if (sourceType == null) { diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java index 5052291723..5aeb701c24 100644 --- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java +++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java @@ -46,9 +46,11 @@ public class MbeansDescriptorsDigesterSource extends ModelerSource digester.setValidating(false); URL url = Registry.getRegistry(null, null).getClass().getResource ("/org/apache/tomcat/util/modeler/mbeans-descriptors.dtd"); - digester.register + if (url != null) { + digester.register ("-//Apache Software Foundation//DTD Model MBeans Configuration File", - url.toString()); + url.toString()); + } // Configure the parsing rules digester.addObjectCreate --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org