Re: Backport to Java 11 for JDK-8240871

2020-10-16 Thread Rory O'Donnell

Hi Mark,

Let me check if there are plans.

Probably useful to add backport request to JBS report when confirming 
the fix.


Rgds,Rory

On 15/10/2020 19:33, Mark Thomas wrote:

Hi Rory,

How do I find out what the plans are for back-porting this TLS 1.3 fix
to Java 11?

https://bugs.openjdk.java.net/browse/JDK-8240871

If there are no plans to backport, how do I put in a request for one?

Thanks,

Mark


--
Rgds, Rory O'Donnell
Quality Engineering Manager
Oracle EMEA, Dublin, Ireland


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



[tomcat] 02/03: Align with 9.0.x

2020-10-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 f45531efbc609fef9683924a1c91a9bad66d8d95
Author: Mark Thomas 
AuthorDate: Fri Oct 16 08:59:17 2020 +0100

Align with 9.0.x

Comments, Javadoc, i18n
---
 java/javax/servlet/GenericServlet.java | 6 +++---
 java/javax/servlet/LocalStrings.properties | 3 +++
 java/javax/servlet/LocalStrings_de.properties  | 2 ++
 java/javax/servlet/LocalStrings_fr.properties  | 3 +++
 java/javax/servlet/LocalStrings_ja.properties  | 3 +++
 java/javax/servlet/LocalStrings_ko.properties  | 3 +++
 java/javax/servlet/LocalStrings_zh_CN.properties   | 3 +++
 java/javax/servlet/ServletRegistration.java| 2 +-
 java/javax/servlet/ServletRequestWrapper.java  | 9 +++--
 java/javax/servlet/ServletResponseWrapper.java | 9 +++--
 java/javax/servlet/http/HttpSessionBindingEvent.java   | 2 +-
 java/javax/servlet/http/HttpUtils.java | 5 ++---
 java/javax/servlet/http/WebConnection.java | 4 ++--
 java/javax/servlet/resources/jsp_2_1.xsd   | 2 +-
 java/javax/servlet/resources/web-jsptaglibrary_1_1.dtd | 2 +-
 java/javax/servlet/resources/web-jsptaglibrary_1_2.dtd | 2 +-
 java/javax/servlet/resources/web-jsptaglibrary_2_0.xsd | 2 +-
 java/javax/servlet/resources/web-jsptaglibrary_2_1.xsd | 2 +-
 18 files changed, 45 insertions(+), 19 deletions(-)

diff --git a/java/javax/servlet/GenericServlet.java 
b/java/javax/servlet/GenericServlet.java
index f040cb7..da70a61 100644
--- a/java/javax/servlet/GenericServlet.java
+++ b/java/javax/servlet/GenericServlet.java
@@ -180,12 +180,12 @@ public abstract class GenericServlet implements Servlet, 
ServletConfig,
  * Writes the specified message to a servlet log file, prepended by the
  * servlet's name. See {@link ServletContext#log(String)}.
  *
- * @param msg
+ * @param message
  *a String specifying the message to be written to
  *the log file
  */
