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 c4cdc27 65135: Fix JMX decriptor issue c4cdc27 is described below commit c4cdc27a74621666bdc4d14c293b641d566e5cc6 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 275063b..ad40de5 100644 --- a/java/org/apache/catalina/Context.java +++ b/java/org/apache/catalina/Context.java @@ -765,8 +765,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 abb123f..b48a284 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -1480,7 +1480,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 66b58a1..bc68499 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 4fee683..e352ce2 100644 --- a/java/org/apache/catalina/startup/FailedContext.java +++ b/java/org/apache/catalina/startup/FailedContext.java @@ -832,7 +832,7 @@ public class FailedContext extends LifecycleMBeanBase implements Context { public void setDispatcherWrapsSameObject(boolean dispatcherWrapsSameObject) {} @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 0d0e65f..4e0e362 100644 --- a/test/org/apache/tomcat/unittest/TesterContext.java +++ b/test/org/apache/tomcat/unittest/TesterContext.java @@ -1291,7 +1291,7 @@ public class TesterContext implements Context { public void setDispatcherWrapsSameObject(boolean dispatcherWrapsSameObject) {} @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 1cc241e..d120802 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