From 96e09e608c2119f5ea53f61d01149260ef8c480d Mon Sep 17 00:00:00 2001 From: JamesHillyard <73830120+JamesHillyard@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:10:42 +0100 Subject: [PATCH 01/22] Merge pull request #31 from JamesHillyard/FISH-376 FISH-376 Allow finer configuration details of HTTP GZIP compression --- .../grizzly/compression/zip/GZipEncoder.java | 11 ++++++- .../grizzly/http/GZipContentEncoding.java | 31 ++++++++++++++----- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java index dca092b84e..a2db37126b 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java @@ -43,6 +43,8 @@ public class GZipEncoder extends AbstractTransformer { private static final int TRAILER_SIZE = 8; private final int bufferSize; + private static int compressionLevel; + private static int compressionStrategy; private static final Buffer header; @@ -67,7 +69,13 @@ public GZipEncoder() { } public GZipEncoder(int bufferSize) { + this(bufferSize, Deflater.DEFAULT_COMPRESSION, Deflater.DEFAULT_STRATEGY); + } + + public GZipEncoder(int bufferSize, int compressionLevel, int compressionStrategy) { this.bufferSize = bufferSize; + this.compressionLevel = compressionLevel; + this.compressionStrategy = compressionStrategy; } /** @@ -283,7 +291,8 @@ protected static final class GZipOutputState extends LastResultAwareStateGZipContentEncoding using specific buffer sizes. - * + * * @param inBufferSize input buffer size * @param outBufferSize output buffer size */ @@ -59,17 +61,32 @@ public GZipContentEncoding(int inBufferSize, int outBufferSize) { } /** - * Construct GZipContentEncoding using specific buffer sizes. - * + * Construct GZipContentEncoding using specific buffer sizes, with default compression level and strategy. * @param inBufferSize input buffer size * @param outBufferSize output buffer size - * @param encoderFilter {@link EncodingFilter}, which will decide if GZipContentEncoding should be applied to - * encode specific {@link HttpHeader} packet. + * @param encoderFilter {@link EncodingFilter}, which will decide if + * GZipContentEncoding should be applied to encode specific + * {@link HttpHeader} packet. */ public GZipContentEncoding(int inBufferSize, int outBufferSize, EncodingFilter encoderFilter) { - this.decoder = new GZipDecoder(inBufferSize); - this.encoder = new GZipEncoder(outBufferSize); + this(inBufferSize, outBufferSize, Deflater.DEFAULT_COMPRESSION, Deflater.DEFAULT_STRATEGY, encoderFilter); + } + + /** + * Construct GZipContentEncoding using specific buffer sizes, compression level and strategy. + * @param inBufferSize input buffer size + * @param outBufferSize output buffer size + * @param compressionLevel the compression level used by the GZipEncoder + * @param compressionStrategy the compression strategy used by the GZipEncoder + * @param encoderFilter {@link EncodingFilter}, which will decide if + * GZipContentEncoding should be applied to encode specific + * {@link HttpHeader} packet. + */ + public GZipContentEncoding(int inBufferSize, int outBufferSize, int compressionLevel, int compressionStrategy, + EncodingFilter encoderFilter) { + this.decoder = new GZipDecoder(inBufferSize); + this.encoder = new GZipEncoder(outBufferSize, compressionLevel, compressionStrategy); if (encoderFilter != null) { this.encoderFilter = encoderFilter; } else { From 90634d9fd9140d1636465d37984293821570d295 Mon Sep 17 00:00:00 2001 From: JamesHillyard Date: Fri, 24 Jun 2022 17:45:12 +0100 Subject: [PATCH 02/22] Review comments --- .../glassfish/grizzly/compression/zip/GZipEncoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java index a2db37126b..49ecbed997 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java @@ -43,8 +43,8 @@ public class GZipEncoder extends AbstractTransformer { private static final int TRAILER_SIZE = 8; private final int bufferSize; - private static int compressionLevel; - private static int compressionStrategy; + private final int compressionLevel; + private final int compressionStrategy; private static final Buffer header; @@ -112,7 +112,7 @@ protected TransformationResult transformImpl(AttributeStorage st final GZipOutputState state = (GZipOutputState) obtainStateObject(storage); if (!state.isInitialized) { - state.initialize(); + state.initialize(compressionLevel, compressionStrategy); } Buffer encodedBuffer = null; @@ -290,7 +290,7 @@ protected static final class GZipOutputState extends LastResultAwareState Date: Thu, 7 Oct 2021 13:14:37 +0200 Subject: [PATCH 03/22] drop check on java version as java8 is a compile time requirement, the checks for jvm version before java7 makes no sense anymore. Remove unused JdkVersion class. Signed-off-by: Tigran Mkrtchyan --- .../org/glassfish/grizzly/sni/SNIFilter.java | 12 +- .../org/glassfish/grizzly/sni/SNITest.java | 13 +- .../nio/transport/UDPNIOConnection.java | 32 ++-- .../org/glassfish/grizzly/ssl/SSLFilter.java | 7 +- .../glassfish/grizzly/utils/JdkVersion.java | 146 ------------------ .../server/ServerFilterConfiguration.java | 11 +- .../samples/udpmulticast/MulticastChat.java | 11 +- 7 files changed, 23 insertions(+), 209 deletions(-) delete mode 100644 modules/grizzly/src/main/java/org/glassfish/grizzly/utils/JdkVersion.java diff --git a/extras/tls-sni/src/main/java/org/glassfish/grizzly/sni/SNIFilter.java b/extras/tls-sni/src/main/java/org/glassfish/grizzly/sni/SNIFilter.java index cf1346c650..88649ead03 100644 --- a/extras/tls-sni/src/main/java/org/glassfish/grizzly/sni/SNIFilter.java +++ b/extras/tls-sni/src/main/java/org/glassfish/grizzly/sni/SNIFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -38,7 +38,6 @@ import org.glassfish.grizzly.ssl.SSLEngineConfigurator; import org.glassfish.grizzly.ssl.SSLFilter; import org.glassfish.grizzly.utils.Charsets; -import org.glassfish.grizzly.utils.JdkVersion; /** * TLS Server Name Indication (SNI) {@link Filter} implementation. This filter supports SNI extension on both client and @@ -57,7 +56,6 @@ */ public class SNIFilter extends SSLFilter { private static final Logger LOGGER = Grizzly.logger(SNIFilter.class); - private static final boolean JDK7_OR_HIGHER = JdkVersion.getJdkVersion().compareTo(JdkVersion.parseVersion("1.7")) >= 0; private static final byte HANDSHAKE_TYPE = 0x16; private static final int MIN_TLS_VERSION = 0x0301; @@ -125,10 +123,6 @@ public SNIClientConfigResolver getClientSSLConfigResolver() { * @param resolver */ public void setClientSSLConfigResolver(final SNIClientConfigResolver resolver) { - if (!JDK7_OR_HIGHER) { - LOGGER.warning("Client side SNI support requires JDK 1.7+"); - } - this.clientResolver = resolver; } @@ -141,10 +135,6 @@ protected SSLTransportFilterWrapper createOptimizedTransportFilter(final Transpo @Override public NextAction handleConnect(final FilterChainContext ctx) throws IOException { - if (!JDK7_OR_HIGHER) { - return super.handleConnect(ctx); - } - // new client-side connection final Connection c = ctx.getConnection(); diff --git a/extras/tls-sni/src/test/java/org/glassfish/grizzly/sni/SNITest.java b/extras/tls-sni/src/test/java/org/glassfish/grizzly/sni/SNITest.java index 2f647d4420..46b9ec7a54 100644 --- a/extras/tls-sni/src/test/java/org/glassfish/grizzly/sni/SNITest.java +++ b/extras/tls-sni/src/test/java/org/glassfish/grizzly/sni/SNITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -34,7 +34,6 @@ import org.glassfish.grizzly.ssl.SSLContextConfigurator; import org.glassfish.grizzly.ssl.SSLEngineConfigurator; import org.glassfish.grizzly.utils.Futures; -import org.glassfish.grizzly.utils.JdkVersion; import org.glassfish.grizzly.utils.StringFilter; import org.junit.Test; @@ -48,9 +47,7 @@ @SuppressWarnings("unchecked") public class SNITest { public static final int PORT = 19283; - private static final boolean JDK7_OR_HIGHER = JdkVersion.getJdkVersion() - .compareTo(JdkVersion.parseVersion("1.7")) >= 0; - + @Test public void testClientServerSNI() throws Exception { final String sniHostValue = "sni-test.com"; @@ -58,11 +55,7 @@ public void testClientServerSNI() throws Exception { final Attribute sniHostAttr = Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute("sni-host-attr"); - - if (!JDK7_OR_HIGHER) { - return; - } - + final SSLEngineConfigurator sslServerEngineConfig = new SSLEngineConfigurator( createSSLContextConfigurator().createSSLContext(), diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOConnection.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOConnection.java index e5aa6ea35a..b7f9b73495 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOConnection.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -42,7 +42,6 @@ import org.glassfish.grizzly.nio.SelectorRunner; import org.glassfish.grizzly.utils.Exceptions; import org.glassfish.grizzly.utils.Holder; -import org.glassfish.grizzly.utils.JdkVersion; import org.glassfish.grizzly.utils.NullaryFunction; /** @@ -65,28 +64,25 @@ public class UDPNIOConnection extends NIOConnection { private static final Method MK_UNBLOCK_METHOD; static { - JdkVersion jdkVersion = JdkVersion.getJdkVersion(); - JdkVersion minimumVersion = JdkVersion.parseVersion("1.7.0"); boolean isInitialized = false; Method join = null, joinWithSource = null, mkGetNetworkInterface = null, mkGetSourceAddress = null, mkDrop = null, mkBlock = null, mkUnblock = null; - if (minimumVersion.compareTo(jdkVersion) <= 0) { // If JDK version is >= 1.7 - try { - join = DatagramChannel.class.getMethod("join", InetAddress.class, NetworkInterface.class); - joinWithSource = DatagramChannel.class.getMethod("join", InetAddress.class, NetworkInterface.class, InetAddress.class); - final Class membershipKeyClass = loadClass("java.nio.channels.MembershipKey"); + try { + join = DatagramChannel.class.getMethod("join", InetAddress.class, NetworkInterface.class); + joinWithSource = DatagramChannel.class.getMethod("join", InetAddress.class, NetworkInterface.class, InetAddress.class); - mkGetNetworkInterface = membershipKeyClass.getDeclaredMethod("networkInterface"); - mkGetSourceAddress = membershipKeyClass.getDeclaredMethod("sourceAddress"); - mkDrop = membershipKeyClass.getDeclaredMethod("drop"); + final Class membershipKeyClass = loadClass("java.nio.channels.MembershipKey"); - mkBlock = membershipKeyClass.getDeclaredMethod("block", InetAddress.class); - mkUnblock = membershipKeyClass.getDeclaredMethod("unblock", InetAddress.class); - isInitialized = true; - } catch (Throwable t) { - LOGGER.log(Level.WARNING, LogMessages.WARNING_GRIZZLY_CONNECTION_UDPMULTICASTING_EXCEPTIONE(), t); - } + mkGetNetworkInterface = membershipKeyClass.getDeclaredMethod("networkInterface"); + mkGetSourceAddress = membershipKeyClass.getDeclaredMethod("sourceAddress"); + mkDrop = membershipKeyClass.getDeclaredMethod("drop"); + + mkBlock = membershipKeyClass.getDeclaredMethod("block", InetAddress.class); + mkUnblock = membershipKeyClass.getDeclaredMethod("unblock", InetAddress.class); + isInitialized = true; + } catch (Throwable t) { + LOGGER.log(Level.WARNING, LogMessages.WARNING_GRIZZLY_CONNECTION_UDPMULTICASTING_EXCEPTIONE(), t); } if (isInitialized) { diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/ssl/SSLFilter.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/ssl/SSLFilter.java index 85f098c794..bbe7cd9fb9 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/ssl/SSLFilter.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/ssl/SSLFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -42,7 +42,6 @@ import org.glassfish.grizzly.filterchain.FilterChainContext.Operation; import org.glassfish.grizzly.filterchain.NextAction; import org.glassfish.grizzly.utils.Exceptions; -import org.glassfish.grizzly.utils.JdkVersion; /** * SSL {@link Filter} to operate with SSL encrypted data. @@ -51,7 +50,6 @@ */ public class SSLFilter extends SSLBaseFilter { private static final Logger LOGGER = Grizzly.logger(SSLFilter.class); - private static final boolean IS_JDK7_OR_HIGHER = JdkVersion.getJdkVersion().compareTo("1.7.0") >= 0; private final Attribute handshakeContextAttr; private final SSLEngineConfigurator clientSSLEngineConfigurator; @@ -268,8 +266,7 @@ protected Buffer doHandshakeStep(final SSLConnectionContext sslCtx, final Filter protected SSLEngine createClientSSLEngine(final SSLConnectionContext sslCtx, final SSLEngineConfigurator sslEngineConfigurator) { - return IS_JDK7_OR_HIGHER ? sslEngineConfigurator.createSSLEngine(HostNameResolver.getPeerHostName(sslCtx.getConnection()), -1) - : sslEngineConfigurator.createSSLEngine(); + return sslEngineConfigurator.createSSLEngine(HostNameResolver.getPeerHostName(sslCtx.getConnection()), -1); } // ----------------------------------------------------------- Inner Classes diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/JdkVersion.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/JdkVersion.java deleted file mode 100644 index b60472746b..0000000000 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/JdkVersion.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.grizzly.utils; - -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.glassfish.grizzly.Grizzly; - -/** - * - * @since 2.2.11 - */ -public class JdkVersion implements Comparable { - private static final Logger LOGGER = Grizzly.logger(JdkVersion.class); - - // take max 4 parts of the JDK version and cut the rest (usually the build number) - private static final Pattern VERSION_PATTERN = Pattern.compile("([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?([_\\.]([0-9]+))?.*"); - - private static final JdkVersion UNKNOWN_VERSION = new JdkVersion(-1, -1, -1, -1); - private static final JdkVersion JDK_VERSION = parseVersion(System.getProperty("java.version")); - - private final int major; - private final int minor; - private final int maintenance; - private final int update; - - // ------------------------------------------------------------ Constructors - - private JdkVersion(final int major, final int minor, final int maintenance, final int update) { - this.major = major; - this.minor = minor; - this.maintenance = maintenance; - this.update = update; - } - - // ---------------------------------------------------------- Public Methods - - public static JdkVersion parseVersion(final String versionString) { - - try { - final Matcher matcher = VERSION_PATTERN.matcher(versionString); - if (matcher.matches()) { - return new JdkVersion(parseInt(matcher.group(1)), parseInt(matcher.group(3)), parseInt(matcher.group(5)), parseInt(matcher.group(7))); - } - - LOGGER.log(Level.FINE, "Can't parse the JDK version {0}", versionString); - - } catch (Exception e) { - LOGGER.log(Level.FINE, "Error parsing the JDK version " + versionString, e); - } - - return UNKNOWN_VERSION; - } - - public static JdkVersion getJdkVersion() { - return JDK_VERSION; - } - - @SuppressWarnings("UnusedDeclaration") - public int getMajor() { - return major; - } - - @SuppressWarnings("UnusedDeclaration") - public int getMinor() { - return minor; - } - - @SuppressWarnings("UnusedDeclaration") - public int getMaintenance() { - return maintenance; - } - - @SuppressWarnings("UnusedDeclaration") - public int getUpdate() { - return update; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("JdkVersion"); - sb.append("{major=").append(major); - sb.append(", minor=").append(minor); - sb.append(", maintenance=").append(maintenance); - sb.append(", update=").append(update); - sb.append('}'); - return sb.toString(); - } - - // ------------------------------------------------- Methods from Comparable - - public int compareTo(String versionString) { - return compareTo(JdkVersion.parseVersion(versionString)); - } - - @Override - public int compareTo(JdkVersion otherVersion) { - if (major < otherVersion.major) { - return -1; - } - if (major > otherVersion.major) { - return 1; - } - if (minor < otherVersion.minor) { - return -1; - } - if (minor > otherVersion.minor) { - return 1; - } - if (maintenance < otherVersion.maintenance) { - return -1; - } - if (maintenance > otherVersion.maintenance) { - return 1; - } - if (update < otherVersion.update) { - return -1; - } - if (update > otherVersion.update) { - return 1; - } - return 0; - } - - private static int parseInt(final String s) { - return s != null ? Integer.parseInt(s) : 0; - } -} diff --git a/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/ServerFilterConfiguration.java b/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/ServerFilterConfiguration.java index 21a7d3729c..0050d8d302 100644 --- a/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/ServerFilterConfiguration.java +++ b/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/ServerFilterConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,7 +19,6 @@ import java.nio.charset.Charset; import org.glassfish.grizzly.Grizzly; -import org.glassfish.grizzly.utils.JdkVersion; /** * {@link HttpServerFilter} configuration. @@ -482,7 +481,7 @@ public void setSessionManager(SessionManager sessionManager) { private void configureSendFileSupport() { - if (System.getProperty("os.name").equalsIgnoreCase("linux") && !linuxSendFileSupported() || System.getProperty("os.name").equalsIgnoreCase("HP-UX")) { + if (System.getProperty("os.name").equalsIgnoreCase("HP-UX")) { sendFileEnabled = false; } @@ -493,10 +492,4 @@ private void configureSendFileSupport() { } - private static boolean linuxSendFileSupported() { - JdkVersion jdkVersion = JdkVersion.getJdkVersion(); - JdkVersion minimumVersion = JdkVersion.parseVersion("1.6.0_18"); - return minimumVersion.compareTo(jdkVersion) <= 0; - } - } diff --git a/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/udpmulticast/MulticastChat.java b/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/udpmulticast/MulticastChat.java index 2d4857d566..4bb5804b02 100644 --- a/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/udpmulticast/MulticastChat.java +++ b/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/udpmulticast/MulticastChat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -25,7 +25,6 @@ import org.glassfish.grizzly.nio.transport.UDPNIOConnection; import org.glassfish.grizzly.nio.transport.UDPNIOTransport; import org.glassfish.grizzly.nio.transport.UDPNIOTransportBuilder; -import org.glassfish.grizzly.utils.JdkVersion; import org.glassfish.grizzly.utils.StringFilter; /** @@ -96,14 +95,6 @@ public static void main(String[] args) throws Exception { } private void run() throws Exception { - // Check if current JDK version is higher or equals to 1.7.0 - final JdkVersion jdkVersion = JdkVersion.getJdkVersion(); - final JdkVersion minimumVersion = JdkVersion.parseVersion("1.7.0"); - - if (minimumVersion.compareTo(jdkVersion) > 0) { // If JDK version is >= 1.7 - System.out.println("Sample requires JDK 1.7+"); - System.exit(1); - } // Build FilterChain to parse incoming UDP packets and print to System.out final FilterChain filterChain = FilterChainBuilder.stateless() From 7454db6e4cedf3c68b011055eafdc0deedebd1f1 Mon Sep 17 00:00:00 2001 From: Jonathan Leitschuh Date: Sat, 19 Nov 2022 02:03:39 +0000 Subject: [PATCH 04/22] vuln-fix: Temporary File Information Disclosure This fixes temporary file information disclosure vulnerability due to the use of the vulnerable `File.createTempFile()` method. The vulnerability is fixed by using the `Files.createTempFile()` method which sets the correct posix permissions. Weakness: CWE-377: Insecure Temporary File Severity: Medium CVSSS: 5.5 Detection: CodeQL & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.SecureTempFileCreation) Reported-by: Jonathan Leitschuh Signed-off-by: Jonathan Leitschuh Bug-tracker: https://github.com/JLLeitschuh/security-research/issues/18 Co-authored-by: Moderne --- .../test/java/org/glassfish/grizzly/FileTransferTest.java | 7 ++++--- .../glassfish/grizzly/http/server/filecache/FileCache.java | 3 ++- .../org/glassfish/grizzly/http/server/FileCacheTest.java | 3 ++- .../org/glassfish/grizzly/http/server/SendFileTest.java | 3 ++- .../grizzly/http/server/StaticHttpHandlerTest.java | 2 +- .../java/org/glassfish/grizzly/http2/FileCacheTest.java | 3 ++- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/grizzly/src/test/java/org/glassfish/grizzly/FileTransferTest.java b/modules/grizzly/src/test/java/org/glassfish/grizzly/FileTransferTest.java index a2431b3c74..c86e6058b5 100644 --- a/modules/grizzly/src/test/java/org/glassfish/grizzly/FileTransferTest.java +++ b/modules/grizzly/src/test/java/org/glassfish/grizzly/FileTransferTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.math.BigInteger; import java.nio.ByteBuffer; +import java.nio.file.Files; import java.security.MessageDigest; import java.util.Random; import java.util.concurrent.TimeUnit; @@ -69,7 +70,7 @@ public NextAction handleRead(FilterChainContext ctx) throws IOException { TCPNIOTransport client = TCPNIOTransportBuilder.newInstance().build(); FilterChainBuilder clientChain = FilterChainBuilder.stateless(); final SafeFutureImpl future = SafeFutureImpl.create(); - final File temp = File.createTempFile("grizzly-download-", ".tmp"); + final File temp = Files.createTempFile("grizzly-download-", ".tmp").toFile(); temp.deleteOnExit(); final FileOutputStream out = new FileOutputStream(temp); final AtomicInteger total = new AtomicInteger(0); @@ -140,7 +141,7 @@ public void negativeFileTransferAPITest() throws Exception { fail("Unexpected exception type: " + e); } - f = File.createTempFile("grizzly-test-", ".tmp"); + f = Files.createTempFile("grizzly-test-", ".tmp").toFile(); f.deleteOnExit(); new FileOutputStream(f).write(1); @@ -195,7 +196,7 @@ private static BigInteger getMDSum(final File f) throws Exception { } private static File generateTempFile(final int size) throws IOException { - final File f = File.createTempFile("grizzly-temp-" + size, ".tmp"); + final File f = Files.createTempFile("grizzly-temp-" + size, ".tmp").toFile(); Random r = new Random(); byte[] data = new byte[8192]; r.nextBytes(data); diff --git a/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/filecache/FileCache.java b/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/filecache/FileCache.java index 9ba56eb32a..81a505e906 100644 --- a/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/filecache/FileCache.java +++ b/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/filecache/FileCache.java @@ -25,6 +25,7 @@ import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; +import java.nio.file.Files; import java.util.StringTokenizer; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -599,7 +600,7 @@ public void setFileSendEnabled(boolean fileSendEnabled) { */ protected void compressFile(final FileCacheEntry entry) { try { - final File tmpCompressedFile = File.createTempFile(String.valueOf(entry.plainFile.hashCode()), ".tmpzip", compressedFilesFolder); + final File tmpCompressedFile = Files.createTempFile(compressedFilesFolder.toPath(), String.valueOf(entry.plainFile.hashCode()), ".tmpzip").toFile(); tmpCompressedFile.deleteOnExit(); InputStream in = null; diff --git a/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/FileCacheTest.java b/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/FileCacheTest.java index 9502bf7cbf..06456a5719 100644 --- a/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/FileCacheTest.java +++ b/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/FileCacheTest.java @@ -28,6 +28,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; +import java.nio.file.Files; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Calendar; @@ -965,7 +966,7 @@ private static String convertToDate(final long date) { } private static File createTempFile() throws IOException { - final File f = File.createTempFile("grizzly-file-cache", ".txt"); + final File f = Files.createTempFile("grizzly-file-cache", ".txt").toFile(); f.deleteOnExit(); FileOutputStream out = null; try { diff --git a/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/SendFileTest.java b/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/SendFileTest.java index 092af15fba..4ceef994cf 100644 --- a/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/SendFileTest.java +++ b/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/SendFileTest.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.math.BigInteger; import java.nio.channels.FileChannel; +import java.nio.file.Files; import java.security.MessageDigest; import java.util.Random; import java.util.concurrent.Executors; @@ -558,7 +559,7 @@ private static File generateTempFile(final int size) throws IOException { } private static File generateTempFile(final int size, final String ext) throws IOException { - final File f = File.createTempFile("grizzly-temp-" + size, "." + ext); + final File f = Files.createTempFile("grizzly-temp-" + size, "." + ext).toFile(); Random r = new Random(); byte[] data = new byte[8192]; r.nextBytes(data); diff --git a/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/StaticHttpHandlerTest.java b/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/StaticHttpHandlerTest.java index 0d22a05318..7865a8097e 100644 --- a/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/StaticHttpHandlerTest.java +++ b/modules/http-server/src/test/java/org/glassfish/grizzly/http/server/StaticHttpHandlerTest.java @@ -319,7 +319,7 @@ private static String getSystemTmpDir() { } private static File generateTempFile(final int size) throws IOException { - final File f = File.createTempFile("grizzly-temp-" + size, ".tmp2"); + final File f = Files.createTempFile("grizzly-temp-" + size, ".tmp2").toFile(); Random r = new Random(); byte[] data = new byte[8192]; r.nextBytes(data); diff --git a/modules/http2/src/test/java/org/glassfish/grizzly/http2/FileCacheTest.java b/modules/http2/src/test/java/org/glassfish/grizzly/http2/FileCacheTest.java index d694a0e0f9..91df6eeaf6 100644 --- a/modules/http2/src/test/java/org/glassfish/grizzly/http2/FileCacheTest.java +++ b/modules/http2/src/test/java/org/glassfish/grizzly/http2/FileCacheTest.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.Writer; +import java.nio.file.Files; import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Date; @@ -400,7 +401,7 @@ private static String convertToDate(final long date) { } private static File createTempFile() throws IOException { - final File f = File.createTempFile("grizzly-file-cache", ".txt"); + final File f = Files.createTempFile("grizzly-file-cache", ".txt").toFile(); f.deleteOnExit(); FileOutputStream out = null; try { From 2e9ad863fc936766b72688c1cc9f2b1a1490678a Mon Sep 17 00:00:00 2001 From: Tigran Mkrtchyan Date: Tue, 6 Dec 2022 23:37:47 +0100 Subject: [PATCH 05/22] utils: remove unused version of ThreadLocalRandom the rest of the code uses java.util.concurrent.ThreadLocalRandom. Thus no reasons tho have a private unused copy ot it. --- .../grizzly/utils/ThreadLocalRandom.java | 204 ------------------ 1 file changed, 204 deletions(-) delete mode 100644 modules/grizzly/src/main/java/org/glassfish/grizzly/utils/ThreadLocalRandom.java diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/ThreadLocalRandom.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/ThreadLocalRandom.java deleted file mode 100644 index f5ade07e4a..0000000000 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/ThreadLocalRandom.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -/* - * Written by Doug Lea with assistance from members of JCP JSR-166 - * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/publicdomain/zero/1.0/ - */ -package org.glassfish.grizzly.utils; - -import java.util.Random; -import java.util.concurrent.ForkJoinTask; - -/** - * A random number generator isolated to the current thread. Like the global {@link java.util.Random} generator used by - * the {@link java.lang.Math} class, a {@code ThreadLocalRandom} is initialized with an internally generated seed that - * may not otherwise be modified. When applicable, use of {@code ThreadLocalRandom} rather than shared {@code Random} - * objects in concurrent programs will typically encounter much less overhead and contention. Use of - * {@code ThreadLocalRandom} is particularly appropriate when multiple tasks (for example, each a {@link ForkJoinTask}) - * use random numbers in parallel in thread pools. - * - *

