From 91ede06376e30f1a9ead9f08586d0ab39bf93d21 Mon Sep 17 00:00:00 2001 From: dansiviter Date: Fri, 13 May 2022 06:34:45 +0100 Subject: [PATCH 01/17] Use Jsonb more effectively (#5047) --- .../jsonb/internal/JsonBindingProvider.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/internal/JsonBindingProvider.java b/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/internal/JsonBindingProvider.java index 98ea299fc6..efc7c814e4 100644 --- a/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/internal/JsonBindingProvider.java +++ b/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/internal/JsonBindingProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022 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,9 +19,17 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.lang.annotation.Annotation; import java.lang.reflect.Type; +import org.glassfish.jersey.jsonb.LocalizationMessages; +import org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider; +import org.glassfish.jersey.message.internal.EntityInputStream; + +import jakarta.json.bind.Jsonb; +import jakarta.json.bind.JsonbBuilder; +import jakarta.json.bind.JsonbException; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.ProcessingException; import jakarta.ws.rs.Produces; @@ -34,14 +42,6 @@ import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Providers; -import jakarta.json.bind.Jsonb; -import jakarta.json.bind.JsonbBuilder; -import jakarta.json.bind.JsonbException; - -import org.glassfish.jersey.jsonb.LocalizationMessages; -import org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider; -import org.glassfish.jersey.message.internal.EntityInputStream; - /** * Entity provider (reader and writer) for JSONB. * @@ -100,9 +100,8 @@ public void writeTo(Object o, Class type, Type genericType, OutputStream entityStream) throws IOException, WebApplicationException { Jsonb jsonb = getJsonb(type); try { - entityStream.write(jsonb.toJson(o).getBytes(AbstractMessageReaderWriterProvider.getCharset(mediaType))); - entityStream.flush(); - } catch (IOException e) { + jsonb.toJson(o, genericType, new OutputStreamWriter(entityStream, getCharset(mediaType))); + } catch (JsonbException e) { throw new ProcessingException(LocalizationMessages.ERROR_JSONB_SERIALIZATION(), e); } } From c0ed81dd7ffa686d9181f86c9e1469ff6312f038 Mon Sep 17 00:00:00 2001 From: jbescos Date: Tue, 17 May 2022 16:05:58 +0200 Subject: [PATCH 02/17] Netty Connector doesn't support Followredirects (#5048) Signed-off-by: Jorge Bescos Gascon --- .../netty/connector/JerseyClientHandler.java | 62 ++++++- .../connector/NettyClientProperties.java | 14 ++ .../netty/connector/NettyConnector.java | 29 ++-- .../connector/internal/RedirectException.java | 62 +++++++ .../netty/connector/localization.properties | 7 +- .../netty/connector/FollowRedirectsTest.java | 163 ++++++++++++++++++ docs/src/main/docbook/appendix-properties.xml | 12 ++ docs/src/main/docbook/jersey.ent | 1 + 8 files changed, 332 insertions(+), 18 deletions(-) create mode 100644 connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/RedirectException.java create mode 100644 connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/FollowRedirectsTest.java diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/JerseyClientHandler.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/JerseyClientHandler.java index 93e20c25a3..af8fa5a158 100644 --- a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/JerseyClientHandler.java +++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/JerseyClientHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2022 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 @@ -18,15 +18,20 @@ import java.io.IOException; import java.io.InputStream; +import java.net.URI; import java.util.Map; +import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeoutException; +import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; +import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.ClientRequest; import org.glassfish.jersey.client.ClientResponse; import org.glassfish.jersey.netty.connector.internal.NettyInputStream; +import org.glassfish.jersey.netty.connector.internal.RedirectException; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; @@ -35,6 +40,7 @@ import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpObject; import io.netty.handler.codec.http.HttpResponse; +import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.HttpUtil; import io.netty.handler.codec.http.LastHttpContent; import io.netty.handler.timeout.IdleStateEvent; @@ -46,21 +52,32 @@ */ class JerseyClientHandler extends SimpleChannelInboundHandler { + private static final int DEFAULT_MAX_REDIRECTS = 5; + + // Modified only by the same thread. No need to synchronize it. + private final Set redirectUriHistory; private final ClientRequest jerseyRequest; private final CompletableFuture responseAvailable; private final CompletableFuture responseDone; + private final boolean followRedirects; + private final int maxRedirects; + private final NettyConnector connector; private NettyInputStream nis; private ClientResponse jerseyResponse; private boolean readTimedOut; - JerseyClientHandler(ClientRequest request, - CompletableFuture responseAvailable, - CompletableFuture responseDone) { + JerseyClientHandler(ClientRequest request, CompletableFuture responseAvailable, + CompletableFuture responseDone, Set redirectUriHistory, NettyConnector connector) { + this.redirectUriHistory = redirectUriHistory; this.jerseyRequest = request; this.responseAvailable = responseAvailable; this.responseDone = responseDone; + // Follow redirects by default + this.followRedirects = jerseyRequest.resolveProperty(ClientProperties.FOLLOW_REDIRECTS, true); + this.maxRedirects = jerseyRequest.resolveProperty(NettyClientProperties.MAX_REDIRECTS, DEFAULT_MAX_REDIRECTS); + this.connector = connector; } @Override @@ -83,7 +100,41 @@ protected void notifyResponse() { if (jerseyResponse != null) { ClientResponse cr = jerseyResponse; jerseyResponse = null; - responseAvailable.complete(cr); + int responseStatus = cr.getStatus(); + if (followRedirects + && (responseStatus == HttpResponseStatus.MOVED_PERMANENTLY.code() + || responseStatus == HttpResponseStatus.FOUND.code() + || responseStatus == HttpResponseStatus.SEE_OTHER.code() + || responseStatus == HttpResponseStatus.TEMPORARY_REDIRECT.code() + || responseStatus == HttpResponseStatus.PERMANENT_REDIRECT.code())) { + String location = cr.getHeaderString(HttpHeaders.LOCATION); + if (location == null || location.isEmpty()) { + responseAvailable.completeExceptionally(new RedirectException(LocalizationMessages.REDIRECT_NO_LOCATION())); + } else { + try { + URI newUri = URI.create(location); + boolean alreadyRequested = !redirectUriHistory.add(newUri); + if (alreadyRequested) { + // infinite loop detection + responseAvailable.completeExceptionally( + new RedirectException(LocalizationMessages.REDIRECT_INFINITE_LOOP())); + } else if (redirectUriHistory.size() > maxRedirects) { + // maximal number of redirection + responseAvailable.completeExceptionally( + new RedirectException(LocalizationMessages.REDIRECT_LIMIT_REACHED(maxRedirects))); + } else { + ClientRequest newReq = new ClientRequest(jerseyRequest); + newReq.setUri(newUri); + connector.execute(newReq, redirectUriHistory, responseAvailable); + } + } catch (IllegalArgumentException e) { + responseAvailable.completeExceptionally( + new RedirectException(LocalizationMessages.REDIRECT_ERROR_DETERMINING_LOCATION(location))); + } + } + } else { + responseAvailable.complete(cr); + } } } @@ -91,7 +142,6 @@ protected void notifyResponse() { public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) { if (msg instanceof HttpResponse) { final HttpResponse response = (HttpResponse) msg; - jerseyResponse = new ClientResponse(new Response.StatusType() { @Override public int getStatusCode() { diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyClientProperties.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyClientProperties.java index bf34699708..671b08ff25 100644 --- a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyClientProperties.java +++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyClientProperties.java @@ -68,4 +68,18 @@ public class NettyClientProperties { * @see javax.net.ssl.SSLParameters#setEndpointIdentificationAlgorithm(String) */ public static final String ENABLE_SSL_HOSTNAME_VERIFICATION = "jersey.config.client.tls.enableHostnameVerification"; + + /** + * The maximal number of redirects during single request. + *

+ * Value is expected to be positive {@link Integer}. Default value is {@value #DEFAULT_MAX_REDIRECTS}. + *

+ * HTTP redirection must be enabled by property {@link org.glassfish.jersey.client.ClientProperties#FOLLOW_REDIRECTS}, + * otherwise {@code MAX_REDIRECTS} is not applied. + * + * @since 2.36 + * @see org.glassfish.jersey.client.ClientProperties#FOLLOW_REDIRECTS + * @see org.glassfish.jersey.netty.connector.internal.RedirectException + */ + public static final String MAX_REDIRECTS = "jersey.config.client.NettyConnectorProvider.maxRedirects"; } diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java index c97ea2e16c..ba1f8c2354 100644 --- a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java +++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java @@ -22,9 +22,11 @@ import java.net.URI; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; +import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutorService; @@ -151,7 +153,9 @@ class NettyConnector implements Connector { @Override public ClientResponse apply(ClientRequest jerseyRequest) { try { - return execute(jerseyRequest).join(); + CompletableFuture response = new CompletableFuture<>(); + execute(jerseyRequest, new HashSet<>(), response); + return response.join(); } catch (CompletionException cex) { final Throwable t = cex.getCause() == null ? cex : cex.getCause(); throw new ProcessingException(t.getMessage(), t); @@ -162,19 +166,25 @@ public ClientResponse apply(ClientRequest jerseyRequest) { @Override public Future apply(final ClientRequest jerseyRequest, final AsyncConnectorCallback jerseyCallback) { - return execute(jerseyRequest).whenCompleteAsync((r, th) -> { - if (th == null) jerseyCallback.response(r); - else jerseyCallback.failure(th); - }, executorService); + CompletableFuture response = new CompletableFuture<>(); + response.whenCompleteAsync((r, th) -> { + if (th == null) { + jerseyCallback.response(r); + } else { + jerseyCallback.failure(th); + } + }, executorService); + execute(jerseyRequest, new HashSet<>(), response); + return response; } - protected CompletableFuture execute(final ClientRequest jerseyRequest) { + protected void execute(final ClientRequest jerseyRequest, final Set redirectUriHistory, + final CompletableFuture responseAvailable) { Integer timeout = jerseyRequest.resolveProperty(ClientProperties.READ_TIMEOUT, 0); if (timeout == null || timeout < 0) { throw new ProcessingException(LocalizationMessages.WRONG_READ_TIMEOUT(timeout)); } - final CompletableFuture responseAvailable = new CompletableFuture<>(); final CompletableFuture responseDone = new CompletableFuture<>(); final URI requestUri = jerseyRequest.getUri(); @@ -290,7 +300,8 @@ protected void initChannel(SocketChannel ch) throws Exception { // assert: it is ok to abort the entire response, if responseDone is completed exceptionally - in particular, nothing // will leak final Channel ch = chan; - JerseyClientHandler clientHandler = new JerseyClientHandler(jerseyRequest, responseAvailable, responseDone); + JerseyClientHandler clientHandler = + new JerseyClientHandler(jerseyRequest, responseAvailable, responseDone, redirectUriHistory, this); // read timeout makes sense really as an inactivity timeout ch.pipeline().addLast(READ_TIMEOUT_HANDLER, new IdleStateHandler(0, 0, timeout, TimeUnit.MILLISECONDS)); @@ -411,8 +422,6 @@ public void run() { } catch (InterruptedException e) { responseDone.completeExceptionally(e); } - - return responseAvailable; } private String buildPathWithQueryParameters(URI requestUri) { diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/RedirectException.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/RedirectException.java new file mode 100644 index 0000000000..bef04e1803 --- /dev/null +++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/RedirectException.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2022 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.jersey.netty.connector.internal; + +import org.glassfish.jersey.client.ClientProperties; + +/** + * This Exception is used only if {@link ClientProperties#FOLLOW_REDIRECTS} is set to {@code true}. + *

+ * This exception is thrown when any of the Redirect HTTP response status codes (301, 302, 303, 307, 308) is received and: + *

    + *
  • + * the chained redirection count exceeds the value of + * {@link org.glassfish.jersey.netty.connector.NettyClientProperties#MAX_REDIRECTS} + *
  • + *
  • + * or an infinite redirection loop is detected + *
  • + *
  • + * or Location response header is missing, empty or does not contain a valid {@link java.net.URI}. + *
  • + *
+ * + */ +public class RedirectException extends Exception { + + private static final long serialVersionUID = 4357724300486801294L; + + /** + * Constructor. + * + * @param message the detail message. The detail message is saved for + * later retrieval by the {@link #getMessage()} method. + */ + public RedirectException(String message) { + super(message); + } + + /** + * Constructor. + * + * @param message the detail message. The detail message is saved for + * later retrieval by the {@link #getMessage()} method. + */ + public RedirectException(String message, Throwable t) { + super(message, t); + } +} diff --git a/connectors/netty-connector/src/main/resources/org/glassfish/jersey/netty/connector/localization.properties b/connectors/netty-connector/src/main/resources/org/glassfish/jersey/netty/connector/localization.properties index bf12db6c02..9055d6277a 100644 --- a/connectors/netty-connector/src/main/resources/org/glassfish/jersey/netty/connector/localization.properties +++ b/connectors/netty-connector/src/main/resources/org/glassfish/jersey/netty/connector/localization.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2022 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,4 +19,7 @@ wrong.read.timeout=Unexpected ("{0}") READ_TIMEOUT. wrong.max.pool.size=Unexpected ("{0}") maximum number of connections per destination. wrong.max.pool.total=Unexpected ("{0}") maximum number of connections total. wrong.max.pool.idle=Unexpected ("{0}") maximum number of idle seconds. - +redirect.no.location="Received redirect that does not contain a location or the location is empty." +redirect.error.determining.location="Error determining redirect location: ({0})." +redirect.infinite.loop="Infinite loop in chained redirects detected." +redirect.limit.reached="Max chained redirect limit ({0}) exceeded." diff --git a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/FollowRedirectsTest.java b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/FollowRedirectsTest.java new file mode 100644 index 0000000000..269562297d --- /dev/null +++ b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/FollowRedirectsTest.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2022 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.jersey.netty.connector; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.net.URI; +import java.util.logging.Logger; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.ProcessingException; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Application; +import javax.ws.rs.core.Response; + +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.logging.LoggingFeature; +import org.glassfish.jersey.netty.connector.internal.RedirectException; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.junit.Test; + +public class FollowRedirectsTest extends JerseyTest { + + private static final Logger LOGGER = Logger.getLogger(FollowRedirectsTest.class.getName()); + private static final String TEST_URL = "http://localhost:9998/test"; + + @Path("/test") + public static class RedirectResource { + @GET + public String get() { + return "GET"; + } + + @GET + @Path("redirect") + public Response redirect() { + return Response.seeOther(URI.create(TEST_URL)).build(); + } + + @GET + @Path("loop") + public Response loop() { + return Response.seeOther(URI.create(TEST_URL + "/loop")).build(); + } + + @GET + @Path("redirect2") + public Response redirect2() { + return Response.seeOther(URI.create(TEST_URL + "/redirect")).build(); + } + } + + @Override + protected Application configure() { + ResourceConfig config = new ResourceConfig(RedirectResource.class); + config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY)); + return config; + } + + @Override + protected void configureClient(ClientConfig config) { + config.property(ClientProperties.FOLLOW_REDIRECTS, false); + config.connectorProvider(new NettyConnectorProvider()); + } + + @Test + public void testDoFollow() { + final URI u = target().getUri(); + ClientConfig config = new ClientConfig().property(ClientProperties.FOLLOW_REDIRECTS, true); + config.connectorProvider(new NettyConnectorProvider()); + Client c = ClientBuilder.newClient(config); + WebTarget t = c.target(u); + Response r = t.path("test/redirect") + .request().get(); + assertEquals(200, r.getStatus()); + assertEquals("GET", r.readEntity(String.class)); + c.close(); + } + + @Test + public void testDoFollowPerRequestOverride() { + WebTarget t = target("test/redirect"); + t.property(ClientProperties.FOLLOW_REDIRECTS, true); + Response r = t.request().get(); + assertEquals(200, r.getStatus()); + assertEquals("GET", r.readEntity(String.class)); + } + + @Test + public void testDontFollow() { + WebTarget t = target("test/redirect"); + assertEquals(303, t.request().get().getStatus()); + } + + @Test + public void testDontFollowPerRequestOverride() { + final URI u = target().getUri(); + ClientConfig config = new ClientConfig().property(ClientProperties.FOLLOW_REDIRECTS, true); + config.connectorProvider(new NettyConnectorProvider()); + Client client = ClientBuilder.newClient(config); + WebTarget t = client.target(u); + t.property(ClientProperties.FOLLOW_REDIRECTS, false); + Response r = t.path("test/redirect").request().get(); + assertEquals(303, r.getStatus()); + client.close(); + } + + @Test + public void testInfiniteLoop() { + WebTarget t = target("test/loop"); + t.property(ClientProperties.FOLLOW_REDIRECTS, true); + try { + t.request().get(); + fail("Expected exception"); + } catch (ProcessingException e) { + assertEquals(RedirectException.class, e.getCause().getClass()); + assertEquals(LocalizationMessages.REDIRECT_INFINITE_LOOP(), e.getCause().getMessage()); + } + } + + @Test + public void testRedirectLimitReached() { + WebTarget t = target("test/redirect2"); + t.property(ClientProperties.FOLLOW_REDIRECTS, true); + t.property(NettyClientProperties.MAX_REDIRECTS, 1); + try { + t.request().get(); + fail("Expected exception"); + } catch (ProcessingException e) { + assertEquals(RedirectException.class, e.getCause().getClass()); + assertEquals(LocalizationMessages.REDIRECT_LIMIT_REACHED(1), e.getCause().getMessage()); + } + } + + @Test + public void testRedirectNoLimitReached() { + WebTarget t = target("test/redirect2"); + t.property(ClientProperties.FOLLOW_REDIRECTS, true); + Response r = t.request().get(); + assertEquals(200, r.getStatus()); + assertEquals("GET", r.readEntity(String.class)); + } +} diff --git a/docs/src/main/docbook/appendix-properties.xml b/docs/src/main/docbook/appendix-properties.xml index 2dd099d228..0f085eb6d4 100644 --- a/docs/src/main/docbook/appendix-properties.xml +++ b/docs/src/main/docbook/appendix-properties.xml @@ -1810,6 +1810,18 @@ + + &jersey.netty.NettyClientProperties.MAX_REDIRECTS; + jersey.config.client.NettyConnectorProvider.maxRedirect + + + This property determines the maximal number of redirects during single request. Value is expected to be + positive number. Default value is 5. + HTTP redirection must be enabled by property org.glassfish.jersey.client.ClientProperties.FOLLOW_REDIRECTS + otherwise &jersey.netty.NettyClientProperties.MAX_REDIRECTS; is not applied. + + + diff --git a/docs/src/main/docbook/jersey.ent b/docs/src/main/docbook/jersey.ent index 88d5f4f471..1c8bdb0564 100644 --- a/docs/src/main/docbook/jersey.ent +++ b/docs/src/main/docbook/jersey.ent @@ -537,6 +537,7 @@ NettyClientProperties.IDLE_CONNECTION_PRUNE_TIMEOUT" > NettyClientProperties.MAX_CONNECTIONS" > NettyClientProperties.MAX_CONNECTIONS_TOTAL" > +NettyClientProperties.MAX_REDIRECTS" > NettyConnectorProvider"> ApplicationHandler"> @BackgroundScheduler"> From 31f6557fce90b7dade46afacfc4c97b65883bb2c Mon Sep 17 00:00:00 2001 From: jansupol Date: Thu, 14 Apr 2022 21:13:23 +0200 Subject: [PATCH 03/17] Adopt ASM 9.3 Signed-off-by: jansupol --- NOTICE.md | 2 +- .../org/objectweb/asm/AnnotationVisitor.java | 16 ++++----- .../org/objectweb/asm/ByteVector.java | 12 +++++++ .../org/objectweb/asm/ClassReader.java | 15 ++++---- .../org/objectweb/asm/ClassVisitor.java | 17 +++++---- .../org/objectweb/asm/ClassWriter.java | 34 ++++++++++++++---- .../org/objectweb/asm/FieldVisitor.java | 19 +++++----- .../org/objectweb/asm/MethodVisitor.java | 30 ++++++++-------- .../org/objectweb/asm/MethodWriter.java | 35 ++++++++++--------- .../org/objectweb/asm/ModuleVisitor.java | 4 +-- .../repackaged/org/objectweb/asm/Opcodes.java | 1 + .../objectweb/asm/RecordComponentVisitor.java | 4 +-- .../repackaged/org/objectweb/asm/Type.java | 2 +- .../scanning/AnnotationAcceptingListener.java | 4 +-- .../main/resources/META-INF/NOTICE.markdown | 2 +- pom.xml | 2 +- 16 files changed, 116 insertions(+), 83 deletions(-) diff --git a/NOTICE.md b/NOTICE.md index c0ef15f056..7a27297587 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -95,7 +95,7 @@ KineticJS, v4.7.1 * Project: http://www.kineticjs.com, https://github.com/ericdrowell/KineticJS * Copyright: Eric Rowell -org.objectweb.asm Version 8.0 +org.objectweb.asm Version 9.3 * License: Modified BSD (https://asm.ow2.io/license.html) * Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved. diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationVisitor.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationVisitor.java index 8ca2039014..0654582e49 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationVisitor.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationVisitor.java @@ -38,8 +38,8 @@ public abstract class AnnotationVisitor { /** - * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * The ASM API version implemented by this visitor. The value of this field must be one of the + * {@code ASM}x values in {@link Opcodes}. */ protected final int api; @@ -52,22 +52,22 @@ public abstract class AnnotationVisitor { /** * Constructs a new {@link AnnotationVisitor}. * - * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * @param api the ASM API version implemented by this visitor. Must be one of the {@code + * ASM}x values in {@link Opcodes}. */ - public AnnotationVisitor(final int api) { + protected AnnotationVisitor(final int api) { this(api, null); } /** * Constructs a new {@link AnnotationVisitor}. * - * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * @param api the ASM API version implemented by this visitor. Must be one of the {@code + * ASM}x values in {@link Opcodes}. * @param annotationVisitor the annotation visitor to which this visitor must delegate method * calls. May be {@literal null}. */ - public AnnotationVisitor(final int api, final AnnotationVisitor annotationVisitor) { + protected AnnotationVisitor(final int api, final AnnotationVisitor annotationVisitor) { if (api != Opcodes.ASM9 && api != Opcodes.ASM8 && api != Opcodes.ASM7 diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ByteVector.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ByteVector.java index 7b386a06f2..472318f820 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ByteVector.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ByteVector.java @@ -65,6 +65,15 @@ public ByteVector(final int initialCapacity) { this.length = data.length; } + /** + * Returns the actual number of bytes in this vector. + * + * @return the actual number of bytes in this vector. + */ + public int size() { + return length; + } + /** * Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary. * @@ -352,6 +361,9 @@ public ByteVector putByteArray( * @param size number of additional bytes that this byte vector should be able to receive. */ private void enlarge(final int size) { + if (length > data.length) { + throw new AssertionError("Internal error"); + } int doubleCapacity = 2 * data.length; int minimalCapacity = length + size; byte[] newData = new byte[doubleCapacity > minimalCapacity ? doubleCapacity : minimalCapacity]; diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassReader.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassReader.java index b0173c8141..cd4a6bb5ad 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassReader.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassReader.java @@ -194,7 +194,7 @@ public ClassReader( this.b = classFileBuffer; // Check the class' major_version. This field is after the magic and minor_version fields, which // use 4 and 2 bytes respectively. - if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V18) { + if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V19) { throw new IllegalArgumentException( "Unsupported class file major version " + readShort(classFileOffset + 6)); } @@ -308,12 +308,13 @@ public ClassReader(final String className) throws IOException { * @return the content of the given input stream. * @throws IOException if a problem occurs during reading. */ + @SuppressWarnings("PMD.UseTryWithResources") private static byte[] readStream(final InputStream inputStream, final boolean close) throws IOException { if (inputStream == null) { throw new IOException("Class not found"); } - int bufferSize = calculateBufferSize(inputStream); + int bufferSize = computeBufferSize(inputStream); try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { byte[] data = new byte[bufferSize]; int bytesRead; @@ -334,19 +335,19 @@ private static byte[] readStream(final InputStream inputStream, final boolean cl } } - private static int calculateBufferSize(final InputStream inputStream) throws IOException { + private static int computeBufferSize(final InputStream inputStream) throws IOException { int expectedLength = inputStream.available(); /* - * Some implementations can return 0 while holding available data - * (e.g. new FileInputStream("/proc/a_file")) - * Also in some pathological cases a very small number might be returned, - * and in this case we use default size + * Some implementations can return 0 while holding available data (e.g. new + * FileInputStream("/proc/a_file")). Also in some pathological cases a very small number might + * be returned, and in this case we use a default size. */ if (expectedLength < 256) { return INPUT_STREAM_DATA_CHUNK_SIZE; } return Math.min(expectedLength, MAX_BUFFER_SIZE); } + // ----------------------------------------------------------------------------------------------- // Accessors // ----------------------------------------------------------------------------------------------- diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassVisitor.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassVisitor.java index e3a5b605f2..8ebf594f64 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassVisitor.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassVisitor.java @@ -40,8 +40,8 @@ public abstract class ClassVisitor { /** - * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * The ASM API version implemented by this visitor. The value of this field must be one of the + * {@code ASM}x values in {@link Opcodes}. */ protected final int api; @@ -51,23 +51,22 @@ public abstract class ClassVisitor { /** * Constructs a new {@link ClassVisitor}. * - * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * @param api the ASM API version implemented by this visitor. Must be one of the {@code + * ASM}x values in {@link Opcodes}. */ - public ClassVisitor(final int api) { + protected ClassVisitor(final int api) { this(api, null); } /** * Constructs a new {@link ClassVisitor}. * - * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7}, {@link - * Opcodes#ASM8} or {@link Opcodes#ASM9}. + * @param api the ASM API version implemented by this visitor. Must be one of the {@code + * ASM}x values in {@link Opcodes}. * @param classVisitor the class visitor to which this visitor must delegate method calls. May be * null. */ - public ClassVisitor(final int api, final ClassVisitor classVisitor) { + protected ClassVisitor(final int api, final ClassVisitor classVisitor) { if (api != Opcodes.ASM9 && api != Opcodes.ASM8 && api != Opcodes.ASM7 diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassWriter.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassWriter.java index 81176b8cc9..de2c44194a 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassWriter.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassWriter.java @@ -65,6 +65,12 @@ public class ClassWriter extends ClassVisitor { */ public static final int COMPUTE_FRAMES = 2; + /** + * The flags passed to the constructor. Must be zero or more of {@link #COMPUTE_MAXS} and {@link + * #COMPUTE_FRAMES}. + */ + private final int flags; + // Note: fields are ordered as in the ClassFile structure, and those related to attributes are // ordered as in Section 4.7 of the JVMS. @@ -248,23 +254,39 @@ public ClassWriter(final int flags) { * @param classReader the {@link ClassReader} used to read the original class. It will be used to * copy the entire constant pool and bootstrap methods from the original class and also to * copy other fragments of original bytecode where applicable. - * @param flags option flags that can be used to modify the default behavior of this class.Must be - * zero or more of {@link #COMPUTE_MAXS} and {@link #COMPUTE_FRAMES}. These option flags do - * not affect methods that are copied as is in the new class. This means that neither the + * @param flags option flags that can be used to modify the default behavior of this class. Must + * be zero or more of {@link #COMPUTE_MAXS} and {@link #COMPUTE_FRAMES}. These option flags + * do not affect methods that are copied as is in the new class. This means that neither the * maximum stack size nor the stack frames will be computed for these methods. */ public ClassWriter(final ClassReader classReader, final int flags) { super(/* latest api = */ Opcodes.ASM9); + this.flags = flags; symbolTable = classReader == null ? new SymbolTable(this) : new SymbolTable(this, classReader); if ((flags & COMPUTE_FRAMES) != 0) { - this.compute = MethodWriter.COMPUTE_ALL_FRAMES; + compute = MethodWriter.COMPUTE_ALL_FRAMES; } else if ((flags & COMPUTE_MAXS) != 0) { - this.compute = MethodWriter.COMPUTE_MAX_STACK_AND_LOCAL; + compute = MethodWriter.COMPUTE_MAX_STACK_AND_LOCAL; } else { - this.compute = MethodWriter.COMPUTE_NOTHING; + compute = MethodWriter.COMPUTE_NOTHING; } } + // ----------------------------------------------------------------------------------------------- + // Accessors + // ----------------------------------------------------------------------------------------------- + + /** + * Returns true if all the given flags were passed to the constructor. + * + * @param flags some option flags. Must be zero or more of {@link #COMPUTE_MAXS} and {@link + * #COMPUTE_FRAMES}. + * @return true if all the given flags, or more, were passed to the constructor. + */ + public boolean hasFlags(final int flags) { + return (this.flags & flags) == flags; + } + // ----------------------------------------------------------------------------------------------- // Implementation of the ClassVisitor abstract class // ----------------------------------------------------------------------------------------------- diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/FieldVisitor.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/FieldVisitor.java index 716d6b0fbe..64865d6d9a 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/FieldVisitor.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/FieldVisitor.java @@ -37,9 +37,8 @@ public abstract class FieldVisitor { /** - * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7}, {@link - * Opcodes#ASM8} or {@link Opcodes#ASM9}. + * The ASM API version implemented by this visitor. The value of this field must be one of the + * {@code ASM}x values in {@link Opcodes}. */ protected final int api; @@ -49,24 +48,22 @@ public abstract class FieldVisitor { /** * Constructs a new {@link FieldVisitor}. * - * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7}, {@link - * Opcodes#ASM8} or {@link Opcodes#ASM9}. + * @param api the ASM API version implemented by this visitor. Must be one of the {@code + * ASM}x values in {@link Opcodes}. */ - public FieldVisitor(final int api) { + protected FieldVisitor(final int api) { this(api, null); } /** * Constructs a new {@link FieldVisitor}. * - * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7} or {@link - * Opcodes#ASM8}. + * @param api the ASM API version implemented by this visitor. Must be one of the {@code + * ASM}x values in {@link Opcodes}. * @param fieldVisitor the field visitor to which this visitor must delegate method calls. May be * null. */ - public FieldVisitor(final int api, final FieldVisitor fieldVisitor) { + protected FieldVisitor(final int api, final FieldVisitor fieldVisitor) { if (api != Opcodes.ASM9 && api != Opcodes.ASM8 && api != Opcodes.ASM7 diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodVisitor.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodVisitor.java index 77392c7fec..805aed5017 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodVisitor.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodVisitor.java @@ -51,8 +51,8 @@ public abstract class MethodVisitor { private static final String REQUIRES_ASM5 = "This feature requires ASM5"; /** - * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * The ASM API version implemented by this visitor. The value of this field must be one of the + * {@code ASM}x values in {@link Opcodes}. */ protected final int api; @@ -64,22 +64,22 @@ public abstract class MethodVisitor { /** * Constructs a new {@link MethodVisitor}. * - * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * @param api the ASM API version implemented by this visitor. Must be one of the {@code + * ASM}x values in {@link Opcodes}. */ - public MethodVisitor(final int api) { + protected MethodVisitor(final int api) { this(api, null); } /** * Constructs a new {@link MethodVisitor}. * - * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * @param api the ASM API version implemented by this visitor. Must be one of the {@code + * ASM}x values in {@link Opcodes}. * @param methodVisitor the method visitor to which this visitor must delegate method calls. May * be null. */ - public MethodVisitor(final int api, final MethodVisitor methodVisitor) { + protected MethodVisitor(final int api, final MethodVisitor methodVisitor) { if (api != Opcodes.ASM9 && api != Opcodes.ASM8 && api != Opcodes.ASM7 @@ -351,12 +351,12 @@ public void visitIntInsn(final int opcode, final int operand) { * * @param opcode the opcode of the local variable instruction to be visited. This opcode is either * ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET. - * @param var the operand of the instruction to be visited. This operand is the index of a local - * variable. + * @param varIndex the operand of the instruction to be visited. This operand is the index of a + * local variable. */ - public void visitVarInsn(final int opcode, final int var) { + public void visitVarInsn(final int opcode, final int varIndex) { if (mv != null) { - mv.visitVarInsn(opcode, var); + mv.visitVarInsn(opcode, varIndex); } } @@ -554,12 +554,12 @@ public void visitLdcInsn(final Object value) { /** * Visits an IINC instruction. * - * @param var index of the local variable to be incremented. + * @param varIndex index of the local variable to be incremented. * @param increment amount to increment the local variable by. */ - public void visitIincInsn(final int var, final int increment) { + public void visitIincInsn(final int varIndex, final int increment) { if (mv != null) { - mv.visitIincInsn(var, increment); + mv.visitIincInsn(varIndex, increment); } } diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodWriter.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodWriter.java index 24f7f6182c..ea2e4e48ed 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodWriter.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodWriter.java @@ -466,7 +466,8 @@ final class MethodWriter extends MethodVisitor { /** * Indicates what must be computed. Must be one of {@link #COMPUTE_ALL_FRAMES}, {@link - * #COMPUTE_INSERTED_FRAMES}, {@link #COMPUTE_MAX_STACK_AND_LOCAL} or {@link #COMPUTE_NOTHING}. + * #COMPUTE_INSERTED_FRAMES}, {@link COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES}, {@link + * #COMPUTE_MAX_STACK_AND_LOCAL} or {@link #COMPUTE_NOTHING}. */ private final int compute; @@ -904,26 +905,26 @@ public void visitIntInsn(final int opcode, final int operand) { } @Override - public void visitVarInsn(final int opcode, final int var) { + public void visitVarInsn(final int opcode, final int varIndex) { lastBytecodeOffset = code.length; // Add the instruction to the bytecode of the method. - if (var < 4 && opcode != Opcodes.RET) { + if (varIndex < 4 && opcode != Opcodes.RET) { int optimizedOpcode; if (opcode < Opcodes.ISTORE) { - optimizedOpcode = Constants.ILOAD_0 + ((opcode - Opcodes.ILOAD) << 2) + var; + optimizedOpcode = Constants.ILOAD_0 + ((opcode - Opcodes.ILOAD) << 2) + varIndex; } else { - optimizedOpcode = Constants.ISTORE_0 + ((opcode - Opcodes.ISTORE) << 2) + var; + optimizedOpcode = Constants.ISTORE_0 + ((opcode - Opcodes.ISTORE) << 2) + varIndex; } code.putByte(optimizedOpcode); - } else if (var >= 256) { - code.putByte(Constants.WIDE).put12(opcode, var); + } else if (varIndex >= 256) { + code.putByte(Constants.WIDE).put12(opcode, varIndex); } else { - code.put11(opcode, var); + code.put11(opcode, varIndex); } // If needed, update the maximum stack size and number of locals, and stack map frames. if (currentBasicBlock != null) { if (compute == COMPUTE_ALL_FRAMES || compute == COMPUTE_INSERTED_FRAMES) { - currentBasicBlock.frame.execute(opcode, var, null, null); + currentBasicBlock.frame.execute(opcode, varIndex, null, null); } else { if (opcode == Opcodes.RET) { // No stack size delta. @@ -945,9 +946,9 @@ public void visitVarInsn(final int opcode, final int var) { || opcode == Opcodes.DLOAD || opcode == Opcodes.LSTORE || opcode == Opcodes.DSTORE) { - currentMaxLocals = var + 2; + currentMaxLocals = varIndex + 2; } else { - currentMaxLocals = var + 1; + currentMaxLocals = varIndex + 1; } if (currentMaxLocals > maxLocals) { maxLocals = currentMaxLocals; @@ -1307,21 +1308,21 @@ public void visitLdcInsn(final Object value) { } @Override - public void visitIincInsn(final int var, final int increment) { + public void visitIincInsn(final int varIndex, final int increment) { lastBytecodeOffset = code.length; // Add the instruction to the bytecode of the method. - if ((var > 255) || (increment > 127) || (increment < -128)) { - code.putByte(Constants.WIDE).put12(Opcodes.IINC, var).putShort(increment); + if ((varIndex > 255) || (increment > 127) || (increment < -128)) { + code.putByte(Constants.WIDE).put12(Opcodes.IINC, varIndex).putShort(increment); } else { - code.putByte(Opcodes.IINC).put11(var, increment); + code.putByte(Opcodes.IINC).put11(varIndex, increment); } // If needed, update the maximum stack size and number of locals, and stack map frames. if (currentBasicBlock != null && (compute == COMPUTE_ALL_FRAMES || compute == COMPUTE_INSERTED_FRAMES)) { - currentBasicBlock.frame.execute(Opcodes.IINC, var, null, null); + currentBasicBlock.frame.execute(Opcodes.IINC, varIndex, null, null); } if (compute != COMPUTE_NOTHING) { - int currentMaxLocals = var + 1; + int currentMaxLocals = varIndex + 1; if (currentMaxLocals > maxLocals) { maxLocals = currentMaxLocals; } diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ModuleVisitor.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ModuleVisitor.java index 0089d06a4f..96675909fa 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ModuleVisitor.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ModuleVisitor.java @@ -53,7 +53,7 @@ public abstract class ModuleVisitor { * @param api the ASM API version implemented by this visitor. Must be one of {@link Opcodes#ASM6} * or {@link Opcodes#ASM7}. */ - public ModuleVisitor(final int api) { + protected ModuleVisitor(final int api) { this(api, null); } @@ -65,7 +65,7 @@ public ModuleVisitor(final int api) { * @param moduleVisitor the module visitor to which this visitor must delegate method calls. May * be null. */ - public ModuleVisitor(final int api, final ModuleVisitor moduleVisitor) { + protected ModuleVisitor(final int api, final ModuleVisitor moduleVisitor) { if (api != Opcodes.ASM9 && api != Opcodes.ASM8 && api != Opcodes.ASM7 diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Opcodes.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Opcodes.java index 7850f21013..0a591eccd8 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Opcodes.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Opcodes.java @@ -284,6 +284,7 @@ public interface Opcodes { int V16 = 0 << 16 | 60; int V17 = 0 << 16 | 61; int V18 = 0 << 16 | 62; + int V19 = 0 << 16 | 63; /** * Version flag indicating that the class is using 'preview' features. diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/RecordComponentVisitor.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/RecordComponentVisitor.java index bab13adeb3..65cf92c9c8 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/RecordComponentVisitor.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/RecordComponentVisitor.java @@ -53,7 +53,7 @@ public abstract class RecordComponentVisitor { * @param api the ASM API version implemented by this visitor. Must be one of {@link Opcodes#ASM8} * or {@link Opcodes#ASM9}. */ - public RecordComponentVisitor(final int api) { + protected RecordComponentVisitor(final int api) { this(api, null); } @@ -64,7 +64,7 @@ public RecordComponentVisitor(final int api) { * @param recordComponentVisitor the record component visitor to which this visitor must delegate * method calls. May be null. */ - public RecordComponentVisitor( + protected RecordComponentVisitor( final int api, final RecordComponentVisitor recordComponentVisitor) { if (api != Opcodes.ASM9 && api != Opcodes.ASM8 diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Type.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Type.java index dbe11cce59..ab8687e4e8 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Type.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Type.java @@ -440,7 +440,7 @@ private static Type getTypeInternal( case '(': return new Type(METHOD, descriptorBuffer, descriptorBegin, descriptorEnd); default: - throw new IllegalArgumentException(); + throw new IllegalArgumentException("Invalid descriptor: " + descriptorBuffer); } } diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/AnnotationAcceptingListener.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/AnnotationAcceptingListener.java index 99c098134e..df41359f48 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/AnnotationAcceptingListener.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/AnnotationAcceptingListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2022 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 @@ -303,7 +303,7 @@ private Class getClassForName(final String className) { private static class ClassReaderWrapper { private static final Logger LOGGER = Logger.getLogger(ClassReader.class.getName()); - private static final int WARN_VERSION = Opcodes.V18; + private static final int WARN_VERSION = Opcodes.V19; private static final int INPUT_STREAM_DATA_CHUNK_SIZE = 4096; private final byte[] b; diff --git a/core-server/src/main/resources/META-INF/NOTICE.markdown b/core-server/src/main/resources/META-INF/NOTICE.markdown index f975c4963c..9399ca7152 100644 --- a/core-server/src/main/resources/META-INF/NOTICE.markdown +++ b/core-server/src/main/resources/META-INF/NOTICE.markdown @@ -36,7 +36,7 @@ org.glassfish.jersey.server.internal.monitoring.core * Copyright (c) 2015-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2010-2013 Coda Hale and Yammer, Inc. -org.objectweb.asm Version 8.0 +org.objectweb.asm Version 9.3 * License: Modified BSD (https://asm.ow2.io/license.html) * Copyright: (c) 2000-2011 INRIA, France Telecom. All rights reserved. diff --git a/pom.xml b/pom.xml index 4f2ea78880..983da586ed 100644 --- a/pom.xml +++ b/pom.xml @@ -2108,7 +2108,7 @@ ${project.version} - 9.2 + 9.3 2.3.6 1.1 2.0.2 From f40c630b60f018da7938d63895f5c29ef13ce0f5 Mon Sep 17 00:00:00 2001 From: jansupol Date: Fri, 20 May 2022 20:22:29 +0200 Subject: [PATCH 04/17] Prevent LoggingFeature timeout on context#hasEntity for HEADERS_ONLY Signed-off-by: jansupol --- .../jersey/logging/ClientLoggingFilter.java | 4 +- .../jersey/logging/ServerLoggingFilter.java | 4 +- .../jersey/logging/HasEntityTimeoutTest.java | 277 ++++++++++++++++++ 3 files changed, 281 insertions(+), 4 deletions(-) create mode 100644 core-common/src/test/java/org/glassfish/jersey/logging/HasEntityTimeoutTest.java diff --git a/core-common/src/main/java/org/glassfish/jersey/logging/ClientLoggingFilter.java b/core-common/src/main/java/org/glassfish/jersey/logging/ClientLoggingFilter.java index b250915db6..8b9b6fb042 100644 --- a/core-common/src/main/java/org/glassfish/jersey/logging/ClientLoggingFilter.java +++ b/core-common/src/main/java/org/glassfish/jersey/logging/ClientLoggingFilter.java @@ -83,7 +83,7 @@ public void filter(final ClientRequestContext context) throws IOException { printRequestLine(b, "Sending client request", id, context.getMethod(), context.getUri()); printPrefixedHeaders(b, id, REQUEST_PREFIX, context.getStringHeaders()); - if (context.hasEntity() && printEntity(verbosity, context.getMediaType())) { + if (printEntity(verbosity, context.getMediaType()) && context.hasEntity()) { final OutputStream stream = new LoggingStream(b, context.getEntityStream()); context.setEntityStream(stream); context.setProperty(ENTITY_LOGGER_PROPERTY, stream); @@ -107,7 +107,7 @@ public void filter(final ClientRequestContext requestContext, final ClientRespon printResponseLine(b, "Client response received", id, responseContext.getStatus()); printPrefixedHeaders(b, id, RESPONSE_PREFIX, responseContext.getHeaders()); - if (responseContext.hasEntity() && printEntity(verbosity, responseContext.getMediaType())) { + if (printEntity(verbosity, responseContext.getMediaType()) && responseContext.hasEntity()) { responseContext.setEntityStream(logInboundEntity(b, responseContext.getEntityStream(), MessageUtils.getCharset(responseContext.getMediaType()))); } diff --git a/core-common/src/main/java/org/glassfish/jersey/logging/ServerLoggingFilter.java b/core-common/src/main/java/org/glassfish/jersey/logging/ServerLoggingFilter.java index 87cac240c1..b0f8523b7c 100644 --- a/core-common/src/main/java/org/glassfish/jersey/logging/ServerLoggingFilter.java +++ b/core-common/src/main/java/org/glassfish/jersey/logging/ServerLoggingFilter.java @@ -83,7 +83,7 @@ public void filter(final ContainerRequestContext context) throws IOException { printRequestLine(b, "Server has received a request", id, context.getMethod(), context.getUriInfo().getRequestUri()); printPrefixedHeaders(b, id, REQUEST_PREFIX, context.getHeaders()); - if (context.hasEntity() && printEntity(verbosity, context.getMediaType())) { + if (printEntity(verbosity, context.getMediaType()) && context.hasEntity()) { context.setEntityStream( logInboundEntity(b, context.getEntityStream(), MessageUtils.getCharset(context.getMediaType()))); } @@ -105,7 +105,7 @@ public void filter(final ContainerRequestContext requestContext, final Container printResponseLine(b, "Server responded with a response", id, responseContext.getStatus()); printPrefixedHeaders(b, id, RESPONSE_PREFIX, responseContext.getStringHeaders()); - if (responseContext.hasEntity() && printEntity(verbosity, responseContext.getMediaType())) { + if (printEntity(verbosity, responseContext.getMediaType()) && responseContext.hasEntity()) { final OutputStream stream = new LoggingStream(b, responseContext.getEntityStream()); responseContext.setEntityStream(stream); requestContext.setProperty(ENTITY_LOGGER_PROPERTY, stream); diff --git a/core-common/src/test/java/org/glassfish/jersey/logging/HasEntityTimeoutTest.java b/core-common/src/test/java/org/glassfish/jersey/logging/HasEntityTimeoutTest.java new file mode 100644 index 0000000000..35459f9422 --- /dev/null +++ b/core-common/src/test/java/org/glassfish/jersey/logging/HasEntityTimeoutTest.java @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2022 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.jersey.logging; + +import javax.ws.rs.ProcessingException; +import javax.ws.rs.client.ClientRequestContext; +import javax.ws.rs.client.ClientResponseContext; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerResponseContext; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.UriInfo; +import org.junit.Test; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.net.SocketTimeoutException; +import java.net.URI; +import java.util.logging.Level; +import java.util.logging.Logger; + + +public class HasEntityTimeoutTest { + + private enum DirectionType { + INBOUND, + OUTBOUND + } + + private static class UriInfoHandler implements InvocationHandler { + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + switch (method.getName()) { + case "getRequestUri": + return URI.create("http://localhost:8080/get"); + } + return null; + } + } + + private static class RequestResponseHandler implements InvocationHandler { + private final DirectionType type; + + private RequestResponseHandler(DirectionType type) { + this.type = type; + } + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + switch (method.getName()) { + case "hasEntity": + throw new ProcessingException(new SocketTimeoutException("Read timed out")); + case "getUri": + return URI.create("http://localhost:8080"); + case "getStringHeaders": + case "getHeaders": + return new MultivaluedHashMap(); + case "getMethod": + return "GET"; + case "getMediaType": + return MediaType.SERVER_SENT_EVENTS_TYPE; + case "getEntityStream": + return type == DirectionType.OUTBOUND + ? new ByteArrayOutputStream() + : new ByteArrayInputStream("entity".getBytes()); + case "getStatus": + return 200; + case "getUriInfo": + return Proxy.newProxyInstance( + UriInfo.class.getClassLoader(), + new Class[]{UriInfo.class}, + new UriInfoHandler()); + } + return null; + } + } + + @Test + public void testClientFilterTimedOut() throws IOException { + ClientLoggingFilter loggingFilter = new ClientLoggingFilter( + LoggingFeature.builder() + .withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME)) + .level(Level.INFO) + .verbosity(LoggingFeature.Verbosity.HEADERS_ONLY) + .maxEntitySize(10) + ); + + ClientRequestContext clientRequestContext = (ClientRequestContext) Proxy.newProxyInstance( + ClientRequestContext.class.getClassLoader(), + new Class[]{ClientRequestContext.class}, + new RequestResponseHandler(DirectionType.OUTBOUND)); + loggingFilter.filter(clientRequestContext); + } + + @Test + public void testClientFilterTimedOutException() throws IOException { + ClientLoggingFilter loggingFilter = new ClientLoggingFilter( + LoggingFeature.builder() + .withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME)) + .level(Level.INFO) + .verbosity(LoggingFeature.Verbosity.PAYLOAD_ANY) + .maxEntitySize(10) + ); + + ClientRequestContext clientRequestContext = (ClientRequestContext) Proxy.newProxyInstance( + ClientRequestContext.class.getClassLoader(), + new Class[]{ClientRequestContext.class}, + new RequestResponseHandler(DirectionType.OUTBOUND)); + try { + loggingFilter.filter(clientRequestContext); + throw new RuntimeException("The expected exception has not been thrown"); + } catch (ProcessingException pe) { + // expected + } + } + + @Test + public void testClientFilterResponseTimedOut() throws IOException { + ClientLoggingFilter loggingFilter = new ClientLoggingFilter( + LoggingFeature.builder() + .withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME)) + .level(Level.INFO) + .verbosity(LoggingFeature.Verbosity.HEADERS_ONLY) + .maxEntitySize(10) + ); + + ClientRequestContext clientRequestContext = (ClientRequestContext) Proxy.newProxyInstance( + ClientRequestContext.class.getClassLoader(), + new Class[]{ClientRequestContext.class}, + new RequestResponseHandler(DirectionType.OUTBOUND)); + + ClientResponseContext clientResponseContext = (ClientResponseContext) Proxy.newProxyInstance( + ClientResponseContext.class.getClassLoader(), + new Class[]{ClientResponseContext.class}, + new RequestResponseHandler(DirectionType.INBOUND)); + loggingFilter.filter(clientRequestContext, clientResponseContext); + } + + @Test + public void testClientFilterResponseTimedOutException() throws IOException { + ClientLoggingFilter loggingFilter = new ClientLoggingFilter( + LoggingFeature.builder() + .withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME)) + .level(Level.INFO) + .verbosity(LoggingFeature.Verbosity.PAYLOAD_ANY) + .maxEntitySize(10) + ); + + ClientRequestContext clientRequestContext = (ClientRequestContext) Proxy.newProxyInstance( + ClientRequestContext.class.getClassLoader(), + new Class[]{ClientRequestContext.class}, + new RequestResponseHandler(DirectionType.OUTBOUND)); + + ClientResponseContext clientResponseContext = (ClientResponseContext) Proxy.newProxyInstance( + ClientResponseContext.class.getClassLoader(), + new Class[]{ClientResponseContext.class}, + new RequestResponseHandler(DirectionType.INBOUND)); + + try { + loggingFilter.filter(clientRequestContext, clientResponseContext); + throw new RuntimeException("The expected exception has not been thrown"); + } catch (ProcessingException pe) { + // expected + } + } + + @Test + public void testServerFilterTimedOut() throws IOException { + ServerLoggingFilter loggingFilter = new ServerLoggingFilter( + LoggingFeature.builder() + .withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME)) + .level(Level.INFO) + .verbosity(LoggingFeature.Verbosity.HEADERS_ONLY) + .maxEntitySize(10) + ); + + ContainerRequestContext containerRequestContext = (ContainerRequestContext) Proxy.newProxyInstance( + ContainerRequestContext.class.getClassLoader(), + new Class[]{ContainerRequestContext.class}, + new RequestResponseHandler(DirectionType.INBOUND)); + loggingFilter.filter(containerRequestContext); + } + + @Test + public void testServerFilterTimedOutException() throws IOException { + ServerLoggingFilter loggingFilter = new ServerLoggingFilter( + LoggingFeature.builder() + .withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME)) + .level(Level.INFO) + .verbosity(LoggingFeature.Verbosity.PAYLOAD_ANY) + .maxEntitySize(10) + ); + + ContainerRequestContext containerRequestContext = (ContainerRequestContext) Proxy.newProxyInstance( + ContainerRequestContext.class.getClassLoader(), + new Class[]{ContainerRequestContext.class}, + new RequestResponseHandler(DirectionType.INBOUND)); + + try { + loggingFilter.filter(containerRequestContext); + throw new RuntimeException("The expected exception has not been thrown"); + } catch (ProcessingException pe) { + // expected + } + } + + @Test + public void testServerFilterResponseTimedOut() throws IOException { + ServerLoggingFilter loggingFilter = new ServerLoggingFilter( + LoggingFeature.builder() + .withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME)) + .level(Level.INFO) + .verbosity(LoggingFeature.Verbosity.HEADERS_ONLY) + .maxEntitySize(10) + ); + + ContainerRequestContext containerRequestContext = (ContainerRequestContext) Proxy.newProxyInstance( + ContainerRequestContext.class.getClassLoader(), + new Class[]{ContainerRequestContext.class}, + new RequestResponseHandler(DirectionType.INBOUND)); + + ContainerResponseContext containerResponseContext = (ContainerResponseContext) Proxy.newProxyInstance( + ContainerResponseContext.class.getClassLoader(), + new Class[]{ContainerResponseContext.class}, + new RequestResponseHandler(DirectionType.OUTBOUND)); + + loggingFilter.filter(containerRequestContext, containerResponseContext); + } + + @Test + public void testServerFilterResponseTimedOutException() throws IOException { + ServerLoggingFilter loggingFilter = new ServerLoggingFilter( + LoggingFeature.builder() + .withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME)) + .level(Level.INFO) + .verbosity(LoggingFeature.Verbosity.PAYLOAD_ANY) + .maxEntitySize(10) + ); + + ContainerRequestContext containerRequestContext = (ContainerRequestContext) Proxy.newProxyInstance( + ContainerRequestContext.class.getClassLoader(), + new Class[]{ContainerRequestContext.class}, + new RequestResponseHandler(DirectionType.INBOUND)); + + ContainerResponseContext containerResponseContext = (ContainerResponseContext) Proxy.newProxyInstance( + ContainerResponseContext.class.getClassLoader(), + new Class[]{ContainerResponseContext.class}, + new RequestResponseHandler(DirectionType.OUTBOUND)); + + try { + loggingFilter.filter(containerRequestContext, containerResponseContext); + throw new RuntimeException("The expected exception has not been thrown"); + } catch (ProcessingException pe) { + // expected + } + } + +} From bf6dd3db9f52f2511ed66430a5d51a6464754ace Mon Sep 17 00:00:00 2001 From: jansupol Date: Thu, 26 May 2022 14:31:55 +0200 Subject: [PATCH 05/17] Remove Spring 4 from Bom pom Signed-off-by: jansupol --- bom/pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 235c34e779..eebaa713f3 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -198,11 +198,6 @@ jersey-servlet-portability ${project.version} - - org.glassfish.jersey.ext - jersey-spring4 - ${project.version} - org.glassfish.jersey.ext jersey-spring5 From 6abd64c8124b03100ca67b48c06d0fe31f8d64cb Mon Sep 17 00:00:00 2001 From: jansupol <15908245+jansupol@users.noreply.github.com> Date: Thu, 9 Jun 2022 07:29:22 +0200 Subject: [PATCH 06/17] Update Netty proxy settings (#5071) Signed-off-by: jansupol --- .../jersey/jetty/connector/ProxyTest.java | 147 ------------- .../netty/connector/NettyConnector.java | 60 +++++- .../connector/proxy/ProxySelectorTest.java | 159 ++++++++++++++ .../e2e/client/connector/proxy/ProxyTest.java | 199 ++++++++++++++++++ 4 files changed, 412 insertions(+), 153 deletions(-) delete mode 100644 connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ProxyTest.java create mode 100644 tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/proxy/ProxySelectorTest.java create mode 100644 tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/proxy/ProxyTest.java diff --git a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ProxyTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ProxyTest.java deleted file mode 100644 index d5b4a02110..0000000000 --- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ProxyTest.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2019 Banco do Brasil S/A. 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.jersey.jetty.connector; - -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.glassfish.jersey.client.ClientConfig; -import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.test.JerseyTest; -import org.junit.Test; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.core.Application; -import javax.ws.rs.core.Response; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.Base64; - -import static org.junit.Assert.assertEquals; - -/** - * @author Marcelo Rubim -\ */ -public class ProxyTest extends JerseyTest { - private static final Charset CHARACTER_SET = Charset.forName("iso-8859-1"); - private static final String PROXY_URI = "http://127.0.0.1:9997"; - private static final String PROXY_USERNAME = "proxy-user"; - private static final String PROXY_PASSWORD = "proxy-password"; - - - @Path("") - public static class ProxyResource { - - @GET - public Response getProxy() { - return Response.status(407).header("Proxy-Authenticate", "Basic").build(); - } - - } - - @Path("proxyTest") - public static class ProxyTestResource { - - @GET - public Response getOK() { - return Response.ok().build(); - } - - } - - @Override - protected Application configure() { - ResourceConfig config = new ResourceConfig(ProxyResource.class, ProxyTestResource.class); - return config; - } - - @Override - protected void configureClient(ClientConfig config) { - config.connectorProvider(new JettyConnectorProvider()); - } - - @Test - public void testGet407() { - startFakeProxy(); - client().property(ClientProperties.PROXY_URI, ProxyTest.PROXY_URI); - Response response = target("proxyTest").request().get(); - assertEquals(407, response.getStatus()); - } - - @Test - public void testGetSuccess() { - startFakeProxy(); - client().property(ClientProperties.PROXY_URI, ProxyTest.PROXY_URI); - client().property(ClientProperties.PROXY_USERNAME, ProxyTest.PROXY_USERNAME); - client().property(ClientProperties.PROXY_PASSWORD, ProxyTest.PROXY_PASSWORD); - Response response = target("proxyTest").request().get(); - assertEquals(200, response.getStatus()); - } - - private void startFakeProxy(){ - Server server = new Server(9997); - server.setHandler(new ProxyHandler()); - try { - server.start(); - } catch (Exception e) { - - } - } - - class ProxyHandler extends AbstractHandler { - @Override - public void handle(String target, - Request baseRequest, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException { - - if (request.getHeader("Proxy-Authorization") != null) { - String proxyAuthorization = request.getHeader("Proxy-Authorization"); - String decoded = new String(Base64.getDecoder().decode(proxyAuthorization.substring(6).getBytes()), - CHARACTER_SET); - final String[] split = decoded.split(":"); - final String username = split[0]; - final String password = split[1]; - - if (!username.equals(PROXY_USERNAME)) { - response.setStatus(400); - System.out.println("Found unexpected username: " + username); - } - - if (!password.equals(PROXY_PASSWORD)) { - response.setStatus(400); - System.out.println("Found unexpected password: " + username); - } - response.setStatus(200); - //TODO Add redirect to requestURI - } else { - response.setStatus(407); - response.addHeader("Proxy-Authenticate", "Basic"); - } - - - baseRequest.setHandled(true); - } - } -} diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java index ba1f8c2354..6d67c9d867 100644 --- a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java +++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java @@ -19,6 +19,9 @@ import java.io.IOException; import java.io.OutputStream; import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.ProxySelector; +import java.net.SocketAddress; import java.net.URI; import java.util.ArrayList; import java.util.HashMap; @@ -45,6 +48,7 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; @@ -53,16 +57,20 @@ import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.http.DefaultFullHttpRequest; +import io.netty.handler.codec.http.DefaultHttpHeaders; import io.netty.handler.codec.http.DefaultHttpRequest; import io.netty.handler.codec.http.HttpChunkedInput; import io.netty.handler.codec.http.HttpClientCodec; import io.netty.handler.codec.http.HttpContentDecompressor; import io.netty.handler.codec.http.HttpHeaderNames; +import io.netty.handler.codec.http.HttpHeaders; import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.HttpUtil; import io.netty.handler.codec.http.HttpVersion; import io.netty.handler.proxy.HttpProxyHandler; +import io.netty.handler.proxy.ProxyConnectionEvent; +import io.netty.handler.proxy.ProxyHandler; import io.netty.handler.ssl.ApplicationProtocolConfig; import io.netty.handler.ssl.ClientAuth; import io.netty.handler.ssl.IdentityCipherSuiteFilter; @@ -223,6 +231,8 @@ protected void execute(final ClientRequest jerseyRequest, final Set redirec } } + Integer connectTimeout = jerseyRequest.resolveProperty(ClientProperties.CONNECT_TIMEOUT, 0); + if (chan == null) { Bootstrap b = new Bootstrap(); b.group(group) @@ -246,8 +256,29 @@ protected void initChannel(SocketChannel ch) throws Exception { InetSocketAddress proxyAddr = new InetSocketAddress(u.getHost(), u.getPort() == -1 ? 8080 : u.getPort()); - p.addLast(userName == null ? new HttpProxyHandler(proxyAddr) - : new HttpProxyHandler(proxyAddr, userName, password)); + ProxyHandler proxy = createProxyHandler(jerseyRequest, proxyAddr, userName, password, connectTimeout); + p.addLast(proxy); + } else { + ProxySelector sel = ProxySelector.getDefault(); + for (Proxy proxy: sel.select(requestUri)) { + if (Proxy.Type.HTTP.equals(proxy.type())) { + SocketAddress proxyAddress = proxy.address(); + if (InetSocketAddress.class.isInstance(proxy.address())) { + InetSocketAddress proxyAddr = (InetSocketAddress) proxyAddress; + if (proxyAddr.isUnresolved() + && proxyAddr.getHostName() != null + && proxyAddr.getHostName().startsWith("http://")) { + proxyAddress = new InetSocketAddress( + proxyAddr.getHostString().substring(7), proxyAddr.getPort() + ); + } + } + ProxyHandler proxyHandler + = createProxyHandler(jerseyRequest, proxyAddress, null, null, connectTimeout); + p.addLast(proxyHandler); + break; + } + } } // Enable HTTPS if necessary. @@ -284,7 +315,6 @@ protected void initChannel(SocketChannel ch) throws Exception { }); // connect timeout - Integer connectTimeout = jerseyRequest.resolveProperty(ClientProperties.CONNECT_TIMEOUT, 0); if (connectTimeout > 0) { b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeout); } @@ -357,9 +387,7 @@ protected void initChannel(SocketChannel ch) throws Exception { } // headers - for (final Map.Entry> e : jerseyRequest.getStringHeaders().entrySet()) { - nettyRequest.headers().add(e.getKey(), e.getValue()); - } + setHeaders(jerseyRequest, nettyRequest.headers()); // host header - http 1.1 nettyRequest.headers().add(HttpHeaderNames.HOST, jerseyRequest.getUri().getHost()); @@ -484,4 +512,24 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exc } } } + + private static ProxyHandler createProxyHandler(ClientRequest jerseyRequest, SocketAddress proxyAddr, + String userName, String password, long connectTimeout) { + HttpHeaders httpHeaders = setHeaders(jerseyRequest, new DefaultHttpHeaders()); + + ProxyHandler proxy = userName == null ? new HttpProxyHandler(proxyAddr, httpHeaders) + : new HttpProxyHandler(proxyAddr, userName, password, httpHeaders); + if (connectTimeout > 0) { + proxy.setConnectTimeoutMillis(connectTimeout); + } + + return proxy; + } + + private static HttpHeaders setHeaders(ClientRequest jerseyRequest, HttpHeaders headers) { + for (final Map.Entry> e : jerseyRequest.getStringHeaders().entrySet()) { + headers.add(e.getKey(), e.getValue()); + } + return headers; + } } diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/proxy/ProxySelectorTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/proxy/ProxySelectorTest.java new file mode 100644 index 0000000000..4580facf24 --- /dev/null +++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/proxy/ProxySelectorTest.java @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 Banco do Brasil S/A. 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.jersey.tests.e2e.client.connector.proxy; + +import org.eclipse.jetty.server.HttpChannel; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.handler.AbstractHandler; +import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; +import org.glassfish.jersey.apache5.connector.Apache5ConnectorProvider; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.spi.ConnectorProvider; +import org.glassfish.jersey.jetty.connector.JettyConnectorProvider; +import org.glassfish.jersey.netty.connector.NettyConnectorProvider; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.ProcessingException; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Response; +import java.lang.reflect.InvocationTargetException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import static org.junit.Assert.assertEquals; + +/** + * Moved from jetty-connector + * @author Marcelo Rubim + */ +@RunWith(Parameterized.class) +public class ProxySelectorTest { + private static final String NO_PASS = "no-pass"; + + @Parameterized.Parameters(name = "{index}: {0}") + public static List testData() { + return Arrays.asList(new Object[][]{ +// {ApacheConnectorProvider.class}, +// {Apache5ConnectorProvider.class}, +// {JettyConnectorProvider.class}, + {NettyConnectorProvider.class}, + }); + } + + private final ConnectorProvider connectorProvider; + + public ProxySelectorTest(Class connectorProviderClass) + throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { + this.connectorProvider = connectorProviderClass.getConstructor().newInstance(); + } + + protected void configureClient(ClientConfig config) { + config.connectorProvider(connectorProvider); + } + + @Test + public void testGetNoPass() { + try (Response response = target("proxyTest").request().header(NO_PASS, 200).get()) { + assertEquals(200, response.getStatus()); + } + } + + @Test + public void testGet407() { + try (Response response = target("proxyTest").request().get()) { + assertEquals(407, response.getStatus()); + } catch (ProcessingException pe) { + Assert.assertTrue(pe.getMessage().contains("407")); // netty + } + } + + private static Server server; + @BeforeClass + public static void startFakeProxy() { + server = new Server(9997); + server.setHandler(new ProxyHandler()); + try { + server.start(); + } catch (Exception e) { + + } + + System.setProperty("http.proxyHost", "http://localhost"); + System.setProperty("http.proxyPort", "9997"); + } + + @AfterClass + public static void tearDownProxy() { + try { + server.stop(); + } catch (Exception e) { + + } finally { + System.clearProperty("http.proxyHost"); + System.clearProperty("http.proxyPort"); + } + } + + private static Client client; + @Before + public void beforeEach() { + ClientConfig config = new ClientConfig(); + this.configureClient(config); + client = ClientBuilder.newClient(config); + } + + private Client client() { + return client; + } + + private WebTarget target(String path) { + // ProxySelector goes DIRECT to localhost, no matter the proxy + return client().target("http://eclipse.org:9998").path(path); + } + + static class ProxyHandler extends AbstractHandler { + Set httpConnect = new HashSet<>(); + @Override + public void handle(String target, + Request baseRequest, + HttpServletRequest request, + HttpServletResponse response) { + if (request.getHeader(NO_PASS) != null) { + response.setStatus(Integer.parseInt(request.getHeader(NO_PASS))); + } else { + response.setStatus(407); + response.addHeader("Proxy-Authenticate", "Basic"); + } + + baseRequest.setHandled(true); + } + } +} diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/proxy/ProxyTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/proxy/ProxyTest.java new file mode 100644 index 0000000000..93e69c2124 --- /dev/null +++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/proxy/ProxyTest.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 Banco do Brasil S/A. 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.jersey.tests.e2e.client.connector.proxy; + +import org.eclipse.jetty.server.HttpChannel; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.handler.AbstractHandler; +import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; +import org.glassfish.jersey.apache5.connector.Apache5ConnectorProvider; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.spi.ConnectorProvider; +import org.glassfish.jersey.jetty.connector.JettyConnectorProvider; +import org.glassfish.jersey.netty.connector.NettyConnectorProvider; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.ProcessingException; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Response; +import java.lang.reflect.InvocationTargetException; +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.Base64; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import static org.junit.Assert.assertEquals; + +/** + * Moved from jetty-connector + * @author Marcelo Rubim + */ +@RunWith(Parameterized.class) +public class ProxyTest { + private static final Charset CHARACTER_SET = Charset.forName("iso-8859-1"); + private static final String PROXY_URI = "http://127.0.0.1:9997"; + private static final String PROXY_USERNAME = "proxy-user"; + private static final String PROXY_PASSWORD = "proxy-password"; + private static final String NO_PASS = "no-pass"; + + @Parameterized.Parameters(name = "{index}: {0}") + public static List testData() { + return Arrays.asList(new Object[][]{ + {ApacheConnectorProvider.class}, + {Apache5ConnectorProvider.class}, + {JettyConnectorProvider.class}, + {NettyConnectorProvider.class}, + }); + } + + private final ConnectorProvider connectorProvider; + + public ProxyTest(Class connectorProviderClass) + throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { + this.connectorProvider = connectorProviderClass.getConstructor().newInstance(); + } + + protected void configureClient(ClientConfig config) { + config.connectorProvider(connectorProvider); + } + + @Test + public void testGetNoPass() { + client().property(ClientProperties.PROXY_URI, ProxyTest.PROXY_URI); + try (Response response = target("proxyTest").request().header(NO_PASS, 200).get()) { + assertEquals(200, response.getStatus()); + } + } + + @Test + public void testGet407() { + client().property(ClientProperties.PROXY_URI, ProxyTest.PROXY_URI); + try (Response response = target("proxyTest").request().get()) { + assertEquals(407, response.getStatus()); + } catch (ProcessingException pe) { + Assert.assertTrue(pe.getMessage().contains("407")); // netty + } + } + + @Test + public void testGetSuccess() { + client().property(ClientProperties.PROXY_URI, ProxyTest.PROXY_URI); + client().property(ClientProperties.PROXY_USERNAME, ProxyTest.PROXY_USERNAME); + client().property(ClientProperties.PROXY_PASSWORD, ProxyTest.PROXY_PASSWORD); + Response response = target("proxyTest").request().get(); + assertEquals(200, response.getStatus()); + } + + private static Server server; + @BeforeClass + public static void startFakeProxy() { + server = new Server(9997); + server.setHandler(new ProxyHandler()); + try { + server.start(); + } catch (Exception e) { + + } + } + + @AfterClass + public static void tearDownProxy() { + try { + server.stop(); + } catch (Exception e) { + + } + } + + private static Client client; + @Before + public void beforeEach() { + ClientConfig config = new ClientConfig(); + this.configureClient(config); + client = ClientBuilder.newClient(config); + } + + private Client client() { + return client; + } + + private WebTarget target(String path) { + return client().target("http://localhost:9998").path(path); + } + + static class ProxyHandler extends AbstractHandler { + Set httpConnect = new HashSet<>(); + @Override + public void handle(String target, + Request baseRequest, + HttpServletRequest request, + HttpServletResponse response) { + if (request.getHeader(NO_PASS) != null) { + response.setStatus(Integer.parseInt(request.getHeader(NO_PASS))); + } else if (request.getHeader("Proxy-Authorization") != null) { + String proxyAuthorization = request.getHeader("Proxy-Authorization"); + String decoded = new String(Base64.getDecoder().decode(proxyAuthorization.substring(6).getBytes()), + CHARACTER_SET); + final String[] split = decoded.split(":"); + final String username = split[0]; + final String password = split[1]; + + if (!username.equals(PROXY_USERNAME)) { + response.setStatus(400); + System.out.println("Found unexpected username: " + username); + } + + if (!password.equals(PROXY_PASSWORD)) { + response.setStatus(400); + System.out.println("Found unexpected password: " + username); + } + + if (response.getStatus() != 400) { + response.setStatus(200); + if ("CONNECT".equalsIgnoreCase(baseRequest.getMethod())) { // NETTY way of doing proxy + httpConnect.add(baseRequest.getHttpChannel()); + } + } + //TODO Add redirect to requestURI + } else { + if (httpConnect.contains(baseRequest.getHttpChannel())) { + response.setStatus(200); + } else { + response.setStatus(407); + response.addHeader("Proxy-Authenticate", "Basic"); + } + } + + baseRequest.setHandled(true); + } + } +} From 78ea6dc1d6b64e5118a218797fe1b89d0cdd4efa Mon Sep 17 00:00:00 2001 From: Maxim Nesen <24524084+senivam@users.noreply.github.com> Date: Thu, 9 Jun 2022 13:39:23 +0200 Subject: [PATCH 07/17] Make JacksonFeature configurable (#5074) Signed-off-by: Maxim Nesen --- .../glassfish/jersey/CommonProperties.java | 53 +++++++++++++- docs/src/main/docbook/appendix-properties.xml | 36 ++++++++++ docs/src/main/docbook/jersey.ent | 6 ++ docs/src/main/docbook/media.xml | 11 ++- media/json-jackson/pom.xml | 3 +- .../DefaultJacksonJaxbJsonProvider.java | 40 +++++++++-- ...JsonJacksonProviderForBothModulesTest.java | 43 +++++++++++ ...JacksonProviderForDisabledModulesTest.java | 71 +++++++++++++++++++ ...nJacksonProviderForEnabledModulesTest.java | 42 +++++++++++ .../internal/model/JAXBServiceTest.java | 62 ++++++++++++++++ .../rest-client14-compatibility/pom.xml | 7 +- 11 files changed, 358 insertions(+), 16 deletions(-) create mode 100644 media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/DefaultJsonJacksonProviderForBothModulesTest.java create mode 100644 media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/DefaultJsonJacksonProviderForDisabledModulesTest.java create mode 100644 media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/DefaultJsonJacksonProviderForEnabledModulesTest.java create mode 100644 media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/model/JAXBServiceTest.java diff --git a/core-common/src/main/java/org/glassfish/jersey/CommonProperties.java b/core-common/src/main/java/org/glassfish/jersey/CommonProperties.java index 50fceb1df7..762a08b050 100644 --- a/core-common/src/main/java/org/glassfish/jersey/CommonProperties.java +++ b/core-common/src/main/java/org/glassfish/jersey/CommonProperties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 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 @@ -255,6 +255,55 @@ public final class CommonProperties { */ public static final String JAXRS_SERVICE_LOADING_ENABLE = "jakarta.ws.rs.loadServices"; + /** + * Comma separated list of jackson modules which are only enabled (only those modules will be used) + * for json-jackson processing + * + * @since 2.36 + */ + public static final String JSON_JACKSON_ENABLED_MODULES = "jersey.config.json.jackson.enabled.modules"; + + /** + * Client-specific version of {@link CommonProperties#JSON_JACKSON_ENABLED_MODULES}. + * + * If present, it overrides the generic one for the client environment. + * @since 2.36 + */ + public static final String JSON_JACKSON_ENABLED_MODULES_CLIENT = "jersey.config.client.json.jackson.enabled.modules"; + + /** + * Server-specific version of {@link CommonProperties#JSON_JACKSON_ENABLED_MODULES}. + * + * If present, it overrides the generic one for the server environment. + * @since 2.36 + */ + public static final String JSON_JACKSON_ENABLED_MODULES_SERVER = "jersey.config.server.json.jackson.enabled.modules"; + + /** + * Comma separated list of jackson modules which shall be excluded from json-jackson processing. + * the JaxbAnnotationModule is always excluded (cannot be configured). + * + * @since 2.36 + */ + + public static final String JSON_JACKSON_DISABLED_MODULES = "jersey.config.json.jackson.disabled.modules"; + + /** + * Client-specific version of {@link CommonProperties#JSON_JACKSON_DISABLED_MODULES}. + * + * If present, it overrides the generic one for the client environment. + * @since 2.36 + */ + public static final String JSON_JACKSON_DISABLED_MODULES_CLIENT = "jersey.config.client.json.jackson.disabled.modules"; + + /** + * Server-specific version of {@link CommonProperties#JSON_JACKSON_DISABLED_MODULES}. + * + * If present, it overrides the generic one for the client environment. + * @since 2.36 + */ + public static final String JSON_JACKSON_DISABLED_MODULES_SERVER = "jersey.config.server.json.jackson.disabled.modules"; + /** * Prevent instantiation. */ @@ -274,7 +323,7 @@ private CommonProperties() { * * @since 2.8 */ - public static Object getValue(final Map properties, final String propertyName, final Class type) { + public static T getValue(final Map properties, final String propertyName, final Class type) { return PropertiesHelper.getValue(properties, propertyName, type, CommonProperties.LEGACY_FALLBACK_MAP); } diff --git a/docs/src/main/docbook/appendix-properties.xml b/docs/src/main/docbook/appendix-properties.xml index 0f085eb6d4..3da415b49c 100644 --- a/docs/src/main/docbook/appendix-properties.xml +++ b/docs/src/main/docbook/appendix-properties.xml @@ -147,6 +147,42 @@ @since 2.30 + + &jersey.common.CommonProperties.JSON_JACKSON_ENABLED_MODULES; / + &jersey.common.CommonProperties.JSON_JACKSON_ENABLED_MODULES_CLIENT; / + &jersey.common.CommonProperties.JSON_JACKSON_ENABLED_MODULES_SERVER; + + + jersey.config.json.jackson.enabled.modules + jersey.config.client.json.jackson.enabled.modules + jersey.config.server.json.jackson.enabled.modules + + + Comma separated list of jackson modules which shall be used for json-jackson provider. + If set, only those modules will be used for JSON processing. + + Default value is NULL + @since 2.36 + + + + &jersey.common.CommonProperties.JSON_JACKSON_DISABLED_MODULES; / + &jersey.common.CommonProperties.JSON_JACKSON_DISABLED_MODULES_CLIENT; / + &jersey.common.CommonProperties.JSON_JACKSON_DISABLED_MODULES_SERVER; + + + jersey.config.json.jackson.disabled.modules + jersey.config.client.json.jackson.disabled.modules + jersey.config.server.json.jackson.disabled.modules + + + Comma separated list of jackson modules which shall be excluded from json-jackson provider. + If set, those modules will be excluded from JSON processing. + + Default value is NULL + @since 2.36 + + &jersey.logging.LoggingFeature.LOGGING_FEATURE_LOGGER_NAME; diff --git a/docs/src/main/docbook/jersey.ent b/docs/src/main/docbook/jersey.ent index 1c8bdb0564..e463997a61 100644 --- a/docs/src/main/docbook/jersey.ent +++ b/docs/src/main/docbook/jersey.ent @@ -394,6 +394,12 @@ CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER_CLIENT" > CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER" > CommonProperties.PROVIDER_DEFAULT_DISABLE" > +CommonProperties.JSON_JACKSON_ENABLED_MODULES" > +CommonProperties.JSON_JACKSON_ENABLED_MODULES_CLIENT" > +CommonProperties.JSON_JACKSON_ENABLED_MODULES_SERVER" > +CommonProperties.JSON_JACKSON_DISABLED_MODULES" > +CommonProperties.JSON_JACKSON_DISABLED_MODULES_CLIENT" > +CommonProperties.JSON_JACKSON_DISABLED_MODULES_SERVER" > DisposableSupplier"> InjectionManager"> AbstractBinder"> diff --git a/docs/src/main/docbook/media.xml b/docs/src/main/docbook/media.xml index 547ac61f4a..2946993351 100644 --- a/docs/src/main/docbook/media.xml +++ b/docs/src/main/docbook/media.xml @@ -1,7 +1,7 @@ diff --git a/tests/integration/servlet-2.5-reload/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/ReloadTestIT.java b/tests/integration/servlet-2.5-reload/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/ReloadTestIT.java index 6515b8aa3a..67095bb87d 100644 --- a/tests/integration/servlet-2.5-reload/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/ReloadTestIT.java +++ b/tests/integration/servlet-2.5-reload/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/ReloadTestIT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2022 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 @@ -24,6 +24,7 @@ import org.glassfish.jersey.test.spi.TestContainerException; import org.glassfish.jersey.test.spi.TestContainerFactory; +import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -44,6 +45,7 @@ protected TestContainerFactory getTestContainerFactory() throws TestContainerExc } @Test + @Ignore //TODO - fix after 2.36 public void testReload() throws Exception { Response response = target().path("helloworld").request().get(); assertEquals(200, response.getStatus()); From bc70ab97fa44b7a943b624ecba8a0a2e9d411fe3 Mon Sep 17 00:00:00 2001 From: Maxim Nesen <24524084+senivam@users.noreply.github.com> Date: Mon, 13 Jun 2022 10:39:22 +0200 Subject: [PATCH 09/17] Dependencies versions update (#5078) Signed-off-by: Maxim Nesen --- pom.xml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index 2b2267ab5b..6e9baffb3e 100644 --- a/pom.xml +++ b/pom.xml @@ -2110,30 +2110,20 @@ 9.3 2.3.6 - 1.1 - 2.0.2 2.11.0 3.3.2 - 2.0 3.1.0 8.28 3.3 - 3.2.5 1.3.3 1.7 3.0.4 2.3.27-incubating 1.9.59 - 1.16 - 2.4.4 31.1-jre 2.2 1.0.3 1.6 - 2.6.1 - org.glassfish.hk2.*;version="[2.5,4)" - org.jvnet.hk2.*;version="[2.5,4)" - 5.1.0 4.5.13 5.1.2 2.13.3 @@ -2145,9 +2135,6 @@ 1.3.7 1.10.2 1.44 - 2.3.6 - 1.2.7 - 1.3.3 5.6.0 4.0.1 3.9.0 @@ -2158,15 +2145,11 @@ 6.0.0 1.10.0 5.0.0 - 1.6.0 4.13.4 0.7.4 1.2.4 1.2.5 2.0.4 - 2.4 - 3.0.1 - 4.0.3 6.0.1 false 1.7.21 @@ -2182,7 +2165,16 @@ 20.3.2 + 1.2 + 2.0.2 + 3.2.6 5.1.0 + 1.16 + 2.4.4 + 2.6.1 + org.glassfish.hk2.*;version="[2.5,4)" + org.jvnet.hk2.*;version="[2.5,4)" + 5.1.0 3.0.8 1.2.2 3.0.3 @@ -2193,17 +2185,25 @@ 2.2.3 2.0.2 2.3.3 - 2.3.3 + 2.3.6 2.1 2.1.6 6.1.26 - 9.4.42.v20210604 + 9.4.46.v20220331 6.1.14 1.0.2 1.1.6 1.1.6 + 2.3.6 + 1.2.7 + 1.3.3 + 2.0.1 1.9.13 - 2.7.9 - 1.0.9 + 2.7.10 + 1.6.1 + 2.5 + 3.0.1 + 4.0.4 + 1.0.11 From 54415d82e8e0b9ea10d19f8a3d79b990ea4a0e93 Mon Sep 17 00:00:00 2001 From: jersey-bot Date: Mon, 13 Jun 2022 09:24:22 +0000 Subject: [PATCH 10/17] 2.36 --- archetypes/jersey-example-java8-webapp/pom.xml | 4 ++-- archetypes/jersey-heroku-webapp/pom.xml | 4 ++-- archetypes/jersey-quickstart-grizzly2/pom.xml | 4 ++-- archetypes/jersey-quickstart-webapp/pom.xml | 4 ++-- archetypes/pom.xml | 4 ++-- bom/pom.xml | 2 +- bundles/apidocs/pom.xml | 2 +- bundles/examples/pom.xml | 4 ++-- bundles/jaxrs-ri/pom.xml | 4 ++-- bundles/pom.xml | 4 ++-- connectors/apache-connector/pom.xml | 2 +- connectors/apache5-connector/pom.xml | 2 +- connectors/grizzly-connector/pom.xml | 4 ++-- connectors/helidon-connector/pom.xml | 4 ++-- connectors/jdk-connector/pom.xml | 4 ++-- connectors/jetty-connector/pom.xml | 2 +- connectors/netty-connector/pom.xml | 2 +- connectors/pom.xml | 2 +- containers/glassfish/jersey-gf-ejb/pom.xml | 4 ++-- containers/glassfish/pom.xml | 4 ++-- containers/grizzly2-http/pom.xml | 4 ++-- containers/grizzly2-servlet/pom.xml | 4 ++-- containers/jdk-http/pom.xml | 2 +- containers/jersey-servlet-core/pom.xml | 4 ++-- containers/jersey-servlet/pom.xml | 4 ++-- containers/jetty-http/pom.xml | 4 ++-- containers/jetty-servlet/pom.xml | 4 ++-- containers/netty-http/pom.xml | 4 ++-- containers/pom.xml | 4 ++-- containers/simple-http/pom.xml | 4 ++-- core-client/pom.xml | 2 +- core-common/pom.xml | 2 +- core-server/pom.xml | 2 +- docs/pom.xml | 4 ++-- examples/assemblies/pom.xml | 4 ++-- examples/bookmark-em/pom.xml | 4 ++-- examples/bookmark/pom.xml | 4 ++-- examples/bookstore-webapp/pom.xml | 4 ++-- examples/cdi-webapp/pom.xml | 4 ++-- examples/clipboard-programmatic/pom.xml | 4 ++-- examples/clipboard/pom.xml | 4 ++-- examples/declarative-linking/pom.xml | 4 ++-- examples/entity-filtering-security/pom.xml | 4 ++-- examples/entity-filtering-selectable/pom.xml | 4 ++-- examples/entity-filtering/pom.xml | 4 ++-- examples/exception-mapping/pom.xml | 4 ++-- examples/extended-wadl-webapp/pom.xml | 4 ++-- examples/freemarker-webapp/pom.xml | 4 ++-- examples/groovy/pom.xml | 4 ++-- examples/helloworld-benchmark/pom.xml | 4 ++-- examples/helloworld-cdi2-se/pom.xml | 4 ++-- examples/helloworld-netty/pom.xml | 4 ++-- examples/helloworld-programmatic/pom.xml | 4 ++-- examples/helloworld-pure-jax-rs/pom.xml | 4 ++-- examples/helloworld-spring-annotations/pom.xml | 4 ++-- examples/helloworld-spring-webapp/pom.xml | 4 ++-- examples/helloworld-webapp/pom.xml | 4 ++-- examples/helloworld-weld/pom.xml | 4 ++-- examples/helloworld/pom.xml | 4 ++-- examples/http-patch/pom.xml | 4 ++-- examples/http-trace/pom.xml | 4 ++-- examples/https-clientserver-grizzly/pom.xml | 4 ++-- examples/https-server-glassfish/pom.xml | 4 ++-- examples/java8-webapp/pom.xml | 4 ++-- examples/jaxb/pom.xml | 4 ++-- examples/jaxrs-types-injection/pom.xml | 4 ++-- examples/jersey-ejb/pom.xml | 4 ++-- examples/json-binding-webapp/pom.xml | 4 ++-- examples/json-jackson/pom.xml | 4 ++-- examples/json-jackson1/pom.xml | 4 ++-- examples/json-jettison/pom.xml | 4 ++-- examples/json-moxy/pom.xml | 4 ++-- examples/json-processing-webapp/pom.xml | 4 ++-- examples/json-with-padding/pom.xml | 4 ++-- examples/managed-beans-webapp/pom.xml | 4 ++-- examples/managed-client-simple-webapp/pom.xml | 4 ++-- examples/managed-client-webapp/pom.xml | 4 ++-- examples/managed-client/pom.xml | 4 ++-- examples/multipart-webapp/pom.xml | 4 ++-- examples/oauth-client-twitter/pom.xml | 4 ++-- examples/open-tracing/pom.xml | 4 ++-- examples/osgi-helloworld-webapp/additional-bundle/pom.xml | 4 ++-- .../osgi-helloworld-webapp/alternate-version-bundle/pom.xml | 4 ++-- examples/osgi-helloworld-webapp/functional-test/pom.xml | 4 ++-- examples/osgi-helloworld-webapp/lib-bundle/pom.xml | 4 ++-- examples/osgi-helloworld-webapp/pom.xml | 4 ++-- examples/osgi-helloworld-webapp/war-bundle/pom.xml | 4 ++-- examples/osgi-http-service/bundle/pom.xml | 4 ++-- examples/osgi-http-service/functional-test/pom.xml | 4 ++-- examples/osgi-http-service/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- examples/reload/pom.xml | 4 ++-- examples/rx-client-webapp/pom.xml | 4 ++-- examples/server-async-managed/pom.xml | 4 ++-- examples/server-async-standalone/client/pom.xml | 4 ++-- examples/server-async-standalone/pom.xml | 4 ++-- examples/server-async-standalone/webapp/pom.xml | 4 ++-- examples/server-async/pom.xml | 4 ++-- examples/server-sent-events-jaxrs/pom.xml | 4 ++-- examples/server-sent-events-jersey/pom.xml | 4 ++-- examples/servlet3-webapp/pom.xml | 4 ++-- examples/simple-console/pom.xml | 4 ++-- examples/sse-item-store-jaxrs-webapp/pom.xml | 4 ++-- examples/sse-item-store-jersey-webapp/pom.xml | 4 ++-- examples/sse-twitter-aggregator/pom.xml | 4 ++-- examples/system-properties-example/pom.xml | 4 ++-- examples/webapp-example-parent/pom.xml | 4 ++-- examples/xml-moxy/pom.xml | 4 ++-- ext/bean-validation/pom.xml | 4 ++-- ext/cdi/jersey-cdi-rs-inject/pom.xml | 4 ++-- ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/pom.xml | 2 +- ext/cdi/jersey-cdi1x-servlet/pom.xml | 4 ++-- ext/cdi/jersey-cdi1x-transaction/pom.xml | 4 ++-- ext/cdi/jersey-cdi1x-validation/pom.xml | 4 ++-- ext/cdi/jersey-cdi1x/pom.xml | 4 ++-- ext/cdi/jersey-weld2-se/pom.xml | 4 ++-- ext/cdi/pom.xml | 4 ++-- ext/entity-filtering/pom.xml | 4 ++-- ext/metainf-services/pom.xml | 4 ++-- ext/microprofile/mp-config/pom.xml | 4 ++-- ext/microprofile/mp-rest-client/pom.xml | 4 ++-- ext/microprofile/pom.xml | 4 ++-- ext/mvc-bean-validation/pom.xml | 4 ++-- ext/mvc-freemarker/pom.xml | 4 ++-- ext/mvc-jsp/pom.xml | 4 ++-- ext/mvc-mustache/pom.xml | 4 ++-- ext/mvc/pom.xml | 4 ++-- ext/pom.xml | 4 ++-- ext/proxy-client/pom.xml | 4 ++-- ext/rx/pom.xml | 2 +- ext/rx/rx-client-guava/pom.xml | 2 +- ext/rx/rx-client-rxjava/pom.xml | 4 ++-- ext/rx/rx-client-rxjava2/pom.xml | 4 ++-- ext/servlet-portability/pom.xml | 4 ++-- ext/spring4/pom.xml | 4 ++-- ext/spring5/pom.xml | 4 ++-- ext/wadl-doclet/pom.xml | 4 ++-- incubator/cdi-inject-weld/pom.xml | 4 ++-- incubator/declarative-linking/pom.xml | 4 ++-- incubator/gae-integration/pom.xml | 4 ++-- incubator/html-json/pom.xml | 4 ++-- incubator/kryo/pom.xml | 4 ++-- incubator/open-tracing/pom.xml | 4 ++-- incubator/pom.xml | 4 ++-- inject/cdi2-se/pom.xml | 4 ++-- inject/hk2/pom.xml | 2 +- inject/pom.xml | 4 ++-- media/jaxb/pom.xml | 4 ++-- media/json-binding/pom.xml | 4 ++-- media/json-jackson/pom.xml | 2 +- media/json-jackson1/pom.xml | 4 ++-- media/json-jettison/pom.xml | 4 ++-- media/json-processing/pom.xml | 4 ++-- media/moxy/pom.xml | 4 ++-- media/multipart/pom.xml | 4 ++-- media/pom.xml | 4 ++-- media/sse/pom.xml | 4 ++-- pom.xml | 2 +- security/oauth1-client/pom.xml | 4 ++-- security/oauth1-server/pom.xml | 4 ++-- security/oauth1-signature/pom.xml | 4 ++-- security/oauth2-client/pom.xml | 4 ++-- security/pom.xml | 4 ++-- test-framework/core/pom.xml | 4 ++-- test-framework/maven/container-runner-maven-plugin/pom.xml | 2 +- test-framework/maven/custom-enforcer-rules/pom.xml | 2 +- test-framework/maven/pom.xml | 4 ++-- test-framework/memleak-test-common/pom.xml | 2 +- test-framework/pom.xml | 4 ++-- test-framework/providers/bundle/pom.xml | 4 ++-- test-framework/providers/external/pom.xml | 4 ++-- test-framework/providers/grizzly2/pom.xml | 4 ++-- test-framework/providers/inmemory/pom.xml | 4 ++-- test-framework/providers/jdk-http/pom.xml | 4 ++-- test-framework/providers/jetty/pom.xml | 4 ++-- test-framework/providers/netty/pom.xml | 4 ++-- test-framework/providers/pom.xml | 4 ++-- test-framework/providers/simple/pom.xml | 4 ++-- test-framework/util/pom.xml | 4 ++-- tests/e2e-client/pom.xml | 2 +- tests/e2e-core-common/pom.xml | 2 +- tests/e2e-entity/pom.xml | 2 +- tests/e2e-inject/cdi-inject-weld/pom.xml | 2 +- tests/e2e-inject/cdi2-se/pom.xml | 2 +- tests/e2e-inject/hk2/pom.xml | 4 ++-- tests/e2e-inject/pom.xml | 4 ++-- tests/e2e-server/pom.xml | 2 +- tests/e2e-testng/pom.xml | 4 ++-- tests/e2e/pom.xml | 2 +- tests/integration/asm/pom.xml | 2 +- tests/integration/async-jersey-filter/pom.xml | 4 ++-- .../cdi-integration/cdi-beanvalidation-webapp/pom.xml | 4 ++-- .../cdi-integration/cdi-client-on-server/pom.xml | 4 ++-- tests/integration/cdi-integration/cdi-client/pom.xml | 4 ++-- .../integration/cdi-integration/cdi-ejb-test-webapp/pom.xml | 4 ++-- .../cdi-iface-with-non-jaxrs-impl-test-webapp/pom.xml | 4 ++-- tests/integration/cdi-integration/cdi-log-check/pom.xml | 4 ++-- .../integration/cdi-integration/cdi-manually-bound/pom.xml | 4 ++-- .../integration/cdi-integration/cdi-multimodule/ear/pom.xml | 4 ++-- .../integration/cdi-integration/cdi-multimodule/lib/pom.xml | 4 ++-- tests/integration/cdi-integration/cdi-multimodule/pom.xml | 4 ++-- .../cdi-integration/cdi-multimodule/war1/pom.xml | 2 +- .../cdi-integration/cdi-multimodule/war2/pom.xml | 2 +- .../cdi-integration/cdi-multipart-webapp/pom.xml | 4 ++-- .../cdi-integration/cdi-resource-with-at-context/pom.xml | 4 ++-- tests/integration/cdi-integration/cdi-singleton/pom.xml | 4 ++-- tests/integration/cdi-integration/cdi-test-webapp/pom.xml | 4 ++-- .../cdi-with-jersey-injection-custom-cfg-webapp/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../cdi-with-jersey-injection-webapp/pom.xml | 4 ++-- .../cdi-integration/context-inject-on-server/pom.xml | 4 ++-- tests/integration/cdi-integration/pom.xml | 4 ++-- tests/integration/client-connector-provider/pom.xml | 4 ++-- tests/integration/ejb-multimodule-reload/ear/pom.xml | 4 ++-- tests/integration/ejb-multimodule-reload/lib/pom.xml | 4 ++-- tests/integration/ejb-multimodule-reload/pom.xml | 4 ++-- tests/integration/ejb-multimodule-reload/war1/pom.xml | 2 +- tests/integration/ejb-multimodule-reload/war2/pom.xml | 2 +- tests/integration/ejb-multimodule/ear/pom.xml | 4 ++-- tests/integration/ejb-multimodule/lib/pom.xml | 4 ++-- tests/integration/ejb-multimodule/pom.xml | 4 ++-- tests/integration/ejb-multimodule/war/pom.xml | 2 +- tests/integration/ejb-test-webapp/pom.xml | 2 +- tests/integration/externalproperties/pom.xml | 4 ++-- tests/integration/j-376/pom.xml | 4 ++-- tests/integration/j-441/ear/pom.xml | 4 ++-- tests/integration/j-441/pom.xml | 4 ++-- tests/integration/j-441/war1/pom.xml | 4 ++-- tests/integration/j-441/war2/pom.xml | 4 ++-- tests/integration/j-59/ear/pom.xml | 4 ++-- tests/integration/j-59/lib/pom.xml | 4 ++-- tests/integration/j-59/pom.xml | 4 ++-- tests/integration/j-59/war/pom.xml | 2 +- tests/integration/jaxrs-component-inject/pom.xml | 4 ++-- tests/integration/jersey-1107/pom.xml | 4 ++-- tests/integration/jersey-1223/pom.xml | 4 ++-- tests/integration/jersey-1604/pom.xml | 4 ++-- tests/integration/jersey-1667/pom.xml | 4 ++-- tests/integration/jersey-1829/pom.xml | 4 ++-- tests/integration/jersey-1883/pom.xml | 4 ++-- tests/integration/jersey-1928/pom.xml | 4 ++-- tests/integration/jersey-1960/pom.xml | 4 ++-- tests/integration/jersey-1964/pom.xml | 4 ++-- tests/integration/jersey-2031/pom.xml | 4 ++-- tests/integration/jersey-2136/pom.xml | 4 ++-- tests/integration/jersey-2137/pom.xml | 4 ++-- tests/integration/jersey-2154/pom.xml | 4 ++-- tests/integration/jersey-2160/pom.xml | 4 ++-- tests/integration/jersey-2164/pom.xml | 4 ++-- tests/integration/jersey-2167/pom.xml | 4 ++-- tests/integration/jersey-2176/pom.xml | 4 ++-- tests/integration/jersey-2184/pom.xml | 4 ++-- tests/integration/jersey-2255/pom.xml | 4 ++-- tests/integration/jersey-2322/pom.xml | 4 ++-- tests/integration/jersey-2335/pom.xml | 4 ++-- tests/integration/jersey-2421/pom.xml | 4 ++-- tests/integration/jersey-2551/pom.xml | 4 ++-- tests/integration/jersey-2612/pom.xml | 2 +- tests/integration/jersey-2637/pom.xml | 4 ++-- tests/integration/jersey-2654/pom.xml | 4 ++-- tests/integration/jersey-2673/pom.xml | 4 ++-- tests/integration/jersey-2689/pom.xml | 4 ++-- tests/integration/jersey-2704/pom.xml | 4 ++-- tests/integration/jersey-2776/pom.xml | 4 ++-- tests/integration/jersey-2794/pom.xml | 4 ++-- tests/integration/jersey-2846/pom.xml | 4 ++-- tests/integration/jersey-2878/pom.xml | 4 ++-- tests/integration/jersey-2892/pom.xml | 4 ++-- tests/integration/jersey-3662/pom.xml | 4 ++-- tests/integration/jersey-3670/pom.xml | 4 ++-- tests/integration/jersey-3796/pom.xml | 4 ++-- tests/integration/jersey-3992/pom.xml | 4 ++-- tests/integration/jersey-4003/pom.xml | 4 ++-- tests/integration/jersey-4099/pom.xml | 4 ++-- tests/integration/jersey-4321/pom.xml | 2 +- tests/integration/jersey-4507/pom.xml | 4 ++-- tests/integration/jersey-4542/pom.xml | 4 ++-- tests/integration/jersey-4697/pom.xml | 4 ++-- tests/integration/jersey-4722/pom.xml | 4 ++-- tests/integration/jersey-4949/pom.xml | 2 +- tests/integration/jersey-780/pom.xml | 4 ++-- tests/integration/jetty-response-close/pom.xml | 4 ++-- tests/integration/microprofile/config/helidon/pom.xml | 4 ++-- tests/integration/microprofile/config/pom.xml | 4 ++-- tests/integration/microprofile/config/webapp/pom.xml | 4 ++-- tests/integration/microprofile/pom.xml | 4 ++-- tests/integration/microprofile/rest-client/pom.xml | 4 ++-- .../microprofile/rest-client14-compatibility/pom.xml | 2 +- tests/integration/pom.xml | 2 +- tests/integration/portability-jersey-1/pom.xml | 4 ++-- tests/integration/portability-jersey-2/pom.xml | 4 ++-- tests/integration/property-check/pom.xml | 2 +- tests/integration/reactive-streams/pom.xml | 4 ++-- tests/integration/reactive-streams/sse/pom.xml | 4 ++-- tests/integration/security-digest/pom.xml | 4 ++-- tests/integration/servlet-2.5-autodiscovery-1/pom.xml | 4 ++-- tests/integration/servlet-2.5-autodiscovery-2/pom.xml | 4 ++-- tests/integration/servlet-2.5-filter/pom.xml | 4 ++-- tests/integration/servlet-2.5-inflector-1/pom.xml | 4 ++-- tests/integration/servlet-2.5-init-1/pom.xml | 4 ++-- tests/integration/servlet-2.5-init-2/pom.xml | 4 ++-- tests/integration/servlet-2.5-init-3/pom.xml | 4 ++-- tests/integration/servlet-2.5-init-4/pom.xml | 4 ++-- tests/integration/servlet-2.5-init-5/pom.xml | 4 ++-- tests/integration/servlet-2.5-init-6/pom.xml | 4 ++-- tests/integration/servlet-2.5-init-7/pom.xml | 4 ++-- tests/integration/servlet-2.5-init-8/pom.xml | 4 ++-- tests/integration/servlet-2.5-mvc-1/pom.xml | 4 ++-- tests/integration/servlet-2.5-mvc-2/pom.xml | 4 ++-- tests/integration/servlet-2.5-mvc-3/pom.xml | 4 ++-- tests/integration/servlet-2.5-reload/pom.xml | 2 +- tests/integration/servlet-3-async/pom.xml | 4 ++-- tests/integration/servlet-3-chunked-io/pom.xml | 4 ++-- tests/integration/servlet-3-filter/pom.xml | 4 ++-- tests/integration/servlet-3-gf-async/pom.xml | 4 ++-- tests/integration/servlet-3-inflector-1/pom.xml | 4 ++-- tests/integration/servlet-3-init-1/pom.xml | 4 ++-- tests/integration/servlet-3-init-2/pom.xml | 4 ++-- tests/integration/servlet-3-init-3/pom.xml | 4 ++-- tests/integration/servlet-3-init-4/pom.xml | 4 ++-- tests/integration/servlet-3-init-5/pom.xml | 4 ++-- tests/integration/servlet-3-init-6/pom.xml | 4 ++-- tests/integration/servlet-3-init-7/pom.xml | 4 ++-- tests/integration/servlet-3-init-8/pom.xml | 4 ++-- tests/integration/servlet-3-init-9/pom.xml | 4 ++-- tests/integration/servlet-3-init-provider/pom.xml | 4 ++-- tests/integration/servlet-3-params/pom.xml | 4 ++-- tests/integration/servlet-3-sse-1/pom.xml | 4 ++-- tests/integration/servlet-4.0-mvc-1/pom.xml | 4 ++-- tests/integration/servlet-request-wrapper-binding-2/pom.xml | 2 +- tests/integration/servlet-request-wrapper-binding/pom.xml | 2 +- tests/integration/servlet-tests/pom.xml | 4 ++-- tests/integration/sonar-test/pom.xml | 4 ++-- tests/integration/spring4/pom.xml | 4 ++-- tests/integration/spring5/pom.xml | 4 ++-- tests/integration/tracing-support/pom.xml | 4 ++-- tests/jmockit/pom.xml | 2 +- tests/mem-leaks/pom.xml | 4 ++-- tests/mem-leaks/redeployment/pom.xml | 4 ++-- .../redeployment/redeployment-hello-world-app-ref/pom.xml | 6 +++--- .../redeployment/redeployment-leaking-test-app/pom.xml | 2 +- .../redeployment/redeployment-no-jersey-app/pom.xml | 4 ++-- .../redeployment/redeployment-threadlocals-app/pom.xml | 4 ++-- tests/mem-leaks/test-cases/bean-param-leak/pom.xml | 4 ++-- tests/mem-leaks/test-cases/leaking-test-app/pom.xml | 2 +- tests/mem-leaks/test-cases/pom.xml | 4 ++-- .../mem-leaks/test-cases/shutdown-hook-leak-client/pom.xml | 4 ++-- tests/mem-leaks/test-cases/shutdown-hook-leak/pom.xml | 4 ++-- tests/osgi/functional/pom.xml | 4 ++-- tests/osgi/pom.xml | 4 ++-- tests/performance/benchmarks/pom.xml | 4 ++-- tests/performance/pom.xml | 4 ++-- tests/performance/runners/jersey-grizzly-runner/pom.xml | 4 ++-- tests/performance/runners/pom.xml | 4 ++-- tests/performance/test-cases/assemblies/pom.xml | 4 ++-- tests/performance/test-cases/filter-dynamic/pom.xml | 4 ++-- tests/performance/test-cases/filter-global/pom.xml | 4 ++-- tests/performance/test-cases/filter-name/pom.xml | 4 ++-- tests/performance/test-cases/interceptor-dynamic/pom.xml | 4 ++-- tests/performance/test-cases/interceptor-global/pom.xml | 4 ++-- tests/performance/test-cases/interceptor-name/pom.xml | 4 ++-- tests/performance/test-cases/mbw-custom-provider/pom.xml | 4 ++-- tests/performance/test-cases/mbw-json-jackson/pom.xml | 4 ++-- tests/performance/test-cases/mbw-json-moxy/pom.xml | 4 ++-- tests/performance/test-cases/mbw-kryo/pom.xml | 4 ++-- tests/performance/test-cases/mbw-text-plain/pom.xml | 4 ++-- tests/performance/test-cases/mbw-xml-jaxb/pom.xml | 4 ++-- tests/performance/test-cases/mbw-xml-moxy/pom.xml | 4 ++-- tests/performance/test-cases/param-srl/pom.xml | 4 ++-- tests/performance/test-cases/pom.xml | 4 ++-- tests/performance/test-cases/proxy-injection/pom.xml | 4 ++-- tests/performance/tools/pom.xml | 4 ++-- tests/pom.xml | 4 ++-- tests/stress/pom.xml | 2 +- 374 files changed, 701 insertions(+), 701 deletions(-) diff --git a/archetypes/jersey-example-java8-webapp/pom.xml b/archetypes/jersey-example-java8-webapp/pom.xml index baa854d386..303ca19c1f 100644 --- a/archetypes/jersey-example-java8-webapp/pom.xml +++ b/archetypes/jersey-example-java8-webapp/pom.xml @@ -1,7 +1,7 @@ ${jakarta.annotation.osgi.version}, - jakarta.json.*;version="[0,3)", - org.glassfish.json.*;version="[0,3)", + jakarta.json.*;version="[2,3)", * @@ -81,13 +80,12 @@ jakarta.json-api - org.glassfish - jakarta.json - module + org.eclipse.parsson + parsson - org.glassfish - jsonp-jaxrs + org.eclipse.parsson + parsson-media diff --git a/media/json-processing/src/main/java/org/glassfish/jersey/jsonp/JsonProcessingFeature.java b/media/json-processing/src/main/java/org/glassfish/jersey/jsonp/JsonProcessingFeature.java index cc1c913802..aa3e96cc9c 100644 --- a/media/json-processing/src/main/java/org/glassfish/jersey/jsonp/JsonProcessingFeature.java +++ b/media/json-processing/src/main/java/org/glassfish/jersey/jsonp/JsonProcessingFeature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 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 @@ -20,10 +20,10 @@ import jakarta.ws.rs.core.Feature; import jakarta.ws.rs.core.FeatureContext; -import org.glassfish.jersey.CommonProperties; +import org.eclipse.parsson.media.JsonValueBodyReader; +import org.eclipse.parsson.media.JsonValueBodyWriter; -import org.glassfish.json.jaxrs.JsonValueBodyReader; -import org.glassfish.json.jaxrs.JsonValueBodyWriter; +import org.glassfish.jersey.CommonProperties; /** * {@link Feature} used to register JSON-P providers. diff --git a/media/moxy/pom.xml b/media/moxy/pom.xml index 2a36b2cbab..f590550e8e 100644 --- a/media/moxy/pom.xml +++ b/media/moxy/pom.xml @@ -101,9 +101,8 @@ jakarta.json.bind-api - org.glassfish - jakarta.json - module + org.eclipse.parsson + parsson diff --git a/pom.xml b/pom.xml index 1d8f55354f..a2d73bc1f3 100644 --- a/pom.xml +++ b/pom.xml @@ -1841,14 +1841,13 @@ ${jakarta.jsonp.version} - org.glassfish - jakarta.json - module + org.eclipse.parsson + parsson ${jsonp.ri.version} - org.glassfish - jsonp-jaxrs + org.eclipse.parsson + parsson-media ${jsonp.jaxrs.version} @@ -2122,11 +2121,10 @@ 1.6 org.glassfish.hk2.*;version="[2.5,4)" org.jvnet.hk2.*;version="[2.5,4)" - 6.0.0 4.5.13 5.1.2 2.13.3 - 3.25.0-GA + 3.28.0-GA 3.3.0.Final 1.19.3 ${jersey1.version} @@ -2169,16 +2167,17 @@ 20.3.2 - 6.0.0 + 6.2.5 + 6.2.5 3.0.0 - 4.0.0 + 4.0.1 3.0.1 2.0.0 - 3.0.2 + 3.0.3 3.0.0 2.0.0 - 2.0.0 + 2.0.1 5.0.0 4.0.0 2.0.1 @@ -2188,22 +2187,22 @@ jakarta.annotation.*;version="[2.0,3)" 2.0.0 2.0.1 - 2.0.0 - 2.0.1 + 2.0.1 + 2.0.2 3.0.0 3.0.0 3.0.1 3.0.2 3.0 3.0.0 - 11.0.7 - 11.0.7 + 11.0.9 + 11.0.9 6.1.14 2.0.0 - 2.0.1 - 2.0.1 + 1.0.0 + 1.0.0 3.0.2 - 2.0.3 + 2.0.4 1.3.2 diff --git a/tests/osgi/functional/pom.xml b/tests/osgi/functional/pom.xml index 23317baaf6..b898c4ede0 100644 --- a/tests/osgi/functional/pom.xml +++ b/tests/osgi/functional/pom.xml @@ -309,14 +309,13 @@ jakarta.json-api - org.glassfish - jakarta.json - module + org.eclipse.parsson + parsson test - org.glassfish - jsonp-jaxrs + org.eclipse.parsson + parsson-media test diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonProcessingTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonProcessingTest.java index ca3a7a0976..4d4ca72038 100644 --- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonProcessingTest.java +++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonProcessingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 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 @@ -69,8 +69,9 @@ public static Option[] configuration() { // JSON processing. mavenBundle().groupId("org.glassfish.jersey.media").artifactId("jersey-media-json-processing") .versionAsInProject(), - mavenBundle().groupId("org.glassfish").artifactId("jakarta.json").versionAsInProject(), - mavenBundle().groupId("org.glassfish").artifactId("jsonp-jaxrs").versionAsInProject() + mavenBundle().groupId("jakarta.json").artifactId("jakarta.json-api").versionAsInProject(), + mavenBundle().groupId("org.eclipse.parsson").artifactId("parsson").versionAsInProject(), + mavenBundle().groupId("org.eclipse.parsson").artifactId("parsson-media").versionAsInProject() )); options = Helper.addPaxExamMavenLocalRepositoryProperty(options); From e114d5ed8bd48a750e98e517112bb5dceb739ef2 Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Tue, 14 Jun 2022 10:19:55 +0200 Subject: [PATCH 15/17] fix for user-guide markup Signed-off-by: Maxim Nesen --- docs/src/main/docbook/appendix-properties.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/main/docbook/appendix-properties.xml b/docs/src/main/docbook/appendix-properties.xml index 3da415b49c..6bd970abad 100644 --- a/docs/src/main/docbook/appendix-properties.xml +++ b/docs/src/main/docbook/appendix-properties.xml @@ -149,8 +149,8 @@ &jersey.common.CommonProperties.JSON_JACKSON_ENABLED_MODULES; / - &jersey.common.CommonProperties.JSON_JACKSON_ENABLED_MODULES_CLIENT; / - &jersey.common.CommonProperties.JSON_JACKSON_ENABLED_MODULES_SERVER; + &jersey.common.CommonProperties.JSON_JACKSON_ENABLED_MODULES_CLIENT; / + &jersey.common.CommonProperties.JSON_JACKSON_ENABLED_MODULES_SERVER; jersey.config.json.jackson.enabled.modules @@ -167,8 +167,8 @@ &jersey.common.CommonProperties.JSON_JACKSON_DISABLED_MODULES; / - &jersey.common.CommonProperties.JSON_JACKSON_DISABLED_MODULES_CLIENT; / - &jersey.common.CommonProperties.JSON_JACKSON_DISABLED_MODULES_SERVER; + &jersey.common.CommonProperties.JSON_JACKSON_DISABLED_MODULES_CLIENT; / + &jersey.common.CommonProperties.JSON_JACKSON_DISABLED_MODULES_SERVER; jersey.config.json.jackson.disabled.modules From eea1322df66cc307842b81114c7e55313281e0ce Mon Sep 17 00:00:00 2001 From: jersey-bot Date: Wed, 15 Jun 2022 13:01:14 +0000 Subject: [PATCH 16/17] 3.0.5 --- archetypes/jersey-example-java8-webapp/pom.xml | 2 +- archetypes/jersey-heroku-webapp/pom.xml | 2 +- archetypes/jersey-quickstart-grizzly2/pom.xml | 2 +- archetypes/jersey-quickstart-webapp/pom.xml | 2 +- archetypes/pom.xml | 2 +- bom/pom.xml | 2 +- bundles/apidocs/pom.xml | 2 +- bundles/examples/pom.xml | 4 ++-- bundles/jaxrs-ri/pom.xml | 2 +- bundles/pom.xml | 2 +- connectors/apache-connector/pom.xml | 2 +- connectors/apache5-connector/pom.xml | 2 +- connectors/grizzly-connector/pom.xml | 2 +- connectors/helidon-connector/pom.xml | 2 +- connectors/jdk-connector/pom.xml | 2 +- connectors/jetty-connector/pom.xml | 2 +- connectors/netty-connector/pom.xml | 2 +- connectors/pom.xml | 2 +- containers/glassfish/jersey-gf-ejb/pom.xml | 2 +- containers/glassfish/pom.xml | 2 +- containers/grizzly2-http/pom.xml | 2 +- containers/grizzly2-servlet/pom.xml | 2 +- containers/jdk-http/pom.xml | 2 +- containers/jersey-servlet-core/pom.xml | 2 +- containers/jersey-servlet/pom.xml | 2 +- containers/jetty-http/pom.xml | 2 +- containers/jetty-servlet/pom.xml | 2 +- containers/netty-http/pom.xml | 2 +- containers/pom.xml | 2 +- containers/simple-http/pom.xml | 2 +- core-client/pom.xml | 2 +- core-common/pom.xml | 2 +- core-server/pom.xml | 2 +- docs/pom.xml | 4 ++-- examples/assemblies/pom.xml | 2 +- examples/bookmark-em/pom.xml | 2 +- examples/bookmark/pom.xml | 2 +- examples/bookstore-webapp/pom.xml | 2 +- examples/cdi-webapp/pom.xml | 2 +- examples/clipboard-programmatic/pom.xml | 2 +- examples/clipboard/pom.xml | 2 +- examples/declarative-linking/pom.xml | 2 +- examples/entity-filtering-security/pom.xml | 2 +- examples/entity-filtering-selectable/pom.xml | 2 +- examples/entity-filtering/pom.xml | 2 +- examples/exception-mapping/pom.xml | 2 +- examples/extended-wadl-webapp/pom.xml | 2 +- examples/freemarker-webapp/pom.xml | 2 +- examples/groovy/pom.xml | 2 +- examples/helloworld-benchmark/pom.xml | 2 +- examples/helloworld-cdi2-se/pom.xml | 2 +- examples/helloworld-netty/pom.xml | 2 +- examples/helloworld-programmatic/pom.xml | 2 +- examples/helloworld-pure-jax-rs/pom.xml | 2 +- examples/helloworld-webapp/pom.xml | 2 +- examples/helloworld-weld/pom.xml | 2 +- examples/helloworld/pom.xml | 2 +- examples/http-patch/pom.xml | 2 +- examples/http-trace/pom.xml | 2 +- examples/https-clientserver-grizzly/pom.xml | 2 +- examples/https-server-glassfish/pom.xml | 2 +- examples/java8-webapp/pom.xml | 2 +- examples/jaxb/pom.xml | 2 +- examples/jaxrs-types-injection/pom.xml | 2 +- examples/jersey-ejb/pom.xml | 2 +- examples/json-binding-webapp/pom.xml | 2 +- examples/json-jackson/pom.xml | 2 +- examples/json-jettison/pom.xml | 2 +- examples/json-moxy/pom.xml | 2 +- examples/json-processing-webapp/pom.xml | 2 +- examples/json-with-padding/pom.xml | 2 +- examples/managed-beans-webapp/pom.xml | 2 +- examples/managed-client-simple-webapp/pom.xml | 2 +- examples/managed-client-webapp/pom.xml | 2 +- examples/managed-client/pom.xml | 2 +- examples/multipart-webapp/pom.xml | 2 +- examples/oauth-client-twitter/pom.xml | 2 +- examples/open-tracing/pom.xml | 2 +- examples/osgi-helloworld-webapp/additional-bundle/pom.xml | 2 +- .../osgi-helloworld-webapp/alternate-version-bundle/pom.xml | 2 +- examples/osgi-helloworld-webapp/functional-test/pom.xml | 2 +- examples/osgi-helloworld-webapp/lib-bundle/pom.xml | 2 +- examples/osgi-helloworld-webapp/pom.xml | 2 +- examples/osgi-helloworld-webapp/war-bundle/pom.xml | 2 +- examples/pom.xml | 2 +- examples/reload/pom.xml | 2 +- examples/rx-client-webapp/pom.xml | 2 +- examples/server-async-managed/pom.xml | 2 +- examples/server-async-standalone/client/pom.xml | 2 +- examples/server-async-standalone/pom.xml | 2 +- examples/server-async-standalone/webapp/pom.xml | 2 +- examples/server-async/pom.xml | 2 +- examples/server-sent-events-jaxrs/pom.xml | 2 +- examples/server-sent-events-jersey/pom.xml | 2 +- examples/servlet3-webapp/pom.xml | 2 +- examples/simple-console/pom.xml | 2 +- examples/sse-item-store-jaxrs-webapp/pom.xml | 2 +- examples/sse-item-store-jersey-webapp/pom.xml | 2 +- examples/sse-twitter-aggregator/pom.xml | 2 +- examples/system-properties-example/pom.xml | 2 +- examples/webapp-example-parent/pom.xml | 2 +- examples/xml-moxy/pom.xml | 2 +- ext/bean-validation/pom.xml | 2 +- ext/cdi/jersey-cdi-rs-inject/pom.xml | 2 +- ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/pom.xml | 2 +- ext/cdi/jersey-cdi1x-servlet/pom.xml | 2 +- ext/cdi/jersey-cdi1x-transaction/pom.xml | 2 +- ext/cdi/jersey-cdi1x-validation/pom.xml | 2 +- ext/cdi/jersey-cdi1x/pom.xml | 2 +- ext/cdi/jersey-weld2-se/pom.xml | 2 +- ext/cdi/pom.xml | 2 +- ext/entity-filtering/pom.xml | 2 +- ext/metainf-services/pom.xml | 2 +- ext/microprofile/mp-config/pom.xml | 2 +- ext/microprofile/mp-rest-client/pom.xml | 2 +- ext/microprofile/pom.xml | 2 +- ext/mvc-bean-validation/pom.xml | 2 +- ext/mvc-freemarker/pom.xml | 2 +- ext/mvc-jsp/pom.xml | 2 +- ext/mvc-mustache/pom.xml | 2 +- ext/mvc/pom.xml | 2 +- ext/pom.xml | 2 +- ext/proxy-client/pom.xml | 2 +- ext/rx/pom.xml | 2 +- ext/rx/rx-client-guava/pom.xml | 2 +- ext/rx/rx-client-rxjava/pom.xml | 2 +- ext/rx/rx-client-rxjava2/pom.xml | 2 +- ext/spring6/pom.xml | 2 +- ext/wadl-doclet/pom.xml | 2 +- incubator/cdi-inject-weld/pom.xml | 2 +- incubator/declarative-linking/pom.xml | 2 +- incubator/gae-integration/pom.xml | 2 +- incubator/html-json/pom.xml | 2 +- incubator/kryo/pom.xml | 2 +- incubator/open-tracing/pom.xml | 2 +- incubator/pom.xml | 2 +- inject/cdi2-se/pom.xml | 2 +- inject/hk2/pom.xml | 2 +- inject/pom.xml | 2 +- media/jaxb/pom.xml | 2 +- media/json-binding/pom.xml | 2 +- media/json-jackson/pom.xml | 2 +- media/json-jettison/pom.xml | 2 +- media/json-processing/pom.xml | 2 +- media/moxy/pom.xml | 2 +- media/multipart/pom.xml | 2 +- media/pom.xml | 2 +- media/sse/pom.xml | 2 +- pom.xml | 2 +- security/oauth1-client/pom.xml | 2 +- security/oauth1-server/pom.xml | 2 +- security/oauth1-signature/pom.xml | 2 +- security/oauth2-client/pom.xml | 2 +- security/pom.xml | 2 +- test-framework/core/pom.xml | 2 +- test-framework/maven/container-runner-maven-plugin/pom.xml | 2 +- test-framework/maven/custom-enforcer-rules/pom.xml | 2 +- test-framework/maven/pom.xml | 2 +- test-framework/memleak-test-common/pom.xml | 2 +- test-framework/pom.xml | 2 +- test-framework/providers/bundle/pom.xml | 2 +- test-framework/providers/external/pom.xml | 2 +- test-framework/providers/grizzly2/pom.xml | 2 +- test-framework/providers/inmemory/pom.xml | 2 +- test-framework/providers/jdk-http/pom.xml | 2 +- test-framework/providers/jetty/pom.xml | 2 +- test-framework/providers/netty/pom.xml | 2 +- test-framework/providers/pom.xml | 2 +- test-framework/providers/simple/pom.xml | 2 +- test-framework/util/pom.xml | 2 +- tests/e2e-client/pom.xml | 2 +- tests/e2e-core-common/pom.xml | 2 +- tests/e2e-entity/pom.xml | 2 +- tests/e2e-inject/cdi-inject-weld/pom.xml | 2 +- tests/e2e-inject/cdi2-se/pom.xml | 2 +- tests/e2e-inject/hk2/pom.xml | 2 +- tests/e2e-inject/pom.xml | 2 +- tests/e2e-server/pom.xml | 2 +- tests/e2e-testng/pom.xml | 2 +- tests/e2e/pom.xml | 2 +- tests/integration/asm/pom.xml | 2 +- tests/integration/async-jersey-filter/pom.xml | 2 +- .../cdi-integration/cdi-beanvalidation-webapp/pom.xml | 2 +- .../integration/cdi-integration/cdi-client-on-server/pom.xml | 2 +- tests/integration/cdi-integration/cdi-client/pom.xml | 2 +- tests/integration/cdi-integration/cdi-ejb-test-webapp/pom.xml | 2 +- .../cdi-iface-with-non-jaxrs-impl-test-webapp/pom.xml | 2 +- tests/integration/cdi-integration/cdi-log-check/pom.xml | 2 +- tests/integration/cdi-integration/cdi-manually-bound/pom.xml | 2 +- tests/integration/cdi-integration/cdi-multimodule/ear/pom.xml | 2 +- tests/integration/cdi-integration/cdi-multimodule/lib/pom.xml | 2 +- tests/integration/cdi-integration/cdi-multimodule/pom.xml | 2 +- .../integration/cdi-integration/cdi-multimodule/war1/pom.xml | 2 +- .../integration/cdi-integration/cdi-multimodule/war2/pom.xml | 2 +- .../integration/cdi-integration/cdi-multipart-webapp/pom.xml | 2 +- .../cdi-integration/cdi-resource-with-at-context/pom.xml | 2 +- tests/integration/cdi-integration/cdi-singleton/pom.xml | 2 +- tests/integration/cdi-integration/cdi-test-webapp/pom.xml | 2 +- .../cdi-with-jersey-injection-custom-cfg-webapp/pom.xml | 2 +- .../pom.xml | 2 +- .../cdi-integration/cdi-with-jersey-injection-webapp/pom.xml | 2 +- .../cdi-integration/context-inject-on-server/pom.xml | 2 +- tests/integration/cdi-integration/pom.xml | 2 +- tests/integration/client-connector-provider/pom.xml | 2 +- tests/integration/ejb-multimodule-reload/ear/pom.xml | 2 +- tests/integration/ejb-multimodule-reload/lib/pom.xml | 2 +- tests/integration/ejb-multimodule-reload/pom.xml | 2 +- tests/integration/ejb-multimodule-reload/war1/pom.xml | 2 +- tests/integration/ejb-multimodule-reload/war2/pom.xml | 2 +- tests/integration/ejb-multimodule/ear/pom.xml | 2 +- tests/integration/ejb-multimodule/lib/pom.xml | 2 +- tests/integration/ejb-multimodule/pom.xml | 2 +- tests/integration/ejb-multimodule/war/pom.xml | 2 +- tests/integration/ejb-test-webapp/pom.xml | 2 +- tests/integration/externalproperties/pom.xml | 2 +- tests/integration/j-376/pom.xml | 2 +- tests/integration/j-441/ear/pom.xml | 2 +- tests/integration/j-441/pom.xml | 2 +- tests/integration/j-441/war1/pom.xml | 2 +- tests/integration/j-441/war2/pom.xml | 2 +- tests/integration/j-59/ear/pom.xml | 2 +- tests/integration/j-59/lib/pom.xml | 2 +- tests/integration/j-59/pom.xml | 2 +- tests/integration/j-59/war/pom.xml | 2 +- tests/integration/jaxrs-component-inject/pom.xml | 2 +- tests/integration/jersey-1107/pom.xml | 2 +- tests/integration/jersey-1223/pom.xml | 2 +- tests/integration/jersey-1604/pom.xml | 2 +- tests/integration/jersey-1667/pom.xml | 2 +- tests/integration/jersey-1883/pom.xml | 2 +- tests/integration/jersey-1928/pom.xml | 2 +- tests/integration/jersey-1960/pom.xml | 2 +- tests/integration/jersey-1964/pom.xml | 2 +- tests/integration/jersey-2031/pom.xml | 2 +- tests/integration/jersey-2136/pom.xml | 2 +- tests/integration/jersey-2137/pom.xml | 2 +- tests/integration/jersey-2154/pom.xml | 2 +- tests/integration/jersey-2160/pom.xml | 2 +- tests/integration/jersey-2164/pom.xml | 2 +- tests/integration/jersey-2167/pom.xml | 2 +- tests/integration/jersey-2176/pom.xml | 2 +- tests/integration/jersey-2184/pom.xml | 2 +- tests/integration/jersey-2255/pom.xml | 2 +- tests/integration/jersey-2322/pom.xml | 2 +- tests/integration/jersey-2335/pom.xml | 2 +- tests/integration/jersey-2421/pom.xml | 2 +- tests/integration/jersey-2551/pom.xml | 2 +- tests/integration/jersey-2612/pom.xml | 2 +- tests/integration/jersey-2637/pom.xml | 2 +- tests/integration/jersey-2654/pom.xml | 2 +- tests/integration/jersey-2673/pom.xml | 2 +- tests/integration/jersey-2689/pom.xml | 2 +- tests/integration/jersey-2704/pom.xml | 2 +- tests/integration/jersey-2776/pom.xml | 2 +- tests/integration/jersey-2794/pom.xml | 2 +- tests/integration/jersey-2846/pom.xml | 2 +- tests/integration/jersey-2878/pom.xml | 2 +- tests/integration/jersey-2892/pom.xml | 2 +- tests/integration/jersey-3662/pom.xml | 2 +- tests/integration/jersey-3670/pom.xml | 2 +- tests/integration/jersey-3796/pom.xml | 2 +- tests/integration/jersey-3992/pom.xml | 2 +- tests/integration/jersey-4003/pom.xml | 2 +- tests/integration/jersey-4099/pom.xml | 2 +- tests/integration/jersey-4321/pom.xml | 2 +- tests/integration/jersey-4507/pom.xml | 2 +- tests/integration/jersey-4542/pom.xml | 2 +- tests/integration/jersey-4697/pom.xml | 2 +- tests/integration/jersey-4722/pom.xml | 2 +- tests/integration/jersey-4949/pom.xml | 2 +- tests/integration/jersey-780/pom.xml | 2 +- tests/integration/microprofile/config/helidon/pom.xml | 2 +- tests/integration/microprofile/config/pom.xml | 2 +- tests/integration/microprofile/config/webapp/pom.xml | 2 +- tests/integration/microprofile/pom.xml | 2 +- tests/integration/microprofile/rest-client-tck/pom.xml | 2 +- tests/integration/microprofile/rest-client/pom.xml | 2 +- tests/integration/pom.xml | 2 +- tests/integration/property-check/pom.xml | 2 +- tests/integration/reactive-streams/pom.xml | 2 +- tests/integration/reactive-streams/sse/pom.xml | 2 +- tests/integration/security-digest/pom.xml | 2 +- tests/integration/servlet-2.5-autodiscovery-1/pom.xml | 2 +- tests/integration/servlet-2.5-autodiscovery-2/pom.xml | 2 +- tests/integration/servlet-2.5-filter/pom.xml | 2 +- tests/integration/servlet-2.5-inflector-1/pom.xml | 2 +- tests/integration/servlet-2.5-init-1/pom.xml | 2 +- tests/integration/servlet-2.5-init-2/pom.xml | 2 +- tests/integration/servlet-2.5-init-3/pom.xml | 2 +- tests/integration/servlet-2.5-init-4/pom.xml | 2 +- tests/integration/servlet-2.5-init-5/pom.xml | 2 +- tests/integration/servlet-2.5-init-6/pom.xml | 2 +- tests/integration/servlet-2.5-init-7/pom.xml | 2 +- tests/integration/servlet-2.5-init-8/pom.xml | 2 +- tests/integration/servlet-2.5-mvc-1/pom.xml | 2 +- tests/integration/servlet-2.5-mvc-2/pom.xml | 2 +- tests/integration/servlet-2.5-mvc-3/pom.xml | 2 +- tests/integration/servlet-2.5-reload/pom.xml | 2 +- tests/integration/servlet-3-async/pom.xml | 2 +- tests/integration/servlet-3-chunked-io/pom.xml | 2 +- tests/integration/servlet-3-filter/pom.xml | 2 +- tests/integration/servlet-3-gf-async/pom.xml | 2 +- tests/integration/servlet-3-inflector-1/pom.xml | 2 +- tests/integration/servlet-3-init-1/pom.xml | 2 +- tests/integration/servlet-3-init-2/pom.xml | 2 +- tests/integration/servlet-3-init-3/pom.xml | 2 +- tests/integration/servlet-3-init-4/pom.xml | 2 +- tests/integration/servlet-3-init-5/pom.xml | 2 +- tests/integration/servlet-3-init-6/pom.xml | 2 +- tests/integration/servlet-3-init-7/pom.xml | 2 +- tests/integration/servlet-3-init-8/pom.xml | 2 +- tests/integration/servlet-3-init-9/pom.xml | 2 +- tests/integration/servlet-3-init-provider/pom.xml | 2 +- tests/integration/servlet-3-params/pom.xml | 2 +- tests/integration/servlet-3-sse-1/pom.xml | 2 +- tests/integration/servlet-4.0-mvc-1/pom.xml | 2 +- tests/integration/servlet-request-wrapper-binding-2/pom.xml | 2 +- tests/integration/servlet-request-wrapper-binding/pom.xml | 2 +- tests/integration/servlet-tests/pom.xml | 2 +- tests/integration/sonar-test/pom.xml | 2 +- tests/integration/spring6/pom.xml | 2 +- tests/integration/tracing-support/pom.xml | 2 +- tests/jmockit/pom.xml | 2 +- tests/mem-leaks/pom.xml | 2 +- tests/mem-leaks/redeployment/pom.xml | 2 +- .../redeployment/redeployment-hello-world-app-ref/pom.xml | 4 ++-- .../redeployment/redeployment-leaking-test-app/pom.xml | 2 +- .../mem-leaks/redeployment/redeployment-no-jersey-app/pom.xml | 2 +- .../redeployment/redeployment-threadlocals-app/pom.xml | 2 +- tests/mem-leaks/test-cases/bean-param-leak/pom.xml | 2 +- tests/mem-leaks/test-cases/leaking-test-app/pom.xml | 2 +- tests/mem-leaks/test-cases/pom.xml | 2 +- tests/mem-leaks/test-cases/shutdown-hook-leak-client/pom.xml | 2 +- tests/mem-leaks/test-cases/shutdown-hook-leak/pom.xml | 2 +- tests/osgi/functional/pom.xml | 2 +- tests/osgi/pom.xml | 2 +- tests/performance/benchmarks/pom.xml | 2 +- tests/performance/pom.xml | 2 +- tests/performance/runners/jersey-grizzly-runner/pom.xml | 2 +- tests/performance/runners/pom.xml | 2 +- tests/performance/test-cases/assemblies/pom.xml | 2 +- tests/performance/test-cases/filter-dynamic/pom.xml | 2 +- tests/performance/test-cases/filter-global/pom.xml | 2 +- tests/performance/test-cases/filter-name/pom.xml | 2 +- tests/performance/test-cases/interceptor-dynamic/pom.xml | 2 +- tests/performance/test-cases/interceptor-global/pom.xml | 2 +- tests/performance/test-cases/interceptor-name/pom.xml | 2 +- tests/performance/test-cases/mbw-custom-provider/pom.xml | 2 +- tests/performance/test-cases/mbw-json-jackson/pom.xml | 2 +- tests/performance/test-cases/mbw-json-moxy/pom.xml | 2 +- tests/performance/test-cases/mbw-kryo/pom.xml | 2 +- tests/performance/test-cases/mbw-text-plain/pom.xml | 2 +- tests/performance/test-cases/mbw-xml-jaxb/pom.xml | 2 +- tests/performance/test-cases/mbw-xml-moxy/pom.xml | 2 +- tests/performance/test-cases/param-srl/pom.xml | 2 +- tests/performance/test-cases/pom.xml | 2 +- tests/performance/test-cases/proxy-injection/pom.xml | 2 +- tests/performance/tools/pom.xml | 2 +- tests/pom.xml | 2 +- tests/stress/pom.xml | 2 +- 360 files changed, 363 insertions(+), 363 deletions(-) diff --git a/archetypes/jersey-example-java8-webapp/pom.xml b/archetypes/jersey-example-java8-webapp/pom.xml index a31bd683b2..ab7714f179 100644 --- a/archetypes/jersey-example-java8-webapp/pom.xml +++ b/archetypes/jersey-example-java8-webapp/pom.xml @@ -22,7 +22,7 @@ org.glassfish.jersey.archetypes project - 3.1.0-SNAPSHOT + 3.0.5 jersey-example-java8-webapp diff --git a/archetypes/jersey-heroku-webapp/pom.xml b/archetypes/jersey-heroku-webapp/pom.xml index e33c51f5b7..f2c211d789 100644 --- a/archetypes/jersey-heroku-webapp/pom.xml +++ b/archetypes/jersey-heroku-webapp/pom.xml @@ -22,7 +22,7 @@ org.glassfish.jersey.archetypes project - 3.1.0-SNAPSHOT + 3.0.5 maven-archetype diff --git a/archetypes/jersey-quickstart-grizzly2/pom.xml b/archetypes/jersey-quickstart-grizzly2/pom.xml index 32d4a9a869..0929e9e3a4 100644 --- a/archetypes/jersey-quickstart-grizzly2/pom.xml +++ b/archetypes/jersey-quickstart-grizzly2/pom.xml @@ -21,7 +21,7 @@ org.glassfish.jersey.archetypes project - 3.1.0-SNAPSHOT + 3.0.5 jersey-quickstart-grizzly2 maven-archetype diff --git a/archetypes/jersey-quickstart-webapp/pom.xml b/archetypes/jersey-quickstart-webapp/pom.xml index 5b395540d4..e219c6fc46 100644 --- a/archetypes/jersey-quickstart-webapp/pom.xml +++ b/archetypes/jersey-quickstart-webapp/pom.xml @@ -21,7 +21,7 @@ org.glassfish.jersey.archetypes project - 3.1.0-SNAPSHOT + 3.0.5 4.0.0 maven-archetype diff --git a/archetypes/pom.xml b/archetypes/pom.xml index baba57c996..7e321187a6 100644 --- a/archetypes/pom.xml +++ b/archetypes/pom.xml @@ -22,7 +22,7 @@ org.glassfish.jersey project - 3.1.0-SNAPSHOT + 3.0.5 org.glassfish.jersey.archetypes diff --git a/bom/pom.xml b/bom/pom.xml index e64e12fa02..cb2c090450 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -30,7 +30,7 @@ org.glassfish.jersey jersey-bom - 3.1.0-SNAPSHOT + 3.0.5 pom jersey-bom diff --git a/bundles/apidocs/pom.xml b/bundles/apidocs/pom.xml index 7e3c65c302..8738be2fc5 100644 --- a/bundles/apidocs/pom.xml +++ b/bundles/apidocs/pom.xml @@ -22,7 +22,7 @@ org.glassfish.jersey.bundles project - 3.1.0-SNAPSHOT + 3.0.5 apidocs diff --git a/bundles/examples/pom.xml b/bundles/examples/pom.xml index a3e5e7b414..6ad85d7166 100644 --- a/bundles/examples/pom.xml +++ b/bundles/examples/pom.xml @@ -1,7 +1,7 @@