Re: JDK 17 is now in Rampdown Phase Two

2021-07-16 Thread Martin Grigorov
Hi Rory,

Apache Tomcat's build and tests pass successfully with JDK 17-ea+31-2664
and 18-ea+6-237, on both Linux x86_64 and aarch64!

Regards,
Martin

On Thu, Jul 15, 2021 at 11:12 PM Rory O'Donnell 
wrote:

>
> Hi Mark,
>
> *Per the JDK 17 schedule , we are in Rampdown Phase Two [1].*
>
> *Please advise if you find any issues while testing the latest Early
> Access builds.*
>
>   * Schedule:
>
>   o *2021/07/15 Rampdown Phase Two*
>   o 2021/08/05  Initial Release Candidate
>   o 2021/08/19 Final Release Candidate
>   o 2021/09/14  General Availability
>
>
> The overall feature set is frozen. No further JEPs will be targeted to
> this release.
>
>   * Features integrated in JDK 17:
>
>   o JEP 306: Restore Always-Strict Floating-Point Semantics
> 
>   o JEP 356: Enhanced Pseudo-Random Number Generators
> 
>   o JEP 382: New macOS Rendering Pipeline
> 
>   o JEP 391: macOS/AArch64 Port 
>   o JEP 398: Deprecate the Applet API for Removal
> 
>   o JEP 403: Strongly Encapsulate JDK Internals
> 
>   o JEP 406: Pattern Matching for switch (Preview)
> 
>   o JEP 407: Remove RMI Activation 
>   o JEP 409: Sealed Classes 
>   o JEP 410: Remove the Experimental AOT and JIT Compiler
> 
>   o JEP 411: Deprecate the Security Manager for Removal
> 
>   o JEP 412: Foreign Function & Memory API (Incubator)
> 
>   o JEP 414: Vector API (Second Incubator)
> 
>   o JEP 415: Context-Specific Deserialization Filters
> 
>
> *
> *
>
> *OpenJDK 17 Early Access build 31 is available at
> **https://jdk.java.net/17* 
>
>   * These early-access , open-source builds are provided under the
>   o GNU General Public License, version 2, with the Classpath
> Exception 
>   * Release Notes are available at https://jdk.java.net/17/release-notes
> 
>
>
> *
> *
>
> *OpenJDK 18 Early Access build 6 is available at *
> *https://jdk.java.net/18* 
>
>   * These early-access , open-source builds are provided under the
>   o GNU General Public License, version 2, with the Classpath
> Exception 
>   * Release Notes are available at https://jdk.java.net/18/release-notes
> 
>   * Changes in recent builds that maybe of interest:
>   o JDK-8269697: JNI_GetPrimitiveArrayCritical() should not accept
> object array [build 6]
>   o JDK-8253119: Remove the legacy PlainSocketImpl and
> PlainDatagramSocketImpl implementation [build 6]
>   o JDK-8268960: Prohibit Null for Header Keys and Values in
> com.sun.net.httpserver.Headers [build 5]
>   o JDK-8256425: Obsolete Biased Locking in JDK 18 [build 4]
>
> *Topics of Interest: *
>
>   * ‘Inside Java’ Podcast #18: Java's steady march towards strong
> encapsulation 
>
>
> Rgds,Rory
>
> [1]
> https://mail.openjdk.java.net/pipermail/jdk-dev/2021-July/005752.html
> 
>
>


Re: [External] : Re: JDK 17 is now in Rampdown Phase Two

2021-07-16 Thread Rory O'Donnell

Many thanks Martin!

On 16/07/2021 09:57, Martin Grigorov wrote:

Hi Rory,

Apache Tomcat's build and tests pass successfully with JDK 
17-ea+31-2664 and 18-ea+6-237, on both Linux x86_64 and aarch64!


Regards,
Martin

On Thu, Jul 15, 2021 at 11:12 PM Rory O'Donnell 
mailto:rory.odonn...@oracle.com>> wrote:



Hi Mark,

*Per the JDK 17 schedule , we are in Rampdown Phase Two [1].*

*Please advise if you find any issues while testing the latest Early
Access builds.*

  * Schedule:

      o *2021/07/15 Rampdown Phase Two*
      o 2021/08/05  Initial Release Candidate
      o 2021/08/19 Final Release Candidate
      o 2021/09/14  General Availability


The overall feature set is frozen. No further JEPs will be
targeted to
this release.

  * Features integrated in JDK 17:

      o JEP 306: Restore Always-Strict Floating-Point Semantics
        >
      o JEP 356: Enhanced Pseudo-Random Number Generators
        >
      o JEP 382: New macOS Rendering Pipeline
        >
      o JEP 391: macOS/AArch64 Port
>
      o JEP 398: Deprecate the Applet API for Removal
        >
      o JEP 403: Strongly Encapsulate JDK Internals
        >
      o JEP 406: Pattern Matching for switch (Preview)
        >
      o JEP 407: Remove RMI Activation
>
      o JEP 409: Sealed Classes >
      o JEP 410: Remove the Experimental AOT and JIT Compiler
        >
      o JEP 411: Deprecate the Security Manager for Removal
        >
      o JEP 412: Foreign Function & Memory API (Incubator)
        >
      o JEP 414: Vector API (Second Incubator)
        >
      o JEP 415: Context-Specific Deserialization Filters
        >

*
*

*OpenJDK 17 Early Access build 31 is available at
**https://jdk.java.net/17*


>

  * These early-access , open-source builds are provided under the
      o GNU General Public License, version 2, with the Classpath
        Exception >
  * Release Notes are available at
https://jdk.java.net/17/release-notes


    >


*
*

*OpenJDK 18 Early Access build 6 is available at *
*https://jdk.java.net/18*


>

  * These early-access , open-source builds are provided under the
      o GNU General Public License, version 2, with the Classpath
        Exception >
  * Release Notes are available at
https://jdk.java.net/18/release-notes


    

[tomcat] branch main updated (6a65741 -> e3c1df4)

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 6a65741  Fix BZ 65448 for blocking IO
 new 0fbb058  Refactor. Internal rename only to support upcoming changes.
 new e3c1df4  Additional fix for BZ 65358

The 2 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:
 java/jakarta/el/Util.java  | 88 +-
 java/org/apache/el/util/ReflectionUtil.java| 84 -
 test/org/apache/el/TestMethodExpressionImpl.java   | 12 +++
 .../el/{TesterBeanEnum.java => TesterBeanI.java}   | 13 ++--
 4 files changed, 118 insertions(+), 79 deletions(-)
 copy test/org/apache/el/{TesterBeanEnum.java => TesterBeanI.java} (75%)

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



[tomcat] 01/02: Refactor. Internal rename only to support upcoming changes.

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 0fbb05847a7c9ffb00427e48552b9d058fe03a07
Author: Mark Thomas 
AuthorDate: Fri Jul 16 14:45:35 2021 +0100

Refactor. Internal rename only to support upcoming changes.
---
 java/jakarta/el/Util.java   | 60 ++---
 java/org/apache/el/util/ReflectionUtil.java | 54 +-
 2 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/java/jakarta/el/Util.java b/java/jakarta/el/Util.java
