This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 19027d1 65135: Fix JMX decriptor issue 19027d1 is described below commit 19027d1f29317d707607f29319cace1527ad72ca Author: remm <r...@apache.org> AuthorDate: Fri Feb 12 14:40:06 2021 +0100 65135: Fix JMX decriptor issue The use of "is" is unusual, so change that to "get", which turns out to be less error prone. --- java/org/apache/catalina/Context.java | 12 +++++++++++- java/org/apache/catalina/core/StandardContext.java | 2 +- java/org/apache/catalina/startup/ContextConfig.java | 4 ++-- java/org/apache/catalina/startup/FailedContext.java | 2 +- test/org/apache/tomcat/unittest/TesterContext.java | 2 +- webapps/docs/changelog.xml | 6 ++++++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/java/org/apache/catalina/Context.java b/java/org/apache/catalina/Context.java index a53b977..c2fc2c5 100644 --- a/java/org/apache/catalina/Context.java +++ b/java/org/apache/catalina/Context.java @@ -764,8 +764,18 @@ public interface Context extends Container, ContextBind { /** * @return the value of the parallel annotation scanning flag. If true, * it will dispatch scanning to the utility executor. + * @deprecated This method will be removed in Tomcat 11 onwards */ - public boolean isParallelAnnotationScanning(); + @Deprecated + public default boolean isParallelAnnotationScanning() { + return getParallelAnnotationScanning(); + } + + /** + * @return the value of the parallel annotation scanning flag. If true, + * it will dispatch scanning to the utility executor. + */ + public boolean getParallelAnnotationScanning(); /** * Set the parallel annotation scanning value. diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index 6db44d3..058664c 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -1437,7 +1437,7 @@ public class StandardContext extends ContainerBase @Override - public boolean isParallelAnnotationScanning() { + public boolean getParallelAnnotationScanning() { return this.parallelAnnotationScanning; } diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java index 5926bfc..8172a3b 100644 --- a/java/org/apache/catalina/startup/ContextConfig.java +++ b/java/org/apache/catalina/startup/ContextConfig.java @@ -1379,7 +1379,7 @@ public class ContextConfig implements LifecycleListener { Map<String, JavaClassCacheEntry> javaClassCache; - if (context.isParallelAnnotationScanning()) { + if (context.getParallelAnnotationScanning()) { javaClassCache = new ConcurrentHashMap<>(); } else { javaClassCache = new HashMap<>(); @@ -2144,7 +2144,7 @@ public class ContextConfig implements LifecycleListener { protected void processAnnotations(Set<WebXml> fragments, boolean handlesTypesOnly, Map<String, JavaClassCacheEntry> javaClassCache) { - if (context.isParallelAnnotationScanning()) { + if (context.getParallelAnnotationScanning()) { processAnnotationsInParallel(fragments, handlesTypesOnly, javaClassCache); } else { for (WebXml fragment : fragments) { diff --git a/java/org/apache/catalina/startup/FailedContext.java b/java/org/apache/catalina/startup/FailedContext.java index 21e5a81..2cffb52 100644 --- a/java/org/apache/catalina/startup/FailedContext.java +++ b/java/org/apache/catalina/startup/FailedContext.java @@ -824,7 +824,7 @@ public class FailedContext extends LifecycleMBeanBase implements Context { public boolean getCreateUploadTargets() { return false; } @Override - public boolean isParallelAnnotationScanning() { return false; } + public boolean getParallelAnnotationScanning() { return false; } @Override public void setParallelAnnotationScanning(boolean parallelAnnotationScanning) {} diff --git a/test/org/apache/tomcat/unittest/TesterContext.java b/test/org/apache/tomcat/unittest/TesterContext.java index 4c67da9..361e471 100644 --- a/test/org/apache/tomcat/unittest/TesterContext.java +++ b/test/org/apache/tomcat/unittest/TesterContext.java @@ -1290,7 +1290,7 @@ public class TesterContext implements Context { public boolean getCreateUploadTargets() { return false; } @Override - public boolean isParallelAnnotationScanning() { return false; } + public boolean getParallelAnnotationScanning() { return false; } @Override public void setParallelAnnotationScanning(boolean parallelAnnotationScanning) {} diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 094e57a..9f73402 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -114,6 +114,12 @@ Improve error message for failed ConfigurationSource lookups in the Catalina implementation. (remm) </fix> + <fix> + <bug>65135</bug>: Rename Context method + <code>isParallelAnnotationScanning</code> to + <code>getParallelAnnotationScanning</code> for consistency and ease + of use in JMX descriptors. (remm) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org