[tomcat] branch master updated: Remove unused code

2019-11-12 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 163c0ad  Remove unused code
163c0ad is described below

commit 163c0ad70540e59b75fc922d6fd19eacc7febd3e
Author: Mark Thomas 
AuthorDate: Tue Nov 12 08:32:56 2019 +

Remove unused code
---
 .../apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java | 7 ---
 1 file changed, 7 deletions(-)

diff --git 
a/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java 
b/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
index 858a6dc..0fee189 100644
--- a/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
+++ b/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
@@ -51,7 +51,6 @@ public class WsRemoteEndpointImplServer extends 
WsRemoteEndpointImplBase {
 private volatile ByteBuffer[] buffers = null;
 
 private volatile long timeoutExpiry = -1;
-private volatile boolean close;
 
 public WsRemoteEndpointImplServer(SocketWrapperBase socketWrapper,
 WsServerContainer serverContainer) {
@@ -103,9 +102,6 @@ public class WsRemoteEndpointImplServer extends 
WsRemoteEndpointImplBase {
 } else {
 
wsWriteTimeout.unregister(WsRemoteEndpointImplServer.this);
 clearHandler(null, true);
-if (close) {
-close();
-}
 }
 }
 @Override
@@ -185,9 +181,6 @@ public class WsRemoteEndpointImplServer extends 
WsRemoteEndpointImplBase {
 if (complete) {
 wsWriteTimeout.unregister(this);
 clearHandler(null, useDispatch);
-if (close) {
-close();
-}
 }
 break;
 }


-
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: Remove unused code

2019-11-12 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 064cca1  Remove unused code
064cca1 is described below

commit 064cca1e6fa20b44082e3deffb1a8f6bcf32cc8f
Author: Mark Thomas 
AuthorDate: Tue Nov 12 08:59:09 2019 +

Remove unused code
---
 .../apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java| 4 
 1 file changed, 4 deletions(-)

diff --git 
a/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java 
b/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
index 0d8f872..b370123 100644
--- a/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
+++ b/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
@@ -49,7 +49,6 @@ public class WsRemoteEndpointImplServer extends 
WsRemoteEndpointImplBase {
 private volatile ByteBuffer[] buffers = null;
 
 private volatile long timeoutExpiry = -1;
-private volatile boolean close;
 
 public WsRemoteEndpointImplServer(SocketWrapperBase socketWrapper,
 WsServerContainer serverContainer) {
@@ -129,9 +128,6 @@ public class WsRemoteEndpointImplServer extends 
WsRemoteEndpointImplBase {
 if (complete) {
 wsWriteTimeout.unregister(this);
 clearHandler(null, useDispatch);
-if (close) {
-close();
-}
 }
 break;
 }


-
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: Remove unused code. Fix deprecation warning.

2019-11-12 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 82dc5f0  Remove unused code. Fix deprecation warning.
82dc5f0 is described below

commit 82dc5f0fb958f167e6f0aa6de6f1cd815e8e1578
Author: Mark Thomas 
AuthorDate: Tue Nov 12 09:01:08 2019 +

Remove unused code. Fix deprecation warning.
---
 .../apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git 
a/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java 
b/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
index 1b0494f..9974638 100644
--- a/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
+++ b/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
@@ -41,8 +41,7 @@ import org.apache.tomcat.websocket.WsRemoteEndpointImplBase;
  */
 public class WsRemoteEndpointImplServer extends WsRemoteEndpointImplBase {
 
-private static final StringManager sm =
-StringManager.getManager(Constants.PACKAGE_NAME);
+private static final StringManager sm = 
StringManager.getManager(WsRemoteEndpointImplServer.class);
 private final Log log = 
LogFactory.getLog(WsRemoteEndpointImplServer.class); // must not be static
 
 private static final Queue onResultRunnables =
@@ -55,7 +54,6 @@ public class WsRemoteEndpointImplServer extends 
WsRemoteEndpointImplBase {
 private volatile ByteBuffer[] buffers = null;
 
 private volatile long timeoutExpiry = -1;
-private volatile boolean close;
 
 
 public WsRemoteEndpointImplServer(AbstractServletOutputStream sos,
@@ -100,9 +98,6 @@ public class WsRemoteEndpointImplServer extends 
WsRemoteEndpointImplBase {
 if (complete) {
 wsWriteTimeout.unregister(this);
 clearHandler(null, useDispatch);
-if (close) {
-close();
-}
 break;
 }
 }


-
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: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap NPEs

2019-11-12 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 cf4f6da  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap 
NPEs
cf4f6da is described below

commit cf4f6da8cf1a7232e8081261032a38cca97af407
Author: Mark Thomas 
AuthorDate: Tue Nov 12 09:11:05 2019 +

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap NPEs

Wrap any NullPointerExceptions throw by the Inflater or Deflater used by
the PerMessageDeflate extension in an IOException so that the error can
be caught and handled by the WebSocket error handling mechanism.
---
 .../tomcat/websocket/LocalStrings.properties   |  1 +
 .../apache/tomcat/websocket/PerMessageDeflate.java | 37 --
 .../apache/tomcat/websocket/Transformation.java|  5 ++-
 .../tomcat/websocket/WsRemoteEndpointImplBase.java |  7 +++-
 .../tomcat/websocket/TestPerMessageDeflate.java|  2 +-
 webapps/docs/changelog.xml | 11 +++
 6 files changed, 51 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/LocalStrings.properties 
b/java/org/apache/tomcat/websocket/LocalStrings.properties
index 4f6f3b7..744619a 100644
--- a/java/org/apache/tomcat/websocket/LocalStrings.properties
+++ b/java/org/apache/tomcat/websocket/LocalStrings.properties
@@ -35,6 +35,7 @@ caseInsensitiveKeyMap.nullKey=Null keys are not permitted
 
 futureToSendHandler.timeout=Operation timed out after waiting [{0}] [{1}] to 
complete
 
+perMessageDeflate.alreadyClosed=The transformer has been closed and may no 
longer be used
 perMessageDeflate.deflateFailed=Failed to decompress a compressed WebSocket 
frame
 perMessageDeflate.duplicateParameter=Duplicate definition of the [{0}] 
extension parameter
 perMessageDeflate.invalidState=Invalid state
diff --git a/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
b/java/org/apache/tomcat/websocket/PerMessageDeflate.java
index 90931c5..afcfcf0 100644
--- a/java/org/apache/tomcat/websocket/PerMessageDeflate.java
+++ b/java/org/apache/tomcat/websocket/PerMessageDeflate.java
@@ -204,6 +204,8 @@ public class PerMessageDeflate implements Transformation {
 dest.array(), dest.arrayOffset() + dest.position(), 
dest.remaining());
 } catch (DataFormatException e) {
 throw new 
IOException(sm.getString("perMessageDeflate.deflateFailed"), e);
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
 }
 dest.position(dest.position() + written);
 
@@ -229,7 +231,11 @@ public class PerMessageDeflate implements Transformation {
 } else if (written == 0) {
 if (fin && (isServer && !clientContextTakeover ||
 !isServer && !serverContextTakeover)) {
-inflater.reset();
+try {
+inflater.reset();
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
+}
 }
 return TransformationResult.END_OF_FRAME;
 }
@@ -314,7 +320,7 @@ public class PerMessageDeflate implements Transformation {
 
 
 @Override
-public List sendMessagePart(List 
uncompressedParts) {
+public List sendMessagePart(List 
uncompressedParts) throws IOException {
 List allCompressedParts = new ArrayList<>();
 
 for (MessagePart uncompressedPart : uncompressedParts) {
@@ -345,10 +351,14 @@ public class PerMessageDeflate implements Transformation {
 while (deflateRequired) {
 ByteBuffer compressedPayload = writeBuffer;
 
-int written = deflater.deflate(compressedPayload.array(),
-compressedPayload.arrayOffset() + 
compressedPayload.position(),
-compressedPayload.remaining(), flush);
-compressedPayload.position(compressedPayload.position() + 
written);
+try {
+int written = 
deflater.deflate(compressedPayload.array(),
+compressedPayload.arrayOffset() + 
compressedPayload.position(),
+compressedPayload.remaining(), flush);
+
compressedPayload.position(compressedPayload.position() + written);
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
+}
 
 if (!uncompressedPart.isFin() && 
compressedPayload.hasRemaining() && deflater.needsInput()) {
   

[tomcat] branch master updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap NPEs

2019-11-12 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 5bf2a85  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap 
NPEs
5bf2a85 is described below

commit 5bf2a8504f5965410e82242667b71f54912fe766
Author: Mark Thomas 
AuthorDate: Tue Nov 12 09:11:05 2019 +

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap NPEs

Wrap any NullPointerExceptions throw by the Inflater or Deflater used by
the PerMessageDeflate extension in an IOException so that the error can
be caught and handled by the WebSocket error handling mechanism.
---
 .../tomcat/websocket/LocalStrings.properties   |  1 +
 .../apache/tomcat/websocket/PerMessageDeflate.java | 37 --
 .../apache/tomcat/websocket/Transformation.java|  5 ++-
 .../tomcat/websocket/WsRemoteEndpointImplBase.java |  7 +++-
 .../tomcat/websocket/TestPerMessageDeflate.java|  2 +-
 webapps/docs/changelog.xml | 11 +++
 6 files changed, 51 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/LocalStrings.properties 
b/java/org/apache/tomcat/websocket/LocalStrings.properties
index 4f6f3b7..744619a 100644
--- a/java/org/apache/tomcat/websocket/LocalStrings.properties
+++ b/java/org/apache/tomcat/websocket/LocalStrings.properties
@@ -35,6 +35,7 @@ caseInsensitiveKeyMap.nullKey=Null keys are not permitted
 
 futureToSendHandler.timeout=Operation timed out after waiting [{0}] [{1}] to 
complete
 
+perMessageDeflate.alreadyClosed=The transformer has been closed and may no 
longer be used
 perMessageDeflate.deflateFailed=Failed to decompress a compressed WebSocket 
frame
 perMessageDeflate.duplicateParameter=Duplicate definition of the [{0}] 
extension parameter
 perMessageDeflate.invalidState=Invalid state
diff --git a/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
b/java/org/apache/tomcat/websocket/PerMessageDeflate.java
index 90931c5..afcfcf0 100644
--- a/java/org/apache/tomcat/websocket/PerMessageDeflate.java
+++ b/java/org/apache/tomcat/websocket/PerMessageDeflate.java
@@ -204,6 +204,8 @@ public class PerMessageDeflate implements Transformation {
 dest.array(), dest.arrayOffset() + dest.position(), 
dest.remaining());
 } catch (DataFormatException e) {
 throw new 
IOException(sm.getString("perMessageDeflate.deflateFailed"), e);
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
 }
 dest.position(dest.position() + written);
 
@@ -229,7 +231,11 @@ public class PerMessageDeflate implements Transformation {
 } else if (written == 0) {
 if (fin && (isServer && !clientContextTakeover ||
 !isServer && !serverContextTakeover)) {
-inflater.reset();
+try {
+inflater.reset();
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
+}
 }
 return TransformationResult.END_OF_FRAME;
 }
@@ -314,7 +320,7 @@ public class PerMessageDeflate implements Transformation {
 
 
 @Override
-public List sendMessagePart(List 
uncompressedParts) {
+public List sendMessagePart(List 
uncompressedParts) throws IOException {
 List allCompressedParts = new ArrayList<>();
 
 for (MessagePart uncompressedPart : uncompressedParts) {
@@ -345,10 +351,14 @@ public class PerMessageDeflate implements Transformation {
 while (deflateRequired) {
 ByteBuffer compressedPayload = writeBuffer;
 
-int written = deflater.deflate(compressedPayload.array(),
-compressedPayload.arrayOffset() + 
compressedPayload.position(),
-compressedPayload.remaining(), flush);
-compressedPayload.position(compressedPayload.position() + 
written);
+try {
+int written = 
deflater.deflate(compressedPayload.array(),
+compressedPayload.arrayOffset() + 
compressedPayload.position(),
+compressedPayload.remaining(), flush);
+
compressedPayload.position(compressedPayload.position() + written);
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
+}
 
 if (!uncompressedPart.isFin() && 
compressedPayload.hasRemaining() && deflater.needsInput()) {
 

[tomcat] branch 7.0.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap NPEs

2019-11-12 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 32a0405  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap 
NPEs
32a0405 is described below

commit 32a04051988982698f6d55f929545fb2689423b9
Author: Mark Thomas 
AuthorDate: Tue Nov 12 09:11:05 2019 +

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63913 Wrap NPEs

Wrap any NullPointerExceptions throw by the Inflater or Deflater used by
the PerMessageDeflate extension in an IOException so that the error can
be caught and handled by the WebSocket error handling mechanism.
---
 .../tomcat/websocket/LocalStrings.properties   |  1 +
 .../apache/tomcat/websocket/PerMessageDeflate.java | 37 --
 .../apache/tomcat/websocket/Transformation.java|  5 ++-
 .../tomcat/websocket/WsRemoteEndpointImplBase.java |  7 +++-
 .../tomcat/websocket/TestPerMessageDeflate.java|  2 +-
 webapps/docs/changelog.xml | 11 +++
 6 files changed, 51 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/LocalStrings.properties 
b/java/org/apache/tomcat/websocket/LocalStrings.properties
index 8507c1a..273920d 100644
--- a/java/org/apache/tomcat/websocket/LocalStrings.properties
+++ b/java/org/apache/tomcat/websocket/LocalStrings.properties
@@ -32,6 +32,7 @@ caseInsensitiveKeyMap.nullKey=Null keys are not permitted
 
 futureToSendHandler.timeout=Operation timed out after waiting [{0}] [{1}] to 
complete
 
+perMessageDeflate.alreadyClosed=The transformer has been closed and may no 
longer be used
 perMessageDeflate.deflateFailed=Failed to decompress a compressed WebSocket 
frame
 perMessageDeflate.duplicateParameter=Duplicate definition of the [{0}] 
extension parameter
 perMessageDeflate.invalidWindowSize=An invalid windows of [{1}] size was 
specified for [{0}]. Valid values are whole numbers from 8 to 15 inclusive.
diff --git a/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
b/java/org/apache/tomcat/websocket/PerMessageDeflate.java
index c4fe1c4..a6f241d 100644
--- a/java/org/apache/tomcat/websocket/PerMessageDeflate.java
+++ b/java/org/apache/tomcat/websocket/PerMessageDeflate.java
@@ -204,6 +204,8 @@ public class PerMessageDeflate implements Transformation {
 dest.array(), dest.arrayOffset() + dest.position(), 
dest.remaining());
 } catch (DataFormatException e) {
 throw new 
IOException(sm.getString("perMessageDeflate.deflateFailed"), e);
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
 }
 dest.position(dest.position() + written);
 
@@ -229,7 +231,11 @@ public class PerMessageDeflate implements Transformation {
 } else if (written == 0) {
 if (fin && (isServer && !clientContextTakeover ||
 !isServer && !serverContextTakeover)) {
-inflater.reset();
+try {
+inflater.reset();
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
+}
 }
 return TransformationResult.END_OF_FRAME;
 }
@@ -314,7 +320,7 @@ public class PerMessageDeflate implements Transformation {
 
 
 @Override
-public List sendMessagePart(List 
uncompressedParts) {
+public List sendMessagePart(List 
uncompressedParts) throws IOException {
 List allCompressedParts = new ArrayList();
 
 for (MessagePart uncompressedPart : uncompressedParts) {
@@ -345,10 +351,14 @@ public class PerMessageDeflate implements Transformation {
 while (deflateRequired) {
 ByteBuffer compressedPayload = writeBuffer;
 
-int written = deflater.deflate(compressedPayload.array(),
-compressedPayload.arrayOffset() + 
compressedPayload.position(),
-compressedPayload.remaining(), flush);
-compressedPayload.position(compressedPayload.position() + 
written);
+try {
+int written = 
deflater.deflate(compressedPayload.array(),
+compressedPayload.arrayOffset() + 
compressedPayload.position(),
+compressedPayload.remaining(), flush);
+
compressedPayload.position(compressedPayload.position() + written);
+} catch (NullPointerException e) {
+throw new 
IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
+}
 
 if (!uncompress

[Bug 63913] java.lang.NullPointerException: Inflater has been closed

2019-11-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63913

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #12 from Mark Thomas  ---
Thanks.

Neither the WebSocket code nor Tomcat's I/O code is expecting a
NullPointerException here which is why it bubbles all the way up to the
Processor which logs it and closes the connection.

I'm going to fix this by catching the NPE and wrapping it in an IOException
which is a better match for what is going wrong and is an Exception that the
code is designed to handle.

Fixed in:
- master for 9.0.28 onwards
- 8.5.x for 8.5.48 onwards
- 7.0.x for 7.0.98 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



JDK 14 - Early Access build 22 is available

2019-11-12 Thread Rory O'Donnell

Hi Mark,

*OpenJDK builds  - JDK 14 *- Early Access build 22 is available at 
http://jdk.java.net/14/


These early-access, open-source builds are provided under the GNU 
General Public License, version 2, with the Classpath Exception 
.


 * Release notes
 o https://jdk.java.net/14/release-notes

 * JEPs targeted to JDK 14, so far:

 * JEP 345: NUMA-Aware Memory Allocation for G1
    was Targeted to JDK 14.
 * JEP 349: JFR Event Streaming
    was Integrated.
 * JEP 361: Switch Expressions (Standard)
    was Targeted to JDK 14.
 * JEP 363: Remove the Concurrent Mark Sweep (CMS) Garbage
   Collector  was Targeted to JDK 14.
 * JEP 364: ZGC on macOS  was
   Targeted to JDK 14.
 * JEP 365: ZGC on Windows  moved
   to Candidate.
 * JEP 366: Deprecate the ParallelScavenge + SerialOld GC
   Combination  was Proposed to
   target JDK 14.
 * JEP 367: Remove the Pack200 Tools and API
    was Targeted to JDK 14.
 * JEP 368: Text Blocks (Second Preview)
    moved to Candidate.

 * Changes in this build
   


*jpackage EA -* Build 14-jpackage+1-67 (2019/11/4)

 * This is an early access build of JEP 343: Packaging Tool
   , aimed at testing a prototype
   implementation of jpackage, which is a new tool for packaging
   self-contained Java applications along with a Java Runtime Environment.
 * These early-access builds are provided under the GNU General Public
   License, version 2, with the Classpath Exception
   
 * Build 14 is now available http://jdk.java.net/jpackage/
 * Please send feedback via e-mail to core-libs-...@openjdk.java.net
   



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



[tomcat] branch 7.0.x updated: Fix Javadoc warnings when building with Java 13

2019-11-12 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 aacd9cb  Fix Javadoc warnings when building with Java 13
aacd9cb is described below

commit aacd9cbee771ef00bb0e381c7814336c38068739
Author: Mark Thomas 
AuthorDate: Tue Nov 12 10:47:41 2019 +

Fix Javadoc warnings when building with Java 13
---
 java/org/apache/tomcat/util/buf/CharChunk.java | 22 +++
 .../apache/tomcat/util/buf/LocalStrings.properties |  2 ++
 java/org/apache/tomcat/util/buf/MessageBytes.java  | 25 +++---
 java/org/apache/tomcat/util/buf/StringCache.java   | 25 ++
 java/org/apache/tomcat/util/buf/UDecoder.java  | 25 +++---
 java/org/apache/tomcat/util/buf/UEncoder.java  | 10 ++---
 6 files changed, 91 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/tomcat/util/buf/CharChunk.java 
b/java/org/apache/tomcat/util/buf/CharChunk.java
index 9428649..f0babe6 100644
--- a/java/org/apache/tomcat/util/buf/CharChunk.java
+++ b/java/org/apache/tomcat/util/buf/CharChunk.java
@@ -40,6 +40,10 @@ public final class CharChunk extends AbstractChunk 
implements CharSequence {
 /**
  * Read new characters.
  *
+ * @param cbuf Buffer to read the characters into
+ * @param off  Offset for target buffer
+ * @param len  length of data to read
+ *
  * @return The number of characters read
  *
  * @throws IOException If an I/O error occurs during reading
@@ -92,6 +96,7 @@ public final class CharChunk extends AbstractChunk implements 
CharSequence {
 // 
 
 /**
+ * @return {@link #clone()}
  * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
  */
 @Deprecated
@@ -359,6 +364,12 @@ public final class CharChunk extends AbstractChunk 
implements CharSequence {
 
 
 /**
+ * @param src Destination for subtracted data
+ *
+ * @return count of bytes removed
+ *
+ * @throws IOException If an I/O error occurs
+ *
  * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
  */
 @Deprecated
@@ -495,6 +506,8 @@ public final class CharChunk extends AbstractChunk 
implements CharSequence {
 
 
 /**
+ * @return Buffer content parsed into an int
+ *
  * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
  */
 @Deprecated
@@ -588,6 +601,13 @@ public final class CharChunk extends AbstractChunk 
implements CharSequence {
 
 
 /**
+ * @param b2Byte array to test
+ * @param off2  Offset for byte array
+ * @param len2  Length of byte array
+ *
+ * @return {@code true} if the contents of the provided byte array are
+ * equal to the contents of this object
+ *
  * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
  */
 @Deprecated
@@ -685,6 +705,8 @@ public final class CharChunk extends AbstractChunk 
implements CharSequence {
 
 
 /**
+ * @return case insensitive (all lower case) hash code
+ *
  * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
  */
 @Deprecated
diff --git a/java/org/apache/tomcat/util/buf/LocalStrings.properties 
b/java/org/apache/tomcat/util/buf/LocalStrings.properties
index 9fe0db8..1f5e8b0 100644
--- a/java/org/apache/tomcat/util/buf/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/buf/LocalStrings.properties
@@ -17,6 +17,8 @@ b2cConverter.unknownEncoding=The character encoding [{0}] is 
not supported
 
 c2bConverter.recycleFailed=Failed to recycle the C2B Converter. Creating new 
BufferedWriter, WriteConvertor and IntermediateOutputStream.
 
+uDecoder.eof=End of file (EOF)
+uDecoder.noSlash=The encoded slash character is not allowed
 uDecoder.convertHexDigit.notHex=[{0}] is not a hexadecimal digit
 uDecoder.urlDecode.conversionError=Failed to decode [{0}] using character set 
[{1}]
 uDecoder.urlDecode.missingDigit=Failed to decode [{0}] because the % character 
must be followed by two hexademical digits
diff --git a/java/org/apache/tomcat/util/buf/MessageBytes.java 
b/java/org/apache/tomcat/util/buf/MessageBytes.java
index a83f83c..a1fbc9e 100644
--- a/java/org/apache/tomcat/util/buf/MessageBytes.java
+++ b/java/org/apache/tomcat/util/buf/MessageBytes.java
@@ -82,6 +82,7 @@ public final class MessageBytes implements Cloneable, 
Serializable {
 }
 
 /**
+ * @return {@link #clone()}
  * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
  */
 @Deprecated
@@ -392,8 +393,10 @@ public final class MessageBytes implements Cloneable, 
Serializable {
 
 
 /**
- * Returns true if the message bytes starts with the specified string.
  * @param s the string
+ *
+ * @return true if the message bytes starts wit

[tomcat] branch 8.5.x updated: Polish. Align with 7.0.x/9.0.x. Use i18n.

2019-11-12 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 f13511f  Polish. Align with 7.0.x/9.0.x. Use i18n.
f13511f is described below

commit f13511f09f38a8dc28b87d13e1a4620105d2df51
Author: Mark Thomas 
AuthorDate: Tue Nov 12 10:48:24 2019 +

Polish. Align with 7.0.x/9.0.x. Use i18n.
---
 java/org/apache/tomcat/util/buf/LocalStrings.properties | 2 ++
 java/org/apache/tomcat/util/buf/MessageBytes.java   | 2 +-
 java/org/apache/tomcat/util/buf/UDecoder.java   | 5 ++---
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/tomcat/util/buf/LocalStrings.properties 
b/java/org/apache/tomcat/util/buf/LocalStrings.properties
index 226c041..8128109 100644
--- a/java/org/apache/tomcat/util/buf/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/buf/LocalStrings.properties
@@ -25,6 +25,8 @@ c2bConverter.recycleFailed=Failed to recycle the C2B 
Converter. Creating new Buf
 hexUtils.fromHex.nonHex=The input must consist only of hex digits
 hexUtils.fromHex.oddDigits=The input must consist of an even number of hex 
digits
 
+uDecoder.eof=End of file (EOF)
+uDecoder.noSlash=The encoded slash character is not allowed
 uDecoder.urlDecode.conversionError=Failed to decode [{0}] using character set 
[{1}]
 uDecoder.urlDecode.missingDigit=Failed to decode [{0}] because the % character 
must be followed by two hexademical digits
 uDecoder.urlDecode.uee=Unable to URL decode the specified input since the 
encoding [{0}] is not supported.
diff --git a/java/org/apache/tomcat/util/buf/MessageBytes.java 
b/java/org/apache/tomcat/util/buf/MessageBytes.java
index de4942f..a24ad82 100644
--- a/java/org/apache/tomcat/util/buf/MessageBytes.java
+++ b/java/org/apache/tomcat/util/buf/MessageBytes.java
@@ -499,7 +499,7 @@ public final class MessageBytes implements Cloneable, 
Serializable {
 private boolean hasLongValue=false;
 
 /**
- * Set the buffer to the representation of an long.
+ * Set the buffer to the representation of a long.
  * @param l The long
  */
 public void setLong(long l) {
diff --git a/java/org/apache/tomcat/util/buf/UDecoder.java 
b/java/org/apache/tomcat/util/buf/UDecoder.java
index dda7ecb..fa0523a 100644
--- a/java/org/apache/tomcat/util/buf/UDecoder.java
+++ b/java/org/apache/tomcat/util/buf/UDecoder.java
@@ -59,7 +59,7 @@ public final class UDecoder {
 }
 
 /** Unexpected end of data. */
-private static final IOException EXCEPTION_EOF = new 
DecodeException("EOF");
+private static final IOException EXCEPTION_EOF = new 
DecodeException(sm.getString("uDecoder.eof"));
 
 /** %xx with not-hex digit */
 private static final IOException EXCEPTION_NOT_HEX_DIGIT = new 
DecodeException(
@@ -129,7 +129,6 @@ public final class UDecoder {
 
 mb.setEnd( idx );
 
-return;
 }
 
 //  Additional methods 
@@ -284,7 +283,7 @@ public final class UDecoder {
 char res = (char) Integer.parseInt(
 str.substring(strPos + 1, strPos + 3), 16);
 if (noSlash && (res == '/')) {
-throw new IllegalArgumentException("noSlash");
+throw new 
IllegalArgumentException(sm.getString("uDecoder.noSlash"));
 }
 dec.append(res);
 strPos += 3;


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



[Bug 63913] java.lang.NullPointerException: Inflater has been closed

2019-11-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63913

--- Comment #13 from Boris Petrov  ---
Thanks for the great support! If there are further troubles when I try 9.0.28,
I'll let you know. Thank you again!

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



[tomcat] branch master updated: Polish. Align with 8.5.x/7.0.x

2019-11-12 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 e76edfc  Polish. Align with 8.5.x/7.0.x
e76edfc is described below

commit e76edfcf993bd28e973a4b73c9fa43f1304ce271
Author: Mark Thomas 
AuthorDate: Tue Nov 12 12:12:46 2019 +

Polish. Align with 8.5.x/7.0.x
---
 java/org/apache/catalina/Context.java | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/Context.java 
b/java/org/apache/catalina/Context.java
index 49453f2..3e647dc 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -1393,6 +1393,7 @@ public interface Context extends Container, ContextBind {
  */
 public JspConfigDescriptor getJspConfigDescriptor();
 
+
 /**
  * Set the JspConfigDescriptor for this context.
  * A null value indicates there is not JSP configuration.
@@ -1401,6 +1402,7 @@ public interface Context extends Container, ContextBind {
  */
 public void setJspConfigDescriptor(JspConfigDescriptor descriptor);
 
+
 /**
  * Add a ServletContainerInitializer instance to this web application.
  *
@@ -1411,6 +1413,7 @@ public interface Context extends Container, ContextBind {
 public void addServletContainerInitializer(
 ServletContainerInitializer sci, Set> classes);
 
+
 /**
  * Is this Context paused whilst it is reloaded?
  *
@@ -1426,6 +1429,7 @@ public interface Context extends Container, ContextBind {
  */
 boolean isServlet22();
 
+
 /**
  * Notification that Servlet security has been dynamically set in a
  * {@link javax.servlet.ServletRegistration.Dynamic}
@@ -1481,7 +1485,7 @@ public interface Context extends Container, ContextBind {
 /**
  * @return The version of this web application, used to differentiate
  * different versions of the same web application when using parallel
- * deployment.
+ * deployment. If not specified, defaults to the empty string.
  */
 public String getWebappVersion();
 


-
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: Polish. Align with 9.0.x/7.0.x

2019-11-12 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 5479b5b  Polish. Align with 9.0.x/7.0.x
5479b5b is described below

commit 5479b5bb922459cd1c4fc59b19ca0b0bc0f0edf2
Author: Mark Thomas 
AuthorDate: Tue Nov 12 12:13:22 2019 +

Polish. Align with 9.0.x/7.0.x
---
 java/org/apache/catalina/ContainerEvent.java |  5 ++---
 java/org/apache/catalina/Context.java|  6 +-
 java/org/apache/catalina/UserDatabase.java   | 32 +++-
 3 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/java/org/apache/catalina/ContainerEvent.java 
b/java/org/apache/catalina/ContainerEvent.java
index 31be8a8..b651356 100644
--- a/java/org/apache/catalina/ContainerEvent.java
+++ b/java/org/apache/catalina/ContainerEvent.java
@@ -16,7 +16,6 @@
  */
 package org.apache.catalina;
 
-
 import java.util.EventObject;
 
 /**
@@ -91,7 +90,7 @@ public final class ContainerEvent extends EventObject {
  */
 @Override
 public String toString() {
-return ("ContainerEvent['" + getContainer() + "','" +
-getType() + "','" + getData() + "']");
+return "ContainerEvent['" + getContainer() + "','" +
+getType() + "','" + getData() + "']";
 }
 }
diff --git a/java/org/apache/catalina/Context.java 
b/java/org/apache/catalina/Context.java
index 8471fa4..329fd2e 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -1415,6 +1415,7 @@ public interface Context extends Container, ContextBind {
  */
 public JspConfigDescriptor getJspConfigDescriptor();
 
+
 /**
  * Set the JspConfigDescriptor for this context.
  * A null value indicates there is not JSP configuration.
@@ -1423,6 +1424,7 @@ public interface Context extends Container, ContextBind {
  */
 public void setJspConfigDescriptor(JspConfigDescriptor descriptor);
 
+
 /**
  * Add a ServletContainerInitializer instance to this web application.
  *
@@ -1433,6 +1435,7 @@ public interface Context extends Container, ContextBind {
 public void addServletContainerInitializer(
 ServletContainerInitializer sci, Set> classes);
 
+
 /**
  * Is this Context paused whilst it is reloaded?
  *
@@ -1448,6 +1451,7 @@ public interface Context extends Container, ContextBind {
  */
 boolean isServlet22();
 
+
 /**
  * Notification that Servlet security has been dynamically set in a
  * {@link javax.servlet.ServletRegistration.Dynamic}
@@ -1503,7 +1507,7 @@ public interface Context extends Container, ContextBind {
 /**
  * @return The version of this web application, used to differentiate
  * different versions of the same web application when using parallel
- * deployment.
+ * deployment. If not specified, defaults to the empty string.
  */
 public String getWebappVersion();
 
diff --git a/java/org/apache/catalina/UserDatabase.java 
b/java/org/apache/catalina/UserDatabase.java
index 9a1a932..a76cfeb 100644
--- a/java/org/apache/catalina/UserDatabase.java
+++ b/java/org/apache/catalina/UserDatabase.java
@@ -14,29 +14,23 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina;
 
-
 import java.util.Iterator;
 
-
 /**
- * Abstract representation of a database of {@link User}s and
- * {@link Group}s that can be maintained by an application,
- * along with definitions of corresponding {@link Role}s, and
- * referenced by a {@link Realm} for authentication and access control.
+ * Abstract representation of a database of {@link User}s and {@link Group}s
+ * that can be maintained by an application, along with definitions of
+ * corresponding {@link Role}s, and referenced by a {@link Realm} for
+ * authentication and access control.
  *
  * @author Craig R. McClanahan
  * @since 4.1
  */
 public interface UserDatabase {
 
-
 // - Properties
 
-
 /**
  * @return the set of {@link Group}s defined in this user database.
  */
@@ -63,7 +57,6 @@ public interface UserDatabase {
 
 // - Public Methods
 
-
 /**
  * Finalize access to this user database.
  *
@@ -100,13 +93,12 @@ public interface UserDatabase {
  * @param fullName The full name of the new user
  * @return The new user
  */
-public User createUser(String username, String password,
-   String fullName);
+public User createUser(String username, String password, String fullName);
 
 
 /**
  * @return the {@link Group} with the specified group name, if any;
- * otherwise return null.
+ * otherwise return null.
  *
 

[tomcat] branch 7.0.x updated (aacd9cb -> 1917104)

2019-11-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from aacd9cb  Fix Javadoc warnings when building with Java 13
 new f873137  Javadoc fixes for building with Java 13
 new 1917104  Remove references to deprecated certificate class

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/CatalinaFactory.java  |   2 +
 java/org/apache/catalina/Container.java|  10 +-
 java/org/apache/catalina/ContainerEvent.java   |  37 ++--
 java/org/apache/catalina/ContainerServlet.java |  13 +-
 java/org/apache/catalina/Context.java  | 213 ++---
 java/org/apache/catalina/Engine.java   |  14 +-
 java/org/apache/catalina/Group.java|  20 +-
 java/org/apache/catalina/LifecycleEvent.java   |  39 +---
 java/org/apache/catalina/LifecycleState.java   |   7 +-
 java/org/apache/catalina/Loader.java   |  28 +--
 java/org/apache/catalina/Store.java|  13 +-
 java/org/apache/catalina/User.java |  14 +-
 java/org/apache/catalina/UserDatabase.java |  45 ++---
 java/org/apache/catalina/Wrapper.java  |  72 ---
 .../apache/tomcat/util/net/jsse/JSSESupport.java   |  24 ++-
 15 files changed, 286 insertions(+), 265 deletions(-)


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



[tomcat] 02/02: Remove references to deprecated certificate class

2019-11-12 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

commit 1917104e44425eac1703b4824d6cc5831214b19d
Author: Mark Thomas 
AuthorDate: Tue Nov 12 12:32:41 2019 +

Remove references to deprecated certificate class
---
 .../apache/tomcat/util/net/jsse/JSSESupport.java   | 24 ++
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/jsse/JSSESupport.java 
b/java/org/apache/tomcat/util/net/jsse/JSSESupport.java
index c9eb166..f9ed8e6 100644
--- a/java/org/apache/tomcat/util/net/jsse/JSSESupport.java
+++ b/java/org/apache/tomcat/util/net/jsse/JSSESupport.java
@@ -23,6 +23,7 @@ import java.io.InputStream;
 import java.net.SocketException;
 import java.security.cert.Certificate;
 import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
 import java.util.Map;
 import java.util.WeakHashMap;
 
@@ -31,7 +32,6 @@ import javax.net.ssl.HandshakeCompletedListener;
 import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSocket;
-import javax.security.cert.X509Certificate;
 
 import org.apache.tomcat.util.net.SSLSessionManager;
 import org.apache.tomcat.util.net.SSLSupport;
@@ -92,8 +92,7 @@ class JSSESupport implements SSLSupport, SSLSessionManager {
 return getPeerCertificateChain(false);
 }
 
-protected java.security.cert.X509Certificate [] getX509Certificates(
-SSLSession session) {
+protected X509Certificate[] getX509Certificates(SSLSession session) {
 Certificate [] certs=null;
 try {
 certs = session.getPeerCertificates();
@@ -103,12 +102,11 @@ class JSSESupport implements SSLSupport, 
SSLSessionManager {
 }
 if( certs==null ) return null;
 
-java.security.cert.X509Certificate [] x509Certs =
-new java.security.cert.X509Certificate[certs.length];
+X509Certificate [] x509Certs = new X509Certificate[certs.length];
 for(int i=0; i < certs.length; i++) {
-if (certs[i] instanceof java.security.cert.X509Certificate ) {
+if (certs[i] instanceof X509Certificate ) {
 // always currently true with the JSSE 1.1.x
-x509Certs[i] = (java.security.cert.X509Certificate) certs[i];
+x509Certs[i] = (X509Certificate) certs[i];
 } else {
 try {
 byte [] buffer = certs[i].getEncoded();
@@ -116,8 +114,7 @@ class JSSESupport implements SSLSupport, SSLSessionManager {
 CertificateFactory.getInstance("X.509");
 ByteArrayInputStream stream =
 new ByteArrayInputStream(buffer);
-x509Certs[i] = (java.security.cert.X509Certificate)
-cf.generateCertificate(stream);
+x509Certs[i] = (X509Certificate) 
cf.generateCertificate(stream);
 } catch(Exception ex) {
 log.info(sm.getString(
 "jseeSupport.certTranslationError", certs[i]), ex);
@@ -139,20 +136,21 @@ class JSSESupport implements SSLSupport, 
SSLSessionManager {
 if (session == null)
 return null;
 
-// Convert JSSE's certificate format to the ones we need
-X509Certificate [] jsseCerts = null;
+// Check to see if we already have the peer certificate chain
+Object[] jsseCerts = null;
 try {
-jsseCerts = session.getPeerCertificateChain();
+jsseCerts = session.getPeerCertificates();
 } catch(Exception bex) {
 // ignore.
 }
 if (jsseCerts == null)
-jsseCerts = new X509Certificate[0];
+jsseCerts = new Object[0];
 if(jsseCerts.length <= 0 && force && ssl != null) {
 session.invalidate();
 handShake();
 session = ssl.getSession();
 }
+// Obtain the certs in the format required by the spec
 return getX509Certificates(session);
 }
 


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



[tomcat] 01/02: Javadoc fixes for building with Java 13

2019-11-12 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

commit f87313772d1220116d2c1b832925fbb6a3db88f9
Author: Mark Thomas 
AuthorDate: Tue Nov 12 12:12:14 2019 +

Javadoc fixes for building with Java 13
---
 java/org/apache/catalina/CatalinaFactory.java  |   2 +
 java/org/apache/catalina/Container.java|  10 +-
 java/org/apache/catalina/ContainerEvent.java   |  37 ++---
 java/org/apache/catalina/ContainerServlet.java |  13 +-
 java/org/apache/catalina/Context.java  | 213 -
 java/org/apache/catalina/Engine.java   |  14 +-
 java/org/apache/catalina/Group.java|  20 +--
 java/org/apache/catalina/LifecycleEvent.java   |  39 +
 java/org/apache/catalina/LifecycleState.java   |   7 +-
 java/org/apache/catalina/Loader.java   |  28 ++--
 java/org/apache/catalina/Store.java|  13 +-
 java/org/apache/catalina/User.java |  14 +-
 java/org/apache/catalina/UserDatabase.java |  45 +++---
 java/org/apache/catalina/Wrapper.java  |  72 +
 14 files changed, 275 insertions(+), 252 deletions(-)

diff --git a/java/org/apache/catalina/CatalinaFactory.java 
b/java/org/apache/catalina/CatalinaFactory.java
index cf41033..3cf27bc 100644
--- a/java/org/apache/catalina/CatalinaFactory.java
+++ b/java/org/apache/catalina/CatalinaFactory.java
@@ -43,6 +43,8 @@ public class CatalinaFactory {
 }
 
 /**
+ * @return Name of default Pipeline implementation class
+ *
  * @deprecated Unused. Will be removed in Tomcat 8.0.x.
  */
 @Deprecated
diff --git a/java/org/apache/catalina/Container.java 
b/java/org/apache/catalina/Container.java
index 1ca34cc..970e1d0 100644
--- a/java/org/apache/catalina/Container.java
+++ b/java/org/apache/catalina/Container.java
@@ -133,7 +133,7 @@ public interface Container extends Lifecycle {
 // - Properties
 
 /**
- * Return descriptive information about this Container implementation and
+ * @return descriptive information about this Container implementation and
  * the corresponding version number, in the format
  * /.
  */
@@ -141,7 +141,7 @@ public interface Container extends Lifecycle {
 
 
 /**
- * Return the Loader with which this Container is associated.  If there is
+ * @return the Loader with which this Container is associated.  If there is
  * no associated Loader, return the Loader associated with our parent
  * Container (if any); otherwise, return null.
  */
@@ -167,7 +167,7 @@ public interface Container extends Lifecycle {
 
 
 /**
- * Return the Manager with which this Container is associated.  If there is
+ * @return the Manager with which this Container is associated.  If there 
is
  * no associated Manager, return the Manager associated with our parent
  * Container (if any); otherwise return null.
  */
@@ -183,7 +183,7 @@ public interface Container extends Lifecycle {
 
 
 /**
- * Return an object which may be utilized for mapping to this component.
+ * @return an object which may be utilized for mapping to this component.
  */
 @Deprecated
 public Object getMappingObject();
@@ -338,7 +338,7 @@ public interface Container extends Lifecycle {
 
 
 /**
- * Return the Resources with which this Container is associated.  If there
+ * @return Resources with which this Container is associated.  If there
  * is no associated Resources object, return the Resources associated with
  * our parent Container (if any); otherwise return null.
  */
diff --git a/java/org/apache/catalina/ContainerEvent.java 
b/java/org/apache/catalina/ContainerEvent.java
index f7cfaef..b651356 100644
--- a/java/org/apache/catalina/ContainerEvent.java
+++ b/java/org/apache/catalina/ContainerEvent.java
@@ -14,20 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina;
 
-
 import java.util.EventObject;
 
-
 /**
  * General event for notifying listeners of significant changes on a Container.
  *
  * @author Craig R. McClanahan
  */
-
 public final class ContainerEvent extends EventObject {
 
 private static final long serialVersionUID = 1L;
@@ -35,13 +30,13 @@ public final class ContainerEvent extends EventObject {
 /**
  * The event data associated with this event.
  */
-private Object data = null;
+private final Object data;
 
 
 /**
  * The event type this instance represents.
  */
-private String type = null;
+private final String type;
 
 
 /**
@@ -52,41 +47,41 @@ public final class ContainerEvent extends EventObject {
  * @param data Event data
  */
 public ContainerEvent(Container container, String type, Obje

[Bug 63916] org.apache.catalina.nonblocking.TestNonBlockingAPI abysmally slow with NIO/NIO2 on FreeBSD

2019-11-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63916

--- Comment #7 from Mark Thomas  ---
I'm starting to look at this.

How are you installing Java on FreeBSD? From the ports?

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



[tomcat] branch master updated: Add some debug to show buffering differences

2019-11-12 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new d09f468  Add some debug to show buffering differences
d09f468 is described below

commit d09f46896da11baba121628a67d3afe8a4bc0c8f
Author: remm 
AuthorDate: Tue Nov 12 16:13:43 2019 +0100

Add some debug to show buffering differences
---
 test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java | 4 
 1 file changed, 4 insertions(+)

diff --git a/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java 
b/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
index 042b6f3..7f16f26 100644
--- a/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
+++ b/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
@@ -192,11 +192,15 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
 int readSinceLastPause = 0;
 while (read != -1) {
 read = is.read(buffer);
+if (readSinceLastPause == 0) {
+log.info("Reading data");
+}
 if (read > 0) {
 result.append(buffer, 0, read);
 }
 readSinceLastPause += read;
 if (readSinceLastPause > WRITE_SIZE / 16) {
+log.info("Read " + readSinceLastPause + " bytes, pause 500ms");
 readSinceLastPause = 0;
 Thread.sleep(500);
 }


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



[Bug 63916] org.apache.catalina.nonblocking.TestNonBlockingAPI abysmally slow with NIO/NIO2 on FreeBSD

2019-11-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63916

--- Comment #8 from Mark Thomas  ---
I see some timing differences on Linux, but not as extreme.

For one test testNonBlockingWriteWithKeepAlive

NIO: 55s
APR:  8s

The NIO slowness is caused by the non-blocking write. The test does a large
write. There is then, essentially a loop where:
- non-blocking write (8k, the buffer size)
- add socket to poller
- wait for poller to signal write is possible

There is a delay of ~40ms in each loop iteration waiting for the poller.
10MB of data in 8k chunks with a 40ms delay per chunk = 51s.

Set socket.appWriteBufSize to 64k and the time for that test with NIO drops to
8s.

I don't see anything that would let us configure the Poller to react any
faster.

I want to use a Profiler to investigate that delay to see if it really does
happen in the Poller or if it is in the Tomcat code using the Poller.

I also want to run the test on FreeBSD to see if the delays you see have a
similar root cause. I'm guessing from the version number you aren't using Java
from ports but are using the AdoptOpenJDK for Linux builds.

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



[tomcat] branch master updated: Add more charsets to CharsetCache for the HPE JVM on HP-UX

2019-11-12 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo 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 47b0118  Add more charsets to CharsetCache for the HPE JVM on HP-UX
47b0118 is described below

commit 47b0118a46430b4d5e19b1caca6f917219f301d6
Author: Michael Osipov 
AuthorDate: Tue Nov 12 16:56:50 2019 +0100

Add more charsets to CharsetCache for the HPE JVM on HP-UX
---
 java/org/apache/tomcat/util/buf/CharsetCache.java | 4 +++-
 webapps/docs/changelog.xml| 4 
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/CharsetCache.java 
b/java/org/apache/tomcat/util/buf/CharsetCache.java
index 9234f07..2f09168 100644
--- a/java/org/apache/tomcat/util/buf/CharsetCache.java
+++ b/java/org/apache/tomcat/util/buf/CharsetCache.java
@@ -149,7 +149,9 @@ public class CharsetCache {
 "29626c", "833", "cp29626c", "ibm-1140", "ibm-1141", "ibm-1142", 
"ibm-1143", "ibm-1144", "ibm-1145",
 "ibm-1146", "ibm-1147", "ibm-1148", "ibm-1149", "ibm-29626c", 
"ibm-858", "ibm-eucjp", "ibm1140", "ibm1141",
 "ibm1142", "ibm1143", "ibm1144", "ibm1145", "ibm1146", "ibm1147", 
"ibm1148", "ibm1149", "ibm29626c",
-"ibm858", "x-ibm29626c"
+"ibm858", "x-ibm29626c",
+// Added from HPE JVM 1.8.0.17-hp-ux
+"cp1051", "cp1386", "cshproman8", "hp-roman8", "ibm-1051", "r8", 
"roman8", "roman9"
 };
 
 private static final Charset DUMMY_CHARSET = new DummyCharset("Dummy",  
null);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8a19840..08598fc 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -195,6 +195,10 @@
 63838: Suppress reflexive access warnings when running the
 unit tests on the command line. (markt)
   
+  
+Add missing charsets from the HPE JVM on HP-UX to pass unit tests in
+org.apache.tomcat.util.buf.TestCharsetCache. (michaelo)
+  
   
 Update the CXF module to Apache CXF 3.3.4. (remm)
   


-
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: Add more charsets to CharsetCache for the HPE JVM on HP-UX

2019-11-12 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo 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 83bae8a  Add more charsets to CharsetCache for the HPE JVM on HP-UX
83bae8a is described below

commit 83bae8a582fbcb0d3702a708f9cd68e86d94b6e4
Author: Michael Osipov 
AuthorDate: Tue Nov 12 16:56:50 2019 +0100

Add more charsets to CharsetCache for the HPE JVM on HP-UX
---
 java/org/apache/tomcat/util/buf/CharsetCache.java | 4 +++-
 webapps/docs/changelog.xml| 4 
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/CharsetCache.java 
b/java/org/apache/tomcat/util/buf/CharsetCache.java
index 9234f07..2f09168 100644
--- a/java/org/apache/tomcat/util/buf/CharsetCache.java
+++ b/java/org/apache/tomcat/util/buf/CharsetCache.java
@@ -149,7 +149,9 @@ public class CharsetCache {
 "29626c", "833", "cp29626c", "ibm-1140", "ibm-1141", "ibm-1142", 
"ibm-1143", "ibm-1144", "ibm-1145",
 "ibm-1146", "ibm-1147", "ibm-1148", "ibm-1149", "ibm-29626c", 
"ibm-858", "ibm-eucjp", "ibm1140", "ibm1141",
 "ibm1142", "ibm1143", "ibm1144", "ibm1145", "ibm1146", "ibm1147", 
"ibm1148", "ibm1149", "ibm29626c",
-"ibm858", "x-ibm29626c"
+"ibm858", "x-ibm29626c",
+// Added from HPE JVM 1.8.0.17-hp-ux
+"cp1051", "cp1386", "cshproman8", "hp-roman8", "ibm-1051", "r8", 
"roman8", "roman9"
 };
 
 private static final Charset DUMMY_CHARSET = new DummyCharset("Dummy",  
null);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9d99328..8a5e592 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -189,6 +189,10 @@
 63838: Suppress reflexive access warnings when running the
 unit tests on the command line. (markt)
   
+  
+Add missing charsets from the HPE JVM on HP-UX to pass unit tests in
+org.apache.tomcat.util.buf.TestCharsetCache. (michaelo)
+  
   
 Expand the coverage and quality of the French translations provided
 with Apache Tomcat. (remm)


-
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: Add more charsets to CharsetCache for the HPE JVM on HP-UX

2019-11-12 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo 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 deab644  Add more charsets to CharsetCache for the HPE JVM on HP-UX
deab644 is described below

commit deab6444187c4ccfa9a57e2e372d1934128d987a
Author: Michael Osipov 
AuthorDate: Tue Nov 12 16:56:50 2019 +0100

Add more charsets to CharsetCache for the HPE JVM on HP-UX
---
 java/org/apache/tomcat/util/buf/CharsetCache.java | 4 +++-
 webapps/docs/changelog.xml| 4 
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/CharsetCache.java 
b/java/org/apache/tomcat/util/buf/CharsetCache.java
index 193792b..49acca2 100644
--- a/java/org/apache/tomcat/util/buf/CharsetCache.java
+++ b/java/org/apache/tomcat/util/buf/CharsetCache.java
@@ -149,7 +149,9 @@ public class CharsetCache {
 "29626c", "833", "cp29626c", "ibm-1140", "ibm-1141", "ibm-1142", 
"ibm-1143", "ibm-1144", "ibm-1145",
 "ibm-1146", "ibm-1147", "ibm-1148", "ibm-1149", "ibm-29626c", 
"ibm-858", "ibm-eucjp", "ibm1140", "ibm1141",
 "ibm1142", "ibm1143", "ibm1144", "ibm1145", "ibm1146", "ibm1147", 
"ibm1148", "ibm1149", "ibm29626c",
-"ibm858", "x-ibm29626c"
+"ibm858", "x-ibm29626c",
+// Added from HPE JVM 1.8.0.17-hp-ux
+"cp1051", "cp1386", "cshproman8", "hp-roman8", "ibm-1051", "r8", 
"roman8", "roman9"
 };
 
 private static final Charset DUMMY_CHARSET = new DummyCharset("Dummy",  
null);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 200d248..1c33ced 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -174,6 +174,10 @@
 63838: Suppress reflexive access warnings when running the
 unit tests on the command line. (markt)
   
+  
+Add missing charsets from the HPE JVM on HP-UX to pass unit tests in
+org.apache.tomcat.util.buf.TestCharsetCache. (michaelo)
+  
   
 Expand the coverage and quality of the French translations provided
 with Apache Tomcat. (remm)


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



[Bug 63916] org.apache.catalina.nonblocking.TestNonBlockingAPI abysmally slow with NIO/NIO2 on FreeBSD

2019-11-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63916

--- Comment #9 from Michael Osipov  ---
(In reply to Mark Thomas from comment #8)
> I see some timing differences on Linux, but not as extreme.
> 
> For one test testNonBlockingWriteWithKeepAlive
> 
> NIO: 55s
> APR:  8s
> 
> The NIO slowness is caused by the non-blocking write. The test does a large
> write. There is then, essentially a loop where:
> - non-blocking write (8k, the buffer size)
> - add socket to poller
> - wait for poller to signal write is possible
> 
> There is a delay of ~40ms in each loop iteration waiting for the poller.
> 10MB of data in 8k chunks with a 40ms delay per chunk = 51s.
> 
> Set socket.appWriteBufSize to 64k and the time for that test with NIO drops
> to 8s.
> 
> I don't see anything that would let us configure the Poller to react any
> faster.
> 
> I want to use a Profiler to investigate that delay to see if it really does
> happen in the Poller or if it is in the Tomcat code using the Poller.

Thanks for looking into, but even on Linux, is that a sound difference? Why is
APR so much faster here?

> I also want to run the test on FreeBSD to see if the delays you see have a
> similar root cause. I'm guessing from the version number you aren't using
> Java from ports but are using the AdoptOpenJDK for Linux builds.

I am using OpenJDK straight from Ports which is a fork of AdoptOpenJDK: The
canonical fork for all BSDs: https://github.com/battleblow/

-- 
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 63867] Add option for reason phrase

2019-11-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63867

Nathan Clement  changed:

   What|Removed |Added

 CC||nclem...@yahoo.com

--- Comment #17 from Nathan Clement  ---
This is a plea for the Tomcat team to reconsider the practical implications of
this decision. I agree that the HTTP/1.1 spec says that the reason phrase can
be blank. However, the reality is that some clients are expecting that the
reason phrase will be present.

We operate a REST API and thousands of corporate/government clients connect to
our API. We know that some of these clients rely on the reason phrase, but we
have no way to determine how many. 

We currently use Tomcat 8.5, but we will need to upgrade to 9.0 at some point.
That upgrade will cause clients to break, and the clients will come to us and
demand that we "fix it". They won't accept arguments that it's good for them to
have to change their system. All they will see is that we upgraded our system
and their integration stopped working.

We don't use HTTP/2 so it's irrelevant that there's no reason phrase in that
version of the protocol.

The reason phrase is a feature of HTTP/1.1 and I don't see any downside for
Tomcat supporting it long term. Please add the flag to enable reason phrases
back into to Tomcat 9 and all future versions that support HTTP/1.1.

-- 
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 63916] org.apache.catalina.nonblocking.TestNonBlockingAPI abysmally slow with NIO/NIO2 on FreeBSD

2019-11-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63916

--- Comment #10 from Mark Thomas  ---
No, the Linux performance is not what I expect. There is something wrong here.
I'm going to build a simple test case to demonstrate it.

FreeBSD has the same issue but the pause before select() returns is longer so
the impact is greater.

I'm still not sure if this is a JRE bug or it is the way Tomcat is using the
API. I hope to be able to explore that in my test case.

-- 
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 63916] org.apache.catalina.nonblocking.TestNonBlockingAPI abysmally slow with NIO/NIO2 on FreeBSD

2019-11-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63916

--- Comment #11 from Mark Thomas  ---
Simpler test case that reproduces the issue

https://github.com/markt-asf/tomcat-bugs/blob/master/src/java/org/apache/tomcat/Bug63916NioPoller.java

Run the test case and connect with telnet to localhost 8080.
Uncomment the line that sets the send buffer to 8k and watch the time taken to
write the 10MB jump from ~400ms to ~50s.

Tomorrow's task is to experiment to see if I can figure out the root cause of
the time difference.

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