-public void log(String msg) {
-getServletContext().log(getServletName() + ": " + msg);
+public void log(String message) {
+getServletContext().log(getServletName() + ": " + message);
 }
 
 /**
diff --git a/java/javax/servlet/LocalStrings.properties 
b/java/javax/servlet/LocalStrings.properties
index b57cb4c..cad5eb7 100644
--- a/java/javax/servlet/LocalStrings.properties
+++ b/java/javax/servlet/LocalStrings.properties
@@ -21,3 +21,6 @@ httpMethodConstraintElement.invalidMethod=Invalid HTTP method
 
 value.false=false
 value.true=true
+
+wrapper.nullRequest=Request cannot be null
+wrapper.nullResponse=Response cannot be null
diff --git a/java/javax/servlet/LocalStrings_de.properties 
b/java/javax/servlet/LocalStrings_de.properties
index e91efd3..c8a5526 100644
--- a/java/javax/servlet/LocalStrings_de.properties
+++ b/java/javax/servlet/LocalStrings_de.properties
@@ -18,3 +18,5 @@ err.not_iso8859_1=Kein ISO 8859-1 Zeichen: [{0}]
 httpMethodConstraintElement.invalidMethod=Ungültige HTTP-Methode
 
 value.true=wahr
+
+wrapper.nullResponse=Der Response darf nicht 'null' sein
diff --git a/java/javax/servlet/LocalStrings_fr.properties 
b/java/javax/servlet/LocalStrings_fr.properties
index 603b694..bd1cdfc 100644
--- a/java/javax/servlet/LocalStrings_fr.properties
+++ b/java/javax/servlet/LocalStrings_fr.properties
@@ -21,3 +21,6 @@ httpMethodConstraintElement.invalidMethod=Méthode HTTP 
invalide
 
 value.false=false
 value.true=true
+
+wrapper.nullRequest=La requête ne peut pas être null
+wrapper.nullResponse=La réponse ne peut pas être null
diff --git a/java/javax/servlet/LocalStrings_ja.properties 
b/java/javax/servlet/LocalStrings_ja.properties
index 7abfb9b..693dcf5 100644
--- a/java/javax/servlet/LocalStrings_ja.properties
+++ b/java/javax/servlet/LocalStrings_ja.properties
@@ -21,3 +21,6 @@ httpMethodConstraintElement.invalidMethod=無効なHTTPメソッド
 
 value.false=false
 value.true=true
+
+wrapper.nullRequest=リクエストには null を指定できません。
+wrapper.nullResponse=レスポンスには null を指定できません。
diff --git a/java/javax/servlet/LocalStrings_ko.properties 
b/java/javax/servlet/LocalStrings_ko.properties
index b09b07b..63865cb 100644
--- a/java/javax/servlet/LocalStrings_ko.properties
+++ b/java/javax/servlet/LocalStrings_ko.properties
@@ -21,3 +21,6 @@ httpMethodConstraintElement.invalidMethod=유효하지 않은 HTTP 메소드
 
 value.false=false
 value.true=true
+
+wrapper.nullRequest=요청이 널이어서는 안됩니다.
+wrapper.nullResponse=응답이 널일 수는 없습니다.
diff --git a/java/javax/servlet/LocalStrings_zh_CN.properties 
b/java/javax/servlet/LocalStrings_zh_CN.properties
index 60310f3..6f983a9 100644
--- a/java/javax/servlet/LocalStrings_zh_CN.properties
+++ b/java/javax/servlet/LocalStrings_zh_CN.properties
@@ -21,3 +21,6 @@ httpMethodConstraintElement.invalidMethod=无效的HTTP.方法
 
 value.false=否
 value.true=true
+
+w

[tomcat] branch 8.5.x updated (b85b00d -> 436a606)

2020-10-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 b85b00d  Weak eTag should be weak
 new a7b91e1  Refactor to remove the need for explicit property permissions 
for Cookie code
 new f45531e  Align with 9.0.x
 new 436a606  Align with 9.0.x

The 3 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:
 conf/catalina.policy   |  8 ---
 java/javax/servlet/GenericServlet.java |  6 +-
 java/javax/servlet/LocalStrings.properties |  3 +
 java/javax/servlet/LocalStrings_de.properties  |  2 +
 java/javax/servlet/LocalStrings_fr.properties  |  3 +
 java/javax/servlet/LocalStrings_ja.properties  |  3 +
 java/javax/servlet/LocalStrings_ko.properties  |  3 +
 java/javax/servlet/LocalStrings_zh_CN.properties   |  3 +
 java/javax/servlet/ServletRegistration.java|  2 +-
 java/javax/servlet/ServletRequestWrapper.java  |  9 ++-
 java/javax/servlet/ServletResponseWrapper.java |  9 ++-
 java/javax/servlet/http/Cookie.java| 72 +-
 .../servlet/http/HttpSessionBindingEvent.java  |  2 +-
 java/javax/servlet/http/HttpUtils.java |  5 +-
 java/javax/servlet/http/WebConnection.java |  4 +-
 java/javax/servlet/resources/jsp_2_1.xsd   |  2 +-
 .../servlet/resources/web-jsptaglibrary_1_1.dtd|  2 +-
 .../servlet/resources/web-jsptaglibrary_1_2.dtd|  2 +-
 .../servlet/resources/web-jsptaglibrary_2_0.xsd|  2 +-
 .../servlet/resources/web-jsptaglibrary_2_1.xsd|  2 +-
 .../org/apache/catalina/core/AccessLogAdapter.java |  1 -
 .../servlet/http/TestCookieRFC2109Validator.java   |  5 +-
 22 files changed, 103 insertions(+), 47 deletions(-)


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



[tomcat] 03/03: Align with 9.0.x

2020-10-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 436a60667c0f53aa03c6c237ff0861c29d07ea06
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:03:26 2020 +0100

Align with 9.0.x
---
 java/org/apache/catalina/core/AccessLogAdapter.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/org/apache/catalina/core/AccessLogAdapter.java 
b/java/org/apache/catalina/core/AccessLogAdapter.java
index 590878b..e370566 100644
--- a/java/org/apache/catalina/core/AccessLogAdapter.java
+++ b/java/org/apache/catalina/core/AccessLogAdapter.java
@@ -60,5 +60,4 @@ public class AccessLogAdapter implements AccessLog {
 // not see a use case for that.
 return false;
 }
-
 }


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



[tomcat] 01/03: Refactor to remove the need for explicit property permissions for Cookie code

2020-10-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 a7b91e1a0f4fa57f50d8103417a6a3f6d5f50ea8
Author: Mark Thomas 
AuthorDate: Sat May 5 20:21:21 2018 +

Refactor to remove the need for explicit property permissions for Cookie 
code

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1831003 
13f79535-47bb-0310-9956-ffa450edef68
---
 conf/catalina.policy   |  8 ---
 java/javax/servlet/http/Cookie.java| 72 +-
 .../servlet/http/TestCookieRFC2109Validator.java   |  5 +-
 3 files changed, 58 insertions(+), 27 deletions(-)

diff --git a/conf/catalina.policy b/conf/catalina.policy
index ffa348d..0567324 100644
--- a/conf/catalina.policy
+++ b/conf/catalina.policy
@@ -172,14 +172,6 @@ grant {
 permission java.lang.RuntimePermission
  "accessClassInPackage.org.apache.jasper.runtime.*";
 
-// The cookie code needs these.
-permission java.util.PropertyPermission
- "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
-permission java.util.PropertyPermission
- "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
-permission java.util.PropertyPermission
- "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR", "read";
-
 // Applications using WebSocket need to be able to access these packages
 permission java.lang.RuntimePermission 
"accessClassInPackage.org.apache.tomcat.websocket";
 permission java.lang.RuntimePermission 
"accessClassInPackage.org.apache.tomcat.websocket.server";
diff --git a/java/javax/servlet/http/Cookie.java 
b/java/javax/servlet/http/Cookie.java
index fc2cb89..1ee31d4 100644
--- a/java/javax/servlet/http/Cookie.java
+++ b/java/javax/servlet/http/Cookie.java
@@ -17,6 +17,8 @@
 package javax.servlet.http;
 
 import java.io.Serializable;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.text.MessageFormat;
 import java.util.BitSet;
 import java.util.Locale;
@@ -54,19 +56,66 @@ import java.util.ResourceBundle;
 public class Cookie implements Cloneable, Serializable {
 
 private static final CookieNameValidator validation;
+
 static {
+boolean strictServletCompliance;
 boolean strictNaming;
-String prop = 
System.getProperty("org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING");
-if (prop != null) {
-strictNaming = Boolean.parseBoolean(prop);
+boolean allowSlash;
+String propStrictNaming;
+String propFwdSlashIsSeparator;
+
+if (System.getSecurityManager() == null) {
+strictServletCompliance = Boolean.getBoolean(
+"org.apache.catalina.STRICT_SERVLET_COMPLIANCE");
+propStrictNaming = System.getProperty(
+"org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING");
+propFwdSlashIsSeparator = System.getProperty(
+
"org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR");
 } else {
-strictNaming = 
Boolean.getBoolean("org.apache.catalina.STRICT_SERVLET_COMPLIANCE");
+strictServletCompliance = AccessController.doPrivileged(
+new PrivilegedAction() {
+@Override
+public Boolean run() {
+return Boolean.valueOf(System.getProperty(
+
"org.apache.catalina.STRICT_SERVLET_COMPLIANCE"));
+}
+}
+).booleanValue();
+propStrictNaming = AccessController.doPrivileged(
+new PrivilegedAction() {
+@Override
+public String run() {
+return System.getProperty(
+
"org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING");
+}
+}
+);
+propFwdSlashIsSeparator = AccessController.doPrivileged(
+new PrivilegedAction() {
+@Override
+public String run() {
+return System.getProperty(
+
"org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR");
+}
+}
+);
 }
 
-if (strictNaming) {
-validation = new RFC2109Validator();
+if (propStrictNaming == null) {
+strictNaming = strictServletCompliance;
+} else {
+strictNaming = Boolean.parseBoolean(propStrictNaming);
+}
+
+if (propFwdSlashIsSeparator == null) {
+allowSlash = !strictServletCompliance;
+} else {
+allowSlash = !Boolean.parseBoolean(pro

[tomcat] branch 8.5.x updated: Fix SpotBugs warnings. No functional change.

2020-10-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 2670bb3  Fix SpotBugs warnings. No functional change.
2670bb3 is described below

commit 2670bb36d60b8f86876e06acb5c65498ac47bdcc
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:28:04 2020 +0100

Fix SpotBugs warnings. No functional change.
---
 test/org/apache/catalina/startup/TestMultipartConfig.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
index 164ed1a..a981d24 100644
--- a/test/org/apache/catalina/startup/TestMultipartConfig.java
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -164,7 +164,6 @@ public class TestMultipartConfig {
 Container parent = new StandardHost();
 parent.setParent(engine);
 super.context.setParent(parent);
-context.getState().equals(LifecycleState.STARTING_PREP);
 }
 public Context getContext() {
 return super.context;
@@ -175,7 +174,7 @@ public class TestMultipartConfig {
 private volatile LifecycleState state;
 
 @Override
-public LifecycleState getState() {
+public synchronized LifecycleState getState() {
 return state;
 }
 


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



[tomcat] branch master updated: Fix SpotBugs warnings. No functional change.

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

markt 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 5b39622  Fix SpotBugs warnings. No functional change.
5b39622 is described below

commit 5b396227db707addc5fd9cc92494a29fefdf47ed
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:28:04 2020 +0100

Fix SpotBugs warnings. No functional change.
---
 test/org/apache/catalina/startup/TestMultipartConfig.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
index 5923bd4..1aee547 100644
--- a/test/org/apache/catalina/startup/TestMultipartConfig.java
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -164,7 +164,6 @@ public class TestMultipartConfig {
 Container parent = new StandardHost();
 parent.setParent(engine);
 super.context.setParent(parent);
-context.getState().equals(LifecycleState.STARTING_PREP);
 }
 public Context getContext() {
 return super.context;
@@ -175,7 +174,7 @@ public class TestMultipartConfig {
 private volatile LifecycleState state;
 
 @Override
-public LifecycleState getState() {
+public synchronized LifecycleState getState() {
 return state;
 }
 


-
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: Fix SpotBugs warnings. No functional change.

2020-10-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 aed7155  Fix SpotBugs warnings. No functional change.
aed7155 is described below

commit aed7155ed9638574c553464f4bfa0337dbc8d78b
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:28:04 2020 +0100

Fix SpotBugs warnings. No functional change.
---
 test/org/apache/catalina/startup/TestMultipartConfig.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
index 164ed1a..a981d24 100644
--- a/test/org/apache/catalina/startup/TestMultipartConfig.java
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -164,7 +164,6 @@ public class TestMultipartConfig {
 Container parent = new StandardHost();
 parent.setParent(engine);
 super.context.setParent(parent);
-context.getState().equals(LifecycleState.STARTING_PREP);
 }
 public Context getContext() {
 return super.context;
@@ -175,7 +174,7 @@ public class TestMultipartConfig {
 private volatile LifecycleState state;
 
 @Override
-public LifecycleState getState() {
+public synchronized LifecycleState getState() {
 return state;
 }
 


-
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: SpotBugs warnings. Log problems stopping acceptor threads

2020-10-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 ef60783  SpotBugs warnings. Log problems stopping acceptor threads
ef60783 is described below

commit ef607838c853db88da12b88d15ab066494146e7e
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:39:24 2020 +0100

SpotBugs warnings. Log problems stopping acceptor threads
---
 java/org/apache/tomcat/util/net/Acceptor.java   | 6 --
 java/org/apache/tomcat/util/net/LocalStrings.properties | 3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Acceptor.java 
b/java/org/apache/tomcat/util/net/Acceptor.java
index 9fa0818..2927b6f 100644
--- a/java/org/apache/tomcat/util/net/Acceptor.java
+++ b/java/org/apache/tomcat/util/net/Acceptor.java
@@ -159,9 +159,11 @@ public class Acceptor implements Runnable {
 public void stop() {
 stopCalled = true;
 try {
-stopLatch.await(10, TimeUnit.SECONDS);
+if (!stopLatch.await(10, TimeUnit.SECONDS)) {
+   log.warn(sm.getString("acceptor.stop.fail", getThreadName()));
+}
 } catch (InterruptedException e) {
-// Ignore
+log.warn(sm.getString("acceptor.stop.interrupted", 
getThreadName()), e);
 }
 }
 
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index 43b740c..10daeb0 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -13,6 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+acceptor.stop.fail= The acceptor thread [{0}] did not stop cleanly
+acceptor.stop.interrupted=Interrupt was received while waiting for the 
acceptor thread [{0}] to stop
+
 channel.nio.interrupted=The current thread was interrupted
 channel.nio.ssl.appInputNotEmpty=Application input buffer still contains data. 
Data would have been lost.
 channel.nio.ssl.appOutputNotEmpty=Application output buffer still contains 
data. Data would have been lost.


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



[tomcat] branch master updated: SpotBugs warnings. Log problems stopping acceptor threads

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

markt 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 329fbb1  SpotBugs warnings. Log problems stopping acceptor threads
329fbb1 is described below

commit 329fbb14fe61b713c3cf56dceef082a29b69cb9e
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:39:24 2020 +0100

SpotBugs warnings. Log problems stopping acceptor threads
---
 java/org/apache/tomcat/util/net/Acceptor.java   | 6 --
 java/org/apache/tomcat/util/net/LocalStrings.properties | 3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Acceptor.java 
b/java/org/apache/tomcat/util/net/Acceptor.java
index 9fa0818..2927b6f 100644
--- a/java/org/apache/tomcat/util/net/Acceptor.java
+++ b/java/org/apache/tomcat/util/net/Acceptor.java
@@ -159,9 +159,11 @@ public class Acceptor implements Runnable {
 public void stop() {
 stopCalled = true;
 try {
-stopLatch.await(10, TimeUnit.SECONDS);
+if (!stopLatch.await(10, TimeUnit.SECONDS)) {
+   log.warn(sm.getString("acceptor.stop.fail", getThreadName()));
+}
 } catch (InterruptedException e) {
-// Ignore
+log.warn(sm.getString("acceptor.stop.interrupted", 
getThreadName()), e);
 }
 }
 
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index e47c7ca..5d6237d 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -13,6 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+acceptor.stop.fail= The acceptor thread [{0}] did not stop cleanly
+acceptor.stop.interrupted=Interrupt was received while waiting for the 
acceptor thread [{0}] to stop
+
 channel.nio.interrupted=The current thread was interrupted
 channel.nio.ssl.appInputNotEmpty=Application input buffer still contains data. 
Data would have been lost.
 channel.nio.ssl.appOutputNotEmpty=Application output buffer still contains 
data. Data would have been lost.


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



[tomcat] branch master updated: SpotBugs - remove unnecessary code

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

markt 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 7554b83  SpotBugs - remove unnecessary code
7554b83 is described below

commit 7554b83d90099eeba40d07984be1e83209375c3a
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:44:03 2020 +0100

SpotBugs - remove unnecessary code
---
 java/org/apache/catalina/servlets/DefaultServlet.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 57a33d0..44032aa 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -1306,7 +1306,7 @@ public class DefaultServlet extends HttpServlet {
 private static boolean validate(Ranges.Entry range, long length) {
 long start = getStart(range, length);
 long end = getEnd(range, length);
-return (range != null) && (start >= 0) && (end >= 0) && (start <= end);
+return (start >= 0) && (end >= 0) && (start <= end);
 }
 
 private static long getStart(Ranges.Entry range, long length) {


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



[tomcat] branch master updated: SpotBugs - simplify logic

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

markt 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 1b27eec  SpotBugs - simplify logic
1b27eec is described below

commit 1b27eec74f80532ab539323450cb4f11a117f46d
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:47:53 2020 +0100

SpotBugs - simplify logic
---
 java/org/apache/catalina/valves/HealthCheckValve.java   | 2 +-
 java/org/apache/tomcat/util/digester/SetPropertiesRule.java | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/HealthCheckValve.java 
b/java/org/apache/catalina/valves/HealthCheckValve.java
index 3dd9bec..0b7522e 100644
--- a/java/org/apache/catalina/valves/HealthCheckValve.java
+++ b/java/org/apache/catalina/valves/HealthCheckValve.java
@@ -96,7 +96,7 @@ public class HealthCheckValve extends ValveBase {
 context ? request.getRequestPathMB() : 
request.getDecodedRequestURIMB();
 if (urlMB.equals(path)) {
 response.setContentType("application/json");
-if (!checkContainersAvailable || (checkContainersAvailable && 
isAvailable(getContainer( {
+if (!checkContainersAvailable || isAvailable(getContainer())) {
 response.getOutputStream().print(UP);
 } else {
 response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
diff --git a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java 
b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
index 4779891..cec8263 100644
--- a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
+++ b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
@@ -95,8 +95,7 @@ public class SetPropertiesRule extends Rule {
 "} Setting property '" + name + "' to '" +
 value + "'");
 }
-if (!digester.isFakeAttribute(top, name)
-&& (excludes == null || (excludes != null && 
!excludes.containsKey(name {
+if (!digester.isFakeAttribute(top, name) && (excludes == null || 
!excludes.containsKey(name))) {
 StringBuilder actualMethod = null;
 if (code != null) {
 actualMethod = new StringBuilder();


-
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: SpotBugs - simplify logic

2020-10-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 d411a77  SpotBugs - simplify logic
d411a77 is described below

commit d411a773a239c8a2042fb37e66fb1fdd7637d858
Author: Mark Thomas 
AuthorDate: Fri Oct 16 09:47:53 2020 +0100

SpotBugs - simplify logic
---
 java/org/apache/catalina/valves/HealthCheckValve.java   | 2 +-
 java/org/apache/tomcat/util/digester/SetPropertiesRule.java | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/HealthCheckValve.java 
b/java/org/apache/catalina/valves/HealthCheckValve.java
index 91b33e9..2a61cf2 100644
--- a/java/org/apache/catalina/valves/HealthCheckValve.java
+++ b/java/org/apache/catalina/valves/HealthCheckValve.java
@@ -96,7 +96,7 @@ public class HealthCheckValve extends ValveBase {
 context ? request.getRequestPathMB() : 
request.getDecodedRequestURIMB();
 if (urlMB.equals(path)) {
 response.setContentType("application/json");
-if (!checkContainersAvailable || (checkContainersAvailable && 
isAvailable(getContainer( {
+if (!checkContainersAvailable || isAvailable(getContainer())) {
 response.getOutputStream().print(UP);
 } else {
 response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
diff --git a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java 
b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
index 4779891..cec8263 100644
--- a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
+++ b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
@@ -95,8 +95,7 @@ public class SetPropertiesRule extends Rule {
 "} Setting property '" + name + "' to '" +
 value + "'");
 }
-if (!digester.isFakeAttribute(top, name)
-&& (excludes == null || (excludes != null && 
!excludes.containsKey(name {
+if (!digester.isFakeAttribute(top, name) && (excludes == null || 
!excludes.containsKey(name))) {
 StringBuilder actualMethod = null;
 if (code != null) {
 actualMethod = new StringBuilder();


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



[tomcat] branch master updated: SpotBugs - remove unnecessary code

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

markt 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 e2d9d6a  SpotBugs - remove unnecessary code
e2d9d6a is described below

commit e2d9d6a850630faa62653738a8d2f622df57956b
Author: Mark Thomas 
AuthorDate: Fri Oct 16 11:32:04 2020 +0100

SpotBugs - remove unnecessary code
---
 .../apache/tomcat/jdbc/test/TestGetConnection.java |  1 -
 .../el/TestImportHandlerStandardPackages.java  |  2 --
 test/jakarta/el/TestResourceBundleELResolver.java  |  1 -
 .../catalina/loader/TestWebappClassLoader.java |  2 --
 test/org/apache/el/lang/TestELSupport.java |  2 --
 .../apache/el/stream/TestCollectionOperations.java |  2 --
 .../jasper/compiler/TestTagPluginManager.java  |  2 --
 test/org/apache/tomcat/util/buf/TestUDecoder.java  | 24 --
 8 files changed, 8 insertions(+), 28 deletions(-)

diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
index 480882e..7a58097 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
@@ -28,7 +28,6 @@ public class TestGetConnection extends DefaultTestCase {
 @Test
 public void testGetConnection() throws Exception {
 Connection con = this.datasource.getConnection();
-Assert.assertTrue("Connection should implement 
javax.sql.PooledConnection",con instanceof PooledConnection);
 Connection actual = ((PooledConnection)con).getConnection();
 Assert.assertNotNull("Connection delegate should not be null.",actual);
 System.out.println("Actual connection:"+actual.getClass().getName());
diff --git a/test/jakarta/el/TestImportHandlerStandardPackages.java 
b/test/jakarta/el/TestImportHandlerStandardPackages.java
index f7f1341..a895030 100644
--- a/test/jakarta/el/TestImportHandlerStandardPackages.java
+++ b/test/jakarta/el/TestImportHandlerStandardPackages.java
@@ -42,8 +42,6 @@ public class TestImportHandlerStandardPackages {
 f.setAccessible(true);
 Object obj = f.get(null);
 
-Assert.assertTrue("Not Map", obj instanceof Map);
-
 @SuppressWarnings("unchecked")
 Map> standardPackageName = (Map>) obj;
 
diff --git a/test/jakarta/el/TestResourceBundleELResolver.java 
b/test/jakarta/el/TestResourceBundleELResolver.java
index 5c0adfa..27abd67 100644
--- a/test/jakarta/el/TestResourceBundleELResolver.java
+++ b/test/jakarta/el/TestResourceBundleELResolver.java
@@ -52,7 +52,6 @@ public class TestResourceBundleELResolver {
 
 // Check that the method expression does return the keys
 Object result2 = me.invoke(context, null);
-Assert.assertTrue(result2 instanceof Enumeration);
 @SuppressWarnings("unchecked")
 Enumeration e = (Enumeration) result2;
 
diff --git a/test/org/apache/catalina/loader/TestWebappClassLoader.java 
b/test/org/apache/catalina/loader/TestWebappClassLoader.java
index 426247d..d320984 100644
--- a/test/org/apache/catalina/loader/TestWebappClassLoader.java
+++ b/test/org/apache/catalina/loader/TestWebappClassLoader.java
@@ -48,8 +48,6 @@ public class TestWebappClassLoader extends TomcatBaseTest {
 
 ClassLoader cl = ctx.getLoader().getClassLoader();
 
-Assert.assertTrue(cl instanceof URLClassLoader);
-
 try (URLClassLoader ucl = (URLClassLoader) cl) {
 URL[] urls = ucl.getURLs();
 Assert.assertEquals(expected.length, urls.length);
diff --git a/test/org/apache/el/lang/TestELSupport.java 
b/test/org/apache/el/lang/TestELSupport.java
index e3d8bf9..84d3ed4 100644
--- a/test/org/apache/el/lang/TestELSupport.java
+++ b/test/org/apache/el/lang/TestELSupport.java
@@ -215,7 +215,6 @@ public class TestELSupport {
 PropertyEditorManager.registerEditor(TesterType.class, 
TesterTypeEditorNoError.class);
 Object result = ELManager.getExpressionFactory().coerceToType(
 "Foo", TesterType.class);
-Assert.assertTrue(result instanceof TesterType);
 Assert.assertEquals("Foo", ((TesterType) result).getValue());
 }
 
@@ -224,7 +223,6 @@ public class TestELSupport {
 PropertyEditorManager.registerEditor(TesterType.class, 
TesterTypeEditorError.class);
 Object result = ELManager.getExpressionFactory().coerceToType(
 "Foo", TesterType.class);
-Assert.assertTrue(result instanceof TesterType);
 Assert.assertEquals("Foo", ((TesterType) result).getValue());
 }
 
diff --git a/test/org/apache/el/stream/TestCollectionOperations.java 
b/test/org/apache/el/stream/TestCollectionOperations.java
index bf800ca..1d33a6c 100644
--- a/test/org/apache/el/stre

[tomcat] branch 9.0.x updated: SpotBugs - remove unnecessary code

2020-10-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 8d5846e  SpotBugs - remove unnecessary code
8d5846e is described below

commit 8d5846ecaaf316c1628315de9ba75a2a07881ac3
Author: Mark Thomas 
AuthorDate: Fri Oct 16 11:32:04 2020 +0100

SpotBugs - remove unnecessary code
---
 .../apache/tomcat/jdbc/test/TestGetConnection.java |  1 -
 .../el/TestImportHandlerStandardPackages.java  |  2 --
 test/javax/el/TestResourceBundleELResolver.java|  1 -
 .../catalina/loader/TestWebappClassLoader.java |  2 --
 test/org/apache/el/lang/TestELSupport.java |  2 --
 .../apache/el/stream/TestCollectionOperations.java |  2 --
 .../jasper/compiler/TestTagPluginManager.java  |  2 --
 test/org/apache/tomcat/util/buf/TestUDecoder.java  | 24 --
 8 files changed, 8 insertions(+), 28 deletions(-)

diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
index 480882e..7a58097 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
@@ -28,7 +28,6 @@ public class TestGetConnection extends DefaultTestCase {
 @Test
 public void testGetConnection() throws Exception {
 Connection con = this.datasource.getConnection();
-Assert.assertTrue("Connection should implement 
javax.sql.PooledConnection",con instanceof PooledConnection);
 Connection actual = ((PooledConnection)con).getConnection();
 Assert.assertNotNull("Connection delegate should not be null.",actual);
 System.out.println("Actual connection:"+actual.getClass().getName());
diff --git a/test/javax/el/TestImportHandlerStandardPackages.java 
b/test/javax/el/TestImportHandlerStandardPackages.java
index 79972df..660f665 100644
--- a/test/javax/el/TestImportHandlerStandardPackages.java
+++ b/test/javax/el/TestImportHandlerStandardPackages.java
@@ -42,8 +42,6 @@ public class TestImportHandlerStandardPackages {
 f.setAccessible(true);
 Object obj = f.get(null);
 
-Assert.assertTrue("Not Map", obj instanceof Map);
-
 @SuppressWarnings("unchecked")
 Map> standardPackageName = (Map>) obj;
 
diff --git a/test/javax/el/TestResourceBundleELResolver.java 
b/test/javax/el/TestResourceBundleELResolver.java
index 5acf029..2dec8a4 100644
--- a/test/javax/el/TestResourceBundleELResolver.java
+++ b/test/javax/el/TestResourceBundleELResolver.java
@@ -52,7 +52,6 @@ public class TestResourceBundleELResolver {
 
 // Check that the method expression does return the keys
 Object result2 = me.invoke(context, null);
-Assert.assertTrue(result2 instanceof Enumeration);
 @SuppressWarnings("unchecked")
 Enumeration e = (Enumeration) result2;
 
diff --git a/test/org/apache/catalina/loader/TestWebappClassLoader.java 
b/test/org/apache/catalina/loader/TestWebappClassLoader.java
index 3bba4cc..a81d4c6 100644
--- a/test/org/apache/catalina/loader/TestWebappClassLoader.java
+++ b/test/org/apache/catalina/loader/TestWebappClassLoader.java
@@ -48,8 +48,6 @@ public class TestWebappClassLoader extends TomcatBaseTest {
 
 ClassLoader cl = ctx.getLoader().getClassLoader();
 
-Assert.assertTrue(cl instanceof URLClassLoader);
-
 try (URLClassLoader ucl = (URLClassLoader) cl) {
 URL[] urls = ucl.getURLs();
 Assert.assertEquals(expected.length, urls.length);
diff --git a/test/org/apache/el/lang/TestELSupport.java 
b/test/org/apache/el/lang/TestELSupport.java
index 3276aff..f7f8a26 100644
--- a/test/org/apache/el/lang/TestELSupport.java
+++ b/test/org/apache/el/lang/TestELSupport.java
@@ -215,7 +215,6 @@ public class TestELSupport {
 PropertyEditorManager.registerEditor(TesterType.class, 
TesterTypeEditorNoError.class);
 Object result = ELManager.getExpressionFactory().coerceToType(
 "Foo", TesterType.class);
-Assert.assertTrue(result instanceof TesterType);
 Assert.assertEquals("Foo", ((TesterType) result).getValue());
 }
 
@@ -224,7 +223,6 @@ public class TestELSupport {
 PropertyEditorManager.registerEditor(TesterType.class, 
TesterTypeEditorError.class);
 Object result = ELManager.getExpressionFactory().coerceToType(
 "Foo", TesterType.class);
-Assert.assertTrue(result instanceof TesterType);
 Assert.assertEquals("Foo", ((TesterType) result).getValue());
 }
 
diff --git a/test/org/apache/el/stream/TestCollectionOperations.java 
b/test/org/apache/el/stream/TestCollectionOperations.java
index a0a7de3..d204043 100644
--- a/test/org/apache/el/stream/TestCollectionO

[tomcat] branch 8.5.x updated: SpotBugs - remove unnecessary code

2020-10-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 2cdb77c  SpotBugs - remove unnecessary code
2cdb77c is described below

commit 2cdb77c0c1f28bade48d92dd6cd4cc195a5415ab
Author: Mark Thomas 
AuthorDate: Fri Oct 16 11:32:04 2020 +0100

SpotBugs - remove unnecessary code
---
 .../apache/tomcat/jdbc/test/TestGetConnection.java |  1 -
 .../el/TestImportHandlerStandardPackages.java  |  2 --
 test/javax/el/TestResourceBundleELResolver.java|  1 -
 .../catalina/loader/TestWebappClassLoader.java |  2 --
 test/org/apache/el/lang/TestELSupport.java |  2 --
 .../apache/el/stream/TestCollectionOperations.java |  2 --
 .../jasper/compiler/TestTagPluginManager.java  |  2 --
 test/org/apache/tomcat/util/buf/TestUDecoder.java  | 24 --
 8 files changed, 8 insertions(+), 28 deletions(-)

diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
index 480882e..7a58097 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestGetConnection.java
@@ -28,7 +28,6 @@ public class TestGetConnection extends DefaultTestCase {
 @Test
 public void testGetConnection() throws Exception {
 Connection con = this.datasource.getConnection();
-Assert.assertTrue("Connection should implement 
javax.sql.PooledConnection",con instanceof PooledConnection);
 Connection actual = ((PooledConnection)con).getConnection();
 Assert.assertNotNull("Connection delegate should not be null.",actual);
 System.out.println("Actual connection:"+actual.getClass().getName());
diff --git a/test/javax/el/TestImportHandlerStandardPackages.java 
b/test/javax/el/TestImportHandlerStandardPackages.java
index c3f30fb..30b0886 100644
--- a/test/javax/el/TestImportHandlerStandardPackages.java
+++ b/test/javax/el/TestImportHandlerStandardPackages.java
@@ -40,8 +40,6 @@ public class TestImportHandlerStandardPackages {
 f.setAccessible(true);
 Object obj = f.get(null);
 
-Assert.assertTrue("Not Map", obj instanceof Map);
-
 @SuppressWarnings("unchecked")
 Map> standardPackageName = (Map>) obj;
 
diff --git a/test/javax/el/TestResourceBundleELResolver.java 
b/test/javax/el/TestResourceBundleELResolver.java
index 5acf029..2dec8a4 100644
--- a/test/javax/el/TestResourceBundleELResolver.java
+++ b/test/javax/el/TestResourceBundleELResolver.java
@@ -52,7 +52,6 @@ public class TestResourceBundleELResolver {
 
 // Check that the method expression does return the keys
 Object result2 = me.invoke(context, null);
-Assert.assertTrue(result2 instanceof Enumeration);
 @SuppressWarnings("unchecked")
 Enumeration e = (Enumeration) result2;
 
diff --git a/test/org/apache/catalina/loader/TestWebappClassLoader.java 
b/test/org/apache/catalina/loader/TestWebappClassLoader.java
index 3bba4cc..a81d4c6 100644
--- a/test/org/apache/catalina/loader/TestWebappClassLoader.java
+++ b/test/org/apache/catalina/loader/TestWebappClassLoader.java
@@ -48,8 +48,6 @@ public class TestWebappClassLoader extends TomcatBaseTest {
 
 ClassLoader cl = ctx.getLoader().getClassLoader();
 
-Assert.assertTrue(cl instanceof URLClassLoader);
-
 try (URLClassLoader ucl = (URLClassLoader) cl) {
 URL[] urls = ucl.getURLs();
 Assert.assertEquals(expected.length, urls.length);
diff --git a/test/org/apache/el/lang/TestELSupport.java 
b/test/org/apache/el/lang/TestELSupport.java
index d812590..cb524a7 100644
--- a/test/org/apache/el/lang/TestELSupport.java
+++ b/test/org/apache/el/lang/TestELSupport.java
@@ -215,7 +215,6 @@ public class TestELSupport {
 PropertyEditorManager.registerEditor(TesterType.class, 
TesterTypeEditorNoError.class);
 Object result = ELManager.getExpressionFactory().coerceToType(
 "Foo", TesterType.class);
-Assert.assertTrue(result instanceof TesterType);
 Assert.assertEquals("Foo", ((TesterType) result).getValue());
 }
 
@@ -224,7 +223,6 @@ public class TestELSupport {
 PropertyEditorManager.registerEditor(TesterType.class, 
TesterTypeEditorError.class);
 Object result = ELManager.getExpressionFactory().coerceToType(
 "Foo", TesterType.class);
-Assert.assertTrue(result instanceof TesterType);
 Assert.assertEquals("Foo", ((TesterType) result).getValue());
 }
 
diff --git a/test/org/apache/el/stream/TestCollectionOperations.java 
b/test/org/apache/el/stream/TestCollectionOperations.java
index a0a7de3..d204043 100644
--- a/test/org/apache/el/stream/TestCollectionO

[tomcat] branch master updated: Better Javadoc (prompted by reviewing a SpotBugs issue)

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

markt 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 be191d8  Better Javadoc (prompted by reviewing a SpotBugs issue)
be191d8 is described below

commit be191d8ad87c8075352566f190108bbb5c83a6f2
Author: Mark Thomas 
AuthorDate: Fri Oct 16 11:46:52 2020 +0100

Better Javadoc (prompted by reviewing a SpotBugs issue)
---
 java/org/apache/tomcat/util/http/parser/EntityTag.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/parser/EntityTag.java 
b/java/org/apache/tomcat/util/http/parser/EntityTag.java
index b2cfaba..f863ccc 100644
--- a/java/org/apache/tomcat/util/http/parser/EntityTag.java
+++ b/java/org/apache/tomcat/util/http/parser/EntityTag.java
@@ -30,7 +30,8 @@ public class EntityTag {
  * @param compareWeak  Use weak comparison e.g. match "etag" with W/"etag"
  * @param resourceETag Resource's ETag
  *
- * @return true if ETag matched or {@code null} if the header is invalid
+ * @return {@code true} if ETag matches, {@code false} if ETag doesn't 
match
+ * or {@code null} if the input is invalid
  *
  * @throws IOException If an I/O occurs during the parsing
  */


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



[tomcat] branch 7.0.x updated: Better Javadoc (prompted by reviewing a SpotBugs issue)

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

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 861e418  Better Javadoc (prompted by reviewing a SpotBugs issue)
861e418 is described below

commit 861e41866ddfe376134b58a7753c8465eb4a6785
Author: Mark Thomas 
AuthorDate: Fri Oct 16 11:46:52 2020 +0100

Better Javadoc (prompted by reviewing a SpotBugs issue)
---
 java/org/apache/tomcat/util/http/parser/EntityTag.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/parser/EntityTag.java 
b/java/org/apache/tomcat/util/http/parser/EntityTag.java
index b2cfaba..f863ccc 100644
--- a/java/org/apache/tomcat/util/http/parser/EntityTag.java
+++ b/java/org/apache/tomcat/util/http/parser/EntityTag.java
@@ -30,7 +30,8 @@ public class EntityTag {
  * @param compareWeak  Use weak comparison e.g. match "etag" with W/"etag"
  * @param resourceETag Resource's ETag
  *
- * @return true if ETag matched or {@code null} if the header is invalid
+ * @return {@code true} if ETag matches, {@code false} if ETag doesn't 
match
+ * or {@code null} if the input is invalid
  *
  * @throws IOException If an I/O occurs during the parsing
  */


-
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: Better Javadoc (prompted by reviewing a SpotBugs issue)

2020-10-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 52e5740  Better Javadoc (prompted by reviewing a SpotBugs issue)
52e5740 is described below

commit 52e5740850c0a53bf6e9edf69407c0aed4709932
Author: Mark Thomas 
AuthorDate: Fri Oct 16 11:46:52 2020 +0100

Better Javadoc (prompted by reviewing a SpotBugs issue)
---
 java/org/apache/tomcat/util/http/parser/EntityTag.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/parser/EntityTag.java 
b/java/org/apache/tomcat/util/http/parser/EntityTag.java
index b2cfaba..f863ccc 100644
--- a/java/org/apache/tomcat/util/http/parser/EntityTag.java
+++ b/java/org/apache/tomcat/util/http/parser/EntityTag.java
@@ -30,7 +30,8 @@ public class EntityTag {
  * @param compareWeak  Use weak comparison e.g. match "etag" with W/"etag"
  * @param resourceETag Resource's ETag
  *
- * @return true if ETag matched or {@code null} if the header is invalid
+ * @return {@code true} if ETag matches, {@code false} if ETag doesn't 
match
+ * or {@code null} if the input is invalid
  *
  * @throws IOException If an I/O occurs during the parsing
  */


-
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: Better Javadoc (prompted by reviewing a SpotBugs issue)

2020-10-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 211f48c  Better Javadoc (prompted by reviewing a SpotBugs issue)
211f48c is described below

commit 211f48c9ea75904ea48929f8e84345d757ce66e1
Author: Mark Thomas 
AuthorDate: Fri Oct 16 11:46:52 2020 +0100

Better Javadoc (prompted by reviewing a SpotBugs issue)
---
 java/org/apache/tomcat/util/http/parser/EntityTag.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/parser/EntityTag.java 
b/java/org/apache/tomcat/util/http/parser/EntityTag.java
index b2cfaba..f863ccc 100644
--- a/java/org/apache/tomcat/util/http/parser/EntityTag.java
+++ b/java/org/apache/tomcat/util/http/parser/EntityTag.java
@@ -30,7 +30,8 @@ public class EntityTag {
  * @param compareWeak  Use weak comparison e.g. match "etag" with W/"etag"
  * @param resourceETag Resource's ETag
  *
- * @return true if ETag matched or {@code null} if the header is invalid
+ * @return {@code true} if ETag matches, {@code false} if ETag doesn't 
match
+ * or {@code null} if the input is invalid
  *
  * @throws IOException If an I/O occurs during the parsing
  */


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



Re: [tomcat] branch master updated: Add extended ErrorReportValve that returns response as JSON instead of HTML

2020-10-16 Thread Martin Grigorov
On Wed, Oct 14, 2020 at 5:55 PM  wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> kfujino 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 42a0841  Add extended ErrorReportValve that returns response as
> JSON instead of HTML
> 42a0841 is described below
>
> commit 42a0841d289a35117da842201622454a9f387cd7
> Author: KeiichiFujino 
> AuthorDate: Wed Oct 14 23:54:22 2020 +0900
>
> Add extended ErrorReportValve that returns response as JSON instead of
> HTML
> ---
>  .../catalina/valves/JsonErrorReportValve.java  | 111
> +
>  webapps/docs/changelog.xml |   8 +-
>  2 files changed, 117 insertions(+), 2 deletions(-)
>
> diff --git a/java/org/apache/catalina/valves/JsonErrorReportValve.java
> b/java/org/apache/catalina/valves/JsonErrorReportValve.java
> new file mode 100644
> index 000..a438e77
> --- /dev/null
> +++ b/java/org/apache/catalina/valves/JsonErrorReportValve.java
> @@ -0,0 +1,111 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one or more
> + * contributor license agreements.  See the NOTICE file distributed with
> + * this work for additional information regarding copyright ownership.
> + * The ASF licenses this file to You under the Apache License, Version 2.0
> + * (the "License"); you may not use this file except in compliance with
> + * the License.  You may obtain a copy of the License at
> + *
> + *  http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.catalina.valves;
> +
> +import java.io.IOException;
> +import java.io.Writer;
> +import java.util.concurrent.atomic.AtomicBoolean;
> +
> +import org.apache.catalina.connector.Request;
> +import org.apache.catalina.connector.Response;
> +import org.apache.catalina.tribes.util.ExceptionUtils;
> +import org.apache.coyote.ActionCode;
> +import org.apache.tomcat.util.res.StringManager;
> +
> +/**
> + * Implementation of a Valve that outputs error jsons.
> + *
> + * This Valve should be attached at the Host level, although it will
> work
> + * if attached to a Context.
> + *
> + */
> +public class JsonErrorReportValve extends ErrorReportValve {
> +
> +public JsonErrorReportValve() {
> +super();
> +}
> +
> +@Override
> +protected void report(Request request, Response response, Throwable
> throwable) {
> +
> +int statusCode = response.getStatus();
> +
> +// Do nothing on a 1xx, 2xx and 3xx status
> +// Do nothing if anything has been written already
> +// Do nothing if the response hasn't been explicitly marked as in
> error
> +//and that error has not been reported.
> +if (statusCode < 400 || response.getContentWritten() > 0 ||
> !response.setErrorReported()) {
> +return;
> +}
> +
> +// If an error has occurred that prevents further I/O, don't
> waste time
> +// producing an error report that will never be read
> +AtomicBoolean result = new AtomicBoolean(false);
> +response.getCoyoteResponse().action(ActionCode.IS_IO_ALLOWED,
> result);
> +if (!result.get()) {
> +return;
> +}
> +
> +StringManager smClient =
> StringManager.getManager(Constants.Package, request.getLocales());
> +response.setLocale(smClient.getLocale());
> +String type = null;
> +if (throwable != null) {
> +type = smClient.getString("errorReportValve.exceptionReport");
> +} else {
> +type = smClient.getString("errorReportValve.statusReport");
> +}
> +String message = response.getMessage();
> +if (message == null && throwable != null) {
> +message = throwable.getMessage();
> +}
> +String description = null;
> +description = smClient.getString("http." + statusCode + ".desc");
> +if (description == null) {
> +if (message.isEmpty()) {
> +return;
> +} else {
> +description =
> smClient.getString("errorReportValve.noDescription");
> +}
> +}
> +String jsonReport = "{\n" +
> +"  \"type\": \"" + type + "\",\n" +
> +"  \"message\": \"" + message + "\"\n" +
> +"  \"description\": \"" + description +
> "\"\n" +
> +"}";
> +try {
> +try {
> +response.setContentType("application/json");
> +   

[tomcat] branch master updated: Simplify

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

markt 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 f8bae5e  Simplify
f8bae5e is described below

commit f8bae5ef16983529d1a1705fff3ff8941ff4a362
Author: Mark Thomas 
AuthorDate: Fri Oct 16 14:10:59 2020 +0100

Simplify
---
 java/org/apache/catalina/valves/HealthCheckValve.java | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/valves/HealthCheckValve.java 
b/java/org/apache/catalina/valves/HealthCheckValve.java
index 0b7522e..b932260 100644
--- a/java/org/apache/catalina/valves/HealthCheckValve.java
+++ b/java/org/apache/catalina/valves/HealthCheckValve.java
@@ -82,11 +82,7 @@ public class HealthCheckValve extends ValveBase {
 @Override
 protected synchronized void startInternal() throws LifecycleException {
 super.startInternal();
-if (getContainer() instanceof Context) {
-context = true;
-} else {
-context = false;
-}
+context = (getContainer() instanceof Context);
 }
 
 @Override


-
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: Simplify

2020-10-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 5c84c6a  Simplify
5c84c6a is described below

commit 5c84c6a8bf227ddd41fc247c125bffc19a29670d
Author: Mark Thomas 
AuthorDate: Fri Oct 16 14:10:59 2020 +0100

Simplify
---
 java/org/apache/catalina/valves/HealthCheckValve.java | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/valves/HealthCheckValve.java 
b/java/org/apache/catalina/valves/HealthCheckValve.java
index 2a61cf2..736d958 100644
--- a/java/org/apache/catalina/valves/HealthCheckValve.java
+++ b/java/org/apache/catalina/valves/HealthCheckValve.java
@@ -82,11 +82,7 @@ public class HealthCheckValve extends ValveBase {
 @Override
 protected synchronized void startInternal() throws LifecycleException {
 super.startInternal();
-if (getContainer() instanceof Context) {
-context = true;
-} else {
-context = false;
-}
+context = (getContainer() instanceof Context);
 }
 
 @Override


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



[tomcat] 02/03: SpotBugs - simplify

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

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

commit 8008253814a14eb7985d85d85ef42700460975af
Author: Mark Thomas 
AuthorDate: Fri Oct 16 14:27:46 2020 +0100

SpotBugs - simplify
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 527f38d..eaf7efe 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -571,7 +571,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 cancelledKey(key, socketWrapper);
 }
 } else {
-cancelledKey(key, attachment);
+cancelledKey(key, null);
 }
 }
 }


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



[tomcat] branch master updated (f8bae5e -> 66df2af)

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

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


from f8bae5e  Simplify
 new 9ead1c1  SpotBugs - Fix possible NPE
 new 8008253  SpotBugs - simplify
 new 66df2af  SpotBugs - Additional false positives when running with 4.1.4

The 3 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/org/apache/catalina/ha/backend/TcpSender.java |  2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java   |  2 +-
 res/findbugs/filter-false-positives.xml| 46 +-
 3 files changed, 47 insertions(+), 3 deletions(-)


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



[tomcat] 01/03: SpotBugs - Fix possible NPE

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

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

commit 9ead1c192007318c7d9deb78d01f7eac5e801e3e
Author: Mark Thomas 
AuthorDate: Fri Oct 16 14:21:52 2020 +0100

SpotBugs - Fix possible NPE
---
 java/org/apache/catalina/ha/backend/TcpSender.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/ha/backend/TcpSender.java 
b/java/org/apache/catalina/ha/backend/TcpSender.java
index 5676c88..7e1bda9 100644
--- a/java/org/apache/catalina/ha/backend/TcpSender.java
+++ b/java/org/apache/catalina/ha/backend/TcpSender.java
@@ -151,7 +151,7 @@ public class TcpSender
 // read all the headers.
 String header = connectionReaders[i].readLine();
 int contentLength = 0;
-while (!header.isEmpty()) {
+while (header != null && !header.isEmpty()) {
 int colon = header.indexOf(':');
 String headerName = header.substring(0, colon).trim();
 String headerValue = header.substring(colon + 1).trim();


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



[tomcat] 03/03: SpotBugs - Additional false positives when running with 4.1.4

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

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

commit 66df2af5047c682e259559e2e38c2d271c16b8fb
Author: Mark Thomas 
AuthorDate: Fri Oct 16 14:29:29 2020 +0100

SpotBugs - Additional false positives when running with 4.1.4
---
 res/findbugs/filter-false-positives.xml | 46 -
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/res/findbugs/filter-false-positives.xml 
b/res/findbugs/filter-false-positives.xml
index 2a44dd8..d4e0b03 100644
--- a/res/findbugs/filter-false-positives.xml
+++ b/res/findbugs/filter-false-positives.xml
@@ -17,6 +17,11 @@
 
   
   
+
+
+
+  
+  
 
 
 
@@ -439,12 +444,15 @@
 
   
   
-
 
 
+  
   
   
   
+  
+  
+  
 
 
   
@@ -518,6 +526,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
 
@@ -679,6 +693,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
@@ -686,6 +706,15 @@
 
   
   
+
+
+
+
+  
+  
+
+  
+  
 
 
@@ -1003,6 +1032,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
 
@@ -1295,6 +1330,12 @@
 
   
   
+
+
+ 
+
+  
+  
 
 
 
@@ -2138,6 +2179,9 @@
   
   
   
+  
+  
+  
 
 
   


-
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 (5c84c6a -> 884ace4)

2020-10-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 5c84c6a  Simplify
 new cb4e295  SpotBugs - Fix possible NPE
 new 884ace4  SpotBugs - simplify

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/org/apache/catalina/ha/backend/TcpSender.java | 2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


-
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: SpotBugs - Fix possible NPE

2020-10-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 98b5c84  SpotBugs - Fix possible NPE
98b5c84 is described below

commit 98b5c84dffba9f50579fea1b9368f99f3c48690b
Author: Mark Thomas 
AuthorDate: Fri Oct 16 14:21:52 2020 +0100

SpotBugs - Fix possible NPE
---
 java/org/apache/catalina/ha/backend/TcpSender.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/ha/backend/TcpSender.java 
b/java/org/apache/catalina/ha/backend/TcpSender.java
index 3ee141b..67873ab 100644
--- a/java/org/apache/catalina/ha/backend/TcpSender.java
+++ b/java/org/apache/catalina/ha/backend/TcpSender.java
@@ -148,7 +148,7 @@ public class TcpSender
 // read all the headers.
 String header = connectionReaders[i].readLine();
 int contentLength = 0;
-while (!header.isEmpty()) {
+while (header != null && !header.isEmpty()) {
 int colon = header.indexOf(':');
 String headerName = header.substring(0, colon).trim();
 String headerValue = header.substring(colon + 1).trim();


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



[tomcat] 01/02: SpotBugs - Fix possible NPE

2020-10-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 cb4e29509700b837e056cca3c96cb2707ce93c77
Author: Mark Thomas 
AuthorDate: Fri Oct 16 14:21:52 2020 +0100

SpotBugs - Fix possible NPE
---
 java/org/apache/catalina/ha/backend/TcpSender.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/ha/backend/TcpSender.java 
b/java/org/apache/catalina/ha/backend/TcpSender.java
index 5676c88..7e1bda9 100644
--- a/java/org/apache/catalina/ha/backend/TcpSender.java
+++ b/java/org/apache/catalina/ha/backend/TcpSender.java
@@ -151,7 +151,7 @@ public class TcpSender
 // read all the headers.
 String header = connectionReaders[i].readLine();
 int contentLength = 0;
-while (!header.isEmpty()) {
+while (header != null && !header.isEmpty()) {
 int colon = header.indexOf(':');
 String headerName = header.substring(0, colon).trim();
 String headerValue = header.substring(colon + 1).trim();


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



[tomcat] 02/02: SpotBugs - simplify

2020-10-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 884ace411f6ae57df1a531a4f8aea7b816789d8b
Author: Mark Thomas 
AuthorDate: Fri Oct 16 14:27:46 2020 +0100

SpotBugs - simplify
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 26486be..3754e0a 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -631,7 +631,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 cancelledKey(key, socketWrapper);
 }
 } else {
-cancelledKey(key, attachment);
+cancelledKey(key, null);
 }
 }
 }


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



Re: Backport to Java 11 for JDK-8240871

2020-10-16 Thread Rory O'Donnell

Hi Mark,

No details yet, but plan to backport to a JDK11 Update in the future.

Rgds,Rory

On 16/10/2020 08:47, Rory O'Donnell wrote:

Hi Mark,

Let me check if there are plans.

Probably useful to add backport request to JBS report when confirming 
the fix.


Rgds,Rory

On 15/10/2020 19:33, Mark Thomas wrote:

Hi Rory,

How do I find out what the plans are for back-porting this TLS 1.3 fix
to Java 11?

https://bugs.openjdk.java.net/browse/JDK-8240871

If there are no plans to backport, how do I put in a request for one?

Thanks,

Mark



--
Rgds, Rory O'Donnell
Quality Engineering Manager
Oracle EMEA, Dublin, Ireland


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



[tomcat] 01/02: SpotBugs - fix various exception class related issues

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

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

commit 5c77665d560be3aa0216eb658089c56815a3a499
Author: Mark Thomas 
AuthorDate: Fri Oct 16 17:06:16 2020 +0100

SpotBugs - fix various exception class related issues

I'd prefer not to use static imports at all but JUnit uses them
extensively and avoiding them in these instances means unnecessarily
verbose code.
---
 res/checkstyle/checkstyle.xml  |  5 +++--
 test/jakarta/el/TestBeanELResolver.java|  7 +--
 .../apache/catalina/authenticator/TestBasicAuthParser.java | 14 +++---
 .../apache/catalina/core/TestSwallowAbortedUploads.java| 11 +++
 test/org/apache/catalina/realm/TestJNDIRealm.java  |  7 +--
 .../startup/TestHostConfigAutomaticDeployment.java |  5 -
 test/org/apache/catalina/startup/TestTomcat.java   |  7 +--
 .../apache/catalina/startup/TestWebappServiceLoader.java   |  7 +--
 test/org/apache/catalina/tribes/io/TestXByteBuffer.java|  5 -
 .../apache/jasper/compiler/TestELInterpreterFactory.java   | 14 --
 10 files changed, 49 insertions(+), 33 deletions(-)

diff --git a/res/checkstyle/checkstyle.xml b/res/checkstyle/checkstyle.xml
index 6fb7231..b52dc27 100644
--- a/res/checkstyle/checkstyle.xml
+++ b/res/checkstyle/checkstyle.xml
@@ -63,8 +63,9 @@
 
 
 
-
+
+
+
 
 
 
diff --git a/test/jakarta/el/TestBeanELResolver.java 
b/test/jakarta/el/TestBeanELResolver.java
index a1bf5a3..312a5a4 100644
--- a/test/jakarta/el/TestBeanELResolver.java
+++ b/test/jakarta/el/TestBeanELResolver.java
@@ -21,6 +21,9 @@ import java.beans.PropertyDescriptor;
 import java.util.ArrayList;
 import java.util.Iterator;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -57,9 +60,9 @@ public class TestBeanELResolver {
 } catch (PropertyNotFoundException pnfe) {
 e = pnfe;
 }
-Assert.assertTrue("Wrong exception type",
-e instanceof PropertyNotFoundException);
+assertThat("Wrong exception type", e, 
instanceOf(PropertyNotFoundException.class));
 String type = Bean.class.getName();
+@SuppressWarnings("null") // Not possible due to test above
 String msg = e.getMessage();
 Assert.assertTrue("No reference to type [" + type +
 "] where property cannot be found in [" + msg + "]",
diff --git a/test/org/apache/catalina/authenticator/TestBasicAuthParser.java 
b/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
index 93e874d..d1dfe31 100644
--- a/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
+++ b/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
@@ -165,22 +165,14 @@ public class TestBasicAuthParser {
 /*
  * Confirm the Basic parser rejects an invalid authentication method.
  */
-@Test
+@Test(expected = IllegalArgumentException.class)
 public void testAuthMethodBadMethod() throws Exception {
 final String METHOD = "BadMethod";
 final BasicAuthHeader AUTH_HEADER =
 new BasicAuthHeader(METHOD, USER_NAME, PASSWORD);
 @SuppressWarnings("unused")
-BasicAuthenticator.BasicCredentials credentials = null;
-try {
-credentials = new BasicAuthenticator.BasicCredentials(
-AUTH_HEADER.getHeader(), StandardCharsets.UTF_8, true);
-Assert.fail("IllegalArgumentException expected");
-}
-catch (Exception e) {
-Assert.assertTrue(e instanceof IllegalArgumentException);
-Assert.assertTrue(e.getMessage().contains("header method"));
-}
+BasicAuthenticator.BasicCredentials credentials =
+new 
BasicAuthenticator.BasicCredentials(AUTH_HEADER.getHeader(), 
StandardCharsets.UTF_8, true);
 }
 
 /*
diff --git a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java 
b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
index 1d0c077..e9c855a 100644
--- a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
+++ b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
@@ -35,6 +35,9 @@ import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.servlet.http.Part;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -128,8 +131,8 @@ public class TestSwallowAbortedUploads extends 
TomcatBaseTest {
 log.info("Limited, swallow disabled");
 AbortedUploadClient client = new AbortedUploadClient();
 Exception ex

[tomcat] 02/02: Remaining false positives

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

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

commit fcd87edac2e2a86108afc4781eb8be1b0388058e
Author: Mark Thomas 
AuthorDate: Fri Oct 16 17:15:36 2020 +0100

Remaining false positives
---
 res/findbugs/filter-false-positives.xml | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/res/findbugs/filter-false-positives.xml 
b/res/findbugs/filter-false-positives.xml
index d4e0b03..4c718a3 100644
--- a/res/findbugs/filter-false-positives.xml
+++ b/res/findbugs/filter-false-positives.xml
@@ -1909,6 +1909,15 @@
 
   
   
+
+
+
+  
+  
+
+
+  
+  
 
 
 
@@ -2140,6 +2149,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
   


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



[tomcat] branch master updated (66df2af -> fcd87ed)

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

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


from 66df2af  SpotBugs - Additional false positives when running with 4.1.4
 new 5c77665  SpotBugs - fix various exception class related issues
 new fcd87ed  Remaining false positives

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:
 res/checkstyle/checkstyle.xml |  5 +++--
 res/findbugs/filter-false-positives.xml   | 15 +++
 test/jakarta/el/TestBeanELResolver.java   |  7 +--
 .../catalina/authenticator/TestBasicAuthParser.java   | 14 +++---
 .../apache/catalina/core/TestSwallowAbortedUploads.java   | 11 +++
 test/org/apache/catalina/realm/TestJNDIRealm.java |  7 +--
 .../startup/TestHostConfigAutomaticDeployment.java|  5 -
 test/org/apache/catalina/startup/TestTomcat.java  |  7 +--
 .../apache/catalina/startup/TestWebappServiceLoader.java  |  7 +--
 test/org/apache/catalina/tribes/io/TestXByteBuffer.java   |  5 -
 .../apache/jasper/compiler/TestELInterpreterFactory.java  | 14 --
 11 files changed, 64 insertions(+), 33 deletions(-)


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



Re: Backport to Java 11 for JDK-8240871

2020-10-16 Thread Mark Thomas
On 16/10/2020 15:49, Rory O'Donnell wrote:
> Hi Mark,
> 
> No details yet, but plan to backport to a JDK11 Update in the future.

Thanks for the update.

Mark


> 
> Rgds,Rory
> 
> On 16/10/2020 08:47, Rory O'Donnell wrote:
>> Hi Mark,
>>
>> Let me check if there are plans.
>>
>> Probably useful to add backport request to JBS report when confirming
>> the fix.
>>
>> Rgds,Rory
>>
>> On 15/10/2020 19:33, Mark Thomas wrote:
>>> Hi Rory,
>>>
>>> How do I find out what the plans are for back-porting this TLS 1.3 fix
>>> to Java 11?
>>>
>>> https://bugs.openjdk.java.net/browse/JDK-8240871
>>>
>>> If there are no plans to backport, how do I put in a request for one?
>>>
>>> Thanks,
>>>
>>> Mark
>>


-
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: SpotBugs - fix various exception class related issues

2020-10-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 69e65b5  SpotBugs - fix various exception class related issues
69e65b5 is described below

commit 69e65b5f4e61257e1c2a7219836fd9f87fd57239
Author: Mark Thomas 
AuthorDate: Fri Oct 16 17:06:16 2020 +0100

SpotBugs - fix various exception class related issues

I'd prefer not to use static imports at all but JUnit uses them
extensively and avoiding them in these instances means unnecessarily
verbose code.
---
 res/checkstyle/checkstyle.xml  |  5 +++--
 test/javax/el/TestBeanELResolver.java  |  7 +--
 .../apache/catalina/authenticator/TestBasicAuthParser.java | 14 +++---
 .../apache/catalina/core/TestSwallowAbortedUploads.java| 11 +++
 test/org/apache/catalina/realm/TestJNDIRealm.java  |  7 +--
 .../startup/TestHostConfigAutomaticDeployment.java |  5 -
 test/org/apache/catalina/startup/TestTomcat.java   |  7 +--
 .../apache/catalina/startup/TestWebappServiceLoader.java   |  7 +--
 test/org/apache/catalina/tribes/io/TestXByteBuffer.java|  5 -
 .../apache/jasper/compiler/TestELInterpreterFactory.java   | 14 --
 10 files changed, 49 insertions(+), 33 deletions(-)

diff --git a/res/checkstyle/checkstyle.xml b/res/checkstyle/checkstyle.xml
index 711212e..9417272 100644
--- a/res/checkstyle/checkstyle.xml
+++ b/res/checkstyle/checkstyle.xml
@@ -63,8 +63,9 @@
 
 
 
-
+
+
+
 
 
 
diff --git a/test/javax/el/TestBeanELResolver.java 
b/test/javax/el/TestBeanELResolver.java
index 7bd9bce..d1df8c6 100644
--- a/test/javax/el/TestBeanELResolver.java
+++ b/test/javax/el/TestBeanELResolver.java
@@ -21,6 +21,9 @@ import java.beans.PropertyDescriptor;
 import java.util.ArrayList;
 import java.util.Iterator;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -57,9 +60,9 @@ public class TestBeanELResolver {
 } catch (PropertyNotFoundException pnfe) {
 e = pnfe;
 }
-Assert.assertTrue("Wrong exception type",
-e instanceof PropertyNotFoundException);
+assertThat("Wrong exception type", e, 
instanceOf(PropertyNotFoundException.class));
 String type = Bean.class.getName();
+@SuppressWarnings("null") // Not possible due to test above
 String msg = e.getMessage();
 Assert.assertTrue("No reference to type [" + type +
 "] where property cannot be found in [" + msg + "]",
diff --git a/test/org/apache/catalina/authenticator/TestBasicAuthParser.java 
b/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
index 93e874d..d1dfe31 100644
--- a/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
+++ b/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
@@ -165,22 +165,14 @@ public class TestBasicAuthParser {
 /*
  * Confirm the Basic parser rejects an invalid authentication method.
  */
-@Test
+@Test(expected = IllegalArgumentException.class)
 public void testAuthMethodBadMethod() throws Exception {
 final String METHOD = "BadMethod";
 final BasicAuthHeader AUTH_HEADER =
 new BasicAuthHeader(METHOD, USER_NAME, PASSWORD);
 @SuppressWarnings("unused")
-BasicAuthenticator.BasicCredentials credentials = null;
-try {
-credentials = new BasicAuthenticator.BasicCredentials(
-AUTH_HEADER.getHeader(), StandardCharsets.UTF_8, true);
-Assert.fail("IllegalArgumentException expected");
-}
-catch (Exception e) {
-Assert.assertTrue(e instanceof IllegalArgumentException);
-Assert.assertTrue(e.getMessage().contains("header method"));
-}
+BasicAuthenticator.BasicCredentials credentials =
+new 
BasicAuthenticator.BasicCredentials(AUTH_HEADER.getHeader(), 
StandardCharsets.UTF_8, true);
 }
 
 /*
diff --git a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java 
b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
index 83b1634..7061ade 100644
--- a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
+++ b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
@@ -35,6 +35,9 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.Part;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -128,8 +131,8 @@ public class TestSwallowAbortedUploads exten

[tomcat] branch 8.5.x updated: SpotBugs - fix various exception class related issues

2020-10-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 461f8d7  SpotBugs - fix various exception class related issues
461f8d7 is described below

commit 461f8d787b15aac6cd717a5c15466117dc24a0a9
Author: Mark Thomas 
AuthorDate: Fri Oct 16 17:06:16 2020 +0100

SpotBugs - fix various exception class related issues

I'd prefer not to use static imports at all but JUnit uses them
extensively and avoiding them in these instances means unnecessarily
verbose code.
---
 res/checkstyle/checkstyle.xml  |  5 +++--
 test/javax/el/TestBeanELResolver.java  |  7 +--
 .../apache/catalina/authenticator/TestBasicAuthParser.java | 14 +++---
 .../apache/catalina/core/TestSwallowAbortedUploads.java| 11 +++
 test/org/apache/catalina/realm/TestJNDIRealm.java  |  7 +--
 .../startup/TestHostConfigAutomaticDeployment.java |  5 -
 test/org/apache/catalina/startup/TestTomcat.java   |  7 +--
 .../apache/catalina/startup/TestWebappServiceLoader.java   |  7 +--
 test/org/apache/catalina/tribes/io/TestXByteBuffer.java|  5 -
 .../apache/jasper/compiler/TestELInterpreterFactory.java   | 14 --
 10 files changed, 49 insertions(+), 33 deletions(-)

diff --git a/res/checkstyle/checkstyle.xml b/res/checkstyle/checkstyle.xml
index 7257bd0..2eb1670 100644
--- a/res/checkstyle/checkstyle.xml
+++ b/res/checkstyle/checkstyle.xml
@@ -60,8 +60,9 @@
 
 
 
-
+
+
+
 
 
 
diff --git a/test/javax/el/TestBeanELResolver.java 
b/test/javax/el/TestBeanELResolver.java
index 7bd9bce..d1df8c6 100644
--- a/test/javax/el/TestBeanELResolver.java
+++ b/test/javax/el/TestBeanELResolver.java
@@ -21,6 +21,9 @@ import java.beans.PropertyDescriptor;
 import java.util.ArrayList;
 import java.util.Iterator;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -57,9 +60,9 @@ public class TestBeanELResolver {
 } catch (PropertyNotFoundException pnfe) {
 e = pnfe;
 }
-Assert.assertTrue("Wrong exception type",
-e instanceof PropertyNotFoundException);
+assertThat("Wrong exception type", e, 
instanceOf(PropertyNotFoundException.class));
 String type = Bean.class.getName();
+@SuppressWarnings("null") // Not possible due to test above
 String msg = e.getMessage();
 Assert.assertTrue("No reference to type [" + type +
 "] where property cannot be found in [" + msg + "]",
diff --git a/test/org/apache/catalina/authenticator/TestBasicAuthParser.java 
b/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
index 9f918d2..b5cfbed 100644
--- a/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
+++ b/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
@@ -165,22 +165,14 @@ public class TestBasicAuthParser {
 /*
  * Confirm the Basic parser rejects an invalid authentication method.
  */
-@Test
+@Test(expected = IllegalArgumentException.class)
 public void testAuthMethodBadMethod() throws Exception {
 final String METHOD = "BadMethod";
 final BasicAuthHeader AUTH_HEADER =
 new BasicAuthHeader(METHOD, USER_NAME, PASSWORD);
 @SuppressWarnings("unused")
-BasicAuthenticator.BasicCredentials credentials = null;
-try {
-credentials = new BasicAuthenticator.BasicCredentials(
-AUTH_HEADER.getHeader(), StandardCharsets.UTF_8, true);
-Assert.fail("IllegalArgumentException expected");
-}
-catch (Exception e) {
-Assert.assertTrue(e instanceof IllegalArgumentException);
-Assert.assertTrue(e.getMessage().contains("header method"));
-}
+BasicAuthenticator.BasicCredentials credentials =
+new 
BasicAuthenticator.BasicCredentials(AUTH_HEADER.getHeader(), 
StandardCharsets.UTF_8, true);
 }
 
 /*
diff --git a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java 
b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
index 83b1634..7061ade 100644
--- a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
+++ b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
@@ -35,6 +35,9 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.Part;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -128,8 +131,8 @@ public class TestSwallowAbortedUploads exten

[tomcat] branch 7.0.x updated: SpotBugs - fix various exception class related issues

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

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new ed94503  SpotBugs - fix various exception class related issues
ed94503 is described below

commit ed94503f43f88eafb6a4c719d46ffe899313189a
Author: Mark Thomas 
AuthorDate: Fri Oct 16 17:06:16 2020 +0100

SpotBugs - fix various exception class related issues

I'd prefer not to use static imports at all but JUnit uses them
extensively and avoiding them in these instances means unnecessarily
verbose code.
---
 res/checkstyle/checkstyle.xml  |  5 +++--
 test/javax/el/TestBeanELResolver.java  |  7 +--
 .../apache/catalina/core/TestSwallowAbortedUploads.java| 11 +++
 test/org/apache/catalina/realm/TestJNDIRealm.java  |  7 +--
 test/org/apache/catalina/startup/TestTomcat.java   |  7 +--
 .../apache/catalina/startup/TestWebappServiceLoader.java   |  7 +--
 test/org/apache/catalina/tribes/io/TestXByteBuffer.java|  5 -
 .../apache/jasper/compiler/TestELInterpreterFactory.java   | 14 --
 8 files changed, 42 insertions(+), 21 deletions(-)

diff --git a/res/checkstyle/checkstyle.xml b/res/checkstyle/checkstyle.xml
index 3bbcb43..77276d6 100644
--- a/res/checkstyle/checkstyle.xml
+++ b/res/checkstyle/checkstyle.xml
@@ -60,8 +60,9 @@
 
 
 
-
+
+
+
 
 
 
diff --git a/test/javax/el/TestBeanELResolver.java 
b/test/javax/el/TestBeanELResolver.java
index 825d7c3..cbd3797 100644
--- a/test/javax/el/TestBeanELResolver.java
+++ b/test/javax/el/TestBeanELResolver.java
@@ -21,6 +21,9 @@ import java.beans.PropertyDescriptor;
 import java.util.ArrayList;
 import java.util.Iterator;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -57,9 +60,9 @@ public class TestBeanELResolver {
 } catch (PropertyNotFoundException pnfe) {
 e = pnfe;
 }
-Assert.assertTrue("Wrong exception type",
-e instanceof PropertyNotFoundException);
+assertThat("Wrong exception type", e, 
instanceOf(PropertyNotFoundException.class));
 String type = Bean.class.getName();
+@SuppressWarnings("null") // Not possible due to test above
 String msg = e.getMessage();
 Assert.assertTrue("No reference to type [" + type +
 "] where property cannot be found in [" + msg + "]",
diff --git a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java 
b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
index 450d9fc..ba45c93 100644
--- a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
+++ b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
@@ -34,6 +34,9 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.Part;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -127,8 +130,8 @@ public class TestSwallowAbortedUploads extends 
TomcatBaseTest {
 log.info("Limited, swallow disabled");
 AbortedUploadClient client = new AbortedUploadClient();
 Exception ex = doAbortedUploadTest(client, true, false);
-Assert.assertTrue("Limited upload with swallow disabled does not 
generate client exception",
-   ex instanceof java.net.SocketException);
+assertThat("Limited upload with swallow disabled does not generate 
client exception",
+   ex, instanceOf(java.net.SocketException.class));
 client.reset();
 }
 
@@ -173,8 +176,8 @@ public class TestSwallowAbortedUploads extends 
TomcatBaseTest {
 log.info("Aborted (413), swallow disabled");
 AbortedPOSTClient client = new AbortedPOSTClient();
 Exception ex = doAbortedPOSTTest(client, 
HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE, false);
-Assert.assertTrue("Limited upload with swallow disabled does not 
generate client exception",
-   ex instanceof java.net.SocketException);
+assertThat("Limited upload with swallow disabled does not generate 
client exception",
+ex, instanceOf(java.net.SocketException.class));
 client.reset();
 }
 
diff --git a/test/org/apache/catalina/realm/TestJNDIRealm.java 
b/test/org/apache/catalina/realm/TestJNDIRealm.java
index 9174b72..4986969 100644
--- a/test/org/apache/catalina/realm/TestJNDIRealm.java
+++ b/test/org/apache/catalina/realm/TestJNDIRealm.java
@@ -28,6 +28,9 @@ import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.SearchControls;
 impo

[tomcat] branch 9.0.x updated: SpotBugs - update false positives for SpotBugs 4.1.4

2020-10-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 1dfc27f  SpotBugs - update false positives for SpotBugs 4.1.4
1dfc27f is described below

commit 1dfc27fbd3a0b93b780b7b682deb0115b8691d77
Author: Mark Thomas 
AuthorDate: Fri Oct 16 17:56:11 2020 +0100

SpotBugs - update false positives for SpotBugs 4.1.4
---
 res/findbugs/filter-false-positives.xml | 62 +
 1 file changed, 62 insertions(+)

diff --git a/res/findbugs/filter-false-positives.xml 
b/res/findbugs/filter-false-positives.xml
index c62e9ac..9b8b32a 100644
--- a/res/findbugs/filter-false-positives.xml
+++ b/res/findbugs/filter-false-positives.xml
@@ -17,6 +17,11 @@
 
   
   
+
+
+
+  
+  
 
 
 
@@ -541,6 +546,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
 
@@ -702,6 +713,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
@@ -709,6 +726,15 @@
 
   
   
+
+
+
+
+  
+  
+
+  
+  
 
 
@@ -1026,6 +1052,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
 
@@ -1318,6 +1350,12 @@
 
   
   
+
+
+ 
+
+  
+  
 
 
 
@@ -1879,6 +1917,15 @@
 
   
   
+
+
+
+  
+  
+
+
+  
+  
 
 
 
@@ -1906,6 +1953,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
 
@@ -2110,6 +2163,12 @@
 
   
   
+
+
+
+
+  
+  
 
 
   
@@ -2149,6 +2208,9 @@
   
   
   
+  
+  
+  
 
 
   


-
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: Remove unnecessary annotation with EasyMock 4.2

2020-10-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 b92c8b3  Remove unnecessary annotation with EasyMock 4.2
b92c8b3 is described below

commit b92c8b30e29d101291173aca6d5978f0f8c243b7
Author: Mark Thomas 
AuthorDate: Fri Oct 16 19:51:33 2020 +0100

Remove unnecessary annotation with EasyMock 4.2
---
 test/org/apache/catalina/realm/TestJNDIRealm.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/test/org/apache/catalina/realm/TestJNDIRealm.java 
b/test/org/apache/catalina/realm/TestJNDIRealm.java
index 5ffac18..00180e1 100644
--- a/test/org/apache/catalina/realm/TestJNDIRealm.java
+++ b/test/org/apache/catalina/realm/TestJNDIRealm.java
@@ -141,7 +141,6 @@ public class TestJNDIRealm {
 
 private NamingEnumeration mockSearchResults(String password)
 throws NamingException {
-@SuppressWarnings("unchecked")
 NamingEnumeration searchResults =
 EasyMock.createNiceMock(NamingEnumeration.class);
 EasyMock.expect(Boolean.valueOf(searchResults.hasMore()))


-
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: SpotBugs - false positives

2020-10-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 37c5b0c  SpotBugs - false positives
37c5b0c is described below

commit 37c5b0c7484a451c322e148aad53c7d318a83e66
Author: Mark Thomas 
AuthorDate: Fri Oct 16 20:16:36 2020 +0100

SpotBugs - false positives
---
 res/findbugs/filter-false-positives.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/res/findbugs/filter-false-positives.xml 
b/res/findbugs/filter-false-positives.xml
index 77327a1..5dd4e2c 100644
--- a/res/findbugs/filter-false-positives.xml
+++ b/res/findbugs/filter-false-positives.xml
@@ -17,6 +17,11 @@
 
   
   
+
+
+
+  
+  
 
 
 


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