index 03a687a..080793a 100644
--- a/java/jakarta/el/Util.java
+++ b/java/jakarta/el/Util.java
@@ -352,7 +352,7 @@ class Util {
 }
 }
 if (multiple) {
-if (bestMatch.getExact() == paramCount - 1) {
+if (bestMatch.getExactCount() == paramCount - 1) {
 // Only one parameter is not an exact match - try using the
 // super class
 match = resolveAmbiguousWrapper(candidates.keySet(), 
paramTypes);
@@ -753,34 +753,34 @@ class Util {
  */
 private static class MatchResult implements Comparable {
 
-private final int exact;
-private final int assignable;
-private final int coercible;
-private final int varArgs;
+private final int exactCount;
+private final int assignableCount;
+private final int coercibleCount;
+private final int varArgsCount;
 private final boolean bridge;
 
-public MatchResult(int exact, int assignable, int coercible, int 
varArgs, boolean bridge) {
-this.exact = exact;
-this.assignable = assignable;
-this.coercible = coercible;
-this.varArgs = varArgs;
+public MatchResult(int exactCount, int assignableCount, int 
coercibleCount, int varArgsCount, boolean bridge) {
+this.exactCount = exactCount;
+this.assignableCount = assignableCount;
+this.coercibleCount = coercibleCount;
+this.varArgsCount = varArgsCount;
 this.bridge = bridge;
 }
 
-public int getExact() {
-return exact;
+public int getExactCount() {
+return exactCount;
 }
 
-public int getAssignable() {
-return assignable;
+public int getAssignableCount() {
+return assignableCount;
 }
 
-public int getCoercible() {
-return coercible;
+public int getCoercibleCount() {
+return coercibleCount;
 }
 
-public int getVarArgs() {
-return varArgs;
+public int getVarArgsCount() {
+return varArgsCount;
 }
 
 public boolean isBridge() {
@@ -789,14 +789,14 @@ class Util {
 
 @Override
 public int compareTo(MatchResult o) {
-int cmp = Integer.compare(this.getExact(), o.getExact());
+int cmp = Integer.compare(this.getExactCount(), o.getExactCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getAssignable(), o.getAssignable());
+cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getCoercible(), 
o.getCoercible());
+cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
 if (cmp == 0) {
 // Fewer var args matches are better
-cmp = Integer.compare(o.getVarArgs(), 
this.getVarArgs());
+cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
 if (cmp == 0) {
 // The nature of bridge methods is such that it 
actually
 // doesn't matter which one we pick as long as we 
pick
@@ -814,10 +814,10 @@ class Util {
 public boolean equals(Object o) {
 return o == this || (null != o &&
 this.getClass().equals(o.getClass()) &&
-((MatchResult)o).getExact() == this.getExact() &&
-((MatchResult)o).getAssignable() == this.getAssignable() &&
-((MatchResult)o).getCoercible() == this.getCoercible() &&
-((MatchResult)o).getVarArgs() == this.getVarArgs() &&
+((MatchResult)o).getExactCount() == this.getExactCount() &&
+((MatchResult)o).getAssignableCount() == 
this.getAssignableCount() &&
+((MatchResult)o).getCoercibleCount() == 
this.getCoercibleCount() &&
+((MatchResult)o).getVarArgsCount() == 
this.getVarArgsCount() &&
 ((MatchResult)o).isBridge() == this.isBridge());
 }
 
@@ -825,11 +825,11 @@ class Util {
 public int hashCo

[tomcat] 02/02: Additional fix for BZ 65358

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit e3c1df49c7b99f20d3f2357fec2824e0b75e4de7
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:00:18 2021 +0100

Additional fix for BZ 65358

https://bz.apache.org/bugzilla/show_bug.cgi?id=65358
A method that does not declare varargs should always be preferred to a
method that does
---
 java/jakarta/el/Util.java| 40 
 java/org/apache/el/util/ReflectionUtil.java  | 40 
 test/org/apache/el/TestMethodExpressionImpl.java | 12 +++
 test/org/apache/el/TesterBeanI.java  | 29 +
 4 files changed, 95 insertions(+), 26 deletions(-)

diff --git a/java/jakarta/el/Util.java b/java/jakarta/el/Util.java
index 080793a..80a6ee0 100644
--- a/java/jakarta/el/Util.java
+++ b/java/jakarta/el/Util.java
@@ -333,12 +333,13 @@ class Util {
 return w;
 }
 
-candidates.put(w, new MatchResult(exactMatch, assignableMatch, 
coercibleMatch, varArgsMatch, w.isBridge()));
+candidates.put(w, new MatchResult(
+w.isVarArgs(), exactMatch, assignableMatch, 
coercibleMatch, varArgsMatch, w.isBridge()));
 }
 
 // Look for the method that has the highest number of parameters where
 // the type matches exactly
-MatchResult bestMatch = new MatchResult(0, 0, 0, 0, false);
+MatchResult bestMatch = new MatchResult(true, 0, 0, 0, 0, true);
 Wrapper match = null;
 boolean multiple = false;
 for (Map.Entry, MatchResult> entry : candidates.entrySet()) 
{
@@ -753,13 +754,16 @@ class Util {
  */
 private static class MatchResult implements Comparable {
 
+private final boolean varArgs;
 private final int exactCount;
 private final int assignableCount;
 private final int coercibleCount;
 private final int varArgsCount;
 private final boolean bridge;
 
-public MatchResult(int exactCount, int assignableCount, int 
coercibleCount, int varArgsCount, boolean bridge) {
+public MatchResult(boolean varArgs, int exactCount, int 
assignableCount, int coercibleCount, int varArgsCount,
+boolean bridge) {
+this.varArgs = varArgs;
 this.exactCount = exactCount;
 this.assignableCount = assignableCount;
 this.coercibleCount = coercibleCount;
@@ -767,6 +771,10 @@ class Util {
 this.bridge = bridge;
 }
 
+public boolean isVarArgs() {
+return varArgs;
+}
+
 public int getExactCount() {
 return exactCount;
 }
@@ -789,20 +797,24 @@ class Util {
 
 @Override
 public int compareTo(MatchResult o) {
-int cmp = Integer.compare(this.getExactCount(), o.getExactCount());
+// Non-varArgs always beats varArgs
+int cmp = Boolean.compare(o.isVarArgs(), this.isVarArgs());
 if (cmp == 0) {
-cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
+cmp = Integer.compare(this.getExactCount(), o.getExactCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
+cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
 if (cmp == 0) {
-// Fewer var args matches are better
-cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
+cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
 if (cmp == 0) {
-// The nature of bridge methods is such that it 
actually
-// doesn't matter which one we pick as long as we 
pick
-// one. That said, pick the 'right' one (the 
non-bridge
-// one) anyway.
-cmp = Boolean.compare(o.isBridge(), 
this.isBridge());
+// Fewer var args matches are better
+cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
+if (cmp == 0) {
+// The nature of bridge methods is such that 
it actually
+// doesn't matter which one we pick as long as 
we pick
+// one. That said, pick the 'right' one (the 
non-bridge
+// one) anyway.
+cmp = Boolean.compare(o.isBridge(), 
this.isBridge());
+}
 }
 }
 }
@@ -818,6 +830

[tomcat] branch 10.0.x updated (a17e9d9 -> 6369446)

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from a17e9d9  Fix BZ 65448 for blocking IO
 new 9e4105a  Refactor. Internal rename only to support upcoming changes.
 new 6369446  Additional fix for BZ 65358

The 2 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:
 java/jakarta/el/Util.java  | 88 +-
 java/org/apache/el/util/ReflectionUtil.java| 84 -
 test/org/apache/el/TestMethodExpressionImpl.java   | 12 +++
 .../el/{TesterBeanEnum.java => TesterBeanI.java}   | 13 ++--
 4 files changed, 118 insertions(+), 79 deletions(-)
 copy test/org/apache/el/{TesterBeanEnum.java => TesterBeanI.java} (75%)

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



[tomcat] 01/02: Refactor. Internal rename only to support upcoming changes.

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 9e4105a85bcc264d2850b0da7e54d9c467d8000f
Author: Mark Thomas 
AuthorDate: Fri Jul 16 14:45:35 2021 +0100

Refactor. Internal rename only to support upcoming changes.
---
 java/jakarta/el/Util.java   | 60 ++---
 java/org/apache/el/util/ReflectionUtil.java | 54 +-
 2 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/java/jakarta/el/Util.java b/java/jakarta/el/Util.java
index 03a687a..080793a 100644
--- a/java/jakarta/el/Util.java
+++ b/java/jakarta/el/Util.java
@@ -352,7 +352,7 @@ class Util {
 }
 }
 if (multiple) {
-if (bestMatch.getExact() == paramCount - 1) {
+if (bestMatch.getExactCount() == paramCount - 1) {
 // Only one parameter is not an exact match - try using the
 // super class
 match = resolveAmbiguousWrapper(candidates.keySet(), 
paramTypes);
@@ -753,34 +753,34 @@ class Util {
  */
 private static class MatchResult implements Comparable {
 
-private final int exact;
-private final int assignable;
-private final int coercible;
-private final int varArgs;
+private final int exactCount;
+private final int assignableCount;
+private final int coercibleCount;
+private final int varArgsCount;
 private final boolean bridge;
 
-public MatchResult(int exact, int assignable, int coercible, int 
varArgs, boolean bridge) {
-this.exact = exact;
-this.assignable = assignable;
-this.coercible = coercible;
-this.varArgs = varArgs;
+public MatchResult(int exactCount, int assignableCount, int 
coercibleCount, int varArgsCount, boolean bridge) {
+this.exactCount = exactCount;
+this.assignableCount = assignableCount;
+this.coercibleCount = coercibleCount;
+this.varArgsCount = varArgsCount;
 this.bridge = bridge;
 }
 
-public int getExact() {
-return exact;
+public int getExactCount() {
+return exactCount;
 }
 
-public int getAssignable() {
-return assignable;
+public int getAssignableCount() {
+return assignableCount;
 }
 
-public int getCoercible() {
-return coercible;
+public int getCoercibleCount() {
+return coercibleCount;
 }
 
-public int getVarArgs() {
-return varArgs;
+public int getVarArgsCount() {
+return varArgsCount;
 }
 
 public boolean isBridge() {
@@ -789,14 +789,14 @@ class Util {
 
 @Override
 public int compareTo(MatchResult o) {
-int cmp = Integer.compare(this.getExact(), o.getExact());
+int cmp = Integer.compare(this.getExactCount(), o.getExactCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getAssignable(), o.getAssignable());
+cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getCoercible(), 
o.getCoercible());
+cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
 if (cmp == 0) {
 // Fewer var args matches are better
-cmp = Integer.compare(o.getVarArgs(), 
this.getVarArgs());
+cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
 if (cmp == 0) {
 // The nature of bridge methods is such that it 
actually
 // doesn't matter which one we pick as long as we 
pick
@@ -814,10 +814,10 @@ class Util {
 public boolean equals(Object o) {
 return o == this || (null != o &&
 this.getClass().equals(o.getClass()) &&
-((MatchResult)o).getExact() == this.getExact() &&
-((MatchResult)o).getAssignable() == this.getAssignable() &&
-((MatchResult)o).getCoercible() == this.getCoercible() &&
-((MatchResult)o).getVarArgs() == this.getVarArgs() &&
+((MatchResult)o).getExactCount() == this.getExactCount() &&
+((MatchResult)o).getAssignableCount() == 
this.getAssignableCount() &&
+((MatchResult)o).getCoercibleCount() == 
this.getCoercibleCount() &&
+((MatchResult)o).getVarArgsCount() == 
this.getVarArgsCount() &&
 ((MatchResult)o).isBridge() == this.isBridge());
 }
 
@@ -825,11 +825,11 @@ class Util {
 public int hash

[tomcat] branch 9.0.x updated (171a2cd -> 8a48f29)

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 171a2cd  Fix BZ 65448 for blocking IO
 new 0853d5f  Refactor. Internal rename only to support upcoming changes.
 new 8a48f29  Additional fix for BZ 65358

The 2 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:
 java/javax/el/Util.java| 88 +-
 java/org/apache/el/util/ReflectionUtil.java| 84 -
 test/org/apache/el/TestMethodExpressionImpl.java   | 12 +++
 .../el/{TesterBeanEnum.java => TesterBeanI.java}   | 13 ++--
 4 files changed, 118 insertions(+), 79 deletions(-)
 copy test/org/apache/el/{TesterBeanEnum.java => TesterBeanI.java} (75%)

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



[tomcat] 02/02: Additional fix for BZ 65358

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 63694463f2a325f94ac810eb74c74bdaf975302e
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:00:18 2021 +0100

Additional fix for BZ 65358

https://bz.apache.org/bugzilla/show_bug.cgi?id=65358
A method that does not declare varargs should always be preferred to a
method that does
---
 java/jakarta/el/Util.java| 40 
 java/org/apache/el/util/ReflectionUtil.java  | 40 
 test/org/apache/el/TestMethodExpressionImpl.java | 12 +++
 test/org/apache/el/TesterBeanI.java  | 29 +
 4 files changed, 95 insertions(+), 26 deletions(-)

diff --git a/java/jakarta/el/Util.java b/java/jakarta/el/Util.java
index 080793a..80a6ee0 100644
--- a/java/jakarta/el/Util.java
+++ b/java/jakarta/el/Util.java
@@ -333,12 +333,13 @@ class Util {
 return w;
 }
 
-candidates.put(w, new MatchResult(exactMatch, assignableMatch, 
coercibleMatch, varArgsMatch, w.isBridge()));
+candidates.put(w, new MatchResult(
+w.isVarArgs(), exactMatch, assignableMatch, 
coercibleMatch, varArgsMatch, w.isBridge()));
 }
 
 // Look for the method that has the highest number of parameters where
 // the type matches exactly
-MatchResult bestMatch = new MatchResult(0, 0, 0, 0, false);
+MatchResult bestMatch = new MatchResult(true, 0, 0, 0, 0, true);
 Wrapper match = null;
 boolean multiple = false;
 for (Map.Entry, MatchResult> entry : candidates.entrySet()) 
{
@@ -753,13 +754,16 @@ class Util {
  */
 private static class MatchResult implements Comparable {
 
+private final boolean varArgs;
 private final int exactCount;
 private final int assignableCount;
 private final int coercibleCount;
 private final int varArgsCount;
 private final boolean bridge;
 
-public MatchResult(int exactCount, int assignableCount, int 
coercibleCount, int varArgsCount, boolean bridge) {
+public MatchResult(boolean varArgs, int exactCount, int 
assignableCount, int coercibleCount, int varArgsCount,
+boolean bridge) {
+this.varArgs = varArgs;
 this.exactCount = exactCount;
 this.assignableCount = assignableCount;
 this.coercibleCount = coercibleCount;
@@ -767,6 +771,10 @@ class Util {
 this.bridge = bridge;
 }
 
+public boolean isVarArgs() {
+return varArgs;
+}
+
 public int getExactCount() {
 return exactCount;
 }
@@ -789,20 +797,24 @@ class Util {
 
 @Override
 public int compareTo(MatchResult o) {
-int cmp = Integer.compare(this.getExactCount(), o.getExactCount());
+// Non-varArgs always beats varArgs
+int cmp = Boolean.compare(o.isVarArgs(), this.isVarArgs());
 if (cmp == 0) {
-cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
+cmp = Integer.compare(this.getExactCount(), o.getExactCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
+cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
 if (cmp == 0) {
-// Fewer var args matches are better
-cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
+cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
 if (cmp == 0) {
-// The nature of bridge methods is such that it 
actually
-// doesn't matter which one we pick as long as we 
pick
-// one. That said, pick the 'right' one (the 
non-bridge
-// one) anyway.
-cmp = Boolean.compare(o.isBridge(), 
this.isBridge());
+// Fewer var args matches are better
+cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
+if (cmp == 0) {
+// The nature of bridge methods is such that 
it actually
+// doesn't matter which one we pick as long as 
we pick
+// one. That said, pick the 'right' one (the 
non-bridge
+// one) anyway.
+cmp = Boolean.compare(o.isBridge(), 
this.isBridge());
+}
 }
 }
 }
@@ -818,6 +8

[tomcat] 02/02: Additional fix for BZ 65358

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 8a48f2973a79ed8c2dbc8435707cc680b99cb7ce
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:00:18 2021 +0100

Additional fix for BZ 65358

https://bz.apache.org/bugzilla/show_bug.cgi?id=65358
A method that does not declare varargs should always be preferred to a
method that does
---
 java/javax/el/Util.java  | 40 
 java/org/apache/el/util/ReflectionUtil.java  | 40 
 test/org/apache/el/TestMethodExpressionImpl.java | 12 +++
 test/org/apache/el/TesterBeanI.java  | 29 +
 4 files changed, 95 insertions(+), 26 deletions(-)

diff --git a/java/javax/el/Util.java b/java/javax/el/Util.java
index c3509b4..b659796 100644
--- a/java/javax/el/Util.java
+++ b/java/javax/el/Util.java
@@ -333,12 +333,13 @@ class Util {
 return w;
 }
 
-candidates.put(w, new MatchResult(exactMatch, assignableMatch, 
coercibleMatch, varArgsMatch, w.isBridge()));
+candidates.put(w, new MatchResult(
+w.isVarArgs(), exactMatch, assignableMatch, 
coercibleMatch, varArgsMatch, w.isBridge()));
 }
 
 // Look for the method that has the highest number of parameters where
 // the type matches exactly
-MatchResult bestMatch = new MatchResult(0, 0, 0, 0, false);
+MatchResult bestMatch = new MatchResult(true, 0, 0, 0, 0, true);
 Wrapper match = null;
 boolean multiple = false;
 for (Map.Entry, MatchResult> entry : candidates.entrySet()) 
{
@@ -753,13 +754,16 @@ class Util {
  */
 private static class MatchResult implements Comparable {
 
+private final boolean varArgs;
 private final int exactCount;
 private final int assignableCount;
 private final int coercibleCount;
 private final int varArgsCount;
 private final boolean bridge;
 
-public MatchResult(int exactCount, int assignableCount, int 
coercibleCount, int varArgsCount, boolean bridge) {
+public MatchResult(boolean varArgs, int exactCount, int 
assignableCount, int coercibleCount, int varArgsCount,
+boolean bridge) {
+this.varArgs = varArgs;
 this.exactCount = exactCount;
 this.assignableCount = assignableCount;
 this.coercibleCount = coercibleCount;
@@ -767,6 +771,10 @@ class Util {
 this.bridge = bridge;
 }
 
+public boolean isVarArgs() {
+return varArgs;
+}
+
 public int getExactCount() {
 return exactCount;
 }
@@ -789,20 +797,24 @@ class Util {
 
 @Override
 public int compareTo(MatchResult o) {
-int cmp = Integer.compare(this.getExactCount(), o.getExactCount());
+// Non-varArgs always beats varArgs
+int cmp = Boolean.compare(o.isVarArgs(), this.isVarArgs());
 if (cmp == 0) {
-cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
+cmp = Integer.compare(this.getExactCount(), o.getExactCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
+cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
 if (cmp == 0) {
-// Fewer var args matches are better
-cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
+cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
 if (cmp == 0) {
-// The nature of bridge methods is such that it 
actually
-// doesn't matter which one we pick as long as we 
pick
-// one. That said, pick the 'right' one (the 
non-bridge
-// one) anyway.
-cmp = Boolean.compare(o.isBridge(), 
this.isBridge());
+// Fewer var args matches are better
+cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
+if (cmp == 0) {
+// The nature of bridge methods is such that 
it actually
+// doesn't matter which one we pick as long as 
we pick
+// one. That said, pick the 'right' one (the 
non-bridge
+// one) anyway.
+cmp = Boolean.compare(o.isBridge(), 
this.isBridge());
+}
 }
 }
 }
@@ -818,6 +830,7 @@ c

[tomcat] 01/02: Refactor. Internal rename only to support upcoming changes.

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 0853d5fe7bb4f6a5e9b7c70cfbe6774d973828f6
Author: Mark Thomas 
AuthorDate: Fri Jul 16 14:45:35 2021 +0100

Refactor. Internal rename only to support upcoming changes.
---
 java/javax/el/Util.java | 60 ++---
 java/org/apache/el/util/ReflectionUtil.java | 54 +-
 2 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/java/javax/el/Util.java b/java/javax/el/Util.java
index b9a9cd3..c3509b4 100644
--- a/java/javax/el/Util.java
+++ b/java/javax/el/Util.java
@@ -352,7 +352,7 @@ class Util {
 }
 }
 if (multiple) {
-if (bestMatch.getExact() == paramCount - 1) {
+if (bestMatch.getExactCount() == paramCount - 1) {
 // Only one parameter is not an exact match - try using the
 // super class
 match = resolveAmbiguousWrapper(candidates.keySet(), 
paramTypes);
@@ -753,34 +753,34 @@ class Util {
  */
 private static class MatchResult implements Comparable {
 
-private final int exact;
-private final int assignable;
-private final int coercible;
-private final int varArgs;
+private final int exactCount;
+private final int assignableCount;
+private final int coercibleCount;
+private final int varArgsCount;
 private final boolean bridge;
 
-public MatchResult(int exact, int assignable, int coercible, int 
varArgs, boolean bridge) {
-this.exact = exact;
-this.assignable = assignable;
-this.coercible = coercible;
-this.varArgs = varArgs;
+public MatchResult(int exactCount, int assignableCount, int 
coercibleCount, int varArgsCount, boolean bridge) {
+this.exactCount = exactCount;
+this.assignableCount = assignableCount;
+this.coercibleCount = coercibleCount;
+this.varArgsCount = varArgsCount;
 this.bridge = bridge;
 }
 
-public int getExact() {
-return exact;
+public int getExactCount() {
+return exactCount;
 }
 
-public int getAssignable() {
-return assignable;
+public int getAssignableCount() {
+return assignableCount;
 }
 
-public int getCoercible() {
-return coercible;
+public int getCoercibleCount() {
+return coercibleCount;
 }
 
-public int getVarArgs() {
-return varArgs;
+public int getVarArgsCount() {
+return varArgsCount;
 }
 
 public boolean isBridge() {
@@ -789,14 +789,14 @@ class Util {
 
 @Override
 public int compareTo(MatchResult o) {
-int cmp = Integer.compare(this.getExact(), o.getExact());
+int cmp = Integer.compare(this.getExactCount(), o.getExactCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getAssignable(), o.getAssignable());
+cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getCoercible(), 
o.getCoercible());
+cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
 if (cmp == 0) {
 // Fewer var args matches are better
-cmp = Integer.compare(o.getVarArgs(), 
this.getVarArgs());
+cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
 if (cmp == 0) {
 // The nature of bridge methods is such that it 
actually
 // doesn't matter which one we pick as long as we 
pick
@@ -814,10 +814,10 @@ class Util {
 public boolean equals(Object o) {
 return o == this || (null != o &&
 this.getClass().equals(o.getClass()) &&
-((MatchResult)o).getExact() == this.getExact() &&
-((MatchResult)o).getAssignable() == this.getAssignable() &&
-((MatchResult)o).getCoercible() == this.getCoercible() &&
-((MatchResult)o).getVarArgs() == this.getVarArgs() &&
+((MatchResult)o).getExactCount() == this.getExactCount() &&
+((MatchResult)o).getAssignableCount() == 
this.getAssignableCount() &&
+((MatchResult)o).getCoercibleCount() == 
this.getCoercibleCount() &&
+((MatchResult)o).getVarArgsCount() == 
this.getVarArgsCount() &&
 ((MatchResult)o).isBridge() == this.isBridge());
 }
 
@@ -825,11 +825,11 @@ class Util {
 public int hashCode() {

[tomcat] branch 9.0.x updated: Backport requires a cast

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 870965e  Backport requires a cast
870965e is described below

commit 870965e28e80838fe81451fd919c486858a2ef48
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:10:48 2021 +0100

Backport requires a cast
---
 test/org/apache/el/TestMethodExpressionImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/el/TestMethodExpressionImpl.java 
b/test/org/apache/el/TestMethodExpressionImpl.java
index 0473174..e8c4abf 100644
--- a/test/org/apache/el/TestMethodExpressionImpl.java
+++ b/test/org/apache/el/TestMethodExpressionImpl.java
@@ -758,7 +758,7 @@ public class TestMethodExpressionImpl {
 bean.setName("xyz");
 elp.defineBean("bean2", bean);
 elp.defineBean("bean1", new TesterBeanI());
-String elResult = elp.eval("bean1.echo(bean2)");
+String elResult = (String) elp.eval("bean1.echo(bean2)");
 Assert.assertEquals("No varargs: xyz", elResult);
 }
 }

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



[tomcat] branch 10.0.x updated: Backport requires a cast

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 ec782de  Backport requires a cast
ec782de is described below

commit ec782ded387eb8a5d317bb41cdb68b9c03c872c3
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:10:48 2021 +0100

Backport requires a cast
---
 test/org/apache/el/TestMethodExpressionImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/el/TestMethodExpressionImpl.java 
b/test/org/apache/el/TestMethodExpressionImpl.java
index b553a82..a1b5ade 100644
--- a/test/org/apache/el/TestMethodExpressionImpl.java
+++ b/test/org/apache/el/TestMethodExpressionImpl.java
@@ -758,7 +758,7 @@ public class TestMethodExpressionImpl {
 bean.setName("xyz");
 elp.defineBean("bean2", bean);
 elp.defineBean("bean1", new TesterBeanI());
-String elResult = elp.eval("bean1.echo(bean2)");
+String elResult = (String) elp.eval("bean1.echo(bean2)");
 Assert.assertEquals("No varargs: xyz", elResult);
 }
 }

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



[tomcat] branch 8.5.x updated (b363fba -> 666ef0b)

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from b363fba  Fix typo (#433)
 new 3ae14e0  Refactor. Internal rename only to support upcoming changes.
 new 666ef0b  Additional fix for BZ 65358

The 2 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:
 java/javax/el/Util.java| 88 +-
 java/org/apache/el/util/ReflectionUtil.java| 84 -
 test/org/apache/el/TestMethodExpressionImpl.java   | 13 
 .../el/{TesterBeanEnum.java => TesterBeanI.java}   | 13 ++--
 4 files changed, 119 insertions(+), 79 deletions(-)
 copy test/org/apache/el/{TesterBeanEnum.java => TesterBeanI.java} (75%)

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



[tomcat] 02/02: Additional fix for BZ 65358

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 666ef0b11d9d8c7f4f389e0bea394630f6a4f104
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:00:18 2021 +0100

Additional fix for BZ 65358

https://bz.apache.org/bugzilla/show_bug.cgi?id=65358
A method that does not declare varargs should always be preferred to a
method that does
---
 java/javax/el/Util.java  | 40 
 java/org/apache/el/util/ReflectionUtil.java  | 40 
 test/org/apache/el/TestMethodExpressionImpl.java | 13 
 test/org/apache/el/TesterBeanI.java  | 29 +
 4 files changed, 96 insertions(+), 26 deletions(-)

diff --git a/java/javax/el/Util.java b/java/javax/el/Util.java
index 5d695f8..0b41196 100644
--- a/java/javax/el/Util.java
+++ b/java/javax/el/Util.java
@@ -335,12 +335,13 @@ class Util {
 return w;
 }
 
-candidates.put(w, new MatchResult(exactMatch, assignableMatch, 
coercibleMatch, varArgsMatch, w.isBridge()));
+candidates.put(w, new MatchResult(
+w.isVarArgs(), exactMatch, assignableMatch, 
coercibleMatch, varArgsMatch, w.isBridge()));
 }
 
 // Look for the method that has the highest number of parameters where
 // the type matches exactly
-MatchResult bestMatch = new MatchResult(0, 0, 0, 0, false);
+MatchResult bestMatch = new MatchResult(true, 0, 0, 0, 0, true);
 Wrapper match = null;
 boolean multiple = false;
 for (Map.Entry, MatchResult> entry : candidates.entrySet()) 
{
@@ -755,13 +756,16 @@ class Util {
  */
 private static class MatchResult implements Comparable {
 
+private final boolean varArgs;
 private final int exactCount;
 private final int assignableCount;
 private final int coercibleCount;
 private final int varArgsCount;
 private final boolean bridge;
 
-public MatchResult(int exactCount, int assignableCount, int 
coercibleCount, int varArgsCount, boolean bridge) {
+public MatchResult(boolean varArgs, int exactCount, int 
assignableCount, int coercibleCount, int varArgsCount,
+boolean bridge) {
+this.varArgs = varArgs;
 this.exactCount = exactCount;
 this.assignableCount = assignableCount;
 this.coercibleCount = coercibleCount;
@@ -769,6 +773,10 @@ class Util {
 this.bridge = bridge;
 }
 
+public boolean isVarArgs() {
+return varArgs;
+}
+
 public int getExactCount() {
 return exactCount;
 }
@@ -791,20 +799,24 @@ class Util {
 
 @Override
 public int compareTo(MatchResult o) {
-int cmp = Integer.compare(this.getExactCount(), o.getExactCount());
+// Non-varArgs always beats varArgs
+int cmp = Boolean.compare(o.isVarArgs(), this.isVarArgs());
 if (cmp == 0) {
-cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
+cmp = Integer.compare(this.getExactCount(), o.getExactCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
+cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
 if (cmp == 0) {
-// Fewer var args matches are better
-cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
+cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
 if (cmp == 0) {
-// The nature of bridge methods is such that it 
actually
-// doesn't matter which one we pick as long as we 
pick
-// one. That said, pick the 'right' one (the 
non-bridge
-// one) anyway.
-cmp = Boolean.compare(o.isBridge(), 
this.isBridge());
+// Fewer var args matches are better
+cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
+if (cmp == 0) {
+// The nature of bridge methods is such that 
it actually
+// doesn't matter which one we pick as long as 
we pick
+// one. That said, pick the 'right' one (the 
non-bridge
+// one) anyway.
+cmp = Boolean.compare(o.isBridge(), 
this.isBridge());
+}
 }
 }
 }
@@ -820,6 +832,7 @@ 

[tomcat] 01/02: Refactor. Internal rename only to support upcoming changes.

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 3ae14e039b7e32c22cfc62ae11a013d3cbc83c3b
Author: Mark Thomas 
AuthorDate: Fri Jul 16 14:45:35 2021 +0100

Refactor. Internal rename only to support upcoming changes.
---
 java/javax/el/Util.java | 60 ++---
 java/org/apache/el/util/ReflectionUtil.java | 54 +-
 2 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/java/javax/el/Util.java b/java/javax/el/Util.java
index 383e9b5..5d695f8 100644
--- a/java/javax/el/Util.java
+++ b/java/javax/el/Util.java
@@ -354,7 +354,7 @@ class Util {
 }
 }
 if (multiple) {
-if (bestMatch.getExact() == paramCount - 1) {
+if (bestMatch.getExactCount() == paramCount - 1) {
 // Only one parameter is not an exact match - try using the
 // super class
 match = resolveAmbiguousWrapper(candidates.keySet(), 
paramTypes);
@@ -755,34 +755,34 @@ class Util {
  */
 private static class MatchResult implements Comparable {
 
-private final int exact;
-private final int assignable;
-private final int coercible;
-private final int varArgs;
+private final int exactCount;
+private final int assignableCount;
+private final int coercibleCount;
+private final int varArgsCount;
 private final boolean bridge;
 
-public MatchResult(int exact, int assignable, int coercible, int 
varArgs, boolean bridge) {
-this.exact = exact;
-this.assignable = assignable;
-this.coercible = coercible;
-this.varArgs = varArgs;
+public MatchResult(int exactCount, int assignableCount, int 
coercibleCount, int varArgsCount, boolean bridge) {
+this.exactCount = exactCount;
+this.assignableCount = assignableCount;
+this.coercibleCount = coercibleCount;
+this.varArgsCount = varArgsCount;
 this.bridge = bridge;
 }
 
-public int getExact() {
-return exact;
+public int getExactCount() {
+return exactCount;
 }
 
-public int getAssignable() {
-return assignable;
+public int getAssignableCount() {
+return assignableCount;
 }
 
-public int getCoercible() {
-return coercible;
+public int getCoercibleCount() {
+return coercibleCount;
 }
 
-public int getVarArgs() {
-return varArgs;
+public int getVarArgsCount() {
+return varArgsCount;
 }
 
 public boolean isBridge() {
@@ -791,14 +791,14 @@ class Util {
 
 @Override
 public int compareTo(MatchResult o) {
-int cmp = Integer.compare(this.getExact(), o.getExact());
+int cmp = Integer.compare(this.getExactCount(), o.getExactCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getAssignable(), o.getAssignable());
+cmp = Integer.compare(this.getAssignableCount(), 
o.getAssignableCount());
 if (cmp == 0) {
-cmp = Integer.compare(this.getCoercible(), 
o.getCoercible());
+cmp = Integer.compare(this.getCoercibleCount(), 
o.getCoercibleCount());
 if (cmp == 0) {
 // Fewer var args matches are better
-cmp = Integer.compare(o.getVarArgs(), 
this.getVarArgs());
+cmp = Integer.compare(o.getVarArgsCount(), 
this.getVarArgsCount());
 if (cmp == 0) {
 // The nature of bridge methods is such that it 
actually
 // doesn't matter which one we pick as long as we 
pick
@@ -816,10 +816,10 @@ class Util {
 public boolean equals(Object o) {
 return o == this || (null != o &&
 this.getClass().equals(o.getClass()) &&
-((MatchResult)o).getExact() == this.getExact() &&
-((MatchResult)o).getAssignable() == this.getAssignable() &&
-((MatchResult)o).getCoercible() == this.getCoercible() &&
-((MatchResult)o).getVarArgs() == this.getVarArgs() &&
+((MatchResult)o).getExactCount() == this.getExactCount() &&
+((MatchResult)o).getAssignableCount() == 
this.getAssignableCount() &&
+((MatchResult)o).getCoercibleCount() == 
this.getCoercibleCount() &&
+((MatchResult)o).getVarArgsCount() == 
this.getVarArgsCount() &&
 ((MatchResult)o).isBridge() == this.isBridge());
 }
 
@@ -827,11 +827,11 @@ class Util {
 public int hashCode() {

[tomcat] branch main updated: Update for recent Ant release

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 ca1ce64  Update for recent Ant release
ca1ce64 is described below

commit ca1ce64bcd1fd7709f6facfbc0d3e8d2721708db
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:15:36 2021 +0100

Update for recent Ant release
---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 23f9e41..e0afb7a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -48,8 +48,8 @@ install:
 - wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz
 - if test "$ARCH" = "s390x"; then mv jdk-11* jdk; else mv jdk8* jdk; fi
 - export JAVA_HOME=`pwd`/jdk
-- wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.10-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
-- export ANT_HOME=`pwd`/apache-ant-1.10.10
+- wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.11-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
+- export ANT_HOME=`pwd`/apache-ant-1.10.11
 - export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
 - java -version
 - ant -version

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



[tomcat] branch 9.0.x updated: Update for recent Ant release

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 33046d7  Update for recent Ant release
33046d7 is described below

commit 33046d7038300e42eb74039b7030f997812f64f4
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:15:36 2021 +0100

Update for recent Ant release
---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index cd22baf..0b29aa9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,8 +40,8 @@ install:
 - wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz
 - mv jdk8* jdk
 - export JAVA_HOME=`pwd`/jdk
-- wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.10-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
-- export ANT_HOME=`pwd`/apache-ant-1.10.10
+- wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.11-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
+- export ANT_HOME=`pwd`/apache-ant-1.10.11
 - export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
 - java -version
 - ant -version

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



[tomcat] branch 8.5.x updated: Update for recent Ant release

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 7236f34  Update for recent Ant release
7236f34 is described below

commit 7236f3484453d37b666adaf29c8ea121e9f0f59e
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:15:36 2021 +0100

Update for recent Ant release
---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index cd22baf..0b29aa9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,8 +40,8 @@ install:
 - wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz
 - mv jdk8* jdk
 - export JAVA_HOME=`pwd`/jdk
-- wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.10-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
-- export ANT_HOME=`pwd`/apache-ant-1.10.10
+- wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.11-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
+- export ANT_HOME=`pwd`/apache-ant-1.10.11
 - export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
 - java -version
 - ant -version

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



[tomcat] branch 10.0.x updated: Update for recent Ant release

2021-07-16 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 51f6f6d  Update for recent Ant release
51f6f6d is described below

commit 51f6f6d4f67d80443586061e316b8a91dff908b2
Author: Mark Thomas 
AuthorDate: Fri Jul 16 15:15:36 2021 +0100

Update for recent Ant release
---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 23f9e41..e0afb7a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -48,8 +48,8 @@ install:
 - wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz
 - if test "$ARCH" = "s390x"; then mv jdk-11* jdk; else mv jdk8* jdk; fi
 - export JAVA_HOME=`pwd`/jdk
-- wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.10-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
-- export ANT_HOME=`pwd`/apache-ant-1.10.10
+- wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.11-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
+- export ANT_HOME=`pwd`/apache-ant-1.10.11
 - export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
 - java -version
 - ant -version

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



[GitHub] [tomcat-native] jfclere commented on pull request #10: fix an issue similar to BZ 55707

2021-07-16 Thread GitBox


jfclere commented on pull request #10:
URL: https://github.com/apache/tomcat-native/pull/10#issuecomment-881501106


   Note the openssl doc from SSL_CTX_set_tlsext_servername_callback:
   "The functionality provided by the servername callback is mostly superseded 
by the ClientHello callback, which can be set using 
SSL_CTX_set_client_hello_cb(). However, even where the ClientHello callback is 
used, the servername callback is still necessary in order to acknowledge the 
servername requested by the client."
   so both call back are needed.
   Note also: SecureNioChannel.processSNI that explains how NIO/NIO2 don't need 
the call back.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[GitHub] [tomcat-native] jfclere merged pull request #10: fix an issue similar to BZ 55707

2021-07-16 Thread GitBox


jfclere merged pull request #10:
URL: https://github.com/apache/tomcat-native/pull/10


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[tomcat-native] branch main updated: fix an issue similar to https://bz.apache.org/bugzilla/show_bug.cgi?id=55707 note it affects only the Apr connector it seems.

2021-07-16 Thread jfclere
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new d1885c2  fix an issue similar to 
https://bz.apache.org/bugzilla/show_bug.cgi?id=55707 note it affects only the 
Apr connector it seems.
 new 1e87871  Merge pull request #10 from jfclere/ASFBZ55707
d1885c2 is described below

commit d1885c202d987f3898ba72b7fc084413f0bdb1f9
Author: Jean-Frederic Clere 
AuthorDate: Thu Jul 15 10:07:23 2021 +0200

fix an issue similar to https://bz.apache.org/bugzilla/show_bug.cgi?id=55707
note it affects only the Apr connector it seems.
---
 native/src/sslcontext.c | 108 
 1 file changed, 108 insertions(+)

diff --git a/native/src/sslcontext.c b/native/src/sslcontext.c
index 6c8d18b..483446d 100644
--- a/native/src/sslcontext.c
+++ b/native/src/sslcontext.c
@@ -130,6 +130,104 @@ int ssl_callback_ServerNameIndication(SSL *ssl, int *al, 
tcn_ssl_ctxt_t *c)
 return SSL_TLSEXT_ERR_OK;
 }
 
+#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+/*
+ * This callback function is called when the ClientHello is received.
+ */
+int ssl_callback_ClientHello(SSL *ssl, int *al, void *arg)
+{
+JavaVM *javavm = tcn_get_java_vm();
+JNIEnv *env;
+char *servername = NULL;
+const unsigned char *pos;
+size_t len, remaining;
+tcn_ssl_ctxt_t *c = (tcn_ssl_ctxt_t *) arg;
+ 
+(*javavm)->AttachCurrentThread(javavm, (void **)&env, NULL);
+// Continue only if the static method exists
+if (sni_java_callback == NULL) {
+return SSL_CLIENT_HELLO_SUCCESS;
+}
+
+/* We can't use SSL_get_servername() at this earliest OpenSSL connection
+ * stage, and there is no SSL_client_hello_get0_servername() provided as
+ * of OpenSSL 1.1.1. So the code below, that extracts the SNI from the
+ * ClientHello's TLS extensions, is taken from some test code in OpenSSL,
+ * i.e. client_hello_select_server_ctx() in "test/handshake_helper.c".
+ */
+
+/*
+ * The server_name extension was given too much extensibility when it
+ * was written, so parsing the normal case is a bit complex.
+ */
+if (!SSL_client_hello_get0_ext(ssl, TLSEXT_TYPE_server_name, &pos,
+   &remaining)
+|| remaining <= 2) 
+goto give_up;
+
+/* Extract the length of the supplied list of names. */
+len = (*(pos++) << 8);
+len += *(pos++);
+if (len + 2 != remaining)
+goto give_up;
+remaining = len;
+
+/*
+ * The list in practice only has a single element, so we only consider
+ * the first one.
+ */
+if (remaining <= 3 || *pos++ != TLSEXT_NAMETYPE_host_name)
+goto give_up;
+remaining--;
+
+/* Now we can finally pull out the byte array with the actual hostname. */
+len = (*(pos++) << 8);
+len += *(pos++);
+if (len + 2 != remaining)
+goto give_up;
+
+/* Use the SNI to switch to the relevant vhost, should it differ from
+ * c->base_server.
+ */
+servername = apr_pstrmemdup(c->pool, (const char *)pos, len);
+
+give_up:
+if (servername != NULL) {
+jstring hostname;
+jlong original_ssl_context, new_ssl_context;
+tcn_ssl_ctxt_t *new_c;
+
+hostname = (*env)->NewStringUTF(env, servername);
+original_ssl_context = P2J(c);
+new_ssl_context = (*env)->CallStaticLongMethod(env,
+   ssl_context_class,
+   sni_java_callback,
+   original_ssl_context,
+   hostname);
+(*env)->DeleteLocalRef(env, hostname);
+if (new_ssl_context != 0 && new_ssl_context != original_ssl_context) {
+SSL_CTX *ctx;
+new_c = J2P(new_ssl_context, tcn_ssl_ctxt_t *);
+ctx = SSL_set_SSL_CTX(ssl, new_c->ctx);
+
+/* Copied from httpd (modules/ssl/ssl_engine_kernel.c) */
+SSL_set_options(ssl, SSL_CTX_get_options(ctx));
+SSL_set_min_proto_version(ssl, SSL_CTX_get_min_proto_version(ctx));
+SSL_set_max_proto_version(ssl, SSL_CTX_get_max_proto_version(ctx));
+if ((SSL_get_verify_mode(ssl) == SSL_VERIFY_NONE) ||
+(SSL_num_renegotiations(ssl) == 0)) {
+SSL_set_verify(ssl, SSL_CTX_get_verify_mode(ctx), 
SSL_CTX_get_verify_callback(ctx));
+}
+if (SSL_num_renegotiations(ssl) == 0) {
+SSL_set_session_id_context(ssl,  &(c->context_id[0]), sizeof 
c->context_id);
+}
+}
+ 
+}
+return SSL_CLIENT_HELLO_SUCCESS;
+}
+#endif /* OPENSSL_VERSION_NUMBER < 0x10101000L */
+
 /* Initialize server context */
 TCN

[Bug 65358] Possible EL Bug — Method Matching with Varargs

2021-07-16 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65358

Mark Thomas  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Mark Thomas  ---
Fixed in:
- 10.1.x for 10.1.0-M3 onwards
- 10.0.x for 10.0.9 onwards
- 9.0.x for 9.0.51 onwards
- 8.5.x for 8.5.70 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65454] New: Race condition with idle thread removal results in request being improperly enqueued by default ThreadPoolExecutor

2021-07-16 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65454

Bug ID: 65454
   Summary: Race condition with idle thread removal results in
request being improperly enqueued by default
ThreadPoolExecutor
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Util
  Assignee: dev@tomcat.apache.org
  Reporter: aogb...@redhat.com
  Target Milestone: -

Created attachment 37959
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37959&action=edit
Reproducer byteman rule and test app

I've found a race condition that can play out like below any time a non-core
thread above minSpareThreads is idling out.  This can result in a request to be
improperly enqueued like so:

1. The thread pool has 11 total threads, 10 threads are busy and 1 idle.  After
the idle timeout (default 60 seconds), the idle thread pool member ends its
ThreadPoolExecutor.getTask()/workQueue.poll() wait on the task queue.  It
hasn't yet called
ThreadPoolExecutor.compareAndDecrementWorkerCount()/ThreadPoolExecutor.processWorkerExit()
to decrement the worker count and remove itself from the executor worker map.

2. A new connection comes in and is handed off to the executor, which calls
TaskQueue.offer.  Since the idle thread hasn't removed itself from the map,
parent.getPoolSize() still returns 11.  Thus, it passes this if check and so it
is enqueued:

https://github.com/apache/tomcat/blob/9.0.x/java/org/apache/tomcat/util/threads/TaskQueue.java#L87

3. The idle thread then finishes exiting and removes itself from the executor. 
The executor does not inherently replace that thread under this condition.  So
there are now 10 busy threads in the pool and no idle thread available to
process the new enqueued request so it sits in the queue until one of the other
threads becomes idle.  This could then typically be a small imperceptible delay
by the time another thread is created or returns idle.  But worst case, a very
large unexpected delay is induced on the new request depending upon the run
time of the current 10 busy tasks.


This can be hard to trigger or notice the effects of if triggered in most
typical operations, but I was able to reproduce deterministically with some
help from byteman.  To use byteman and reproduce:

1. Download the byteman 4.0.13 from
https://downloads.jboss.org/byteman/4.0.13/byteman-download-4.0.13-bin.zip
2. Unzip byteman into install directory .
3. Use the Byteman rules file DecrementWorkerSleep.btm from
WorkerQueueRaceCondition.zip
4. Enable the Byteman instrumentation by adding the following to your JVM
options:

-javaagent:/lib/byteman.jar=script:/DecrementWorkerSleep.btm,boot:/lib/byteman.jar
-Dorg.jboss.byteman.transform.all=true

5. Add the helloworld from WorkerQueueRaceCondition.zip to webapps for a simple
slow jsp that can be easily used to trigger long requests
7. Start Tomcat
8. Make 10 slow requests (/helloworld/hi.jsp?sleep=true), resulting in usage of
the 10 core threads
9. Make an 11th normal request (/helloworld/hi.jsp), resulting in the creation
of the 11th non-core thread
10. Wait ~60 seconds after that to result in the idle timeout of that 11th
thread.  With the extra byteman delay induced in that operation, you can watch
for a message like this:

--->ThreadPoolExecutor.compareAndDecrementWorkerCount
http-nio-8080-exec-11 sleeping...

11. Upon seeing that message, issue another normal quick request like in step 9
within the next 30 seconds and note it is not getting a response.  And without
any other activity on the server, the request is never processed until one of
the 10 core threads may become available.  A heap dump at that time and
inspecting the executor/taskQueue confirms only the 10 busy threads in the pool
with slow requests while the expected quick request is sitting in the queue
doing nothing.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat-maven-plugin] almathelyv opened a new pull request #33: PDS-432:Upgrading tomcat version 8.5.69

2021-07-16 Thread GitBox


almathelyv opened a new pull request #33:
URL: https://github.com/apache/tomcat-maven-plugin/pull/33


   - Attempted to bump to tomcat 8.5.68, but that resulted in errors when 
running core / Max Classic (issue with compilation of JSPs including tags - 
described here https://bz.apache.org/bugzilla/show_bug.cgi?id=65390 , and as 
noted in a comment on that thread, "Fixed in: 8.5.x for 8.5.69 onwards )
   - Bumped tomcat version in pom.xml
   - Added property its.ajp.secret to pom.xml, created corresponding option in 
Tomcat8RunnerCli
   - Setting secret in AbstractRunMojo and Tomcat8Runner
   - Modified assertions in Tomcat8RunMultiConfigIT and 
Tomcat8SimpleWarProjectIT


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[GitHub] [tomcat-maven-plugin] almathelyv closed pull request #33: PDS-432:Upgrading tomcat version 8.5.69

2021-07-16 Thread GitBox


almathelyv closed pull request #33:
URL: https://github.com/apache/tomcat-maven-plugin/pull/33


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[Bug 65454] Race condition with idle thread removal results in request being improperly enqueued by default ThreadPoolExecutor

2021-07-16 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65454

--- Comment #1 from Aaron Ogburn  ---
Fortunately for an easy workaround, you can set minSpareThreads equal to
maxThreads to avoid any idle thread removal that may allow for that condition.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org