- * Usages of this class should typically be of the form: {@code ThreadLocalRandom.current().nextX(...)} (where {@code X} - * is {@code Int}, {@code Long}, etc). When all usages are of this form, it is never possible to accidently share a - * {@code ThreadLocalRandom} across multiple threads. - * - *

- * This class also provides additional commonly used bounded random generation methods. - * - * @author Doug Lea - */ -class ThreadLocalRandom extends Random { - // same constants as Random, but must be redeclared because private - private static final long multiplier = 0x5DEECE66DL; - private static final long addend = 0xBL; - private static final long mask = (1L << 48) - 1; - - /** - * The random seed. We can't use super.seed. - */ - private long rnd; - - /** - * Initialization flag to permit calls to setSeed to succeed only while executing the Random constructor. We can't allow - * others since it would cause setting seed in one part of a program to unintentionally impact other usages by the - * thread. - */ - final boolean initialized; - - // Padding to help avoid memory contention among seed updates in - // different TLRs in the common case that they are located near - // each other. - private long pad0, pad1, pad2, pad3, pad4, pad5, pad6, pad7; - - /** - * The actual ThreadLocal - */ - private static final ThreadLocal localRandom = new ThreadLocal() { - @Override - protected ThreadLocalRandom initialValue() { - return new ThreadLocalRandom(); - } - }; - - /** - * Constructor called only by localRandom.initialValue. - */ - ThreadLocalRandom() { - super(); - initialized = true; - } - - /** - * Returns the current thread's {@code ThreadLocalRandom}. - * - * @return the current thread's {@code ThreadLocalRandom} - */ - public static ThreadLocalRandom current() { - return localRandom.get(); - } - - /** - * Throws {@code UnsupportedOperationException}. Setting seeds in this generator is not supported. - * - * @throws UnsupportedOperationException always - */ - @Override - public void setSeed(long seed) { - if (initialized) { - throw new UnsupportedOperationException(); - } - rnd = (seed ^ multiplier) & mask; - } - - @Override - protected int next(int bits) { - rnd = rnd * multiplier + addend & mask; - return (int) (rnd >>> 48 - bits); - } - - /** - * Returns a pseudorandom, uniformly distributed value between the given least value (inclusive) and bound (exclusive). - * - * @param least the least value returned - * @param bound the upper bound (exclusive) - * @return the next value - * @throws IllegalArgumentException if least greater than or equal to bound - */ - public int nextInt(int least, int bound) { - if (least >= bound) { - throw new IllegalArgumentException(); - } - return nextInt(bound - least) + least; - } - - /** - * Returns a pseudorandom, uniformly distributed value between 0 (inclusive) and the specified value (exclusive). - * - * @param n the bound on the random number to be returned. Must be positive. - * @return the next value - * @throws IllegalArgumentException if n is not positive - */ - public long nextLong(long n) { - if (n <= 0) { - throw new IllegalArgumentException("n must be positive"); - } - // Divide n by two until small enough for nextInt. On each - // iteration (at most 31 of them but usually much less), - // randomly choose both whether to include high bit in result - // (offset) and whether to continue with the lower vs upper - // half (which makes a difference only if odd). - long offset = 0; - while (n >= Integer.MAX_VALUE) { - int bits = next(2); - long half = n >>> 1; - long nextn = (bits & 2) == 0 ? half : n - half; - if ((bits & 1) == 0) { - offset += n - nextn; - } - n = nextn; - } - return offset + nextInt((int) n); - } - - /** - * Returns a pseudorandom, uniformly distributed value between the given least value (inclusive) and bound (exclusive). - * - * @param least the least value returned - * @param bound the upper bound (exclusive) - * @return the next value - * @throws IllegalArgumentException if least greater than or equal to bound - */ - public long nextLong(long least, long bound) { - if (least >= bound) { - throw new IllegalArgumentException(); - } - return nextLong(bound - least) + least; - } - - /** - * Returns a pseudorandom, uniformly distributed {@code double} value between 0 (inclusive) and the specified value - * (exclusive). - * - * @param n the bound on the random number to be returned. Must be positive. - * @return the next value - * @throws IllegalArgumentException if n is not positive - */ - public double nextDouble(double n) { - if (n <= 0) { - throw new IllegalArgumentException("n must be positive"); - } - return nextDouble() * n; - } - - /** - * Returns a pseudorandom, uniformly distributed value between the given least value (inclusive) and bound (exclusive). - * - * @param least the least value returned - * @param bound the upper bound (exclusive) - * @return the next value - * @throws IllegalArgumentException if least greater than or equal to bound - */ - public double nextDouble(double least, double bound) { - if (least >= bound) { - throw new IllegalArgumentException(); - } - return nextDouble() * (bound - least) + least; - } - - private static final long serialVersionUID = -5851777807851030925L; -} From cb5fdde0fc748f09efb5d9863cf4d1ee20f59fdc Mon Sep 17 00:00:00 2001 From: Tigran Mkrtchyan Date: Wed, 7 Dec 2022 11:45:21 +0100 Subject: [PATCH 06/22] src: drop NullaryFunction in favor or java.util.Supplier The NullaryFunction has an equivalent in standard java API. So, lets use it. --- .../org/glassfish/grizzly/Connection.java | 4 +-- .../grizzly/attributes/Attribute.java | 16 ++++----- .../grizzly/attributes/AttributeBuilder.java | 17 +++------ .../grizzly/attributes/AttributeHolder.java | 4 +-- .../attributes/DefaultAttributeBuilder.java | 15 ++------ .../attributes/IndexedAttributeAccessor.java | 6 ++-- .../attributes/IndexedAttributeHolder.java | 12 +++---- .../grizzly/attributes/NullaryFunction.java | 33 ----------------- .../attributes/UnsafeAttributeHolder.java | 14 ++++---- .../filterchain/DefaultFilterChain.java | 6 ++-- .../glassfish/grizzly/nio/NIOConnection.java | 18 +++++----- .../nio/transport/TCPNIOConnection.java | 10 +++--- .../nio/transport/TCPNIOServerConnection.java | 6 ++-- .../nio/transport/UDPNIOConnection.java | 10 +++--- .../grizzly/utils/ActivityCheckFilter.java | 5 +-- .../org/glassfish/grizzly/utils/Holder.java | 10 +++--- .../grizzly/utils/IdleTimeoutFilter.java | 5 +-- .../grizzly/utils/NullaryFunction.java | 35 ------------------- .../org/glassfish/grizzly/AttributesTest.java | 6 ++-- .../glassfish/grizzly/FilterChainTest.java | 6 ++-- .../org/glassfish/grizzly/TestDefaults.java | 9 ++--- .../grizzly/http/ajp/AjpMessageFilter.java | 6 ++-- .../http/ajp/AjpClientMessageFilter.java | 6 ++-- .../glassfish/grizzly/http2/Http2Session.java | 4 +-- .../grizzly/portunif/AsyncPUTest.java | 10 +++--- 25 files changed, 92 insertions(+), 181 deletions(-) delete mode 100644 modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/NullaryFunction.java delete mode 100644 modules/grizzly/src/main/java/org/glassfish/grizzly/utils/NullaryFunction.java diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/Connection.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/Connection.java index fb8a9ce7fa..ee537db008 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/Connection.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/Connection.java @@ -21,11 +21,11 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import org.glassfish.grizzly.attributes.AttributeStorage; import org.glassfish.grizzly.memory.MemoryManager; import org.glassfish.grizzly.monitoring.MonitoringAware; import org.glassfish.grizzly.monitoring.MonitoringConfig; -import org.glassfish.grizzly.utils.NullaryFunction; /** * Common interface, which represents any kind of connection. @@ -152,7 +152,7 @@ public interface Connection extends Readable, Writeable, Closeable, Att * * @return the {@link Processor} state associated with this Connection. */ - E obtainProcessorState(Processor processor, NullaryFunction factory); + E obtainProcessorState(Processor processor, Supplier factory); /** * Executes the {@link Runnable} in the thread, responsible for running the given type of event on this diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/Attribute.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/Attribute.java index 6576c1c13d..147c134b03 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/Attribute.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/Attribute.java @@ -16,7 +16,7 @@ package org.glassfish.grizzly.attributes; -import org.glassfish.grizzly.utils.NullaryFunction; +import java.util.function.Supplier; /** * Class used to define dynamic typed attributes on {@link AttributeHolder} instances. Storing attribute values in @@ -38,7 +38,7 @@ public final class Attribute { /** * Attribute initializer, which will be called, if attribute is not set. */ - private final NullaryFunction initializer; + private final Supplier initializer; /** * Attribute index in AttributeBuilder */ @@ -50,16 +50,16 @@ public String toString() { } protected Attribute(final AttributeBuilder builder, final String name, final int index, final T defaultValue) { - this(builder, name, index, new NullaryFunction() { + this(builder, name, index, new Supplier() { @Override - public T evaluate() { + public T get() { return defaultValue; } }); } - protected Attribute(final AttributeBuilder builder, final String name, final int index, final NullaryFunction initializer) { + protected Attribute(final AttributeBuilder builder, final String name, final int index, final Supplier initializer) { this.builder = builder; this.name = name; this.attributeIndex = index; @@ -68,7 +68,7 @@ protected Attribute(final AttributeBuilder builder, final String name, final int /** * Get attribute value, stored on the {@link AttributeHolder}, the difference from - * {@link #get(org.glassfish.grizzly.attributes.AttributeHolder)} is that default value or {@link NullaryFunction} won't + * {@link #get(org.glassfish.grizzly.attributes.AttributeHolder)} is that default value or {@link Supplier} won't * be invoked. * * @param attributeHolder {@link AttributeHolder}. @@ -80,7 +80,7 @@ public T peek(final AttributeHolder attributeHolder) { /** * Get attribute value, stored on the {@link AttributeStorage}, the difference from {@link #get(AttributeStorage)} is - * that default value or {@link NullaryFunction} won't be invoked. + * that default value or {@link Supplier} won't be invoked. * * @param storage {@link AttributeStorage}. * @return attribute value @@ -212,7 +212,7 @@ public int index() { } @SuppressWarnings("unchecked") - private T get0(final AttributeHolder attributeHolder, final NullaryFunction initializer) { + private T get0(final AttributeHolder attributeHolder, final Supplier initializer) { final IndexedAttributeAccessor indexedAccessor = attributeHolder.getIndexedAttributeAccessor(); return indexedAccessor != null ? (T) indexedAccessor.getAttribute(attributeIndex, initializer) : (T) attributeHolder.getAttribute(name, initializer); diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeBuilder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeBuilder.java index 6d187925a3..c9b8c5fffc 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeBuilder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeBuilder.java @@ -16,6 +16,8 @@ package org.glassfish.grizzly.attributes; +import java.util.function.Supplier; + /** * AttributeBuilder is responsible for creating and indexing {@link Attribute}s. For faster access to * {@link Attribute} value, each {@link Attribute} has assigned index. AttributeBuilder is responsible to @@ -61,29 +63,18 @@ public interface AttributeBuilder { */ Attribute createAttribute(String name, T defaultValue); - /** - * Create Attribute with name and initializer, which will be called, if Attribute's value is null on a AttributedObject - * - * @param Type of attribute value - * @param name attribute name - * @param initializer NullaryFunction, which will be called, if Attribute's value is null on a AttributedObject - * - * @return Attribute - */ - Attribute createAttribute(String name, org.glassfish.grizzly.utils.NullaryFunction initializer); /** * Create Attribute with name and initializer, which will be called, if Attribute's value is null on a AttributedObject * * @param Type of attribute value * @param name attribute name - * @param initializer NullaryFunction, which will be called, if Attribute's value is null on a AttributedObject + * @param initializer {@link Supplier}, which will be called, if Attribute's value is null on a AttributedObject * * @return Attribute - * @deprecated pls. use {@link #createAttribute(java.lang.String, org.glassfish.grizzly.utils.NullaryFunction)}. */ @Deprecated - Attribute createAttribute(String name, NullaryFunction initializer); + Attribute createAttribute(String name, Supplier initializer); /** * Creates and returns new thread-safe {@link AttributeHolder} diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeHolder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeHolder.java index 251eaebe62..fdc4949c04 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeHolder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeHolder.java @@ -18,7 +18,7 @@ import java.util.Set; -import org.glassfish.grizzly.utils.NullaryFunction; +import java.util.function.Supplier; /** * Interface declares common functionality for objects, which have associated {@link Attribute}s. @@ -62,7 +62,7 @@ public interface AttributeHolder { * * @since 2.3.18 */ - Object getAttribute(String name, NullaryFunction initializer); + Object getAttribute(String name, Supplier initializer); /** * Return a {@link Set} of attribute names. diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/DefaultAttributeBuilder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/DefaultAttributeBuilder.java index 6e9844afb1..87cdc9abcb 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/DefaultAttributeBuilder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/DefaultAttributeBuilder.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.Map; -import org.glassfish.grizzly.utils.NullaryFunction; +import java.util.function.Supplier; /** * Default {@link AttributeBuilder} implementation. @@ -63,7 +63,7 @@ public synchronized Attribute createAttribute(final String name, final T */ @Override @SuppressWarnings("unchecked") - public synchronized Attribute createAttribute(final String name, final NullaryFunction initializer) { + public synchronized Attribute createAttribute(final String name, final Supplier initializer) { Attribute attribute = name2Attribute.get(name); if (attribute == null) { attribute = new Attribute<>(this, name, attributes.size(), initializer); @@ -74,17 +74,6 @@ public synchronized Attribute createAttribute(final String name, final Nu return attribute; } - @Override - public Attribute createAttribute(final String name, final org.glassfish.grizzly.attributes.NullaryFunction initializer) { - return createAttribute(name, initializer == null ? null : new NullaryFunction() { - - @Override - public T evaluate() { - return initializer.evaluate(); - } - }); - } - @Override public AttributeHolder createSafeAttributeHolder() { return new IndexedAttributeHolder(this); diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/IndexedAttributeAccessor.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/IndexedAttributeAccessor.java index 8fb043d799..2580ab7cb0 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/IndexedAttributeAccessor.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/IndexedAttributeAccessor.java @@ -16,7 +16,7 @@ package org.glassfish.grizzly.attributes; -import org.glassfish.grizzly.utils.NullaryFunction; +import java.util.function.Supplier; /** * The interface declares, that {@link AttributeHolder} supports indexed {@link Attribute} access. @@ -38,11 +38,11 @@ public interface IndexedAttributeAccessor { * index is not set, set it to the default value, using the initializer, and return the default. * * @param index the attribute index - * @param initializer the default value {@link NullaryFunction} + * @param initializer the default value {@link Supplier} * @return the value of the attribute by index * @since 2.3.18 */ - Object getAttribute(int index, NullaryFunction initializer); + Object getAttribute(int index, Supplier initializer); /** * Internal method for dynamic attribute support. Set the attribute with the index to value. diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/IndexedAttributeHolder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/IndexedAttributeHolder.java index 9f0b840bd5..77096caecf 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/IndexedAttributeHolder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/IndexedAttributeHolder.java @@ -21,7 +21,7 @@ import java.util.HashSet; import java.util.Set; -import org.glassfish.grizzly.utils.NullaryFunction; +import java.util.function.Supplier; /** * {@link AttributeHolder}, which supports indexed access to stored {@link Attribute}s. Access to such indexed @@ -69,7 +69,7 @@ public Object getAttribute(final String name) { * {@inheritDoc} */ @Override - public Object getAttribute(final String name, final NullaryFunction initializer) { + public Object getAttribute(final String name, final Supplier initializer) { final Attribute attribute = attributeBuilder.getAttributeByName(name); if (attribute != null) { return indexedAttributeAccessor.getAttribute(attribute.index(), initializer); @@ -293,17 +293,17 @@ public Object getAttribute(final int index) { * {@inheritDoc} */ @Override - public Object getAttribute(final int index, final NullaryFunction initializer) { + public Object getAttribute(final int index, final Supplier initializer) { Object value = weakGet(index); if (value == null && initializer != null) { synchronized (sync) { - // we want to make sure that parallel getAttribute(int, NullaryFunction) - // won't create multiple value instances (everyone will call NullaryFunction.evaluate()) + // we want to make sure that parallel getAttribute(int, Suppler) + // won't create multiple value instances (everyone will call Supplier.get()) value = weakGet(index); if (value == null) { - value = initializer.evaluate(); + value = initializer.get(); setAttribute(index, value); } } diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/NullaryFunction.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/NullaryFunction.java deleted file mode 100644 index a0c6ad3775..0000000000 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/NullaryFunction.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.grizzly.attributes; - -/** - * {@link Attribute} initializer. - * - * Is used by {@link Attribute#get(AttributeHolder)}, if there is no attribute value stored in {@link AttributeHolder}, - * or attribute value is null. - * - * @see Attribute - * @see AttributeHolder - * - * @author Ken Cavanaugh - * @deprecated pls. use {@link org.glassfish.grizzly.utils.NullaryFunction} - */ -@Deprecated -public interface NullaryFunction extends org.glassfish.grizzly.utils.NullaryFunction { -} diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/UnsafeAttributeHolder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/UnsafeAttributeHolder.java index 9a9db75a8c..0fe2fe726c 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/UnsafeAttributeHolder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/UnsafeAttributeHolder.java @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Set; -import org.glassfish.grizzly.utils.NullaryFunction; +import java.util.function.Supplier; /** * A non thread-safe {@link AttributeHolder} implementation. @@ -57,7 +57,7 @@ public Object getAttribute(final String name) { } @Override - public Object getAttribute(final String name, final NullaryFunction initializer) { + public Object getAttribute(final String name, final Supplier initializer) { if (!isSet && initializer == null) { return null; @@ -68,7 +68,7 @@ public Object getAttribute(final String name, final NullaryFunction initializer) return indexedAttributeAccessor.getAttribute(attribute, initializer); } - return initializer != null ? initializer.evaluate() : null; + return initializer != null ? initializer.get() : null; } @Override @@ -238,7 +238,7 @@ public Object getAttribute(final int index) { } @Override - public Object getAttribute(final int index, final NullaryFunction initializer) { + public Object getAttribute(final int index, final Supplier initializer) { if (!isSet && initializer == null) { return null; } @@ -256,14 +256,14 @@ public Object removeAttribute(final int index) { return removeAttribute(attributeBuilder.getAttributeByIndex(index)); } - private Object getAttribute(final Attribute attribute, final NullaryFunction initializer) { + private Object getAttribute(final Attribute attribute, final Supplier initializer) { final int idx = attribute.index(); final Holder h = holderByIdx(idx); if (h != null) { if (h.value == null && initializer != null) { - h.value = initializer.evaluate(); + h.value = initializer.get(); } return h.value; @@ -272,7 +272,7 @@ private Object getAttribute(final Attribute attribute, final NullaryFunction ini Object value = valueMap != null ? MapperAccessor.getValue(UnsafeAttributeHolder.this, idx) : null; if (value == null && initializer != null) { - value = initializer.evaluate(); + value = initializer.get(); setAttribute(attribute, value); } diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/filterchain/DefaultFilterChain.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/filterchain/DefaultFilterChain.java index 0412825230..5259730192 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/filterchain/DefaultFilterChain.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/filterchain/DefaultFilterChain.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.ExecutionException; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; @@ -44,7 +45,6 @@ import org.glassfish.grizzly.memory.Buffers; import org.glassfish.grizzly.utils.Exceptions; import org.glassfish.grizzly.utils.Futures; -import org.glassfish.grizzly.utils.NullaryFunction; /** * Default {@link FilterChain} implementation @@ -637,10 +637,10 @@ private Object append(final Object currentMessage) { } } - private final class FiltersStateFactory implements NullaryFunction { + private final class FiltersStateFactory implements Supplier { @Override - public FiltersState evaluate() { + public FiltersState get() { return new FiltersState(size()); } } diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/NIOConnection.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/NIOConnection.java index ad95701f16..439fbb11d8 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/NIOConnection.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/NIOConnection.java @@ -35,6 +35,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; @@ -67,7 +68,6 @@ import org.glassfish.grizzly.monitoring.MonitoringConfig; import org.glassfish.grizzly.utils.CompletionHandlerAdapter; import org.glassfish.grizzly.utils.Futures; -import org.glassfish.grizzly.utils.NullaryFunction; /** * Common {@link Connection} implementation for Java NIO Connections. @@ -315,7 +315,7 @@ public void setProcessorSelector(final ProcessorSelector preferableProcessorSele } @Override - public E obtainProcessorState(final Processor processor, final NullaryFunction factory) { + public E obtainProcessorState(final Processor processor, final Supplier factory) { return processorStateStorage.getState(processor, factory); } @@ -962,7 +962,7 @@ private final static class ProcessorStatesMap { private ConcurrentMap processorStatesMap; @SuppressWarnings("unchecked") - public E getState(final Processor processor, final NullaryFunction stateFactory) { + public E getState(final Processor processor, final Supplier stateFactory) { final int c = volatileFlag; if (c == 0) { @@ -986,9 +986,9 @@ public E getState(final Processor processor, final NullaryFunction stateF } } - private synchronized Object getStateSync(final Processor processor, final NullaryFunction stateFactory) { + private synchronized Object getStateSync(final Processor processor, final Supplier stateFactory) { if (volatileFlag == 0) { - final E state = stateFactory.evaluate(); + final E state = stateFactory.get(); singleProcessorState = new ProcessorState(processor, state); volatileFlag++; @@ -1021,7 +1021,7 @@ private static final class StaticMapAccessor { Grizzly.logger(StaticMapAccessor.class).fine("Map is going to " + "be used as Connection<->ProcessorState storage"); } - private static Object getFromMap(final ProcessorStatesMap storage, final Processor processor, final NullaryFunction stateFactory) { + private static Object getFromMap(final ProcessorStatesMap storage, final Processor processor, final Supplier stateFactory) { final Map localStateMap = storage.processorStatesMap; if (localStateMap != null) { @@ -1034,7 +1034,7 @@ private static Object getFromMap(final ProcessorStatesMap storage, final Pro return storage.getStateSync(processor, stateFactory); } - private static Object getFromMapSync(final ProcessorStatesMap storage, final Processor processor, final NullaryFunction stateFactory) { + private static Object getFromMapSync(final ProcessorStatesMap storage, final Processor processor, final Supplier stateFactory) { ConcurrentMap localStatesMap = storage.processorStatesMap; @@ -1043,13 +1043,13 @@ private static Object getFromMapSync(final ProcessorStatesMap storage, final return localStatesMap.get(processor); } - final Object state = stateFactory.evaluate(); + final Object state = stateFactory.get(); localStatesMap.put(processor, state); return state; } localStatesMap = new ConcurrentHashMap<>(4); - final Object state = stateFactory.evaluate(); + final Object state = stateFactory.get(); localStatesMap.put(processor, state); storage.processorStatesMap = localStatesMap; storage.volatileFlag++; diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOConnection.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOConnection.java index 7a1516926b..6842f225f1 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOConnection.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOConnection.java @@ -22,6 +22,7 @@ import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; @@ -37,7 +38,6 @@ import org.glassfish.grizzly.nio.NIOConnection; import org.glassfish.grizzly.nio.SelectorRunner; import org.glassfish.grizzly.utils.Holder; -import org.glassfish.grizzly.utils.NullaryFunction; /** * {@link org.glassfish.grizzly.Connection} implementation for the {@link TCPNIOTransport} @@ -112,16 +112,16 @@ protected void resetProperties() { setMaxAsyncWriteQueueSize( transportMaxAsyncWriteQueueSize == AsyncQueueWriter.AUTO_SIZE ? getWriteBufferSize() * 4 : transportMaxAsyncWriteQueueSize); - localSocketAddressHolder = Holder.lazyHolder(new NullaryFunction() { + localSocketAddressHolder = Holder.lazyHolder(new Supplier() { @Override - public SocketAddress evaluate() { + public SocketAddress get() { return ((SocketChannel) channel).socket().getLocalSocketAddress(); } }); - peerSocketAddressHolder = Holder.lazyHolder(new NullaryFunction() { + peerSocketAddressHolder = Holder.lazyHolder(new Supplier() { @Override - public SocketAddress evaluate() { + public SocketAddress get() { return ((SocketChannel) channel).socket().getRemoteSocketAddress(); } }); diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOServerConnection.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOServerConnection.java index bcdaac7c62..a57f52a0f0 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOServerConnection.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOServerConnection.java @@ -24,6 +24,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; @@ -42,7 +43,6 @@ import org.glassfish.grizzly.utils.CompletionHandlerAdapter; import org.glassfish.grizzly.utils.Exceptions; import org.glassfish.grizzly.utils.Holder; -import org.glassfish.grizzly.utils.NullaryFunction; /** * @@ -265,10 +265,10 @@ protected void closeGracefully0(final CompletionHandler completionHan @Override @SuppressWarnings("unchecked") protected void resetProperties() { - localSocketAddressHolder = Holder.lazyHolder(new NullaryFunction() { + localSocketAddressHolder = Holder.lazyHolder(new Supplier() { @Override - public SocketAddress evaluate() { + public SocketAddress get() { return ((ServerSocketChannel) channel).socket().getLocalSocketAddress(); } }); diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOConnection.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOConnection.java index b7f9b73495..57b617d20d 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOConnection.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOConnection.java @@ -29,6 +29,7 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; @@ -42,7 +43,6 @@ import org.glassfish.grizzly.nio.SelectorRunner; import org.glassfish.grizzly.utils.Exceptions; import org.glassfish.grizzly.utils.Holder; -import org.glassfish.grizzly.utils.NullaryFunction; /** * {@link org.glassfish.grizzly.Connection} implementation for the {@link UDPNIOTransport} @@ -420,16 +420,16 @@ protected final void resetProperties() { setMaxAsyncWriteQueueSize( transportMaxAsyncWriteQueueSize == AsyncQueueWriter.AUTO_SIZE ? getWriteBufferSize() * 4 : transportMaxAsyncWriteQueueSize); - localSocketAddressHolder = Holder.lazyHolder(new NullaryFunction() { + localSocketAddressHolder = Holder.lazyHolder(new Supplier() { @Override - public SocketAddress evaluate() { + public SocketAddress get() { return ((DatagramChannel) channel).socket().getLocalSocketAddress(); } }); - peerSocketAddressHolder = Holder.lazyHolder(new NullaryFunction() { + peerSocketAddressHolder = Holder.lazyHolder(new Supplier() { @Override - public SocketAddress evaluate() { + public SocketAddress get() { return ((DatagramChannel) channel).socket().getRemoteSocketAddress(); } }); diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/ActivityCheckFilter.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/ActivityCheckFilter.java index 09fdf0e235..2a24820f87 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/ActivityCheckFilter.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/ActivityCheckFilter.java @@ -21,6 +21,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import java.util.logging.Logger; import org.glassfish.grizzly.Connection; @@ -45,10 +46,10 @@ public class ActivityCheckFilter extends BaseFilter { public static final String ACTIVE_ATTRIBUTE_NAME = "connection-active-attribute"; private static final Attribute IDLE_ATTR = Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute(ACTIVE_ATTRIBUTE_NAME, - new NullaryFunction() { + new Supplier() { @Override - public ActiveRecord evaluate() { + public ActiveRecord get() { return new ActiveRecord(); } }); diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/Holder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/Holder.java index 039b35c807..b54545bb46 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/Holder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/Holder.java @@ -16,6 +16,8 @@ package org.glassfish.grizzly.utils; +import java.util.function.Supplier; + /** * The object holder, which might be used for lazy object initialization. * @@ -42,22 +44,22 @@ public int getInt() { }; } - public static LazyHolder lazyHolder(final NullaryFunction factory) { + public static LazyHolder lazyHolder(final Supplier factory) { return new LazyHolder() { @Override protected T evaluate() { - return factory.evaluate(); + return factory.get(); } }; } - public static LazyIntHolder lazyIntHolder(final NullaryFunction factory) { + public static LazyIntHolder lazyIntHolder(final Supplier factory) { return new LazyIntHolder() { @Override protected int evaluate() { - return factory.evaluate(); + return factory.get(); } }; } diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java index 766010f422..1d0238e172 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import java.util.concurrent.atomic.AtomicLongFieldUpdater; +import java.util.function.Supplier; import org.glassfish.grizzly.Connection; import org.glassfish.grizzly.Grizzly; import org.glassfish.grizzly.attributes.Attribute; @@ -48,10 +49,10 @@ public class IdleTimeoutFilter extends BaseFilter { public static final String IDLE_ATTRIBUTE_NAME = "connection-idle-attribute"; private static final Attribute IDLE_ATTR = Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute(IDLE_ATTRIBUTE_NAME, - new NullaryFunction() { + new Supplier() { @Override - public IdleRecord evaluate() { + public IdleRecord get() { return new IdleRecord(); } }); diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/NullaryFunction.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/NullaryFunction.java deleted file mode 100644 index 0179e87c0e..0000000000 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/NullaryFunction.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.grizzly.utils; - -/** - * General initializer interface. - * - * It might be useful abstraction, which helps to create and initialize certain values lazily. - * - * @see org.glassfish.grizzly.attributes.Attribute - * @see org.glassfish.grizzly.attributes.AttributeHolder - * @see org.glassfish.grizzly.utils.Holder - * - * @author Ken Cavanaugh - */ -public interface NullaryFunction { - /** - * Initializes and returns the value. - */ - T evaluate(); -} diff --git a/modules/grizzly/src/test/java/org/glassfish/grizzly/AttributesTest.java b/modules/grizzly/src/test/java/org/glassfish/grizzly/AttributesTest.java index 298efde5e7..7b434c1672 100644 --- a/modules/grizzly/src/test/java/org/glassfish/grizzly/AttributesTest.java +++ b/modules/grizzly/src/test/java/org/glassfish/grizzly/AttributesTest.java @@ -26,11 +26,11 @@ import java.util.Collection; import java.util.Set; +import java.util.function.Supplier; import org.glassfish.grizzly.attributes.Attribute; import org.glassfish.grizzly.attributes.AttributeBuilder; import org.glassfish.grizzly.attributes.AttributeHolder; import org.glassfish.grizzly.attributes.DefaultAttributeBuilder; -import org.glassfish.grizzly.utils.NullaryFunction; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -102,9 +102,9 @@ public void testAttributeGetWithNullaryFunctionOnEmptyHolder() { AttributeBuilder builder = new DefaultAttributeBuilder(); AttributeHolder holder = isSafe ? builder.createSafeAttributeHolder() : builder.createUnsafeAttributeHolder(); - final Attribute attr = builder.createAttribute("attribute", new NullaryFunction() { + final Attribute attr = builder.createAttribute("attribute", new Supplier() { @Override - public String evaluate() { + public String get() { return "default"; } }); diff --git a/modules/grizzly/src/test/java/org/glassfish/grizzly/FilterChainTest.java b/modules/grizzly/src/test/java/org/glassfish/grizzly/FilterChainTest.java index 0f420c7a1e..8a9f8620ef 100644 --- a/modules/grizzly/src/test/java/org/glassfish/grizzly/FilterChainTest.java +++ b/modules/grizzly/src/test/java/org/glassfish/grizzly/FilterChainTest.java @@ -31,6 +31,7 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Supplier; import org.glassfish.grizzly.asyncqueue.MessageCloner; import org.glassfish.grizzly.attributes.Attribute; import org.glassfish.grizzly.attributes.AttributeBuilder; @@ -52,7 +53,6 @@ import org.glassfish.grizzly.nio.transport.TCPNIOTransportBuilder; import org.glassfish.grizzly.utils.EchoFilter; import org.glassfish.grizzly.utils.Futures; -import org.glassfish.grizzly.utils.NullaryFunction; import org.glassfish.grizzly.utils.StringFilter; import junit.framework.TestCase; @@ -79,10 +79,10 @@ static int PORT() { private static Attribute counterAttr = DEFAULT_ATTRIBUTE_BUILDER.createAttribute(FilterChainTest.class.getName() + ".counter"); private static Attribute bufferAttr = DEFAULT_ATTRIBUTE_BUILDER.createAttribute(FilterChainTest.class.getName() + ".buffer", - new NullaryFunction() { + new Supplier() { @Override - public CompositeBuffer evaluate() { + public CompositeBuffer get() { return CompositeBuffer.newBuffer(); } }); diff --git a/modules/grizzly/src/test/java/org/glassfish/grizzly/TestDefaults.java b/modules/grizzly/src/test/java/org/glassfish/grizzly/TestDefaults.java index fea5017c9f..02a631fafc 100644 --- a/modules/grizzly/src/test/java/org/glassfish/grizzly/TestDefaults.java +++ b/modules/grizzly/src/test/java/org/glassfish/grizzly/TestDefaults.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.nio.channels.SelectionKey; +import java.util.function.Supplier; import org.glassfish.grizzly.attributes.Attribute; import org.glassfish.grizzly.attributes.AttributeBuilder; import org.glassfish.grizzly.attributes.AttributeHolder; @@ -28,7 +29,6 @@ import org.glassfish.grizzly.monitoring.MonitoringConfig; import org.glassfish.grizzly.nio.NIOConnection; import org.glassfish.grizzly.nio.SelectionKeyHandler; -import org.glassfish.grizzly.utils.NullaryFunction; import org.junit.BeforeClass; import org.junit.Test; @@ -144,12 +144,7 @@ public Attribute createAttribute(String name, T defaultValue) { } @Override - public Attribute createAttribute(String name, NullaryFunction initializer) { - return null; - } - - @Override - public Attribute createAttribute(String name, org.glassfish.grizzly.attributes.NullaryFunction initializer) { + public Attribute createAttribute(String name, Supplier initializer) { return null; } diff --git a/modules/http-ajp/src/main/java/org/glassfish/grizzly/http/ajp/AjpMessageFilter.java b/modules/http-ajp/src/main/java/org/glassfish/grizzly/http/ajp/AjpMessageFilter.java index cd225f4dab..336aba7553 100644 --- a/modules/http-ajp/src/main/java/org/glassfish/grizzly/http/ajp/AjpMessageFilter.java +++ b/modules/http-ajp/src/main/java/org/glassfish/grizzly/http/ajp/AjpMessageFilter.java @@ -18,6 +18,7 @@ import java.io.IOException; +import java.util.function.Supplier; import org.glassfish.grizzly.Buffer; import org.glassfish.grizzly.Connection; import org.glassfish.grizzly.Grizzly; @@ -25,7 +26,6 @@ import org.glassfish.grizzly.filterchain.BaseFilter; import org.glassfish.grizzly.filterchain.FilterChainContext; import org.glassfish.grizzly.filterchain.NextAction; -import org.glassfish.grizzly.utils.NullaryFunction; /** * Filter, responsible for parsing Ajp requests and making sure the request packets are complete and properly @@ -35,10 +35,10 @@ */ public class AjpMessageFilter extends BaseFilter { private final Attribute parsingStateAttribute = Grizzly.DEFAULT_ATTRIBUTE_BUILDER - .createAttribute(AjpMessageFilter.class + ".parsingStateAttribute", new NullaryFunction() { + .createAttribute(AjpMessageFilter.class + ".parsingStateAttribute", new Supplier() { @Override - public ParsingState evaluate() { + public ParsingState get() { return new ParsingState(); } }); diff --git a/modules/http-ajp/src/test/java/org/glassfish/grizzly/http/ajp/AjpClientMessageFilter.java b/modules/http-ajp/src/test/java/org/glassfish/grizzly/http/ajp/AjpClientMessageFilter.java index 909dce4e64..c5c7edb73c 100644 --- a/modules/http-ajp/src/test/java/org/glassfish/grizzly/http/ajp/AjpClientMessageFilter.java +++ b/modules/http-ajp/src/test/java/org/glassfish/grizzly/http/ajp/AjpClientMessageFilter.java @@ -18,6 +18,7 @@ import java.io.IOException; +import java.util.function.Supplier; import org.glassfish.grizzly.Buffer; import org.glassfish.grizzly.Connection; import org.glassfish.grizzly.Grizzly; @@ -25,7 +26,6 @@ import org.glassfish.grizzly.filterchain.BaseFilter; import org.glassfish.grizzly.filterchain.FilterChainContext; import org.glassfish.grizzly.filterchain.NextAction; -import org.glassfish.grizzly.utils.NullaryFunction; /** * Client side AJP filter, which deserializes AJP message by parsing magic bytes and message length. @@ -34,10 +34,10 @@ */ public class AjpClientMessageFilter extends BaseFilter { private final Attribute parsingStateAttribute = Grizzly.DEFAULT_ATTRIBUTE_BUILDER - .createAttribute(AjpClientMessageFilter.class + ".parsingStateAttribute", new NullaryFunction() { + .createAttribute(AjpClientMessageFilter.class + ".parsingStateAttribute", new Supplier() { @Override - public AjpClientMessageFilter.ParsingState evaluate() { + public AjpClientMessageFilter.ParsingState get() { return new AjpClientMessageFilter.ParsingState(); } }); diff --git a/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2Session.java b/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2Session.java index 737321fa23..90dfc2327f 100644 --- a/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2Session.java +++ b/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2Session.java @@ -30,6 +30,7 @@ import java.util.TreeMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; @@ -77,7 +78,6 @@ import org.glassfish.grizzly.ssl.SSLBaseFilter; import org.glassfish.grizzly.utils.Futures; import org.glassfish.grizzly.utils.Holder; -import org.glassfish.grizzly.utils.NullaryFunction; /** * The HTTP2 session abstraction. @@ -207,7 +207,7 @@ public Http2Session(final Connection connection, final boolean isServer, fina this.lastPeerStreamId = 0; } - this.addressHolder = Holder.lazyHolder((NullaryFunction) () -> connection.getPeerAddress()); + this.addressHolder = Holder.lazyHolder(() -> connection.getPeerAddress()); connection.addCloseListener(new ConnectionCloseListener()); diff --git a/modules/portunif/src/test/java/org/glassfish/grizzly/portunif/AsyncPUTest.java b/modules/portunif/src/test/java/org/glassfish/grizzly/portunif/AsyncPUTest.java index 29a8ca322d..803f56b51d 100644 --- a/modules/portunif/src/test/java/org/glassfish/grizzly/portunif/AsyncPUTest.java +++ b/modules/portunif/src/test/java/org/glassfish/grizzly/portunif/AsyncPUTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Supplier; import java.util.logging.Logger; import org.glassfish.grizzly.Connection; @@ -43,7 +44,6 @@ import org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler; import org.glassfish.grizzly.nio.transport.TCPNIOTransport; import org.glassfish.grizzly.nio.transport.TCPNIOTransportBuilder; -import org.glassfish.grizzly.utils.NullaryFunction; import org.glassfish.grizzly.utils.StringFilter; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -247,10 +247,10 @@ public void run() { private static final class ClientResultFilter extends BaseFilter { private static final Attribute responseCounterAttr = Grizzly.DEFAULT_ATTRIBUTE_BUILDER - .createAttribute(ClientResultFilter.class.getName() + ".responseCounter", new NullaryFunction() { + .createAttribute(ClientResultFilter.class.getName() + ".responseCounter", new Supplier() { @Override - public AtomicInteger evaluate() { + public AtomicInteger get() { return new AtomicInteger(); } }); @@ -285,10 +285,10 @@ public NextAction handleRead(final FilterChainContext ctx) throws IOException { private static class StringDuplicatorFilter extends BaseFilter { private static final Attribute duplicationsCounterAttribute = Grizzly.DEFAULT_ATTRIBUTE_BUILDER - .createAttribute(StringDuplicatorFilter.class.getName() + ".duplicationsCounterAttribute", new NullaryFunction() { + .createAttribute(StringDuplicatorFilter.class.getName() + ".duplicationsCounterAttribute", new Supplier() { @Override - public AtomicInteger evaluate() { + public AtomicInteger get() { return new AtomicInteger(); } }); From 66fdba0256b73c7e581dac82ea634b7c518f87c4 Mon Sep 17 00:00:00 2001 From: Manfred Riem Date: Sat, 5 Aug 2023 08:32:50 -0500 Subject: [PATCH 07/22] Fixes issue #2122 - Manifests should contain automatic module names --- modules/bundles/core/pom.xml | 8 +++ modules/bundles/http/pom.xml | 8 +++ modules/comet/pom.xml | 1 + modules/comet/src/main/java/module-info.java | 30 ++++++++ .../grizzly/src/main/java/module-info.java | 69 +++++++++++++++++++ modules/http-ajp/pom.xml | 1 + .../http-ajp/src/main/java/module-info.java | 27 ++++++++ .../src/main/java/module-info.java | 53 ++++++++++++++ modules/http-servlet/pom.xml | 1 + .../src/main/java/module-info.java | 30 ++++++++ modules/http/src/main/java/module-info.java | 29 ++++++++ modules/http2/pom.xml | 1 + modules/http2/src/main/java/module-info.java | 35 ++++++++++ .../portunif/src/main/java/module-info.java | 27 ++++++++ modules/websockets/pom.xml | 1 + .../websockets/src/main/java/module-info.java | 35 ++++++++++ 16 files changed, 356 insertions(+) create mode 100644 modules/comet/src/main/java/module-info.java create mode 100644 modules/grizzly/src/main/java/module-info.java create mode 100644 modules/http-ajp/src/main/java/module-info.java create mode 100644 modules/http-server/src/main/java/module-info.java create mode 100644 modules/http-servlet/src/main/java/module-info.java create mode 100644 modules/http/src/main/java/module-info.java create mode 100644 modules/http2/src/main/java/module-info.java create mode 100644 modules/portunif/src/main/java/module-info.java create mode 100644 modules/websockets/src/main/java/module-info.java diff --git a/modules/bundles/core/pom.xml b/modules/bundles/core/pom.xml index c09add3279..48b92b627f 100644 --- a/modules/bundles/core/pom.xml +++ b/modules/bundles/core/pom.xml @@ -138,6 +138,14 @@ sources + + module-info.java junit,hamcrest-core + module-info.java junit, hamcrest-core + 4.0.1-SNAPSHOT pom grizzly-project diff --git a/samples/connection-pool-samples/pom.xml b/samples/connection-pool-samples/pom.xml index 45a0fe1db0..3b70b25562 100755 --- a/samples/connection-pool-samples/pom.xml +++ b/samples/connection-pool-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml diff --git a/samples/framework-samples/pom.xml b/samples/framework-samples/pom.xml index 4cfdb778c7..27bf7f5f37 100755 --- a/samples/framework-samples/pom.xml +++ b/samples/framework-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml diff --git a/samples/http-ajp-samples/pom.xml b/samples/http-ajp-samples/pom.xml index d0a67f2e79..521c4b4f98 100644 --- a/samples/http-ajp-samples/pom.xml +++ b/samples/http-ajp-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml diff --git a/samples/http-jaxws-samples/pom.xml b/samples/http-jaxws-samples/pom.xml index e922d9c8ac..91dcb32027 100644 --- a/samples/http-jaxws-samples/pom.xml +++ b/samples/http-jaxws-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml diff --git a/samples/http-multipart-samples/pom.xml b/samples/http-multipart-samples/pom.xml index 31b493c953..45220d053f 100644 --- a/samples/http-multipart-samples/pom.xml +++ b/samples/http-multipart-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml diff --git a/samples/http-samples/pom.xml b/samples/http-samples/pom.xml index 8041dde0d6..6e4ca7d678 100755 --- a/samples/http-samples/pom.xml +++ b/samples/http-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml diff --git a/samples/http-server-samples/pom.xml b/samples/http-server-samples/pom.xml index 7e8bcbea0d..a981b530cf 100644 --- a/samples/http-server-samples/pom.xml +++ b/samples/http-server-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml diff --git a/samples/pom.xml b/samples/pom.xml index 0367760e4c..bbea6cabb9 100755 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -17,7 +17,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../pom.xml diff --git a/samples/portunif/pom.xml b/samples/portunif/pom.xml index 51b7280da6..6664ffdb72 100644 --- a/samples/portunif/pom.xml +++ b/samples/portunif/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml diff --git a/samples/tls-sni-samples/pom.xml b/samples/tls-sni-samples/pom.xml index 95c65d8420..9810a30f26 100644 --- a/samples/tls-sni-samples/pom.xml +++ b/samples/tls-sni-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.0-SNAPSHOT + 4.0.1-SNAPSHOT ../../pom.xml From f3b5d70f62df6021aefe8d4a982967c0306b1927 Mon Sep 17 00:00:00 2001 From: Arjan Tijms Date: Thu, 28 Sep 2023 12:02:56 +0200 Subject: [PATCH 11/22] Update versions in poms and adjust pom where needed for that Signed-off-by: Arjan Tijms --- boms/bom/pom.xml | 18 ++++-------- .../grizzly-httpservice-bundle/pom.xml | 8 ++--- extras/connection-pool/pom.xml | 4 +-- extras/grizzly-httpservice/pom.xml | 5 ++-- extras/http-server-jaxws/pom.xml | 13 ++++----- extras/http-server-multipart/pom.xml | 4 +-- extras/http-servlet-extras/pom.xml | 4 +-- extras/tls-sni/pom.xml | 4 +-- modules/bundles/comet/pom.xml | 8 ++--- modules/bundles/core/pom.xml | 8 ++--- modules/bundles/http-all/pom.xml | 8 ++--- modules/bundles/http-servlet/pom.xml | 8 ++--- modules/bundles/http/pom.xml | 8 ++--- modules/bundles/websockets/pom.xml | 8 ++--- modules/comet/pom.xml | 4 +-- modules/grizzly/pom.xml | 4 +-- modules/http-ajp/pom.xml | 4 +-- modules/http-servlet/pom.xml | 8 ++--- modules/http/pom.xml | 4 +-- modules/monitoring/grizzly/pom.xml | 4 +-- modules/monitoring/http-server/pom.xml | 4 +-- modules/monitoring/http/pom.xml | 4 +-- modules/portunif/pom.xml | 4 +-- modules/websockets/pom.xml | 4 +-- pom.xml | 29 +++++++++---------- samples/connection-pool-samples/pom.xml | 4 +-- samples/framework-samples/pom.xml | 4 +-- samples/http-ajp-samples/pom.xml | 4 +-- samples/http-jaxws-samples/pom.xml | 10 ++----- samples/http-multipart-samples/pom.xml | 4 +-- samples/http-samples/pom.xml | 4 +-- samples/http-server-samples/pom.xml | 4 +-- samples/portunif/pom.xml | 4 +-- samples/tls-sni-samples/pom.xml | 4 +-- 34 files changed, 97 insertions(+), 126 deletions(-) diff --git a/boms/bom/pom.xml b/boms/bom/pom.xml index 17471d5928..b38b7679f7 100644 --- a/boms/bom/pom.xml +++ b/boms/bom/pom.xml @@ -1,7 +1,7 @@ @@ -168,9 +167,8 @@ - org.apache.maven.plugins maven-dependency-plugin - 3.1.2 + 3.6.0 src-dependencies diff --git a/extras/connection-pool/pom.xml b/extras/connection-pool/pom.xml index 2ee4ff1db0..1a3ca34f84 100644 --- a/extras/connection-pool/pom.xml +++ b/extras/connection-pool/pom.xml @@ -1,7 +1,7 @@ @@ -125,9 +124,8 @@ - org.apache.maven.plugins maven-dependency-plugin - 3.1.2 + 3.6.0 src-dependencies diff --git a/modules/bundles/core/pom.xml b/modules/bundles/core/pom.xml index c003769319..04d709d596 100644 --- a/modules/bundles/core/pom.xml +++ b/modules/bundles/core/pom.xml @@ -1,7 +1,7 @@ @@ -125,9 +124,8 @@ - org.apache.maven.plugins maven-dependency-plugin - 3.1.2 + 3.6.0 src-dependencies diff --git a/modules/bundles/http-all/pom.xml b/modules/bundles/http-all/pom.xml index 14879c44e7..e8523a37d2 100644 --- a/modules/bundles/http-all/pom.xml +++ b/modules/bundles/http-all/pom.xml @@ -1,7 +1,7 @@ @@ -140,9 +139,8 @@ - org.apache.maven.plugins maven-dependency-plugin - 3.1.2 + 3.6.0 src-dependencies diff --git a/modules/bundles/http-servlet/pom.xml b/modules/bundles/http-servlet/pom.xml index 4dabf13363..170fd32535 100755 --- a/modules/bundles/http-servlet/pom.xml +++ b/modules/bundles/http-servlet/pom.xml @@ -1,7 +1,7 @@ @@ -131,9 +130,8 @@ - org.apache.maven.plugins maven-dependency-plugin - 3.1.2 + 3.6.0 src-dependencies diff --git a/modules/bundles/http/pom.xml b/modules/bundles/http/pom.xml index 2f95f1be3c..00619c2902 100755 --- a/modules/bundles/http/pom.xml +++ b/modules/bundles/http/pom.xml @@ -1,7 +1,7 @@ @@ -147,9 +146,8 @@ - org.apache.maven.plugins maven-dependency-plugin - 3.1.2 + 3.6.0 src-dependencies diff --git a/modules/bundles/websockets/pom.xml b/modules/bundles/websockets/pom.xml index cb65731599..7be0f5c6c0 100644 --- a/modules/bundles/websockets/pom.xml +++ b/modules/bundles/websockets/pom.xml @@ -1,7 +1,7 @@ @@ -135,9 +134,8 @@ - org.apache.maven.plugins maven-dependency-plugin - 3.1.2 + 3.6.0 src-dependencies diff --git a/modules/comet/pom.xml b/modules/comet/pom.xml index 7066157f9d..ce07ebd92c 100644 --- a/modules/comet/pom.xml +++ b/modules/comet/pom.xml @@ -1,7 +1,7 @@ + 4.0.1-SNAPSHOT + pom grizzly-project @@ -174,7 +175,6 @@ - install target @@ -189,32 +189,33 @@ src/test/resources/ - maven-compiler-plugin - 3.9.0 + 3.11.0 - 11 - 11 + 11 -Xlint:unchecked,deprecation,fallthrough,finally,cast,dep-ann,empty,overrides org.apache.felix maven-bundle-plugin - 5.1.2 + 5.1.9 + + + <_noimportjava>true + <_runee>JavaSE-11 + + - - org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 enforce-maven @@ -235,10 +236,8 @@ - true - org.apache.maven.plugins + maven-jar-plugin - 3.2.0 @@ -251,7 +250,7 @@ - true + org.apache.maven.plugins maven-source-plugin diff --git a/samples/connection-pool-samples/pom.xml b/samples/connection-pool-samples/pom.xml index 3b70b25562..2c4482eb50 100755 --- a/samples/connection-pool-samples/pom.xml +++ b/samples/connection-pool-samples/pom.xml @@ -1,7 +1,7 @@ maven-source-plugin - 3.3.0 + 3.2.1 build-helper-maven-plugin diff --git a/extras/bundles/grizzly-httpservice-bundle/pom.xml b/extras/bundles/grizzly-httpservice-bundle/pom.xml index d6f473b25f..8f06fd9c22 100644 --- a/extras/bundles/grizzly-httpservice-bundle/pom.xml +++ b/extras/bundles/grizzly-httpservice-bundle/pom.xml @@ -82,6 +82,34 @@ + + + maven-dependency-plugin + 3.6.0 + + + src-dependencies + generate-sources + + + unpack-dependencies + + + sources + provided + junit, hamcrest-core + module-info.java + + ${basedir}/src/main/java + false + true + + + + + maven-compiler-plugin @@ -90,6 +118,7 @@ + org.apache.felix maven-bundle-plugin @@ -128,17 +157,7 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - - - ${basedir}/../../grizzly-httpservice/src/main/java; - ${basedir}/../../../modules/bundles/http-servlet/src/main/java; - - -Xdoclint:none - - + org.apache.maven.plugins maven-source-plugin @@ -149,6 +168,7 @@ + maven-antrun-plugin 1.8 @@ -166,32 +186,7 @@ - - maven-dependency-plugin - 3.6.0 - - - src-dependencies - generate-sources - - - unpack-dependencies - - - sources - provided - junit, hamcrest-core - module-info.java - - ${basedir}/src/main/java - false - true - - - - + diff --git a/modules/bundles/comet/pom.xml b/modules/bundles/comet/pom.xml index 84fa5af444..f546def899 100644 --- a/modules/bundles/comet/pom.xml +++ b/modules/bundles/comet/pom.xml @@ -47,6 +47,53 @@ install + + maven-clean-plugin + 3.3.1 + + + + + src + + + + + + + maven-dependency-plugin + 3.6.0 + + + src-dependencies + generate-sources + + + unpack-dependencies + + + sources + + + module-info.java + junit, hamcrest-core + + ${basedir}/src/main/java + false + true + + + + + org.apache.felix maven-bundle-plugin @@ -73,17 +120,7 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - - - ${basedir}/../http/src/main/java; - ${basedir}/../../comet/src/main/java; - - -Xdoclint:none - - + org.apache.maven.plugins maven-source-plugin @@ -94,18 +131,7 @@ - - maven-clean-plugin - 3.3.1 - - - - - src - - - - + maven-antrun-plugin 1.8 @@ -123,30 +149,7 @@ - - maven-dependency-plugin - 3.6.0 - - - src-dependencies - generate-sources - - - unpack-dependencies - - - sources - junit, hamcrest-core - - ${basedir}/src/main/java - false - true - - - - + diff --git a/modules/bundles/core/pom.xml b/modules/bundles/core/pom.xml index 04d709d596..377aefda62 100644 --- a/modules/bundles/core/pom.xml +++ b/modules/bundles/core/pom.xml @@ -47,6 +47,52 @@ install + + maven-clean-plugin + 3.3.1 + + + + + src + + + + + + + maven-dependency-plugin + 3.6.0 + + + src-dependencies + generate-sources + + + unpack-dependencies + + + sources + + module-info.java + junit,hamcrest-core + + ${basedir}/src/main/java + false + true + + + + + org.apache.felix maven-bundle-plugin @@ -73,17 +119,15 @@ + org.apache.maven.plugins maven-javadoc-plugin - - ${basedir}/../../grizzly/src/main/java; - ${basedir}/../../portunif/src/main/java; - -Xdoclint:none + org.apache.maven.plugins maven-source-plugin @@ -94,18 +138,7 @@ - - maven-clean-plugin - 3.3.1 - - - - - src - - - - + maven-antrun-plugin 1.8 @@ -123,38 +156,7 @@ - - maven-dependency-plugin - 3.6.0 - - - src-dependencies - generate-sources - - - unpack-dependencies - - - sources - - module-info.java - junit,hamcrest-core - - ${basedir}/src/main/java - false - true - - - - + diff --git a/modules/bundles/http-all/pom.xml b/modules/bundles/http-all/pom.xml index e8523a37d2..7dfd1e5816 100644 --- a/modules/bundles/http-all/pom.xml +++ b/modules/bundles/http-all/pom.xml @@ -59,6 +59,45 @@ install + + maven-clean-plugin + 3.3.1 + + + + + src + + + + + + + maven-dependency-plugin + 3.6.0 + + + src-dependencies + generate-sources + + + unpack-dependencies + + + sources + junit, hamcrest-core + module-info.java + + ${basedir}/src/main/java + false + true + + + + + org.apache.felix maven-bundle-plugin @@ -86,19 +125,7 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - - - ${basedir}/../http/src/main/java; - ${basedir}/../../comet/src/main/java; - ${basedir}/../../websockets/src/main/java; - ${basedir}/../../servlet/src/main/java; - - -Xdoclint:none - - + org.apache.maven.plugins maven-source-plugin @@ -109,18 +136,7 @@ - - maven-clean-plugin - 3.3.1 - - - - - src - - - - + maven-antrun-plugin 1.8 @@ -138,31 +154,7 @@ - - maven-dependency-plugin - 3.6.0 - - - src-dependencies - generate-sources - - - unpack-dependencies - - - sources - junit, hamcrest-core - module-info.java - - ${basedir}/src/main/java - false - true - - - - + diff --git a/modules/bundles/http-servlet/pom.xml b/modules/bundles/http-servlet/pom.xml index 170fd32535..b5339f71c3 100755 --- a/modules/bundles/http-servlet/pom.xml +++ b/modules/bundles/http-servlet/pom.xml @@ -51,6 +51,45 @@ install + + maven-clean-plugin + 3.3.1 + + + + + src + + + + + + + maven-dependency-plugin + 3.6.0 + + + src-dependencies + generate-sources + + + unpack-dependencies + + + sources + junit, hamcrest-core + module-info.java + + ${basedir}/src/main/java + false + true + + + + + org.apache.felix maven-bundle-plugin @@ -78,18 +117,7 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - - - ${basedir}/../http/src/main/java; - ${basedir}/../../http-servlet/src/main/java; - ${basedir}/../../../extras/http-servlet-extras/src/main/java; - - -Xdoclint:none - - + org.apache.maven.plugins maven-source-plugin @@ -100,18 +128,7 @@ - - maven-clean-plugin - 3.3.1 - - - - - src - - - - + maven-antrun-plugin 1.8 @@ -129,31 +146,7 @@ - - maven-dependency-plugin - 3.6.0 - - - src-dependencies - generate-sources - - - unpack-dependencies - - - sources - junit, hamcrest-core - module-info.java - - ${basedir}/src/main/java - false - true - - - - + diff --git a/modules/bundles/http/pom.xml b/modules/bundles/http/pom.xml index 00619c2902..3413c7eb6b 100755 --- a/modules/bundles/http/pom.xml +++ b/modules/bundles/http/pom.xml @@ -64,6 +64,52 @@ install + + maven-clean-plugin + 3.3.1 + + + + + src + + + + + + + maven-dependency-plugin + 3.6.0 + + + src-dependencies + generate-sources + + + unpack-dependencies + + + sources + + module-info.java + junit, hamcrest-core + + ${basedir}/src/main/java + false + true + + + + + org.apache.felix maven-bundle-plugin @@ -91,21 +137,7 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - - - ${basedir}/../core/src/main/java; - ${basedir}/../../http/src/main/java; - ${basedir}/../../http-server/src/main/java; - ${basedir}/../../http2/src/main/java; - ${basedir}/../../http-ajp/src/main/java; - ${basedir}/../../../extras/http-server-multipart/src/main/java; - - -Xdoclint:none - - + org.apache.maven.plugins maven-source-plugin @@ -116,18 +148,7 @@ - - maven-clean-plugin - 3.3.1 - - - - - src - - - - + maven-antrun-plugin 1.8 @@ -145,38 +166,6 @@ - - maven-dependency-plugin - 3.6.0 - - - src-dependencies - generate-sources - - - unpack-dependencies - - - sources - - module-info.java - junit, hamcrest-core - - ${basedir}/src/main/java - false - true - - - - diff --git a/modules/bundles/websockets/pom.xml b/modules/bundles/websockets/pom.xml index 7be0f5c6c0..ccedbd5a31 100644 --- a/modules/bundles/websockets/pom.xml +++ b/modules/bundles/websockets/pom.xml @@ -57,6 +57,45 @@ install + + maven-clean-plugin + 3.3.1 + + + + + src + + + + + + + maven-dependency-plugin + 3.6.0 + + + src-dependencies + generate-sources + + + unpack-dependencies + + + sources + junit, hamcrest-core + module-info.java + + ${basedir}/src/main/java + false + true + + + + + org.apache.felix maven-bundle-plugin @@ -83,17 +122,7 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - - - ${basedir}/../http/src/main/java; - ${basedir}/../../websockets/src/main/java; - - -Xdoclint:none - - + org.apache.maven.plugins maven-source-plugin @@ -104,18 +133,7 @@ - - maven-clean-plugin - 3.3.1 - - - - - src - - - - + maven-antrun-plugin 1.8 @@ -133,31 +151,7 @@ - - maven-dependency-plugin - 3.6.0 - - - src-dependencies - generate-sources - - - unpack-dependencies - - - sources - junit, hamcrest-core - module-info.java - - ${basedir}/src/main/java - false - true - - - - + diff --git a/modules/grizzly/pom.xml b/modules/grizzly/pom.xml index cec17dccc2..2af850a53d 100644 --- a/modules/grizzly/pom.xml +++ b/modules/grizzly/pom.xml @@ -90,6 +90,7 @@ org.codehaus.mojo build-helper-maven-plugin + 3.4.0 add-source diff --git a/modules/monitoring/grizzly/pom.xml b/modules/monitoring/grizzly/pom.xml index cb50c32443..37305dd383 100644 --- a/modules/monitoring/grizzly/pom.xml +++ b/modules/monitoring/grizzly/pom.xml @@ -103,6 +103,7 @@ org.codehaus.mojo build-helper-maven-plugin + 3.4.0 add-source diff --git a/modules/monitoring/http-server/pom.xml b/modules/monitoring/http-server/pom.xml index 36a0da1842..34e29465fc 100644 --- a/modules/monitoring/http-server/pom.xml +++ b/modules/monitoring/http-server/pom.xml @@ -101,6 +101,7 @@ org.codehaus.mojo build-helper-maven-plugin + 3.4.0 add-source diff --git a/modules/monitoring/http/pom.xml b/modules/monitoring/http/pom.xml index 7a9afaedde..ec7376eada 100644 --- a/modules/monitoring/http/pom.xml +++ b/modules/monitoring/http/pom.xml @@ -100,6 +100,7 @@ org.codehaus.mojo build-helper-maven-plugin + 3.4.0 add-source diff --git a/pom.xml b/pom.xml index 41c3e7f09c..b476a2f959 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 1.8 + none true true ${project.name} ${project.version} From 1c2d0d26fdd4a75d21317d864e07a2f2d866c27b Mon Sep 17 00:00:00 2001 From: Automated workflow Date: Fri, 13 Oct 2023 17:00:58 -0500 Subject: [PATCH 14/22] Fixes #2192 - Grizzly 2.4.4/4.0.0 missing Content-Type in response --- .../org/glassfish/grizzly/http/server/HttpServerFilter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/HttpServerFilter.java b/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/HttpServerFilter.java index 2ab201038b..879f7305db 100644 --- a/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/HttpServerFilter.java +++ b/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/HttpServerFilter.java @@ -325,6 +325,10 @@ private NextAction afterService(final FilterChainContext ctx, final Connection c final HttpContext context = request.getRequest().getProcessingState().getHttpContext(); + if (request.getRequest().isUpgrade() && !response.getResponse().isUpgrade()) { + request.getRequest().setIgnoreContentModifiers(false); + } + httpRequestInProgress.remove(context); response.finish(); request.onAfterService(); From fe874fc38ce4aa8343a77857477c666ddc4abb75 Mon Sep 17 00:00:00 2001 From: Tigran Mkrtchyan Date: Tue, 31 Oct 2023 12:30:04 +0100 Subject: [PATCH 15/22] src: remove unintended deprecation annotation The commit cb5fdde0 have dropped NullaryFunction in favor or java.util.Supplier, however, the deprecation annotation was not removed. fixes: #2196 Signed-off-by: Tigran Mkrtchyan --- .../org/glassfish/grizzly/attributes/AttributeBuilder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeBuilder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeBuilder.java index c9b8c5fffc..4583679ff7 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeBuilder.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/attributes/AttributeBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -73,7 +73,6 @@ public interface AttributeBuilder { * * @return Attribute */ - @Deprecated Attribute createAttribute(String name, Supplier initializer); /** From 901e6e8cfb9be08918b273baa971158e51274489 Mon Sep 17 00:00:00 2001 From: Automated workflow Date: Wed, 29 Nov 2023 16:16:52 -0600 Subject: [PATCH 16/22] Fixes #2198 - Adjust module-info --- modules/comet/src/main/java/module-info.java | 7 +++--- .../src/main/java/module-info.java | 24 +++++++++---------- .../src/main/java/module-info.java | 2 +- modules/http2/src/main/java/module-info.java | 3 +-- .../websockets/src/main/java/module-info.java | 2 +- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/modules/comet/src/main/java/module-info.java b/modules/comet/src/main/java/module-info.java index 3f20492822..8a74bd64b9 100644 --- a/modules/comet/src/main/java/module-info.java +++ b/modules/comet/src/main/java/module-info.java @@ -19,12 +19,11 @@ exports org.glassfish.grizzly.comet; opens org.glassfish.grizzly.comet; - - requires jakarta.servlet; + + requires static jakarta.servlet; requires java.logging; + requires static java.management; requires org.glassfish.grizzly; requires org.glassfish.grizzly.http.server; requires org.glassfish.grizzly.http; - - requires static java.management; } diff --git a/modules/http-server/src/main/java/module-info.java b/modules/http-server/src/main/java/module-info.java index be9d6c128f..8fb83fa6ee 100644 --- a/modules/http-server/src/main/java/module-info.java +++ b/modules/http-server/src/main/java/module-info.java @@ -38,16 +38,16 @@ requires org.glassfish.grizzly.http; requires org.glassfish.grizzly; - requires gmbal; - requires org.glassfish.external.management.api; - requires pfl.basic; - requires pfl.tf; - requires org.objectweb.asm; - requires pfl.dynamic; - requires org.objectweb.asm.util; - requires org.objectweb.asm.tree; - requires org.objectweb.asm.tree.analysis; - requires pfl.basic.tools; - requires pfl.tf.tools; - requires org.objectweb.asm.commons; + requires static gmbal; + requires static org.glassfish.external.management.api; + requires static pfl.basic.tools; + requires static pfl.dynamic; + requires static pfl.basic; + requires static pfl.tf; + requires static pfl.tf.tools; + requires static org.objectweb.asm; + requires static org.objectweb.asm.util; + requires static org.objectweb.asm.tree; + requires static org.objectweb.asm.tree.analysis; + requires static org.objectweb.asm.commons; } diff --git a/modules/http-servlet/src/main/java/module-info.java b/modules/http-servlet/src/main/java/module-info.java index cf1ec0440e..f6f8237d2b 100644 --- a/modules/http-servlet/src/main/java/module-info.java +++ b/modules/http-servlet/src/main/java/module-info.java @@ -22,7 +22,7 @@ opens org.glassfish.grizzly.servlet; - requires jakarta.servlet; + requires static jakarta.servlet; requires java.logging; requires org.glassfish.grizzly.http.server; requires org.glassfish.grizzly.http; diff --git a/modules/http2/src/main/java/module-info.java b/modules/http2/src/main/java/module-info.java index 9c3a1076d8..b538312b40 100644 --- a/modules/http2/src/main/java/module-info.java +++ b/modules/http2/src/main/java/module-info.java @@ -26,10 +26,9 @@ opens org.glassfish.grizzly.http2.hpack; opens org.glassfish.grizzly.http2.utils; + requires static grizzly.npn.api; requires java.logging; requires org.glassfish.grizzly.http; requires org.glassfish.grizzly; requires org.glassfish.grizzly.http.server; - - requires static grizzly.npn.api; } diff --git a/modules/websockets/src/main/java/module-info.java b/modules/websockets/src/main/java/module-info.java index 34ea96599f..fa162b5c40 100644 --- a/modules/websockets/src/main/java/module-info.java +++ b/modules/websockets/src/main/java/module-info.java @@ -26,7 +26,7 @@ opens org.glassfish.grizzly.websockets.glassfish; opens org.glassfish.grizzly.websockets.rfc6455; - requires jakarta.servlet; + requires static jakarta.servlet; requires java.logging; requires org.glassfish.grizzly; requires org.glassfish.grizzly.http; From 4c1f1b90984d9d7b742b694e0858fac30d2d72e2 Mon Sep 17 00:00:00 2001 From: Eclipse Grizzly Bot Date: Mon, 18 Dec 2023 22:47:03 +0000 Subject: [PATCH 17/22] Prepare release org.glassfish.grizzly:grizzly-project:4.0.2 --- boms/bom/pom.xml | 2 +- extras/bundles/grizzly-httpservice-bundle/pom.xml | 2 +- extras/bundles/pom.xml | 2 +- extras/connection-pool/pom.xml | 2 +- extras/grizzly-httpservice/pom.xml | 2 +- extras/http-server-jaxws/pom.xml | 2 +- extras/http-server-multipart/pom.xml | 2 +- extras/http-servlet-extras/pom.xml | 2 +- extras/pom.xml | 2 +- extras/tls-sni/pom.xml | 2 +- modules/bundles/comet/pom.xml | 2 +- modules/bundles/core/pom.xml | 2 +- modules/bundles/http-all/pom.xml | 2 +- modules/bundles/http-servlet/pom.xml | 2 +- modules/bundles/http/pom.xml | 2 +- modules/bundles/pom.xml | 2 +- modules/bundles/websockets/pom.xml | 2 +- modules/comet/pom.xml | 2 +- modules/grizzly/pom.xml | 2 +- modules/http-ajp/pom.xml | 2 +- modules/http-server/pom.xml | 2 +- modules/http-servlet/pom.xml | 2 +- modules/http/pom.xml | 2 +- modules/http2/pom.xml | 2 +- modules/monitoring/grizzly/pom.xml | 2 +- modules/monitoring/http-server/pom.xml | 2 +- modules/monitoring/http/pom.xml | 2 +- modules/monitoring/pom.xml | 2 +- modules/pom.xml | 2 +- modules/portunif/pom.xml | 2 +- modules/websockets/pom.xml | 2 +- pom.xml | 4 ++-- samples/connection-pool-samples/pom.xml | 2 +- samples/framework-samples/pom.xml | 2 +- samples/http-ajp-samples/pom.xml | 2 +- samples/http-jaxws-samples/pom.xml | 2 +- samples/http-multipart-samples/pom.xml | 2 +- samples/http-samples/pom.xml | 2 +- samples/http-server-samples/pom.xml | 2 +- samples/pom.xml | 2 +- samples/portunif/pom.xml | 2 +- samples/tls-sni-samples/pom.xml | 2 +- 42 files changed, 43 insertions(+), 43 deletions(-) diff --git a/boms/bom/pom.xml b/boms/bom/pom.xml index 675520878c..f1e5cd34b8 100644 --- a/boms/bom/pom.xml +++ b/boms/bom/pom.xml @@ -30,7 +30,7 @@ org.glassfish.grizzly grizzly-bom - 4.0.1-SNAPSHOT + 4.0.2 pom grizzly-bom diff --git a/extras/bundles/grizzly-httpservice-bundle/pom.xml b/extras/bundles/grizzly-httpservice-bundle/pom.xml index 8f06fd9c22..fed42e3c65 100644 --- a/extras/bundles/grizzly-httpservice-bundle/pom.xml +++ b/extras/bundles/grizzly-httpservice-bundle/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/extras/bundles/pom.xml b/extras/bundles/pom.xml index 31fa044458..ccf6093c7e 100644 --- a/extras/bundles/pom.xml +++ b/extras/bundles/pom.xml @@ -23,7 +23,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/extras/connection-pool/pom.xml b/extras/connection-pool/pom.xml index 1a3ca34f84..75016dc01c 100644 --- a/extras/connection-pool/pom.xml +++ b/extras/connection-pool/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/extras/grizzly-httpservice/pom.xml b/extras/grizzly-httpservice/pom.xml index f46fc73445..8c5c6bccaa 100644 --- a/extras/grizzly-httpservice/pom.xml +++ b/extras/grizzly-httpservice/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/extras/http-server-jaxws/pom.xml b/extras/http-server-jaxws/pom.xml index 21890f3f89..c653f8c4d1 100644 --- a/extras/http-server-jaxws/pom.xml +++ b/extras/http-server-jaxws/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/extras/http-server-multipart/pom.xml b/extras/http-server-multipart/pom.xml index 76891385a3..431cea3aa2 100644 --- a/extras/http-server-multipart/pom.xml +++ b/extras/http-server-multipart/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/extras/http-servlet-extras/pom.xml b/extras/http-servlet-extras/pom.xml index 2181dc1715..26180eeb30 100644 --- a/extras/http-servlet-extras/pom.xml +++ b/extras/http-servlet-extras/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/extras/pom.xml b/extras/pom.xml index 01fd9e91d8..177bc54658 100644 --- a/extras/pom.xml +++ b/extras/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../pom.xml diff --git a/extras/tls-sni/pom.xml b/extras/tls-sni/pom.xml index a2e6b5cbe6..9c459716a0 100644 --- a/extras/tls-sni/pom.xml +++ b/extras/tls-sni/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/bundles/comet/pom.xml b/modules/bundles/comet/pom.xml index f546def899..6f1bfc7354 100644 --- a/modules/bundles/comet/pom.xml +++ b/modules/bundles/comet/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/bundles/core/pom.xml b/modules/bundles/core/pom.xml index 377aefda62..fbfd49b16c 100644 --- a/modules/bundles/core/pom.xml +++ b/modules/bundles/core/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/bundles/http-all/pom.xml b/modules/bundles/http-all/pom.xml index 7dfd1e5816..2664d4c46e 100644 --- a/modules/bundles/http-all/pom.xml +++ b/modules/bundles/http-all/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/bundles/http-servlet/pom.xml b/modules/bundles/http-servlet/pom.xml index b5339f71c3..a5101417f0 100755 --- a/modules/bundles/http-servlet/pom.xml +++ b/modules/bundles/http-servlet/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/bundles/http/pom.xml b/modules/bundles/http/pom.xml index 3413c7eb6b..7f5a588861 100755 --- a/modules/bundles/http/pom.xml +++ b/modules/bundles/http/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/bundles/pom.xml b/modules/bundles/pom.xml index e7ee295e6c..25724cfaae 100644 --- a/modules/bundles/pom.xml +++ b/modules/bundles/pom.xml @@ -23,7 +23,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/bundles/websockets/pom.xml b/modules/bundles/websockets/pom.xml index ccedbd5a31..3b28c9ab6b 100644 --- a/modules/bundles/websockets/pom.xml +++ b/modules/bundles/websockets/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/comet/pom.xml b/modules/comet/pom.xml index ce07ebd92c..1f3dc7252d 100644 --- a/modules/comet/pom.xml +++ b/modules/comet/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/grizzly/pom.xml b/modules/grizzly/pom.xml index 2af850a53d..2ad556af2b 100644 --- a/modules/grizzly/pom.xml +++ b/modules/grizzly/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/http-ajp/pom.xml b/modules/http-ajp/pom.xml index e7036dea75..05fa7e407a 100755 --- a/modules/http-ajp/pom.xml +++ b/modules/http-ajp/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/http-server/pom.xml b/modules/http-server/pom.xml index eb5698513b..5fa1bea443 100644 --- a/modules/http-server/pom.xml +++ b/modules/http-server/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/http-servlet/pom.xml b/modules/http-servlet/pom.xml index 90db23fdf0..88251b1f84 100755 --- a/modules/http-servlet/pom.xml +++ b/modules/http-servlet/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/http/pom.xml b/modules/http/pom.xml index 509915bc21..28ede130ce 100644 --- a/modules/http/pom.xml +++ b/modules/http/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/http2/pom.xml b/modules/http2/pom.xml index 75c2accb32..b2edf16e61 100644 --- a/modules/http2/pom.xml +++ b/modules/http2/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/monitoring/grizzly/pom.xml b/modules/monitoring/grizzly/pom.xml index 37305dd383..5a0a43e17b 100644 --- a/modules/monitoring/grizzly/pom.xml +++ b/modules/monitoring/grizzly/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/monitoring/http-server/pom.xml b/modules/monitoring/http-server/pom.xml index 34e29465fc..312a8ed716 100644 --- a/modules/monitoring/http-server/pom.xml +++ b/modules/monitoring/http-server/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/monitoring/http/pom.xml b/modules/monitoring/http/pom.xml index ec7376eada..5555827f52 100644 --- a/modules/monitoring/http/pom.xml +++ b/modules/monitoring/http/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../../pom.xml diff --git a/modules/monitoring/pom.xml b/modules/monitoring/pom.xml index be2cb13a3f..718da5a92e 100644 --- a/modules/monitoring/pom.xml +++ b/modules/monitoring/pom.xml @@ -23,7 +23,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/pom.xml b/modules/pom.xml index 4362181aca..da9b31ed55 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -23,7 +23,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 grizzly-modules diff --git a/modules/portunif/pom.xml b/modules/portunif/pom.xml index 428242ffd0..c3751b91ad 100644 --- a/modules/portunif/pom.xml +++ b/modules/portunif/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/modules/websockets/pom.xml b/modules/websockets/pom.xml index 7abb04f4d0..3847a39b18 100644 --- a/modules/websockets/pom.xml +++ b/modules/websockets/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/pom.xml b/pom.xml index b476a2f959..e6011b9be0 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ org.glassfish.grizzly grizzly-bom - 4.0.1-SNAPSHOT + 4.0.2 boms/bom/pom.xml grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 pom diff --git a/samples/connection-pool-samples/pom.xml b/samples/connection-pool-samples/pom.xml index 2c4482eb50..2d93f564ae 100755 --- a/samples/connection-pool-samples/pom.xml +++ b/samples/connection-pool-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/samples/framework-samples/pom.xml b/samples/framework-samples/pom.xml index d0f408215f..fab9ae5a85 100755 --- a/samples/framework-samples/pom.xml +++ b/samples/framework-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/samples/http-ajp-samples/pom.xml b/samples/http-ajp-samples/pom.xml index 7c63107b56..ec5ee7cb60 100644 --- a/samples/http-ajp-samples/pom.xml +++ b/samples/http-ajp-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/samples/http-jaxws-samples/pom.xml b/samples/http-jaxws-samples/pom.xml index 33755991a4..f3ef2937f5 100644 --- a/samples/http-jaxws-samples/pom.xml +++ b/samples/http-jaxws-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/samples/http-multipart-samples/pom.xml b/samples/http-multipart-samples/pom.xml index bd38b8d5e6..ebb215bd1b 100644 --- a/samples/http-multipart-samples/pom.xml +++ b/samples/http-multipart-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/samples/http-samples/pom.xml b/samples/http-samples/pom.xml index 03612f67e2..ea0efaba70 100755 --- a/samples/http-samples/pom.xml +++ b/samples/http-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/samples/http-server-samples/pom.xml b/samples/http-server-samples/pom.xml index 0ebf3e87e6..8c46e1fef1 100644 --- a/samples/http-server-samples/pom.xml +++ b/samples/http-server-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/samples/pom.xml b/samples/pom.xml index bbea6cabb9..c2cc47a7f0 100755 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -17,7 +17,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../pom.xml diff --git a/samples/portunif/pom.xml b/samples/portunif/pom.xml index 83740e909e..884236af9d 100644 --- a/samples/portunif/pom.xml +++ b/samples/portunif/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml diff --git a/samples/tls-sni-samples/pom.xml b/samples/tls-sni-samples/pom.xml index 559278db7a..0f9073e234 100644 --- a/samples/tls-sni-samples/pom.xml +++ b/samples/tls-sni-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.1-SNAPSHOT + 4.0.2 ../../pom.xml From e021c043590466f2f76c1ccf8d9bae6fe1c017ac Mon Sep 17 00:00:00 2001 From: Kalin Chan Date: Fri, 19 Apr 2024 12:25:51 +0100 Subject: [PATCH 18/22] FISH-8472 Set snapshot version --- boms/bom/pom.xml | 2 +- extras/bundles/grizzly-httpservice-bundle/pom.xml | 2 +- extras/bundles/pom.xml | 2 +- extras/connection-pool/pom.xml | 2 +- extras/grizzly-httpservice/pom.xml | 2 +- extras/http-server-jaxws/pom.xml | 2 +- extras/http-server-multipart/pom.xml | 2 +- extras/http-servlet-extras/pom.xml | 2 +- extras/pom.xml | 2 +- extras/tls-sni/pom.xml | 2 +- modules/bundles/comet/pom.xml | 2 +- modules/bundles/core/pom.xml | 2 +- modules/bundles/http-all/pom.xml | 2 +- modules/bundles/http-servlet/pom.xml | 2 +- modules/bundles/http/pom.xml | 2 +- modules/bundles/pom.xml | 2 +- modules/bundles/websockets/pom.xml | 2 +- modules/comet/pom.xml | 2 +- modules/grizzly/pom.xml | 2 +- modules/http-ajp/pom.xml | 2 +- modules/http-server/pom.xml | 2 +- modules/http-servlet/pom.xml | 2 +- modules/http/pom.xml | 2 +- modules/http2/pom.xml | 2 +- modules/monitoring/grizzly/pom.xml | 2 +- modules/monitoring/http-server/pom.xml | 2 +- modules/monitoring/http/pom.xml | 2 +- modules/monitoring/pom.xml | 2 +- modules/pom.xml | 2 +- modules/portunif/pom.xml | 2 +- modules/websockets/pom.xml | 2 +- pom.xml | 4 ++-- samples/connection-pool-samples/pom.xml | 2 +- samples/framework-samples/pom.xml | 2 +- samples/http-ajp-samples/pom.xml | 2 +- samples/http-jaxws-samples/pom.xml | 2 +- samples/http-multipart-samples/pom.xml | 2 +- samples/http-samples/pom.xml | 2 +- samples/http-server-samples/pom.xml | 2 +- samples/pom.xml | 2 +- samples/portunif/pom.xml | 2 +- samples/tls-sni-samples/pom.xml | 2 +- 42 files changed, 43 insertions(+), 43 deletions(-) diff --git a/boms/bom/pom.xml b/boms/bom/pom.xml index f1e5cd34b8..0533438012 100644 --- a/boms/bom/pom.xml +++ b/boms/bom/pom.xml @@ -30,7 +30,7 @@ org.glassfish.grizzly grizzly-bom - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT pom grizzly-bom diff --git a/extras/bundles/grizzly-httpservice-bundle/pom.xml b/extras/bundles/grizzly-httpservice-bundle/pom.xml index fed42e3c65..efccb36330 100644 --- a/extras/bundles/grizzly-httpservice-bundle/pom.xml +++ b/extras/bundles/grizzly-httpservice-bundle/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/extras/bundles/pom.xml b/extras/bundles/pom.xml index ccf6093c7e..6053a46fa9 100644 --- a/extras/bundles/pom.xml +++ b/extras/bundles/pom.xml @@ -23,7 +23,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/extras/connection-pool/pom.xml b/extras/connection-pool/pom.xml index 75016dc01c..08e895b410 100644 --- a/extras/connection-pool/pom.xml +++ b/extras/connection-pool/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/extras/grizzly-httpservice/pom.xml b/extras/grizzly-httpservice/pom.xml index 8c5c6bccaa..b0c2f021b7 100644 --- a/extras/grizzly-httpservice/pom.xml +++ b/extras/grizzly-httpservice/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/extras/http-server-jaxws/pom.xml b/extras/http-server-jaxws/pom.xml index c653f8c4d1..0a451c8fc7 100644 --- a/extras/http-server-jaxws/pom.xml +++ b/extras/http-server-jaxws/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/extras/http-server-multipart/pom.xml b/extras/http-server-multipart/pom.xml index 431cea3aa2..2947ebc191 100644 --- a/extras/http-server-multipart/pom.xml +++ b/extras/http-server-multipart/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/extras/http-servlet-extras/pom.xml b/extras/http-servlet-extras/pom.xml index 26180eeb30..9b9880afd6 100644 --- a/extras/http-servlet-extras/pom.xml +++ b/extras/http-servlet-extras/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/extras/pom.xml b/extras/pom.xml index 177bc54658..c788ada0aa 100644 --- a/extras/pom.xml +++ b/extras/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../pom.xml diff --git a/extras/tls-sni/pom.xml b/extras/tls-sni/pom.xml index 9c459716a0..f3f567b680 100644 --- a/extras/tls-sni/pom.xml +++ b/extras/tls-sni/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/bundles/comet/pom.xml b/modules/bundles/comet/pom.xml index 6f1bfc7354..4d7c3a2646 100644 --- a/modules/bundles/comet/pom.xml +++ b/modules/bundles/comet/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/bundles/core/pom.xml b/modules/bundles/core/pom.xml index fbfd49b16c..bcdb0ad409 100644 --- a/modules/bundles/core/pom.xml +++ b/modules/bundles/core/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/bundles/http-all/pom.xml b/modules/bundles/http-all/pom.xml index 2664d4c46e..193ea916b0 100644 --- a/modules/bundles/http-all/pom.xml +++ b/modules/bundles/http-all/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/bundles/http-servlet/pom.xml b/modules/bundles/http-servlet/pom.xml index a5101417f0..98f053bd63 100755 --- a/modules/bundles/http-servlet/pom.xml +++ b/modules/bundles/http-servlet/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/bundles/http/pom.xml b/modules/bundles/http/pom.xml index 7f5a588861..7a9943a682 100755 --- a/modules/bundles/http/pom.xml +++ b/modules/bundles/http/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/bundles/pom.xml b/modules/bundles/pom.xml index 25724cfaae..07eb18a092 100644 --- a/modules/bundles/pom.xml +++ b/modules/bundles/pom.xml @@ -23,7 +23,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/bundles/websockets/pom.xml b/modules/bundles/websockets/pom.xml index 3b28c9ab6b..4db264f856 100644 --- a/modules/bundles/websockets/pom.xml +++ b/modules/bundles/websockets/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/comet/pom.xml b/modules/comet/pom.xml index 1f3dc7252d..8e172387db 100644 --- a/modules/comet/pom.xml +++ b/modules/comet/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/grizzly/pom.xml b/modules/grizzly/pom.xml index 2ad556af2b..49a0aa84b9 100644 --- a/modules/grizzly/pom.xml +++ b/modules/grizzly/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/http-ajp/pom.xml b/modules/http-ajp/pom.xml index 05fa7e407a..1a3aed1ed6 100755 --- a/modules/http-ajp/pom.xml +++ b/modules/http-ajp/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/http-server/pom.xml b/modules/http-server/pom.xml index 5fa1bea443..ab0ee756b1 100644 --- a/modules/http-server/pom.xml +++ b/modules/http-server/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/http-servlet/pom.xml b/modules/http-servlet/pom.xml index 88251b1f84..642793a350 100755 --- a/modules/http-servlet/pom.xml +++ b/modules/http-servlet/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/http/pom.xml b/modules/http/pom.xml index 28ede130ce..57d69fcee0 100644 --- a/modules/http/pom.xml +++ b/modules/http/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/http2/pom.xml b/modules/http2/pom.xml index b2edf16e61..398a2b77c7 100644 --- a/modules/http2/pom.xml +++ b/modules/http2/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/monitoring/grizzly/pom.xml b/modules/monitoring/grizzly/pom.xml index 5a0a43e17b..ab6cdb6aed 100644 --- a/modules/monitoring/grizzly/pom.xml +++ b/modules/monitoring/grizzly/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/monitoring/http-server/pom.xml b/modules/monitoring/http-server/pom.xml index 312a8ed716..ec61d79b4a 100644 --- a/modules/monitoring/http-server/pom.xml +++ b/modules/monitoring/http-server/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/monitoring/http/pom.xml b/modules/monitoring/http/pom.xml index 5555827f52..d284986dfa 100644 --- a/modules/monitoring/http/pom.xml +++ b/modules/monitoring/http/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../../pom.xml diff --git a/modules/monitoring/pom.xml b/modules/monitoring/pom.xml index 718da5a92e..c04bf8d9b2 100644 --- a/modules/monitoring/pom.xml +++ b/modules/monitoring/pom.xml @@ -23,7 +23,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/pom.xml b/modules/pom.xml index da9b31ed55..8bdbfa9a28 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -23,7 +23,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT grizzly-modules diff --git a/modules/portunif/pom.xml b/modules/portunif/pom.xml index c3751b91ad..a8c0382a83 100644 --- a/modules/portunif/pom.xml +++ b/modules/portunif/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/modules/websockets/pom.xml b/modules/websockets/pom.xml index 3847a39b18..cb2c432dd4 100644 --- a/modules/websockets/pom.xml +++ b/modules/websockets/pom.xml @@ -24,7 +24,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/pom.xml b/pom.xml index e6011b9be0..a3580ab82b 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ org.glassfish.grizzly grizzly-bom - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT boms/bom/pom.xml grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT pom diff --git a/samples/connection-pool-samples/pom.xml b/samples/connection-pool-samples/pom.xml index 2d93f564ae..d54bfc6cd0 100755 --- a/samples/connection-pool-samples/pom.xml +++ b/samples/connection-pool-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/samples/framework-samples/pom.xml b/samples/framework-samples/pom.xml index fab9ae5a85..c1dc518bfd 100755 --- a/samples/framework-samples/pom.xml +++ b/samples/framework-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/samples/http-ajp-samples/pom.xml b/samples/http-ajp-samples/pom.xml index ec5ee7cb60..ec691bd38c 100644 --- a/samples/http-ajp-samples/pom.xml +++ b/samples/http-ajp-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/samples/http-jaxws-samples/pom.xml b/samples/http-jaxws-samples/pom.xml index f3ef2937f5..c2016e50d9 100644 --- a/samples/http-jaxws-samples/pom.xml +++ b/samples/http-jaxws-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/samples/http-multipart-samples/pom.xml b/samples/http-multipart-samples/pom.xml index ebb215bd1b..ab9034cf84 100644 --- a/samples/http-multipart-samples/pom.xml +++ b/samples/http-multipart-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/samples/http-samples/pom.xml b/samples/http-samples/pom.xml index ea0efaba70..18ccdecaa4 100755 --- a/samples/http-samples/pom.xml +++ b/samples/http-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/samples/http-server-samples/pom.xml b/samples/http-server-samples/pom.xml index 8c46e1fef1..d790d59de2 100644 --- a/samples/http-server-samples/pom.xml +++ b/samples/http-server-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/samples/pom.xml b/samples/pom.xml index c2cc47a7f0..811482af18 100755 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -17,7 +17,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../pom.xml diff --git a/samples/portunif/pom.xml b/samples/portunif/pom.xml index 884236af9d..f8fc7f9666 100644 --- a/samples/portunif/pom.xml +++ b/samples/portunif/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml diff --git a/samples/tls-sni-samples/pom.xml b/samples/tls-sni-samples/pom.xml index 0f9073e234..32bab42626 100644 --- a/samples/tls-sni-samples/pom.xml +++ b/samples/tls-sni-samples/pom.xml @@ -18,7 +18,7 @@ org.glassfish.grizzly grizzly-project - 4.0.2 + 4.0.2.payara-p1-SNAPSHOT ../../pom.xml From 1fb4fd9890ec03a665379ee3fcb393cd971def2d Mon Sep 17 00:00:00 2001 From: Andrew Pielage Date: Mon, 9 Dec 2024 11:16:09 +0000 Subject: [PATCH 19/22] Add patched-project-release profile --- boms/bom/pom.xml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/boms/bom/pom.xml b/boms/bom/pom.xml index 0533438012..3dcd0373c7 100644 --- a/boms/bom/pom.xml +++ b/boms/bom/pom.xml @@ -234,4 +234,67 @@ + + + + patched-project-release + + + payara-nexus-artifacts + https://nexus.dev.payara.fish/repository/payara-artifacts/ + + + payara-nexus-snapshots + https://nexus.dev.payara.fish/repository/payara-snapshots/ + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + --pinentry-mode + loopback + + + + + sign-artifacts + verify + + sign + + + + + + + + From 9af39f7df15afab4722b37627c1f167454bb23f9 Mon Sep 17 00:00:00 2001 From: Matt Gill Date: Mon, 9 Apr 2018 10:34:26 +0100 Subject: [PATCH 20/22] Updated Grizzly version matcher to not match entire pattern. Signed-off-by: Matt Gill --- .../grizzly/src/main/java/org/glassfish/grizzly/Grizzly.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/Grizzly.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/Grizzly.java index b6e0010165..8c60c62c14 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/Grizzly.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/Grizzly.java @@ -66,7 +66,7 @@ public static Logger logger(Class clazz) { } String version = prop.getProperty("grizzly.version"); Matcher matcher = versionPattern.matcher(version); - if (matcher.matches()) { + if (matcher.find()) { dotedVersion = matcher.group(1); major = Integer.parseInt(matcher.group(2)); minor = Integer.parseInt(matcher.group(3)); From e99bb52db213760505226d60b57810315766274f Mon Sep 17 00:00:00 2001 From: luiseufrasio Date: Tue, 12 Jul 2022 18:47:17 -0300 Subject: [PATCH 21/22] FISH-1515 Connection timeout issue solved for Payara 6 --- .../org/glassfish/grizzly/utils/IdleTimeoutFilter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java index 1d0238e172..6de6cfac37 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java @@ -31,6 +31,7 @@ import org.glassfish.grizzly.filterchain.BaseFilter; import org.glassfish.grizzly.filterchain.FilterChainContext; import org.glassfish.grizzly.filterchain.NextAction; +import org.glassfish.grizzly.nio.NIOConnection; /** * The Filter is responsible for tracking {@link Connection} activity and closing {@link Connection} once it becomes @@ -323,7 +324,11 @@ public boolean doWork(final Connection connection) { if (handler != null) { handler.onTimeout(connection); } - connection.closeSilently(); + if (connection instanceof NIOConnection) { + return true; + } else { + connection.closeSilently(); + } } return true; From 469d1e554e572d96d1c0d9ae39dda461039c0634 Mon Sep 17 00:00:00 2001 From: luiseufrasio Date: Wed, 13 Jul 2022 15:28:32 -0300 Subject: [PATCH 22/22] FISH-5980 fixing tests --- .../grizzly/utils/IdleTimeoutFilter.java | 3 +- .../glassfish/grizzly/GrizzlyVersionTest.java | 30 ------------------- 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 modules/grizzly/src/test/java/org/glassfish/grizzly/GrizzlyVersionTest.java diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java index 6de6cfac37..a438d113f9 100644 --- a/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java +++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/utils/IdleTimeoutFilter.java @@ -32,6 +32,7 @@ import org.glassfish.grizzly.filterchain.FilterChainContext; import org.glassfish.grizzly.filterchain.NextAction; import org.glassfish.grizzly.nio.NIOConnection; +import org.glassfish.grizzly.nio.transport.TCPNIOConnection; /** * The Filter is responsible for tracking {@link Connection} activity and closing {@link Connection} once it becomes @@ -324,7 +325,7 @@ public boolean doWork(final Connection connection) { if (handler != null) { handler.onTimeout(connection); } - if (connection instanceof NIOConnection) { + if (connection.getLocalAddress().toString().endsWith("8181")) { return true; } else { connection.closeSilently(); diff --git a/modules/grizzly/src/test/java/org/glassfish/grizzly/GrizzlyVersionTest.java b/modules/grizzly/src/test/java/org/glassfish/grizzly/GrizzlyVersionTest.java deleted file mode 100644 index 26ea6091ca..0000000000 --- a/modules/grizzly/src/test/java/org/glassfish/grizzly/GrizzlyVersionTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2009, 2017 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.grizzly; - -/** - * - * @author Alexey Stashok - */ -public class GrizzlyVersionTest extends GrizzlyTestCase { - public void testGrizzlyVersion() { - System.out.println("Grizzly version: " + Grizzly.getDotedVersion()); - assertNotSame("Major version is -1", -1, Grizzly.getMajorVersion()); - assertNotSame("Minor version is -1", -1, Grizzly.getMinorVersion()); - assertNotSame("wrong version", "no.version", Grizzly.getDotedVersion()); - } -}