[tomcat] branch main updated: Refactor MbeansDescriptorsIntrospectionSource. Simplify code.

2022-10-08 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new d2298907f3 Refactor MbeansDescriptorsIntrospectionSource. Simplify 
code.
d2298907f3 is described below

commit d2298907f3b3f08f7aa79108e5dbb6e6319b499c
Author: lihan 
AuthorDate: Sat Oct 8 16:39:52 2022 +0800

Refactor MbeansDescriptorsIntrospectionSource. Simplify code.
---
 .../MbeansDescriptorsIntrospectionSource.java  | 76 ++
 1 file changed, 35 insertions(+), 41 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
index ffb0937066..0bd28eb6a6 100644
--- 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
+++ 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
@@ -22,7 +22,9 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -188,16 +190,16 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
  * Process the methods and extract 'attributes', methods, etc.
  *
  * @param realClass The class to process
- * @param methods The methods to process
- * @param attMap The attribute map (complete)
+ * @param attNames The attribute name (complete)
  * @param getAttMap The readable attributes map
  * @param setAttMap The settable attributes map
  * @param invokeAttMap The invokable attributes map
  */
-private void initMethods(Class realClass, Method methods[], 
Map attMap,
+private void initMethods(Class realClass, Set attNames,
 Map getAttMap, Map setAttMap,
 Map invokeAttMap) {
 
+Method[] methods = realClass.getMethods();
 for (Method method : methods) {
 String name = method.getName();
 
@@ -213,7 +215,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 if (method.getDeclaringClass() == Object.class) {
 continue;
 }
-Class params[] = method.getParameterTypes();
+Class[] params = method.getParameterTypes();
 
 if (name.startsWith("get") && params.length == 0) {
 Class ret = method.getReturnType();
@@ -226,8 +228,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 name = unCapitalize(name.substring(3));
 
 getAttMap.put(name, method);
-// just a marker, we don't use the value
-attMap.put(name, method);
+attNames.add(name);
 } else if (name.startsWith("is") && params.length == 0) {
 Class ret = method.getReturnType();
 if (Boolean.TYPE != ret) {
@@ -239,8 +240,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 name = unCapitalize(name.substring(2));
 
 getAttMap.put(name, method);
-// just a marker, we don't use the value
-attMap.put(name, method);
+attNames.add(name);
 
 } else if (name.startsWith("set") && params.length == 1) {
 if (!supportedType(params[0])) {
@@ -251,7 +251,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 }
 name = unCapitalize(name.substring(3));
 setAttMap.put(name, method);
-attMap.put(name, method);
+attNames.add(name);
 } else {
 if (params.length == 0) {
 if (specialMethods.get(method.getName()) != null) {
@@ -290,25 +290,21 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 public ManagedBean createManagedBean(Registry registry, String domain,
  Class realClass, String type)
 {
-ManagedBean mbean= new ManagedBean();
+ManagedBean mbean = new ManagedBean();
 
-Method methods[]=null;
 
-Map attMap = new HashMap<>();
+Set attrNames = new HashSet<>();
 // key: attribute val: getter method
-Map getAttMap = new HashMap<>();
+Map getAttMap = new HashMap<>();
 // key: attribute val: setter method
-Map setAttMap = new HashMap<>();
+Map setAttMap = new HashMap<>();
 // key: operation val: invoke method
-Map invokeAttMap = new HashMap<>();
+Map invokeAttMap = new HashMap<>();
 
-methods = realClass.getMethods();
-
-initMethods(realClass, me

[tomcat] branch 10.0.x updated: Refactor MbeansDescriptorsIntrospectionSource. Simplify code.

2022-10-08 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 4fc7a891c8 Refactor MbeansDescriptorsIntrospectionSource. Simplify 
code.
4fc7a891c8 is described below

commit 4fc7a891c8f4efe18d60c6726cfc4a97db088a35
Author: lihan 
AuthorDate: Sat Oct 8 16:39:52 2022 +0800

Refactor MbeansDescriptorsIntrospectionSource. Simplify code.
---
 .../MbeansDescriptorsIntrospectionSource.java  | 76 ++
 1 file changed, 35 insertions(+), 41 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
index ffb0937066..0bd28eb6a6 100644
--- 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
+++ 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
@@ -22,7 +22,9 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -188,16 +190,16 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
  * Process the methods and extract 'attributes', methods, etc.
  *
  * @param realClass The class to process
- * @param methods The methods to process
- * @param attMap The attribute map (complete)
+ * @param attNames The attribute name (complete)
  * @param getAttMap The readable attributes map
  * @param setAttMap The settable attributes map
  * @param invokeAttMap The invokable attributes map
  */
-private void initMethods(Class realClass, Method methods[], 
Map attMap,
+private void initMethods(Class realClass, Set attNames,
 Map getAttMap, Map setAttMap,
 Map invokeAttMap) {
 
+Method[] methods = realClass.getMethods();
 for (Method method : methods) {
 String name = method.getName();
 
@@ -213,7 +215,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 if (method.getDeclaringClass() == Object.class) {
 continue;
 }
-Class params[] = method.getParameterTypes();
+Class[] params = method.getParameterTypes();
 
 if (name.startsWith("get") && params.length == 0) {
 Class ret = method.getReturnType();
@@ -226,8 +228,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 name = unCapitalize(name.substring(3));
 
 getAttMap.put(name, method);
-// just a marker, we don't use the value
-attMap.put(name, method);
+attNames.add(name);
 } else if (name.startsWith("is") && params.length == 0) {
 Class ret = method.getReturnType();
 if (Boolean.TYPE != ret) {
@@ -239,8 +240,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 name = unCapitalize(name.substring(2));
 
 getAttMap.put(name, method);
-// just a marker, we don't use the value
-attMap.put(name, method);
+attNames.add(name);
 
 } else if (name.startsWith("set") && params.length == 1) {
 if (!supportedType(params[0])) {
@@ -251,7 +251,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 }
 name = unCapitalize(name.substring(3));
 setAttMap.put(name, method);
-attMap.put(name, method);
+attNames.add(name);
 } else {
 if (params.length == 0) {
 if (specialMethods.get(method.getName()) != null) {
@@ -290,25 +290,21 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 public ManagedBean createManagedBean(Registry registry, String domain,
  Class realClass, String type)
 {
-ManagedBean mbean= new ManagedBean();
+ManagedBean mbean = new ManagedBean();
 
-Method methods[]=null;
 
-Map attMap = new HashMap<>();
+Set attrNames = new HashSet<>();
 // key: attribute val: getter method
-Map getAttMap = new HashMap<>();
+Map getAttMap = new HashMap<>();
 // key: attribute val: setter method
-Map setAttMap = new HashMap<>();
+Map setAttMap = new HashMap<>();
 // key: operation val: invoke method
-Map invokeAttMap = new HashMap<>();
+Map invokeAttMap = new HashMap<>();
 
-methods = realClass.getMethods();
-
-initMethods(realClass

[tomcat] branch 9.0.x updated: Refactor MbeansDescriptorsIntrospectionSource. Simplify code.

2022-10-08 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 a9fa36f198 Refactor MbeansDescriptorsIntrospectionSource. Simplify 
code.
a9fa36f198 is described below

commit a9fa36f1983729267f64240fe2c412dab7c3402a
Author: lihan 
AuthorDate: Sat Oct 8 16:39:52 2022 +0800

Refactor MbeansDescriptorsIntrospectionSource. Simplify code.
---
 .../MbeansDescriptorsIntrospectionSource.java  | 76 ++
 1 file changed, 35 insertions(+), 41 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
index ffb0937066..0bd28eb6a6 100644
--- 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
+++ 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
@@ -22,7 +22,9 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -188,16 +190,16 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
  * Process the methods and extract 'attributes', methods, etc.
  *
  * @param realClass The class to process
- * @param methods The methods to process
- * @param attMap The attribute map (complete)
+ * @param attNames The attribute name (complete)
  * @param getAttMap The readable attributes map
  * @param setAttMap The settable attributes map
  * @param invokeAttMap The invokable attributes map
  */
-private void initMethods(Class realClass, Method methods[], 
Map attMap,
+private void initMethods(Class realClass, Set attNames,
 Map getAttMap, Map setAttMap,
 Map invokeAttMap) {
 
+Method[] methods = realClass.getMethods();
 for (Method method : methods) {
 String name = method.getName();
 
@@ -213,7 +215,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 if (method.getDeclaringClass() == Object.class) {
 continue;
 }
-Class params[] = method.getParameterTypes();
+Class[] params = method.getParameterTypes();
 
 if (name.startsWith("get") && params.length == 0) {
 Class ret = method.getReturnType();
@@ -226,8 +228,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 name = unCapitalize(name.substring(3));
 
 getAttMap.put(name, method);
-// just a marker, we don't use the value
-attMap.put(name, method);
+attNames.add(name);
 } else if (name.startsWith("is") && params.length == 0) {
 Class ret = method.getReturnType();
 if (Boolean.TYPE != ret) {
@@ -239,8 +240,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 name = unCapitalize(name.substring(2));
 
 getAttMap.put(name, method);
-// just a marker, we don't use the value
-attMap.put(name, method);
+attNames.add(name);
 
 } else if (name.startsWith("set") && params.length == 1) {
 if (!supportedType(params[0])) {
@@ -251,7 +251,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 }
 name = unCapitalize(name.substring(3));
 setAttMap.put(name, method);
-attMap.put(name, method);
+attNames.add(name);
 } else {
 if (params.length == 0) {
 if (specialMethods.get(method.getName()) != null) {
@@ -290,25 +290,21 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 public ManagedBean createManagedBean(Registry registry, String domain,
  Class realClass, String type)
 {
-ManagedBean mbean= new ManagedBean();
+ManagedBean mbean = new ManagedBean();
 
-Method methods[]=null;
 
-Map attMap = new HashMap<>();
+Set attrNames = new HashSet<>();
 // key: attribute val: getter method
-Map getAttMap = new HashMap<>();
+Map getAttMap = new HashMap<>();
 // key: attribute val: setter method
-Map setAttMap = new HashMap<>();
+Map setAttMap = new HashMap<>();
 // key: operation val: invoke method
-Map invokeAttMap = new HashMap<>();
+Map invokeAttMap = new HashMap<>();
 
-methods = realClass.getMethods();
-
-initMethods(realClass, 

[tomcat] branch 8.5.x updated: Refactor MbeansDescriptorsIntrospectionSource. Simplify code.

2022-10-08 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 f7862e3b69 Refactor MbeansDescriptorsIntrospectionSource. Simplify 
code.
f7862e3b69 is described below

commit f7862e3b698fde2d0939243a3129eb6477bc5096
Author: lihan 
AuthorDate: Sat Oct 8 16:39:52 2022 +0800

Refactor MbeansDescriptorsIntrospectionSource. Simplify code.
---
 .../MbeansDescriptorsIntrospectionSource.java  | 76 ++
 1 file changed, 35 insertions(+), 41 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
index ffb0937066..0bd28eb6a6 100644
--- 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
+++ 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
@@ -22,7 +22,9 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -188,16 +190,16 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
  * Process the methods and extract 'attributes', methods, etc.
  *
  * @param realClass The class to process
- * @param methods The methods to process
- * @param attMap The attribute map (complete)
+ * @param attNames The attribute name (complete)
  * @param getAttMap The readable attributes map
  * @param setAttMap The settable attributes map
  * @param invokeAttMap The invokable attributes map
  */
-private void initMethods(Class realClass, Method methods[], 
Map attMap,
+private void initMethods(Class realClass, Set attNames,
 Map getAttMap, Map setAttMap,
 Map invokeAttMap) {
 
+Method[] methods = realClass.getMethods();
 for (Method method : methods) {
 String name = method.getName();
 
@@ -213,7 +215,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 if (method.getDeclaringClass() == Object.class) {
 continue;
 }
-Class params[] = method.getParameterTypes();
+Class[] params = method.getParameterTypes();
 
 if (name.startsWith("get") && params.length == 0) {
 Class ret = method.getReturnType();
@@ -226,8 +228,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 name = unCapitalize(name.substring(3));
 
 getAttMap.put(name, method);
-// just a marker, we don't use the value
-attMap.put(name, method);
+attNames.add(name);
 } else if (name.startsWith("is") && params.length == 0) {
 Class ret = method.getReturnType();
 if (Boolean.TYPE != ret) {
@@ -239,8 +240,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 name = unCapitalize(name.substring(2));
 
 getAttMap.put(name, method);
-// just a marker, we don't use the value
-attMap.put(name, method);
+attNames.add(name);
 
 } else if (name.startsWith("set") && params.length == 1) {
 if (!supportedType(params[0])) {
@@ -251,7 +251,7 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 }
 name = unCapitalize(name.substring(3));
 setAttMap.put(name, method);
-attMap.put(name, method);
+attNames.add(name);
 } else {
 if (params.length == 0) {
 if (specialMethods.get(method.getName()) != null) {
@@ -290,25 +290,21 @@ public class MbeansDescriptorsIntrospectionSource extends 
ModelerSource
 public ManagedBean createManagedBean(Registry registry, String domain,
  Class realClass, String type)
 {
-ManagedBean mbean= new ManagedBean();
+ManagedBean mbean = new ManagedBean();
 
-Method methods[]=null;
 
-Map attMap = new HashMap<>();
+Set attrNames = new HashSet<>();
 // key: attribute val: getter method
-Map getAttMap = new HashMap<>();
+Map getAttMap = new HashMap<>();
 // key: attribute val: setter method
-Map setAttMap = new HashMap<>();
+Map setAttMap = new HashMap<>();
 // key: operation val: invoke method
-Map invokeAttMap = new HashMap<>();
+Map invokeAttMap = new HashMap<>();
 
-methods = realClass.getMethods();
-
-initMethods(realClass, 

[tomcat] branch main updated: Add items for Tomcat 11

2022-10-08 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 476affb15f Add items for Tomcat 11
476affb15f is described below

commit 476affb15faaac51eb014a0ceac23521fecaaec6
Author: remm 
AuthorDate: Sat Oct 8 18:33:10 2022 +0200

Add items for Tomcat 11

Given the schedule (at some point in 2024), having out of the box Panama
use in Tomcat 11 seems very likely. Server QUIC APIs should also be in
OpenSSL by that time, but this is obviously an aggressive schedule.
---
 TOMCAT-NEXT.txt | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/TOMCAT-NEXT.txt b/TOMCAT-NEXT.txt
index 4a247a7201..c3cdfb557a 100644
--- a/TOMCAT-NEXT.txt
+++ b/TOMCAT-NEXT.txt
@@ -15,10 +15,13 @@
   limitations under the License.
 

 
-Notes of things to consider for the next major Tomcat release (10.1.x)
-
-Deferred until 10.1.x:
+Notes of things to consider for the next major Tomcat release (11.x)
 
  1. Implement OCSP checks for client certs with NIO/NIO2.
 Useful reference:
-
https://stackoverflow.com/questions/5161504/ocsp-revocation-on-client-certificate
\ No newline at end of file
+
https://stackoverflow.com/questions/5161504/ocsp-revocation-on-client-certificate
+
+ 2. Integrate Panama OpenSSL module once Java 21 is available. Building Tomcat
+releases would then require at least Java 21.
+
+ 3. Add QUIC support using OpenSSL and Panama.
\ No newline at end of file


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