Merge MASTER to JAX_RS_2_2 branch
Signed-off-by: Jan Supol <jan.supol@oracle.com>
diff --git a/.travis.yml b/.travis.yml
index 964c748..de1dd18 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,5 @@
+dist: trusty
+
sudo: required
language: java
@@ -7,7 +9,7 @@
jdk:
- oraclejdk8
- - openjdk8
+ - openjdk11
cache:
directories:
diff --git a/README.md b/README.md
index 3656671..92f22fa 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[//]: # " Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. "
+[//]: # " Copyright (c) 2012, 2019 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 "
@@ -13,6 +13,8 @@
[//]: # " SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 "
[](https://travis-ci.org/eclipse-ee4j/jersey)
+ [](https://www.eclipse.org/legal/epl-2.0/)
+ [](https://www.gnu.org/software/classpath/license.html)
### About Jersey
diff --git a/archetypes/jersey-example-java8-webapp/pom.xml b/archetypes/jersey-example-java8-webapp/pom.xml
index 08699f8..9708e4f 100644
--- a/archetypes/jersey-example-java8-webapp/pom.xml
+++ b/archetypes/jersey-example-java8-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.archetypes</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-example-java8-webapp</artifactId>
diff --git a/archetypes/jersey-heroku-webapp/pom.xml b/archetypes/jersey-heroku-webapp/pom.xml
index ea156ec..4556948 100644
--- a/archetypes/jersey-heroku-webapp/pom.xml
+++ b/archetypes/jersey-heroku-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.archetypes</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<packaging>maven-archetype</packaging>
diff --git a/archetypes/jersey-quickstart-grizzly2/pom.xml b/archetypes/jersey-quickstart-grizzly2/pom.xml
index ad86d93..2d85336 100644
--- a/archetypes/jersey-quickstart-grizzly2/pom.xml
+++ b/archetypes/jersey-quickstart-grizzly2/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.glassfish.jersey.archetypes</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-quickstart-grizzly2</artifactId>
<packaging>maven-archetype</packaging>
diff --git a/archetypes/jersey-quickstart-webapp/pom.xml b/archetypes/jersey-quickstart-webapp/pom.xml
index d2dfa76..3d0f10b 100644
--- a/archetypes/jersey-quickstart-webapp/pom.xml
+++ b/archetypes/jersey-quickstart-webapp/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.glassfish.jersey.archetypes</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>maven-archetype</packaging>
diff --git a/archetypes/pom.xml b/archetypes/pom.xml
index 2ba2da7..af36c87 100644
--- a/archetypes/pom.xml
+++ b/archetypes/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.archetypes</groupId>
diff --git a/bom/pom.xml b/bom/pom.xml
index e2b5ccb..fcdf548 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -30,7 +30,7 @@
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<packaging>pom</packaging>
<name>jersey-bom</name>
@@ -149,6 +149,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.glassfish.jersey.ext.microprofile</groupId>
+ <artifactId>jersey-mp-config</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-mvc</artifactId>
<version>${project.version}</version>
@@ -190,6 +195,11 @@
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
+ <artifactId>jersey-spring5</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-declarative-linking</artifactId>
<version>${project.version}</version>
</dependency>
@@ -244,6 +254,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.glassfish.jersey.ext.microprofile</groupId>
+ <artifactId>jersey-mp-rest-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-jaxb</artifactId>
<version>${project.version}</version>
@@ -379,6 +394,15 @@
<artifactId>glassfish-copyright-maven-plugin</artifactId>
<inherited>true</inherited>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.7.1</version>
+ <configuration>
+ <generateProjectInfo>false</generateProjectInfo>
+ <generateReports>true</generateReports>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git a/bundles/apidocs/pom.xml b/bundles/apidocs/pom.xml
index cc069cd..9c030db 100644
--- a/bundles/apidocs/pom.xml
+++ b/bundles/apidocs/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.bundles</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>apidocs</artifactId>
diff --git a/bundles/examples/pom.xml b/bundles/examples/pom.xml
index b739345..c707da0 100644
--- a/bundles/examples/pom.xml
+++ b/bundles/examples/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey.bundles</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-examples</artifactId>
diff --git a/bundles/jaxrs-ri/pom.xml b/bundles/jaxrs-ri/pom.xml
index ec7361b..baae254 100644
--- a/bundles/jaxrs-ri/pom.xml
+++ b/bundles/jaxrs-ri/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.bundles</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jaxrs-ri</artifactId>
@@ -175,8 +175,8 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -281,10 +281,11 @@
javax.servlet.annotation.*;resolution:=optional;version="[2.4,5.0)",
javax.servlet.descriptor.*;resolution:=optional;version="[2.4,5.0)",
javax.servlet.*;version="[2.4,5.0)",
- javax.annotation;version="!",
+ ${javax.annotation.osgi.version},
javax.persistence.*;resolution:=optional,
javax.validation.*;resolution:=optional;version="${range;[==,3);${javax.validation.api.version}}",
sun.misc.*;resolution:=optional,
+ ${hk2.osgi.version},
*
]]></Import-Package>
<Private-Package>
diff --git a/bundles/pom.xml b/bundles/pom.xml
index f9c3e12..34373de 100644
--- a/bundles/pom.xml
+++ b/bundles/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.bundles</groupId>
diff --git a/connectors/apache-connector/pom.xml b/connectors/apache-connector/pom.xml
index 9d5e8c1..f4db1b3 100644
--- a/connectors/apache-connector/pom.xml
+++ b/connectors/apache-connector/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-apache-connector</artifactId>
diff --git a/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheClientProperties.java b/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheClientProperties.java
index 6f87627..b779197 100644
--- a/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheClientProperties.java
+++ b/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheClientProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
*
* @author jorgeluisw@mac.com
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Arul Dhesiaseelan (aruld at acm.org)
*/
@PropertiesClass
@@ -135,6 +135,28 @@
public static final String RETRY_HANDLER = "jersey.config.apache.client.retryHandler";
/**
+ * ConnectionReuseStrategy for the {@link org.apache.http.client.HttpClient}.
+ * <p/>
+ * The value MUST be an instance of {@link org.apache.http.impl.ConnectionReuseStrategy}.
+ * <p/>
+ * If the property is absent the default reuse strategy of the Apache HTTP library will be used
+ * <p/>
+ * The name of the configuration property is <tt>{@value}</tt>.
+ */
+ public static final String REUSE_STRATEGY = "jersey.config.apache.client.reuseStrategy";
+
+ /**
+ * ConnectionKeepAliveStrategy for the {@link org.apache.http.client.HttpClient}.
+ * <p/>
+ * The value MUST be an instance of {@link org.apache.http.conn.ConnectionKeepAliveStrategy}.
+ * <p/>
+ * If the property is absent the default keepalive strategy of the Apache HTTP library will be used
+ * <p/>
+ * The name of the configuration property is <tt>{@value}</tt>.
+ */
+ public static final String KEEPALIVE_STRATEGY = "jersey.config.apache.client.keepAliveStrategy";
+
+ /**
* Get the value of the specified property.
*
* If the property is not set or the actual property value type is not compatible with the specified type, the method will
diff --git a/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnector.java b/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnector.java
index 693a8d3..16a1131 100644
--- a/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnector.java
+++ b/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicLong;
@@ -56,7 +57,7 @@
import org.glassfish.jersey.message.internal.OutboundMessageContext;
import org.glassfish.jersey.message.internal.ReaderWriter;
import org.glassfish.jersey.message.internal.Statuses;
-
+import org.apache.http.ConnectionReuseStrategy;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
@@ -76,6 +77,7 @@
import org.apache.http.config.ConnectionConfig;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.ConnectionKeepAliveStrategy;
import org.apache.http.conn.HttpClientConnectionManager;
import org.apache.http.conn.ManagedHttpClientConnection;
import org.apache.http.conn.routing.HttpRoute;
@@ -111,12 +113,14 @@
* <li>{@link ApacheClientProperties#REQUEST_CONFIG}</li>
* <li>{@link ApacheClientProperties#CREDENTIALS_PROVIDER}</li>
* <li>{@link ApacheClientProperties#DISABLE_COOKIES}</li>
- * <li>{@link ClientProperties#PROXY_URI}</li>
- * <li>{@link ClientProperties#PROXY_USERNAME}</li>
- * <li>{@link ClientProperties#PROXY_PASSWORD}</li>
- * <li>{@link ClientProperties#REQUEST_ENTITY_PROCESSING} - default value is {@link RequestEntityProcessing#CHUNKED}</li>
+ * <li>{@link ApacheClientProperties#KEEPALIVE_STRATEGY}</li>
+ * <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_URI}</li>
+ * <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_USERNAME}</li>
+ * <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_PASSWORD}</li>
+ * <li>{@link org.glassfish.jersey.client.ClientProperties#REQUEST_ENTITY_PROCESSING} - default value is {@link org.glassfish.jersey.client.RequestEntityProcessing#CHUNKED}</li>
* <li>{@link ApacheClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}</li>
* <li>{@link ApacheClientProperties#RETRY_HANDLER}</li>
+ * <li>{@link ApacheClientProperties#REUSE_STRATEGY}</li>
* </ul>
* <p>
* This connector uses {@link RequestEntityProcessing#CHUNKED chunked encoding} as a default setting. This can
@@ -135,6 +139,12 @@
* be set to {@code true}.
* </p>
* <p>
+ * Registration of {@link ApacheHttpClientBuilderConfigurator} instance on the
+ * {@link javax.ws.rs.client.Client#register(Object) Client} is supported. A configuration provided by
+ * {@link ApacheHttpClientBuilderConfigurator} will override the {@link org.apache.http.impl.client.HttpClientBuilder}
+ * configuration set by using the properties.
+ * </p>
+ * <p>
* If a {@link org.glassfish.jersey.client.ClientResponse} is obtained and an
* entity is not read from the response then
* {@link org.glassfish.jersey.client.ClientResponse#close()} MUST be called
@@ -155,7 +165,7 @@
*
* @author jorgeluisw@mac.com
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Arul Dhesiaseelan (aruld at acm.org)
* @see ApacheClientProperties#CONNECTION_MANAGER
*/
@@ -197,6 +207,34 @@
}
}
+ Object keepAliveStrategy = config.getProperties().get(ApacheClientProperties.KEEPALIVE_STRATEGY);
+ if (keepAliveStrategy != null) {
+ if (!(keepAliveStrategy instanceof ConnectionKeepAliveStrategy)) {
+ LOGGER.log(
+ Level.WARNING,
+ LocalizationMessages.IGNORING_VALUE_OF_PROPERTY(
+ ApacheClientProperties.KEEPALIVE_STRATEGY,
+ keepAliveStrategy.getClass().getName(),
+ ConnectionKeepAliveStrategy.class.getName())
+ );
+ keepAliveStrategy = null;
+ }
+ }
+
+ Object reuseStrategy = config.getProperties().get(ApacheClientProperties.REUSE_STRATEGY);
+ if (reuseStrategy != null) {
+ if (!(reuseStrategy instanceof ConnectionReuseStrategy)) {
+ LOGGER.log(
+ Level.WARNING,
+ LocalizationMessages.IGNORING_VALUE_OF_PROPERTY(
+ ApacheClientProperties.REUSE_STRATEGY,
+ reuseStrategy.getClass().getName(),
+ ConnectionReuseStrategy.class.getName())
+ );
+ reuseStrategy = null;
+ }
+ }
+
Object reqConfig = config.getProperties().get(ApacheClientProperties.REQUEST_CONFIG);
if (reqConfig != null) {
if (!(reqConfig instanceof RequestConfig)) {
@@ -217,7 +255,13 @@
clientBuilder.setConnectionManager(getConnectionManager(client, config, sslContext));
clientBuilder.setConnectionManagerShared(
PropertiesHelper.getValue(config.getProperties(), ApacheClientProperties.CONNECTION_MANAGER_SHARED, false, null));
- clientBuilder.setSslcontext(sslContext);
+ clientBuilder.setSSLContext(sslContext);
+ if (keepAliveStrategy != null) {
+ clientBuilder.setKeepAliveStrategy((ConnectionKeepAliveStrategy) keepAliveStrategy);
+ }
+ if (reuseStrategy != null) {
+ clientBuilder.setConnectionReuseStrategy((ConnectionReuseStrategy) reuseStrategy);
+ }
final RequestConfig.Builder requestConfigBuilder = RequestConfig.custom();
@@ -280,7 +324,15 @@
this.cookieStore = null;
}
clientBuilder.setDefaultRequestConfig(requestConfig);
- this.client = clientBuilder.build();
+
+ Optional<Object> contract = config.getInstances().stream()
+ .filter(a -> ApacheHttpClientBuilderConfigurator.class.isInstance(a)).findFirst();
+
+ final HttpClientBuilder configuredBuilder = contract.isPresent()
+ ? ((ApacheHttpClientBuilderConfigurator) contract.get()).configure(clientBuilder)
+ : null;
+
+ this.client = configuredBuilder != null ? configuredBuilder.build() : clientBuilder.build();
}
private HttpClientConnectionManager getConnectionManager(final Client client,
diff --git a/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnectorProvider.java b/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnectorProvider.java
index 1d988b0..d92d490 100644
--- a/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnectorProvider.java
+++ b/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -37,6 +37,7 @@
* <li>{@link ApacheClientProperties#REQUEST_CONFIG}</li>
* <li>{@link ApacheClientProperties#CREDENTIALS_PROVIDER}</li>
* <li>{@link ApacheClientProperties#DISABLE_COOKIES}</li>
+ * <li>{@link ApacheClientProperties#KEEPALIVE_STRATEGY}</li>
* <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_URI}</li>
* <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_USERNAME}</li>
* <li>{@link org.glassfish.jersey.client.ClientProperties#PROXY_PASSWORD}</li>
@@ -44,6 +45,7 @@
* - default value is {@link org.glassfish.jersey.client.RequestEntityProcessing#CHUNKED}</li>
* <li>{@link ApacheClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}</li>
* <li>{@link ApacheClientProperties#RETRY_HANDLER}</li>
+ * <li>{@link ApacheClientProperties#REUSE_STRATEGY}</li>
* </ul>
* </p>
* <p>
@@ -70,6 +72,12 @@
* connection-based resources.
* </p>
* <p>
+ * Registration of {@link ApacheHttpClientBuilderConfigurator} instance on the
+ * {@link javax.ws.rs.client.Client#register(Object) Client} is supported. A configuration provided by
+ * {@link ApacheHttpClientBuilderConfigurator} will override the {@link org.apache.http.impl.client.HttpClientBuilder}
+ * configuration set by using the properties.
+ * </p>
+ * <p>
* If a response entity is obtained that is an instance of {@link java.io.Closeable}
* then the instance MUST be closed after processing the entity to release
* connection-based resources.
@@ -78,10 +86,10 @@
* The following methods are currently supported: HEAD, GET, POST, PUT, DELETE, OPTIONS, PATCH and TRACE.
* <p/>
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Arul Dhesiaseelan (aruld at acm.org)
* @author jorgeluisw at mac.com
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Paul Sandoz
* @author Maksim Mukosey (mmukosey at gmail.com)
* @since 2.5
diff --git a/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheHttpClientBuilderConfigurator.java b/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheHttpClientBuilderConfigurator.java
new file mode 100644
index 0000000..251a5c4
--- /dev/null
+++ b/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheHttpClientBuilderConfigurator.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2019 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.apache.connector;
+
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.glassfish.jersey.spi.Contract;
+
+/**
+ * A callback interface used to configure {@link org.apache.http.impl.client.HttpClientBuilder}. It is called immediately before
+ * the {@link ApacheConnectorProvider} creates {@link org.apache.http.client.HttpClient}, after the
+ * {@link org.apache.http.impl.client.HttpClientBuilder} is configured using the properties.
+ */
+@Contract
+public interface ApacheHttpClientBuilderConfigurator {
+ /**
+ * A callback method to configure the {@link org.apache.http.impl.client.HttpClientBuilder}
+ * @param httpClientBuilder {@link org.apache.http.impl.client.HttpClientBuilder} object to be further configured
+ * @return the configured {@link org.apache.http.impl.client.HttpClientBuilder}. If {@code null} is returned the
+ * {@code httpClientBuilder} is used by {@link ApacheConnectorProvider} instead.
+ */
+ HttpClientBuilder configure(HttpClientBuilder httpClientBuilder);
+}
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/AsyncTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/AsyncTest.java
index 3e3896f..82e2d5d 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/AsyncTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/AsyncTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -49,7 +49,7 @@
* Asynchronous connector test.
*
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncTest extends JerseyTest {
private static final Logger LOGGER = Logger.getLogger(AsyncTest.class.getName());
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/AuthTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/AuthTest.java
index 07586e9..dceb272 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/AuthTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/AuthTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -33,6 +33,7 @@
import javax.inject.Singleton;
+import org.apache.http.impl.client.HttpClientBuilder;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
import org.glassfish.jersey.client.authentication.ResponseAuthenticationException;
@@ -570,6 +571,25 @@
.queryParam("param1", "value1")
.queryParam("param2", "value2");
assertEquals("GET 3", r.request().get(String.class));
+ }
+ @Test
+ public void testAuthGetWithConfigurator() {
+ CredentialsProvider credentialsProvider = new org.apache.http.impl.client.BasicCredentialsProvider();
+ credentialsProvider.setCredentials(
+ AuthScope.ANY,
+ new UsernamePasswordCredentials("name", "password")
+ );
+ ApacheHttpClientBuilderConfigurator apacheHttpClientBuilderConfigurator = (httpClientBuilder) -> {
+ return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
+ };
+
+ ClientConfig cc = new ClientConfig();
+ cc.register(apacheHttpClientBuilderConfigurator);
+ cc.connectorProvider(new ApacheConnectorProvider());
+ Client client = ClientBuilder.newClient(cc);
+ WebTarget r = client.target(getBaseUri()).path("test");
+
+ assertEquals("GET", r.request().get(String.class));
}
}
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/DisableContentEncodingTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/DisableContentEncodingTest.java
index 2fd7048..4e2681f 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/DisableContentEncodingTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/DisableContentEncodingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
*/
public class DisableContentEncodingTest extends JerseyTest {
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/FollowRedirectsTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/FollowRedirectsTest.java
index 267fd5d..f55bf78 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/FollowRedirectsTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/FollowRedirectsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,7 +44,7 @@
*
* @author Martin Matula
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class FollowRedirectsTest extends JerseyTest {
private static final Logger LOGGER = Logger.getLogger(TimeoutTest.class.getName());
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/HelloWorldTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/HelloWorldTest.java
index 9c3bfd6..e6a29e5 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/HelloWorldTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/HelloWorldTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -70,7 +70,7 @@
import static org.junit.Assert.fail;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class HelloWorldTest extends JerseyTest {
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/LargeDataTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/LargeDataTest.java
index 5483203..938096c 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/LargeDataTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/LargeDataTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -62,8 +62,8 @@
* It is also possible to send the data to netcat: {@code nc -l 8080} and verify the problem is
* on the client side.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Stepan Vavra
+ * @author Marek Potociar
*/
public class LargeDataTest extends JerseyTest {
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java
index 2f1f1c3..a263177 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/ManagedClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -52,7 +52,7 @@
/**
* Jersey programmatic managed client test
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ManagedClientTest extends JerseyTest {
@@ -87,7 +87,7 @@
* to every method that is annotated with {@link Require @Require} internal feature
* annotation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public static class CustomHeaderFeature implements DynamicFeature {
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/StreamingTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/StreamingTest.java
index 6bfac5a..218bf4b 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/StreamingTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/StreamingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -40,7 +40,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class StreamingTest extends JerseyTest {
private PoolingHttpClientConnectionManager connectionManager;
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/TraceSupportTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/TraceSupportTest.java
index 4691bb9..c0442f2 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/TraceSupportTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/TraceSupportTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -54,7 +54,7 @@
* This very basic resource showcases support of a HTTP TRACE method,
* not directly supported by JAX-RS API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TraceSupportTest extends JerseyTest {
diff --git a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/UnderlyingHttpClientAccessTest.java b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/UnderlyingHttpClientAccessTest.java
index a5a0299..61b9bd0 100644
--- a/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/UnderlyingHttpClientAccessTest.java
+++ b/connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/UnderlyingHttpClientAccessTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
/**
* Test of access to the underlying HTTP client instance used by the connector.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UnderlyingHttpClientAccessTest {
diff --git a/connectors/grizzly-connector/pom.xml b/connectors/grizzly-connector/pom.xml
index 9680eb4..6c8a378 100644
--- a/connectors/grizzly-connector/pom.xml
+++ b/connectors/grizzly-connector/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-grizzly-connector</artifactId>
diff --git a/connectors/grizzly-connector/src/main/java/org/glassfish/jersey/grizzly/connector/GrizzlyConnector.java b/connectors/grizzly-connector/src/main/java/org/glassfish/jersey/grizzly/connector/GrizzlyConnector.java
index 6b3a3bc..e4428d5 100644
--- a/connectors/grizzly-connector/src/main/java/org/glassfish/jersey/grizzly/connector/GrizzlyConnector.java
+++ b/connectors/grizzly-connector/src/main/java/org/glassfish/jersey/grizzly/connector/GrizzlyConnector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -68,7 +68,7 @@
* The transport using the AsyncHttpClient.
*
* @author Stepan Kopriva
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class GrizzlyConnector implements Connector {
diff --git a/connectors/grizzly-connector/src/main/java/org/glassfish/jersey/grizzly/connector/GrizzlyConnectorProvider.java b/connectors/grizzly-connector/src/main/java/org/glassfish/jersey/grizzly/connector/GrizzlyConnectorProvider.java
index ab39857..7aff9eb 100644
--- a/connectors/grizzly-connector/src/main/java/org/glassfish/jersey/grizzly/connector/GrizzlyConnectorProvider.java
+++ b/connectors/grizzly-connector/src/main/java/org/glassfish/jersey/grizzly/connector/GrizzlyConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -65,7 +65,7 @@
* The following methods are currently supported: HEAD, GET, POST, PUT, DELETE, OPTIONS, PATCH and TRACE.
* <p/>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.5
*/
public class GrizzlyConnectorProvider implements ConnectorProvider {
diff --git a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/AsyncTest.java b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/AsyncTest.java
index 78298fc..754c371 100644
--- a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/AsyncTest.java
+++ b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/AsyncTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -44,7 +44,7 @@
* Asynchronous connector test.
*
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncTest extends JerseyTest {
diff --git a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/CustomizersTest.java b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/CustomizersTest.java
index b28aae5..75e0ca0 100644
--- a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/CustomizersTest.java
+++ b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/CustomizersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -45,7 +45,7 @@
/**
* Async HTTP Client Config and Request customizers unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CustomizersTest extends JerseyTest {
diff --git a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/FollowRedirectsTest.java b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/FollowRedirectsTest.java
index 7c9c417..21f8879 100644
--- a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/FollowRedirectsTest.java
+++ b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/FollowRedirectsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -41,7 +41,7 @@
* Grizzly connector follow redirect tests.
*
* @author Martin Matula
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class FollowRedirectsTest extends JerseyTest {
@Path("/test")
diff --git a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/NoEntityTest.java b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/NoEntityTest.java
index eacf6ed..a6db9ee 100644
--- a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/NoEntityTest.java
+++ b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/NoEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -36,7 +36,7 @@
/**
* @author Paul Sandoz
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class NoEntityTest extends JerseyTest {
private static final Logger LOGGER = Logger.getLogger(NoEntityTest.class.getName());
diff --git a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/TraceSupportTest.java b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/TraceSupportTest.java
index 4a132ef..d5b2cf5 100644
--- a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/TraceSupportTest.java
+++ b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/TraceSupportTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -54,7 +54,7 @@
* This very basic resource showcases support of a HTTP TRACE method,
* not directly supported by JAX-RS API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TraceSupportTest extends JerseyTest {
diff --git a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/UnderlyingHttpClientAccessTest.java b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/UnderlyingHttpClientAccessTest.java
index b756630..eee7992 100644
--- a/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/UnderlyingHttpClientAccessTest.java
+++ b/connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/UnderlyingHttpClientAccessTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
/**
* Test of access to the underlying HTTP client instance used by the connector.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UnderlyingHttpClientAccessTest {
diff --git a/connectors/jdk-connector/pom.xml b/connectors/jdk-connector/pom.xml
index fe88dcc..5202522 100644
--- a/connectors/jdk-connector/pom.xml
+++ b/connectors/jdk-connector/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-jdk-connector</artifactId>
@@ -76,4 +76,17 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <properties>
+ <!-- https://bugs.openjdk.java.net/browse/JDK-8211426 -->
+ <surefire.security.argline>-Djdk.tls.server.protocols=TLSv1.2</surefire.security.argline>
+ </properties>
+ </profile>
+ </profiles>
+
</project>
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/JdkConnectorProperties.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/JdkConnectorProperties.java
index 7e602d0..190232f 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/JdkConnectorProperties.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/JdkConnectorProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -25,7 +25,7 @@
/**
* Configuration options specific to {@link org.glassfish.jersey.jdk.connector.internal.JdkConnector}.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@PropertiesClass
public final class JdkConnectorProperties {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/JdkConnectorProvider.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/JdkConnectorProvider.java
index b205008..9d70ed2 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/JdkConnectorProvider.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/JdkConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
import org.glassfish.jersey.jdk.connector.internal.JdkConnector;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class JdkConnectorProvider implements ConnectorProvider {
@Override
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyInputStream.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyInputStream.java
index 236ac52..083b076 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyInputStream.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyInputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
* <p/>
* Body stream that can operate either synchronously or asynchronously. See {@link BodyInputStream} for details.
*
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class AsynchronousBodyInputStream extends BodyInputStream {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/BufferedBodyOutputStream.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/BufferedBodyOutputStream.java
index 233258e..2ee03fe 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/BufferedBodyOutputStream.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/BufferedBodyOutputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
import java.nio.ByteBuffer;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class BufferedBodyOutputStream extends BodyOutputStream {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ChunkedBodyOutputStream.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ChunkedBodyOutputStream.java
index acf9c31..92b5a03 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ChunkedBodyOutputStream.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ChunkedBodyOutputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,6 +18,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
@@ -25,7 +26,7 @@
/**
* Body stream that can operate either synchronously or asynchronously. See {@link BodyOutputStream} for details.
*
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class ChunkedBodyOutputStream extends BodyOutputStream {
@@ -97,17 +98,17 @@
}
} else {
// if the data overflow the buffer, send a multiple of the buffer size and buffer the remainder
- int currentDataLength = dataBuffer.position() + len;
+ int currentDataLength = ((Buffer) dataBuffer).position() + len;
int remainder = currentDataLength % dataBuffer.capacity();
// buffer that will be send
ByteBuffer buffer = ByteBuffer.allocate(currentDataLength - remainder);
- dataBuffer.flip();
+ ((Buffer) dataBuffer).flip();
// put currently buffered data
buffer.put(dataBuffer);
// fill the rest with passed data
buffer.put(b, off, len - remainder);
- buffer.flip();
- dataBuffer.clear();
+ ((Buffer) buffer).flip();
+ ((Buffer) dataBuffer).clear();
// buffer remaining data
dataBuffer.put(b, off + len - remainder, remainder);
// send the to-be-written buffer
@@ -127,12 +128,12 @@
assertValidState();
}
- if (dataBuffer.position() == 0) {
+ if (((Buffer) dataBuffer).position() == 0) {
// there is nothing buffered, so don't bother
return;
}
- dataBuffer.flip();
+ ((Buffer) dataBuffer).flip();
write(dataBuffer);
}
@@ -145,7 +146,7 @@
dataBuffer.put((byte) b);
if (!dataBuffer.hasRemaining()) {
// send the buffer if we have just filled it.
- dataBuffer.flip();
+ ((Buffer) dataBuffer).flip();
write(dataBuffer);
}
}
@@ -200,7 +201,7 @@
throw new IOException(LocalizationMessages.WRITING_FAILED(), e);
}
- byteBuffer.clear();
+ ((Buffer) byteBuffer).clear();
Throwable t = error.get();
// check fo any errors
@@ -214,7 +215,7 @@
@Override
public void completed(ByteBuffer result) {
ready = true;
- byteBuffer.clear();
+ ((Buffer) byteBuffer).clear();
if (callListener) {
callOnWritePossible();
}
@@ -315,13 +316,13 @@
ByteBuffer encodedChunks = ByteBuffer.allocate(numberOfChunks * encodedFullChunkSize);
for (int i = 0; i < numberOfChunks; i++) {
- byteBuffer.position(i * chunkSize);
- byteBuffer.limit(i * chunkSize + chunkSize);
+ ((Buffer) byteBuffer).position(i * chunkSize);
+ ((Buffer) byteBuffer).limit(i * chunkSize + chunkSize);
ByteBuffer encodeChunk = HttpRequestEncoder.encodeChunk(byteBuffer);
encodedChunks.put(encodeChunk);
}
- encodedChunks.flip();
+ ((Buffer) encodedChunks).flip();
return encodedChunks;
}
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ConnectorConfiguration.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ConnectorConfiguration.java
index 63a571c..612d540 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ConnectorConfiguration.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ConnectorConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -37,7 +37,7 @@
* <p/>
* This is internal to the connector and is not used by the user for configuration.
*
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class ConnectorConfiguration {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Constants.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Constants.java
index 9b3b8e3..d778544 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Constants.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Constants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.jdk.connector.internal;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class Constants {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/DestinationConnectionPool.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/DestinationConnectionPool.java
index 26a9aed..2ef9b9c 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/DestinationConnectionPool.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/DestinationConnectionPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
import java.util.concurrent.ScheduledExecutorService;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class DestinationConnectionPool {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Filter.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Filter.java
index f42e68a..c96b2e9 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Filter.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Filter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,8 +22,8 @@
* A filter can add functionality to JDK client transport. Filters are composed together to
* create JDK client transport.
*
- * @author Petr Janouch (petr.janouch at oracle.com)
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Petr Janouch
+ * @author Pavel Bucek
*/
class Filter<UP_IN, UP_OUT, DOWN_OUT, DOWN_IN> {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnection.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnection.java
index 28ce232..2330dd4 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnection.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnection.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
import org.glassfish.jersey.SslConfigurator;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class HttpConnection {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnectionPool.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnectionPool.java
index 96842c4..28c7500 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnectionPool.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnectionPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
import java.util.concurrent.ScheduledExecutorService;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class HttpConnectionPool {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpFilter.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpFilter.java
index 3f3dda8..f0e9b16 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpFilter.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.core.HttpHeaders;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class HttpFilter extends Filter<HttpRequest, HttpResponse, ByteBuffer, ByteBuffer> {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParser.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParser.java
index 3170e06..ed2fbf9 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParser.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,13 +18,14 @@
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
import java.util.List;
import javax.ws.rs.core.HttpHeaders;
/**
* @author Alexey Stashok
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class HttpParser {
@@ -57,8 +58,9 @@
void reset(boolean expectContent) {
this.expectContent = expectContent;
headerParsed = false;
- buffer.clear();
- buffer.flip();
+ // see https://jira.mongodb.org/browse/JAVA-2559 for the casts
+ ((Buffer) buffer).clear();
+ ((Buffer) buffer).flip();
complete = false;
headerParsingState.recycle();
}
@@ -109,25 +111,25 @@
private void saveRemaining(ByteBuffer input) {
// some of the fields use 0 nad -1 as a special state -> if the field is <= 0, just let it be
- headerParsingState.start =
- headerParsingState.start > 0 ? headerParsingState.start - input.position() : headerParsingState.start;
- headerParsingState.offset =
- headerParsingState.offset > 0 ? headerParsingState.offset - input.position() : headerParsingState.offset;
- headerParsingState.packetLimit = headerParsingState.packetLimit > 0 ? headerParsingState.packetLimit - input.position()
- : headerParsingState.packetLimit;
- headerParsingState.checkpoint = headerParsingState.checkpoint > 0 ? headerParsingState.checkpoint - input.position()
- : headerParsingState.checkpoint;
- headerParsingState.checkpoint2 = headerParsingState.checkpoint2 > 0 ? headerParsingState.checkpoint2 - input.position()
- : headerParsingState.checkpoint2;
+ headerParsingState.start = headerParsingState.start > 0
+ ? headerParsingState.start - ((Buffer) input).position() : headerParsingState.start;
+ headerParsingState.offset = headerParsingState.offset > 0
+ ? headerParsingState.offset - ((Buffer) input).position() : headerParsingState.offset;
+ headerParsingState.packetLimit = headerParsingState.packetLimit > 0
+ ? headerParsingState.packetLimit - ((Buffer) input).position() : headerParsingState.packetLimit;
+ headerParsingState.checkpoint = headerParsingState.checkpoint > 0
+ ? headerParsingState.checkpoint - ((Buffer) input).position() : headerParsingState.checkpoint;
+ headerParsingState.checkpoint2 = headerParsingState.checkpoint2 > 0
+ ? headerParsingState.checkpoint2 - ((Buffer) input).position() : headerParsingState.checkpoint2;
if (input.hasRemaining()) {
if (input != buffer) {
- buffer.clear();
- buffer.flip();
+ ((Buffer) buffer).clear();
+ ((Buffer) buffer).flip();
buffer = Utils.appendBuffers(buffer, input, bufferMaxSize, BUFFER_STEP_SIZE);
} else {
buffer.compact();
- buffer.flip();
+ ((Buffer) buffer).flip();
}
}
}
@@ -159,7 +161,7 @@
}
case 2: { // Headers are ready
- input.position(headerParsingState.offset);
+ ((Buffer) input).position(headerParsingState.offset);
// if headers get parsed - set the flag
headerParsed = true;
decideTransferEncoding();
@@ -189,7 +191,7 @@
final int spaceIdx =
findSpace(input, headerParsingState.offset, packetLimit);
if (spaceIdx == -1) {
- headerParsingState.offset = input.limit();
+ headerParsingState.offset = ((Buffer) input).limit();
return false;
}
@@ -206,7 +208,7 @@
final int nonSpaceIdx =
HttpParserUtils.skipSpaces(input, headerParsingState.offset, packetLimit);
if (nonSpaceIdx == -1) {
- headerParsingState.offset = input.limit();
+ headerParsingState.offset = ((Buffer) input).limit();
return false;
}
@@ -217,7 +219,7 @@
}
case 2: { // parse the status code
- if (headerParsingState.offset + 3 > input.limit()) {
+ if (headerParsingState.offset + 3 > ((Buffer) input).limit()) {
return false;
}
@@ -233,7 +235,7 @@
final int nonSpaceIdx =
HttpParserUtils.skipSpaces(input, headerParsingState.offset, packetLimit);
if (nonSpaceIdx == -1) {
- headerParsingState.offset = input.limit();
+ headerParsingState.offset = ((Buffer) input).limit();
return false;
}
@@ -245,7 +247,7 @@
case 4: { // HTTP response reason-phrase
if (!findEOL(input)) {
- headerParsingState.offset = input.limit();
+ headerParsingState.offset = ((Buffer) input).limit();
return false;
}
@@ -263,7 +265,7 @@
// 100-Continue.
headerParsingState.offset += 2;
headerParsingState.start = 0;
- input.position(headerParsingState.offset);
+ ((Buffer) input).position(headerParsingState.offset);
input.compact();
headerParsingState.offset = 0;
return false;
@@ -323,7 +325,7 @@
final int nonSpaceIdx = HttpParserUtils
.skipSpaces(input, headerParsingState.offset, headerParsingState.packetLimit);
if (nonSpaceIdx == -1) {
- headerParsingState.offset = input.limit();
+ headerParsingState.offset = ((Buffer) input).limit();
return false;
}
@@ -364,7 +366,7 @@
// Taken with small modifications from Grizzly HttpCodecFilter.parseHeaderName
// (change: Grizzly also initializes value store)
private boolean parseHeaderName(final ByteBuffer input) throws ParseException {
- final int limit = Math.min(input.limit(), headerParsingState.packetLimit);
+ final int limit = Math.min(((Buffer) input).limit(), headerParsingState.packetLimit);
final int start = headerParsingState.start;
int offset = headerParsingState.offset;
@@ -392,7 +394,7 @@
// (change: Grizzly saves teh value as a buffer, we split it and add to response)
private int parseHeaderValue(ByteBuffer input, boolean parsingTrailerHeaders) throws ParseException {
- final int limit = Math.min(input.limit(), headerParsingState.packetLimit);
+ final int limit = Math.min(((Buffer) input).limit(), headerParsingState.packetLimit);
int offset = headerParsingState.offset;
@@ -518,7 +520,7 @@
// Taken unmodified from Grizzly HttpCodecUtils.findSpace
private int findSpace(final ByteBuffer input, int offset, final int packetLimit) {
- final int limit = Math.min(input.limit(), packetLimit);
+ final int limit = Math.min(((Buffer) input).limit(), packetLimit);
while (offset < limit) {
final byte b = input.get(offset);
if (HttpParserUtils.isSpaceOrTab(b)) {
@@ -534,7 +536,7 @@
// Taken unmodified from Grizzly HttpCodecUtils.findEOL
private boolean findEOL(final ByteBuffer input) {
int offset = headerParsingState.offset;
- final int limit = Math.min(input.limit(), headerParsingState.packetLimit);
+ final int limit = Math.min(((Buffer) input).limit(), headerParsingState.packetLimit);
while (offset < limit) {
final byte b = input.get(offset);
@@ -560,7 +562,7 @@
// Taken unmodified from Grizzly HttpCodecUtils.checkEOL
private int checkEOL(final ByteBuffer input) {
final int offset = headerParsingState.offset;
- final int avail = input.limit() - offset;
+ final int avail = ((Buffer) input).limit() - offset;
final byte b1;
final byte b2;
@@ -602,7 +604,7 @@
private String parseString(ByteBuffer input, int startIdx, int endIdx) throws ParseException {
byte[] bytes = new byte[endIdx - startIdx];
- input.position(startIdx);
+ ((Buffer) input).position(startIdx);
input.get(bytes, 0, endIdx - startIdx);
try {
return new String(bytes, ENCODING);
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParserUtils.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParserUtils.java
index e07177d..eaa20b0 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParserUtils.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParserUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -17,10 +17,11 @@
package org.glassfish.jersey.jdk.connector.internal;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
/**
* @author Alexey Stashok
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class HttpParserUtils {
@@ -37,7 +38,7 @@
static final byte LC_OFFSET = A - a;
static int skipSpaces(ByteBuffer input, int offset, int packetLimit) {
- final int limit = Math.min(input.limit(), packetLimit);
+ final int limit = Math.min(((Buffer) input).limit(), packetLimit);
while (offset < limit) {
final byte b = input.get(offset);
if (isNotSpaceAndTab(b)) {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpRequest.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpRequest.java
index 4eea826..cc8dfbe 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpRequest.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
import java.util.Map;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class HttpRequest {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpRequestEncoder.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpRequestEncoder.java
index ae29c13..d1a116b 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpRequestEncoder.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpRequestEncoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,12 +18,13 @@
import java.net.URI;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class HttpRequestEncoder {
@@ -97,7 +98,7 @@
chunkBuffer.put(startBytes);
chunkBuffer.put(data);
chunkBuffer.put(LINE_SEPARATOR_BYTES);
- chunkBuffer.flip();
+ ((Buffer) chunkBuffer).flip();
return chunkBuffer;
}
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpResponse.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpResponse.java
index 51aa7e1..6a52d78 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpResponse.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
import java.util.Map;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class HttpResponse {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/InterceptingOutputStream.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/InterceptingOutputStream.java
index 61d1840..f2b094f 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/InterceptingOutputStream.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/InterceptingOutputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
* A stream that invokes {@link FirstCallListener} when any operation is invoked.
* {@link FirstCallListener} is invoked only once in the stream lifetime.
*
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class InterceptingOutputStream extends OutputStream {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/JdkConnector.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/JdkConnector.java
index fe723a5..c5dab95 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/JdkConnector.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/JdkConnector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -39,7 +39,7 @@
import org.glassfish.jersey.client.spi.Connector;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class JdkConnector implements Connector {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ParseException.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ParseException.java
index 37dab60..ddf0886 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ParseException.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ParseException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.jdk.connector.internal;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class ParseException extends Exception {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyAuthenticationException.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyAuthenticationException.java
index a9a85fb..f65f502 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyAuthenticationException.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyAuthenticationException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.jdk.connector.internal;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class ProxyAuthenticationException extends Exception {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyBasicAuthenticator.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyBasicAuthenticator.java
index bab2807..d965cfd 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyBasicAuthenticator.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyBasicAuthenticator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
/**
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
*/
class ProxyBasicAuthenticator {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyDigestAuthenticator.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyDigestAuthenticator.java
index 285eeb5..668ed58 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyDigestAuthenticator.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyDigestAuthenticator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -31,8 +31,8 @@
*
* @author raphael.jolivet@gmail.com
* @author Stefan Katerkamp (stefan@katerkamp.de)
- * @author Miroslav Fuksa (miroslav.fuksa at oracle.com)
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Miroslav Fuksa
+ * @author Ondrej Kosatka
*/
class ProxyDigestAuthenticator {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyFilter.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyFilter.java
index c0f74bd..6ca75b0 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyFilter.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/ProxyFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
import java.util.List;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class ProxyFilter extends Filter<HttpRequest, HttpResponse, HttpRequest, HttpResponse> {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/RedirectException.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/RedirectException.java
index 28c8c65..65aec26 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/RedirectException.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/RedirectException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -35,7 +35,7 @@
* </li>
* </ul>
*
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
* @see RedirectHandler
*/
public class RedirectException extends Exception {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/RedirectHandler.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/RedirectHandler.java
index 79e1973..889632a 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/RedirectHandler.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/RedirectHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,8 +27,8 @@
import java.util.Set;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Petr Janouch
+ * @author Ondrej Kosatka
*/
class RedirectHandler {
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/SslFilter.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/SslFilter.java
index d463c4a..15bd43a 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/SslFilter.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/SslFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -17,6 +17,7 @@
package org.glassfish.jersey.jdk.connector.internal;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
import java.util.LinkedList;
import java.util.Queue;
@@ -29,7 +30,7 @@
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class SslFilter extends Filter<ByteBuffer, ByteBuffer, ByteBuffer, ByteBuffer> {
@@ -148,7 +149,7 @@
private void handleWrite(final ByteBuffer applicationData, final CompletionHandler<ByteBuffer> completionHandler) {
try {
// transport buffer always writes all data, so there are not leftovers in the networkOutputBuffer
- networkOutputBuffer.clear();
+ ((Buffer) networkOutputBuffer).clear();
SSLEngineResult result = sslEngine.wrap(applicationData, networkOutputBuffer);
switch (result.getStatus()) {
@@ -178,7 +179,7 @@
state = State.REHANDSHAKING;
}
- networkOutputBuffer.flip();
+ ((Buffer) networkOutputBuffer).flip();
// write only if something was written to the output buffer
if (networkOutputBuffer.hasRemaining()) {
writeQueue.write(networkOutputBuffer, new CompletionHandler<ByteBuffer>() {
@@ -273,7 +274,7 @@
if (lazyBuffer.isAllocated()) {
ByteBuffer buffer = lazyBuffer.get();
- buffer.flip();
+ ((Buffer) buffer).flip();
writeQueue.write(buffer, new CompletionHandler<ByteBuffer>() {
@Override
@@ -321,7 +322,7 @@
case CLOSED: {
// drop any data that arrive after the SSL has been closed
- networkData.clear();
+ ((Buffer) networkData).clear();
readMore = false;
}
}
@@ -332,7 +333,7 @@
private boolean handleRead(ByteBuffer networkData) {
try {
- applicationInputBuffer.clear();
+ ((Buffer) applicationInputBuffer).clear();
SSLEngineResult result = sslEngine.unwrap(networkData, applicationInputBuffer);
switch (result.getStatus()) {
@@ -352,7 +353,7 @@
case CLOSED:
case OK: {
if (result.bytesProduced() > 0) {
- applicationInputBuffer.flip();
+ ((Buffer) applicationInputBuffer).flip();
upstreamFilter.onRead(applicationInputBuffer);
applicationInputBuffer.compact();
}
@@ -460,7 +461,7 @@
SSLEngineResult result = sslEngine.unwrap(networkData, applicationInputBuffer);
- applicationInputBuffer.flip();
+ ((Buffer) applicationInputBuffer).flip();
if (applicationInputBuffer.hasRemaining()) {
// data can flow during re-handshake
inputBuffer.append(applicationInputBuffer);
@@ -510,7 +511,7 @@
// now write the stored wrap() results
if (outputBuffer.isAllocated()) {
ByteBuffer buffer = outputBuffer.get();
- buffer.flip();
+ ((Buffer) buffer).flip();
writeQueue.write(buffer, null);
}
@@ -630,20 +631,20 @@
void resize() {
int increment = sslEngine.getSession().getPacketBufferSize();
- int newSize = buffer.position() + increment;
+ int newSize = ((Buffer) buffer).position() + increment;
ByteBuffer newBuffer = ByteBuffer.allocate(newSize);
- buffer.flip();
- newBuffer.flip();
- buffer = Utils.appendBuffers(newBuffer, buffer, newBuffer.limit(), 50);
+ ((Buffer) buffer).flip();
+ ((Buffer) newBuffer).flip();
+ buffer = Utils.appendBuffers(newBuffer, buffer, ((Buffer) newBuffer).limit(), 50);
buffer.compact();
}
void append(ByteBuffer b) {
if (buffer == null) {
buffer = ByteBuffer.allocate(b.remaining());
- buffer.flip();
+ ((Buffer) buffer).flip();
}
- int newSize = buffer.limit() + b.remaining();
+ int newSize = ((Buffer) buffer).limit() + b.remaining();
buffer = Utils.appendBuffers(buffer, b, newSize, 50);
}
}
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransferEncodingParser.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransferEncodingParser.java
index af7b482..64fb9c7 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransferEncodingParser.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransferEncodingParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -17,6 +17,7 @@
package org.glassfish.jersey.jdk.connector.internal;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
import static org.glassfish.jersey.jdk.connector.internal.HttpParserUtils.skipSpaces;
import static org.glassfish.jersey.jdk.connector.internal.HttpParserUtils.isSpaceOrTab;
@@ -24,7 +25,7 @@
/**
* @author Alexey Stashok
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
abstract class TransferEncodingParser {
@@ -127,7 +128,7 @@
} else {
// HTTP content starts from position 0 in the input Buffer (HTTP chunk header is not part of the input Buffer)
//contentParsingState.chunkContentStart = 0;
- contentParsingState.chunkContentStart = input.position();
+ contentParsingState.chunkContentStart = ((Buffer) input).position();
}
// Get the position in the input Buffer, where actual HTTP content starts
@@ -155,16 +156,16 @@
}
if (isLastChunk) {
- input.position(chunkContentStart);
+ ((Buffer) input).position(chunkContentStart);
return true;
}
// Get the number of bytes remaining in the current chunk
final long thisPacketRemaining = contentParsingState.chunkRemainder;
// Get the number of content bytes available in the current input Buffer
- final int contentAvailable = input.limit() - chunkContentStart;
+ final int contentAvailable = ((Buffer) input).limit() - chunkContentStart;
- input.position(chunkContentStart);
+ ((Buffer) input).position(chunkContentStart);
ByteBuffer data;
if (contentAvailable > thisPacketRemaining) {
// If input Buffer has part of the next message - slice it
@@ -186,7 +187,7 @@
while (true) {
switch (headerParsingState.state) {
case 0: {// Initialize chunk parsing
- final int pos = input.position();
+ final int pos = ((Buffer) input).position();
headerParsingState.start = pos;
headerParsingState.offset = pos;
headerParsingState.packetLimit = pos + MAX_HTTP_CHUNK_SIZE_LENGTH;
@@ -198,7 +199,7 @@
final int nonSpaceIdx = skipSpaces(input,
headerParsingState.offset, headerParsingState.packetLimit);
if (nonSpaceIdx == -1) {
- headerParsingState.offset = input.limit();
+ headerParsingState.offset = ((Buffer) input).limit();
headerParsingState.state = 1;
headerParsingState.checkOverflow(LocalizationMessages.HTTP_CHUNK_ENCODING_PREFIX_OVERFLOW());
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransportFilter.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransportFilter.java
index 3087a55..fde8298 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransportFilter.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransportFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,6 +19,7 @@
import java.io.IOException;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
import java.nio.channels.AsynchronousChannelGroup;
import java.nio.channels.AsynchronousCloseException;
import java.nio.channels.AsynchronousSocketChannel;
@@ -47,7 +48,7 @@
* another one is started only after the previous one has completed. Blocking in {@link #onRead(Object)}
* or {@link #onConnect()} method will result in data not being read from a socket until these methods have completed.
*
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class TransportFilter extends Filter<ByteBuffer, ByteBuffer, Void, ByteBuffer> {
@@ -257,7 +258,7 @@
return;
}
- inputBuffer.flip();
+ ((Buffer) inputBuffer).flip();
onRead(inputBuffer);
inputBuffer.compact();
_read(inputBuffer);
diff --git a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Utils.java b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Utils.java
index 994842e..0ac7b63 100644
--- a/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Utils.java
+++ b/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/Utils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,9 +18,10 @@
import java.net.URI;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class Utils {
@@ -35,26 +36,26 @@
*/
static ByteBuffer appendBuffers(ByteBuffer buffer, ByteBuffer buffer1, int incomingBufferSize, int BUFFER_STEP_SIZE) {
- final int limit = buffer.limit();
- final int capacity = buffer.capacity();
- final int remaining = buffer.remaining();
- final int len = buffer1.remaining();
+ final int limit = ((Buffer) buffer).limit();
+ final int capacity = ((Buffer) buffer).capacity();
+ final int remaining = ((Buffer) buffer).remaining();
+ final int len = ((Buffer) buffer1).remaining();
// buffer1 will be appended to buffer
if (len < (capacity - limit)) {
- buffer.mark();
- buffer.position(limit);
- buffer.limit(capacity);
+ ((Buffer) buffer).mark();
+ ((Buffer) buffer).position(limit);
+ ((Buffer) buffer).limit(capacity);
buffer.put(buffer1);
- buffer.limit(limit + len);
- buffer.reset();
+ ((Buffer) buffer).limit(limit + len);
+ ((Buffer) buffer).reset();
return buffer;
// Remaining data is moved to left. Then new data is appended
} else if (remaining + len < capacity) {
buffer.compact();
buffer.put(buffer1);
- buffer.flip();
+ ((Buffer) buffer).flip();
return buffer;
// create new buffer
} else {
@@ -67,14 +68,14 @@
final ByteBuffer result = ByteBuffer.allocate(roundedSize > incomingBufferSize ? newSize : roundedSize);
result.put(buffer);
result.put(buffer1);
- result.flip();
+ ((Buffer) result).flip();
return result;
}
}
}
static ByteBuffer split(ByteBuffer buffer, int position) {
- int bytesLength = position - buffer.position();
+ int bytesLength = position - ((Buffer) buffer).position();
byte[] bytes = new byte[bytesLength];
buffer.get(bytes);
return ByteBuffer.wrap(bytes);
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyInputStreamTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyInputStreamTest.java
index 249f645..3d64abe 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyInputStreamTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyInputStreamTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -36,7 +36,7 @@
import static junit.framework.TestCase.assertNull;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class AsynchronousBodyInputStreamTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyOutputStreamTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyOutputStreamTest.java
index 09e21be..2feea43 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyOutputStreamTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/AsynchronousBodyOutputStreamTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -40,7 +40,7 @@
import static junit.framework.Assert.assertNotNull;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class AsynchronousBodyOutputStreamTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ChunkedBodyOutputStreamTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ChunkedBodyOutputStreamTest.java
index d86f05d..474e9e9 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ChunkedBodyOutputStreamTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ChunkedBodyOutputStreamTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
import static junit.framework.TestCase.fail;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class ChunkedBodyOutputStreamTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ConnectionPoolTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ConnectionPoolTest.java
index ee9d261..9585c54 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ConnectionPoolTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ConnectionPoolTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -49,7 +49,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class ConnectionPoolTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/CookieTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/CookieTest.java
index 532645d..418e7c4 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/CookieTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/CookieTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -39,7 +39,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Paul Sandoz (paul.sandoz at oracle.com)
+ * @author Paul Sandoz
* @author Arul Dhesiaseelan (aruld at acm.org)
*/
public class CookieTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/EntityWriteTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/EntityWriteTest.java
index 1937aa9..65ce246 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/EntityWriteTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/EntityWriteTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class EntityWriteTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/HttpConnectionTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/HttpConnectionTest.java
index 3a124e2..d2af874 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/HttpConnectionTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/HttpConnectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -57,7 +57,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class HttpConnectionTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/HttpParserTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/HttpParserTest.java
index b73a8bb..3dccc76 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/HttpParserTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/HttpParserTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
import static org.junit.Assert.fail;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class HttpParserTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ModifyHeaderInBodyWriterTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ModifyHeaderInBodyWriterTest.java
index a3e6772..f35cba7 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ModifyHeaderInBodyWriterTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ModifyHeaderInBodyWriterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -45,7 +45,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class ModifyHeaderInBodyWriterTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/MultiValueHeaderTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/MultiValueHeaderTest.java
index 281ced5..8934830 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/MultiValueHeaderTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/MultiValueHeaderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -32,7 +32,7 @@
import org.junit.Test;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class MultiValueHeaderTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ProxyTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ProxyTest.java
index 15a2cdf..266646c 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ProxyTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ProxyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -48,7 +48,7 @@
import static org.junit.Assert.fail;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class ProxyTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/PublicSitesTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/PublicSitesTest.java
index 4d77939..40f0181 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/PublicSitesTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/PublicSitesTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -31,7 +31,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
@Ignore
public class PublicSitesTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ReadChunkedEntity.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ReadChunkedEntity.java
index 42e944b..49dc28d 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ReadChunkedEntity.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/ReadChunkedEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -37,7 +37,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*
* TODO I have a strong feeling a got inspired somewhere, but forgot where.
*/
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/RedirectTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/RedirectTest.java
index 1fb31eb..52722ec 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/RedirectTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/RedirectTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -40,7 +40,7 @@
import static org.junit.Assert.fail;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class RedirectTest extends JerseyTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/SslFilterTest.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/SslFilterTest.java
index 099c23c..c1e7fbe 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/SslFilterTest.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/SslFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -47,7 +47,7 @@
import static org.junit.Assert.fail;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class SslFilterTest {
diff --git a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/TestUtils.java b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/TestUtils.java
index 0312a48..53ed774 100644
--- a/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/TestUtils.java
+++ b/connectors/jdk-connector/src/test/java/org/glassfish/jersey/jdk/connector/internal/TestUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.jdk.connector.internal;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
class TestUtils {
diff --git a/connectors/jetty-connector/pom.xml b/connectors/jetty-connector/pom.xml
index 7c7b2d8..e129493 100644
--- a/connectors/jetty-connector/pom.xml
+++ b/connectors/jetty-connector/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-jetty-connector</artifactId>
@@ -88,6 +88,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>testsSkipJdk6</id>
<activation>
<jdk>1.6</jdk>
diff --git a/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java
index 68886e7..fc87414 100644
--- a/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java
+++ b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
@@ -120,7 +121,7 @@
* </p>
*
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class JettyConnector implements Connector {
@@ -136,18 +137,28 @@
* @param config client configuration.
*/
JettyConnector(final Client jaxrsClient, final Configuration config) {
- final SSLContext sslContext = jaxrsClient.getSslContext();
- final SslContextFactory sslContextFactory = new SslContextFactory();
- sslContextFactory.setSslContext(sslContext);
+ HttpClient httpClient = null;
+ if (config.isRegistered(JettyHttpClientSupplier.class)) {
+ Optional<Object> contract = config.getInstances().stream()
+ .filter(a-> JettyHttpClientSupplier.class.isInstance(a)).findFirst();
+ if (contract.isPresent()) {
+ httpClient = ((JettyHttpClientSupplier) contract.get()).getHttpClient();
+ }
+ }
+ if (httpClient == null) {
+ final SSLContext sslContext = jaxrsClient.getSslContext();
+ final SslContextFactory sslContextFactory = new SslContextFactory();
+ sslContextFactory.setSslContext(sslContext);
+ httpClient = new HttpClient(sslContextFactory);
+ }
+ this.client = httpClient;
Boolean enableHostnameVerification = (Boolean) config.getProperties()
- .get(JettyClientProperties.ENABLE_SSL_HOSTNAME_VERIFICATION);
+ .get(JettyClientProperties.ENABLE_SSL_HOSTNAME_VERIFICATION);
if (enableHostnameVerification != null && enableHostnameVerification) {
- sslContextFactory.setEndpointIdentificationAlgorithm("https");
+ client.getSslContextFactory().setEndpointIdentificationAlgorithm("https");
}
- this.client = new HttpClient(sslContextFactory);
-
final Object connectTimeout = config.getProperties().get(ClientProperties.CONNECT_TIMEOUT);
if (connectTimeout != null && connectTimeout instanceof Integer && (Integer) connectTimeout > 0) {
client.setConnectTimeout((Integer) connectTimeout);
@@ -173,6 +184,13 @@
final URI u = getProxyUri(proxyUri);
final ProxyConfiguration proxyConfig = client.getProxyConfiguration();
proxyConfig.getProxies().add(new HttpProxy(u.getHost(), u.getPort()));
+
+ final Object proxyUsername = config.getProperties().get(ClientProperties.PROXY_USERNAME);
+ if (proxyUsername != null) {
+ final Object proxyPassword = config.getProperties().get(ClientProperties.PROXY_PASSWORD);
+ auth.addAuthentication(new BasicAuthentication(u, "<<ANY_REALM>>",
+ String.valueOf(proxyUsername), String.valueOf(proxyPassword)));
+ }
}
if (disableCookies) {
diff --git a/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.java b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.java
index c2fb054..e59ae7113 100644
--- a/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.java
+++ b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -75,7 +75,7 @@
* </p>
*
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.5
*/
public class JettyConnectorProvider implements ConnectorProvider {
diff --git a/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientContract.java b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientContract.java
new file mode 100644
index 0000000..7547cd9
--- /dev/null
+++ b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientContract.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019 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.jetty.connector;
+
+import org.eclipse.jetty.client.HttpClient;
+import org.glassfish.jersey.spi.Contract;
+
+/**
+ * A contract that allows for an optional registration of user predefined Jetty {@code HttpClient}
+ * that is consequently used by {@link JettyConnector}
+ */
+@Contract
+public interface JettyHttpClientContract {
+ /**
+ * Supply a user predefined HttpClient
+ * @return a user predefined HttpClient
+ */
+ HttpClient getHttpClient();
+}
diff --git a/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientSupplier.java b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientSupplier.java
new file mode 100644
index 0000000..681165d
--- /dev/null
+++ b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientSupplier.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2019 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.jetty.connector;
+
+import org.eclipse.jetty.client.HttpClient;
+
+/**
+ * Jetty HttpClient supplier to be registered into Jersey configuration to be used by {@link JettyConnector}.
+ * Not every possible configuration option is covered by the Jetty Connector and this supplier offers a way to provide
+ * an HttpClient that has configured the options not covered by the Jetty Connector.
+ * <p>
+ * Typical usage:
+ * </p>
+ * <pre>
+ * {@code
+ * HttpClient httpClient = ...
+ *
+ * ClientConfig config = new ClientConfig();
+ * config.connectorProvider(new JettyConnectorProvider());
+ * config.register(new JettyHttpClientSupplier(httpClient));
+ * Client client = ClientBuilder.newClient(config);
+ * }
+ * </pre>
+ * <p>
+ * The {@code HttpClient} is configured as if it was created by {@link JettyConnector} the usual way.
+ * </p>
+ */
+public class JettyHttpClientSupplier implements JettyHttpClientContract {
+ private final HttpClient httpClient;
+
+ /**
+ * {@code HttpClient} supplier to be optionally registered to a {@link org.glassfish.jersey.client.ClientConfig}
+ * @param httpClient a HttpClient to be supplied when {@link JettyConnector#getHttpClient()} is called.
+ */
+ public JettyHttpClientSupplier(HttpClient httpClient) {
+ this.httpClient = httpClient;
+ }
+
+ @Override
+ public HttpClient getHttpClient() {
+ return httpClient;
+ }
+}
diff --git a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/AsyncTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/AsyncTest.java
index 0f732f9..53f98f3 100644
--- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/AsyncTest.java
+++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/AsyncTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -44,7 +44,7 @@
* Asynchronous connector test.
*
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncTest extends JerseyTest {
private static final Logger LOGGER = Logger.getLogger(AsyncTest.class.getName());
diff --git a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/FollowRedirectsTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/FollowRedirectsTest.java
index 0edda7a..b618241 100644
--- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/FollowRedirectsTest.java
+++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/FollowRedirectsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -47,7 +47,7 @@
*
* @author Martin Matula
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class FollowRedirectsTest extends JerseyTest {
diff --git a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/HelloWorldTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/HelloWorldTest.java
index 641648d..73743eb 100644
--- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/HelloWorldTest.java
+++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/HelloWorldTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -43,7 +43,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class HelloWorldTest extends JerseyTest {
diff --git a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java
index fb1ce62..4c26067 100644
--- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java
+++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -52,7 +52,7 @@
/**
* Jersey programmatic managed client test
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ManagedClientTest extends JerseyTest {
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
new file mode 100644
index 0000000..3f73aae
--- /dev/null
+++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/ProxyTest.java
@@ -0,0 +1,147 @@
+/*
+ * 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
+ * Contributors:
+ * Marcelo Rubim
+ */
+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/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/TraceSupportTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/TraceSupportTest.java
index 87cac21..f2642eb 100644
--- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/TraceSupportTest.java
+++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/TraceSupportTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -54,7 +54,7 @@
* This very basic resource showcases support of a HTTP TRACE method,
* not directly supported by JAX-RS API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TraceSupportTest extends JerseyTest {
diff --git a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/UnderlyingHttpClientAccessTest.java b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/UnderlyingHttpClientAccessTest.java
index 7cefc2b..ff64489 100644
--- a/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/UnderlyingHttpClientAccessTest.java
+++ b/connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/UnderlyingHttpClientAccessTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,13 +24,16 @@
import org.eclipse.jetty.client.HttpClient;
import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
/**
* Test of access to the underlying HTTP client instance used by the connector.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UnderlyingHttpClientAccessTest {
@@ -54,4 +57,18 @@
hcOnClient, hcOnTarget
);
}
+
+ @Test
+ public void testGetProvidedClientInstance() {
+ final HttpClient httpClient = new HttpClient();
+ final ClientConfig clientConfig = new ClientConfig()
+ .connectorProvider(new JettyConnectorProvider())
+ .register(new JettyHttpClientSupplier(httpClient));
+ final Client client = ClientBuilder.newClient(clientConfig);
+ final WebTarget target = client.target("http://localhost/");
+ final HttpClient hcOnTarget = JettyConnectorProvider.getHttpClient(target);
+
+ assertThat("Instance provided to a ClientConfig differs from instance provided by JettyProvider",
+ httpClient, is(hcOnTarget));
+ }
}
diff --git a/connectors/netty-connector/pom.xml b/connectors/netty-connector/pom.xml
index 1927576..50bbf7a 100644
--- a/connectors/netty-connector/pom.xml
+++ b/connectors/netty-connector/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-netty-connector</artifactId>
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 51e78e8..1a9cbe5 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, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -45,7 +45,7 @@
/**
* Jersey implementation of Netty channel handler.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class JerseyClientHandler extends SimpleChannelInboundHandler<HttpObject> {
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 d67c547..0cd1f75 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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,7 +69,7 @@
/**
* Netty connector implementation.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class NettyConnector implements Connector {
diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnectorProvider.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnectorProvider.java
index 4716f67..01895cf 100644
--- a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnectorProvider.java
+++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -45,7 +45,7 @@
* be closed after processing the entity to release connection-based resources.
* <p/>
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @since 2.24
*/
@Beta
diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/JerseyChunkedInput.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/JerseyChunkedInput.java
index 3ea9693..ef14ba3 100644
--- a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/JerseyChunkedInput.java
+++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/JerseyChunkedInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -37,7 +37,7 @@
* Netty {@link ChunkedInput} implementation which also serves as an output
* stream to Jersey {@link javax.ws.rs.container.ContainerResponseContext}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class JerseyChunkedInput extends OutputStream implements ChunkedInput<ByteBuf>, ChannelFutureListener {
diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/NettyInputStream.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/NettyInputStream.java
index 8ff47d6..aab83b3 100644
--- a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/NettyInputStream.java
+++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/NettyInputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -26,7 +26,7 @@
* Converts Netty NIO buffers to an input streams and stores them in the queue,
* waiting for Jersey to process it.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class NettyInputStream extends InputStream {
@@ -68,9 +68,11 @@
this.isList = isList;
}
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
+ private interface ISReader {
+ int readFrom(InputStream take) throws IOException;
+ }
+ private int readInternal(ISReader isReader) throws IOException {
if (end) {
return -1;
}
@@ -83,10 +85,12 @@
return -1;
}
- int read = take.read(b, off, len);
+ int read = isReader.readFrom(take);
if (take.available() > 0) {
isList.addFirst(take);
+ } else {
+ take.close();
}
return read;
@@ -96,29 +100,13 @@
}
@Override
+ public int read(byte[] b, int off, int len) throws IOException {
+ return readInternal(take -> take.read(b, off, len));
+ }
+
+ @Override
public int read() throws IOException {
-
- if (end) {
- return -1;
- }
-
- try {
- InputStream take = isList.take();
-
- if (checkEndOfInput(take)) {
- return -1;
- }
-
- int read = take.read();
-
- if (take.available() > 0) {
- isList.addFirst(take);
- }
-
- return read;
- } catch (InterruptedException e) {
- throw new IOException("Interrupted.", e);
- }
+ return readInternal(InputStream::read);
}
@Override
diff --git a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/AsyncTest.java b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/AsyncTest.java
index 3237784..6a9637b 100644
--- a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/AsyncTest.java
+++ b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/AsyncTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -43,7 +43,7 @@
* Asynchronous connector test.
*
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncTest extends JerseyTest {
diff --git a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/HelloWorldTest.java b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/HelloWorldTest.java
index d860530..6716c9b 100644
--- a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/HelloWorldTest.java
+++ b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/HelloWorldTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -41,7 +41,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HelloWorldTest extends JerseyTest {
diff --git a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/HugeEntityTest.java b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/HugeEntityTest.java
index dbc5fac..44d7f38 100644
--- a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/HugeEntityTest.java
+++ b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/HugeEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -45,7 +45,7 @@
/**
* Test to make sure huge entity gets chunk-encoded.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class HugeEntityTest extends JerseyTest {
diff --git a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/NoEntityTest.java b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/NoEntityTest.java
index 2570b02..2677c3e 100644
--- a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/NoEntityTest.java
+++ b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/NoEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* @author Paul Sandoz
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class NoEntityTest extends JerseyTest {
private static final Logger LOGGER = Logger.getLogger(NoEntityTest.class.getName());
diff --git a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/TraceSupportTest.java b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/TraceSupportTest.java
index 8d8bf33..4ce24f5 100644
--- a/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/TraceSupportTest.java
+++ b/connectors/netty-connector/src/test/java/org/glassfish/jersey/netty/connector/TraceSupportTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -53,7 +53,7 @@
* This very basic resource showcases support of a HTTP TRACE method,
* not directly supported by JAX-RS API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TraceSupportTest extends JerseyTest {
diff --git a/connectors/pom.xml b/connectors/pom.xml
index a778aaf..4f377c9 100644
--- a/connectors/pom.xml
+++ b/connectors/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.connectors</groupId>
diff --git a/containers/glassfish/jersey-gf-ejb/pom.xml b/containers/glassfish/jersey-gf-ejb/pom.xml
index 0c97a46..e6a2757 100644
--- a/containers/glassfish/jersey-gf-ejb/pom.xml
+++ b/containers/glassfish/jersey-gf-ejb/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers.glassfish</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-gf-ejb</artifactId>
@@ -116,9 +116,10 @@
<!-- Explicitly set versions for packages from GlassFish to allow future uptake of GlassFish 5.x-->
<Import-Package>
com.sun.*;version="[4.0,6)",
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
org.glassfish.ejb.*;version="[4.0,6)",
org.glassfish.internal.*;version="[4.0,6)",
+ ${hk2.osgi.version},
*
</Import-Package>
</instructions>
diff --git a/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbComponentInterceptor.java b/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbComponentInterceptor.java
index 26e6e8b..8e08ffa 100644
--- a/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbComponentInterceptor.java
+++ b/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbComponentInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
/**
* EJB interceptor to inject Jersey specific stuff into EJB beans.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class EjbComponentInterceptor {
diff --git a/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbComponentProvider.java b/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbComponentProvider.java
index 8a652e3..2602c3f 100644
--- a/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbComponentProvider.java
+++ b/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbComponentProvider.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) [2018-2019] [Payara Foundation and/or its affiliates].
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -13,7 +14,6 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-
package org.glassfish.jersey.gf.ejb.internal;
import java.lang.annotation.Annotation;
@@ -72,7 +72,7 @@
* EJB component provider.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Priority(300)
@SuppressWarnings("UnusedDeclaration")
@@ -166,24 +166,26 @@
throw new NamingException("Application Information Not Found");
}
- private void registerEjbInterceptor() {
+ private void registerEjbInterceptor(Class<?> component) {
try {
final Object interceptor = new EjbComponentInterceptor(injectionManager);
initialContext = getInitialContext();
final EjbContainerUtil ejbUtil = EjbContainerUtilImpl.getInstance();
final ApplicationInfo appInfo = getApplicationInfo(ejbUtil);
- final List<String> tempLibNames = new LinkedList<>();
for (ModuleInfo moduleInfo : appInfo.getModuleInfos()) {
final String jarName = moduleInfo.getName();
if (jarName.endsWith(".jar") || jarName.endsWith(".war")) {
final String moduleName = jarName.substring(0, jarName.length() - 4);
- tempLibNames.add(moduleName);
final Object bundleDescriptor = moduleInfo.getMetaData(EjbBundleDescriptorImpl.class.getName());
if (bundleDescriptor instanceof EjbBundleDescriptorImpl) {
final Collection<EjbDescriptor> ejbs = ((EjbBundleDescriptorImpl) bundleDescriptor).getEjbs();
for (final EjbDescriptor ejb : ejbs) {
final BaseContainer ejbContainer = EjbContainerUtilImpl.getInstance().getContainer(ejb.getUniqueId());
+ if (ejbContainer.getEJBClass() != component) {
+ continue;
+ }
+ libNames.add(moduleName);
try {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
@Override
@@ -206,7 +208,7 @@
}
}
}
- libNames.addAll(tempLibNames);
+
final Object interceptorBinder = initialContext.lookup("java:org.glassfish.ejb.container.interceptor_binding_spi");
// Some implementations of InitialContext return null instead of
// throwing NamingException if there is no Object associated with
@@ -257,7 +259,7 @@
}
if (!ejbInterceptorRegistered) {
- registerEjbInterceptor();
+ registerEjbInterceptor(component);
}
Binding binding = Bindings.supplier(new EjbFactory(component, initialContext, EjbComponentProvider.this))
@@ -331,7 +333,7 @@
LocalizationMessages.EJB_INTERFACE_HANDLING_METHOD_LOOKUP_EXCEPTION(method, component, iFace), ex);
}
- private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
+ private static List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
final List<Class> allLocalOrRemoteIfaces = new LinkedList<>();
if (resourceClass.isAnnotationPresent(Remote.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value()));
@@ -357,18 +359,22 @@
}
}
- private static Object lookup(InitialContext ic, Class<?> c, String name, EjbComponentProvider provider)
+ private static Object lookup(InitialContext ic, Class<?> rawType, String name, EjbComponentProvider provider)
throws NamingException {
try {
- return lookupSimpleForm(ic, name, provider);
+ return lookupSimpleForm(ic, rawType, name, provider);
} catch (NamingException ex) {
- LOGGER.log(Level.WARNING, LocalizationMessages.EJB_CLASS_SIMPLE_LOOKUP_FAILED(c.getName()), ex);
+ LOGGER.log(Level.WARNING, LocalizationMessages.EJB_CLASS_SIMPLE_LOOKUP_FAILED(rawType.getName()), ex);
- return lookupFullyQualifiedForm(ic, c, name, provider);
+ return lookupFullyQualifiedForm(ic, rawType, name, provider);
}
}
- private static Object lookupSimpleForm(InitialContext ic, String name, EjbComponentProvider provider) throws NamingException {
+ private static Object lookupSimpleForm(
+ InitialContext ic,
+ Class<?> rawType,
+ String name,
+ EjbComponentProvider provider) throws NamingException {
if (provider.libNames.isEmpty()) {
String jndiName = "java:module/" + name;
return ic.lookup(jndiName);
@@ -379,7 +385,7 @@
Object result;
try {
result = ic.lookup(jndiName);
- if (result != null) {
+ if (result != null && isLookupInstanceValid(rawType, result)) {
return result;
}
} catch (NamingException e) {
@@ -390,19 +396,22 @@
}
}
- private static Object lookupFullyQualifiedForm(InitialContext ic, Class<?> c, String name, EjbComponentProvider provider)
- throws NamingException {
+ private static Object lookupFullyQualifiedForm(
+ InitialContext ic,
+ Class<?> rawType,
+ String name,
+ EjbComponentProvider provider) throws NamingException {
if (provider.libNames.isEmpty()) {
- String jndiName = "java:module/" + name + "!" + c.getName();
+ String jndiName = "java:module/" + name + "!" + rawType.getName();
return ic.lookup(jndiName);
} else {
NamingException ne = null;
for (String moduleName : provider.libNames) {
- String jndiName = "java:app/" + moduleName + "/" + name + "!" + c.getName();
+ String jndiName = "java:app/" + moduleName + "/" + name + "!" + rawType.getName();
Object result;
try {
result = ic.lookup(jndiName);
- if (result != null) {
+ if (result != null && isLookupInstanceValid(rawType, result)) {
return result;
}
} catch (NamingException e) {
@@ -412,4 +421,13 @@
throw (ne != null) ? ne : new NamingException();
}
}
+
+ private static boolean isLookupInstanceValid(Class<?> rawType, Object result){
+ return rawType.isInstance(result)
+ || remoteAndLocalIfaces(rawType)
+ .stream()
+ .filter(iface -> iface.isInstance(result))
+ .findAny()
+ .isPresent();
+ }
}
diff --git a/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbExceptionMapper.java b/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbExceptionMapper.java
index 1121c41..243b167 100644
--- a/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbExceptionMapper.java
+++ b/containers/glassfish/jersey-gf-ejb/src/main/java/org/glassfish/jersey/gf/ejb/internal/EjbExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -33,7 +33,7 @@
* would end up mapped to the corresponding response.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class EjbExceptionMapper implements ExtendedExceptionMapper<EJBException> {
diff --git a/containers/glassfish/pom.xml b/containers/glassfish/pom.xml
index fa6826c..91ac246 100644
--- a/containers/glassfish/pom.xml
+++ b/containers/glassfish/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.containers.glassfish</groupId>
diff --git a/containers/grizzly2-http/pom.xml b/containers/grizzly2-http/pom.xml
index 8ca8823..a321542 100644
--- a/containers/grizzly2-http/pom.xml
+++ b/containers/grizzly2-http/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-grizzly2-http</artifactId>
diff --git a/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpContainer.java b/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpContainer.java
index 8c9815d..f906ca1 100644
--- a/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpContainer.java
+++ b/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -60,9 +60,9 @@
/**
* Jersey {@code Container} implementation based on Grizzly {@link org.glassfish.grizzly.http.server.HttpHandler}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Libor Kramolis
+ * @author Marek Potociar
*/
public final class GrizzlyHttpContainer extends HttpHandler implements Container {
diff --git a/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpContainerProvider.java b/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpContainerProvider.java
index 4d14227..91bfc30 100644
--- a/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpContainerProvider.java
+++ b/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -26,8 +26,8 @@
/**
* Container provider for containers based on Grizzly {@link org.glassfish.grizzly.http.server.HttpHandler}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class GrizzlyHttpContainerProvider implements ContainerProvider {
diff --git a/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpServerFactory.java b/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpServerFactory.java
index fed3ec7..ee2a583 100644
--- a/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpServerFactory.java
+++ b/containers/grizzly2-http/src/main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyHttpServerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -46,9 +46,9 @@
* When the {@code start} parameter is not present, the factory method returns an already started instance.
* </p>
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Jakub Podlesak
+ * @author Marek Potociar
* @see HttpServer
* @see GrizzlyHttpContainer
*/
diff --git a/containers/grizzly2-servlet/pom.xml b/containers/grizzly2-servlet/pom.xml
index cf4f75c..37a2e7d 100644
--- a/containers/grizzly2-servlet/pom.xml
+++ b/containers/grizzly2-servlet/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-grizzly2-servlet</artifactId>
diff --git a/containers/grizzly2-servlet/src/main/java/org/glassfish/jersey/grizzly2/servlet/GrizzlyWebContainerFactory.java b/containers/grizzly2-servlet/src/main/java/org/glassfish/jersey/grizzly2/servlet/GrizzlyWebContainerFactory.java
index db969dd..1eb0bde 100644
--- a/containers/grizzly2-servlet/src/main/java/org/glassfish/jersey/grizzly2/servlet/GrizzlyWebContainerFactory.java
+++ b/containers/grizzly2-servlet/src/main/java/org/glassfish/jersey/grizzly2/servlet/GrizzlyWebContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -41,7 +41,7 @@
* referenced in the java classpath.
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public final class GrizzlyWebContainerFactory {
diff --git a/containers/jdk-http/pom.xml b/containers/jdk-http/pom.xml
index 6601b6f..b69b52c 100644
--- a/containers/jdk-http/pom.xml
+++ b/containers/jdk-http/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-jdk-http</artifactId>
@@ -86,8 +86,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <properties>
+ <!-- https://bugs.openjdk.java.net/browse/JDK-8211426 -->
+ <surefire.security.argline>-Djdk.tls.client.protocols=TLSv1.2</surefire.security.argline>
+ </properties>
+ </profile>
+ <profile>
<id>windows</id>
<activation>
+ <jdk>1.8</jdk>
<os>
<family>windows</family>
</os>
diff --git a/containers/jdk-http/src/main/java/org/glassfish/jersey/jdkhttp/JdkHttpHandlerContainer.java b/containers/jdk-http/src/main/java/org/glassfish/jersey/jdkhttp/JdkHttpHandlerContainer.java
index 051c5ca..265e9e3 100644
--- a/containers/jdk-http/src/main/java/org/glassfish/jersey/jdkhttp/JdkHttpHandlerContainer.java
+++ b/containers/jdk-http/src/main/java/org/glassfish/jersey/jdkhttp/JdkHttpHandlerContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -55,7 +55,7 @@
* Jersey {@code Container} implementation based on Java SE {@link HttpServer}.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JdkHttpHandlerContainer implements HttpHandler, Container {
diff --git a/containers/jdk-http/src/main/java/org/glassfish/jersey/jdkhttp/JdkHttpServerFactory.java b/containers/jdk-http/src/main/java/org/glassfish/jersey/jdkhttp/JdkHttpServerFactory.java
index f91a0a8..09c44ff 100644
--- a/containers/jdk-http/src/main/java/org/glassfish/jersey/jdkhttp/JdkHttpServerFactory.java
+++ b/containers/jdk-http/src/main/java/org/glassfish/jersey/jdkhttp/JdkHttpServerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -45,7 +45,7 @@
* Factory for creating {@link HttpServer JDK HttpServer} instances to run Jersey applications.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class JdkHttpServerFactory {
diff --git a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/AbstractJdkHttpServerTester.java b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/AbstractJdkHttpServerTester.java
index b5c0be8..8d0c2c2 100644
--- a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/AbstractJdkHttpServerTester.java
+++ b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/AbstractJdkHttpServerTester.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
/**
* Abstract JDK HTTP Server unit tester.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractJdkHttpServerTester {
diff --git a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/BasicJdkHttpServerTest.java b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/BasicJdkHttpServerTest.java
index 62a344d..67eaab8 100644
--- a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/BasicJdkHttpServerTest.java
+++ b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/BasicJdkHttpServerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,6 +20,7 @@
import javax.ws.rs.Path;
import javax.ws.rs.core.UriBuilder;
+import org.glassfish.jersey.internal.util.JdkVersion;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.After;
@@ -66,6 +67,9 @@
false);
assertThat(server, instanceOf(HttpsServer.class));
+ if (JdkVersion.getJdkVersion().getMajor() > 8) {
+ server.start(); // Address already in bind otherwise
+ }
}
@After
diff --git a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/JdkHttpPackageTest.java b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/JdkHttpPackageTest.java
index 675bbaa..ea327c0 100644
--- a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/JdkHttpPackageTest.java
+++ b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/JdkHttpPackageTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Jdk Http Container package scanning test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JdkHttpPackageTest extends AbstractJdkHttpServerTester {
diff --git a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/JdkHttpsServerTest.java b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/JdkHttpsServerTest.java
index 5fe94cb..12ad486 100644
--- a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/JdkHttpsServerTest.java
+++ b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/JdkHttpsServerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -31,6 +31,7 @@
import javax.net.ssl.SSLHandshakeException;
import org.glassfish.jersey.SslConfigurator;
+import org.glassfish.jersey.internal.util.JdkVersion;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.After;
@@ -50,7 +51,7 @@
/**
* Jdk Https Server tests.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class JdkHttpsServerTest extends AbstractJdkHttpServerTester {
@@ -82,6 +83,10 @@
public void testCreateHttpsServerNoSslContext() throws Exception {
HttpServer server = startServer(getHttpsUri(), rc, null, false);
assertThat(server, instanceOf(HttpsServer.class));
+
+ if (JdkVersion.getJdkVersion().getMajor() > 8) {
+ server.start(); // Address already in bind otherwise
+ }
}
/**
diff --git a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/LifecycleListenerTest.java b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/LifecycleListenerTest.java
index 229058f..c2acf8d 100644
--- a/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/LifecycleListenerTest.java
+++ b/containers/jdk-http/src/test/java/org/glassfish/jersey/jdkhttp/LifecycleListenerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -35,7 +35,7 @@
/**
* Reload and ContainerLifecycleListener support test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class LifecycleListenerTest extends AbstractJdkHttpServerTester {
diff --git a/containers/jersey-servlet-core/pom.xml b/containers/jersey-servlet-core/pom.xml
index 8e90bde..035f69d 100644
--- a/containers/jersey-servlet-core/pom.xml
+++ b/containers/jersey-servlet-core/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-servlet-core</artifactId>
@@ -72,7 +72,7 @@
<Import-Package>
javax.persistence.*;resolution:=optional,
javax.servlet.*;version="[2.4,5.0)",
- javax.annotation.*;version=!,
+ ${javax.annotation.osgi.version},
*
</Import-Package>
<Export-Package>org.glassfish.jersey.servlet.*</Export-Package>
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletContainer.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletContainer.java
index f54fc00..15a3217 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletContainer.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -125,9 +125,9 @@
* field or parameter annotated with {@code @PersistenceUnit(unitName="WidgetPU")}.
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class ServletContainer extends HttpServlet implements Filter, Container {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletProperties.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletProperties.java
index e6ea54b..a3257d2 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletProperties.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Jersey servlet container configuration properties.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@PropertiesClass
public final class ServletProperties {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/WebComponent.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/WebComponent.java
index 84962be..35c1499 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/WebComponent.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/WebComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -92,10 +92,10 @@
* Filter implementation, or encapsulated by a Servlet or Filter implementation.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
* @author Martin Matula
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class WebComponent {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java
index b96ebb7..451e912 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,9 +44,9 @@
* The writer depends on provided {@link AsyncContextDelegate} to support async functionality.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Martin Matula
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class ResponseWriter implements ContainerResponseWriter {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ServletContainerProviderFactory.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ServletContainerProviderFactory.java
index 8dbeb80..7fa646f 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ServletContainerProviderFactory.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ServletContainerProviderFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
* Factory class to get all "registered" implementations of {@link ServletContainerProvider}.
* Mentioned implementation classes are registered by {@code META-INF/services}.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.1
*/
public final class ServletContainerProviderFactory {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/ExtendedServletContainerProvider.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/ExtendedServletContainerProvider.java
index f9fa19b..73e42c7 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/ExtendedServletContainerProvider.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/ExtendedServletContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
* binding implementation in HK2 locator and also an implementation of {@link RequestScopedInitializer}
* that is used to set actual request/response references in injection manager within each request.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @since 2.21
*/
public interface ExtendedServletContainerProvider extends ServletContainerProvider {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/NoOpServletContainerProvider.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/NoOpServletContainerProvider.java
index d4147d8..c668f0f 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/NoOpServletContainerProvider.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/NoOpServletContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* dummy no-op method implementation. It should be convenient to extend if you only need to implement
* a subset of the original SPI methods.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class NoOpServletContainerProvider implements ExtendedServletContainerProvider {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/RequestContextProvider.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/RequestContextProvider.java
index 49049f2..792a3a8 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/RequestContextProvider.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/RequestContextProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
/**
* Provide access to the actual servlet request/response.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @see {@link RequestScopedInitializerProvider}
*/
public interface RequestContextProvider {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/RequestScopedInitializerProvider.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/RequestScopedInitializerProvider.java
index ea18626..fee9f4f 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/RequestScopedInitializerProvider.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/RequestScopedInitializerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
* Produces {@link RequestScopedInitializer}
* based on provided {@link RequestContextProvider}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface RequestScopedInitializerProvider {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/ServletContainerProvider.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/ServletContainerProvider.java
index 2e9b697..7e6e927 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/ServletContainerProvider.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/spi/ServletContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
* The provider implementation class is registered via {@code META-INF/services}.
*
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.4.1
*/
public interface ServletContainerProvider {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/AsyncContextDelegate.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/AsyncContextDelegate.java
index 99a02a8..fae2fd9 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/AsyncContextDelegate.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/AsyncContextDelegate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +24,7 @@
*
* @see AsyncContextDelegateProvider
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface AsyncContextDelegate {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/AsyncContextDelegateProvider.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/AsyncContextDelegateProvider.java
index 8503ff1..944b4ce 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/AsyncContextDelegateProvider.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/AsyncContextDelegateProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
* If no such a factory is registered via the {@code META-INF/services} mechanism
* a default factory for Servlet versions prior to 3.0 will be utilized with no async support.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface AsyncContextDelegateProvider {
diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/FilterUrlMappingsProvider.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/FilterUrlMappingsProvider.java
index a68b5ea..d8c1c0c 100644
--- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/FilterUrlMappingsProvider.java
+++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/spi/FilterUrlMappingsProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
/**
* Provides an access to context path from the filter configuration.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public interface FilterUrlMappingsProvider {
diff --git a/containers/jersey-servlet/pom.xml b/containers/jersey-servlet/pom.xml
index 9f901d0..bd79df0 100644
--- a/containers/jersey-servlet/pom.xml
+++ b/containers/jersey-servlet/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-servlet</artifactId>
@@ -79,7 +79,7 @@
<!-- Note: When you're changing these properties change them also in bundles/jax-rs-ri/bundle/pom.xml. -->
<Import-Package>
javax.servlet.*;version="[3.0,5.0)",
- javax.annotation.*;version=!,
+ ${javax.annotation.osgi.version},
*
</Import-Package>
</instructions>
diff --git a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/async/AsyncContextDelegateProviderImpl.java b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/async/AsyncContextDelegateProviderImpl.java
index 25ad283..cb60baf 100644
--- a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/async/AsyncContextDelegateProviderImpl.java
+++ b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/async/AsyncContextDelegateProviderImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,8 +32,8 @@
/**
* Servlet 3.x container response writer async extension and related extension factory implementation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class AsyncContextDelegateProviderImpl implements AsyncContextDelegateProvider {
diff --git a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/FilterUrlMappingsProviderImpl.java b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/FilterUrlMappingsProviderImpl.java
index e632f72..072820c 100644
--- a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/FilterUrlMappingsProviderImpl.java
+++ b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/FilterUrlMappingsProviderImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -32,7 +32,7 @@
* The functionality is available in Servlet 3.x environment only, so this
* implementation of {@link FilterUrlMappingsProvider} interface is Servlet 3 specific.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class FilterUrlMappingsProviderImpl implements FilterUrlMappingsProvider {
@Override
diff --git a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java
index 17493a3..5341af3 100644
--- a/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java
+++ b/containers/jersey-servlet/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -96,7 +96,7 @@
*
* @author Paul Sandoz
* @author Martin Matula
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@HandlesTypes({ Path.class, Provider.class, Application.class, ApplicationPath.class })
public final class JerseyServletContainerInitializer implements ServletContainerInitializer {
diff --git a/containers/jetty-http/pom.xml b/containers/jetty-http/pom.xml
index 0787c91..f7e16b6 100644
--- a/containers/jetty-http/pom.xml
+++ b/containers/jetty-http/pom.xml
@@ -23,7 +23,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.containers</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-jetty-http</artifactId>
diff --git a/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainer.java b/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainer.java
index fa93775..54e3316 100644
--- a/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainer.java
+++ b/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -68,8 +68,8 @@
* Jersey {@code Container} implementation based on Jetty {@link org.eclipse.jetty.server.Handler}.
*
* @author Arul Dhesiaseelan (aruld@acm.org)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Libor Kramolis
+ * @author Marek Potociar
*/
public final class JettyHttpContainer extends AbstractHandler implements Container {
diff --git a/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainerFactory.java b/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainerFactory.java
index 8155ea7..b501079 100644
--- a/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainerFactory.java
+++ b/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -48,7 +48,7 @@
* connected TCP socket channel.
*
* @author Arul Dhesiaseelan (aruld@acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class JettyHttpContainerFactory {
diff --git a/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainerProvider.java b/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainerProvider.java
index 15afcbf..7c50c75 100644
--- a/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainerProvider.java
+++ b/containers/jetty-http/src/main/java/org/glassfish/jersey/jetty/JettyHttpContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,7 +27,7 @@
* Container provider for containers based on Jetty Server {@link org.eclipse.jetty.server.Handler}.
*
* @author Arul Dhesiaseelan (aruld@acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class JettyHttpContainerProvider implements ContainerProvider {
diff --git a/containers/jetty-http/src/test/java/org/glassfish/jersey/jetty/LifecycleListenerTest.java b/containers/jetty-http/src/test/java/org/glassfish/jersey/jetty/LifecycleListenerTest.java
index 1377b88..15b299a 100644
--- a/containers/jetty-http/src/test/java/org/glassfish/jersey/jetty/LifecycleListenerTest.java
+++ b/containers/jetty-http/src/test/java/org/glassfish/jersey/jetty/LifecycleListenerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Reload and ContainerLifecycleListener support test.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class LifecycleListenerTest extends AbstractJettyServerTester {
diff --git a/containers/jetty-servlet/pom.xml b/containers/jetty-servlet/pom.xml
index 2b056df..c09d901 100644
--- a/containers/jetty-servlet/pom.xml
+++ b/containers/jetty-servlet/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-jetty-servlet</artifactId>
diff --git a/containers/netty-http/pom.xml b/containers/netty-http/pom.xml
index e8deb20..889e24c 100644
--- a/containers/netty-http/pom.xml
+++ b/containers/netty-http/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-netty-http</artifactId>
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/HttpVersionChooser.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/HttpVersionChooser.java
index 22660e2..20af41f 100644
--- a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/HttpVersionChooser.java
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/HttpVersionChooser.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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,7 +20,7 @@
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpServerCodec;
-import io.netty.handler.codec.http2.Http2Codec;
+import io.netty.handler.codec.http2.Http2MultiplexCodecBuilder;
import io.netty.handler.ssl.ApplicationProtocolNames;
import io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
import io.netty.handler.stream.ChunkedWriteHandler;
@@ -28,7 +28,7 @@
/**
* Choose the handler implementation based on Http protocol.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class HttpVersionChooser extends ApplicationProtocolNegotiationHandler {
@@ -45,7 +45,8 @@
@Override
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception {
if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {
- ctx.pipeline().addLast(new Http2Codec(true, new JerseyHttp2ServerHandler(baseUri, container)));
+ ctx.pipeline().addLast(Http2MultiplexCodecBuilder.forServer(
+ new JerseyHttp2ServerHandler(baseUri, container)).build());
return;
}
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyHttp2ServerHandler.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyHttp2ServerHandler.java
index b78d0d6..b1c34db 100644
--- a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyHttp2ServerHandler.java
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyHttp2ServerHandler.java
@@ -48,7 +48,7 @@
* <p>
* Note that this implementation cannot be more experimental. Any contributions / feedback is welcomed.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@ChannelHandler.Sharable
class JerseyHttp2ServerHandler extends ChannelDuplexHandler {
@@ -88,7 +88,7 @@
* Process incoming data.
*/
private void onDataRead(ChannelHandlerContext ctx, Http2DataFrame data) throws Exception {
- isList.add(new ByteBufInputStream(data.content()));
+ isList.add(new ByteBufInputStream(data.content(), true));
if (data.isEndStream()) {
isList.add(NettyInputStream.END_OF_INPUT);
}
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerHandler.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerHandler.java
index 9905afa..2b350de 100644
--- a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerHandler.java
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerHandler.java
@@ -43,6 +43,7 @@
import io.netty.util.concurrent.GenericFutureListener;
import org.glassfish.jersey.internal.PropertiesDelegate;
import org.glassfish.jersey.netty.connector.internal.NettyInputStream;
+import org.glassfish.jersey.netty.httpserver.NettySecurityContext;
import org.glassfish.jersey.server.ContainerRequest;
import org.glassfish.jersey.server.internal.ContainerUtils;
@@ -50,7 +51,7 @@
* {@link io.netty.channel.ChannelInboundHandler} which servers as a bridge
* between Netty and Jersey.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class JerseyServerHandler extends ChannelInboundHandlerAdapter {
@@ -99,7 +100,7 @@
ByteBuf content = httpContent.content();
if (content.isReadable()) {
- isList.add(new ByteBufInputStream(content));
+ isList.add(new ByteBufInputStream(content, true));
}
if (msg instanceof LastHttpContent) {
@@ -121,7 +122,7 @@
URI requestUri = URI.create(baseUri + ContainerUtils.encodeUnsafeCharacters(s));
ContainerRequest requestContext = new ContainerRequest(
- baseUri, requestUri, req.method().name(), getSecurityContext(),
+ baseUri, requestUri, req.method().name(), getSecurityContext(ctx),
new PropertiesDelegate() {
private final Map<String, Object> properties = new HashMap<>();
@@ -181,29 +182,8 @@
return requestContext;
}
- private SecurityContext getSecurityContext() {
- return new SecurityContext() {
-
- @Override
- public boolean isUserInRole(final String role) {
- return false;
- }
-
- @Override
- public boolean isSecure() {
- return false;
- }
-
- @Override
- public Principal getUserPrincipal() {
- return null;
- }
-
- @Override
- public String getAuthenticationScheme() {
- return null;
- }
- };
+ private NettySecurityContext getSecurityContext(ChannelHandlerContext ctx) {
+ return new NettySecurityContext(ctx);
}
@Override
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerInitializer.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerInitializer.java
index 16a6ce0..e7c11bf 100644
--- a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerInitializer.java
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerInitializer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -26,8 +26,8 @@
import io.netty.handler.codec.http.HttpMessage;
import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.handler.codec.http.HttpServerUpgradeHandler;
-import io.netty.handler.codec.http2.Http2Codec;
import io.netty.handler.codec.http2.Http2CodecUtil;
+import io.netty.handler.codec.http2.Http2MultiplexCodecBuilder;
import io.netty.handler.codec.http2.Http2ServerUpgradeCodec;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.stream.ChunkedWriteHandler;
@@ -38,7 +38,7 @@
* <p>
* Adds {@link HttpServerCodec}, {@link ChunkedWriteHandler} and {@link JerseyServerHandler} to the channels pipeline.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class JerseyServerInitializer extends ChannelInitializer<SocketChannel> {
@@ -113,7 +113,8 @@
@Override
public HttpServerUpgradeHandler.UpgradeCodec newUpgradeCodec(CharSequence protocol) {
if (AsciiString.contentEquals(Http2CodecUtil.HTTP_UPGRADE_PROTOCOL_NAME, protocol)) {
- return new Http2ServerUpgradeCodec(new Http2Codec(true, new JerseyHttp2ServerHandler(baseUri, container)));
+ return new Http2ServerUpgradeCodec(Http2MultiplexCodecBuilder.forServer(
+ new JerseyHttp2ServerHandler(baseUri, container)).build());
} else {
return null;
}
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttp2ResponseWriter.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttp2ResponseWriter.java
index 327d894..c08d065 100644
--- a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttp2ResponseWriter.java
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttp2ResponseWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
/**
* Netty implementation of {@link ContainerResponseWriter}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class NettyHttp2ResponseWriter implements ContainerResponseWriter {
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttpContainer.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttpContainer.java
index c825a82..ac4bf4e 100644
--- a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttpContainer.java
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttpContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -30,7 +30,7 @@
/**
* Netty based implementation of a {@link Container}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class NettyHttpContainer implements Container {
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttpContainerProvider.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttpContainerProvider.java
index 85d7b96..658557c 100644
--- a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttpContainerProvider.java
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyHttpContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -39,7 +39,7 @@
* <p>
* There is also a few "factory" methods for creating Netty server.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @since 2.24
*/
@Beta
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyResponseWriter.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyResponseWriter.java
index e50d870..00998c3 100644
--- a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyResponseWriter.java
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettyResponseWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -46,7 +46,7 @@
/**
* Netty implementation of {@link ContainerResponseWriter}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class NettyResponseWriter implements ContainerResponseWriter {
@@ -119,11 +119,7 @@
JerseyChunkedInput jerseyChunkedInput = new JerseyChunkedInput(ctx.channel());
- if (HttpUtil.isTransferEncodingChunked(response)) {
- ctx.write(new HttpChunkedInput(jerseyChunkedInput)).addListener(FLUSH_FUTURE);
- } else {
- ctx.write(new HttpChunkedInput(jerseyChunkedInput)).addListener(FLUSH_FUTURE);
- }
+ ctx.write(new HttpChunkedInput(jerseyChunkedInput)).addListener(FLUSH_FUTURE);
return jerseyChunkedInput;
} else {
diff --git a/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettySecurityContext.java b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettySecurityContext.java
new file mode 100644
index 0000000..b6fcc06
--- /dev/null
+++ b/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/NettySecurityContext.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2018 Ian Kirk. 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.httpserver;
+
+import java.security.Principal;
+
+import javax.ws.rs.core.SecurityContext;
+
+import io.netty.channel.ChannelHandlerContext;
+
+public class NettySecurityContext implements SecurityContext {
+ private ChannelHandlerContext ctx;
+
+ public NettySecurityContext(ChannelHandlerContext ctx) {
+ this.ctx = ctx;
+ }
+
+ public ChannelHandlerContext getNettyContext() {
+ return this.ctx;
+ }
+
+ @Override
+ public boolean isUserInRole(final String role) {
+ return false;
+ }
+
+ @Override
+ public boolean isSecure() {
+ return false;
+ }
+
+ @Override
+ public Principal getUserPrincipal() {
+ return null;
+ }
+
+ @Override
+ public String getAuthenticationScheme() {
+ return null;
+ }
+};
diff --git a/containers/pom.xml b/containers/pom.xml
index 3be359d..e11cac5 100644
--- a/containers/pom.xml
+++ b/containers/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.containers</groupId>
diff --git a/containers/simple-http/pom.xml b/containers/simple-http/pom.xml
index b7c6f73..7ac1987 100644
--- a/containers/simple-http/pom.xml
+++ b/containers/simple-http/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-container-simple-http</artifactId>
diff --git a/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainer.java b/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainer.java
index e59962f..22909e1 100644
--- a/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainer.java
+++ b/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -66,7 +66,7 @@
* {@link org.simpleframework.http.core.Container}.
*
* @author Arul Dhesiaseelan (aruld@acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class SimpleContainer implements org.simpleframework.http.core.Container, Container {
diff --git a/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainerFactory.java b/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainerFactory.java
index db8dcdf..3d98917 100644
--- a/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainerFactory.java
+++ b/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -47,7 +47,7 @@
* decrypt and encrypt information sent over the connected TCP socket channel.
*
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Paul Sandoz
*/
public final class SimpleContainerFactory {
diff --git a/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainerProvider.java b/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainerProvider.java
index 68f8f0f..4eaf1c4 100644
--- a/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainerProvider.java
+++ b/containers/simple-http/src/main/java/org/glassfish/jersey/simple/SimpleContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
*
* @author Marc Hadley
* @author Arul Dhesiaseelan (aruld@acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class SimpleContainerProvider implements ContainerProvider {
diff --git a/containers/simple-http/src/test/java/org/glassfish/jersey/simple/LifecycleListenerTest.java b/containers/simple-http/src/test/java/org/glassfish/jersey/simple/LifecycleListenerTest.java
index 439b7d2..4c16329 100644
--- a/containers/simple-http/src/test/java/org/glassfish/jersey/simple/LifecycleListenerTest.java
+++ b/containers/simple-http/src/test/java/org/glassfish/jersey/simple/LifecycleListenerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,7 +37,7 @@
* Reload and ContainerLifecycleListener support test.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class LifecycleListenerTest extends AbstractSimpleServerTester {
diff --git a/core-client/pom.xml b/core-client/pom.xml
index d10e482..43235f6 100644
--- a/core-client/pom.xml
+++ b/core-client/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.core</groupId>
@@ -91,7 +91,7 @@
<configuration>
<instructions>
<Import-Package>
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
*
</Import-Package>
<unpackBundle>true</unpackBundle>
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/AbortException.java b/core-client/src/main/java/org/glassfish/jersey/client/AbortException.java
index 0a81aff..713c4f5 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/AbortException.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/AbortException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
* Internal exception indicating that request processing has been aborted
* in the request filter processing chain.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*
* @see javax.ws.rs.client.ClientRequestContext#abortWith(javax.ws.rs.core.Response)
*/
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ChunkParser.java b/core-client/src/main/java/org/glassfish/jersey/client/ChunkParser.java
index 9aa3ca7..394bd97 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ChunkParser.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ChunkParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* of the chunk data.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface ChunkParser {
/**
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ChunkedInput.java b/core-client/src/main/java/org/glassfish/jersey/client/ChunkedInput.java
index e7101c5..29493f3 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ChunkedInput.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ChunkedInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -48,7 +48,7 @@
* input streams.
*
* @param <T> chunk type.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@SuppressWarnings("UnusedDeclaration")
public class ChunkedInput<T> extends GenericType<T> implements Closeable {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ChunkedInputReader.java b/core-client/src/main/java/org/glassfish/jersey/client/ChunkedInputReader.java
index 2b4a9af..f480447 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ChunkedInputReader.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ChunkedInputReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
/**
* {@link javax.ws.rs.ext.MessageBodyWriter} for {@link ChunkedInput}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ConstrainedTo(RuntimeType.CLIENT)
class ChunkedInputReader implements MessageBodyReader<ChunkedInput> {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientAsyncExecutor.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientAsyncExecutor.java
index 3d85ebc..6b12259 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientAsyncExecutor.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientAsyncExecutor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -35,7 +35,7 @@
* with the {@code @ClientAsyncExecutor} annotation.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see org.glassfish.jersey.client.ClientAsyncExecutorLiteral
* @since 2.18
*/
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientAsyncExecutorLiteral.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientAsyncExecutorLiteral.java
index 986460b..816e660 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientAsyncExecutorLiteral.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientAsyncExecutorLiteral.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* in method calls that require use of annotation instances.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.18
*/
@SuppressWarnings("ClassExplicitlyAnnotation")
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientBackgroundScheduler.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientBackgroundScheduler.java
index c01f066..538b400 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientBackgroundScheduler.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientBackgroundScheduler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* annotated with the {@code @ClientAsyncExecutor} annotation.
* </p>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @see ClientBackgroundSchedulerLiteral
* @since 2.26
*/
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientBackgroundSchedulerLiteral.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientBackgroundSchedulerLiteral.java
index aeb4860..be45497 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientBackgroundSchedulerLiteral.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientBackgroundSchedulerLiteral.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -25,7 +25,7 @@
* in method calls that require use of annotation instances.
* </p>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
@SuppressWarnings("ClassExplicitlyAnnotation")
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientBinder.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientBinder.java
index e30a258..6f6778f 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientBinder.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,6 +22,7 @@
import javax.ws.rs.RuntimeType;
import javax.ws.rs.client.Client;
import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.ext.MessageBodyReader;
import javax.inject.Inject;
@@ -38,9 +39,9 @@
/**
* Registers all binders necessary for {@link Client} runtime.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Marek Potociar
+ * @author Jakub Podlesak
+ * @author Libor Kramolis
*/
class ClientBinder extends AbstractBinder {
@@ -90,6 +91,9 @@
.to(ClientRequest.class)
.in(RequestScoped.class);
+ bindFactory(RequestContextInjectionFactory.class).to(HttpHeaders.class)
+ .proxy(true).proxyForSameScope(false).in(RequestScoped.class);
+
bindFactory(ReferencingFactory.referenceFactory()).to(new GenericType<Ref<ClientRequest>>() {
}).in(RequestScoped.class);
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientBootstrapBag.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientBootstrapBag.java
new file mode 100644
index 0000000..ced406a
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientBootstrapBag.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019 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.client;
+
+
+import org.glassfish.jersey.internal.BootstrapBag;
+import org.glassfish.jersey.client.inject.ParameterUpdaterProvider;
+
+/**
+ * {@inheritDoc}
+ * <p>
+ * This bootstrap bag is specialized for client part of Jersey.
+ *
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+public class ClientBootstrapBag extends BootstrapBag {
+
+ private ParameterUpdaterProvider parameterUpdaterProvider;
+
+ public ParameterUpdaterProvider getParameterUpdaterProvider() {
+ requireNonNull(parameterUpdaterProvider, ParameterUpdaterProvider.class);
+ return parameterUpdaterProvider;
+ }
+
+ public void setParameterUpdaterProvider(ParameterUpdaterProvider provider) {
+ this.parameterUpdaterProvider = provider;
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java
index a981b76..bfd2d8b 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,6 +35,7 @@
import org.glassfish.jersey.CommonProperties;
import org.glassfish.jersey.ExtendedConfig;
import org.glassfish.jersey.client.internal.LocalizationMessages;
+import org.glassfish.jersey.client.internal.inject.ParameterUpdaterConfigurator;
import org.glassfish.jersey.client.spi.Connector;
import org.glassfish.jersey.client.spi.ConnectorProvider;
import org.glassfish.jersey.internal.AutoDiscoverableConfigurator;
@@ -56,14 +58,16 @@
import org.glassfish.jersey.model.internal.ComponentBag;
import org.glassfish.jersey.model.internal.ManagedObjectsFinalizer;
import org.glassfish.jersey.process.internal.RequestScope;
+import org.glassfish.jersey.internal.inject.ParamConverterConfigurator;
/**
* Jersey externalized implementation of client-side JAX-RS {@link javax.ws.rs.core.Configurable
* configurable} contract.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
*/
public class ClientConfig implements Configurable<ClientConfig>, ExtendedConfig {
/**
@@ -413,10 +417,11 @@
InjectionManager injectionManager = Injections.createInjectionManager();
injectionManager.register(new ClientBinder(runtimeCfgState.getProperties()));
- BootstrapBag bootstrapBag = new BootstrapBag();
+ BootstrapBag bootstrapBag = new ClientBootstrapBag();
bootstrapBag.setManagedObjectsFinalizer(new ManagedObjectsFinalizer(injectionManager));
- List<BootstrapConfigurator> bootstrapConfigurators = Arrays.asList(
- new RequestScope.RequestScopeConfigurator(),
+ List<BootstrapConfigurator> bootstrapConfigurators = Arrays.asList(new RequestScope.RequestScopeConfigurator(),
+ new ParamConverterConfigurator(),
+ new ParameterUpdaterConfigurator(),
new RuntimeConfigConfigurator(runtimeCfgState),
new ContextResolverFactory.ContextResolversConfigurator(),
new MessageBodyFactory.MessageBodyWorkersConfigurator(),
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientExecutor.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientExecutor.java
index 51cde1c..786adaa 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientExecutor.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientExecutor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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,7 +24,7 @@
/**
* Executor for client async processing and background task scheduling.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
public interface ClientExecutor {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientFilteringStages.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientFilteringStages.java
index cb7efa3..057fac5 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientFilteringStages.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientFilteringStages.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,10 +22,17 @@
import javax.ws.rs.client.ClientRequestFilter;
import javax.ws.rs.client.ClientResponseFilter;
import javax.ws.rs.client.ResponseProcessingException;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ReaderInterceptor;
+import org.glassfish.jersey.client.internal.routing.AbortedRequestMediaTypeDeterminer;
import org.glassfish.jersey.internal.inject.InjectionManager;
import org.glassfish.jersey.internal.inject.Providers;
+import org.glassfish.jersey.message.internal.HeaderUtils;
+import org.glassfish.jersey.message.internal.InboundMessageContext;
+import org.glassfish.jersey.message.internal.OutboundJaxrsResponse;
import org.glassfish.jersey.model.internal.RankedComparator;
import org.glassfish.jersey.process.internal.AbstractChainableStage;
import org.glassfish.jersey.process.internal.ChainableStage;
@@ -33,7 +40,7 @@
/**
* Client filtering stage factory.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class ClientFilteringStages {
@@ -84,6 +91,21 @@
filter.filter(requestContext);
final Response abortResponse = requestContext.getAbortResponse();
if (abortResponse != null) {
+ if (abortResponse.hasEntity() && abortResponse.getMediaType() == null) {
+ final InboundMessageContext headerContext = new InboundMessageContext() {
+ @Override
+ protected Iterable<ReaderInterceptor> getReaderInterceptors() {
+ return null;
+ }
+ };
+ headerContext.headers(HeaderUtils.asStringHeaders(abortResponse.getHeaders()));
+
+ final AbortedRequestMediaTypeDeterminer determiner = new AbortedRequestMediaTypeDeterminer(
+ requestContext.getWorkers());
+ final MediaType mediaType = determiner.determineResponseMediaType(abortResponse.getEntity(),
+ headerContext.getQualifiedAcceptableMediaTypes());
+ abortResponse.getHeaders().add(HttpHeaders.CONTENT_TYPE, mediaType);
+ }
throw new AbortException(new ClientResponse(requestContext, abortResponse));
}
} catch (IOException ex) {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientLifecycleListener.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientLifecycleListener.java
index 3aaf87f..a33cd3a 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientLifecycleListener.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientLifecycleListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Jersey client lifecycle listener contract.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.11
*/
@Contract
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientProperties.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientProperties.java
index e7b272f..e4f20be 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientProperties.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -27,8 +27,8 @@
/**
* Jersey client implementation configuration properties.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Marek Potociar
+ * @author Libor Kramolis
*/
@PropertiesClass
public final class ClientProperties {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientRequest.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientRequest.java
index 154ed69..f6fedfa 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientRequest.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientRequest.java
@@ -50,14 +50,15 @@
import org.glassfish.jersey.internal.util.ExceptionUtils;
import org.glassfish.jersey.internal.util.PropertiesHelper;
import org.glassfish.jersey.message.MessageBodyWorkers;
+import org.glassfish.jersey.message.internal.HeaderUtils;
import org.glassfish.jersey.message.internal.OutboundMessageContext;
/**
* Jersey client request context.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
-public class ClientRequest extends OutboundMessageContext implements ClientRequestContext, InjectionManagerSupplier {
+public class ClientRequest extends OutboundMessageContext implements ClientRequestContext, HttpHeaders, InjectionManagerSupplier {
// Request-scoped configuration instance
private final ClientConfig clientConfig;
@@ -276,6 +277,16 @@
}
@Override
+ public List<String> getRequestHeader(String name) {
+ return HeaderUtils.asStringList(getHeaders().get(name), null);
+ }
+
+ @Override
+ public MultivaluedMap<String, String> getRequestHeaders() {
+ return HeaderUtils.asStringHeaders(getHeaders());
+ }
+
+ @Override
public Map<String, Cookie> getCookies() {
return super.getRequestCookies();
}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientResponse.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientResponse.java
index 93301c2..51c9556 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientResponse.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -47,7 +47,7 @@
/**
* Jersey client response context.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ClientResponse extends InboundMessageContext implements ClientResponseContext, InjectionManagerSupplier {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java b/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java
index e40da77..fb90a03 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ClientRuntime.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -56,7 +56,7 @@
/**
* Client-side request processing runtime.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class ClientRuntime implements JerseyClient.ShutdownHook, ClientExecutor {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/DefaultClientAsyncExecutorProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/DefaultClientAsyncExecutorProvider.java
index 369603a..a875feb 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/DefaultClientAsyncExecutorProvider.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/DefaultClientAsyncExecutorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
/**
* Default {@link org.glassfish.jersey.spi.ExecutorServiceProvider} used on the client side for asynchronous request processing.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ClientAsyncExecutor
class DefaultClientAsyncExecutorProvider extends ThreadPoolExecutorProvider {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/DefaultClientBackgroundSchedulerProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/DefaultClientBackgroundSchedulerProvider.java
index 7ff298e..0082456 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/DefaultClientBackgroundSchedulerProvider.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/DefaultClientBackgroundSchedulerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -22,7 +22,7 @@
* Default {@link org.glassfish.jersey.spi.ScheduledExecutorServiceProvider} used on the client side for providing the scheduled
* executor service that runs background tasks.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
@ClientBackgroundScheduler
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/HttpUrlConnectorProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/HttpUrlConnectorProvider.java
index 86bac84..7389781 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/HttpUrlConnectorProvider.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/HttpUrlConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -47,7 +47,7 @@
* {@link #USE_FIXED_LENGTH_STREAMING} Jersey client configuration property.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class HttpUrlConnectorProvider implements ConnectorProvider {
/**
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/InboundJaxrsResponse.java b/core-client/src/main/java/org/glassfish/jersey/client/InboundJaxrsResponse.java
index 57181aa..4d6fe52 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/InboundJaxrsResponse.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/InboundJaxrsResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,7 +44,7 @@
* ensures that all request-scoped method invocations are run in the proper request scope.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class InboundJaxrsResponse extends Response {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/Initializable.java b/core-client/src/main/java/org/glassfish/jersey/client/Initializable.java
index 1c8f4c2..a144443 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/Initializable.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/Initializable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
* </p>
*
* @param <T> initializable type.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.8
*/
public interface Initializable<T extends Initializable<T>> {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyClient.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyClient.java
index 8dadb35..f7e3916 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyClient.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -51,7 +51,7 @@
* Jersey implementation of {@link javax.ws.rs.client.Client JAX-RS Client}
* contract.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JerseyClient implements javax.ws.rs.client.Client, Initializable<JerseyClient> {
private static final Logger LOG = Logger.getLogger(JerseyClient.class.getName());
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyClientBuilder.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyClientBuilder.java
index 309ef77..5f1a594 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyClientBuilder.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyClientBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -36,7 +36,7 @@
/**
* Jersey provider of {@link javax.ws.rs.client.ClientBuilder JAX-RS client builder}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JerseyClientBuilder extends ClientBuilder {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java
index b2dfddd..d27c619 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -70,7 +70,7 @@
* Jersey implementation of {@link javax.ws.rs.client.Invocation JAX-RS client-side
* request invocation} contract.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JerseyInvocation implements javax.ws.rs.client.Invocation {
@@ -451,18 +451,12 @@
@Override
public CompletionStageRxInvoker rx() {
- ExecutorServiceProvider instance = this.requestContext.getInjectionManager()
- .getInstance(ExecutorServiceProvider.class);
-
- return new JerseyCompletionStageRxInvoker(this, instance.getExecutorService());
+ return new JerseyCompletionStageRxInvoker(this, executorService());
}
@Override
public <T extends RxInvoker> T rx(Class<T> clazz) {
- ExecutorServiceProvider instance = this.requestContext.getInjectionManager()
- .getInstance(ExecutorServiceProvider.class);
-
- return createRxInvoker(clazz, instance.getExecutorService());
+ return createRxInvoker(clazz, executorService());
}
private <T extends RxInvoker> T rx(Class<T> clazz, ExecutorService executorService) {
@@ -473,6 +467,19 @@
return createRxInvoker(clazz, executorService);
}
+ // get executor service from explicit configuration; if not available, get executor service from provider
+ private ExecutorService executorService() {
+ final ExecutorService result = request().getClientConfig().getExecutorService();
+
+ if (result != null) {
+ return result;
+ }
+
+ return this.requestContext.getInjectionManager()
+ .getInstance(ExecutorServiceProvider.class)
+ .getExecutorService();
+ }
+
/**
* Create {@link RxInvoker} from provided {@code RxInvoker} subclass.
* <p>
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyWebTarget.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyWebTarget.java
index c7d54be..6c4f029 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyWebTarget.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyWebTarget.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
* Jersey implementation of {@link javax.ws.rs.client.WebTarget JAX-RS client target}
* contract.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JerseyWebTarget implements javax.ws.rs.client.WebTarget, Initializable<JerseyWebTarget> {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/RequestProcessingInitializationStage.java b/core-client/src/main/java/org/glassfish/jersey/client/RequestProcessingInitializationStage.java
index 99de792..dc86103 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/RequestProcessingInitializationStage.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/RequestProcessingInitializationStage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -37,7 +37,7 @@
* the client-side request-scoped processing injection for the current
* request and response exchange.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class RequestProcessingInitializationStage implements Function<ClientRequest, ClientRequest> {
private final Provider<Ref<ClientRequest>> requestRefProvider;
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/ResponseCallback.java b/core-client/src/main/java/org/glassfish/jersey/client/ResponseCallback.java
index 6ed9064..60cc10f 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/ResponseCallback.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/ResponseCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
/**
* Client response processing callback.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
interface ResponseCallback {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/authentication/BasicAuthenticator.java b/core-client/src/main/java/org/glassfish/jersey/client/authentication/BasicAuthenticator.java
index be0cfe3..bf6ac86 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/authentication/BasicAuthenticator.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/authentication/BasicAuthenticator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
* Implementation of Basic Http Authentication method (RFC 2617).
*
* @author Miroslav Fuksa
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Craig McClanahan
*/
final class BasicAuthenticator {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterUpdater.java b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterUpdater.java
new file mode 100644
index 0000000..beac968
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterUpdater.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.inject;
+
+/**
+ * Provider that converts the an object of a custom Java type
+ * values to String / Collection<String>> type
+ *
+ * @param <T> custom Java type
+ * @param <R> String / Collection<String>> type
+ *
+ * @author Paul Sandoz
+ * @author Marek Potociar
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+public interface ParameterUpdater<T, R> {
+
+ /**
+ * Name of the parameter to be udpated
+ *
+ * @return name of the updated parameter.
+ */
+ String getName();
+
+ /**
+ * Default value (string) that will be used in case input value is not available.
+ *
+ * @return default (back-up) value.
+ */
+ String getDefaultValueString();
+
+ /**
+ * Update the value using ParamConverter#toString (and using
+ * the configured {@link #getDefaultValueString() default value})
+ *
+ * @param parameters custom Java type instance value.
+ * @return converted value.
+ */
+ R update(T parameters);
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterUpdaterProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterUpdaterProvider.java
new file mode 100644
index 0000000..5f6ec3f
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/inject/ParameterUpdaterProvider.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.inject;
+
+import org.glassfish.jersey.model.Parameter;
+
+/**
+ * Provider of parameter updater.
+ *
+ * @author Paul Sandoz
+ * @author Marek Potociar
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+public interface ParameterUpdaterProvider {
+
+ /**
+ * Get the updater configured to update value of given {@link Parameter parameter}.
+ * <p />
+ * If the default value has been set on the parameter, it will be configured
+ * in the updater.
+ *
+ * @param parameter client model parameter.
+ * @return updater for the method parameter.
+ */
+ ParameterUpdater<?, ?> get(Parameter parameter);
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/HttpUrlConnector.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/HttpUrlConnector.java
index 65b2eae..0b018d6 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/internal/HttpUrlConnector.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/HttpUrlConnector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -64,7 +64,7 @@
/**
* Default client transport connector using {@link HttpURLConnection}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class HttpUrlConnector implements Connector {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueUpdater.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueUpdater.java
new file mode 100644
index 0000000..fb09364
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/AbstractParamValueUpdater.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.internal.inject;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.ext.ParamConverter;
+
+import org.glassfish.jersey.internal.inject.UpdaterException;
+import org.glassfish.jersey.internal.util.collection.UnsafeValue;
+import org.glassfish.jersey.internal.util.collection.Values;
+
+/**
+ * Abstract base class for implementing parameter value updater
+ * logic supplied using {@link ParamConverter parameter converters}.
+ *
+ * @author Paul Sandoz
+ * @author Marek Potociar
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+abstract class AbstractParamValueUpdater<T> {
+
+ private final ParamConverter<T> paramConverter;
+ private final String parameterName;
+ private final String defaultValue;
+ private final UnsafeValue<String, RuntimeException> convertedDefaultValue;
+
+ /**
+ * Constructor that initializes parameter updater.
+ *
+ * @param converter parameter converter.
+ * @param parameterName name of the parameter.
+ * @param defaultValueString default parameter value string.
+ */
+ protected AbstractParamValueUpdater(ParamConverter<T> converter, String parameterName, final String defaultValue) {
+ this.paramConverter = converter;
+ this.parameterName = parameterName;
+ this.defaultValue = defaultValue;
+
+ if (defaultValue != null) {
+ this.convertedDefaultValue = Values.lazy(new UnsafeValue<String, RuntimeException>() {
+ @Override
+ public String get() throws RuntimeException {
+ return defaultValue;
+ }
+ });
+
+ if (!converter.getClass().isAnnotationPresent(ParamConverter.Lazy.class)) {
+ // ignore return value - executed just for validation reasons
+ convertedDefaultValue.get();
+ }
+ } else {
+ convertedDefaultValue = null;
+ }
+ }
+
+ /**
+ * Get the name of the parameter this updater belongs to.
+ *
+ * @return parameter name.
+ */
+ public String getName() {
+ return parameterName;
+ }
+
+ /**
+ * Get the default value of the parameter.
+ *
+ * @return default parameter value.
+ */
+ public String getDefaultValueString() {
+ return defaultValue;
+ }
+
+ /**
+ * Update parameter value to string using the configured {@link ParamConverter parameter converter}.
+ *
+ * A {@link WebApplicationException} / {@link IllegalArgumentException} thrown
+ * from the converter is propagated unchanged. Any other exception throws by
+ * the converter is wrapped in a new {@link UpdaterException} before rethrowing.
+ *
+ * @param value parameter value to be converted/updated.
+ * @return updated value of a given Java type.
+ * @throws WebApplicationException in case the underlying parameter converter throws
+ * a {@code WebApplicationException}. The exception is rethrown without a change.
+ * @throws UpdaterException wrapping any other exception thrown by the parameter converter.
+ */
+ protected final String toString(T value) {
+ String result = convert(value);
+ if (result == null) {
+ return defaultValue();
+ }
+ return result;
+ }
+
+ private String convert(T value) {
+ try {
+ return paramConverter.toString(value);
+ } catch (WebApplicationException | IllegalArgumentException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new UpdaterException(ex);
+ }
+ }
+
+ /**
+ * Check if there is a default value registered for the parameter.
+ *
+ * @return {@code true} if there is a default parameter value registered, {@code false} otherwise.
+ */
+ protected final boolean isDefaultValueRegistered() {
+ return defaultValue != null;
+ }
+
+ /**
+ * Get converted default value.
+ *
+ * The conversion happens lazily during first call of the method.
+ *
+ * @return converted default value.
+ */
+ protected final String defaultValue() {
+ if (!isDefaultValueRegistered()) {
+ return null;
+ }
+
+ return convertedDefaultValue.get();
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionUpdater.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionUpdater.java
new file mode 100644
index 0000000..d8407e3
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/CollectionUpdater.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.internal.inject;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import static java.util.stream.Collectors.toList;
+import javax.ws.rs.ProcessingException;
+import javax.ws.rs.ext.ParamConverter;
+import org.glassfish.jersey.client.internal.LocalizationMessages;
+import org.glassfish.jersey.client.inject.ParameterUpdater;
+
+/**
+ * Update parameter value as a typed collection.
+ *
+ * @param <T> parameter value type.
+ * @author Paul Sandoz
+ * @author Marek Potociar
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+abstract class CollectionUpdater<T> extends AbstractParamValueUpdater<T>
+ implements ParameterUpdater<Collection<T>, Collection<String>> {
+
+ /**
+ * Create new collection parameter updater.
+ *
+ * @param converter parameter converter to be used to convert parameter from a custom Java type.
+ * @param parameterName parameter name.
+ * @param defaultValue default parameter String value.
+ */
+ protected CollectionUpdater(final ParamConverter<T> converter,
+ final String parameterName,
+ final String defaultValue) {
+ super(converter, parameterName, defaultValue);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public Collection<String> update(final Collection<T> values) {
+ Collection<String> results = Collections.EMPTY_LIST;
+ if (values != null) {
+ results = values
+ .stream()
+ .map(item -> toString(item))
+ .collect(toList());
+ } else if (isDefaultValueRegistered()) {
+ results = Collections.singletonList(getDefaultValueString());
+ }
+ return results;
+ }
+
+ /**
+ * Get a new collection instance that will be used to store the updated parameters.
+ * <p/>
+ * The method is overridden by concrete implementations to return an instance
+ * of a proper collection sub-type.
+ *
+ * @return instance of a proper collection sub-type
+ */
+ protected abstract Collection<String> newCollection();
+
+ private static final class ListValueOf<T> extends CollectionUpdater<T> {
+
+ ListValueOf(final ParamConverter<T> converter, final String parameter, final String defaultValue) {
+ super(converter, parameter, defaultValue);
+ }
+
+ @Override
+ protected List<String> newCollection() {
+ return new ArrayList<>();
+ }
+ }
+
+ private static final class SetValueOf<T> extends CollectionUpdater<T> {
+
+ SetValueOf(final ParamConverter<T> converter, final String parameter, final String defaultValue) {
+ super(converter, parameter, defaultValue);
+ }
+
+ @Override
+ protected Set<String> newCollection() {
+ return new HashSet<>();
+ }
+ }
+
+ private static final class SortedSetValueOf<T> extends CollectionUpdater<T> {
+
+ SortedSetValueOf(final ParamConverter<T> converter, final String parameter, final String defaultValue) {
+ super(converter, parameter, defaultValue);
+ }
+
+ @Override
+ protected SortedSet<String> newCollection() {
+ return new TreeSet<>();
+ }
+ }
+
+ /**
+ * Get a new {@code CollectionUpdater} instance.
+ *
+ * @param collectionType raw collection type.
+ * @param converter parameter converter to be used to convert parameter Java type values into
+ * String values .
+ * @param parameterName parameter name.
+ * @param defaultValue default parameter string value.
+ * @param <T> converted parameter Java type.
+ * @return new collection parameter updated instance.
+ */
+ public static <T> CollectionUpdater getInstance(final Class<?> collectionType,
+ final ParamConverter<T> converter,
+ final String parameterName,
+ final String defaultValue) {
+ if (List.class == collectionType) {
+ return new ListValueOf<>(converter, parameterName, defaultValue);
+ } else if (Set.class == collectionType) {
+ return new SetValueOf<>(converter, parameterName, defaultValue);
+ } else if (SortedSet.class == collectionType) {
+ return new SortedSetValueOf<>(converter, parameterName, defaultValue);
+ } else {
+ throw new ProcessingException(LocalizationMessages.COLLECTION_UPDATER_TYPE_UNSUPPORTED());
+ }
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterUpdaterConfigurator.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterUpdaterConfigurator.java
new file mode 100644
index 0000000..ed24fa7
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterUpdaterConfigurator.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.internal.inject;
+
+import javax.ws.rs.ext.ParamConverterProvider;
+import org.glassfish.jersey.client.ClientBootstrapBag;
+
+import org.glassfish.jersey.internal.BootstrapBag;
+import org.glassfish.jersey.internal.BootstrapConfigurator;
+import org.glassfish.jersey.internal.inject.Bindings;
+import org.glassfish.jersey.internal.inject.InjectionManager;
+import org.glassfish.jersey.internal.inject.ParamConverterFactory;
+import org.glassfish.jersey.internal.inject.Providers;
+import org.glassfish.jersey.internal.util.collection.LazyValue;
+import org.glassfish.jersey.internal.util.collection.Value;
+import org.glassfish.jersey.internal.util.collection.Values;
+import org.glassfish.jersey.client.inject.ParameterUpdaterProvider;
+
+/**
+ * Configurator which initializes and register {@link ParameterUpdaterProvider} instance into
+ * {@link InjectionManager}.
+ *
+ * @author Petr Bouda
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+public class ParameterUpdaterConfigurator implements BootstrapConfigurator {
+
+ @Override
+ public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) {
+ ClientBootstrapBag clientBag = (ClientBootstrapBag) bootstrapBag;
+
+ // Param Converters must be initialized Lazy and created at the time of the call on updater
+ LazyValue<ParamConverterFactory> lazyParamConverterFactory =
+ Values.lazy((Value<ParamConverterFactory>) () -> new ParamConverterFactory(
+ Providers.getProviders(injectionManager, ParamConverterProvider.class),
+ Providers.getCustomProviders(injectionManager, ParamConverterProvider.class)));
+
+ ParameterUpdaterFactory parameterUpdaterFactory = new ParameterUpdaterFactory(lazyParamConverterFactory);
+ clientBag.setParameterUpdaterProvider(parameterUpdaterFactory);
+ injectionManager.register(Bindings.service(parameterUpdaterFactory)
+ .to(ParameterUpdaterProvider.class));
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterUpdaterFactory.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterUpdaterFactory.java
new file mode 100644
index 0000000..2b15402
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/ParameterUpdaterFactory.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.internal.inject;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import javax.ws.rs.ProcessingException;
+import javax.ws.rs.ext.ParamConverter;
+import javax.inject.Singleton;
+import org.glassfish.jersey.internal.inject.UpdaterException;
+import org.glassfish.jersey.internal.inject.ParamConverterFactory;
+import org.glassfish.jersey.internal.util.ReflectionHelper;
+import org.glassfish.jersey.internal.util.collection.ClassTypePair;
+import org.glassfish.jersey.internal.util.collection.LazyValue;
+import org.glassfish.jersey.client.internal.LocalizationMessages;
+import org.glassfish.jersey.model.Parameter;
+import org.glassfish.jersey.internal.inject.PrimitiveMapper;
+import org.glassfish.jersey.client.inject.ParameterUpdater;
+import org.glassfish.jersey.client.inject.ParameterUpdaterProvider;
+
+/**
+ * Implementation of {@link ParameterUpdaterProvider}. For each
+ * parameter, the implementation obtains a
+ * {@link ParamConverter param converter} instance via
+ * {@link ParamConverterFactory} and creates the proper
+ * {@link ParameterUpdater parameter updater}.
+ *
+ * @author Paul Sandoz
+ * @author Marek Potociar
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+@Singleton
+final class ParameterUpdaterFactory implements ParameterUpdaterProvider {
+
+ private final LazyValue<ParamConverterFactory> paramConverterFactory;
+
+ /**
+ * Create new parameter updater factory.
+ *
+ * @param paramConverterFactory string readers factory.
+ */
+ public ParameterUpdaterFactory(LazyValue<ParamConverterFactory> paramConverterFactory) {
+ this.paramConverterFactory = paramConverterFactory;
+ }
+
+ @Override
+ public ParameterUpdater<?, ?> get(final Parameter p) {
+ return process(
+ paramConverterFactory.get(),
+ p.getDefaultValue(),
+ p.getRawType(),
+ p.getType(),
+ p.getAnnotations(),
+ p.getSourceName());
+ }
+
+ @SuppressWarnings("unchecked")
+ private ParameterUpdater<?, ?> process(
+ final ParamConverterFactory paramConverterFactory,
+ final String defaultValue,
+ final Class<?> rawType,
+ final Type type,
+ final Annotation[] annotations,
+ final String parameterName) {
+
+ // Try to find a converter that support rawType and type at first.
+ // E.g. if someone writes a converter that support List<Integer> this approach should precede the next one.
+ ParamConverter<?> converter = paramConverterFactory.getConverter(rawType, type, annotations);
+ if (converter != null) {
+ try {
+ return new SingleValueUpdater(converter, parameterName, defaultValue);
+ } catch (final UpdaterException e) {
+ throw e;
+ } catch (final Exception e) {
+ throw new ProcessingException(LocalizationMessages.ERROR_PARAMETER_TYPE_PROCESSING(rawType), e);
+ }
+ }
+
+ // Check whether the rawType is the type of the collection supported.
+ if (rawType == List.class || rawType == Set.class || rawType == SortedSet.class) {
+ // Get the generic type of the list. If none is found default to String.
+ final List<ClassTypePair> typePairs = ReflectionHelper.getTypeArgumentAndClass(type);
+ final ClassTypePair typePair = (typePairs.size() == 1) ? typePairs.get(0) : null;
+
+ if (typePair != null) {
+ converter = paramConverterFactory.getConverter(
+ typePair.rawClass(),
+ typePair.type(),
+ annotations
+ );
+ }
+ if (converter != null) {
+ try {
+ return CollectionUpdater.getInstance(rawType, converter, parameterName, defaultValue);
+ } catch (final UpdaterException e) {
+ throw e;
+ } catch (final Exception e) {
+ throw new ProcessingException(LocalizationMessages.ERROR_PARAMETER_TYPE_PROCESSING(rawType), e);
+ }
+ }
+ }
+
+ // Check primitive types.
+ if (rawType == String.class) {
+ return new SingleStringValueUpdater(parameterName, defaultValue);
+ } else if (rawType == Character.class) {
+ return new PrimitiveCharacterUpdater(parameterName,
+ defaultValue,
+ PrimitiveMapper.primitiveToDefaultValueMap.get(rawType));
+ } else if (rawType.isPrimitive()) {
+ // Convert primitive to wrapper class
+ final Class<?> wrappedRaw = PrimitiveMapper.primitiveToClassMap.get(rawType);
+ if (wrappedRaw == null) {
+ // Primitive type not supported
+ return null;
+ }
+
+ if (wrappedRaw == Character.class) {
+ return new PrimitiveCharacterUpdater(parameterName,
+ defaultValue,
+ PrimitiveMapper.primitiveToDefaultValueMap.get(wrappedRaw));
+ }
+
+ return new PrimitiveValueOfUpdater(
+ parameterName,
+ defaultValue,
+ PrimitiveMapper.primitiveToDefaultValueMap.get(wrappedRaw));
+ }
+
+ return null;
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterUpdater.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterUpdater.java
new file mode 100644
index 0000000..da36a75
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveCharacterUpdater.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.internal.inject;
+
+import org.glassfish.jersey.client.inject.ParameterUpdater;
+
+/**
+ * Value updater for {@link java.lang.Character} and {@code char} parameters.
+ *
+ * @author Pavel Bucek
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ *
+ */
+class PrimitiveCharacterUpdater implements ParameterUpdater<Character, String> {
+
+ private final String parameter;
+ private final String defaultValue;
+ private final Object defaultPrimitiveTypeValue;
+
+ public PrimitiveCharacterUpdater(String parameter, String defaultValue, Object defaultPrimitiveTypeValue) {
+ this.parameter = parameter;
+ this.defaultValue = defaultValue;
+ this.defaultPrimitiveTypeValue = defaultPrimitiveTypeValue;
+ }
+
+ @Override
+ public String getName() {
+ return parameter;
+ }
+
+ @Override
+ public String getDefaultValueString() {
+ return defaultValue;
+ }
+
+ @Override
+ public String update(Character value) {
+ if (value != null) {
+ return value.toString();
+ } else if (defaultValue != null) {
+ return defaultValue;
+ }
+ return defaultPrimitiveTypeValue.toString();
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfUpdater.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfUpdater.java
new file mode 100644
index 0000000..b9ea6a0
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/PrimitiveValueOfUpdater.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.internal.inject;
+
+import org.glassfish.jersey.client.inject.ParameterUpdater;
+
+/**
+ * Update String value using {@code toString()} methods
+ * on the primitive Java type wrapper classes.
+ *
+ * @author Paul Sandoz
+ * @author Marek Potociar
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ * @author Patrik Dudits
+ *
+ */
+final class PrimitiveValueOfUpdater implements ParameterUpdater<Object, String> {
+
+ private final String parameter;
+ private final String defaultValue;
+ private final Object defaultPrimitiveTypeValue;
+
+ /**
+ * Create new primitive parameter value updater.
+ *
+ * @param valueOf {@code valueOf()} method handler.
+ * @param parameter string parameter value.
+ * @param defaultValue default string value.
+ * @param defaultPrimitiveTypeValue default primitive type value.
+ */
+ public PrimitiveValueOfUpdater(String parameter,
+ String defaultValue,
+ Object defaultPrimitiveTypeValue) {
+ this.parameter = parameter;
+ this.defaultValue = defaultValue;
+ this.defaultPrimitiveTypeValue = defaultPrimitiveTypeValue;
+ }
+
+ @Override
+ public String getName() {
+ return parameter;
+ }
+
+ @Override
+ public String getDefaultValueString() {
+ return defaultValue;
+ }
+
+ @Override
+ public String update(Object value) {
+ if (value != null) {
+ return value.toString();
+ } else if (defaultValue != null) {
+ return defaultValue;
+ }
+ return defaultPrimitiveTypeValue.toString();
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueUpdater.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueUpdater.java
new file mode 100644
index 0000000..46ae92e
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleStringValueUpdater.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.internal.inject;
+
+import org.glassfish.jersey.client.inject.ParameterUpdater;
+
+/**
+ * Update value of the parameter by returning the first string parameter value
+ * found in the list of string parameter values.
+ * <p />
+ * This class can be seen as a special, optimized, case of {@link SingleValueUpdater}.
+ *
+ * @author Paul Sandoz
+ * @author Marek Potociar
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+final class SingleStringValueUpdater implements ParameterUpdater<String, String> {
+
+ private final String paramName;
+ private final String defaultValue;
+
+ /**
+ * Create new single string value updater.
+ *
+ * @param parameterName string parameter name.
+ * @param defaultValue default value.
+ */
+ public SingleStringValueUpdater(String parameterName, String defaultValue) {
+ this.paramName = parameterName;
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public String getName() {
+ return paramName;
+ }
+
+ @Override
+ public String getDefaultValueString() {
+ return defaultValue;
+ }
+
+ /**
+ * {@inheritDoc}
+ * <p/>
+ * This implementation return s the first String value found in the list of
+ * potential multiple string parameter values. Any other values in the multi-value
+ * list will be ignored.
+ *
+ * @param parameters map of parameters.
+ * @return updated single string parameter value.
+ */
+ @Override
+ public String update(String value) {
+ return (value != null) ? value : defaultValue;
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueUpdater.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueUpdater.java
new file mode 100644
index 0000000..152451c
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/inject/SingleValueUpdater.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.client.internal.inject;
+
+import javax.ws.rs.ProcessingException;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.ext.ParamConverter;
+import org.glassfish.jersey.internal.inject.UpdaterException;
+import org.glassfish.jersey.client.inject.ParameterUpdater;
+
+
+/**
+ * Update value of the parameter using a single parameter value and the underlying
+ * {@link ParamConverter param converter}.
+ *
+ * @param <T> custom Java type.
+ * @author Paul Sandoz
+ * @author Marek Potociar
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+final class SingleValueUpdater<T> extends AbstractParamValueUpdater<T> implements ParameterUpdater<T, String> {
+
+ /**
+ * Create new single value updater.
+ *
+ * @param converter string value reader.
+ * @param parameterName string parameter name.
+ * @param defaultValue default value.
+ */
+ public SingleValueUpdater(final ParamConverter<T> converter, final String parameterName, final String defaultValue) {
+ super(converter, parameterName, defaultValue);
+ }
+
+ /**
+ * {@inheritDoc}
+ * <p/>
+ * This implementation updates the value of the parameter applying the underlying
+ * {@link ParamConverter param converter} to the first value found in the list of potential multiple
+ * parameter values. Any other values in the multi-value list will be ignored.
+ *
+ * @param parameters map of parameters.
+ * @return updated single parameter value.
+ */
+ @Override
+ public String update(final T value){
+ try {
+ if (value == null && isDefaultValueRegistered()) {
+ return getDefaultValueString();
+ } else {
+ return toString(value);
+ }
+ } catch (final WebApplicationException | ProcessingException ex) {
+ throw ex;
+ } catch (final IllegalArgumentException ex) {
+ return defaultValue();
+ } catch (final Exception ex) {
+ throw new UpdaterException(ex);
+ }
+ }
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/package-info.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/package-info.java
new file mode 100644
index 0000000..a6edca9
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 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
+ */
+
+/**
+ * Jersey client-side internal classes.
+ */
+package org.glassfish.jersey.client.internal;
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/routing/AbortedRequestMediaTypeDeterminer.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/routing/AbortedRequestMediaTypeDeterminer.java
new file mode 100644
index 0000000..7a36727
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/routing/AbortedRequestMediaTypeDeterminer.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2019 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.client.internal.routing;
+
+import org.glassfish.jersey.internal.routing.CombinedMediaType;
+import org.glassfish.jersey.internal.routing.ContentTypeDeterminer;
+import org.glassfish.jersey.internal.routing.RequestSpecificConsumesProducesAcceptor;
+import org.glassfish.jersey.internal.util.ReflectionHelper;
+import org.glassfish.jersey.message.MessageBodyWorkers;
+import org.glassfish.jersey.message.internal.AcceptableMediaType;
+
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Client side {@link Response} media type determinator utility class.
+ * Used for determining media type when {@link ClientRequestContext#abortWith(Response)} on
+ * {@link javax.ws.rs.client.ClientRequestFilter#filter(ClientRequestContext)} is used without specifying the response
+ * media type.
+ */
+public class AbortedRequestMediaTypeDeterminer extends ContentTypeDeterminer {
+
+ private static final AbortedRouting ABORTED_ROUTING = new AbortedRouting();
+
+ public AbortedRequestMediaTypeDeterminer(MessageBodyWorkers workers) {
+ super(workers);
+ }
+
+ /**
+ * Determine the {@link MediaType} of the {@link Response} based on writers suitable for the given entity instance.
+ *
+ * @param entity entity instance to determine the media type for
+ * @param acceptableMediaTypes acceptable media types from request.
+ * @return media type of the response.
+ */
+ public MediaType determineResponseMediaType(
+ final Object entity,
+ final List<AcceptableMediaType> acceptableMediaTypes) {
+
+ final GenericType type = ReflectionHelper.genericTypeFor(entity);
+ final CombinedMediaType wildcardType = CombinedMediaType.create(MediaType.WILDCARD_TYPE,
+ new CombinedMediaType.EffectiveMediaType(MediaType.WILDCARD_TYPE));
+ final RequestSpecificConsumesProducesAcceptor<AbortedRouting> selectedMethod =
+ new RequestSpecificConsumesProducesAcceptor<>(wildcardType, wildcardType, true, ABORTED_ROUTING);
+ // Media types producible by method.
+ final List<MediaType> methodProducesTypes = Collections.singletonList(MediaType.WILDCARD_TYPE);
+
+ return determineResponseMediaType(type.getRawType(), type.getType(), selectedMethod, acceptableMediaTypes,
+ methodProducesTypes, null);
+ }
+
+ /**
+ * An information that the routing aborted by {@code javax.ws.rs.client.ClientRequestContext#abortWith(Response)}.
+ */
+ private static final class AbortedRouting {
+
+ @Override
+ public String toString() {
+ return "{Aborted by ClientRequestFilter}";
+ }
+ }
+
+}
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/internal/routing/package-info.java b/core-client/src/main/java/org/glassfish/jersey/client/internal/routing/package-info.java
new file mode 100644
index 0000000..56ff6d6
--- /dev/null
+++ b/core-client/src/main/java/org/glassfish/jersey/client/internal/routing/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 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
+ */
+
+/**
+ * Jersey client-side internal routing API classes.
+ */
+package org.glassfish.jersey.client.internal.routing;
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/spi/AsyncConnectorCallback.java b/core-client/src/main/java/org/glassfish/jersey/client/spi/AsyncConnectorCallback.java
index f4d5e8e..7ffa36c 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/spi/AsyncConnectorCallback.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/spi/AsyncConnectorCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Asynchronous connector response processing callback contract.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface AsyncConnectorCallback {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/spi/CachingConnectorProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/spi/CachingConnectorProvider.java
index d30de4c..f66b326 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/spi/CachingConnectorProvider.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/spi/CachingConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
* instances that have significantly different connector-specific settings.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.10
*/
public class CachingConnectorProvider implements ConnectorProvider {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/spi/Connector.java b/core-client/src/main/java/org/glassfish/jersey/client/spi/Connector.java
index 8c8953b..b218f90 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/spi/Connector.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/spi/Connector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
* registered in {@link org.glassfish.jersey.client.ClientConfig}.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
// Must not be annotated with @Contract
public interface Connector extends Inflector<ClientRequest, ClientResponse> {
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/spi/ConnectorProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/spi/ConnectorProvider.java
index 6a8b81a..3b80d7d 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/spi/ConnectorProvider.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/spi/ConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* initializer method.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.5
*/
// Must not be annotated with @Contract
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/spi/DefaultSslContextProvider.java b/core-client/src/main/java/org/glassfish/jersey/client/spi/DefaultSslContextProvider.java
index 84dd5b4..4f8ab05 100644
--- a/core-client/src/main/java/org/glassfish/jersey/client/spi/DefaultSslContextProvider.java
+++ b/core-client/src/main/java/org/glassfish/jersey/client/spi/DefaultSslContextProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* <p>
* Can be used to override {@link SslConfigurator#getDefaultContext()}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @since 2.21.1
*/
public interface DefaultSslContextProvider {
diff --git a/core-client/src/main/resources/org/glassfish/jersey/client/internal/localization.properties b/core-client/src/main/resources/org/glassfish/jersey/client/internal/localization.properties
index 7e45210..1a70cb3 100644
--- a/core-client/src/main/resources/org/glassfish/jersey/client/internal/localization.properties
+++ b/core-client/src/main/resources/org/glassfish/jersey/client/internal/localization.properties
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2019 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
@@ -33,12 +33,14 @@
client.uri.template.null=URI template of the newly created target must not be null.
client.uri.null=URI of the newly created target must not be null.
client.uri.builder.null=URI builder of the newly created target must not be null.
+collection.updater.type.unsupported=Unsupported collection type.
digest.filter.qop.unsupported=The 'qop' (quality of protection) = {0} extension requested by the server is not supported by Jersey HttpDigestAuthFilter. Cannot authenticate against the server using Http Digest Authentication.
error.closing.output.stream=Error when closing the output stream.
error.committing.output.stream=Error while committing the request output stream.
error.digest.filter.generator=Error during initialization of random generator of Digest authentication.
error.http.method.entity.not.null=Entity must be null for http method {0}.
error.http.method.entity.null=Entity must not be null for http method {0}.
+error.parameter.type.processing=Could not process parameter type {0}.
error.service.locator.provider.instance.request=Incorrect type of request instance {0}. Parameter must be a default Jersey ClientRequestContext implementation.
error.service.locator.provider.instance.response=Incorrect type of response instance {0}. Parameter must be a default Jersey ClientResponseContext implementation.
ignored.async.threadpool.size=Zero or negative asynchronous thread pool size specified in the client configuration property: [{0}] \
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/ClientConfigTest.java b/core-client/src/test/java/org/glassfish/jersey/client/ClientConfigTest.java
index d1b5f89..4a20f78 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/ClientConfigTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/ClientConfigTest.java
@@ -45,7 +45,7 @@
/**
* {@link ClientConfig} unit test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ClientConfigTest {
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/ClientRequestTest.java b/core-client/src/test/java/org/glassfish/jersey/client/ClientRequestTest.java
index 6e47a41..d23b088 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/ClientRequestTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/ClientRequestTest.java
@@ -51,7 +51,7 @@
/**
* {@code ClientRequest} unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@RunWith(MockitoJUnitRunner.class)
public class ClientRequestTest {
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/ClientRxTest.java b/core-client/src/test/java/org/glassfish/jersey/client/ClientRxTest.java
index 263822d..cb0497a 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/ClientRxTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/ClientRxTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -43,7 +43,7 @@
/**
* Sanity test for {@link Invocation.Builder#rx()} methods.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ClientRxTest {
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/CustomConnectorTest.java b/core-client/src/test/java/org/glassfish/jersey/client/CustomConnectorTest.java
index 570e60c..17b83e7 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/CustomConnectorTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/CustomConnectorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -40,7 +40,7 @@
import static org.junit.Assert.assertThat;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CustomConnectorTest {
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/DefaultSslContextProviderTest.java b/core-client/src/test/java/org/glassfish/jersey/client/DefaultSslContextProviderTest.java
index b7483d9..d0ef2bd 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/DefaultSslContextProviderTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/DefaultSslContextProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -32,7 +32,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class DefaultSslContextProviderTest {
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/JerseyClientBuilderTest.java b/core-client/src/test/java/org/glassfish/jersey/client/JerseyClientBuilderTest.java
index b234e61..bb4a680 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/JerseyClientBuilderTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/JerseyClientBuilderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -16,12 +16,13 @@
package org.glassfish.jersey.client;
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.util.concurrent.TimeUnit;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import javax.annotation.Priority;
+import javax.net.ssl.SSLContext;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.ClientRequestContext;
@@ -29,16 +30,18 @@
import javax.ws.rs.core.Feature;
import javax.ws.rs.core.FeatureContext;
import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
-import javax.annotation.Priority;
-import javax.net.ssl.SSLContext;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
@@ -46,7 +49,7 @@
/**
* {@link JerseyClient} unit test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Michal Gajdos
*/
public class JerseyClientBuilderTest {
@@ -185,6 +188,7 @@
_testCreateClientWithAnotherConfig(true);
}
+
public void _testCreateClientWithAnotherConfig(final boolean clientInFilter) throws Exception {
final Client client = ClientBuilder.newBuilder().register(new ClientFeature()).build();
Response response = client.target("http://localhost")
@@ -209,6 +213,43 @@
}
@Test
+ public void testRegisterIrrelevantContractsMap() {
+ final ClientBuilder clientBuilder = ClientBuilder.newBuilder();
+ final Map<Class<?>, Integer> contracts = new HashMap<>();
+ contracts.put(Object.class, 500);
+ contracts.put(String.class, 501);
+ int sizeBeforeRegister = contracts.size();
+ clientBuilder.register(ClientConfigTest.MyProvider.class, contracts);
+ int sizeAfterRegister = contracts.size();
+
+ assertThat(sizeBeforeRegister, equalTo(sizeAfterRegister));
+ }
+
+ @Test
+ public void testRegisterNullMap() {
+ final ClientBuilder clientBuilder = ClientBuilder.newBuilder();
+ final Map<Class<?>, Integer> contracts = null;
+ clientBuilder.register(ClientConfigTest.MyProvider.class, contracts);
+
+ assertNull(contracts);
+ }
+
+ @Test(expected = Test.None.class) //no exception shall be thrown
+ public void testRegisterIrrelevantImmutableContractsMap() {
+ final ClientBuilder clientBuilder = ClientBuilder.newBuilder();
+ final Map<Class<?>, Integer> contracts = new HashMap<>();
+ contracts.put(Object.class, 500);
+ contracts.put(String.class, 501);
+ final Map<Class<?>, Integer> immutableContracts = Collections.unmodifiableMap(contracts);
+ int sizeBeforeRegister = immutableContracts.size();
+ clientBuilder.register(ClientConfigTest.MyProvider.class, immutableContracts);
+ int sizeAfterRegister = immutableContracts.size(); //that just proves everything passed OK
+ // otherwise exception already would been thrown
+
+ assertThat(sizeBeforeRegister, equalTo(sizeAfterRegister));
+ }
+
+ @Test
public void testNegativeConnectTimeout() {
ClientBuilder clientBuilder = ClientBuilder.newBuilder();
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/JerseyClientTest.java b/core-client/src/test/java/org/glassfish/jersey/client/JerseyClientTest.java
index a3aa578..8a851f6 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/JerseyClientTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/JerseyClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -54,7 +54,7 @@
/**
* {@link JerseyClient} unit test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JerseyClientTest {
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvokerTest.java b/core-client/src/test/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvokerTest.java
index 56d763f..cf3ba57 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvokerTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/JerseyCompletionStageRxInvokerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -41,7 +41,7 @@
import static org.hamcrest.core.Is.is;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class JerseyCompletionStageRxInvokerTest {
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/ShutdownHookLeakTest.java b/core-client/src/test/java/org/glassfish/jersey/client/ShutdownHookLeakTest.java
index d92fec7..ff88ab8 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/ShutdownHookLeakTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/ShutdownHookLeakTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -32,7 +32,7 @@
/**
* Reproducer for JERSEY-2786.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ShutdownHookLeakTest {
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/filter/EncodingFilterTest.java b/core-client/src/test/java/org/glassfish/jersey/client/filter/EncodingFilterTest.java
index 66dfc48..4d1fe39 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/filter/EncodingFilterTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/filter/EncodingFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -53,7 +53,7 @@
* Client-side content encoding filter unit tests.
*
* @author Martin Matula
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class EncodingFilterTest {
@Test
diff --git a/core-client/src/test/java/org/glassfish/jersey/client/spi/CachingConnectorProviderTest.java b/core-client/src/test/java/org/glassfish/jersey/client/spi/CachingConnectorProviderTest.java
index c3ea160..d4f9363 100644
--- a/core-client/src/test/java/org/glassfish/jersey/client/spi/CachingConnectorProviderTest.java
+++ b/core-client/src/test/java/org/glassfish/jersey/client/spi/CachingConnectorProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -35,7 +35,7 @@
/**
* Caching connector provider unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CachingConnectorProviderTest {
public static class ReferenceCountingNullConnector implements Connector, ConnectorProvider {
diff --git a/core-common/pom.xml b/core-common/pom.xml
index f4ad864..7bc9dd5 100644
--- a/core-common/pom.xml
+++ b/core-common/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.core</groupId>
@@ -127,11 +127,11 @@
<Import-Package>
sun.misc.*;resolution:=optional,
javax.activation.*;version="!",
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
*
</Import-Package>
<Export-Package>org.glassfish.jersey.*;version=${project.version}</Export-Package>
- <Private-Package>org.glassfish.jersey.osgi</Private-Package>
+ <Require-Capability>osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"</Require-Capability>
</instructions>
<unpackBundle>true</unpackBundle>
</configuration>
@@ -191,11 +191,6 @@
</dependency>
<dependency>
- <!-- Must be declared before JUnit dependency, otherwise not visible to JUnit. -->
- <groupId>org.jmockit</groupId>
- <artifactId>jmockit</artifactId>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -209,6 +204,452 @@
<profiles>
<profile>
+ <id>jdk8</id>
+ <activation>
+ <jdk>1.8</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/main/jsr166</source>
+ <source>src/main/java8</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.8.0</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <echo>Building for JDK8</echo>
+ </target>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- need to compile this to be able to compile-2-java8 -->
+ <id>compile-1-jsr166</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <javac srcdir="${jsr166.sourceDirectory}" destdir="${project.build.outputDirectory}"
+ classpath="${project.build.outputDirectory}" includeantruntime="false" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <!-- Compile these files with jdk 8 and put them aside to be included in multirelase jar -->
+ <!-- Multi-release jar is built by jdk 11+, but these classes are buildable by jdk 8 only -->
+ <id>compile-2-java8</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${java8.build.outputDirectory}" />
+ <javac srcdir="${java8.sourceDirectory}" destdir="${java8.build.outputDirectory}"
+ classpath="${project.build.outputDirectory}" includeantruntime="false" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.activation</groupId>
+ <artifactId>jakarta.activation</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <echo>Building for JDK 11+</echo>
+ </target>
+ </configuration>
+ </execution>
+ <execution>
+ <id>compile-1-jsr166</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <javac srcdir="${jsr166.sourceDirectory}" destdir="${project.build.outputDirectory}"
+ classpath="${project.build.outputDirectory}" includeantruntime="false" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <!-- build these java 11 specific classes to be put to META-INF/versions/11 later -->
+ <id>compile-2-java11</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${java11.build.outputDirectory}" />
+ <javac srcdir="${java11.sourceDirectory}" destdir="${java11.build.outputDirectory}"
+ classpath="${project.build.outputDirectory}" includeantruntime="false" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>compile-0-addsources</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/main/jsr166</source>
+ <source>src/main/java11</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-compile</id>
+ <configuration>
+ <!-- compile everything to ensure module-info contains right entries -->
+ <release>11</release>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>copyJDK11FilesToMultiReleaseJar</id>
+ <activation>
+ <file>
+ <!-- ${java11.build.outputDirectory} does not work here -->
+ <exists>target/classes-java11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.class</exists>
+ </file>
+ <jdk>1.8</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <inherited>true</inherited>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Multi-Release>true</Multi-Release>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <!-- only one file set per execution works -->
+ <executions>
+ <execution>
+ <id>remove-jdk11-generated-sources</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <configuration>
+ <excludeDefaultDirectories>true</excludeDefaultDirectories>
+ <filesets>
+ <fileset>
+ <directory>${project.build.directory}/generated-sources</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </execution>
+ <execution>
+ <id>remove-jdk11-classes</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <configuration>
+ <excludeDefaultDirectories>true</excludeDefaultDirectories>
+ <filesets>
+ <fileset>
+ <directory>${project.build.directory}/classes</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>copy-jdk11-sources</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/generated-sources/rsrc-gen/META-INF/versions/11/org/glassfish/jersey/internal/jsr166</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${java11.sourceDirectory}/org/glassfish/jersey/internal/jsr166</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-jdk11-classes-to-meta-inf</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${java11.build.outputDirectory}</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>copyJDK8FilesToMultiReleaseJar</id>
+ <activation>
+ <file>
+ <!-- ${java8.build.outputDirectory} does not work here -->
+ <exists>target/classes-java8/org/glassfish/jersey/internal/jsr166/UnsafeAccessor.class</exists>
+ </file>
+ <jdk>[11,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <inherited>true</inherited>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Multi-Release>true</Multi-Release>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <!-- only one file set per execution works -->
+ <executions>
+ <execution>
+ <id>remove-jdk11-jsr166-sources</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <configuration>
+ <excludeDefaultDirectories>true</excludeDefaultDirectories>
+ <filesets>
+ <fileset>
+ <directory>${project.build.directory}/generated-sources/rsrc-gen/org/glassfish/jersey/internal/jsr166</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </execution>
+ <execution>
+ <id>remove-jdk11-jsr166-META-INF-sources</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <configuration>
+ <excludeDefaultDirectories>true</excludeDefaultDirectories>
+ <filesets>
+ <fileset>
+ <directory>${project.build.directory}/generated-sources/rsrc-gen/META-INF</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </execution>
+ <execution>
+ <id>remove-jdk11-jsr166-classes</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <configuration>
+ <excludeDefaultDirectories>true</excludeDefaultDirectories>
+ <filesets>
+ <fileset>
+ <directory>${project.build.outputDirectory}/org/glassfish/jersey/internal/jsr166</directory>
+ <includes>
+ <include>*.class</include>
+ </includes>
+ <excludes>
+ <exclude>Flow*.class</exclude>
+ <exclude>SubmittableFlowPublisher.class</exclude>
+ <exclude>package-info.class</exclude>
+ </excludes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>copy-jdk8-classes-ouputDirectory</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${java8.build.outputDirectory}</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-jdk8-sources</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/generated-sources/rsrc-gen/org/glassfish/jersey/internal/jsr166</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${java8.sourceDirectory}/org/glassfish/jersey/internal/jsr166</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-jdk11-sources</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/generated-sources/rsrc-gen/META-INF/versions/11/org/glassfish/jersey/internal/jsr166</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${java11.sourceDirectory}/org/glassfish/jersey/internal/jsr166</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-jdk11-classes-to-meta-inf</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${java11.build.outputDirectory}</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>3.0.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>org/glassfish/jersey/internal/jsr166/Jdk9SubmissionPublisher.java</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
<id>securityOff</id>
<properties>
<surefire.security.argline />
@@ -249,6 +690,11 @@
<properties>
<surefire.security.argline>-Djava.security.manager -Djava.security.policy=${project.build.directory}/test-classes/surefire.policy</surefire.security.argline>
+ <jsr166.sourceDirectory>${project.basedir}/src/main/jsr166</jsr166.sourceDirectory>
+ <java8.build.outputDirectory>${project.build.directory}/classes-java8</java8.build.outputDirectory>
+ <java8.sourceDirectory>${project.basedir}/src/main/java8</java8.sourceDirectory>
+ <java11.build.outputDirectory>${project.build.directory}/classes-java11</java11.build.outputDirectory>
+ <java11.sourceDirectory>${project.basedir}/src/main/java11</java11.sourceDirectory>
</properties>
</project>
diff --git a/core-common/src/main/java/org/glassfish/jersey/Beta.java b/core-common/src/main/java/org/glassfish/jersey/Beta.java
index b855978..9ea9ff6 100644
--- a/core-common/src/main/java/org/glassfish/jersey/Beta.java
+++ b/core-common/src/main/java/org/glassfish/jersey/Beta.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -47,7 +47,7 @@
* will be removed from such API and the API will become part of a stable public Jersey API.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Retention(RetentionPolicy.CLASS)
@Documented
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 3218d3b..8001bd5 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, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
* Common (server/client) Jersey configuration properties.
*
* @author Michal Gajdos
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@PropertiesClass
public final class CommonProperties {
@@ -217,6 +217,17 @@
public static final String OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER = "jersey.config.server.contentLength.buffer";
/**
+ * Property which allows (if true) default System properties configuration provider.
+ *
+ * Effective if there are no any external properties providers
+ *
+ * Shall be set (if used) in system properties.
+ * @since 2.29
+ */
+
+ public static final String ALLOW_SYSTEM_PROPERTIES_PROVIDER = "jersey.config.allowSystemPropertiesProvider";
+
+ /**
* Prevent instantiation.
*/
private CommonProperties() {
diff --git a/core-common/src/main/java/org/glassfish/jersey/ExtendedConfig.java b/core-common/src/main/java/org/glassfish/jersey/ExtendedConfig.java
index ca0c24f..12e6840 100644
--- a/core-common/src/main/java/org/glassfish/jersey/ExtendedConfig.java
+++ b/core-common/src/main/java/org/glassfish/jersey/ExtendedConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Extended common runtime configuration.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface ExtendedConfig extends Configuration {
diff --git a/core-common/src/main/java/org/glassfish/jersey/JerseyPriorities.java b/core-common/src/main/java/org/glassfish/jersey/JerseyPriorities.java
index a35a764..e8a4d57 100644
--- a/core-common/src/main/java/org/glassfish/jersey/JerseyPriorities.java
+++ b/core-common/src/main/java/org/glassfish/jersey/JerseyPriorities.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
* Built-in Jersey-specific priority constants to be used along with {@link javax.ws.rs.Priorities} where finer-grained
* categorization is required.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class JerseyPriorities {
diff --git a/core-common/src/main/java/org/glassfish/jersey/SslConfigurator.java b/core-common/src/main/java/org/glassfish/jersey/SslConfigurator.java
index 1f03bfc..1bf2647 100644
--- a/core-common/src/main/java/org/glassfish/jersey/SslConfigurator.java
+++ b/core-common/src/main/java/org/glassfish/jersey/SslConfigurator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2019 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
@@ -65,7 +65,7 @@
* @author Alexey Stashok
* @author Hubert Iwaniuk
* @author Bruno Harbulot
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@SuppressWarnings("UnusedDeclaration")
public final class SslConfigurator {
diff --git a/core-common/src/main/java/org/glassfish/jersey/inject/spi/BinderConfigurationFactory.java b/core-common/src/main/java/org/glassfish/jersey/inject/spi/BinderConfigurationFactory.java
new file mode 100644
index 0000000..c42c2b4
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/inject/spi/BinderConfigurationFactory.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2019 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.inject.spi;
+
+import org.glassfish.jersey.internal.inject.InjectionManager;
+import org.glassfish.jersey.model.ContractProvider;
+
+import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+/**
+ * Factory class creating instances of {@link BinderConfiguration} classes used to configure Binders registered
+ * to a configuration. While it is created for a backward compatibility with HK2 {@code AbstractBinder} to be
+ * able to be registered to a configuration (while HK2 injection module is on the classpath), a factory
+ * implementing this interface is used for registering Jersey {@code AbstractBinder}, too.
+ *
+ * @since 2.29
+ */
+public interface BinderConfigurationFactory {
+
+ /**
+ * Creates a {@link BinderConfiguration} instance that has a reference to {@code getInstances} function returning all
+ * registered instances filtered by provided {@link Predicate<ContractProvider>} that can be further traversed and configured.
+ *
+ * @param getInstances a function returning filtered instances registered to a configuration. The
+ * {@link Predicate<ContractProvider>} is used to filter out all the instances not to be further processed by the
+ * {@link BinderConfiguration}.
+ * @return {@link BinderConfiguration} instance used to register/configure the provided filtered instances.
+ */
+ BinderConfiguration createBinderConfiguration(Function<Predicate<ContractProvider>, Set<Object>> getInstances);
+
+ /**
+ * This configuration object configure all the instances provided by the {@code getInstances} function passed from the
+ * factory {@link BinderConfigurationFactory#createBinderConfiguration(Function)} method.
+ * <p>
+ * The implementation possibly can hold a list of already configured {@code Binders} so that consecutive calls do
+ * not register the already registered {@code Binders} again.
+ */
+ interface BinderConfiguration {
+ /**
+ * The provided {@code getInstances} function is used to get registered (filtered) instances in a
+ * {@link javax.ws.rs.core.Configuration}
+ *
+ * @param injectionManager {@link InjectionManager} to be used to configure the {@code Binder}
+ * @return {@code true} if a {@code Binder} has been configured.
+ */
+ boolean configureBinders(InjectionManager injectionManager);
+ }
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/inject/spi/package-info.java b/core-common/src/main/java/org/glassfish/jersey/inject/spi/package-info.java
new file mode 100644
index 0000000..11ec894
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/inject/spi/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 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
+ */
+
+/**
+ * Common Jersey core injection SPI classes.
+ */
+package org.glassfish.jersey.inject.spi;
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/ContextResolverFactory.java b/core-common/src/main/java/org/glassfish/jersey/internal/ContextResolverFactory.java
index aa97add..66f1c9f 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/ContextResolverFactory.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/ContextResolverFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -41,7 +41,7 @@
* A factory implementation for managing {@link ContextResolver} instances.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ContextResolverFactory implements ContextResolvers {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/ExceptionMapperFactory.java b/core-common/src/main/java/org/glassfish/jersey/internal/ExceptionMapperFactory.java
index aff86bd..f73602c 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/ExceptionMapperFactory.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/ExceptionMapperFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -51,8 +51,8 @@
*
* @author Paul Sandoz
* @author Santiago Pericas-Geertsen (Santiago.PericasGeertsen at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Marek Potociar
+ * @author Jakub Podlesak
*/
public class ExceptionMapperFactory implements ExceptionMappers {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/JaxrsProviders.java b/core-common/src/main/java/org/glassfish/jersey/internal/JaxrsProviders.java
index 519b1e5..5b97317 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/JaxrsProviders.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/JaxrsProviders.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -39,7 +39,7 @@
/**
* Jersey implementation of JAX-RS {@link Providers} contract.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JaxrsProviders implements Providers {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/MapPropertiesDelegate.java b/core-common/src/main/java/org/glassfish/jersey/internal/MapPropertiesDelegate.java
index 5da1992..89906e7 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/MapPropertiesDelegate.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/MapPropertiesDelegate.java
@@ -24,7 +24,7 @@
/**
* Properties delegate backed by a {@code Map}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class MapPropertiesDelegate implements PropertiesDelegate {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/OsgiRegistry.java b/core-common/src/main/java/org/glassfish/jersey/internal/OsgiRegistry.java
index 846e133..ada9081 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/OsgiRegistry.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/OsgiRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -66,8 +66,8 @@
* via the OSGi Bundle API as direct ClassLoader#getResource() method invocation
* does not work in this case within OSGi.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Jakub Podlesak
+ * @author Adam Lindenthal
*/
public final class OsgiRegistry implements SynchronousBundleListener {
@@ -307,7 +307,7 @@
: packagePath + bundleEntryPath.substring(bundleEntryPath.lastIndexOf('/') + 1);
return (normalizedClassNamePath.startsWith("/") ? normalizedClassNamePath.substring(1) : normalizedClassNamePath)
- .replace('/', '.').replace(".class", "");
+ .replace(".class", "").replace('/', '.');
}
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/PropertiesDelegate.java b/core-common/src/main/java/org/glassfish/jersey/internal/PropertiesDelegate.java
index 1d89e28..fcd0a88 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/PropertiesDelegate.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/PropertiesDelegate.java
@@ -21,7 +21,7 @@
/**
* TODO: javadoc.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface PropertiesDelegate {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/RuntimeDelegateImpl.java b/core-common/src/main/java/org/glassfish/jersey/internal/RuntimeDelegateImpl.java
index e1be9bc..40d49d8 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/RuntimeDelegateImpl.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/RuntimeDelegateImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -33,7 +33,7 @@
* method.
*
* @author Jakub Podlesak
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
*/
public class RuntimeDelegateImpl extends AbstractRuntimeDelegate {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/ServiceConfigurationError.java b/core-common/src/main/java/org/glassfish/jersey/internal/ServiceConfigurationError.java
index fa3c542..d777c7a 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/ServiceConfigurationError.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/ServiceConfigurationError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -28,7 +28,7 @@
* </ul>
*
* @author Mark Reinhold
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ServiceConfigurationError extends Error {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/ServiceFinderBinder.java b/core-common/src/main/java/org/glassfish/jersey/internal/ServiceFinderBinder.java
index cc0da5e..84bf1d4 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/ServiceFinderBinder.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/ServiceFinderBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -31,8 +31,8 @@
* and registers found instances to {@link InjectionManager}.
*
* @param <T> contract type.
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Libor Kramolis
*/
public class ServiceFinderBinder<T> extends AbstractBinder {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesAutoDiscoverable.java b/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesAutoDiscoverable.java
new file mode 100644
index 0000000..e7d0adc
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesAutoDiscoverable.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2019 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.internal.config;
+
+import org.glassfish.jersey.internal.spi.AutoDiscoverable;
+
+import javax.annotation.Priority;
+import javax.ws.rs.ConstrainedTo;
+import javax.ws.rs.RuntimeType;
+import javax.ws.rs.core.FeatureContext;
+
+@ConstrainedTo(RuntimeType.CLIENT) //server is configured directly in ResourceConfig
+@Priority(AutoDiscoverable.DEFAULT_PRIORITY)
+public class ExternalPropertiesAutoDiscoverable implements AutoDiscoverable {
+ @Override
+ public void configure(FeatureContext context) {
+ if (!context.getConfiguration().isRegistered(ExternalPropertiesConfigurationFeature.class)) {
+ context.register(ExternalPropertiesConfigurationFeature.class);
+ }
+ }
+}
\ No newline at end of file
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactory.java b/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactory.java
new file mode 100644
index 0000000..35ca77a
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactory.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2019 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.internal.config;
+
+import org.glassfish.jersey.internal.ServiceFinder;
+import org.glassfish.jersey.spi.ExternalConfigurationModel;
+import org.glassfish.jersey.spi.ExternalConfigurationProvider;
+
+import javax.annotation.Priority;
+import javax.ws.rs.Priorities;
+import javax.ws.rs.core.Configurable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+/**
+ * Factory for external properties providers
+ * Offers methods to work with properties loaded from providers or
+ * just configure Jersey's Configurables with loaded properties from providers
+ */
+public class ExternalPropertiesConfigurationFactory {
+
+ private static final List<ExternalConfigurationProvider> EXTERNAL_CONFIGURATION_PROVIDERS =
+ getExternalConfigurations();
+
+
+ /**
+ * Map of merged properties from all found providers
+ *
+ * @return map of merged properties from all found/plugged providers
+ */
+ static Map<String, Object> readExternalPropertiesMap() {
+
+ final ExternalConfigurationProvider provider = mergeConfigs(EXTERNAL_CONFIGURATION_PROVIDERS);
+ return provider == null ? Collections.emptyMap() : provider.getProperties();
+ }
+
+
+ /**
+ * Input Configurable object shall be provided in order to be filled with all found properties
+ *
+ * @param config Input Configurable initialised object to be filled with properties
+ * @return true if configured false otherwise
+ */
+
+ public static boolean configure(Configurable config) {
+
+ if (config instanceof ExternalConfigurationModel) {
+ return false; //shall not configure itself
+ }
+
+ final Map<String, Object> properties = readExternalPropertiesMap();
+
+ properties.forEach((k, v) -> config.property(k, v));
+
+ return true;
+ }
+
+ /**
+ * Merged config model from all found configuration models
+ *
+ * @return merged Model object with all properties
+ */
+ static ExternalConfigurationModel getConfig() {
+ final ExternalConfigurationProvider provider = mergeConfigs(getExternalConfigurations());
+ return provider == null ? null : provider.getConfiguration();
+ }
+
+ /**
+ * List of all found models as they are found by Jersey
+ *
+ * @return list of models (or empty list)
+ */
+ private static List<ExternalConfigurationProvider> getExternalConfigurations() {
+ final List<ExternalConfigurationProvider> providers = new ArrayList<>();
+ final ServiceFinder<ExternalConfigurationProvider> finder =
+ ServiceFinder.find(ExternalConfigurationProvider.class);
+ if (finder.iterator().hasNext()) {
+ finder.forEach(providers::add);
+ } else {
+ providers.add(new SystemPropertiesConfigurationProvider());
+ }
+ return providers;
+ }
+
+ private static ExternalConfigurationProvider mergeConfigs(List<ExternalConfigurationProvider> configurations) {
+ final Set<ExternalConfigurationProvider> orderedConfigurations = orderConfigs(configurations);
+ final Iterator<ExternalConfigurationProvider> configurationIterator = orderedConfigurations.iterator();
+ if (!configurationIterator.hasNext()) {
+ return null;
+ }
+ final ExternalConfigurationProvider firstConfig = configurationIterator.next();
+ while (configurationIterator.hasNext()) {
+ final ExternalConfigurationProvider nextConfig = configurationIterator.next();
+ firstConfig.merge(nextConfig.getConfiguration());
+ }
+
+ return firstConfig;
+ }
+
+ private static Set<ExternalConfigurationProvider> orderConfigs(List<ExternalConfigurationProvider> configurations) {
+
+ final SortedSet<ExternalConfigurationProvider> sortedSet = new TreeSet<>(new ConfigComparator());
+ sortedSet.addAll(configurations);
+ return Collections.unmodifiableSortedSet(sortedSet);
+ }
+
+ private static class ConfigComparator implements Comparator<ExternalConfigurationProvider> {
+
+ @Override
+ public int compare(ExternalConfigurationProvider config1, ExternalConfigurationProvider config2) {
+
+ boolean config1PriorityPresent = config1.getClass().isAnnotationPresent(Priority.class);
+ boolean config2PriorityPresent = config2.getClass().isAnnotationPresent(Priority.class);
+
+ int priority1 = Priorities.USER;
+ int priority2 = Priorities.USER;
+
+ if (config1PriorityPresent) {
+ priority1 = config1.getClass().getAnnotation(Priority.class).value();
+ }
+ if (config2PriorityPresent) {
+ priority2 = config2.getClass().getAnnotation(Priority.class).value();
+ }
+
+ if (priority1 == priority2) {
+ return config1.getClass().getName().compareTo(config2.getClass().getName());
+ }
+ return Integer.compare(priority1, priority2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFeature.java b/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFeature.java
new file mode 100644
index 0000000..acdab23
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFeature.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2019 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.internal.config;
+
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
+
+public class ExternalPropertiesConfigurationFeature implements Feature {
+
+ @Override
+ public boolean configure(FeatureContext configurableContext) {
+ return ExternalPropertiesConfigurationFactory.configure(configurableContext);
+ }
+
+}
\ No newline at end of file
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/config/SystemPropertiesConfigurationModel.java b/core-common/src/main/java/org/glassfish/jersey/internal/config/SystemPropertiesConfigurationModel.java
new file mode 100644
index 0000000..3c0fd7a
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/config/SystemPropertiesConfigurationModel.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2019 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.internal.config;
+
+import org.glassfish.jersey.CommonProperties;
+import org.glassfish.jersey.internal.LocalizationMessages;
+import org.glassfish.jersey.internal.util.PropertiesHelper;
+import org.glassfish.jersey.internal.util.ReflectionHelper;
+import org.glassfish.jersey.spi.ExternalConfigurationModel;
+
+import javax.ws.rs.RuntimeType;
+import javax.ws.rs.core.Feature;
+import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.logging.Logger;
+
+
+class SystemPropertiesConfigurationModel implements ExternalConfigurationModel<Void> {
+
+ private static final Logger log = Logger.getLogger(SystemPropertiesConfigurationModel.class.getName());
+
+
+ private static final Map<Class, Function> converters = new HashMap<>();
+ static {
+ converters.put(String.class, (Function<String, String>) s -> s);
+ converters.put(Integer.class, (Function<String, Integer>) s -> Integer.valueOf(s));
+ converters.put(Boolean.class, (Function<String, Boolean>) s -> s.equalsIgnoreCase("1")
+ ? true
+ : Boolean.parseBoolean(s));
+ }
+
+ private String getSystemProperty(String name) {
+ return AccessController.doPrivileged(PropertiesHelper.getSystemProperty(name));
+ }
+
+ @Override
+ public <T> T as(String name, Class<T> clazz) {
+ if (converters.get(clazz) == null) {
+ throw new IllegalArgumentException("Unsupported class type");
+ }
+ return (name != null && clazz != null && isProperty(name))
+ ? clazz.cast(converters.get(clazz).apply(getSystemProperty(name)))
+ : null;
+ }
+
+
+
+ @Override
+ public <T> Optional<T> getOptionalProperty(String name, Class<T> clazz) {
+ return Optional.of(as(name, clazz));
+ }
+
+ @Override
+ public ExternalConfigurationModel mergeProperties(Map<String, Object> inputProperties) {
+ return this;
+ }
+
+ @Override
+ public Void getConfig() {
+ return null;
+ }
+
+ @Override
+ public boolean isProperty(String name) {
+ return Optional.ofNullable(
+ AccessController.doPrivileged(
+ PropertiesHelper.getSystemProperty(name)
+ )
+ ).isPresent();
+ }
+
+ @Override
+ public RuntimeType getRuntimeType() {
+ return null;
+ }
+
+ @Override
+ public Map<String, Object> getProperties() {
+ final Map<String, Object> result = new HashMap<>();
+
+ final Boolean allowSystemPropertiesProvider = as(
+ CommonProperties.ALLOW_SYSTEM_PROPERTIES_PROVIDER, Boolean.class
+ );
+ if (!Boolean.TRUE.equals(allowSystemPropertiesProvider)) {
+ log.finer(LocalizationMessages.WARNING_PROPERTIES());
+ return result;
+ }
+
+ try {
+ AccessController.doPrivileged(PropertiesHelper.getSystemProperties())
+ .forEach((k, v) -> result.put(String.valueOf(k), v));
+ } catch (SecurityException se) {
+ log.warning(LocalizationMessages.SYSTEM_PROPERTIES_WARNING());
+ return getExpectedSystemProperties();
+ }
+ return result;
+ }
+
+ private Map<String, Object> getExpectedSystemProperties() {
+
+
+ final Map<String, Object> result = new HashMap<>();
+
+ mapFieldsToProperties(result, CommonProperties.class);
+
+
+
+ mapFieldsToProperties(result,
+ AccessController.doPrivileged(
+ ReflectionHelper.classForNamePA("org.glassfish.jersey.server.ServerProperties")
+ )
+ );
+
+ mapFieldsToProperties(result,
+ AccessController.doPrivileged(
+ ReflectionHelper.classForNamePA("org.glassfish.jersey.client.ClientProperties")
+ )
+ );
+
+
+ return result;
+ }
+
+ private <T> void mapFieldsToProperties(Map<String, Object> properties, Class<T> clazz) {
+ if (clazz == null) {
+ return;
+ }
+
+ final Field[] fields = AccessController.doPrivileged(
+ ReflectionHelper.getDeclaredFieldsPA(clazz)
+ );
+
+ for (final Field field : fields) {
+ if (field.getType().isAssignableFrom(String.class)) {
+ final String propertyValue = getPropertyNameByField(field);
+ properties.put(propertyValue, PropertiesHelper.getSystemProperty(propertyValue));
+ }
+ }
+ }
+
+ private String getPropertyNameByField(Field field) {
+ return AccessController.doPrivileged((PrivilegedAction<String>) () -> {
+ try {
+ return (String) field.get(null);
+ } catch (IllegalAccessException e) {
+ log.warning(e.getLocalizedMessage());
+ }
+ return null;
+ });
+ }
+
+ @Override
+ public Object getProperty(String name) {
+ return getSystemProperty(name);
+ }
+
+ @Override
+ public Collection<String> getPropertyNames() {
+ return PropertiesHelper.getSystemProperties().run().stringPropertyNames();
+ }
+
+ @Override
+ public boolean isEnabled(Feature feature) {
+ return false;
+ }
+
+ @Override
+ public boolean isEnabled(Class<? extends Feature> featureClass) {
+ return false;
+ }
+
+ @Override
+ public boolean isRegistered(Object component) {
+ return false;
+ }
+
+ @Override
+ public boolean isRegistered(Class<?> componentClass) {
+ return false;
+ }
+
+ @Override
+ public Map<Class<?>, Integer> getContracts(Class<?> componentClass) {
+ return null;
+ }
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ return null;
+ }
+
+ @Override
+ public Set<Object> getInstances() {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/config/SystemPropertiesConfigurationProvider.java b/core-common/src/main/java/org/glassfish/jersey/internal/config/SystemPropertiesConfigurationProvider.java
new file mode 100644
index 0000000..145f5f7
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/config/SystemPropertiesConfigurationProvider.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2019 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.internal.config;
+
+import org.glassfish.jersey.spi.ExternalConfigurationModel;
+import org.glassfish.jersey.spi.ExternalConfigurationProvider;
+
+import java.util.Map;
+
+class SystemPropertiesConfigurationProvider implements ExternalConfigurationProvider {
+
+ private final SystemPropertiesConfigurationModel model = new SystemPropertiesConfigurationModel();
+ @Override
+ public Map<String, Object> getProperties() {
+ return model.getProperties();
+ }
+
+ @Override
+ public ExternalConfigurationModel getConfiguration() {
+ return model;
+ }
+
+ @Override
+ public ExternalConfigurationModel merge(ExternalConfigurationModel input) {
+ return input == null ? model : model.mergeProperties(input.getProperties());
+ }
+
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/config/package-info.java b/core-common/src/main/java/org/glassfish/jersey/internal/config/package-info.java
new file mode 100644
index 0000000..21206bd
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/config/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 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
+ */
+
+/**
+ * Configuration factory to handle external properties from different config SPI implementations
+ *
+ * @since 2.29
+ */
+package org.glassfish.jersey.internal.config;
\ No newline at end of file
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Custom.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Custom.java
index 0b315d7..938ef2e 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Custom.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Custom.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -41,7 +41,7 @@
* </p>
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see org.glassfish.jersey.internal.inject.CustomAnnotationLiteral
*/
@Qualifier
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/CustomAnnotationLiteral.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/CustomAnnotationLiteral.java
index 6e47ed8..e76892c 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/CustomAnnotationLiteral.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/CustomAnnotationLiteral.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
* in method calls that require use of annotation instances.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@SuppressWarnings("ClassExplicitlyAnnotation")
public final class CustomAnnotationLiteral extends AnnotationLiteral<Custom> implements Custom {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ForeignRequestScopeBridge.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ForeignRequestScopeBridge.java
index dabbe13..774bd07 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ForeignRequestScopeBridge.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ForeignRequestScopeBridge.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
* factory created components managed by 3rd party component
* providers
*
- * Jakub Podlesak (jakub.podlesak at oracle.com).
+ * Jakub Podlesak.
*/
public interface ForeignRequestScopeBridge {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Injections.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Injections.java
index 90b2f1b..d2ff00d 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Injections.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Injections.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
* Injection binding utility methods.
*
* @author Tom Beerbower
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class Injections {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/JerseyBinderConfigurationFactory.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/JerseyBinderConfigurationFactory.java
new file mode 100644
index 0000000..78a3901
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/JerseyBinderConfigurationFactory.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2019 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.internal.inject;
+
+import org.glassfish.jersey.inject.spi.BinderConfigurationFactory;
+import org.glassfish.jersey.model.ContractProvider;
+import org.glassfish.jersey.model.internal.ComponentBag;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.IdentityHashMap;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+/**
+ * An implementation of {@link BinderConfigurationFactory} used to configure {@link Binder} instances.
+ */
+public class JerseyBinderConfigurationFactory implements BinderConfigurationFactory {
+
+ @Override
+ public BinderConfiguration createBinderConfiguration(Function<Predicate<ContractProvider>, Set<Object>> getInstances) {
+ return new JerseyBinderConfiguration(getInstances);
+ }
+
+ private static class JerseyBinderConfiguration implements BinderConfiguration {
+ private Set<Binder> configuredBinders = Collections.emptySet();
+ private final Function<Predicate<ContractProvider>, Set<Object>> getInstances;
+ private static final Function<Object, Binder> CAST_TO_BINDER = Binder.class::cast;
+
+ private JerseyBinderConfiguration(Function<Predicate<ContractProvider>, Set<Object>> getInstances) {
+ this.getInstances = getInstances;
+ }
+
+ @Override
+ public boolean configureBinders(InjectionManager injectionManager) {
+ configuredBinders = configureBinders(injectionManager, configuredBinders);
+ return !configuredBinders.isEmpty();
+ }
+
+ private Set<Binder> configureBinders(InjectionManager injectionManager, Set<Binder> configured) {
+ Set<Binder> allConfigured = Collections.newSetFromMap(new IdentityHashMap<>());
+ allConfigured.addAll(configured);
+
+ Collection<Binder> binders = getBinder(configured);
+ if (!binders.isEmpty()) {
+ injectionManager.register(CompositeBinder.wrap(binders));
+ allConfigured.addAll(binders);
+ }
+
+ return allConfigured;
+ }
+
+ private Collection<Binder> getBinder(Set<Binder> configured) {
+ return getInstances
+ .apply(ComponentBag.BINDERS_ONLY)
+ .stream()
+ .map(CAST_TO_BINDER)
+ .filter(binder -> !configured.contains(binder))
+ .collect(Collectors.toList());
+ }
+ }
+}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterConfigurator.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java
similarity index 86%
rename from core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterConfigurator.java
rename to core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java
index 29f97e4..477d918 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterConfigurator.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterConfigurator.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -14,15 +15,12 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package org.glassfish.jersey.server.internal.inject;
+package org.glassfish.jersey.internal.inject;
import javax.ws.rs.ext.ParamConverterProvider;
import org.glassfish.jersey.internal.BootstrapBag;
import org.glassfish.jersey.internal.BootstrapConfigurator;
-import org.glassfish.jersey.internal.inject.Bindings;
-import org.glassfish.jersey.internal.inject.InjectionManager;
-import org.glassfish.jersey.internal.inject.InstanceBinding;
/**
* Configurator which initializes and register {@link ParamConverters.AggregatedProvider} instances into {@link InjectionManager}.
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java
similarity index 88%
rename from core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java
rename to core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java
index 2d8afd0..5fcd853 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverterFactory.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -14,7 +15,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package org.glassfish.jersey.server.internal.inject;
+package org.glassfish.jersey.internal.inject;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
@@ -22,12 +23,10 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-
+import javax.inject.Singleton;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
-import javax.inject.Singleton;
-
/**
* An aggregate {@link ParamConverterProvider param converter provider} that loads all
* the registered {@link ParamConverterProvider} implementations.
@@ -39,15 +38,16 @@
* providers are iterated first, so that user registered providers are preferred against internal jersey providers.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav Fuksa
*/
+
@Singleton
public class ParamConverterFactory implements ParamConverterProvider {
private final List<ParamConverterProvider> converterProviders;
- ParamConverterFactory(Set<ParamConverterProvider> providers, Set<ParamConverterProvider> customProviders) {
+ public ParamConverterFactory(Set<ParamConverterProvider> providers, Set<ParamConverterProvider> customProviders) {
Set<ParamConverterProvider> copyProviders = new LinkedHashSet<>(providers);
converterProviders = new ArrayList<>();
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverters.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java
similarity index 96%
rename from core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverters.java
rename to core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java
index f7ac194..31b1a58 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverters.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -14,7 +15,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package org.glassfish.jersey.server.internal.inject;
+package org.glassfish.jersey.internal.inject;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
@@ -32,10 +33,9 @@
import javax.inject.Singleton;
-import org.glassfish.jersey.internal.inject.ExtractorException;
import org.glassfish.jersey.internal.util.ReflectionHelper;
import org.glassfish.jersey.message.internal.HttpDateFormat;
-import org.glassfish.jersey.server.internal.LocalizationMessages;
+import org.glassfish.jersey.internal.LocalizationMessages;
/**
* Container of several different {@link ParamConverterProvider param converter providers}
@@ -43,10 +43,10 @@
* strategies of constructing an instance from a {@code String} value.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
-class ParamConverters {
+public class ParamConverters {
private abstract static class AbstractStringReader<T> implements ParamConverter<T> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveMapper.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java
similarity index 85%
rename from core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveMapper.java
rename to core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java
index eb9ce14..5b1a584 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveMapper.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/PrimitiveMapper.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -14,7 +15,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package org.glassfish.jersey.server.internal.inject;
+package org.glassfish.jersey.internal.inject;
import java.util.Collections;
import java.util.Map;
@@ -25,13 +26,13 @@
* as the default values as defined by the JAX-RS specification.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
-final class PrimitiveMapper {
+public final class PrimitiveMapper {
- static final Map<Class, Class> primitiveToClassMap =
+ public static final Map<Class, Class> primitiveToClassMap =
getPrimitiveToClassMap();
- static final Map<Class, Object> primitiveToDefaultValueMap =
+ public static final Map<Class, Object> primitiveToDefaultValueMap =
getPrimitiveToDefaultValueMap();
private static Map<Class, Class> getPrimitiveToClassMap() {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ProviderBinder.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ProviderBinder.java
index 0d302b4..bc7e01e 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ProviderBinder.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ProviderBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -50,7 +50,7 @@
* </p>
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Michal Gajdos
*/
public class ProviderBinder {
@@ -72,8 +72,53 @@
* @param providerClass provider class.
* @param model contract provider model.
*/
- public static void bindProvider(Class<?> providerClass, ContractProvider model, InjectionManager injectionManager) {
- injectionManager.register(CompositeBinder.wrap(createProviderBinders(providerClass, model)));
+ public static <T> void bindProvider(Class<T> providerClass, ContractProvider model, InjectionManager injectionManager) {
+ final T instance = injectionManager.getInstance(providerClass);
+ if (instance != null) {
+ injectionManager.register(createInstanceBinder(instance, model));
+ } else {
+ injectionManager.register(createClassBinder(model));
+ }
+ }
+
+ private static <T> Binder createInstanceBinder(T instance, ContractProvider model) {
+
+ return new AbstractBinder() {
+
+ @Override
+ protected void configure() {
+ final InstanceBinding binding = bind(instance)
+ .in(model.getScope())
+ .qualifiedBy(CustomAnnotationLiteral.INSTANCE);
+ binding.to(model.getContracts());
+ int priority = model.getPriority(model.getImplementationClass());
+ if (priority > ContractProvider.NO_PRIORITY) {
+ binding.ranked(priority);
+ }
+
+ }
+ };
+
+ }
+
+ private static Binder createClassBinder(ContractProvider model) {
+
+ return new AbstractBinder() {
+
+ @Override
+ protected void configure() {
+ final ClassBinding binding = bind(model.getImplementationClass())
+ .in(model.getScope())
+ .qualifiedBy(CustomAnnotationLiteral.INSTANCE);
+ binding.to(model.getContracts());
+ int priority = model.getPriority(model.getImplementationClass());
+ if (priority > ContractProvider.NO_PRIORITY) {
+ binding.ranked(priority);
+ }
+
+ }
+ };
+
}
private static Collection<Binder> createProviderBinders(Class<?> providerClass, ContractProvider model) {
@@ -110,7 +155,7 @@
* @param model contract provider model.
*/
public static void bindProvider(Object providerInstance, ContractProvider model, InjectionManager injectionManager) {
- injectionManager.register(CompositeBinder.wrap(createProviderBinders(providerInstance, model)));
+ injectionManager.register(createInstanceBinder(providerInstance, model));
}
private static Collection<Binder> createProviderBinders(Object providerInstance, ContractProvider model) {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java
index a965574..b74628d 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -52,7 +52,7 @@
* Utility class providing a set of utility methods for easier and more type-safe
* interaction with an injection layer.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav Fuksa
*/
public final class Providers {
@@ -179,24 +179,16 @@
* @return iterable of all available ranked service providers for the contract. Return value is never {@code null}.
*/
public static <T> Iterable<RankedProvider<T>> getAllRankedProviders(InjectionManager injectionManager, Class<T> contract) {
- List<ServiceHolder<T>> providers = getServiceHolders(injectionManager, contract, CustomAnnotationLiteral.INSTANCE);
+ final List<ServiceHolder<T>> providers = getServiceHolders(injectionManager, contract, CustomAnnotationLiteral.INSTANCE);
providers.addAll(getServiceHolders(injectionManager, contract));
- LinkedHashMap<ServiceHolder<T>, RankedProvider<T>> providerMap = new LinkedHashMap<>();
+ final LinkedHashMap<Class<T>, RankedProvider<T>> providerMap = new LinkedHashMap<>();
- for (ServiceHolder<T> provider : providers) {
- if (!providerMap.containsKey(provider)) {
- Set<Type> contractTypes = provider.getContractTypes();
- Class<?> implementationClass = provider.getImplementationClass();
- boolean proxyGenerated = true;
- for (Type ct : contractTypes) {
- if (((Class<?>) ct).isAssignableFrom(implementationClass)) {
- proxyGenerated = false;
- break;
- }
- }
- Set<Type> contracts = proxyGenerated ? contractTypes : null;
- providerMap.put(provider, new RankedProvider<>(provider.getInstance(), provider.getRank(), contracts));
+ for (final ServiceHolder<T> provider : providers) {
+ final Class<T> implClass = getImplementationClass(contract, provider);
+ if (!providerMap.containsKey(implClass)) {
+ Set<Type> contracts = isProxyGenerated(contract, provider) ? provider.getContractTypes() : null;
+ providerMap.put(implClass, new RankedProvider<>(provider.getInstance(), provider.getRank(), contracts));
}
}
@@ -290,14 +282,16 @@
CustomAnnotationLiteral.INSTANCE);
providers.addAll(getServiceHolders(injectionManager, contract));
- LinkedHashSet<ServiceHolder<T>> providersSet = new LinkedHashSet<>();
- for (ServiceHolder<T> provider : providers) {
- if (!providersSet.contains(provider)) {
- providersSet.add(provider);
+ final LinkedHashMap<Class<T>, ServiceHolder<T>> providerMap = new LinkedHashMap<>();
+
+ for (final ServiceHolder<T> provider : providers) {
+ final Class<T> implClass = getImplementationClass(contract, provider);
+ if (!providerMap.containsKey(implClass)) {
+ providerMap.put(implClass, provider);
}
}
- return providersSet;
+ return providerMap.values();
}
private static <T> List<ServiceHolder<T>> getServiceHolders(
@@ -311,7 +305,9 @@
Annotation... qualifiers) {
List<ServiceHolder<T>> serviceHolders = injectionManager.getAllServiceHolders(contract, qualifiers);
- serviceHolders.sort((o1, o2) -> objectComparator.compare(o1.getImplementationClass(), o2.getImplementationClass()));
+ serviceHolders.sort((o1, o2) -> objectComparator.compare(
+ getImplementationClass(contract, o1), getImplementationClass(contract, o2))
+ );
return serviceHolders;
}
@@ -370,6 +366,17 @@
return Priorities.USER;
}
+ private static <T> Class<T> getImplementationClass(Class<T> contract, ServiceHolder<T> serviceHolder) {
+ return isProxyGenerated(contract, serviceHolder)
+ ? serviceHolder.getContractTypes().stream().filter(a -> Class.class.isInstance(a))
+ .map(a -> (Class) a).reduce(contract, (a, b) -> a.isAssignableFrom(b) ? b : a)
+ : serviceHolder.getImplementationClass();
+ }
+
+ private static <T> boolean isProxyGenerated(Class<T> contract, ServiceHolder<T> serviceHolder) {
+ return !contract.isAssignableFrom(serviceHolder.getImplementationClass());
+ }
+
/**
* Returns provider contracts recognized by Jersey that are implemented by the {@code clazz}.
* Recognized provider contracts include all JAX-RS providers as well as all Jersey SPI
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ReferencingFactory.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ReferencingFactory.java
index ddeb7f6..0c92e24 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ReferencingFactory.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ReferencingFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -27,7 +27,7 @@
* Factory that provides injection of the referenced instance.
*
* @param <T>
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class ReferencingFactory<T> implements Supplier<T> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/UpdaterException.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/UpdaterException.java
new file mode 100644
index 0000000..f07691e
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/UpdaterException.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
+ *
+ * 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.internal.inject;
+
+import javax.ws.rs.ProcessingException;
+import javax.ws.rs.WebApplicationException;
+
+/**
+ * A runtime exception that contains a cause, a checked or runtime exception,
+ * that may be passed to the cause of a {@link WebApplicationException}.
+ *
+ * @author Paul Sandoz
+ * @author Gaurav Gupta
+ *
+ */
+public class UpdaterException extends ProcessingException {
+ private static final long serialVersionUID = -4918023257104413981L;
+
+ /**
+ * Create new parameter extractor exception.
+ *
+ * @param message exception message.
+ */
+ public UpdaterException(String message) {
+ super(message);
+ }
+
+ /**
+ * Create new parameter extractor exception.
+ *
+ * @param message exception message.
+ * @param cause exception cause.
+ */
+ public UpdaterException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Create new parameter extractor exception.
+ *
+ * @param cause exception cause.
+ */
+ public UpdaterException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/CombinedMediaType.java b/core-common/src/main/java/org/glassfish/jersey/internal/routing/CombinedMediaType.java
similarity index 91%
rename from core-server/src/main/java/org/glassfish/jersey/server/internal/routing/CombinedMediaType.java
rename to core-common/src/main/java/org/glassfish/jersey/internal/routing/CombinedMediaType.java
index e2479e7..b0078b8 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/CombinedMediaType.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/routing/CombinedMediaType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package org.glassfish.jersey.server.internal.routing;
+package org.glassfish.jersey.internal.routing;
import java.util.Comparator;
@@ -33,12 +33,12 @@
* @author Jakub Podlesak
* @author Miroslav Fuksa
*/
-final class CombinedMediaType {
+public final class CombinedMediaType {
/**
* Constant combined type representing no match.
*/
- static final CombinedMediaType NO_MATCH = new CombinedMediaType(null, 0, 0, 0);
+ public static final CombinedMediaType NO_MATCH = new CombinedMediaType(null, 0, 0, 0);
private static int matchedWildcards(MediaType clientMt, EffectiveMediaType serverMt) {
return b2i(clientMt.isWildcardType() ^ serverMt.isWildcardType())
@@ -85,6 +85,14 @@
}
/**
+ * Get combined client/server {@link MediaType}, stripped of q and qs parameters.
+ * @return Combined client/server media type, stripped of q and qs parameters.
+ */
+ public MediaType getCombinedType() {
+ return combinedType;
+ }
+
+ /**
* Create combined client/server media type.
*
* if the two types are not compatible, {@link #NO_MATCH} is returned.
@@ -93,7 +101,7 @@
* @param serverType server-side media type.
* @return combined client/server media type.
*/
- static CombinedMediaType create(MediaType clientType, EffectiveMediaType serverType) {
+ public static CombinedMediaType create(MediaType clientType, EffectiveMediaType serverType) {
if (!clientType.isCompatible(serverType.getMediaType())) {
return NO_MATCH;
}
@@ -112,7 +120,7 @@
* Comparator used to compare {@link CombinedMediaType}. The comparator sorts the elements of list
* in the ascending order from the most appropriate to the least appropriate combined media type.
*/
- static final Comparator<CombinedMediaType> COMPARATOR = new Comparator<CombinedMediaType>() {
+ public static final Comparator<CombinedMediaType> COMPARATOR = new Comparator<CombinedMediaType>() {
@Override
public int compare(CombinedMediaType c1, CombinedMediaType c2) {
@@ -149,7 +157,7 @@
* obtained from user annotations {@link Consumes} or {@link Produces} or has no
* annotation and therefore was derived from {@link MessageBodyWorkers}.
*/
- static class EffectiveMediaType {
+ public static class EffectiveMediaType {
/**
* True if the MediaType was not defined by annotation and therefore was
@@ -227,7 +235,7 @@
* @return {@code true} if the {@code MediaType} was not defined by annotation and therefore was derived from
* Message Body Providers, {@code false} otherwise.
*/
- boolean isDerived() {
+ public boolean isDerived() {
return derived;
}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/routing/ContentTypeDeterminer.java b/core-common/src/main/java/org/glassfish/jersey/internal/routing/ContentTypeDeterminer.java
new file mode 100644
index 0000000..cb90495
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/routing/ContentTypeDeterminer.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2012, 2019 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.internal.routing;
+
+import org.glassfish.jersey.message.MessageBodyWorkers;
+import org.glassfish.jersey.message.WriterModel;
+import org.glassfish.jersey.message.internal.AcceptableMediaType;
+import org.glassfish.jersey.message.internal.MediaTypes;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * Utility class containing methods used on both client and server side for determining media type of a response based
+ * on provided {@link MessageBodyWorkers}.
+ */
+public class ContentTypeDeterminer {
+
+ protected ContentTypeDeterminer(MessageBodyWorkers workers) {
+ this.workers = workers;
+ }
+
+ protected MessageBodyWorkers workers;
+
+ /**
+ * Determine the {@link MediaType} of the {@link Response} based on writers suitable for the given entity class,
+ * pre-selected method and acceptable media types.
+ *
+ * @param entityClass entity class to determine the media type for.
+ * @param entityType entity type for writers.
+ * @param selectedMethod pre-selected (invoked) method.
+ * @param acceptableMediaTypes acceptable media types from request.
+ * @param methodProducesTypes media types producible by resource method
+ * @return media type of the response.
+ */
+ protected MediaType determineResponseMediaType(
+ final Class<?> entityClass,
+ final Type entityType,
+ final RequestSpecificConsumesProducesAcceptor<?> selectedMethod,
+ final List<AcceptableMediaType> acceptableMediaTypes,
+ final List<MediaType> methodProducesTypes,
+ final Annotation[] handlingMethodAnnotations) {
+
+ // Entity class can be null when considering HEAD method || empty entity.
+ final Class<?> responseEntityClass = entityClass;
+
+ // Applicable entity providers
+ final List<WriterModel> writersForEntityType = workers.getWritersModelsForType(responseEntityClass);
+
+ CombinedMediaType selected = null;
+ for (final MediaType acceptableMediaType : acceptableMediaTypes) {
+ for (final MediaType methodProducesType : methodProducesTypes) {
+ if (!acceptableMediaType.isCompatible(methodProducesType)) {
+ // no need to go deeper if acceptable and method produces type are incompatible
+ continue;
+ }
+
+ // Use writers suitable for entity class to determine the media type.
+ for (final WriterModel model : writersForEntityType) {
+ for (final MediaType writerProduces : model.declaredTypes()) {
+ if (!writerProduces.isCompatible(acceptableMediaType)
+ || !methodProducesType.isCompatible(writerProduces)) {
+ continue;
+ }
+
+ final CombinedMediaType.EffectiveMediaType effectiveProduces =
+ new CombinedMediaType.EffectiveMediaType(
+ MediaTypes.mostSpecific(methodProducesType, writerProduces),
+ false);
+
+ final CombinedMediaType candidate =
+ CombinedMediaType.create(acceptableMediaType, effectiveProduces);
+
+ if (candidate != CombinedMediaType.NO_MATCH) {
+ // Look for a better compatible worker.
+ if (selected == null || CombinedMediaType.COMPARATOR.compare(candidate, selected) < 0) {
+ if (model.isWriteable(
+ responseEntityClass,
+ entityType,
+ handlingMethodAnnotations,
+ candidate.getCombinedType())) {
+ selected = candidate;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Found media type for current writer.
+ if (selected != null) {
+ return selected.getCombinedType();
+ }
+
+ // If the media type couldn't be determined, choose pre-selected one and wait whether interceptors change the mediaType
+ // so it can be written.
+ return selectedMethod.getProduces().getCombinedType();
+ }
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/routing/RequestSpecificConsumesProducesAcceptor.java b/core-common/src/main/java/org/glassfish/jersey/internal/routing/RequestSpecificConsumesProducesAcceptor.java
new file mode 100644
index 0000000..365db17
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/routing/RequestSpecificConsumesProducesAcceptor.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2012, 2019 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.internal.routing;
+
+/**
+ * A {@link Comparable} concrete request content-type, accept header, and a methodRouting triplet
+ *
+ * @see CombinedMediaType
+ */
+@SuppressWarnings("ComparableImplementedButEqualsNotOverridden")
+public final class RequestSpecificConsumesProducesAcceptor<MethodRouting> implements Comparable {
+ private final CombinedMediaType consumes;
+ private final CombinedMediaType produces;
+ private final MethodRouting methodRouting;
+
+ private final boolean producesFromProviders;
+
+ public RequestSpecificConsumesProducesAcceptor(final CombinedMediaType consumes,
+ final CombinedMediaType produces,
+ final boolean producesFromProviders,
+ final MethodRouting methodRouting) {
+
+ this.methodRouting = methodRouting;
+ this.consumes = consumes;
+ this.produces = produces;
+ this.producesFromProviders = producesFromProviders;
+ }
+
+ @Override
+ public int compareTo(Object o) {
+ if (o == null) {
+ return -1;
+ }
+ if (!(o instanceof RequestSpecificConsumesProducesAcceptor)) {
+ return -1;
+ }
+ RequestSpecificConsumesProducesAcceptor other = (RequestSpecificConsumesProducesAcceptor) o;
+ final int consumedComparison = CombinedMediaType.COMPARATOR.compare(consumes, other.consumes);
+ return (consumedComparison != 0)
+ ? consumedComparison : CombinedMediaType.COMPARATOR.compare(produces, other.produces);
+ }
+
+ /**
+ * Get request content type
+ * @return request content type
+ */
+ public CombinedMediaType getConsumes() {
+ return consumes;
+ }
+
+ /**
+ * Get specified method routing
+ * @return method routing
+ */
+ public MethodRouting getMethodRouting() {
+ return methodRouting;
+ }
+
+ /**
+ * Get Accept header media type
+ * @return request accept header
+ */
+ public CombinedMediaType getProduces() {
+ return produces;
+ }
+
+ /**
+ * Information whether {@link #getProduces()} was set by providers}. If not, resource method was annotated by
+ * {@code @Produces}
+ * @return {@code true} if the produces media type was set by providers and not by {@code @Produces} annotation.
+ */
+ public boolean producesFromProviders() {
+ return producesFromProviders;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s->%s:%s", consumes, produces, methodRouting);
+ }
+
+}
\ No newline at end of file
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/routing/package-info.java b/core-common/src/main/java/org/glassfish/jersey/internal/routing/package-info.java
new file mode 100644
index 0000000..8d5bd4b
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/routing/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 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
+ */
+
+/**
+ * Common Jersey internal routing API classes.
+ */
+package org.glassfish.jersey.internal.routing;
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/sonar/SonarJerseyCommon.java b/core-common/src/main/java/org/glassfish/jersey/internal/sonar/SonarJerseyCommon.java
index 5f1e851..3a58bb3 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/sonar/SonarJerseyCommon.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/sonar/SonarJerseyCommon.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +20,7 @@
* The purpose of this class is to verify the reported test coverage shows correct results in various modes of test executions.
* For further details, see javadoc bellow.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class SonarJerseyCommon {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/Closure.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/Closure.java
index 89e3ce3..9c68ca4 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/Closure.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/Closure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +20,7 @@
* Closure interface.
*
* @param <T> data type.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Closure<T> {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/ExtendedLogger.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/ExtendedLogger.java
index 928f39c..0790294 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/ExtendedLogger.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/ExtendedLogger.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -27,7 +27,7 @@
/**
* Logger extension with additional logging utility & convenience methods.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@SuppressWarnings("deprecation")
public final class ExtendedLogger {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/JdkVersion.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/JdkVersion.java
index 2905bfe..9b8ec40 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/JdkVersion.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/JdkVersion.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +20,7 @@
* JDK Version related utilities. Ported from Grizzly project.
*
* @author Ryan Lubke (ryan.lubke at oracle.com)
- * @author Alexey Stashok (oleksiy.stashok at oracle.com)
+ * @author Alexey Stashok
* @since 2.3
*/
public class JdkVersion implements Comparable<JdkVersion> {
@@ -74,15 +74,20 @@
}
final String[] parts = versionString.split("\\.|_");
if (parts.length == 3) {
+ // e.g. "1.8.0" or "9.0.1"
return new JdkVersion(Integer.parseInt(parts[0]),
Integer.parseInt(parts[1]),
Integer.parseInt(parts[2]),
0);
- } else {
+ } else if (parts.length == 4) {
+ // e.g. "1.8.0_141"
return new JdkVersion(Integer.parseInt(parts[0]),
Integer.parseInt(parts[1]),
Integer.parseInt(parts[2]),
Integer.parseInt(parts[3]));
+ } else {
+ // e.g "11"
+ return new JdkVersion(Integer.parseInt(parts[0]), 0, 0, 0);
}
} catch (final Exception e) {
return UNKNOWN_VERSION;
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/JerseyPublisher.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/JerseyPublisher.java
index 519ac21..ea91da4 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/JerseyPublisher.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/JerseyPublisher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -27,19 +27,21 @@
import org.glassfish.jersey.internal.LocalizationMessages;
import org.glassfish.jersey.internal.jsr166.Flow;
import org.glassfish.jersey.internal.jsr166.SubmissionPublisher;
+import org.glassfish.jersey.internal.jsr166.SubmissionPublisherFactory;
+import org.glassfish.jersey.internal.jsr166.SubmittableFlowPublisher;
/**
* Implementation of {@link Flow.Publisher} corresponding to reactive streams specification.
* <p>
- * Delegates to {@link SubmissionPublisher} repackaged from jsr166.
+ * Delegates to {@link SubmissionPublisher} repackaged from jsr166 on JDK 8 or to JDK {@code SubmissionPublisher}.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class JerseyPublisher<T> implements Flow.Publisher<T> {
private static final int DEFAULT_BUFFER_CAPACITY = 256;
- private SubmissionPublisher<T> submissionPublisher = new SubmissionPublisher<>();
+ private SubmittableFlowPublisher<T> submissionPublisher = SubmissionPublisherFactory.createSubmissionPublisher();
private final PublisherStrategy strategy;
@@ -92,7 +94,7 @@
*/
public JerseyPublisher(final Executor executor, final PublisherStrategy strategy) {
this.strategy = strategy;
- submissionPublisher = new SubmissionPublisher<>(executor, DEFAULT_BUFFER_CAPACITY);
+ submissionPublisher = SubmissionPublisherFactory.createSubmissionPublisher(executor, DEFAULT_BUFFER_CAPACITY);
}
@@ -130,7 +132,7 @@
*/
public JerseyPublisher(final Executor executor, final int maxBufferCapacity, PublisherStrategy strategy) {
this.strategy = strategy;
- submissionPublisher = new SubmissionPublisher<>(executor, maxBufferCapacity);
+ submissionPublisher = SubmissionPublisherFactory.createSubmissionPublisher(executor, maxBufferCapacity);
}
@Override
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/LazyUid.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/LazyUid.java
index d8b3576..1c9ccc2 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/LazyUid.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/LazyUid.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -27,7 +27,7 @@
* The UUID value gets initialized with the first call to {@link #value()} method.
* Once initialized, the UUID value stays the same.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class LazyUid implements Serializable {
private static final long serialVersionUID = 4618609413877136867L;
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/Producer.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/Producer.java
index c840354..a5c75e7 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/Producer.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/Producer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
*
* @param <T> type of the produced result.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Producer<T> extends Callable<T> {
@Override
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/PropertiesClass.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/PropertiesClass.java
index 1ae4dc8..c19896f 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/PropertiesClass.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/PropertiesClass.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -35,7 +35,7 @@
* (@code org.glassfish.jersey.tests.integration.propertycheck.PropertyOverlappingCheckTest) unit test.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see org.glassfish.jersey.internal.util.Property
* @see org.glassfish.jersey.internal.util.PropertyAlias
*/
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/Property.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/Property.java
index f099fc8..1a18944 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/Property.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/Property.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
* (@code org.glassfish.jersey.tests.integration.propertycheck.PropertyOverlappingCheckTest) unit test.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see org.glassfish.jersey.internal.util.PropertiesClass
* @see org.glassfish.jersey.internal.util.PropertyAlias
*/
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/PropertyAlias.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/PropertyAlias.java
index 2f1191b..ba8744d 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/PropertyAlias.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/PropertyAlias.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
* it has to be marked by this annotation, otherwise the test will fail and prevent Jersey build to succeed.
* </p>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @see org.glassfish.jersey.internal.util.PropertiesClass
* @see org.glassfish.jersey.internal.util.Property
*/
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/ReflectionHelper.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/ReflectionHelper.java
index 26d280c..b0a0447 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/ReflectionHelper.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/ReflectionHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -64,7 +64,7 @@
* Utility methods for Java reflection.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class ReflectionHelper {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/Tokenizer.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/Tokenizer.java
index dbb8305..e15138c 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/Tokenizer.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/Tokenizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
* A utility class providing methods capable of splitting String entries
* into an array of tokens based on either default or custom token delimiters.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class Tokenizer {
private Tokenizer() {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/TypeVisitor.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/TypeVisitor.java
index a930bc7..2d96d42 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/TypeVisitor.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/TypeVisitor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -27,7 +27,7 @@
*
* @param <T> type visiting result type.
* @author Kohsuke Kawaguchi
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
abstract class TypeVisitor<T> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ByteBufferInputStream.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ByteBufferInputStream.java
index e9754e3..39176a8 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ByteBufferInputStream.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ByteBufferInputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,6 +19,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
@@ -33,7 +34,7 @@
* this input stream provides the non-blocking {@code tryRead} counterparts.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class ByteBufferInputStream extends NonBlockingInputStream {
@@ -70,7 +71,7 @@
* to be read.
*/
public ByteBufferInputStream() {
- this.buffers = DataStructures.createLinkedTransferQueue();
+ this.buffers = new LinkedTransferQueue<>();
this.current = null;
}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Cache.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Cache.java
index 1bca909..923552c 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Cache.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Cache.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -33,7 +33,7 @@
*
* @param <K> The type of the key of the cache
* @param <V> The type of the values in the cache
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Cache<K, V> implements Function<K, V> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ClassTypePair.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ClassTypePair.java
index 68a1ce3..e950a2d 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ClassTypePair.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ClassTypePair.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -21,7 +21,7 @@
/**
* A pair of raw class and the related type.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class ClassTypePair {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ConcurrentHashMapV8.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ConcurrentHashMapV8.java
deleted file mode 100644
index dc435d3..0000000
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ConcurrentHashMapV8.java
+++ /dev/null
@@ -1,3541 +0,0 @@
-/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-/**
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-package org.glassfish.jersey.internal.util.collection;
-
-import java.io.ObjectStreamField;
-import java.io.Serializable;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.AbstractMap;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.locks.LockSupport;
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * A hash table supporting full concurrency of retrievals and
- * high expected concurrency for updates. This class obeys the
- * same functional specification as {@link java.util.Hashtable}, and
- * includes versions of methods corresponding to each method of
- * {@code Hashtable}. However, even though all operations are
- * thread-safe, retrieval operations do <em>not</em> entail locking,
- * and there is <em>not</em> any support for locking the entire table
- * in a way that prevents all access. This class is fully
- * interoperable with {@code Hashtable} in programs that rely on its
- * thread safety but not on its synchronization details.
- *
- * <p>Retrieval operations (including {@code get}) generally do not
- * block, so may overlap with update operations (including {@code put}
- * and {@code remove}). Retrievals reflect the results of the most
- * recently <em>completed</em> update operations holding upon their
- * onset. (More formally, an update operation for a given key bears a
- * <em>happens-before</em> relation with any (non-null) retrieval for
- * that key reporting the updated value.) For aggregate operations
- * such as {@code putAll} and {@code clear}, concurrent retrievals may
- * reflect insertion or removal of only some entries. Similarly,
- * Iterators and Enumerations return elements reflecting the state of
- * the hash table at some point at or since the creation of the
- * iterator/enumeration. They do <em>not</em> throw {@link
- * ConcurrentModificationException}. However, iterators are designed
- * to be used by only one thread at a time. Bear in mind that the
- * results of aggregate status methods including {@code size}, {@code
- * isEmpty}, and {@code containsValue} are typically useful only when
- * a map is not undergoing concurrent updates in other threads.
- * Otherwise the results of these methods reflect transient states
- * that may be adequate for monitoring or estimation purposes, but not
- * for program control.
- *
- * <p>The table is dynamically expanded when there are too many
- * collisions (i.e., keys that have distinct hash codes but fall into
- * the same slot modulo the table size), with the expected average
- * effect of maintaining roughly two bins per mapping (corresponding
- * to a 0.75 load factor threshold for resizing). There may be much
- * variance around this average as mappings are added and removed, but
- * overall, this maintains a commonly accepted time/space tradeoff for
- * hash tables. However, resizing this or any other kind of hash
- * table may be a relatively slow operation. When possible, it is a
- * good idea to provide a size estimate as an optional {@code
- * initialCapacity} constructor argument. An additional optional
- * {@code loadFactor} constructor argument provides a further means of
- * customizing initial table capacity by specifying the table density
- * to be used in calculating the amount of space to allocate for the
- * given number of elements. Also, for compatibility with previous
- * versions of this class, constructors may optionally specify an
- * expected {@code concurrencyLevel} as an additional hint for
- * internal sizing. Note that using many keys with exactly the same
- * {@code hashCode()} is a sure way to slow down performance of any
- * hash table. To ameliorate impact, when keys are {@link Comparable},
- * this class may use comparison order among keys to help break ties.
- *
- * <p>A {@link Set} projection of a ConcurrentHashMapV8 may be created
- * (using {@link #newKeySet()} or {@link #newKeySet(int)}), or viewed
- * (using {@link #keySet(Object)} when only keys are of interest, and the
- * mapped values are (perhaps transiently) not used or all take the
- * same mapping value.
- *
- * <p>This class and its views and iterators implement all of the
- * <em>optional</em> methods of the {@link Map} and {@link Iterator}
- * interfaces.
- *
- * <p>Like {@link java.util.Hashtable} but unlike {@link HashMap}, this class
- * does <em>not</em> allow {@code null} to be used as a key or value.
- *
- * <p>ConcurrentHashMapV8s support a set of sequential and parallel bulk
- * operations that are designed
- * to be safely, and often sensibly, applied even with maps that are
- * being concurrently updated by other threads; for example, when
- * computing a snapshot summary of the values in a shared registry.
- * There are three kinds of operation, each with four forms, accepting
- * functions with Keys, Values, Entries, and (Key, Value) arguments
- * and/or return values. Because the elements of a ConcurrentHashMapV8
- * are not ordered in any particular way, and may be processed in
- * different orders in different parallel executions, the correctness
- * of supplied functions should not depend on any ordering, or on any
- * other objects or values that may transiently change while
- * computation is in progress; and except for forEach actions, should
- * ideally be side-effect-free. Bulk operations on {@link java.util.Map.Entry}
- * objects do not support method {@code setValue}.
- *
- * <ul>
- * <li> forEach: Perform a given action on each element.
- * A variant form applies a given transformation on each element
- * before performing the action.</li>
- *
- * <li> search: Return the first available non-null result of
- * applying a given function on each element; skipping further
- * search when a result is found.</li>
- *
- * <li> reduce: Accumulate each element. The supplied reduction
- * function cannot rely on ordering (more formally, it should be
- * both associative and commutative). There are five variants:
- *
- * <ul>
- *
- * <li> Plain reductions. (There is not a form of this method for
- * (key, value) function arguments since there is no corresponding
- * return type.)</li>
- *
- * <li> Mapped reductions that accumulate the results of a given
- * function applied to each element.</li>
- *
- * <li> Reductions to scalar doubles, longs, and ints, using a
- * given basis value.</li>
- *
- * </ul>
- * </li>
- * </ul>
- *
- * <p>These bulk operations accept a {@code parallelismThreshold}
- * argument. Methods proceed sequentially if the current map size is
- * estimated to be less than the given threshold. Using a value of
- * {@code Long.MAX_VALUE} suppresses all parallelism. Using a value
- * of {@code 1} results in maximal parallelism by partitioning into
- * enough subtasks to fully utilize the {@code
- * ForkJoinPool#commonPool()} that is used for all parallel
- * computations. Normally, you would initially choose one of these
- * extreme values, and then measure performance of using in-between
- * values that trade off overhead versus throughput.
- *
- * <p>The concurrency properties of bulk operations follow
- * from those of ConcurrentHashMapV8: Any non-null result returned
- * from {@code get(key)} and related access methods bears a
- * happens-before relation with the associated insertion or
- * update. The result of any bulk operation reflects the
- * composition of these per-element relations (but is not
- * necessarily atomic with respect to the map as a whole unless it
- * is somehow known to be quiescent). Conversely, because keys
- * and values in the map are never null, null serves as a reliable
- * atomic indicator of the current lack of any result. To
- * maintain this property, null serves as an implicit basis for
- * all non-scalar reduction operations. For the double, long, and
- * int versions, the basis should be one that, when combined with
- * any other value, returns that other value (more formally, it
- * should be the identity element for the reduction). Most common
- * reductions have these properties; for example, computing a sum
- * with basis 0 or a minimum with basis MAX_VALUE.
- *
- * <p>Search and transformation functions provided as arguments
- * should similarly return null to indicate the lack of any result
- * (in which case it is not used). In the case of mapped
- * reductions, this also enables transformations to serve as
- * filters, returning null (or, in the case of primitive
- * specializations, the identity basis) if the element should not
- * be combined. You can create compound transformations and
- * filterings by composing them yourself under this "null means
- * there is nothing there now" rule before using them in search or
- * reduce operations.
- *
- * <p>Methods accepting and/or returning Entry arguments maintain
- * key-value associations. They may be useful for example when
- * finding the key for the greatest value. Note that "plain" Entry
- * arguments can be supplied using {@code new
- * AbstractMap.SimpleEntry(k,v)}.
- *
- * <p>Bulk operations may complete abruptly, throwing an
- * exception encountered in the application of a supplied
- * function. Bear in mind when handling such exceptions that other
- * concurrently executing functions could also have thrown
- * exceptions, or would have done so if the first exception had
- * not occurred.
- *
- * <p>Speedups for parallel compared to sequential forms are common
- * but not guaranteed. Parallel operations involving brief functions
- * on small maps may execute more slowly than sequential forms if the
- * underlying work to parallelize the computation is more expensive
- * than the computation itself. Similarly, parallelization may not
- * lead to much actual parallelism if all processors are busy
- * performing unrelated tasks.
- *
- * <p>All arguments to all task methods must be non-null.
- *
- * <p><em>jsr166e note: During transition, this class
- * uses nested functional interfaces with different names but the
- * same forms as those expected for JDK8.</em>
- *
- * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * @param <K> the type of keys maintained by this map
- * @param <V> the type of mapped values
- * @author Doug Lea
- */
-class ConcurrentHashMapV8<K, V> extends AbstractMap<K, V>
- implements ConcurrentMap<K, V>, Serializable {
- private static final long serialVersionUID = 7249069246763182397L;
-
- /*
- * Overview:
- *
- * The primary design goal of this hash table is to maintain
- * concurrent readability (typically method get(), but also
- * iterators and related methods) while minimizing update
- * contention. Secondary goals are to keep space consumption about
- * the same or better than java.util.HashMap, and to support high
- * initial insertion rates on an empty table by many threads.
- *
- * This map usually acts as a binned (bucketed) hash table. Each
- * key-value mapping is held in a Node. Most nodes are instances
- * of the basic Node class with hash, key, value, and next
- * fields. However, various subclasses exist: TreeNodes are
- * arranged in balanced trees, not lists. TreeBins hold the roots
- * of sets of TreeNodes. ForwardingNodes are placed at the heads
- * of bins during resizing. ReservationNodes are used as
- * placeholders while establishing values in computeIfAbsent and
- * related methods. The types TreeBin, ForwardingNode, and
- * ReservationNode do not hold normal user keys, values, or
- * hashes, and are readily distinguishable during search etc
- * because they have negative hash fields and null key and value
- * fields. (These special nodes are either uncommon or transient,
- * so the impact of carrying around some unused fields is
- * insignificant.)
- *
- * The table is lazily initialized to a power-of-two size upon the
- * first insertion. Each bin in the table normally contains a
- * list of Nodes (most often, the list has only zero or one Node).
- * Table accesses require volatile/atomic reads, writes, and
- * CASes. Because there is no other way to arrange this without
- * adding further indirections, we use intrinsics
- * (sun.misc.Unsafe) operations.
- *
- * We use the top (sign) bit of Node hash fields for control
- * purposes -- it is available anyway because of addressing
- * constraints. Nodes with negative hash fields are specially
- * handled or ignored in map methods.
- *
- * Insertion (via put or its variants) of the first node in an
- * empty bin is performed by just CASing it to the bin. This is
- * by far the most common case for put operations under most
- * key/hash distributions. Other update operations (insert,
- * delete, and replace) require locks. We do not want to waste
- * the space required to associate a distinct lock object with
- * each bin, so instead use the first node of a bin list itself as
- * a lock. Locking support for these locks relies on builtin
- * "synchronized" monitors.
- *
- * Using the first node of a list as a lock does not by itself
- * suffice though: When a node is locked, any update must first
- * validate that it is still the first node after locking it, and
- * retry if not. Because new nodes are always appended to lists,
- * once a node is first in a bin, it remains first until deleted
- * or the bin becomes invalidated (upon resizing).
- *
- * The main disadvantage of per-bin locks is that other update
- * operations on other nodes in a bin list protected by the same
- * lock can stall, for example when user equals() or mapping
- * functions take a long time. However, statistically, under
- * random hash codes, this is not a common problem. Ideally, the
- * frequency of nodes in bins follows a Poisson distribution
- * (http://en.wikipedia.org/wiki/Poisson_distribution) with a
- * parameter of about 0.5 on average, given the resizing threshold
- * of 0.75, although with a large variance because of resizing
- * granularity. Ignoring variance, the expected occurrences of
- * list size k are (exp(-0.5) * pow(0.5, k) / factorial(k)). The
- * first values are:
- *
- * 0: 0.60653066
- * 1: 0.30326533
- * 2: 0.07581633
- * 3: 0.01263606
- * 4: 0.00157952
- * 5: 0.00015795
- * 6: 0.00001316
- * 7: 0.00000094
- * 8: 0.00000006
- * more: less than 1 in ten million
- *
- * Lock contention probability for two threads accessing distinct
- * elements is roughly 1 / (8 * #elements) under random hashes.
- *
- * Actual hash code distributions encountered in practice
- * sometimes deviate significantly from uniform randomness. This
- * includes the case when N > (1<<30), so some keys MUST collide.
- * Similarly for dumb or hostile usages in which multiple keys are
- * designed to have identical hash codes or ones that differs only
- * in masked-out high bits. So we use a secondary strategy that
- * applies when the number of nodes in a bin exceeds a
- * threshold. These TreeBins use a balanced tree to hold nodes (a
- * specialized form of red-black trees), bounding search time to
- * O(log N). Each search step in a TreeBin is at least twice as
- * slow as in a regular list, but given that N cannot exceed
- * (1<<64) (before running out of addresses) this bounds search
- * steps, lock hold times, etc, to reasonable constants (roughly
- * 100 nodes inspected per operation worst case) so long as keys
- * are Comparable (which is very common -- String, Long, etc).
- * TreeBin nodes (TreeNodes) also maintain the same "next"
- * traversal pointers as regular nodes, so can be traversed in
- * iterators in the same way.
- *
- * The table is resized when occupancy exceeds a percentage
- * threshold (nominally, 0.75, but see below). Any thread
- * noticing an overfull bin may assist in resizing after the
- * initiating thread allocates and sets up the replacement
- * array. However, rather than stalling, these other threads may
- * proceed with insertions etc. The use of TreeBins shields us
- * from the worst case effects of overfilling while resizes are in
- * progress. Resizing proceeds by transferring bins, one by one,
- * from the table to the next table. To enable concurrency, the
- * next table must be (incrementally) prefilled with place-holders
- * serving as reverse forwarders to the old table. Because we are
- * using power-of-two expansion, the elements from each bin must
- * either stay at same index, or move with a power of two
- * offset. We eliminate unnecessary node creation by catching
- * cases where old nodes can be reused because their next fields
- * won't change. On average, only about one-sixth of them need
- * cloning when a table doubles. The nodes they replace will be
- * garbage collectable as soon as they are no longer referenced by
- * any reader thread that may be in the midst of concurrently
- * traversing table. Upon transfer, the old table bin contains
- * only a special forwarding node (with hash field "MOVED") that
- * contains the next table as its key. On encountering a
- * forwarding node, access and update operations restart, using
- * the new table.
- *
- * Each bin transfer requires its bin lock, which can stall
- * waiting for locks while resizing. However, because other
- * threads can join in and help resize rather than contend for
- * locks, average aggregate waits become shorter as resizing
- * progresses. The transfer operation must also ensure that all
- * accessible bins in both the old and new table are usable by any
- * traversal. This is arranged by proceeding from the last bin
- * (table.length - 1) up towards the first. Upon seeing a
- * forwarding node, traversals (see class Traverser) arrange to
- * move to the new table without revisiting nodes. However, to
- * ensure that no intervening nodes are skipped, bin splitting can
- * only begin after the associated reverse-forwarders are in
- * place.
- *
- * The traversal scheme also applies to partial traversals of
- * ranges of bins (via an alternate Traverser constructor)
- * to support partitioned aggregate operations. Also, read-only
- * operations give up if ever forwarded to a null table, which
- * provides support for shutdown-style clearing, which is also not
- * currently implemented.
- *
- * Lazy table initialization minimizes footprint until first use,
- * and also avoids resizings when the first operation is from a
- * putAll, constructor with map argument, or deserialization.
- * These cases attempt to override the initial capacity settings,
- * but harmlessly fail to take effect in cases of races.
- *
- * The element count is maintained using a specialization of
- * LongAdder. We need to incorporate a specialization rather than
- * just use a LongAdder in order to access implicit
- * contention-sensing that leads to creation of multiple
- * CounterCells. The counter mechanics avoid contention on
- * updates but can encounter cache thrashing if read too
- * frequently during concurrent access. To avoid reading so often,
- * resizing under contention is attempted only upon adding to a
- * bin already holding two or more nodes. Under uniform hash
- * distributions, the probability of this occurring at threshold
- * is around 13%, meaning that only about 1 in 8 puts check
- * threshold (and after resizing, many fewer do so).
- *
- * TreeBins use a special form of comparison for search and
- * related operations (which is the main reason we cannot use
- * existing collections such as TreeMaps). TreeBins contain
- * Comparable elements, but may contain others, as well as
- * elements that are Comparable but not necessarily Comparable for
- * the same T, so we cannot invoke compareTo among them. To handle
- * this, the tree is ordered primarily by hash value, then by
- * Comparable.compareTo order if applicable. On lookup at a node,
- * if elements are not comparable or compare as 0 then both left
- * and right children may need to be searched in the case of tied
- * hash values. (This corresponds to the full list search that
- * would be necessary if all elements were non-Comparable and had
- * tied hashes.) On insertion, to keep a total ordering (or as
- * close as is required here) across rebalancings, we compare
- * classes and identityHashCodes as tie-breakers. The red-black
- * balancing code is updated from pre-jdk-collections
- * (http://gee.cs.oswego.edu/dl/classes/collections/RBCell.java)
- * based in turn on Cormen, Leiserson, and Rivest "Introduction to
- * Algorithms" (CLR).
- *
- * TreeBins also require an additional locking mechanism. While
- * list traversal is always possible by readers even during
- * updates, tree traversal is not, mainly because of tree-rotations
- * that may change the root node and/or its linkages. TreeBins
- * include a simple read-write lock mechanism parasitic on the
- * main bin-synchronization strategy: Structural adjustments
- * associated with an insertion or removal are already bin-locked
- * (and so cannot conflict with other writers) but must wait for
- * ongoing readers to finish. Since there can be only one such
- * waiter, we use a simple scheme using a single "waiter" field to
- * block writers. However, readers need never block. If the root
- * lock is held, they proceed along the slow traversal path (via
- * next-pointers) until the lock becomes available or the list is
- * exhausted, whichever comes first. These cases are not fast, but
- * maximize aggregate expected throughput.
- *
- * Maintaining API and serialization compatibility with previous
- * versions of this class introduces several oddities. Mainly: We
- * leave untouched but unused constructor arguments refering to
- * concurrencyLevel. We accept a loadFactor constructor argument,
- * but apply it only to initial table capacity (which is the only
- * time that we can guarantee to honor it.) We also declare an
- * unused "Segment" class that is instantiated in minimal form
- * only when serializing.
- *
- * Also, solely for compatibility with previous versions of this
- * class, it extends AbstractMap, even though all of its methods
- * are overridden, so it is just useless baggage.
- *
- * This file is organized to make things a little easier to follow
- * while reading than they might otherwise: First the main static
- * declarations and utilities, then fields, then main public
- * methods (with a few factorings of multiple public methods into
- * internal ones), then sizing methods, trees, traversers, and
- * bulk operations.
- */
-
- /* ---------------- Constants -------------- */
-
- /**
- * The largest possible table capacity. This value must be
- * exactly 1<<30 to stay within Java array allocation and indexing
- * bounds for power of two table sizes, and is further required
- * because the top two bits of 32bit hash fields are used for
- * control purposes.
- */
- private static final int MAXIMUM_CAPACITY = 1 << 30;
-
- /**
- * The default initial table capacity. Must be a power of 2
- * (i.e., at least 1) and at most MAXIMUM_CAPACITY.
- */
- private static final int DEFAULT_CAPACITY = 16;
-
- /**
- * The largest possible (non-power of two) array size.
- * Needed by toArray and related methods.
- */
- static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
-
- /**
- * The default concurrency level for this table. Unused but
- * defined for compatibility with previous versions of this class.
- */
- private static final int DEFAULT_CONCURRENCY_LEVEL = 16;
-
- /**
- * The load factor for this table. Overrides of this value in
- * constructors affect only the initial table capacity. The
- * actual floating point value isn't normally used -- it is
- * simpler to use expressions such as {@code n - (n >>> 2)} for
- * the associated resizing threshold.
- */
- private static final float LOAD_FACTOR = 0.75f;
-
- /**
- * The bin count threshold for using a tree rather than list for a
- * bin. Bins are converted to trees when adding an element to a
- * bin with at least this many nodes. The value must be greater
- * than 2, and should be at least 8 to mesh with assumptions in
- * tree removal about conversion back to plain bins upon
- * shrinkage.
- */
- static final int TREEIFY_THRESHOLD = 8;
-
- /**
- * The bin count threshold for untreeifying a (split) bin during a
- * resize operation. Should be less than TREEIFY_THRESHOLD, and at
- * most 6 to mesh with shrinkage detection under removal.
- */
- static final int UNTREEIFY_THRESHOLD = 6;
-
- /**
- * The smallest table capacity for which bins may be treeified.
- * (Otherwise the table is resized if too many nodes in a bin.)
- * The value should be at least 4 * TREEIFY_THRESHOLD to avoid
- * conflicts between resizing and treeification thresholds.
- */
- static final int MIN_TREEIFY_CAPACITY = 64;
-
- /**
- * Minimum number of rebinnings per transfer step. Ranges are
- * subdivided to allow multiple resizer threads. This value
- * serves as a lower bound to avoid resizers encountering
- * excessive memory contention. The value should be at least
- * DEFAULT_CAPACITY.
- */
- private static final int MIN_TRANSFER_STRIDE = 16;
-
- /*
- * Encodings for Node hash fields. See above for explanation.
- */
- static final int MOVED = -1; // hash for forwarding nodes
- static final int TREEBIN = -2; // hash for roots of trees
- static final int RESERVED = -3; // hash for transient reservations
- static final int HASH_BITS = 0x7fffffff; // usable bits of normal node hash
-
- /**
- * Number of CPUS, to place bounds on some sizings
- */
- static final int NCPU = Runtime.getRuntime().availableProcessors();
-
- /**
- * For serialization compatibility.
- */
- private static final ObjectStreamField[] serialPersistentFields = {
- new ObjectStreamField("segments", Segment[].class),
- new ObjectStreamField("segmentMask", Integer.TYPE),
- new ObjectStreamField("segmentShift", Integer.TYPE)
- };
-
- /* ---------------- Nodes -------------- */
-
- /**
- * Key-value entry. This class is never exported out as a
- * user-mutable Map.Entry (i.e., one supporting setValue; see
- * MapEntry below), but can be used for read-only traversals used
- * in bulk tasks. Subclasses of Node with a negative hash field
- * are special, and contain null keys and values (but are never
- * exported). Otherwise, keys and vals are never null.
- */
- static class Node<K, V> implements Map.Entry<K, V> {
- final int hash;
- final K key;
- volatile V val;
- volatile Node<K, V> next;
-
- Node(final int hash, final K key, final V val, final Node<K, V> next) {
- this.hash = hash;
- this.key = key;
- this.val = val;
- this.next = next;
- }
-
- public final K getKey() {
- return key;
- }
-
- public final V getValue() {
- return val;
- }
-
- public final int hashCode() {
- return key.hashCode() ^ val.hashCode();
- }
-
- public final String toString() {
- return key + "=" + val;
- }
-
- public final V setValue(final V value) {
- throw new UnsupportedOperationException();
- }
-
- public final boolean equals(final Object o) {
- final Object k;
- final Object v;
- final Object u;
- final Map.Entry<?, ?> e;
- return ((o instanceof Map.Entry) &&
- (k = (e = (Map.Entry<?, ?>) o).getKey()) != null &&
- (v = e.getValue()) != null &&
- (k == key || k.equals(key)) &&
- (v == (u = val) || v.equals(u)));
- }
-
- /**
- * Virtualized support for map.get(); overridden in subclasses.
- */
- Node<K, V> find(final int h, final Object k) {
- Node<K, V> e = this;
- if (k != null) {
- do {
- final K ek;
- if (e.hash == h &&
- ((ek = e.key) == k || (ek != null && k.equals(ek))))
- return e;
- } while ((e = e.next) != null);
- }
- return null;
- }
- }
-
- /* ---------------- Static utilities -------------- */
-
- /**
- * Spreads (XORs) higher bits of hash to lower and also forces top
- * bit to 0. Because the table uses power-of-two masking, sets of
- * hashes that vary only in bits above the current mask will
- * always collide. (Among known examples are sets of Float keys
- * holding consecutive whole numbers in small tables.) So we
- * apply a transform that spreads the impact of higher bits
- * downward. There is a tradeoff between speed, utility, and
- * quality of bit-spreading. Because many common sets of hashes
- * are already reasonably distributed (so don't benefit from
- * spreading), and because we use trees to handle large sets of
- * collisions in bins, we just XOR some shifted bits in the
- * cheapest possible way to reduce systematic lossage, as well as
- * to incorporate impact of the highest bits that would otherwise
- * never be used in index calculations because of table bounds.
- */
- static final int spread(final int h) {
- return (h ^ (h >>> 16)) & HASH_BITS;
- }
-
- /**
- * Returns a power of two table size for the given desired capacity.
- * See Hackers Delight, sec 3.2
- */
- private static final int tableSizeFor(final int c) {
- int n = c - 1;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
- }
-
- /**
- * Returns x's Class if it is of the form "class C implements
- * Comparable<C>", else null.
- */
- static Class<?> comparableClassFor(final Object x) {
- if (x instanceof Comparable) {
- final Class<?> c;
- final Type[] ts;
- Type[] as;
- Type t;
- ParameterizedType p;
- if ((c = x.getClass()) == String.class) // bypass checks
- return c;
- if ((ts = c.getGenericInterfaces()) != null) {
- for (int i = 0; i < ts.length; ++i) {
- if (((t = ts[i]) instanceof ParameterizedType) &&
- ((p = (ParameterizedType) t).getRawType() ==
- Comparable.class) &&
- (as = p.getActualTypeArguments()) != null &&
- as.length == 1 && as[0] == c) // type arg is c
- return c;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns k.compareTo(x) if x matches kc (k's screened comparable
- * class), else 0.
- */
- @SuppressWarnings({"rawtypes", "unchecked"}) // for cast to Comparable
- static int compareComparables(final Class<?> kc, final Object k, final Object x) {
- return (x == null || x.getClass() != kc ? 0 :
- ((Comparable) k).compareTo(x));
- }
-
- /* ---------------- Table element access -------------- */
-
- /*
- * Volatile access methods are used for table elements as well as
- * elements of in-progress next table while resizing. All uses of
- * the tab arguments must be null checked by callers. All callers
- * also paranoically precheck that tab's length is not zero (or an
- * equivalent check), thus ensuring that any index argument taking
- * the form of a hash value anded with (length - 1) is a valid
- * index. Note that, to be correct wrt arbitrary concurrency
- * errors by users, these checks must operate on local variables,
- * which accounts for some odd-looking inline assignments below.
- * Note that calls to setTabAt always occur within locked regions,
- * and so in principle require only release ordering, not need
- * full volatile semantics, but are currently coded as volatile
- * writes to be conservative.
- */
-
- @SuppressWarnings("unchecked")
- static final <K, V> Node<K, V> tabAt(final Node<K, V>[] tab, final int i) {
- return (Node<K, V>) U.getObjectVolatile(tab, ((long) i << ASHIFT) + ABASE);
- }
-
- static final <K, V> boolean casTabAt(final Node<K, V>[] tab, final int i,
- final Node<K, V> c, final Node<K, V> v) {
- return U.compareAndSwapObject(tab, ((long) i << ASHIFT) + ABASE, c, v);
- }
-
- static final <K, V> void setTabAt(final Node<K, V>[] tab, final int i, final Node<K, V> v) {
- U.putObjectVolatile(tab, ((long) i << ASHIFT) + ABASE, v);
- }
-
- /* ---------------- Fields -------------- */
-
- /**
- * The array of bins. Lazily initialized upon first insertion.
- * Size is always a power of two. Accessed directly by iterators.
- */
- transient volatile Node<K, V>[] table;
-
- /**
- * The next table to use; non-null only while resizing.
- */
- private transient volatile Node<K, V>[] nextTable;
-
- /**
- * Base counter value, used mainly when there is no contention,
- * but also as a fallback during table initialization
- * races. Updated via CAS.
- */
- private transient volatile long baseCount;
-
- /**
- * Table initialization and resizing control. When negative, the
- * table is being initialized or resized: -1 for initialization,
- * else -(1 + the number of active resizing threads). Otherwise,
- * when table is null, holds the initial table size to use upon
- * creation, or 0 for default. After initialization, holds the
- * next element count value upon which to resize the table.
- */
- private transient volatile int sizeCtl;
-
- /**
- * The next table index (plus one) to split while resizing.
- */
- private transient volatile int transferIndex;
-
- /**
- * The least available table index to split while resizing.
- */
- private transient volatile int transferOrigin;
-
- /**
- * Spinlock (locked via CAS) used when resizing and/or creating CounterCells.
- */
- private transient volatile int cellsBusy;
-
- /**
- * Table of counter cells. When non-null, size is a power of 2.
- */
- private transient volatile CounterCell[] counterCells;
-
- // views
- private transient KeySetView<K, V> keySet;
- private transient ValuesView<K, V> values;
- private transient EntrySetView<K, V> entrySet;
-
-
- /* ---------------- Public operations -------------- */
-
- /**
- * Creates a new, empty map with the default initial table size (16).
- */
- ConcurrentHashMapV8() {
- }
-
- /**
- * Creates a new, empty map with an initial table size
- * accommodating the specified number of elements without the need
- * to dynamically resize.
- *
- * @param initialCapacity The implementation performs internal
- * sizing to accommodate this many elements.
- * @throws IllegalArgumentException if the initial capacity of
- * elements is negative
- */
- ConcurrentHashMapV8(final int initialCapacity) {
- if (initialCapacity < 0)
- throw new IllegalArgumentException();
- final int cap = ((initialCapacity >= (MAXIMUM_CAPACITY >>> 1)) ?
- MAXIMUM_CAPACITY :
- tableSizeFor(initialCapacity + (initialCapacity >>> 1) + 1));
- this.sizeCtl = cap;
- }
-
- /**
- * Creates a new map with the same mappings as the given map.
- *
- * @param m the map
- */
- ConcurrentHashMapV8(final Map<? extends K, ? extends V> m) {
- this.sizeCtl = DEFAULT_CAPACITY;
- putAll(m);
- }
-
- /**
- * Creates a new, empty map with an initial table size based on
- * the given number of elements ({@code initialCapacity}) and
- * initial table density ({@code loadFactor}).
- *
- * @param initialCapacity the initial capacity. The implementation
- * performs internal sizing to accommodate this many elements,
- * given the specified load factor.
- * @param loadFactor the load factor (table density) for
- * establishing the initial table size
- * @throws IllegalArgumentException if the initial capacity of
- * elements is negative or the load factor is nonpositive
- * @since 1.6
- */
- ConcurrentHashMapV8(final int initialCapacity, final float loadFactor) {
- this(initialCapacity, loadFactor, 1);
- }
-
- /**
- * Creates a new, empty map with an initial table size based on
- * the given number of elements ({@code initialCapacity}), table
- * density ({@code loadFactor}), and number of concurrently
- * updating threads ({@code concurrencyLevel}).
- *
- * @param initialCapacity the initial capacity. The implementation
- * performs internal sizing to accommodate this many elements,
- * given the specified load factor.
- * @param loadFactor the load factor (table density) for
- * establishing the initial table size
- * @param concurrencyLevel the estimated number of concurrently
- * updating threads. The implementation may use this value as
- * a sizing hint.
- * @throws IllegalArgumentException if the initial capacity is
- * negative or the load factor or concurrencyLevel are
- * nonpositive
- */
- ConcurrentHashMapV8(int initialCapacity,
- final float loadFactor, final int concurrencyLevel) {
- if (!(loadFactor > 0.0f) || initialCapacity < 0 || concurrencyLevel <= 0)
- throw new IllegalArgumentException();
- if (initialCapacity < concurrencyLevel) // Use at least as many bins
- initialCapacity = concurrencyLevel; // as estimated threads
- final long size = (long) (1.0 + (long) initialCapacity / loadFactor);
- final int cap = (size >= (long) MAXIMUM_CAPACITY) ?
- MAXIMUM_CAPACITY : tableSizeFor((int) size);
- this.sizeCtl = cap;
- }
-
- // Original (since JDK1.2) Map methods
-
- /**
- * {@inheritDoc}
- */
- public int size() {
- final long n = sumCount();
- return ((n < 0L) ? 0 :
- (n > (long) Integer.MAX_VALUE) ? Integer.MAX_VALUE :
- (int) n);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isEmpty() {
- return sumCount() <= 0L; // ignore transient negative values
- }
-
- /**
- * Returns the value to which the specified key is mapped,
- * or {@code null} if this map contains no mapping for the key.
- *
- * <p>More formally, if this map contains a mapping from a key
- * {@code k} to a value {@code v} such that {@code key.equals(k)},
- * then this method returns {@code v}; otherwise it returns
- * {@code null}. (There can be at most one such mapping.)
- *
- * @throws NullPointerException if the specified key is null
- */
- public V get(final Object key) {
- final Node<K, V>[] tab;
- Node<K, V> e;
- final Node<K, V> p;
- final int n;
- final int eh;
- K ek;
- final int h = spread(key.hashCode());
- if ((tab = table) != null && (n = tab.length) > 0 &&
- (e = tabAt(tab, (n - 1) & h)) != null) {
- if ((eh = e.hash) == h) {
- if ((ek = e.key) == key || (ek != null && key.equals(ek)))
- return e.val;
- } else if (eh < 0)
- return (p = e.find(h, key)) != null ? p.val : null;
- while ((e = e.next) != null) {
- if (e.hash == h &&
- ((ek = e.key) == key || (ek != null && key.equals(ek))))
- return e.val;
- }
- }
- return null;
- }
-
- /**
- * Tests if the specified object is a key in this table.
- *
- * @param key possible key
- * @return {@code true} if and only if the specified object
- * is a key in this table, as determined by the
- * {@code equals} method; {@code false} otherwise
- * @throws NullPointerException if the specified key is null
- */
- public boolean containsKey(final Object key) {
- return get(key) != null;
- }
-
- /**
- * Returns {@code true} if this map maps one or more keys to the
- * specified value. Note: This method may require a full traversal
- * of the map, and is much slower than method {@code containsKey}.
- *
- * @param value value whose presence in this map is to be tested
- * @return {@code true} if this map maps one or more keys to the
- * specified value
- * @throws NullPointerException if the specified value is null
- */
- public boolean containsValue(final Object value) {
- if (value == null)
- throw new NullPointerException();
- final Node<K, V>[] t;
- if ((t = table) != null) {
- final Traverser<K, V> it = new Traverser<K, V>(t, t.length, 0, t.length);
- for (Node<K, V> p; (p = it.advance()) != null; ) {
- final V v;
- if ((v = p.val) == value || (v != null && value.equals(v)))
- return true;
- }
- }
- return false;
- }
-
- /**
- * Maps the specified key to the specified value in this table.
- * Neither the key nor the value can be null.
- *
- * <p>The value can be retrieved by calling the {@code get} method
- * with a key that is equal to the original key.
- *
- * @param key key with which the specified value is to be associated
- * @param value value to be associated with the specified key
- * @return the previous value associated with {@code key}, or
- * {@code null} if there was no mapping for {@code key}
- * @throws NullPointerException if the specified key or value is null
- */
- public V put(final K key, final V value) {
- return putVal(key, value, false);
- }
-
- /**
- * Implementation for put and putIfAbsent
- */
- final V putVal(final K key, final V value, final boolean onlyIfAbsent) {
- if (key == null || value == null) throw new NullPointerException();
- final int hash = spread(key.hashCode());
- int binCount = 0;
- for (Node<K, V>[] tab = table; ; ) {
- final Node<K, V> f;
- final int n;
- final int i;
- final int fh;
- if (tab == null || (n = tab.length) == 0)
- tab = initTable();
- else if ((f = tabAt(tab, i = (n - 1) & hash)) == null) {
- if (casTabAt(tab, i, null,
- new Node<K, V>(hash, key, value, null)))
- break; // no lock when adding to empty bin
- } else if ((fh = f.hash) == MOVED)
- tab = helpTransfer(tab, f);
- else {
- V oldVal = null;
- synchronized (f) {
- if (tabAt(tab, i) == f) {
- if (fh >= 0) {
- binCount = 1;
- for (Node<K, V> e = f; ; ++binCount) {
- final K ek;
- if (e.hash == hash &&
- ((ek = e.key) == key ||
- (ek != null && key.equals(ek)))) {
- oldVal = e.val;
- if (!onlyIfAbsent)
- e.val = value;
- break;
- }
- final Node<K, V> pred = e;
- if ((e = e.next) == null) {
- pred.next = new Node<K, V>(hash, key,
- value, null);
- break;
- }
- }
- } else if (f instanceof TreeBin) {
- final Node<K, V> p;
- binCount = 2;
- if ((p = ((TreeBin<K, V>) f).putTreeVal(hash, key,
- value)) != null) {
- oldVal = p.val;
- if (!onlyIfAbsent)
- p.val = value;
- }
- }
- }
- }
- if (binCount != 0) {
- if (binCount >= TREEIFY_THRESHOLD)
- treeifyBin(tab, i);
- if (oldVal != null)
- return oldVal;
- break;
- }
- }
- }
- addCount(1L, binCount);
- return null;
- }
-
- /**
- * Copies all of the mappings from the specified map to this one.
- * These mappings replace any mappings that this map had for any of the
- * keys currently in the specified map.
- *
- * @param m mappings to be stored in this map
- */
- public void putAll(final Map<? extends K, ? extends V> m) {
- tryPresize(m.size());
- for (final Map.Entry<? extends K, ? extends V> e : m.entrySet())
- putVal(e.getKey(), e.getValue(), false);
- }
-
- /**
- * Removes the key (and its corresponding value) from this map.
- * This method does nothing if the key is not in the map.
- *
- * @param key the key that needs to be removed
- * @return the previous value associated with {@code key}, or
- * {@code null} if there was no mapping for {@code key}
- * @throws NullPointerException if the specified key is null
- */
- public V remove(final Object key) {
- return replaceNode(key, null, null);
- }
-
- /**
- * Implementation for the four public remove/replace methods:
- * Replaces node value with v, conditional upon match of cv if
- * non-null. If resulting value is null, delete.
- */
- final V replaceNode(final Object key, final V value, final Object cv) {
- final int hash = spread(key.hashCode());
- for (Node<K, V>[] tab = table; ; ) {
- final Node<K, V> f;
- final int n;
- final int i;
- final int fh;
- if (tab == null || (n = tab.length) == 0 ||
- (f = tabAt(tab, i = (n - 1) & hash)) == null)
- break;
- else if ((fh = f.hash) == MOVED)
- tab = helpTransfer(tab, f);
- else {
- V oldVal = null;
- boolean validated = false;
- synchronized (f) {
- if (tabAt(tab, i) == f) {
- if (fh >= 0) {
- validated = true;
- for (Node<K, V> e = f, pred = null; ; ) {
- final K ek;
- if (e.hash == hash &&
- ((ek = e.key) == key ||
- (ek != null && key.equals(ek)))) {
- final V ev = e.val;
- if (cv == null || cv == ev ||
- (ev != null && cv.equals(ev))) {
- oldVal = ev;
- if (value != null)
- e.val = value;
- else if (pred != null)
- pred.next = e.next;
- else
- setTabAt(tab, i, e.next);
- }
- break;
- }
- pred = e;
- if ((e = e.next) == null)
- break;
- }
- } else if (f instanceof TreeBin) {
- validated = true;
- final TreeBin<K, V> t = (TreeBin<K, V>) f;
- final TreeNode<K, V> r;
- final TreeNode<K, V> p;
- if ((r = t.root) != null &&
- (p = r.findTreeNode(hash, key, null)) != null) {
- final V pv = p.val;
- if (cv == null || cv == pv ||
- (pv != null && cv.equals(pv))) {
- oldVal = pv;
- if (value != null)
- p.val = value;
- else if (t.removeTreeNode(p))
- setTabAt(tab, i, untreeify(t.first));
- }
- }
- }
- }
- }
- if (validated) {
- if (oldVal != null) {
- if (value == null)
- addCount(-1L, -1);
- return oldVal;
- }
- break;
- }
- }
- }
- return null;
- }
-
- /**
- * Removes all of the mappings from this map.
- */
- public void clear() {
- long delta = 0L; // negative number of deletions
- int i = 0;
- Node<K, V>[] tab = table;
- while (tab != null && i < tab.length) {
- final int fh;
- final Node<K, V> f = tabAt(tab, i);
- if (f == null)
- ++i;
- else if ((fh = f.hash) == MOVED) {
- tab = helpTransfer(tab, f);
- i = 0; // restart
- } else {
- synchronized (f) {
- if (tabAt(tab, i) == f) {
- Node<K, V> p = (fh >= 0 ? f :
- (f instanceof TreeBin) ?
- ((TreeBin<K, V>) f).first : null);
- while (p != null) {
- --delta;
- p = p.next;
- }
- setTabAt(tab, i++, null);
- }
- }
- }
- }
- if (delta != 0L)
- addCount(delta, -1);
- }
-
- /**
- * Returns a {@link Set} view of the keys contained in this map.
- * The set is backed by the map, so changes to the map are
- * reflected in the set, and vice-versa. The set supports element
- * removal, which removes the corresponding mapping from this map,
- * via the {@code Iterator.remove}, {@code Set.remove},
- * {@code removeAll}, {@code retainAll}, and {@code clear}
- * operations. It does not support the {@code add} or
- * {@code addAll} operations.
- *
- * <p>The view's {@code iterator} is a "weakly consistent" iterator
- * that will never throw {@link ConcurrentModificationException},
- * and guarantees to traverse elements as they existed upon
- * construction of the iterator, and may (but is not guaranteed to)
- * reflect any modifications subsequent to construction.
- *
- * @return the set view
- */
- public KeySetView<K, V> keySet() {
- final KeySetView<K, V> ks;
- return (ks = keySet) != null ? ks : (keySet = new KeySetView<K, V>(this, null));
- }
-
- /**
- * Returns a {@link Collection} view of the values contained in this map.
- * The collection is backed by the map, so changes to the map are
- * reflected in the collection, and vice-versa. The collection
- * supports element removal, which removes the corresponding
- * mapping from this map, via the {@code Iterator.remove},
- * {@code Collection.remove}, {@code removeAll},
- * {@code retainAll}, and {@code clear} operations. It does not
- * support the {@code add} or {@code addAll} operations.
- *
- * <p>The view's {@code iterator} is a "weakly consistent" iterator
- * that will never throw {@link ConcurrentModificationException},
- * and guarantees to traverse elements as they existed upon
- * construction of the iterator, and may (but is not guaranteed to)
- * reflect any modifications subsequent to construction.
- *
- * @return the collection view
- */
- public Collection<V> values() {
- final ValuesView<K, V> vs;
- return (vs = values) != null ? vs : (values = new ValuesView<K, V>(this));
- }
-
- /**
- * Returns a {@link Set} view of the mappings contained in this map.
- * The set is backed by the map, so changes to the map are
- * reflected in the set, and vice-versa. The set supports element
- * removal, which removes the corresponding mapping from the map,
- * via the {@code Iterator.remove}, {@code Set.remove},
- * {@code removeAll}, {@code retainAll}, and {@code clear}
- * operations.
- *
- * <p>The view's {@code iterator} is a "weakly consistent" iterator
- * that will never throw {@link ConcurrentModificationException},
- * and guarantees to traverse elements as they existed upon
- * construction of the iterator, and may (but is not guaranteed to)
- * reflect any modifications subsequent to construction.
- *
- * @return the set view
- */
- public Set<Map.Entry<K, V>> entrySet() {
- final EntrySetView<K, V> es;
- return (es = entrySet) != null ? es : (entrySet = new EntrySetView<K, V>(this));
- }
-
- /**
- * Returns the hash code value for this {@link Map}, i.e.,
- * the sum of, for each key-value pair in the map,
- * {@code key.hashCode() ^ value.hashCode()}.
- *
- * @return the hash code value for this map
- */
- public int hashCode() {
- int h = 0;
- final Node<K, V>[] t;
- if ((t = table) != null) {
- final Traverser<K, V> it = new Traverser<K, V>(t, t.length, 0, t.length);
- for (Node<K, V> p; (p = it.advance()) != null; )
- h += p.key.hashCode() ^ p.val.hashCode();
- }
- return h;
- }
-
- /**
- * Returns a string representation of this map. The string
- * representation consists of a list of key-value mappings (in no
- * particular order) enclosed in braces ("{@code {}}"). Adjacent
- * mappings are separated by the characters {@code ", "} (comma
- * and space). Each key-value mapping is rendered as the key
- * followed by an equals sign ("{@code =}") followed by the
- * associated value.
- *
- * @return a string representation of this map
- */
- public String toString() {
- final Node<K, V>[] t;
- final int f = (t = table) == null ? 0 : t.length;
- final Traverser<K, V> it = new Traverser<K, V>(t, f, 0, f);
- final StringBuilder sb = new StringBuilder();
- sb.append('{');
- Node<K, V> p;
- if ((p = it.advance()) != null) {
- for (; ; ) {
- final K k = p.key;
- final V v = p.val;
- sb.append(k == this ? "(this Map)" : k);
- sb.append('=');
- sb.append(v == this ? "(this Map)" : v);
- if ((p = it.advance()) == null)
- break;
- sb.append(',').append(' ');
- }
- }
- return sb.append('}').toString();
- }
-
- /**
- * Compares the specified object with this map for equality.
- * Returns {@code true} if the given object is a map with the same
- * mappings as this map. This operation may return misleading
- * results if either map is concurrently modified during execution
- * of this method.
- *
- * @param o object to be compared for equality with this map
- * @return {@code true} if the specified object is equal to this map
- */
- public boolean equals(final Object o) {
- if (o != this) {
- if (!(o instanceof Map))
- return false;
- final Map<?, ?> m = (Map<?, ?>) o;
- final Node<K, V>[] t;
- final int f = (t = table) == null ? 0 : t.length;
- final Traverser<K, V> it = new Traverser<K, V>(t, f, 0, f);
- for (Node<K, V> p; (p = it.advance()) != null; ) {
- final V val = p.val;
- final Object v = m.get(p.key);
- if (v == null || (v != val && !v.equals(val)))
- return false;
- }
- for (final Map.Entry<?, ?> e : m.entrySet()) {
- final Object mk;
- final Object mv;
- final Object v;
- if ((mk = e.getKey()) == null ||
- (mv = e.getValue()) == null ||
- (v = get(mk)) == null ||
- (mv != v && !mv.equals(v)))
- return false;
- }
- }
- return true;
- }
-
- /**
- * Stripped-down version of helper class used in previous version,
- * declared for the sake of serialization compatibility
- */
- static class Segment<K, V> extends ReentrantLock implements Serializable {
- private static final long serialVersionUID = 2249069246763182397L;
- final float loadFactor;
-
- Segment(final float lf) {
- this.loadFactor = lf;
- }
- }
-
- /**
- * Saves the state of the {@code ConcurrentHashMapV8} instance to a
- * stream (i.e., serializes it).
- *
- * @param s the stream
- * @throws java.io.IOException if an I/O error occurs
- * @serialData the key (Object) and value (Object)
- * for each key-value mapping, followed by a null pair.
- * The key-value mappings are emitted in no particular order.
- */
- private void writeObject(final java.io.ObjectOutputStream s)
- throws java.io.IOException {
- // For serialization compatibility
- // Emulate segment calculation from previous version of this class
- int sshift = 0;
- int ssize = 1;
- while (ssize < DEFAULT_CONCURRENCY_LEVEL) {
- ++sshift;
- ssize <<= 1;
- }
- final int segmentShift = 32 - sshift;
- final int segmentMask = ssize - 1;
- @SuppressWarnings("unchecked") Segment<K, V>[] segments = (Segment<K, V>[])
- new Segment<?, ?>[DEFAULT_CONCURRENCY_LEVEL];
- for (int i = 0; i < segments.length; ++i)
- segments[i] = new Segment<K, V>(LOAD_FACTOR);
- s.putFields().put("segments", segments);
- s.putFields().put("segmentShift", segmentShift);
- s.putFields().put("segmentMask", segmentMask);
- s.writeFields();
-
- final Node<K, V>[] t;
- if ((t = table) != null) {
- final Traverser<K, V> it = new Traverser<K, V>(t, t.length, 0, t.length);
- for (Node<K, V> p; (p = it.advance()) != null; ) {
- s.writeObject(p.key);
- s.writeObject(p.val);
- }
- }
- s.writeObject(null);
- s.writeObject(null);
- segments = null; // throw away
- }
-
- /**
- * Reconstitutes the instance from a stream (that is, deserializes it).
- *
- * @param s the stream
- * @throws ClassNotFoundException if the class of a serialized object
- * could not be found
- * @throws java.io.IOException if an I/O error occurs
- */
- private void readObject(final java.io.ObjectInputStream s)
- throws java.io.IOException, ClassNotFoundException {
- /*
- * To improve performance in typical cases, we create nodes
- * while reading, then place in table once size is known.
- * However, we must also validate uniqueness and deal with
- * overpopulated bins while doing so, which requires
- * specialized versions of putVal mechanics.
- */
- sizeCtl = -1; // force exclusion for table construction
- s.defaultReadObject();
- long size = 0L;
- Node<K, V> p = null;
- for (; ; ) {
- @SuppressWarnings("unchecked") final K k = (K) s.readObject();
- @SuppressWarnings("unchecked") final V v = (V) s.readObject();
- if (k != null && v != null) {
- p = new Node<K, V>(spread(k.hashCode()), k, v, p);
- ++size;
- } else
- break;
- }
- if (size == 0L)
- sizeCtl = 0;
- else {
- final int n;
- if (size >= (long) (MAXIMUM_CAPACITY >>> 1))
- n = MAXIMUM_CAPACITY;
- else {
- final int sz = (int) size;
- n = tableSizeFor(sz + (sz >>> 1) + 1);
- }
- @SuppressWarnings({"rawtypes", "unchecked"}) final
- Node<K, V>[] tab = (Node<K, V>[]) new Node[n];
- final int mask = n - 1;
- long added = 0L;
- while (p != null) {
- boolean insertAtFront;
- final Node<K, V> next = p.next;
- final Node<K, V> first;
- final int h = p.hash;
- final int j = h & mask;
- if ((first = tabAt(tab, j)) == null)
- insertAtFront = true;
- else {
- final K k = p.key;
- if (first.hash < 0) {
- final TreeBin<K, V> t = (TreeBin<K, V>) first;
- if (t.putTreeVal(h, k, p.val) == null)
- ++added;
- insertAtFront = false;
- } else {
- int binCount = 0;
- insertAtFront = true;
- Node<K, V> q;
- K qk;
- for (q = first; q != null; q = q.next) {
- if (q.hash == h &&
- ((qk = q.key) == k ||
- (qk != null && k.equals(qk)))) {
- insertAtFront = false;
- break;
- }
- ++binCount;
- }
- if (insertAtFront && binCount >= TREEIFY_THRESHOLD) {
- insertAtFront = false;
- ++added;
- p.next = first;
- TreeNode<K, V> hd = null, tl = null;
- for (q = p; q != null; q = q.next) {
- final TreeNode<K, V> t = new TreeNode<K, V>
- (q.hash, q.key, q.val, null, null);
- if ((t.prev = tl) == null)
- hd = t;
- else
- tl.next = t;
- tl = t;
- }
- setTabAt(tab, j, new TreeBin<K, V>(hd));
- }
- }
- }
- if (insertAtFront) {
- ++added;
- p.next = first;
- setTabAt(tab, j, p);
- }
- p = next;
- }
- table = tab;
- sizeCtl = n - (n >>> 2);
- baseCount = added;
- }
- }
-
- // ConcurrentMap methods
-
- /**
- * {@inheritDoc}
- *
- * @return the previous value associated with the specified key,
- * or {@code null} if there was no mapping for the key
- * @throws NullPointerException if the specified key or value is null
- */
- public V putIfAbsent(final K key, final V value) {
- return putVal(key, value, true);
- }
-
- /**
- * {@inheritDoc}
- *
- * @throws NullPointerException if the specified key is null
- */
- public boolean remove(final Object key, final Object value) {
- if (key == null)
- throw new NullPointerException();
- return value != null && replaceNode(key, null, value) != null;
- }
-
- /**
- * {@inheritDoc}
- *
- * @throws NullPointerException if any of the arguments are null
- */
- public boolean replace(final K key, final V oldValue, final V newValue) {
- if (key == null || oldValue == null || newValue == null)
- throw new NullPointerException();
- return replaceNode(key, newValue, oldValue) != null;
- }
-
- /**
- * {@inheritDoc}
- *
- * @return the previous value associated with the specified key,
- * or {@code null} if there was no mapping for the key
- * @throws NullPointerException if the specified key or value is null
- */
- public V replace(final K key, final V value) {
- if (key == null || value == null)
- throw new NullPointerException();
- return replaceNode(key, value, null);
- }
-
- // Overrides of JDK8+ Map extension method defaults
-
- /**
- * Returns the value to which the specified key is mapped, or the
- * given default value if this map contains no mapping for the
- * key.
- *
- * @param key the key whose associated value is to be returned
- * @param defaultValue the value to return if this map contains
- * no mapping for the given key
- * @return the mapping for the key, if present; else the default value
- * @throws NullPointerException if the specified key is null
- */
- public V getOrDefault(final Object key, final V defaultValue) {
- final V v;
- return (v = get(key)) == null ? defaultValue : v;
- }
-
-
- // Hashtable legacy methods
-
- /**
- * Legacy method testing if some key maps into the specified value
- * in this table. This method is identical in functionality to
- * {@link #containsValue(Object)}, and exists solely to ensure
- * full compatibility with class {@link java.util.Hashtable},
- * which supported this method prior to introduction of the
- * Java Collections framework.
- *
- * @param value a value to search for
- * @return {@code true} if and only if some key maps to the
- * {@code value} argument in this table as
- * determined by the {@code equals} method;
- * {@code false} otherwise
- * @throws NullPointerException if the specified value is null
- */
- @Deprecated
- public boolean contains(final Object value) {
- return containsValue(value);
- }
-
- /**
- * Returns an enumeration of the keys in this table.
- *
- * @return an enumeration of the keys in this table
- * @see #keySet()
- */
- public Enumeration<K> keys() {
- final Node<K, V>[] t;
- final int f = (t = table) == null ? 0 : t.length;
- return new KeyIterator<K, V>(t, f, 0, f, this);
- }
-
- /**
- * Returns an enumeration of the values in this table.
- *
- * @return an enumeration of the values in this table
- * @see #values()
- */
- public Enumeration<V> elements() {
- final Node<K, V>[] t;
- final int f = (t = table) == null ? 0 : t.length;
- return new ValueIterator<K, V>(t, f, 0, f, this);
- }
-
- // ConcurrentHashMapV8-only methods
-
- /**
- * Returns the number of mappings. This method should be used
- * instead of {@link #size} because a ConcurrentHashMapV8 may
- * contain more mappings than can be represented as an int. The
- * value returned is an estimate; the actual count may differ if
- * there are concurrent insertions or removals.
- *
- * @return the number of mappings
- * @since 1.8
- */
- public long mappingCount() {
- final long n = sumCount();
- return (n < 0L) ? 0L : n; // ignore transient negative values
- }
-
- /**
- * Creates a new {@link Set} backed by a ConcurrentHashMapV8
- * from the given type to {@code Boolean.TRUE}.
- *
- * @return the new set
- * @since 1.8
- */
- public static <K> KeySetView<K, Boolean> newKeySet() {
- return new KeySetView<K, Boolean>
- (new ConcurrentHashMapV8<K, Boolean>(), Boolean.TRUE);
- }
-
- /**
- * Creates a new {@link Set} backed by a ConcurrentHashMapV8
- * from the given type to {@code Boolean.TRUE}.
- *
- * @param initialCapacity The implementation performs internal
- * sizing to accommodate this many elements.
- * @return the new set
- * @throws IllegalArgumentException if the initial capacity of
- * elements is negative
- * @since 1.8
- */
- public static <K> KeySetView<K, Boolean> newKeySet(final int initialCapacity) {
- return new KeySetView<K, Boolean>
- (new ConcurrentHashMapV8<K, Boolean>(initialCapacity), Boolean.TRUE);
- }
-
- /**
- * Returns a {@link Set} view of the keys in this map, using the
- * given common mapped value for any additions (i.e., {@link
- * Collection#add} and {@link Collection#addAll(Collection)}).
- * This is of course only appropriate if it is acceptable to use
- * the same value for all additions from this view.
- *
- * @param mappedValue the mapped value to use for any additions
- * @return the set view
- * @throws NullPointerException if the mappedValue is null
- */
- public KeySetView<K, V> keySet(final V mappedValue) {
- if (mappedValue == null)
- throw new NullPointerException();
- return new KeySetView<K, V>(this, mappedValue);
- }
-
- /* ---------------- Special Nodes -------------- */
-
- /**
- * A node inserted at head of bins during transfer operations.
- */
- static final class ForwardingNode<K, V> extends Node<K, V> {
- final Node<K, V>[] nextTable;
-
- ForwardingNode(final Node<K, V>[] tab) {
- super(MOVED, null, null, null);
- this.nextTable = tab;
- }
-
- Node<K, V> find(final int h, final Object k) {
- // loop to avoid arbitrarily deep recursion on forwarding nodes
- outer:
- for (Node<K, V>[] tab = nextTable; ; ) {
- Node<K, V> e;
- final int n;
- if (k == null || tab == null || (n = tab.length) == 0 ||
- (e = tabAt(tab, (n - 1) & h)) == null)
- return null;
- for (; ; ) {
- final int eh;
- final K ek;
- if ((eh = e.hash) == h &&
- ((ek = e.key) == k || (ek != null && k.equals(ek))))
- return e;
- if (eh < 0) {
- if (e instanceof ForwardingNode) {
- tab = ((ForwardingNode<K, V>) e).nextTable;
- continue outer;
- } else
- return e.find(h, k);
- }
- if ((e = e.next) == null)
- return null;
- }
- }
- }
- }
-
- /**
- * A place-holder node used in computeIfAbsent and compute
- */
- static final class ReservationNode<K, V> extends Node<K, V> {
- ReservationNode() {
- super(RESERVED, null, null, null);
- }
-
- Node<K, V> find(final int h, final Object k) {
- return null;
- }
- }
-
- /* ---------------- Table Initialization and Resizing -------------- */
-
- /**
- * Initializes table, using the size recorded in sizeCtl.
- */
- private final Node<K, V>[] initTable() {
- Node<K, V>[] tab;
- int sc;
- while ((tab = table) == null || tab.length == 0) {
- if ((sc = sizeCtl) < 0)
- Thread.yield(); // lost initialization race; just spin
- else if (U.compareAndSwapInt(this, SIZECTL, sc, -1)) {
- try {
- if ((tab = table) == null || tab.length == 0) {
- final int n = (sc > 0) ? sc : DEFAULT_CAPACITY;
- @SuppressWarnings({"rawtypes", "unchecked"}) final
- Node<K, V>[] nt = (Node<K, V>[]) new Node[n];
- table = tab = nt;
- sc = n - (n >>> 2);
- }
- } finally {
- sizeCtl = sc;
- }
- break;
- }
- }
- return tab;
- }
-
- /**
- * Adds to count, and if table is too small and not already
- * resizing, initiates transfer. If already resizing, helps
- * perform transfer if work is available. Rechecks occupancy
- * after a transfer to see if another resize is already needed
- * because resizings are lagging additions.
- *
- * @param x the count to add
- * @param check if <0, don't check resize, if <= 1 only check if uncontended
- */
- private final void addCount(final long x, final int check) {
- final CounterCell[] as;
- final long b;
- long s;
- if ((as = counterCells) != null ||
- !U.compareAndSwapLong(this, BASECOUNT, b = baseCount, s = b + x)) {
- final CounterHashCode hc;
- final CounterCell a;
- final long v;
- final int m;
- boolean uncontended = true;
- if ((hc = threadCounterHashCode.get()) == null ||
- as == null || (m = as.length - 1) < 0 ||
- (a = as[m & hc.code]) == null ||
- !(uncontended =
- U.compareAndSwapLong(a, CELLVALUE, v = a.value, v + x))) {
- fullAddCount(x, hc, uncontended);
- return;
- }
- if (check <= 1)
- return;
- s = sumCount();
- }
- if (check >= 0) {
- Node<K, V>[] tab, nt;
- int sc;
- while (s >= (long) (sc = sizeCtl) && (tab = table) != null &&
- tab.length < MAXIMUM_CAPACITY) {
- if (sc < 0) {
- if (sc == -1 || transferIndex <= transferOrigin ||
- (nt = nextTable) == null)
- break;
- if (U.compareAndSwapInt(this, SIZECTL, sc, sc - 1))
- transfer(tab, nt);
- } else if (U.compareAndSwapInt(this, SIZECTL, sc, -2))
- transfer(tab, null);
- s = sumCount();
- }
- }
- }
-
- /**
- * Helps transfer if a resize is in progress.
- */
- final Node<K, V>[] helpTransfer(final Node<K, V>[] tab, final Node<K, V> f) {
- final Node<K, V>[] nextTab;
- final int sc;
- if ((f instanceof ForwardingNode) &&
- (nextTab = ((ForwardingNode<K, V>) f).nextTable) != null) {
- if (nextTab == nextTable && tab == table &&
- transferIndex > transferOrigin && (sc = sizeCtl) < -1 &&
- U.compareAndSwapInt(this, SIZECTL, sc, sc - 1))
- transfer(tab, nextTab);
- return nextTab;
- }
- return table;
- }
-
- /**
- * Tries to presize table to accommodate the given number of elements.
- *
- * @param size number of elements (doesn't need to be perfectly accurate)
- */
- private final void tryPresize(final int size) {
- final int c = (size >= (MAXIMUM_CAPACITY >>> 1)) ? MAXIMUM_CAPACITY :
- tableSizeFor(size + (size >>> 1) + 1);
- int sc;
- while ((sc = sizeCtl) >= 0) {
- final Node<K, V>[] tab = table;
- int n;
- if (tab == null || (n = tab.length) == 0) {
- n = (sc > c) ? sc : c;
- if (U.compareAndSwapInt(this, SIZECTL, sc, -1)) {
- try {
- if (table == tab) {
- @SuppressWarnings({"rawtypes", "unchecked"}) final
- Node<K, V>[] nt = (Node<K, V>[]) new Node[n];
- table = nt;
- sc = n - (n >>> 2);
- }
- } finally {
- sizeCtl = sc;
- }
- }
- } else if (c <= sc || n >= MAXIMUM_CAPACITY)
- break;
- else if (tab == table &&
- U.compareAndSwapInt(this, SIZECTL, sc, -2))
- transfer(tab, null);
- }
- }
-
- /**
- * Moves and/or copies the nodes in each bin to new table. See
- * above for explanation.
- */
- private final void transfer(final Node<K, V>[] tab, Node<K, V>[] nextTab) {
- final int n = tab.length;
- int stride;
- if ((stride = (NCPU > 1) ? (n >>> 3) / NCPU : n) < MIN_TRANSFER_STRIDE)
- stride = MIN_TRANSFER_STRIDE; // subdivide range
- if (nextTab == null) { // initiating
- try {
- @SuppressWarnings({"rawtypes", "unchecked"}) final
- Node<K, V>[] nt = (Node<K, V>[]) new Node[n << 1];
- nextTab = nt;
- } catch (final Throwable ex) { // try to cope with OOME
- sizeCtl = Integer.MAX_VALUE;
- return;
- }
- nextTable = nextTab;
- transferOrigin = n;
- transferIndex = n;
- final ForwardingNode<K, V> rev = new ForwardingNode<K, V>(tab);
- for (int k = n; k > 0; ) { // progressively reveal ready slots
- final int nextk = (k > stride) ? k - stride : 0;
- for (int m = nextk; m < k; ++m)
- nextTab[m] = rev;
- for (int m = n + nextk; m < n + k; ++m)
- nextTab[m] = rev;
- U.putOrderedInt(this, TRANSFERORIGIN, k = nextk);
- }
- }
- final int nextn = nextTab.length;
- final ForwardingNode<K, V> fwd = new ForwardingNode<K, V>(nextTab);
- boolean advance = true;
- boolean finishing = false; // to ensure sweep before committing nextTab
- for (int i = 0, bound = 0; ; ) {
- int nextIndex;
- int nextBound;
- final int fh;
- final Node<K, V> f;
- while (advance) {
- if (--i >= bound || finishing)
- advance = false;
- else if ((nextIndex = transferIndex) <= transferOrigin) {
- i = -1;
- advance = false;
- } else if (U.compareAndSwapInt
- (this, TRANSFERINDEX, nextIndex,
- nextBound = (nextIndex > stride ?
- nextIndex - stride : 0))) {
- bound = nextBound;
- i = nextIndex - 1;
- advance = false;
- }
- }
- if (i < 0 || i >= n || i + n >= nextn) {
- if (finishing) {
- nextTable = null;
- table = nextTab;
- sizeCtl = (n << 1) - (n >>> 1);
- return;
- }
- for (int sc; ; ) {
- if (U.compareAndSwapInt(this, SIZECTL, sc = sizeCtl, ++sc)) {
- if (sc != -1)
- return;
- finishing = advance = true;
- i = n; // recheck before commit
- break;
- }
- }
- } else if ((f = tabAt(tab, i)) == null) {
- if (casTabAt(tab, i, null, fwd)) {
- setTabAt(nextTab, i, null);
- setTabAt(nextTab, i + n, null);
- advance = true;
- }
- } else if ((fh = f.hash) == MOVED)
- advance = true; // already processed
- else {
- synchronized (f) {
- if (tabAt(tab, i) == f) {
- Node<K, V> ln, hn;
- if (fh >= 0) {
- int runBit = fh & n;
- Node<K, V> lastRun = f;
- for (Node<K, V> p = f.next; p != null; p = p.next) {
- final int b = p.hash & n;
- if (b != runBit) {
- runBit = b;
- lastRun = p;
- }
- }
- if (runBit == 0) {
- ln = lastRun;
- hn = null;
- } else {
- hn = lastRun;
- ln = null;
- }
- for (Node<K, V> p = f; p != lastRun; p = p.next) {
- final int ph = p.hash;
- final K pk = p.key;
- final V pv = p.val;
- if ((ph & n) == 0)
- ln = new Node<K, V>(ph, pk, pv, ln);
- else
- hn = new Node<K, V>(ph, pk, pv, hn);
- }
- setTabAt(nextTab, i, ln);
- setTabAt(nextTab, i + n, hn);
- setTabAt(tab, i, fwd);
- advance = true;
- } else if (f instanceof TreeBin) {
- final TreeBin<K, V> t = (TreeBin<K, V>) f;
- TreeNode<K, V> lo = null, loTail = null;
- TreeNode<K, V> hi = null, hiTail = null;
- int lc = 0, hc = 0;
- for (Node<K, V> e = t.first; e != null; e = e.next) {
- final int h = e.hash;
- final TreeNode<K, V> p = new TreeNode<K, V>
- (h, e.key, e.val, null, null);
- if ((h & n) == 0) {
- if ((p.prev = loTail) == null)
- lo = p;
- else
- loTail.next = p;
- loTail = p;
- ++lc;
- } else {
- if ((p.prev = hiTail) == null)
- hi = p;
- else
- hiTail.next = p;
- hiTail = p;
- ++hc;
- }
- }
- ln = (lc <= UNTREEIFY_THRESHOLD) ? untreeify(lo) :
- (hc != 0) ? new TreeBin<K, V>(lo) : t;
- hn = (hc <= UNTREEIFY_THRESHOLD) ? untreeify(hi) :
- (lc != 0) ? new TreeBin<K, V>(hi) : t;
- setTabAt(nextTab, i, ln);
- setTabAt(nextTab, i + n, hn);
- setTabAt(tab, i, fwd);
- advance = true;
- }
- }
- }
- }
- }
- }
-
- /* ---------------- Conversion from/to TreeBins -------------- */
-
- /**
- * Replaces all linked nodes in bin at given index unless table is
- * too small, in which case resizes instead.
- */
- private final void treeifyBin(final Node<K, V>[] tab, final int index) {
- final Node<K, V> b;
- final int n;
- final int sc;
- if (tab != null) {
- if ((n = tab.length) < MIN_TREEIFY_CAPACITY) {
- if (tab == table && (sc = sizeCtl) >= 0 &&
- U.compareAndSwapInt(this, SIZECTL, sc, -2))
- transfer(tab, null);
- } else if ((b = tabAt(tab, index)) != null && b.hash >= 0) {
- synchronized (b) {
- if (tabAt(tab, index) == b) {
- TreeNode<K, V> hd = null, tl = null;
- for (Node<K, V> e = b; e != null; e = e.next) {
- final TreeNode<K, V> p =
- new TreeNode<K, V>(e.hash, e.key, e.val,
- null, null);
- if ((p.prev = tl) == null)
- hd = p;
- else
- tl.next = p;
- tl = p;
- }
- setTabAt(tab, index, new TreeBin<K, V>(hd));
- }
- }
- }
- }
- }
-
- /**
- * Returns a list on non-TreeNodes replacing those in given list.
- */
- static <K, V> Node<K, V> untreeify(final Node<K, V> b) {
- Node<K, V> hd = null, tl = null;
- for (Node<K, V> q = b; q != null; q = q.next) {
- final Node<K, V> p = new Node<K, V>(q.hash, q.key, q.val, null);
- if (tl == null)
- hd = p;
- else
- tl.next = p;
- tl = p;
- }
- return hd;
- }
-
- /* ---------------- TreeNodes -------------- */
-
- /**
- * Nodes for use in TreeBins
- */
- static final class TreeNode<K, V> extends Node<K, V> {
- TreeNode<K, V> parent; // red-black tree links
- TreeNode<K, V> left;
- TreeNode<K, V> right;
- TreeNode<K, V> prev; // needed to unlink next upon deletion
- boolean red;
-
- TreeNode(final int hash, final K key, final V val, final Node<K, V> next,
- final TreeNode<K, V> parent) {
- super(hash, key, val, next);
- this.parent = parent;
- }
-
- Node<K, V> find(final int h, final Object k) {
- return findTreeNode(h, k, null);
- }
-
- /**
- * Returns the TreeNode (or null if not found) for the given key
- * starting at given root.
- */
- final TreeNode<K, V> findTreeNode(final int h, final Object k, Class<?> kc) {
- if (k != null) {
- TreeNode<K, V> p = this;
- do {
- final int ph;
- final int dir;
- final K pk;
- final TreeNode<K, V> q;
- final TreeNode<K, V> pl = p.left;
- final TreeNode<K, V> pr = p.right;
- if ((ph = p.hash) > h)
- p = pl;
- else if (ph < h)
- p = pr;
- else if ((pk = p.key) == k || (pk != null && k.equals(pk)))
- return p;
- else if (pl == null)
- p = pr;
- else if (pr == null)
- p = pl;
- else if ((kc != null ||
- (kc = comparableClassFor(k)) != null) &&
- (dir = compareComparables(kc, k, pk)) != 0)
- p = (dir < 0) ? pl : pr;
- else if ((q = pr.findTreeNode(h, k, kc)) != null)
- return q;
- else
- p = pl;
- } while (p != null);
- }
- return null;
- }
- }
-
- /* ---------------- TreeBins -------------- */
-
- /**
- * TreeNodes used at the heads of bins. TreeBins do not hold user
- * keys or values, but instead point to list of TreeNodes and
- * their root. They also maintain a parasitic read-write lock
- * forcing writers (who hold bin lock) to wait for readers (who do
- * not) to complete before tree restructuring operations.
- */
- static final class TreeBin<K, V> extends Node<K, V> {
- TreeNode<K, V> root;
- volatile TreeNode<K, V> first;
- volatile Thread waiter;
- volatile int lockState;
- // values for lockState
- static final int WRITER = 1; // set while holding write lock
- static final int WAITER = 2; // set when waiting for write lock
- static final int READER = 4; // increment value for setting read lock
-
- /**
- * Tie-breaking utility for ordering insertions when equal
- * hashCodes and non-comparable. We don't require a total
- * order, just a consistent insertion rule to maintain
- * equivalence across rebalancings. Tie-breaking further than
- * necessary simplifies testing a bit.
- */
- static int tieBreakOrder(final Object a, final Object b) {
- int d;
- if (a == null || b == null ||
- (d = a.getClass().getName().
- compareTo(b.getClass().getName())) == 0)
- d = (System.identityHashCode(a) <= System.identityHashCode(b) ?
- -1 : 1);
- return d;
- }
-
- /**
- * Creates bin with initial set of nodes headed by b.
- */
- TreeBin(final TreeNode<K, V> b) {
- super(TREEBIN, null, null, null);
- this.first = b;
- TreeNode<K, V> r = null;
- for (TreeNode<K, V> x = b, next; x != null; x = next) {
- next = (TreeNode<K, V>) x.next;
- x.left = x.right = null;
- if (r == null) {
- x.parent = null;
- x.red = false;
- r = x;
- } else {
- final K k = x.key;
- final int h = x.hash;
- Class<?> kc = null;
- for (TreeNode<K, V> p = r; ; ) {
- int dir;
- final int ph;
- final K pk = p.key;
- if ((ph = p.hash) > h)
- dir = -1;
- else if (ph < h)
- dir = 1;
- else if ((kc == null &&
- (kc = comparableClassFor(k)) == null) ||
- (dir = compareComparables(kc, k, pk)) == 0)
- dir = tieBreakOrder(k, pk);
- final TreeNode<K, V> xp = p;
- if ((p = (dir <= 0) ? p.left : p.right) == null) {
- x.parent = xp;
- if (dir <= 0)
- xp.left = x;
- else
- xp.right = x;
- r = balanceInsertion(r, x);
- break;
- }
- }
- }
- }
- this.root = r;
- assert checkInvariants(root);
- }
-
- /**
- * Acquires write lock for tree restructuring.
- */
- private final void lockRoot() {
- if (!U.compareAndSwapInt(this, LOCKSTATE, 0, WRITER))
- contendedLock(); // offload to separate method
- }
-
- /**
- * Releases write lock for tree restructuring.
- */
- private final void unlockRoot() {
- lockState = 0;
- }
-
- /**
- * Possibly blocks awaiting root lock.
- */
- private final void contendedLock() {
- boolean waiting = false;
- for (int s; ; ) {
- if (((s = lockState) & WRITER) == 0) {
- if (U.compareAndSwapInt(this, LOCKSTATE, s, WRITER)) {
- if (waiting)
- waiter = null;
- return;
- }
- } else if ((s & WAITER) == 0) {
- if (U.compareAndSwapInt(this, LOCKSTATE, s, s | WAITER)) {
- waiting = true;
- waiter = Thread.currentThread();
- }
- } else if (waiting)
- LockSupport.park(this);
- }
- }
-
- /**
- * Returns matching node or null if none. Tries to search
- * using tree comparisons from root, but continues linear
- * search when lock not available.
- */
- final Node<K, V> find(final int h, final Object k) {
- if (k != null) {
- for (Node<K, V> e = first; e != null; e = e.next) {
- final int s;
- final K ek;
- if (((s = lockState) & (WAITER | WRITER)) != 0) {
- if (e.hash == h &&
- ((ek = e.key) == k || (ek != null && k.equals(ek))))
- return e;
- } else if (U.compareAndSwapInt(this, LOCKSTATE, s,
- s + READER)) {
- final TreeNode<K, V> r;
- TreeNode<K, V> p;
- try {
- p = ((r = root) == null ? null :
- r.findTreeNode(h, k, null));
- } finally {
- final Thread w;
- int ls;
- do {
- } while (!U.compareAndSwapInt
- (this, LOCKSTATE,
- ls = lockState, ls - READER));
- if (ls == (READER | WAITER) && (w = waiter) != null)
- LockSupport.unpark(w);
- }
- return p;
- }
- }
- }
- return null;
- }
-
- /**
- * Finds or adds a node.
- *
- * @return null if added
- */
- final TreeNode<K, V> putTreeVal(final int h, final K k, final V v) {
- Class<?> kc = null;
- boolean searched = false;
- for (TreeNode<K, V> p = root; ; ) {
- int dir;
- final int ph;
- final K pk;
- if (p == null) {
- first = root = new TreeNode<K, V>(h, k, v, null, null);
- break;
- } else if ((ph = p.hash) > h)
- dir = -1;
- else if (ph < h)
- dir = 1;
- else if ((pk = p.key) == k || (pk != null && k.equals(pk)))
- return p;
- else if ((kc == null &&
- (kc = comparableClassFor(k)) == null) ||
- (dir = compareComparables(kc, k, pk)) == 0) {
- if (!searched) {
- TreeNode<K, V> q, ch;
- searched = true;
- if (((ch = p.left) != null &&
- (q = ch.findTreeNode(h, k, kc)) != null) ||
- ((ch = p.right) != null &&
- (q = ch.findTreeNode(h, k, kc)) != null))
- return q;
- }
- dir = tieBreakOrder(k, pk);
- }
-
- final TreeNode<K, V> xp = p;
- if ((p = (dir <= 0) ? p.left : p.right) == null) {
- final TreeNode<K, V> x;
- final TreeNode<K, V> f = first;
- first = x = new TreeNode<K, V>(h, k, v, f, xp);
- if (f != null)
- f.prev = x;
- if (dir <= 0)
- xp.left = x;
- else
- xp.right = x;
- if (!xp.red)
- x.red = true;
- else {
- lockRoot();
- try {
- root = balanceInsertion(root, x);
- } finally {
- unlockRoot();
- }
- }
- break;
- }
- }
- assert checkInvariants(root);
- return null;
- }
-
- /**
- * Removes the given node, that must be present before this
- * call. This is messier than typical red-black deletion code
- * because we cannot swap the contents of an interior node
- * with a leaf successor that is pinned by "next" pointers
- * that are accessible independently of lock. So instead we
- * swap the tree linkages.
- *
- * @return true if now too small, so should be untreeified
- */
- final boolean removeTreeNode(final TreeNode<K, V> p) {
- final TreeNode<K, V> next = (TreeNode<K, V>) p.next;
- final TreeNode<K, V> pred = p.prev; // unlink traversal pointers
- TreeNode<K, V> r;
- final TreeNode<K, V> rl;
- if (pred == null)
- first = next;
- else
- pred.next = next;
- if (next != null)
- next.prev = pred;
- if (first == null) {
- root = null;
- return true;
- }
- if ((r = root) == null || r.right == null || // too small
- (rl = r.left) == null || rl.left == null)
- return true;
- lockRoot();
- try {
- final TreeNode<K, V> replacement;
- final TreeNode<K, V> pl = p.left;
- final TreeNode<K, V> pr = p.right;
- if (pl != null && pr != null) {
- TreeNode<K, V> s = pr, sl;
- while ((sl = s.left) != null) // find successor
- s = sl;
- final boolean c = s.red;
- s.red = p.red;
- p.red = c; // swap colors
- final TreeNode<K, V> sr = s.right;
- final TreeNode<K, V> pp = p.parent;
- if (s == pr) { // p was s's direct parent
- p.parent = s;
- s.right = p;
- } else {
- final TreeNode<K, V> sp = s.parent;
- if ((p.parent = sp) != null) {
- if (s == sp.left)
- sp.left = p;
- else
- sp.right = p;
- }
- if ((s.right = pr) != null)
- pr.parent = s;
- }
- p.left = null;
- if ((p.right = sr) != null)
- sr.parent = p;
- if ((s.left = pl) != null)
- pl.parent = s;
- if ((s.parent = pp) == null)
- r = s;
- else if (p == pp.left)
- pp.left = s;
- else
- pp.right = s;
- if (sr != null)
- replacement = sr;
- else
- replacement = p;
- } else if (pl != null)
- replacement = pl;
- else if (pr != null)
- replacement = pr;
- else
- replacement = p;
- if (replacement != p) {
- final TreeNode<K, V> pp = replacement.parent = p.parent;
- if (pp == null)
- r = replacement;
- else if (p == pp.left)
- pp.left = replacement;
- else
- pp.right = replacement;
- p.left = p.right = p.parent = null;
- }
-
- root = (p.red) ? r : balanceDeletion(r, replacement);
-
- if (p == replacement) { // detach pointers
- final TreeNode<K, V> pp;
- if ((pp = p.parent) != null) {
- if (p == pp.left)
- pp.left = null;
- else if (p == pp.right)
- pp.right = null;
- p.parent = null;
- }
- }
- } finally {
- unlockRoot();
- }
- assert checkInvariants(root);
- return false;
- }
-
- /* ------------------------------------------------------------ */
- // Red-black tree methods, all adapted from CLR
-
- static <K, V> TreeNode<K, V> rotateLeft(TreeNode<K, V> root,
- final TreeNode<K, V> p) {
- final TreeNode<K, V> r;
- final TreeNode<K, V> pp;
- final TreeNode<K, V> rl;
- if (p != null && (r = p.right) != null) {
- if ((rl = p.right = r.left) != null)
- rl.parent = p;
- if ((pp = r.parent = p.parent) == null)
- (root = r).red = false;
- else if (pp.left == p)
- pp.left = r;
- else
- pp.right = r;
- r.left = p;
- p.parent = r;
- }
- return root;
- }
-
- static <K, V> TreeNode<K, V> rotateRight(TreeNode<K, V> root,
- final TreeNode<K, V> p) {
- final TreeNode<K, V> l;
- final TreeNode<K, V> pp;
- final TreeNode<K, V> lr;
- if (p != null && (l = p.left) != null) {
- if ((lr = p.left = l.right) != null)
- lr.parent = p;
- if ((pp = l.parent = p.parent) == null)
- (root = l).red = false;
- else if (pp.right == p)
- pp.right = l;
- else
- pp.left = l;
- l.right = p;
- p.parent = l;
- }
- return root;
- }
-
- static <K, V> TreeNode<K, V> balanceInsertion(TreeNode<K, V> root,
- TreeNode<K, V> x) {
- x.red = true;
- for (TreeNode<K, V> xp, xpp, xppl, xppr; ; ) {
- if ((xp = x.parent) == null) {
- x.red = false;
- return x;
- } else if (!xp.red || (xpp = xp.parent) == null)
- return root;
- if (xp == (xppl = xpp.left)) {
- if ((xppr = xpp.right) != null && xppr.red) {
- xppr.red = false;
- xp.red = false;
- xpp.red = true;
- x = xpp;
- } else {
- if (x == xp.right) {
- root = rotateLeft(root, x = xp);
- xpp = (xp = x.parent) == null ? null : xp.parent;
- }
- if (xp != null) {
- xp.red = false;
- if (xpp != null) {
- xpp.red = true;
- root = rotateRight(root, xpp);
- }
- }
- }
- } else {
- if (xppl != null && xppl.red) {
- xppl.red = false;
- xp.red = false;
- xpp.red = true;
- x = xpp;
- } else {
- if (x == xp.left) {
- root = rotateRight(root, x = xp);
- xpp = (xp = x.parent) == null ? null : xp.parent;
- }
- if (xp != null) {
- xp.red = false;
- if (xpp != null) {
- xpp.red = true;
- root = rotateLeft(root, xpp);
- }
- }
- }
- }
- }
- }
-
- static <K, V> TreeNode<K, V> balanceDeletion(TreeNode<K, V> root,
- TreeNode<K, V> x) {
- for (TreeNode<K, V> xp, xpl, xpr; ; ) {
- if (x == null || x == root)
- return root;
- else if ((xp = x.parent) == null) {
- x.red = false;
- return x;
- } else if (x.red) {
- x.red = false;
- return root;
- } else if ((xpl = xp.left) == x) {
- if ((xpr = xp.right) != null && xpr.red) {
- xpr.red = false;
- xp.red = true;
- root = rotateLeft(root, xp);
- xpr = (xp = x.parent) == null ? null : xp.right;
- }
- if (xpr == null)
- x = xp;
- else {
- final TreeNode<K, V> sl = xpr.left;
- TreeNode<K, V> sr = xpr.right;
- if ((sr == null || !sr.red) &&
- (sl == null || !sl.red)) {
- xpr.red = true;
- x = xp;
- } else {
- if (sr == null || !sr.red) {
- if (sl != null)
- sl.red = false;
- xpr.red = true;
- root = rotateRight(root, xpr);
- xpr = (xp = x.parent) == null ?
- null : xp.right;
- }
- if (xpr != null) {
- xpr.red = (xp == null) ? false : xp.red;
- if ((sr = xpr.right) != null)
- sr.red = false;
- }
- if (xp != null) {
- xp.red = false;
- root = rotateLeft(root, xp);
- }
- x = root;
- }
- }
- } else { // symmetric
- if (xpl != null && xpl.red) {
- xpl.red = false;
- xp.red = true;
- root = rotateRight(root, xp);
- xpl = (xp = x.parent) == null ? null : xp.left;
- }
- if (xpl == null)
- x = xp;
- else {
- TreeNode<K, V> sl = xpl.left;
- final TreeNode<K, V> sr = xpl.right;
- if ((sl == null || !sl.red) &&
- (sr == null || !sr.red)) {
- xpl.red = true;
- x = xp;
- } else {
- if (sl == null || !sl.red) {
- if (sr != null)
- sr.red = false;
- xpl.red = true;
- root = rotateLeft(root, xpl);
- xpl = (xp = x.parent) == null ?
- null : xp.left;
- }
- if (xpl != null) {
- xpl.red = (xp == null) ? false : xp.red;
- if ((sl = xpl.left) != null)
- sl.red = false;
- }
- if (xp != null) {
- xp.red = false;
- root = rotateRight(root, xp);
- }
- x = root;
- }
- }
- }
- }
- }
-
- /**
- * Recursive invariant check
- */
- static <K, V> boolean checkInvariants(final TreeNode<K, V> t) {
- final TreeNode<K, V> tp = t.parent;
- final TreeNode<K, V> tl = t.left;
- final TreeNode<K, V> tr = t.right;
- final TreeNode<K, V> tb = t.prev;
- final TreeNode<K, V> tn = (TreeNode<K, V>) t.next;
- if (tb != null && tb.next != t)
- return false;
- if (tn != null && tn.prev != t)
- return false;
- if (tp != null && t != tp.left && t != tp.right)
- return false;
- if (tl != null && (tl.parent != t || tl.hash > t.hash))
- return false;
- if (tr != null && (tr.parent != t || tr.hash < t.hash))
- return false;
- if (t.red && tl != null && tl.red && tr != null && tr.red)
- return false;
- if (tl != null && !checkInvariants(tl))
- return false;
- if (tr != null && !checkInvariants(tr))
- return false;
- return true;
- }
-
- private static final sun.misc.Unsafe U;
- private static final long LOCKSTATE;
-
- static {
- try {
- U = getUnsafe();
- final Class<?> k = TreeBin.class;
- LOCKSTATE = U.objectFieldOffset
- (k.getDeclaredField("lockState"));
- } catch (final Exception e) {
- throw new Error(e);
- }
- }
- }
-
- /* ----------------Table Traversal -------------- */
-
- /**
- * Encapsulates traversal for methods such as containsValue; also
- * serves as a base class for other iterators and spliterators.
- *
- * Method advance visits once each still-valid node that was
- * reachable upon iterator construction. It might miss some that
- * were added to a bin after the bin was visited, which is OK wrt
- * consistency guarantees. Maintaining this property in the face
- * of possible ongoing resizes requires a fair amount of
- * bookkeeping state that is difficult to optimize away amidst
- * volatile accesses. Even so, traversal maintains reasonable
- * throughput.
- *
- * Normally, iteration proceeds bin-by-bin traversing lists.
- * However, if the table has been resized, then all future steps
- * must traverse both the bin at the current index as well as at
- * (index + baseSize); and so on for further resizings. To
- * paranoically cope with potential sharing by users of iterators
- * across threads, iteration terminates if a bounds checks fails
- * for a table read.
- */
- static class Traverser<K, V> {
- Node<K, V>[] tab; // current table; updated if resized
- Node<K, V> next; // the next entry to use
- int index; // index of bin to use next
- int baseIndex; // current index of initial table
- int baseLimit; // index bound for initial table
- final int baseSize; // initial table size
-
- Traverser(final Node<K, V>[] tab, final int size, final int index, final int limit) {
- this.tab = tab;
- this.baseSize = size;
- this.baseIndex = this.index = index;
- this.baseLimit = limit;
- this.next = null;
- }
-
- /**
- * Advances if possible, returning next valid node, or null if none.
- */
- final Node<K, V> advance() {
- Node<K, V> e;
- if ((e = next) != null)
- e = e.next;
- for (; ; ) {
- final Node<K, V>[] t;
- final int i;
- final int n;
- K ek; // must use locals in checks
- if (e != null)
- return next = e;
- if (baseIndex >= baseLimit || (t = tab) == null ||
- (n = t.length) <= (i = index) || i < 0)
- return next = null;
- if ((e = tabAt(t, index)) != null && e.hash < 0) {
- if (e instanceof ForwardingNode) {
- tab = ((ForwardingNode<K, V>) e).nextTable;
- e = null;
- continue;
- } else if (e instanceof TreeBin)
- e = ((TreeBin<K, V>) e).first;
- else
- e = null;
- }
- if ((index += baseSize) >= n)
- index = ++baseIndex; // visit upper slots if present
- }
- }
- }
-
- /**
- * Base of key, value, and entry Iterators. Adds fields to
- * Traverser to support iterator.remove.
- */
- static class BaseIterator<K, V> extends Traverser<K, V> {
- final ConcurrentHashMapV8<K, V> map;
- Node<K, V> lastReturned;
-
- BaseIterator(final Node<K, V>[] tab, final int size, final int index, final int limit,
- final ConcurrentHashMapV8<K, V> map) {
- super(tab, size, index, limit);
- this.map = map;
- advance();
- }
-
- public final boolean hasNext() {
- return next != null;
- }
-
- public final boolean hasMoreElements() {
- return next != null;
- }
-
- public final void remove() {
- final Node<K, V> p;
- if ((p = lastReturned) == null)
- throw new IllegalStateException();
- lastReturned = null;
- map.replaceNode(p.key, null, null);
- }
- }
-
- static final class KeyIterator<K, V> extends BaseIterator<K, V>
- implements Iterator<K>, Enumeration<K> {
- KeyIterator(final Node<K, V>[] tab, final int index, final int size, final int limit,
- final ConcurrentHashMapV8<K, V> map) {
- super(tab, index, size, limit, map);
- }
-
- public final K next() {
- final Node<K, V> p;
- if ((p = next) == null)
- throw new NoSuchElementException();
- final K k = p.key;
- lastReturned = p;
- advance();
- return k;
- }
-
- public final K nextElement() {
- return next();
- }
- }
-
- static final class ValueIterator<K, V> extends BaseIterator<K, V>
- implements Iterator<V>, Enumeration<V> {
- ValueIterator(final Node<K, V>[] tab, final int index, final int size, final int limit,
- final ConcurrentHashMapV8<K, V> map) {
- super(tab, index, size, limit, map);
- }
-
- public final V next() {
- final Node<K, V> p;
- if ((p = next) == null)
- throw new NoSuchElementException();
- final V v = p.val;
- lastReturned = p;
- advance();
- return v;
- }
-
- public final V nextElement() {
- return next();
- }
- }
-
- static final class EntryIterator<K, V> extends BaseIterator<K, V>
- implements Iterator<Map.Entry<K, V>> {
- EntryIterator(final Node<K, V>[] tab, final int index, final int size, final int limit,
- final ConcurrentHashMapV8<K, V> map) {
- super(tab, index, size, limit, map);
- }
-
- public final Map.Entry<K, V> next() {
- final Node<K, V> p;
- if ((p = next) == null)
- throw new NoSuchElementException();
- final K k = p.key;
- final V v = p.val;
- lastReturned = p;
- advance();
- return new MapEntry<K, V>(k, v, map);
- }
- }
-
- /**
- * Exported Entry for EntryIterator
- */
- static final class MapEntry<K, V> implements Map.Entry<K, V> {
- final K key; // non-null
- V val; // non-null
- final ConcurrentHashMapV8<K, V> map;
-
- MapEntry(final K key, final V val, final ConcurrentHashMapV8<K, V> map) {
- this.key = key;
- this.val = val;
- this.map = map;
- }
-
- public K getKey() {
- return key;
- }
-
- public V getValue() {
- return val;
- }
-
- public int hashCode() {
- return key.hashCode() ^ val.hashCode();
- }
-
- public String toString() {
- return key + "=" + val;
- }
-
- public boolean equals(final Object o) {
- final Object k;
- final Object v;
- final Map.Entry<?, ?> e;
- return ((o instanceof Map.Entry) &&
- (k = (e = (Map.Entry<?, ?>) o).getKey()) != null &&
- (v = e.getValue()) != null &&
- (k == key || k.equals(key)) &&
- (v == val || v.equals(val)));
- }
-
- /**
- * Sets our entry's value and writes through to the map. The
- * value to return is somewhat arbitrary here. Since we do not
- * necessarily track asynchronous changes, the most recent
- * "previous" value could be different from what we return (or
- * could even have been removed, in which case the put will
- * re-establish). We do not and cannot guarantee more.
- */
- public V setValue(final V value) {
- if (value == null) throw new NullPointerException();
- final V v = val;
- val = value;
- map.put(key, value);
- return v;
- }
- }
-
- /* ----------------Views -------------- */
-
- /**
- * Base class for views.
- */
- abstract static class CollectionView<K, V, E>
- implements Collection<E>, java.io.Serializable {
- private static final long serialVersionUID = 7249069246763182397L;
- final ConcurrentHashMapV8<K, V> map;
-
- CollectionView(final ConcurrentHashMapV8<K, V> map) {
- this.map = map;
- }
-
- /**
- * Returns the map backing this view.
- *
- * @return the map backing this view
- */
- public ConcurrentHashMapV8<K, V> getMap() {
- return map;
- }
-
- /**
- * Removes all of the elements from this view, by removing all
- * the mappings from the map backing this view.
- */
- public final void clear() {
- map.clear();
- }
-
- public final int size() {
- return map.size();
- }
-
- public final boolean isEmpty() {
- return map.isEmpty();
- }
-
- // implementations below rely on concrete classes supplying these
- // abstract methods
-
- /**
- * Returns a "weakly consistent" iterator that will never
- * throw {@link ConcurrentModificationException}, and
- * guarantees to traverse elements as they existed upon
- * construction of the iterator, and may (but is not
- * guaranteed to) reflect any modifications subsequent to
- * construction.
- */
- public abstract Iterator<E> iterator();
-
- public abstract boolean contains(Object o);
-
- public abstract boolean remove(Object o);
-
- private static final String oomeMsg = "Required array size too large";
-
- public final Object[] toArray() {
- final long sz = map.mappingCount();
- if (sz > MAX_ARRAY_SIZE)
- throw new OutOfMemoryError(oomeMsg);
- int n = (int) sz;
- Object[] r = new Object[n];
- int i = 0;
- for (final E e : this) {
- if (i == n) {
- if (n >= MAX_ARRAY_SIZE)
- throw new OutOfMemoryError(oomeMsg);
- if (n >= MAX_ARRAY_SIZE - (MAX_ARRAY_SIZE >>> 1) - 1)
- n = MAX_ARRAY_SIZE;
- else
- n += (n >>> 1) + 1;
- r = Arrays.copyOf(r, n);
- }
- r[i++] = e;
- }
- return (i == n) ? r : Arrays.copyOf(r, i);
- }
-
- @SuppressWarnings("unchecked")
- public final <T> T[] toArray(final T[] a) {
- final long sz = map.mappingCount();
- if (sz > MAX_ARRAY_SIZE)
- throw new OutOfMemoryError(oomeMsg);
- final int m = (int) sz;
- T[] r = (a.length >= m) ? a :
- (T[]) java.lang.reflect.Array
- .newInstance(a.getClass().getComponentType(), m);
- int n = r.length;
- int i = 0;
- for (final E e : this) {
- if (i == n) {
- if (n >= MAX_ARRAY_SIZE)
- throw new OutOfMemoryError(oomeMsg);
- if (n >= MAX_ARRAY_SIZE - (MAX_ARRAY_SIZE >>> 1) - 1)
- n = MAX_ARRAY_SIZE;
- else
- n += (n >>> 1) + 1;
- r = Arrays.copyOf(r, n);
- }
- r[i++] = (T) e;
- }
- if (a == r && i < n) {
- r[i] = null; // null-terminate
- return r;
- }
- return (i == n) ? r : Arrays.copyOf(r, i);
- }
-
- /**
- * Returns a string representation of this collection.
- * The string representation consists of the string representations
- * of the collection's elements in the order they are returned by
- * its iterator, enclosed in square brackets ({@code "[]"}).
- * Adjacent elements are separated by the characters {@code ", "}
- * (comma and space). Elements are converted to strings as by
- * {@link String#valueOf(Object)}.
- *
- * @return a string representation of this collection
- */
- public final String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append('[');
- final Iterator<E> it = iterator();
- if (it.hasNext()) {
- for (; ; ) {
- final Object e = it.next();
- sb.append(e == this ? "(this Collection)" : e);
- if (!it.hasNext())
- break;
- sb.append(',').append(' ');
- }
- }
- return sb.append(']').toString();
- }
-
- public final boolean containsAll(final Collection<?> c) {
- if (c != this) {
- for (final Object e : c) {
- if (e == null || !contains(e))
- return false;
- }
- }
- return true;
- }
-
- public final boolean removeAll(final Collection<?> c) {
- boolean modified = false;
- for (final Iterator<E> it = iterator(); it.hasNext(); ) {
- if (c.contains(it.next())) {
- it.remove();
- modified = true;
- }
- }
- return modified;
- }
-
- public final boolean retainAll(final Collection<?> c) {
- boolean modified = false;
- for (final Iterator<E> it = iterator(); it.hasNext(); ) {
- if (!c.contains(it.next())) {
- it.remove();
- modified = true;
- }
- }
- return modified;
- }
-
- }
-
- /**
- * A view of a ConcurrentHashMapV8 as a {@link Set} of keys, in
- * which additions may optionally be enabled by mapping to a
- * common value. This class cannot be directly instantiated.
- * See {@link #keySet() keySet()},
- * {@link #keySet(Object) keySet(V)},
- * {@link #newKeySet() newKeySet()},
- * {@link #newKeySet(int) newKeySet(int)}.
- *
- * @since 1.8
- */
- public static class KeySetView<K, V> extends CollectionView<K, V, K>
- implements Set<K>, java.io.Serializable {
- private static final long serialVersionUID = 7249069246763182397L;
- private final V value;
-
- KeySetView(final ConcurrentHashMapV8<K, V> map, final V value) { // non-public
- super(map);
- this.value = value;
- }
-
- /**
- * Returns the default mapped value for additions,
- * or {@code null} if additions are not supported.
- *
- * @return the default mapped value for additions, or {@code null}
- * if not supported
- */
- public V getMappedValue() {
- return value;
- }
-
- /**
- * {@inheritDoc}
- *
- * @throws NullPointerException if the specified key is null
- */
- public boolean contains(final Object o) {
- return map.containsKey(o);
- }
-
- /**
- * Removes the key from this map view, by removing the key (and its
- * corresponding value) from the backing map. This method does
- * nothing if the key is not in the map.
- *
- * @param o the key to be removed from the backing map
- * @return {@code true} if the backing map contained the specified key
- * @throws NullPointerException if the specified key is null
- */
- public boolean remove(final Object o) {
- return map.remove(o) != null;
- }
-
- /**
- * @return an iterator over the keys of the backing map
- */
- public Iterator<K> iterator() {
- final Node<K, V>[] t;
- final ConcurrentHashMapV8<K, V> m = map;
- final int f = (t = m.table) == null ? 0 : t.length;
- return new KeyIterator<K, V>(t, f, 0, f, m);
- }
-
- /**
- * Adds the specified key to this set view by mapping the key to
- * the default mapped value in the backing map, if defined.
- *
- * @param e key to be added
- * @return {@code true} if this set changed as a result of the call
- * @throws NullPointerException if the specified key is null
- * @throws UnsupportedOperationException if no default mapped value
- * for additions was provided
- */
- public boolean add(final K e) {
- final V v;
- if ((v = value) == null)
- throw new UnsupportedOperationException();
- return map.putVal(e, v, true) == null;
- }
-
- /**
- * Adds all of the elements in the specified collection to this set,
- * as if by calling {@link #add} on each one.
- *
- * @param c the elements to be inserted into this set
- * @return {@code true} if this set changed as a result of the call
- * @throws NullPointerException if the collection or any of its
- * elements are {@code null}
- * @throws UnsupportedOperationException if no default mapped value
- * for additions was provided
- */
- public boolean addAll(final Collection<? extends K> c) {
- boolean added = false;
- final V v;
- if ((v = value) == null)
- throw new UnsupportedOperationException();
- for (final K e : c) {
- if (map.putVal(e, v, true) == null)
- added = true;
- }
- return added;
- }
-
- public int hashCode() {
- int h = 0;
- for (final K e : this)
- h += e.hashCode();
- return h;
- }
-
- public boolean equals(final Object o) {
- final Set<?> c;
- return ((o instanceof Set) &&
- ((c = (Set<?>) o) == this ||
- (containsAll(c) && c.containsAll(this))));
- }
- }
-
- /**
- * A view of a ConcurrentHashMapV8 as a {@link Collection} of
- * values, in which additions are disabled. This class cannot be
- * directly instantiated. See {@link #values()}.
- */
- static final class ValuesView<K, V> extends CollectionView<K, V, V>
- implements Collection<V>, java.io.Serializable {
- private static final long serialVersionUID = 2249069246763182397L;
-
- ValuesView(final ConcurrentHashMapV8<K, V> map) {
- super(map);
- }
-
- public final boolean contains(final Object o) {
- return map.containsValue(o);
- }
-
- public final boolean remove(final Object o) {
- if (o != null) {
- for (final Iterator<V> it = iterator(); it.hasNext(); ) {
- if (o.equals(it.next())) {
- it.remove();
- return true;
- }
- }
- }
- return false;
- }
-
- public final Iterator<V> iterator() {
- final ConcurrentHashMapV8<K, V> m = map;
- final Node<K, V>[] t;
- final int f = (t = m.table) == null ? 0 : t.length;
- return new ValueIterator<K, V>(t, f, 0, f, m);
- }
-
- public final boolean add(final V e) {
- throw new UnsupportedOperationException();
- }
-
- public final boolean addAll(final Collection<? extends V> c) {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * A view of a ConcurrentHashMapV8 as a {@link Set} of (key, value)
- * entries. This class cannot be directly instantiated. See
- * {@link #entrySet()}.
- */
- static final class EntrySetView<K, V> extends CollectionView<K, V, Map.Entry<K, V>>
- implements Set<Map.Entry<K, V>>, java.io.Serializable {
- private static final long serialVersionUID = 2249069246763182397L;
-
- EntrySetView(final ConcurrentHashMapV8<K, V> map) {
- super(map);
- }
-
- public boolean contains(final Object o) {
- final Object k;
- final Object v;
- final Object r;
- final Map.Entry<?, ?> e;
- return ((o instanceof Map.Entry) &&
- (k = (e = (Map.Entry<?, ?>) o).getKey()) != null &&
- (r = map.get(k)) != null &&
- (v = e.getValue()) != null &&
- (v == r || v.equals(r)));
- }
-
- public boolean remove(final Object o) {
- final Object k;
- final Object v;
- final Map.Entry<?, ?> e;
- return ((o instanceof Map.Entry) &&
- (k = (e = (Map.Entry<?, ?>) o).getKey()) != null &&
- (v = e.getValue()) != null &&
- map.remove(k, v));
- }
-
- /**
- * @return an iterator over the entries of the backing map
- */
- public Iterator<Map.Entry<K, V>> iterator() {
- final ConcurrentHashMapV8<K, V> m = map;
- final Node<K, V>[] t;
- final int f = (t = m.table) == null ? 0 : t.length;
- return new EntryIterator<K, V>(t, f, 0, f, m);
- }
-
- public boolean add(final Entry<K, V> e) {
- return map.putVal(e.getKey(), e.getValue(), false) == null;
- }
-
- public boolean addAll(final Collection<? extends Entry<K, V>> c) {
- boolean added = false;
- for (final Entry<K, V> e : c) {
- if (add(e))
- added = true;
- }
- return added;
- }
-
- public final int hashCode() {
- int h = 0;
- final Node<K, V>[] t;
- if ((t = map.table) != null) {
- final Traverser<K, V> it = new Traverser<K, V>(t, t.length, 0, t.length);
- for (Node<K, V> p; (p = it.advance()) != null; ) {
- h += p.hashCode();
- }
- }
- return h;
- }
-
- public final boolean equals(final Object o) {
- final Set<?> c;
- return ((o instanceof Set) &&
- ((c = (Set<?>) o) == this ||
- (containsAll(c) && c.containsAll(this))));
- }
- }
-
- // -------------------------------------------------------
-
- /* ---------------- Counters -------------- */
-
- // Adapted from LongAdder and Striped64.
- // See their internal docs for explanation.
-
- // A padded cell for distributing counts
- static final class CounterCell {
- volatile long p0, p1, p2, p3, p4, p5, p6;
- volatile long value;
- volatile long q0, q1, q2, q3, q4, q5, q6;
-
- CounterCell(final long x) {
- value = x;
- }
- }
-
- /**
- * Holder for the thread-local hash code determining which
- * CounterCell to use. The code is initialized via the
- * counterHashCodeGenerator, but may be moved upon collisions.
- */
- static final class CounterHashCode {
- int code;
- }
-
- /**
- * Generates initial value for per-thread CounterHashCodes.
- */
- static final AtomicInteger counterHashCodeGenerator = new AtomicInteger();
-
- /**
- * Increment for counterHashCodeGenerator. See class ThreadLocal
- * for explanation.
- */
- static final int SEED_INCREMENT = 0x61c88647;
-
- /**
- * Per-thread counter hash codes. Shared across all instances.
- */
- static final ThreadLocal<CounterHashCode> threadCounterHashCode =
- new ThreadLocal<CounterHashCode>();
-
-
- final long sumCount() {
- final CounterCell[] as = counterCells;
- CounterCell a;
- long sum = baseCount;
- if (as != null) {
- for (int i = 0; i < as.length; ++i) {
- if ((a = as[i]) != null)
- sum += a.value;
- }
- }
- return sum;
- }
-
- // See LongAdder version for explanation
- private final void fullAddCount(final long x, CounterHashCode hc,
- boolean wasUncontended) {
- int h;
- if (hc == null) {
- hc = new CounterHashCode();
- final int s = counterHashCodeGenerator.addAndGet(SEED_INCREMENT);
- h = hc.code = (s == 0) ? 1 : s; // Avoid zero
- threadCounterHashCode.set(hc);
- } else
- h = hc.code;
- boolean collide = false; // True if last slot nonempty
- for (; ; ) {
- final CounterCell[] as;
- final CounterCell a;
- final int n;
- final long v;
- if ((as = counterCells) != null && (n = as.length) > 0) {
- if ((a = as[(n - 1) & h]) == null) {
- if (cellsBusy == 0) { // Try to attach new Cell
- final CounterCell r = new CounterCell(x); // Optimistic create
- if (cellsBusy == 0 &&
- U.compareAndSwapInt(this, CELLSBUSY, 0, 1)) {
- boolean created = false;
- try { // Recheck under lock
- final CounterCell[] rs;
- final int m;
- final int j;
- if ((rs = counterCells) != null &&
- (m = rs.length) > 0 &&
- rs[j = (m - 1) & h] == null) {
- rs[j] = r;
- created = true;
- }
- } finally {
- cellsBusy = 0;
- }
- if (created)
- break;
- continue; // Slot is now non-empty
- }
- }
- collide = false;
- } else if (!wasUncontended) // CAS already known to fail
- wasUncontended = true; // Continue after rehash
- else if (U.compareAndSwapLong(a, CELLVALUE, v = a.value, v + x))
- break;
- else if (counterCells != as || n >= NCPU)
- collide = false; // At max size or stale
- else if (!collide)
- collide = true;
- else if (cellsBusy == 0 &&
- U.compareAndSwapInt(this, CELLSBUSY, 0, 1)) {
- try {
- if (counterCells == as) {// Expand table unless stale
- final CounterCell[] rs = new CounterCell[n << 1];
- System.arraycopy(as, 0, rs, 0, n);
- counterCells = rs;
- }
- } finally {
- cellsBusy = 0;
- }
- collide = false;
- continue; // Retry with expanded table
- }
- h ^= h << 13; // Rehash
- h ^= h >>> 17;
- h ^= h << 5;
- } else if (cellsBusy == 0 && counterCells == as &&
- U.compareAndSwapInt(this, CELLSBUSY, 0, 1)) {
- boolean init = false;
- try { // Initialize table
- if (counterCells == as) {
- final CounterCell[] rs = new CounterCell[2];
- rs[h & 1] = new CounterCell(x);
- counterCells = rs;
- init = true;
- }
- } finally {
- cellsBusy = 0;
- }
- if (init)
- break;
- } else if (U.compareAndSwapLong(this, BASECOUNT, v = baseCount, v + x))
- break; // Fall back on using base
- }
- hc.code = h; // Record index for next time
- }
-
- // Unsafe mechanics
- private static final sun.misc.Unsafe U;
- private static final long SIZECTL;
- private static final long TRANSFERINDEX;
- private static final long TRANSFERORIGIN;
- private static final long BASECOUNT;
- private static final long CELLSBUSY;
- private static final long CELLVALUE;
- private static final long ABASE;
- private static final int ASHIFT;
-
- static {
- try {
- U = getUnsafe();
- final Class<?> k = ConcurrentHashMapV8.class;
- SIZECTL = U.objectFieldOffset
- (k.getDeclaredField("sizeCtl"));
- TRANSFERINDEX = U.objectFieldOffset
- (k.getDeclaredField("transferIndex"));
- TRANSFERORIGIN = U.objectFieldOffset
- (k.getDeclaredField("transferOrigin"));
- BASECOUNT = U.objectFieldOffset
- (k.getDeclaredField("baseCount"));
- CELLSBUSY = U.objectFieldOffset
- (k.getDeclaredField("cellsBusy"));
- final Class<?> ck = CounterCell.class;
- CELLVALUE = U.objectFieldOffset
- (ck.getDeclaredField("value"));
- final Class<?> ak = Node[].class;
- ABASE = U.arrayBaseOffset(ak);
- final int scale = U.arrayIndexScale(ak);
- if ((scale & (scale - 1)) != 0)
- throw new Error("data type scale not a power of two");
- ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
- } catch (final Exception e) {
- throw new Error(e);
- }
- }
-
- /**
- * Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package.
- * Replace with a simple call to Unsafe.getUnsafe when integrating
- * into a jdk.
- *
- * @return a sun.misc.Unsafe
- */
- private static sun.misc.Unsafe getUnsafe() {
- try {
- return sun.misc.Unsafe.getUnsafe();
- } catch (final SecurityException tryReflectionInstead) {
- }
- try {
- return java.security.AccessController.doPrivileged
- (new java.security.PrivilegedExceptionAction<sun.misc.Unsafe>() {
- public sun.misc.Unsafe run() throws Exception {
- final Class<sun.misc.Unsafe> k = sun.misc.Unsafe.class;
- for (final java.lang.reflect.Field f : k.getDeclaredFields()) {
- f.setAccessible(true);
- final Object x = f.get(null);
- if (k.isInstance(x))
- return k.cast(x);
- }
- throw new NoSuchFieldError("the Unsafe");
- }
- });
- } catch (final java.security.PrivilegedActionException e) {
- throw new RuntimeException("Could not initialize intrinsics",
- e.getCause());
- }
- }
-}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/DataStructures.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/DataStructures.java
index 164f357..3e295b7 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/DataStructures.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/DataStructures.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -16,56 +16,22 @@
package org.glassfish.jersey.internal.util.collection;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.glassfish.jersey.internal.util.JdkVersion;
+import java.util.concurrent.LinkedTransferQueue;
/**
* Utility class, which tries to pickup the best collection implementation depending
* on running environment.
*
* @author Gustav Trede
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.3
*/
public final class DataStructures {
- private static final Class<?> LTQ_CLASS;
-
- static {
- String className = null;
-
- Class<?> c;
- try {
- final JdkVersion jdkVersion = JdkVersion.getJdkVersion();
- final JdkVersion minimumVersion = JdkVersion.parseVersion("1.7.0");
-
- className = (minimumVersion.compareTo(jdkVersion) <= 0)
- ? "java.util.concurrent.LinkedTransferQueue"
- : "org.glassfish.jersey.internal.util.collection.LinkedTransferQueue";
-
- c = getAndVerify(className);
- Logger.getLogger(DataStructures.class.getName()).log(Level.FINE, "USING LTQ class:{0}", c);
- } catch (final Throwable t) {
- Logger.getLogger(DataStructures.class.getName()).log(Level.FINE,
- "failed loading data structure class:" + className
- + " fallback to embedded one", t);
-
- c = LinkedBlockingQueue.class; // fallback to LinkedBlockingQueue
- }
-
- LTQ_CLASS = c;
- }
-
/**
* Default concurrency level calculated based on the number of available CPUs.
*/
@@ -76,100 +42,69 @@
return 1 << (Integer.SIZE - Integer.numberOfLeadingZeros(x - 1));
}
- private static Class<?> getAndVerify(final String cn) throws Throwable {
- try {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
- @Override
- public Class<?> run() throws Exception {
- return DataStructures.class.getClassLoader().loadClass(cn).newInstance().getClass();
- }
- });
- } catch (final PrivilegedActionException ex) {
- throw ex.getCause();
- }
- }
-
/**
* Create an instance of a {@link BlockingQueue} that is based on
- * {@code LinkedTransferQueue} implementation from JDK 7.
+ * {@code LinkedTransferQueue} implementation, available in JDK 7 and above.
* <p>
- * When running on JDK 7 or higher, JDK {@code LinkedTransferQueue} implementation is used,
- * on JDK 6 an internal Jersey implementation class is used.
+ * Originally, the method was used to provide backwards compatibility for JDK versions 6 and below.
+ * As those versions are now unsupported, callers should instantiate an {@link LinkedTransferQueue}
+ * directly instead of using this method.
* </p>
*
* @param <E> the type of elements held in the queue.
* @return new instance of a {@link BlockingQueue} that is based on {@code LinkedTransferQueue}
* implementation from JDK 7.
*/
- @SuppressWarnings("unchecked")
+ @Deprecated
public static <E> BlockingQueue<E> createLinkedTransferQueue() {
- try {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<BlockingQueue<E>>() {
- @Override
- public BlockingQueue<E> run() throws Exception {
- return (BlockingQueue<E>) LTQ_CLASS.newInstance();
- }
- });
- } catch (final PrivilegedActionException ex) {
- final Throwable cause = ex.getCause();
- if (cause instanceof RuntimeException) {
- throw (RuntimeException) cause;
- } else {
- throw new RuntimeException(cause);
- }
- }
+ return new LinkedTransferQueue<>();
}
/**
* Creates a new, empty map with a default initial capacity (16),
* load factor (0.75) and concurrencyLevel (16).
* <p>
- * On Oracle JDK, the factory method will return an instance of
+ * The method was originally used to provide the
* <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html">
- * {@code ConcurrentHashMapV8}</a>
- * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than
- * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK,
- * the factory instantiates the standard {@code ConcurrentHashMap} from JDK.
+ * {@code ConcurrentHashMapV8}</a>, available in JDK 8 and above, for JDK 7 or earlier.
+ * As those versions are now unsupported, callers should instantiate an {@link ConcurrentHashMap}
+ * directly instead of using this method.
* </p>
*
* @return the map.
*/
+ @Deprecated
public static <K, V> ConcurrentMap<K, V> createConcurrentMap() {
- return JdkVersion.getJdkVersion().isUnsafeSupported()
- ? new ConcurrentHashMapV8<K, V>()
- : new ConcurrentHashMap<K, V>();
+ return new ConcurrentHashMap<>();
}
/**
* Creates a new map with the same mappings as the given map.
* <p>
- * On Oracle JDK, the factory method will return an instance of
+ * The method was originally used to provide the
* <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html">
- * {@code ConcurrentHashMapV8}</a>
- * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than
- * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK,
- * the factory instantiates the standard {@code ConcurrentHashMap} from JDK.
+ * {@code ConcurrentHashMapV8}</a>, available in JDK 8 and above, for JDK 7 or earlier.
+ * As those versions are now unsupported, callers should instantiate an {@link ConcurrentHashMap}
+ * directly instead of using this method.
* </p>
*
* @param map the map.
*/
+ @Deprecated
public static <K, V> ConcurrentMap<K, V> createConcurrentMap(
final Map<? extends K, ? extends V> map) {
- return JdkVersion.getJdkVersion().isUnsafeSupported()
- ? new ConcurrentHashMapV8<K, V>(map)
- : new ConcurrentHashMap<K, V>(map);
+ return new ConcurrentHashMap<>(map);
}
/**
* Creates a new, empty map with an initial table size accommodating the specified
* number of elements without the need to dynamically resize.
* <p>
- * On Oracle JDK, the factory method will return an instance of
+ * The method was originally used to provide the
* <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html">
- * {@code ConcurrentHashMapV8}</a>
- * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than
- * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK,
- * the factory instantiates the standard {@code ConcurrentHashMap} from JDK.
+ * {@code ConcurrentHashMapV8}</a>, available in JDK 8 and above, for JDK 7 or earlier.
+ * As those versions are now unsupported, callers should instantiate an {@link ConcurrentHashMap}
+ * directly instead of using this method.
* </p>
*
* @param initialCapacity The implementation performs internal
@@ -177,11 +112,10 @@
* @throws IllegalArgumentException if the initial capacity of
* elements is negative.
*/
+ @Deprecated
public static <K, V> ConcurrentMap<K, V> createConcurrentMap(
final int initialCapacity) {
- return JdkVersion.getJdkVersion().isUnsafeSupported()
- ? new ConcurrentHashMapV8<K, V>(initialCapacity)
- : new ConcurrentHashMap<K, V>(initialCapacity);
+ return new ConcurrentHashMap<>(initialCapacity);
}
/**
@@ -189,12 +123,11 @@
* ({@code initialCapacity}), table density ({@code loadFactor}), and number of concurrently
* updating threads ({@code concurrencyLevel}).
* <p>
- * On Oracle JDK, the factory method will return an instance of
+ * The method was originally used to provide the
* <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html">
- * {@code ConcurrentHashMapV8}</a>
- * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than
- * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK,
- * the factory instantiates the standard {@code ConcurrentHashMap} from JDK.
+ * {@code ConcurrentHashMapV8}</a>, available in JDK 8 and above, for JDK 7 or earlier.
+ * As those versions are now unsupported, callers should instantiate an {@link ConcurrentHashMap}
+ * directly instead of using this method.
* </p>
*
* @param initialCapacity the initial capacity. The implementation
@@ -209,11 +142,10 @@
* negative or the load factor or concurrencyLevel are
* not positive.
*/
+ @Deprecated
public static <K, V> ConcurrentMap<K, V> createConcurrentMap(
final int initialCapacity, final float loadFactor,
final int concurrencyLevel) {
- return JdkVersion.getJdkVersion().isUnsafeSupported()
- ? new ConcurrentHashMapV8<K, V>(initialCapacity, loadFactor, concurrencyLevel)
- : new ConcurrentHashMap<K, V>(initialCapacity, loadFactor, concurrencyLevel);
+ return new ConcurrentHashMap<>(initialCapacity, loadFactor, concurrencyLevel);
}
}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LazyUnsafeValue.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LazyUnsafeValue.java
index b563c52..efe0833 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LazyUnsafeValue.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LazyUnsafeValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
* of a {@code LazyUnsafeValue} instance is available via {@link #isInitialized()} method.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface LazyUnsafeValue<T, E extends Throwable> extends UnsafeValue<T, E> {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LazyValue.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LazyValue.java
index ab3d079..5b1e5bc 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LazyValue.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LazyValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
* of a {@code LazyValue} instance is available via {@link #isInitialized()} method.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface LazyValue<T> extends Value<T> {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LinkedTransferQueue.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LinkedTransferQueue.java
deleted file mode 100644
index 8d98734..0000000
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/LinkedTransferQueue.java
+++ /dev/null
@@ -1,1371 +0,0 @@
-/*
- * Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-/**
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-package org.glassfish.jersey.internal.util.collection;
-
-import java.util.AbstractQueue;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.LockSupport;
-
-/**
- * An unbounded {@link TransferQueue} based on linked nodes.
- * This queue orders elements FIFO (first-in-first-out) with respect
- * to any given producer. The <em>head</em> of the queue is that
- * element that has been on the queue the longest time for some
- * producer. The <em>tail</em> of the queue is that element that has
- * been on the queue the shortest time for some producer.
- *
- * <p>Beware that, unlike in most collections, the {@code size} method
- * is <em>NOT</em> a constant-time operation. Because of the
- * asynchronous nature of these queues, determining the current number
- * of elements requires a traversal of the elements, and so may report
- * inaccurate results if this collection is modified during traversal.
- * Additionally, the bulk operations {@code addAll},
- * {@code removeAll}, {@code retainAll}, {@code containsAll},
- * {@code equals}, and {@code toArray} are <em>not</em> guaranteed
- * to be performed atomically. For example, an iterator operating
- * concurrently with an {@code addAll} operation might view only some
- * of the added elements.
- *
- * <p>This class and its iterator implement all of the
- * <em>optional</em> methods of the {@link Collection} and {@link
- * Iterator} interfaces.
- *
- * <p>Memory consistency effects: As with other concurrent
- * collections, actions in a thread prior to placing an object into a
- * {@code LinkedTransferQueue}
- * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
- * actions subsequent to the access or removal of that element from
- * the {@code LinkedTransferQueue} in another thread.
- *
- * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * TODO: Do NOT remove this class. It's referenced from {@link org.glassfish.jersey.internal.util.collection.DataStructures}.
- *
- * @param <E> the type of elements held in this collection.
- * @author Doug Lea
- */
-class LinkedTransferQueue<E> extends AbstractQueue<E>
- implements TransferQueue<E>, java.io.Serializable {
- private static final long serialVersionUID = -3223113410248163686L;
-
- /*
- * *** Overview of Dual Queues with Slack ***
- *
- * Dual Queues, introduced by Scherer and Scott
- * (http://www.cs.rice.edu/~wns1/papers/2004-DISC-DDS.pdf) are
- * (linked) queues in which nodes may represent either data or
- * requests. When a thread tries to enqueue a data node, but
- * encounters a request node, it instead "matches" and removes it;
- * and vice versa for enqueuing requests. Blocking Dual Queues
- * arrange that threads enqueuing unmatched requests block until
- * other threads provide the match. Dual Synchronous Queues (see
- * Scherer, Lea, & Scott
- * http://www.cs.rochester.edu/u/scott/papers/2009_Scherer_CACM_SSQ.pdf)
- * additionally arrange that threads enqueuing unmatched data also
- * block. Dual Transfer Queues support all of these modes, as
- * dictated by callers.
- *
- * A FIFO dual queue may be implemented using a variation of the
- * Michael & Scott (M&S) lock-free queue algorithm
- * (http://www.cs.rochester.edu/u/scott/papers/1996_PODC_queues.pdf).
- * It maintains two pointer fields, "head", pointing to a
- * (matched) node that in turn points to the first actual
- * (unmatched) queue node (or null if empty); and "tail" that
- * points to the last node on the queue (or again null if
- * empty). For example, here is a possible queue with four data
- * elements:
- *
- * head tail
- * | |
- * v v
- * M -> U -> U -> U -> U
- *
- * The M&S queue algorithm is known to be prone to scalability and
- * overhead limitations when maintaining (via CAS) these head and
- * tail pointers. This has led to the development of
- * contention-reducing variants such as elimination arrays (see
- * Moir et al http://portal.acm.org/citation.cfm?id=1074013) and
- * optimistic back pointers (see Ladan-Mozes & Shavit
- * http://people.csail.mit.edu/edya/publications/OptimisticFIFOQueue-journal.pdf).
- * However, the nature of dual queues enables a simpler tactic for
- * improving M&S-style implementations when dual-ness is needed.
- *
- * In a dual queue, each node must atomically maintain its match
- * status. While there are other possible variants, we implement
- * this here as: for a data-mode node, matching entails CASing an
- * "item" field from a non-null data value to null upon match, and
- * vice-versa for request nodes, CASing from null to a data
- * value. (Note that the linearization properties of this style of
- * queue are easy to verify -- elements are made available by
- * linking, and unavailable by matching.) Compared to plain M&S
- * queues, this property of dual queues requires one additional
- * successful atomic operation per enq/deq pair. But it also
- * enables lower cost variants of queue maintenance mechanics. (A
- * variation of this idea applies even for non-dual queues that
- * support deletion of interior elements, such as
- * j.u.c.ConcurrentLinkedQueue.)
- *
- * Once a node is matched, its match status can never again
- * change. We may thus arrange that the linked list of them
- * contain a prefix of zero or more matched nodes, followed by a
- * suffix of zero or more unmatched nodes. (Note that we allow
- * both the prefix and suffix to be zero length, which in turn
- * means that we do not use a dummy header.) If we were not
- * concerned with either time or space efficiency, we could
- * correctly perform enqueue and dequeue operations by traversing
- * from a pointer to the initial node; CASing the item of the
- * first unmatched node on match and CASing the next field of the
- * trailing node on appends. (Plus some special-casing when
- * initially empty). While this would be a terrible idea in
- * itself, it does have the benefit of not requiring ANY atomic
- * updates on head/tail fields.
- *
- * We introduce here an approach that lies between the extremes of
- * never versus always updating queue (head and tail) pointers.
- * This offers a tradeoff between sometimes requiring extra
- * traversal steps to locate the first and/or last unmatched
- * nodes, versus the reduced overhead and contention of fewer
- * updates to queue pointers. For example, a possible snapshot of
- * a queue is:
- *
- * head tail
- * | |
- * v v
- * M -> M -> U -> U -> U -> U
- *
- * The best value for this "slack" (the targeted maximum distance
- * between the value of "head" and the first unmatched node, and
- * similarly for "tail") is an empirical matter. We have found
- * that using very small constants in the range of 1-3 work best
- * over a range of platforms. Larger values introduce increasing
- * costs of cache misses and risks of long traversal chains, while
- * smaller values increase CAS contention and overhead.
- *
- * Dual queues with slack differ from plain M&S dual queues by
- * virtue of only sometimes updating head or tail pointers when
- * matching, appending, or even traversing nodes; in order to
- * maintain a targeted slack. The idea of "sometimes" may be
- * operationalized in several ways. The simplest is to use a
- * per-operation counter incremented on each traversal step, and
- * to try (via CAS) to update the associated queue pointer
- * whenever the count exceeds a threshold. Another, that requires
- * more overhead, is to use random number generators to update
- * with a given probability per traversal step.
- *
- * In any strategy along these lines, because CASes updating
- * fields may fail, the actual slack may exceed targeted
- * slack. However, they may be retried at any time to maintain
- * targets. Even when using very small slack values, this
- * approach works well for dual queues because it allows all
- * operations up to the point of matching or appending an item
- * (hence potentially allowing progress by another thread) to be
- * read-only, thus not introducing any further contention. As
- * described below, we implement this by performing slack
- * maintenance retries only after these points.
- *
- * As an accompaniment to such techniques, traversal overhead can
- * be further reduced without increasing contention of head
- * pointer updates: Threads may sometimes shortcut the "next" link
- * path from the current "head" node to be closer to the currently
- * known first unmatched node, and similarly for tail. Again, this
- * may be triggered with using thresholds or randomization.
- *
- * These ideas must be further extended to avoid unbounded amounts
- * of costly-to-reclaim garbage caused by the sequential "next"
- * links of nodes starting at old forgotten head nodes: As first
- * described in detail by Boehm
- * (http://portal.acm.org/citation.cfm?doid=503272.503282) if a GC
- * delays noticing that any arbitrarily old node has become
- * garbage, all newer dead nodes will also be unreclaimed.
- * (Similar issues arise in non-GC environments.) To cope with
- * this in our implementation, upon CASing to advance the head
- * pointer, we set the "next" link of the previous head to point
- * only to itself; thus limiting the length of connected dead lists.
- * (We also take similar care to wipe out possibly garbage
- * retaining values held in other Node fields.) However, doing so
- * adds some further complexity to traversal: If any "next"
- * pointer links to itself, it indicates that the current thread
- * has lagged behind a head-update, and so the traversal must
- * continue from the "head". Traversals trying to find the
- * current tail starting from "tail" may also encounter
- * self-links, in which case they also continue at "head".
- *
- * It is tempting in slack-based scheme to not even use CAS for
- * updates (similarly to Ladan-Mozes & Shavit). However, this
- * cannot be done for head updates under the above link-forgetting
- * mechanics because an update may leave head at a detached node.
- * And while direct writes are possible for tail updates, they
- * increase the risk of long retraversals, and hence long garbage
- * chains, which can be much more costly than is worthwhile
- * considering that the cost difference of performing a CAS vs
- * write is smaller when they are not triggered on each operation
- * (especially considering that writes and CASes equally require
- * additional GC bookkeeping ("write barriers") that are sometimes
- * more costly than the writes themselves because of contention).
- *
- * *** Overview of implementation ***
- *
- * We use a threshold-based approach to updates, with a slack
- * threshold of two -- that is, we update head/tail when the
- * current pointer appears to be two or more steps away from the
- * first/last node. The slack value is hard-wired: a path greater
- * than one is naturally implemented by checking equality of
- * traversal pointers except when the list has only one element,
- * in which case we keep slack threshold at one. Avoiding tracking
- * explicit counts across method calls slightly simplifies an
- * already-messy implementation. Using randomization would
- * probably work better if there were a low-quality dirt-cheap
- * per-thread one available, but even ThreadLocalRandom is too
- * heavy for these purposes.
- *
- * With such a small slack threshold value, it is not worthwhile
- * to augment this with path short-circuiting (i.e., unsplicing
- * interior nodes) except in the case of cancellation/removal (see
- * below).
- *
- * We allow both the head and tail fields to be null before any
- * nodes are enqueued; initializing upon first append. This
- * simplifies some other logic, as well as providing more
- * efficient explicit control paths instead of letting JVMs insert
- * implicit NullPointerExceptions when they are null. While not
- * currently fully implemented, we also leave open the possibility
- * of re-nulling these fields when empty (which is complicated to
- * arrange, for little benefit.)
- *
- * All enqueue/dequeue operations are handled by the single method
- * "xfer" with parameters indicating whether to act as some form
- * of offer, put, poll, take, or transfer (each possibly with
- * timeout). The relative complexity of using one monolithic
- * method outweighs the code bulk and maintenance problems of
- * using separate methods for each case.
- *
- * Operation consists of up to three phases. The first is
- * implemented within method xfer, the second in tryAppend, and
- * the third in method awaitMatch.
- *
- * 1. Try to match an existing node
- *
- * Starting at head, skip already-matched nodes until finding
- * an unmatched node of opposite mode, if one exists, in which
- * case matching it and returning, also if necessary updating
- * head to one past the matched node (or the node itself if the
- * list has no other unmatched nodes). If the CAS misses, then
- * a loop retries advancing head by two steps until either
- * success or the slack is at most two. By requiring that each
- * attempt advances head by two (if applicable), we ensure that
- * the slack does not grow without bound. Traversals also check
- * if the initial head is now off-list, in which case they
- * start at the new head.
- *
- * If no candidates are found and the call was untimed
- * poll/offer, (argument "how" is NOW) return.
- *
- * 2. Try to append a new node (method tryAppend)
- *
- * Starting at current tail pointer, find the actual last node
- * and try to append a new node (or if head was null, establish
- * the first node). Nodes can be appended only if their
- * predecessors are either already matched or are of the same
- * mode. If we detect otherwise, then a new node with opposite
- * mode must have been appended during traversal, so we must
- * restart at phase 1. The traversal and update steps are
- * otherwise similar to phase 1: Retrying upon CAS misses and
- * checking for staleness. In particular, if a self-link is
- * encountered, then we can safely jump to a node on the list
- * by continuing the traversal at current head.
- *
- * On successful append, if the call was ASYNC, return.
- *
- * 3. Await match or cancellation (method awaitMatch)
- *
- * Wait for another thread to match node; instead cancelling if
- * the current thread was interrupted or the wait timed out. On
- * multiprocessors, we use front-of-queue spinning: If a node
- * appears to be the first unmatched node in the queue, it
- * spins a bit before blocking. In either case, before blocking
- * it tries to unsplice any nodes between the current "head"
- * and the first unmatched node.
- *
- * Front-of-queue spinning vastly improves performance of
- * heavily contended queues. And so long as it is relatively
- * brief and "quiet", spinning does not much impact performance
- * of less-contended queues. During spins threads check their
- * interrupt status and generate a thread-local random number
- * to decide to occasionally perform a Thread.yield. While
- * yield has underdefined specs, we assume that it might help,
- * and will not hurt, in limiting impact of spinning on busy
- * systems. We also use smaller (1/2) spins for nodes that are
- * not known to be front but whose predecessors have not
- * blocked -- these "chained" spins avoid artifacts of
- * front-of-queue rules which otherwise lead to alternating
- * nodes spinning vs blocking. Further, front threads that
- * represent phase changes (from data to request node or vice
- * versa) compared to their predecessors receive additional
- * chained spins, reflecting longer paths typically required to
- * unblock threads during phase changes.
- *
- *
- * ** Unlinking removed interior nodes **
- *
- * In addition to minimizing garbage retention via self-linking
- * described above, we also unlink removed interior nodes. These
- * may arise due to timed out or interrupted waits, or calls to
- * remove(x) or Iterator.remove. Normally, given a node that was
- * at one time known to be the predecessor of some node s that is
- * to be removed, we can unsplice s by CASing the next field of
- * its predecessor if it still points to s (otherwise s must
- * already have been removed or is now offlist). But there are two
- * situations in which we cannot guarantee to make node s
- * unreachable in this way: (1) If s is the trailing node of list
- * (i.e., with null next), then it is pinned as the target node
- * for appends, so can only be removed later after other nodes are
- * appended. (2) We cannot necessarily unlink s given a
- * predecessor node that is matched (including the case of being
- * cancelled): the predecessor may already be unspliced, in which
- * case some previous reachable node may still point to s.
- * (For further explanation see Herlihy & Shavit "The Art of
- * Multiprocessor Programming" chapter 9). Although, in both
- * cases, we can rule out the need for further action if either s
- * or its predecessor are (or can be made to be) at, or fall off
- * from, the head of list.
- *
- * Without taking these into account, it would be possible for an
- * unbounded number of supposedly removed nodes to remain
- * reachable. Situations leading to such buildup are uncommon but
- * can occur in practice; for example when a series of short timed
- * calls to poll repeatedly time out but never otherwise fall off
- * the list because of an untimed call to take at the front of the
- * queue.
- *
- * When these cases arise, rather than always retraversing the
- * entire list to find an actual predecessor to unlink (which
- * won't help for case (1) anyway), we record a conservative
- * estimate of possible unsplice failures (in "sweepVotes").
- * We trigger a full sweep when the estimate exceeds a threshold
- * ("SWEEP_THRESHOLD") indicating the maximum number of estimated
- * removal failures to tolerate before sweeping through, unlinking
- * cancelled nodes that were not unlinked upon initial removal.
- * We perform sweeps by the thread hitting threshold (rather than
- * background threads or by spreading work to other threads)
- * because in the main contexts in which removal occurs, the
- * caller is already timed-out, cancelled, or performing a
- * potentially O(n) operation (e.g. remove(x)), none of which are
- * time-critical enough to warrant the overhead that alternatives
- * would impose on other threads.
- *
- * Because the sweepVotes estimate is conservative, and because
- * nodes become unlinked "naturally" as they fall off the head of
- * the queue, and because we allow votes to accumulate even while
- * sweeps are in progress, there are typically significantly fewer
- * such nodes than estimated. Choice of a threshold value
- * balances the likelihood of wasted effort and contention, versus
- * providing a worst-case bound on retention of interior nodes in
- * quiescent queues. The value defined below was chosen
- * empirically to balance these under various timeout scenarios.
- *
- * Note that we cannot self-link unlinked interior nodes during
- * sweeps. However, the associated garbage chains terminate when
- * some successor ultimately falls off the head of the list and is
- * self-linked.
- */
-
- /**
- * True if on multiprocessor
- */
- private static final boolean MP =
- Runtime.getRuntime().availableProcessors() > 1;
-
- /**
- * The number of times to spin (with randomly interspersed calls
- * to Thread.yield) on multiprocessor before blocking when a node
- * is apparently the first waiter in the queue. See above for
- * explanation. Must be a power of two. The value is empirically
- * derived -- it works pretty well across a variety of processors,
- * numbers of CPUs, and OSes.
- */
- private static final int FRONT_SPINS = 1 << 7;
-
- /**
- * The number of times to spin before blocking when a node is
- * preceded by another node that is apparently spinning. Also
- * serves as an increment to FRONT_SPINS on phase changes, and as
- * base average frequency for yielding during spins. Must be a
- * power of two.
- */
- private static final int CHAINED_SPINS = FRONT_SPINS >>> 1;
-
- /**
- * The maximum number of estimated removal failures (sweepVotes)
- * to tolerate before sweeping through the queue unlinking
- * cancelled nodes that were not unlinked upon initial
- * removal. See above for explanation. The value must be at least
- * two to avoid useless sweeps when removing trailing nodes.
- */
- static final int SWEEP_THRESHOLD = 32;
-
- /**
- * Queue nodes. Uses Object, not E, for items to allow forgetting
- * them after use. Relies heavily on Unsafe mechanics to minimize
- * unnecessary ordering constraints: Writes that are intrinsically
- * ordered wrt other accesses or CASes use simple relaxed forms.
- */
- static final class Node {
- final boolean isData; // false if this is a request node
- volatile Object item; // initially non-null if isData; CASed to match
- volatile Node next;
- volatile Thread waiter; // null until waiting
-
- // CAS methods for fields
- final boolean casNext(Node cmp, Node val) {
- return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val);
- }
-
- final boolean casItem(Object cmp, Object val) {
- // assert cmp == null || cmp.getClass() != Node.class;
- return UNSAFE.compareAndSwapObject(this, itemOffset, cmp, val);
- }
-
- /**
- * Constructs a new node. Uses relaxed write because item can
- * only be seen after publication via casNext.
- */
- Node(Object item, boolean isData) {
- UNSAFE.putObject(this, itemOffset, item); // relaxed write
- this.isData = isData;
- }
-
- /**
- * Links node to itself to avoid garbage retention. Called
- * only after CASing head field, so uses relaxed write.
- */
- final void forgetNext() {
- UNSAFE.putObject(this, nextOffset, this);
- }
-
- /**
- * Sets item to self and waiter to null, to avoid garbage
- * retention after matching or cancelling. Uses relaxed writes
- * because order is already constrained in the only calling
- * contexts: item is forgotten only after volatile/atomic
- * mechanics that extract items. Similarly, clearing waiter
- * follows either CAS or return from park (if ever parked;
- * else we don't care).
- */
- final void forgetContents() {
- UNSAFE.putObject(this, itemOffset, this);
- UNSAFE.putObject(this, waiterOffset, null);
- }
-
- /**
- * Returns true if this node has been matched, including the
- * case of artificial matches due to cancellation.
- */
- final boolean isMatched() {
- Object x = item;
- return (x == this) || ((x == null) == isData);
- }
-
- /**
- * Returns true if this is an unmatched request node.
- */
- final boolean isUnmatchedRequest() {
- return !isData && item == null;
- }
-
- /**
- * Returns true if a node with the given mode cannot be
- * appended to this node because this node is unmatched and
- * has opposite data mode.
- */
- final boolean cannotPrecede(boolean haveData) {
- boolean d = isData;
- Object x;
- return d != haveData && (x = item) != this && (x != null) == d;
- }
-
- /**
- * Tries to artificially match a data node -- used by remove.
- */
- final boolean tryMatchData() {
- // assert isData;
- Object x = item;
- if (x != null && x != this && casItem(x, null)) {
- LockSupport.unpark(waiter);
- return true;
- }
- return false;
- }
-
- private static final long serialVersionUID = -3375979862319811754L;
-
- // Unsafe mechanics
- private static final sun.misc.Unsafe UNSAFE;
- private static final long itemOffset;
- private static final long nextOffset;
- private static final long waiterOffset;
-
- static {
- try {
- UNSAFE = getUnsafe();
- Class<?> k = Node.class;
- itemOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("item"));
- nextOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("next"));
- waiterOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("waiter"));
- } catch (Exception e) {
- throw new Error(e);
- }
- }
- }
-
- /**
- * head of the queue; null until first enqueue
- */
- transient volatile Node head;
-
- /**
- * tail of the queue; null until first append
- */
- private transient volatile Node tail;
-
- /**
- * The number of apparent failures to unsplice removed nodes
- */
- private transient volatile int sweepVotes;
-
- // CAS methods for fields
- private boolean casTail(Node cmp, Node val) {
- return UNSAFE.compareAndSwapObject(this, tailOffset, cmp, val);
- }
-
- private boolean casHead(Node cmp, Node val) {
- return UNSAFE.compareAndSwapObject(this, headOffset, cmp, val);
- }
-
- private boolean casSweepVotes(int cmp, int val) {
- return UNSAFE.compareAndSwapInt(this, sweepVotesOffset, cmp, val);
- }
-
- /*
- * Possible values for "how" argument in xfer method.
- */
- private static final int NOW = 0; // for untimed poll, tryTransfer
- private static final int ASYNC = 1; // for offer, put, add
- private static final int SYNC = 2; // for transfer, take
- private static final int TIMED = 3; // for timed poll, tryTransfer
-
- @SuppressWarnings("unchecked")
- static <E> E cast(Object item) {
- // assert item == null || item.getClass() != Node.class;
- return (E) item;
- }
-
- /**
- * Implements all queuing methods. See above for explanation.
- *
- * @param e the item or null for take
- * @param haveData true if this is a put, else a take
- * @param how NOW, ASYNC, SYNC, or TIMED
- * @param nanos timeout in nanosecs, used only if mode is TIMED
- * @return an item if matched, else e
- * @throws NullPointerException if haveData mode but e is null
- */
- private E xfer(E e, boolean haveData, int how, long nanos) {
- if (haveData && (e == null))
- throw new NullPointerException();
- Node s = null; // the node to append, if needed
-
- retry:
- for (; ; ) { // restart on append race
-
- for (Node h = head, p = h; p != null; ) { // find & match first node
- boolean isData = p.isData;
- Object item = p.item;
- if (item != p && (item != null) == isData) { // unmatched
- if (isData == haveData) // can't match
- break;
- if (p.casItem(item, e)) { // match
- for (Node q = p; q != h; ) {
- Node n = q.next; // update by 2 unless singleton
- if (head == h && casHead(h, n == null ? q : n)) {
- h.forgetNext();
- break;
- } // advance and retry
- if ((h = head) == null ||
- (q = h.next) == null || !q.isMatched())
- break; // unless slack < 2
- }
- LockSupport.unpark(p.waiter);
- return LinkedTransferQueue.<E>cast(item);
- }
- }
- Node n = p.next;
- p = (p != n) ? n : (h = head); // Use head if p offlist
- }
-
- if (how != NOW) { // No matches available
- if (s == null)
- s = new Node(e, haveData);
- Node pred = tryAppend(s, haveData);
- if (pred == null)
- continue retry; // lost race vs opposite mode
- if (how != ASYNC)
- return awaitMatch(s, pred, e, (how == TIMED), nanos);
- }
- return e; // not waiting
- }
- }
-
- /**
- * Tries to append node s as tail.
- *
- * @param s the node to append
- * @param haveData true if appending in data mode
- * @return null on failure due to losing race with append in
- * different mode, else s's predecessor, or s itself if no
- * predecessor
- */
- private Node tryAppend(Node s, boolean haveData) {
- for (Node t = tail, p = t; ; ) { // move p to last node and append
- Node n, u; // temps for reads of next & tail
- if (p == null && (p = head) == null) {
- if (casHead(null, s))
- return s; // initialize
- } else if (p.cannotPrecede(haveData))
- return null; // lost race vs opposite mode
- else if ((n = p.next) != null) // not last; keep traversing
- p = p != t && t != (u = tail) ? (t = u) : // stale tail
- (p != n) ? n : null; // restart if off list
- else if (!p.casNext(null, s))
- p = p.next; // re-read on CAS failure
- else {
- if (p != t) { // update if slack now >= 2
- while ((tail != t || !casTail(t, s)) &&
- (t = tail) != null &&
- (s = t.next) != null && // advance and retry
- (s = s.next) != null && s != t) ;
- }
- return p;
- }
- }
- }
-
- /**
- * Spins/yields/blocks until node s is matched or caller gives up.
- *
- * @param s the waiting node
- * @param pred the predecessor of s, or s itself if it has no
- * predecessor, or null if unknown (the null case does not occur
- * in any current calls but may in possible future extensions)
- * @param e the comparison value for checking match
- * @param timed if true, wait only until timeout elapses
- * @param nanos timeout in nanosecs, used only if timed is true
- * @return matched item, or e if unmatched on interrupt or timeout
- */
- private E awaitMatch(Node s, Node pred, E e, boolean timed, long nanos) {
- long lastTime = timed ? System.nanoTime() : 0L;
- Thread w = Thread.currentThread();
- int spins = -1; // initialized after first item and cancel checks
- ThreadLocalRandom randomYields = null; // bound if needed
-
- for (; ; ) {
- Object item = s.item;
- if (item != e) { // matched
- // assert item != s;
- s.forgetContents(); // avoid garbage
- return LinkedTransferQueue.<E>cast(item);
- }
- if ((w.isInterrupted() || (timed && nanos <= 0)) &&
- s.casItem(e, s)) { // cancel
- unsplice(pred, s);
- return e;
- }
-
- if (spins < 0) { // establish spins at/near front
- if ((spins = spinsFor(pred, s.isData)) > 0)
- randomYields = ThreadLocalRandom.current();
- } else if (spins > 0) { // spin
- --spins;
- if (randomYields.nextInt(CHAINED_SPINS) == 0)
- Thread.yield(); // occasionally yield
- } else if (s.waiter == null) {
- s.waiter = w; // request unpark then recheck
- } else if (timed) {
- long now = System.nanoTime();
- if ((nanos -= now - lastTime) > 0)
- LockSupport.parkNanos(this, nanos);
- lastTime = now;
- } else {
- LockSupport.park(this);
- }
- }
- }
-
- /**
- * Returns spin/yield value for a node with given predecessor and
- * data mode. See above for explanation.
- */
- private static int spinsFor(Node pred, boolean haveData) {
- if (MP && pred != null) {
- if (pred.isData != haveData) // phase change
- return FRONT_SPINS + CHAINED_SPINS;
- if (pred.isMatched()) // probably at front
- return FRONT_SPINS;
- if (pred.waiter == null) // pred apparently spinning
- return CHAINED_SPINS;
- }
- return 0;
- }
-
- /* -------------- Traversal methods -------------- */
-
- /**
- * Returns the successor of p, or the head node if p.next has been
- * linked to self, which will only be true if traversing with a
- * stale pointer that is now off the list.
- */
- final Node succ(Node p) {
- Node next = p.next;
- return (p == next) ? head : next;
- }
-
- /**
- * Returns the first unmatched node of the given mode, or null if
- * none. Used by methods isEmpty, hasWaitingConsumer.
- */
- private Node firstOfMode(boolean isData) {
- for (Node p = head; p != null; p = succ(p)) {
- if (!p.isMatched())
- return (p.isData == isData) ? p : null;
- }
- return null;
- }
-
- /**
- * Returns the item in the first unmatched node with isData; or
- * null if none. Used by peek.
- */
- private E firstDataItem() {
- for (Node p = head; p != null; p = succ(p)) {
- Object item = p.item;
- if (p.isData) {
- if (item != null && item != p)
- return LinkedTransferQueue.<E>cast(item);
- } else if (item == null)
- return null;
- }
- return null;
- }
-
- /**
- * Traverses and counts unmatched nodes of the given mode.
- * Used by methods size and getWaitingConsumerCount.
- */
- private int countOfMode(boolean data) {
- int count = 0;
- for (Node p = head; p != null; ) {
- if (!p.isMatched()) {
- if (p.isData != data)
- return 0;
- if (++count == Integer.MAX_VALUE) // saturated
- break;
- }
- Node n = p.next;
- if (n != p)
- p = n;
- else {
- count = 0;
- p = head;
- }
- }
- return count;
- }
-
- final class Itr implements Iterator<E> {
- private Node nextNode; // next node to return item for
- private E nextItem; // the corresponding item
- private Node lastRet; // last returned node, to support remove
- private Node lastPred; // predecessor to unlink lastRet
-
- /**
- * Moves to next node after prev, or first node if prev null.
- */
- private void advance(Node prev) {
- /*
- * To track and avoid buildup of deleted nodes in the face
- * of calls to both Queue.remove and Itr.remove, we must
- * include variants of unsplice and sweep upon each
- * advance: Upon Itr.remove, we may need to catch up links
- * from lastPred, and upon other removes, we might need to
- * skip ahead from stale nodes and unsplice deleted ones
- * found while advancing.
- */
-
- Node r, b; // reset lastPred upon possible deletion of lastRet
- if ((r = lastRet) != null && !r.isMatched())
- lastPred = r; // next lastPred is old lastRet
- else if ((b = lastPred) == null || b.isMatched())
- lastPred = null; // at start of list
- else {
- Node s, n; // help with removal of lastPred.next
- while ((s = b.next) != null &&
- s != b && s.isMatched() &&
- (n = s.next) != null && n != s)
- b.casNext(s, n);
- }
-
- this.lastRet = prev;
-
- for (Node p = prev, s, n; ; ) {
- s = (p == null) ? head : p.next;
- if (s == null)
- break;
- else if (s == p) {
- p = null;
- continue;
- }
- Object item = s.item;
- if (s.isData) {
- if (item != null && item != s) {
- nextItem = LinkedTransferQueue.<E>cast(item);
- nextNode = s;
- return;
- }
- } else if (item == null)
- break;
- // assert s.isMatched();
- if (p == null)
- p = s;
- else if ((n = s.next) == null)
- break;
- else if (s == n)
- p = null;
- else
- p.casNext(s, n);
- }
- nextNode = null;
- nextItem = null;
- }
-
- Itr() {
- advance(null);
- }
-
- public final boolean hasNext() {
- return nextNode != null;
- }
-
- public final E next() {
- Node p = nextNode;
- if (p == null) throw new NoSuchElementException();
- E e = nextItem;
- advance(p);
- return e;
- }
-
- public final void remove() {
- final Node lastRet = this.lastRet;
- if (lastRet == null)
- throw new IllegalStateException();
- this.lastRet = null;
- if (lastRet.tryMatchData())
- unsplice(lastPred, lastRet);
- }
- }
-
- /* -------------- Removal methods -------------- */
-
- /**
- * Unsplices (now or later) the given deleted/cancelled node with
- * the given predecessor.
- *
- * @param pred a node that was at one time known to be the
- * predecessor of s, or null or s itself if s is/was at head
- * @param s the node to be unspliced
- */
- final void unsplice(Node pred, Node s) {
- s.forgetContents(); // forget unneeded fields
- /*
- * See above for rationale. Briefly: if pred still points to
- * s, try to unlink s. If s cannot be unlinked, because it is
- * trailing node or pred might be unlinked, and neither pred
- * nor s are head or offlist, add to sweepVotes, and if enough
- * votes have accumulated, sweep.
- */
- if (pred != null && pred != s && pred.next == s) {
- Node n = s.next;
- if (n == null ||
- (n != s && pred.casNext(s, n) && pred.isMatched())) {
- for (; ; ) { // check if at, or could be, head
- Node h = head;
- if (h == pred || h == s || h == null)
- return; // at head or list empty
- if (!h.isMatched())
- break;
- Node hn = h.next;
- if (hn == null)
- return; // now empty
- if (hn != h && casHead(h, hn))
- h.forgetNext(); // advance head
- }
- if (pred.next != pred && s.next != s) { // recheck if offlist
- for (; ; ) { // sweep now if enough votes
- int v = sweepVotes;
- if (v < SWEEP_THRESHOLD) {
- if (casSweepVotes(v, v + 1))
- break;
- } else if (casSweepVotes(v, 0)) {
- sweep();
- break;
- }
- }
- }
- }
- }
- }
-
- /**
- * Unlinks matched (typically cancelled) nodes encountered in a
- * traversal from head.
- */
- private void sweep() {
- for (Node p = head, s, n; p != null && (s = p.next) != null; ) {
- if (!s.isMatched())
- // Unmatched nodes are never self-linked
- p = s;
- else if ((n = s.next) == null) // trailing node is pinned
- break;
- else if (s == n) // stale
- // No need to also check for p == s, since that implies s == n
- p = head;
- else
- p.casNext(s, n);
- }
- }
-
- /**
- * Main implementation of remove(Object)
- */
- private boolean findAndRemove(Object e) {
- if (e != null) {
- for (Node pred = null, p = head; p != null; ) {
- Object item = p.item;
- if (p.isData) {
- if (item != null && item != p && e.equals(item) &&
- p.tryMatchData()) {
- unsplice(pred, p);
- return true;
- }
- } else if (item == null)
- break;
- pred = p;
- if ((p = p.next) == pred) { // stale
- pred = null;
- p = head;
- }
- }
- }
- return false;
- }
-
-
- /**
- * Creates an initially empty {@code LinkedTransferQueue}.
- */
- public LinkedTransferQueue() {
- }
-
- /**
- * Creates a {@code LinkedTransferQueue}
- * initially containing the elements of the given collection,
- * added in traversal order of the collection's iterator.
- *
- * @param c the collection of elements to initially contain
- * @throws NullPointerException if the specified collection or any
- * of its elements are null
- */
- public LinkedTransferQueue(Collection<? extends E> c) {
- this();
- addAll(c);
- }
-
- /**
- * Inserts the specified element at the tail of this queue.
- * As the queue is unbounded, this method will never block.
- *
- * @throws NullPointerException if the specified element is null
- */
- public void put(E e) {
- xfer(e, true, ASYNC, 0);
- }
-
- /**
- * Inserts the specified element at the tail of this queue.
- * As the queue is unbounded, this method will never block or
- * return {@code false}.
- *
- * @return {@code true} (as specified by
- * {@link java.util.concurrent.BlockingQueue#offer(Object, long, TimeUnit)
- * BlockingQueue.offer})
- * @throws NullPointerException if the specified element is null
- */
- public boolean offer(E e, long timeout, TimeUnit unit) {
- xfer(e, true, ASYNC, 0);
- return true;
- }
-
- /**
- * Inserts the specified element at the tail of this queue.
- * As the queue is unbounded, this method will never return {@code false}.
- *
- * @return {@code true} (as specified by {@link Queue#offer})
- * @throws NullPointerException if the specified element is null
- */
- public boolean offer(E e) {
- xfer(e, true, ASYNC, 0);
- return true;
- }
-
- /**
- * Inserts the specified element at the tail of this queue.
- * As the queue is unbounded, this method will never throw
- * {@link IllegalStateException} or return {@code false}.
- *
- * @return {@code true} (as specified by {@link Collection#add})
- * @throws NullPointerException if the specified element is null
- */
- public boolean add(E e) {
- xfer(e, true, ASYNC, 0);
- return true;
- }
-
- /**
- * Transfers the element to a waiting consumer immediately, if possible.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long, TimeUnit) poll}),
- * otherwise returning {@code false} without enqueuing the element.
- *
- * @throws NullPointerException if the specified element is null
- */
- public boolean tryTransfer(E e) {
- return xfer(e, true, NOW, 0) == null;
- }
-
- /**
- * Transfers the element to a consumer, waiting if necessary to do so.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long, TimeUnit) poll}),
- * else inserts the specified element at the tail of this queue
- * and waits until the element is received by a consumer.
- *
- * @throws NullPointerException if the specified element is null
- */
- public void transfer(E e) throws InterruptedException {
- if (xfer(e, true, SYNC, 0) != null) {
- Thread.interrupted(); // failure possible only due to interrupt
- throw new InterruptedException();
- }
- }
-
- /**
- * Transfers the element to a consumer if it is possible to do so
- * before the timeout elapses.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long, TimeUnit) poll}),
- * else inserts the specified element at the tail of this queue
- * and waits until the element is received by a consumer,
- * returning {@code false} if the specified wait time elapses
- * before the element can be transferred.
- *
- * @throws NullPointerException if the specified element is null
- */
- public boolean tryTransfer(E e, long timeout, TimeUnit unit)
- throws InterruptedException {
- if (xfer(e, true, TIMED, unit.toNanos(timeout)) == null)
- return true;
- if (!Thread.interrupted())
- return false;
- throw new InterruptedException();
- }
-
- public E take() throws InterruptedException {
- E e = xfer(null, false, SYNC, 0);
- if (e != null)
- return e;
- Thread.interrupted();
- throw new InterruptedException();
- }
-
- public E poll(long timeout, TimeUnit unit) throws InterruptedException {
- E e = xfer(null, false, TIMED, unit.toNanos(timeout));
- if (e != null || !Thread.interrupted())
- return e;
- throw new InterruptedException();
- }
-
- public E poll() {
- return xfer(null, false, NOW, 0);
- }
-
- /**
- * @throws NullPointerException {@inheritDoc}
- * @throws IllegalArgumentException {@inheritDoc}
- */
- public int drainTo(Collection<? super E> c) {
- if (c == null)
- throw new NullPointerException();
- if (c == this)
- throw new IllegalArgumentException();
- int n = 0;
- for (E e; (e = poll()) != null; ) {
- c.add(e);
- ++n;
- }
- return n;
- }
-
- /**
- * @throws NullPointerException {@inheritDoc}
- * @throws IllegalArgumentException {@inheritDoc}
- */
- public int drainTo(Collection<? super E> c, int maxElements) {
- if (c == null)
- throw new NullPointerException();
- if (c == this)
- throw new IllegalArgumentException();
- int n = 0;
- for (E e; n < maxElements && (e = poll()) != null; ) {
- c.add(e);
- ++n;
- }
- return n;
- }
-
- /**
- * Returns an iterator over the elements in this queue in proper sequence.
- * The elements will be returned in order from first (head) to last (tail).
- *
- * <p>The returned iterator is a "weakly consistent" iterator that
- * will never throw {@link java.util.ConcurrentModificationException
- * ConcurrentModificationException}, and guarantees to traverse
- * elements as they existed upon construction of the iterator, and
- * may (but is not guaranteed to) reflect any modifications
- * subsequent to construction.
- *
- * @return an iterator over the elements in this queue in proper sequence
- */
- public Iterator<E> iterator() {
- return new Itr();
- }
-
- public E peek() {
- return firstDataItem();
- }
-
- /**
- * Returns {@code true} if this queue contains no elements.
- *
- * @return {@code true} if this queue contains no elements
- */
- public boolean isEmpty() {
- for (Node p = head; p != null; p = succ(p)) {
- if (!p.isMatched())
- return !p.isData;
- }
- return true;
- }
-
- public boolean hasWaitingConsumer() {
- return firstOfMode(false) != null;
- }
-
- /**
- * Returns the number of elements in this queue. If this queue
- * contains more than {@code Integer.MAX_VALUE} elements, returns
- * {@code Integer.MAX_VALUE}.
- *
- * <p>Beware that, unlike in most collections, this method is
- * <em>NOT</em> a constant-time operation. Because of the
- * asynchronous nature of these queues, determining the current
- * number of elements requires an O(n) traversal.
- *
- * @return the number of elements in this queue
- */
- public int size() {
- return countOfMode(true);
- }
-
- public int getWaitingConsumerCount() {
- return countOfMode(false);
- }
-
- /**
- * Removes a single instance of the specified element from this queue,
- * if it is present. More formally, removes an element {@code e} such
- * that {@code o.equals(e)}, if this queue contains one or more such
- * elements.
- * Returns {@code true} if this queue contained the specified element
- * (or equivalently, if this queue changed as a result of the call).
- *
- * @param o element to be removed from this queue, if present
- * @return {@code true} if this queue changed as a result of the call
- */
- public boolean remove(Object o) {
- return findAndRemove(o);
- }
-
- /**
- * Returns {@code true} if this queue contains the specified element.
- * More formally, returns {@code true} if and only if this queue contains
- * at least one element {@code e} such that {@code o.equals(e)}.
- *
- * @param o object to be checked for containment in this queue
- * @return {@code true} if this queue contains the specified element
- */
- public boolean contains(Object o) {
- if (o == null) return false;
- for (Node p = head; p != null; p = succ(p)) {
- Object item = p.item;
- if (p.isData) {
- if (item != null && item != p && o.equals(item))
- return true;
- } else if (item == null)
- break;
- }
- return false;
- }
-
- /**
- * Always returns {@code Integer.MAX_VALUE} because a
- * {@code LinkedTransferQueue} is not capacity constrained.
- *
- * @return {@code Integer.MAX_VALUE} (as specified by
- * {@link java.util.concurrent.BlockingQueue#remainingCapacity()
- * BlockingQueue.remainingCapacity})
- */
- public int remainingCapacity() {
- return Integer.MAX_VALUE;
- }
-
- /**
- * Saves the state to a stream (that is, serializes it).
- *
- * @param s the stream
- * @serialData All of the elements (each an {@code E}) in
- * the proper order, followed by a null
- */
- private void writeObject(java.io.ObjectOutputStream s)
- throws java.io.IOException {
- s.defaultWriteObject();
- for (E e : this)
- s.writeObject(e);
- // Use trailing null as sentinel
- s.writeObject(null);
- }
-
- /**
- * Reconstitutes the Queue instance from a stream (that is,
- * deserializes it).
- *
- * @param s the stream
- */
- private void readObject(java.io.ObjectInputStream s)
- throws java.io.IOException, ClassNotFoundException {
- s.defaultReadObject();
- for (; ; ) {
- @SuppressWarnings("unchecked")
- E item = (E) s.readObject();
- if (item == null)
- break;
- else
- offer(item);
- }
- }
-
- // Unsafe mechanics
-
- private static final sun.misc.Unsafe UNSAFE;
- private static final long headOffset;
- private static final long tailOffset;
- private static final long sweepVotesOffset;
-
- static {
- try {
- UNSAFE = getUnsafe();
- Class<?> k = LinkedTransferQueue.class;
- headOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("head"));
- tailOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("tail"));
- sweepVotesOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("sweepVotes"));
- } catch (Exception e) {
- throw new Error(e);
- }
- }
-
- /**
- * Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package.
- * Replace with a simple call to Unsafe.getUnsafe when integrating
- * into a jdk.
- *
- * @return a sun.misc.Unsafe
- */
- static sun.misc.Unsafe getUnsafe() {
- try {
- return sun.misc.Unsafe.getUnsafe();
- } catch (SecurityException tryReflectionInstead) {
- }
- try {
- return java.security.AccessController.doPrivileged
- (new java.security.PrivilegedExceptionAction<sun.misc.Unsafe>() {
- public sun.misc.Unsafe run() throws Exception {
- Class<sun.misc.Unsafe> k = sun.misc.Unsafe.class;
- for (java.lang.reflect.Field f : k.getDeclaredFields()) {
- f.setAccessible(true);
- Object x = f.get(null);
- if (k.isInstance(x))
- return k.cast(x);
- }
- throw new NoSuchFieldError("the Unsafe");
- }
- });
- } catch (java.security.PrivilegedActionException e) {
- throw new RuntimeException("Could not initialize intrinsics",
- e.getCause());
- }
- }
-}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/MultivaluedStringMap.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/MultivaluedStringMap.java
index 808055e..168a371 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/MultivaluedStringMap.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/MultivaluedStringMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -30,7 +30,7 @@
* individual string values as a constructor parameters.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class MultivaluedStringMap extends MultivaluedHashMap<String, String> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/NonBlockingInputStream.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/NonBlockingInputStream.java
index 148ec34..bcd0058 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/NonBlockingInputStream.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/NonBlockingInputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
* An abstract {@link InputStream} extension that defines contract for non-blocking
* streaming {@code read} operations.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class NonBlockingInputStream extends InputStream {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Ref.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Ref.java
index 6357e33..f7c9996 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Ref.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Ref.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -21,7 +21,7 @@
* and the reference can be get by {@link #get()}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*
* @param <T> referred value type
*
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Refs.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Refs.java
index dacf95f..1ae6c3c 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Refs.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Refs.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* A collection of {@link Ref reference} factory & utility methods.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class Refs {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ThreadLocalRandom.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ThreadLocalRandom.java
deleted file mode 100644
index aaf5017..0000000
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/ThreadLocalRandom.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-package org.glassfish.jersey.internal.util.collection;
-
-import java.util.Random;
-
-/**
- * A random number generator isolated to the current thread. Like the
- * global {@link java.util.Random} generator used by the {@link
- * java.lang.Math} class, a {@code ThreadLocalRandom} is initialized
- * with an internally generated seed that may not otherwise be
- * modified. When applicable, use of {@code ThreadLocalRandom} rather
- * than shared {@code Random} objects in concurrent programs will
- * typically encounter much less overhead and contention. Use of
- * {@code ThreadLocalRandom} is particularly appropriate when multiple
- * tasks (for example, each a {@link ForkJoinTask}) use random numbers
- * in parallel in thread pools.
- *
- * <p>Usages of this class should typically be of the form:
- * {@code ThreadLocalRandom.current().nextX(...)} (where
- * {@code X} is {@code Int}, {@code Long}, etc).
- * When all usages are of this form, it is never possible to
- * accidently share a {@code ThreadLocalRandom} across multiple threads.
- *
- * <p>This class also provides additional commonly used bounded random
- * generation methods.
- *
- * @author Doug Lea
- */
-class ThreadLocalRandom extends Random {
- // same constants as Random, but must be redeclared because private
- private static final long multiplier = 0x5DEECE66DL;
- private static final long addend = 0xBL;
- private static final long mask = (1L << 48) - 1;
-
- /**
- * The random seed. We can't use super.seed.
- */
- private long rnd;
-
- /**
- * Initialization flag to permit calls to setSeed to succeed only
- * while executing the Random constructor. We can't allow others
- * since it would cause setting seed in one part of a program to
- * unintentionally impact other usages by the thread.
- */
- boolean initialized;
-
- // Padding to help avoid memory contention among seed updates in
- // different TLRs in the common case that they are located near
- // each other.
- private long pad0, pad1, pad2, pad3, pad4, pad5, pad6, pad7;
-
- /**
- * The actual ThreadLocal
- */
- private static final ThreadLocal<ThreadLocalRandom> localRandom =
- new ThreadLocal<ThreadLocalRandom>() {
- protected ThreadLocalRandom initialValue() {
- return new ThreadLocalRandom();
- }
- };
-
-
- /**
- * Constructor called only by localRandom.initialValue.
- */
- ThreadLocalRandom() {
- super();
- initialized = true;
- }
-
- /**
- * Returns the current thread's {@code ThreadLocalRandom}.
- *
- * @return the current thread's {@code ThreadLocalRandom}
- */
- public static ThreadLocalRandom current() {
- return localRandom.get();
- }
-
- /**
- * Throws {@code UnsupportedOperationException}. Setting seeds in
- * this generator is not supported.
- *
- * @throws UnsupportedOperationException always
- */
- public void setSeed(long seed) {
- if (initialized)
- throw new UnsupportedOperationException();
- rnd = (seed ^ multiplier) & mask;
- }
-
- protected int next(int bits) {
- rnd = (rnd * multiplier + addend) & mask;
- return (int) (rnd >>> (48 - bits));
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed value between the
- * given least value (inclusive) and bound (exclusive).
- *
- * @param least the least value returned
- * @param bound the upper bound (exclusive)
- * @return the next value
- * @throws IllegalArgumentException if least greater than or equal
- * to bound
- */
- public int nextInt(int least, int bound) {
- if (least >= bound)
- throw new IllegalArgumentException();
- return nextInt(bound - least) + least;
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed value
- * between 0 (inclusive) and the specified value (exclusive).
- *
- * @param n the bound on the random number to be returned. Must be
- * positive.
- * @return the next value
- * @throws IllegalArgumentException if n is not positive
- */
- public long nextLong(long n) {
- if (n <= 0)
- throw new IllegalArgumentException("n must be positive");
- // Divide n by two until small enough for nextInt. On each
- // iteration (at most 31 of them but usually much less),
- // randomly choose both whether to include high bit in result
- // (offset) and whether to continue with the lower vs upper
- // half (which makes a difference only if odd).
- long offset = 0;
- while (n >= Integer.MAX_VALUE) {
- int bits = next(2);
- long half = n >>> 1;
- long nextn = ((bits & 2) == 0) ? half : n - half;
- if ((bits & 1) == 0)
- offset += n - nextn;
- n = nextn;
- }
- return offset + nextInt((int) n);
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed value between the
- * given least value (inclusive) and bound (exclusive).
- *
- * @param least the least value returned
- * @param bound the upper bound (exclusive)
- * @return the next value
- * @throws IllegalArgumentException if least greater than or equal
- * to bound
- */
- public long nextLong(long least, long bound) {
- if (least >= bound)
- throw new IllegalArgumentException();
- return nextLong(bound - least) + least;
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed {@code double} value
- * between 0 (inclusive) and the specified value (exclusive).
- *
- * @param n the bound on the random number to be returned. Must be
- * positive.
- * @return the next value
- * @throws IllegalArgumentException if n is not positive
- */
- public double nextDouble(double n) {
- if (n <= 0)
- throw new IllegalArgumentException("n must be positive");
- return nextDouble() * n;
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed value between the
- * given least value (inclusive) and bound (exclusive).
- *
- * @param least the least value returned
- * @param bound the upper bound (exclusive)
- * @return the next value
- * @throws IllegalArgumentException if least greater than or equal
- * to bound
- */
- public double nextDouble(double least, double bound) {
- if (least >= bound)
- throw new IllegalArgumentException();
- return nextDouble() * (bound - least) + least;
- }
-
- private static final long serialVersionUID = -5851777807851030925L;
-}
-
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/TransferQueue.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/TransferQueue.java
index ce9e3e9..265a0dc 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/TransferQueue.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/TransferQueue.java
@@ -52,6 +52,7 @@
* @param <E> the type of elements held in this collection
* @author Doug Lea
*/
+@Deprecated
public interface TransferQueue<E> extends BlockingQueue<E> {
/**
* Transfers the specified element if there exists a consumer
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/UnsafeValue.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/UnsafeValue.java
index dc22957..c659f62 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/UnsafeValue.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/UnsafeValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
*
* @param <T> value type.
* @param <E> exception type.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface UnsafeValue<T, E extends Throwable> {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Value.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Value.java
index 5366812..ee23800 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Value.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Value.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +20,7 @@
* A generic value provider.
*
* @param <T> value type.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Value<T> {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Values.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Values.java
index 1c51225..4761644 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Values.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Values.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* A collection of {@link Value Value provider} factory & utility methods.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class Values {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Views.java b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Views.java
index 19fd728..32e2640 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Views.java
+++ b/core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Views.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* Collections utils, which provide transforming views for {@link List} and {@link Map}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class Views {
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 17633d7..1cd5cdb 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,9 +42,9 @@
* is set to the minimum value, which means that filter is called as the last filter when request is sent and similarly as the
* first filter when the response is received, so request and response is logged as sent or as received.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
*/
@ConstrainedTo(RuntimeType.CLIENT)
@PreMatching
diff --git a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java
index 9b0775a..e4e2b01 100644
--- a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java
+++ b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -65,7 +65,7 @@
* <li>{@link #LOGGING_FEATURE_MAX_ENTITY_SIZE_CLIENT}</li>
* </ul>
*
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
* @since 2.23
*/
public class LoggingFeature implements Feature {
diff --git a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeatureAutoDiscoverable.java b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeatureAutoDiscoverable.java
index f51a891..205ed08 100644
--- a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeatureAutoDiscoverable.java
+++ b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeatureAutoDiscoverable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -47,7 +47,7 @@
* <p>
* The registration does not occur if the feature is already registered or auto-discoverable mechanism is disabled.
*
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
* @since 2.23
*/
@Priority(AutoDiscoverable.DEFAULT_PRIORITY)
diff --git a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java
index 85e0e08..5863c7b 100644
--- a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java
+++ b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -47,7 +47,7 @@
* An interceptor that logs an entity if configured so and provides a common logic for {@link ClientLoggingFilter}
* and {@link ServerLoggingFilter}.
*
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
*/
abstract class LoggingInterceptor implements WriterInterceptor {
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 441db64..8405edf 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,9 +42,9 @@
* is set to the maximum value, which means that filter is called as the first filter when request arrives and similarly as the
* last filter when the response is dispatched, so request and response is logged as arrives or as dispatched.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
*/
@ConstrainedTo(RuntimeType.SERVER)
@PreMatching
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/AbstractEntityProviderModel.java b/core-common/src/main/java/org/glassfish/jersey/message/AbstractEntityProviderModel.java
index bebc40f..a9d9075 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/AbstractEntityProviderModel.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/AbstractEntityProviderModel.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
/**
* Abstract entity provider model.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.16
*/
public abstract class AbstractEntityProviderModel<T> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/MessageProperties.java b/core-common/src/main/java/org/glassfish/jersey/message/MessageProperties.java
index 27fccbc..6319abb 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/MessageProperties.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/MessageProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Jersey configuration properties for message & entity processing.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@PropertiesClass
public final class MessageProperties {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/MessageUtils.java b/core-common/src/main/java/org/glassfish/jersey/message/MessageUtils.java
index d657467..59b9cdc 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/MessageUtils.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/MessageUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
/**
* Utility class with message related methods.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public final class MessageUtils {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/ReaderModel.java b/core-common/src/main/java/org/glassfish/jersey/message/ReaderModel.java
index 82359f5..b2bf602 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/ReaderModel.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/ReaderModel.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* {@link javax.ws.rs.ext.MessageBodyReader} model.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.16
*/
public final class ReaderModel extends AbstractEntityProviderModel<MessageBodyReader> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/WriterModel.java b/core-common/src/main/java/org/glassfish/jersey/message/WriterModel.java
index fb39b41..c7b4527 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/WriterModel.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/WriterModel.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* {@link javax.ws.rs.ext.MessageBodyWriter} model.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.16
*/
public final class WriterModel extends AbstractEntityProviderModel<MessageBodyWriter> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/AbstractFormProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/AbstractFormProvider.java
index d1e6850..1df6471 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/AbstractFormProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/AbstractFormProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,7 +36,7 @@
* @param <T> form type.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractFormProvider<T> extends AbstractMessageReaderWriterProvider<T> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/AbstractMessageReaderWriterProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/AbstractMessageReaderWriterProvider.java
index 0c877a5..2b3be17 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/AbstractMessageReaderWriterProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/AbstractMessageReaderWriterProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
*
* @param <T> Java type supported by the provider
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractMessageReaderWriterProvider<T> implements MessageBodyReader<T>, MessageBodyWriter<T> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableLanguageTag.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableLanguageTag.java
index 2cab1ee..9c5f7d3 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableLanguageTag.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableLanguageTag.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
* An acceptable language tag.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AcceptableLanguageTag extends LanguageTag implements Qualified {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableMediaType.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableMediaType.java
index eff94e0..fe39724 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableMediaType.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableMediaType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,7 +26,7 @@
* An acceptable media type.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AcceptableMediaType extends MediaType implements Qualified {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableToken.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableToken.java
index 7cf59c8..1883d57 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableToken.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/AcceptableToken.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
* An acceptable token.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AcceptableToken extends Token implements Qualified {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/BasicTypesMessageProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/BasicTypesMessageProvider.java
index bfc9352..b69a170 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/BasicTypesMessageProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/BasicTypesMessageProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -46,7 +46,7 @@
* argument constructor.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Produces({"text/plain"})
@Consumes({"text/plain"})
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/ByteArrayProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/ByteArrayProvider.java
index 4e6063f..4871013 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/ByteArrayProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/ByteArrayProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
* Default Jersey byte array entity provider (reader and writer).
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Produces({"application/octet-stream", "*/*"})
@Consumes({"application/octet-stream", "*/*"})
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/CacheControlProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/CacheControlProvider.java
index b63b01f..8cf122c 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/CacheControlProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/CacheControlProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
* {@code Cache-Control} {@link HeaderDelegateProvider header delegate provider}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author hubick@java.net
*/
@Singleton
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/CommittingOutputStream.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/CommittingOutputStream.java
index 203a5ed..39f74fb 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/CommittingOutputStream.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/CommittingOutputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -52,7 +52,7 @@
* </p>
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav Fuksa
*/
public final class CommittingOutputStream extends OutputStream {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/CookieProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/CookieProvider.java
index 6c63dbb..fbe9275 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/CookieProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/CookieProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
* Request {@code Cookie} {@link HeaderDelegateProvider header delegate provider}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public class CookieProvider implements HeaderDelegateProvider<Cookie> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/CookiesParser.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/CookiesParser.java
index 8460cee..74ce034 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/CookiesParser.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/CookiesParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
* Cookies parser.
*
* @author Marc Hadley
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CookiesParser {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/DataSourceProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/DataSourceProvider.java
index e2a2503..10c0932 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/DataSourceProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/DataSourceProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,7 +36,7 @@
* entity type to/from a {@link DataSource} instance.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Produces({"application/octet-stream", "*/*"})
@Consumes({"application/octet-stream", "*/*"})
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/DateProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/DateProvider.java
index 5c27798..b0e1495 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/DateProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/DateProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -30,7 +30,7 @@
* {@code Date} {@link HeaderDelegateProvider header delegate provider}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public class DateProvider implements HeaderDelegateProvider<Date> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/EntityInputStream.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/EntityInputStream.java
index 3e481e7..06678b1 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/EntityInputStream.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/EntityInputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
* <li>{@link #close()} method throws Jersey-specific runtime exception in case of an IO error.</li>
* </ul>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class EntityInputStream extends InputStream {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/EntityTagProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/EntityTagProvider.java
index 56e9dc1..cdffee5 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/EntityTagProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/EntityTagProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
* {@code ETag} {@link HeaderDelegateProvider header delegate provider}.
*
* @author Marc Hadley
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public class EntityTagProvider implements HeaderDelegateProvider<EntityTag> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/FileProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/FileProvider.java
index 6ed3508..fb5a6d4 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/FileProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/FileProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -39,7 +39,7 @@
* entity type to/from a {@link File} instance.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Produces({"application/octet-stream", "*/*"})
@Consumes({"application/octet-stream", "*/*"})
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/FormMultivaluedMapProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/FormMultivaluedMapProvider.java
index 2dce040..8d1ce18 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/FormMultivaluedMapProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/FormMultivaluedMapProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,7 +37,7 @@
* entity type to/from {@link MultivaluedMap multi-valued map} instance.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Produces("application/x-www-form-urlencoded")
@Consumes("application/x-www-form-urlencoded")
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/FormProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/FormProvider.java
index b9b78aa..ccf81de 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/FormProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/FormProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* entity type to/from {@link Form JAX-RS Form} instance.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Produces({"application/x-www-form-urlencoded", "*/*"})
@Consumes({"application/x-www-form-urlencoded", "*/*"})
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/HeaderUtils.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/HeaderUtils.java
index f4182e9..1bf5440 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/HeaderUtils.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/HeaderUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -39,9 +39,9 @@
/**
* Utility class supporting the processing of message headers.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Michal Gajdos
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public final class HeaderUtils {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/HeaderValueException.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/HeaderValueException.java
index c6e4a20..bc1cb67 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/HeaderValueException.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/HeaderValueException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
* {@link ProcessingException Processing exception} indicating that an attempt to
* read a value of a header failed.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class HeaderValueException extends ProcessingException {
private static final long serialVersionUID = 981810773601231157L;
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpDateFormat.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpDateFormat.java
index d99116c..75479e6 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpDateFormat.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpDateFormat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
* Helper class for HTTP specified date formats.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class HttpDateFormat {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpHeaderListAdapter.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpHeaderListAdapter.java
index 61c6305..b574f95 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpHeaderListAdapter.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpHeaderListAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
* headers containing comma-separated value lists.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
/* package */ class HttpHeaderListAdapter extends HttpHeaderReader {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpHeaderReader.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpHeaderReader.java
index c1ac16f..25f6962 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpHeaderReader.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/HttpHeaderReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
* An abstract pull-based reader of HTTP headers.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class HttpHeaderReader {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/InboundMessageContext.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/InboundMessageContext.java
index 5005310..026fd69 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/InboundMessageContext.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/InboundMessageContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -59,7 +59,7 @@
/**
* Base inbound message context implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class InboundMessageContext {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/JerseyLink.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/JerseyLink.java
index 6acacdc..a27d248 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/JerseyLink.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/JerseyLink.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -32,7 +32,7 @@
/**
* Jersey implementation of {@link javax.ws.rs.core.Link JAX-RS Link} contract.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class JerseyLink extends javax.ws.rs.core.Link {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/LanguageTag.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/LanguageTag.java
index a1e4d7d..c34756b 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/LanguageTag.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/LanguageTag.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
* A language tag.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class LanguageTag {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/LinkProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/LinkProvider.java
index 5645348..91c6f54 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/LinkProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/LinkProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,7 +37,7 @@
* Provider for Link Headers.
*
* @author Santiago Pericas-Geertsen
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public class LinkProvider implements HeaderDelegateProvider<Link> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/LocaleProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/LocaleProvider.java
index 82e1d1b..7aedca7 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/LocaleProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/LocaleProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -30,7 +30,7 @@
* {@code Locale} {@link HeaderDelegateProvider header delegate provider}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public class LocaleProvider implements HeaderDelegateProvider<Locale> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MatchingEntityTag.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MatchingEntityTag.java
index 30eb094..1219ea1 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MatchingEntityTag.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MatchingEntityTag.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -33,7 +33,7 @@
* {@code *} is not a valid entity tag.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class MatchingEntityTag extends EntityTag {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MediaTypeProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MediaTypeProvider.java
index b7623e2..bfd51b4 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MediaTypeProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MediaTypeProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -31,7 +31,7 @@
* Header delegate provider for MediaType.
*
* @author Marc Hadley
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
*/
@Singleton
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MediaTypes.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MediaTypes.java
index d58c2de..1cfeb01 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MediaTypes.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MediaTypes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* Common media types and functionality.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class MediaTypes {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java
index 5b78763..73551ca 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessageBodyFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,6 +36,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -81,8 +82,8 @@
* A factory for managing {@link MessageBodyReader}, {@link MessageBodyWriter} instances.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Marek Potociar
+ * @author Jakub Podlesak
*/
public class MessageBodyFactory implements MessageBodyWorkers {
@@ -180,19 +181,19 @@
private static final int LOOKUP_CACHE_INITIAL_CAPACITY = 32;
private static final float LOOKUP_CACHE_LOAD_FACTOR = 0.75f;
- private final Map<Class<?>, List<ReaderModel>> mbrTypeLookupCache = DataStructures.createConcurrentMap(
+ private final Map<Class<?>, List<ReaderModel>> mbrTypeLookupCache = new ConcurrentHashMap<>(
LOOKUP_CACHE_INITIAL_CAPACITY, LOOKUP_CACHE_LOAD_FACTOR, DataStructures.DEFAULT_CONCURENCY_LEVEL);
- private final Map<Class<?>, List<WriterModel>> mbwTypeLookupCache = DataStructures.createConcurrentMap(
+ private final Map<Class<?>, List<WriterModel>> mbwTypeLookupCache = new ConcurrentHashMap<>(
LOOKUP_CACHE_INITIAL_CAPACITY, LOOKUP_CACHE_LOAD_FACTOR, DataStructures.DEFAULT_CONCURENCY_LEVEL);
- private final Map<Class<?>, List<MediaType>> typeToMediaTypeReadersCache = DataStructures.createConcurrentMap(
+ private final Map<Class<?>, List<MediaType>> typeToMediaTypeReadersCache = new ConcurrentHashMap<>(
LOOKUP_CACHE_INITIAL_CAPACITY, LOOKUP_CACHE_LOAD_FACTOR, DataStructures.DEFAULT_CONCURENCY_LEVEL);
- private final Map<Class<?>, List<MediaType>> typeToMediaTypeWritersCache = DataStructures.createConcurrentMap(
+ private final Map<Class<?>, List<MediaType>> typeToMediaTypeWritersCache = new ConcurrentHashMap<>(
LOOKUP_CACHE_INITIAL_CAPACITY, LOOKUP_CACHE_LOAD_FACTOR, DataStructures.DEFAULT_CONCURENCY_LEVEL);
- private final Map<ModelLookupKey, List<ReaderModel>> mbrLookupCache = DataStructures.createConcurrentMap(
+ private final Map<ModelLookupKey, List<ReaderModel>> mbrLookupCache = new ConcurrentHashMap<>(
LOOKUP_CACHE_INITIAL_CAPACITY, LOOKUP_CACHE_LOAD_FACTOR, DataStructures.DEFAULT_CONCURENCY_LEVEL);
- private final Map<ModelLookupKey, List<WriterModel>> mbwLookupCache = DataStructures.createConcurrentMap(
+ private final Map<ModelLookupKey, List<WriterModel>> mbwLookupCache = new ConcurrentHashMap<>(
LOOKUP_CACHE_INITIAL_CAPACITY, LOOKUP_CACHE_LOAD_FACTOR, DataStructures.DEFAULT_CONCURENCY_LEVEL);
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessagingBinders.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessagingBinders.java
index e7a15e1..95b000d 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MessagingBinders.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MessagingBinders.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,8 +34,8 @@
* Binding definitions for the default set of message related providers (readers,
* writers, header delegates).
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Marek Potociar
+ * @author Libor Kramolis
*/
public final class MessagingBinders {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/MsgTraceEvent.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/MsgTraceEvent.java
index ca94700..b175a19 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/MsgTraceEvent.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/MsgTraceEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Common tracing events.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.3
*/
public enum MsgTraceEvent implements TracingLogger.Event {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/NewCookieProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/NewCookieProvider.java
index 01a62ec..fcfa203 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/NewCookieProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/NewCookieProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
* Response {@code Set-Cookie} {@link HeaderDelegateProvider header delegate provider}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public class NewCookieProvider implements HeaderDelegateProvider<NewCookie> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/NullOutputStream.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/NullOutputStream.java
index e8f9c53..26d3f14 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/NullOutputStream.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/NullOutputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
* to write the data to the closed stream result in an {@link java.io.IOException} being thrown.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class NullOutputStream extends OutputStream {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundJaxrsResponse.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundJaxrsResponse.java
index 8f8699d..27843db 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundJaxrsResponse.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundJaxrsResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -49,7 +49,7 @@
* The implementation delegates method calls to an {@link #getContext() underlying
* outbound message context}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class OutboundJaxrsResponse extends javax.ws.rs.core.Response {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundMessageContext.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundMessageContext.java
index 0b76182..ef37b6c 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundMessageContext.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundMessageContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -56,7 +56,7 @@
/**
* Base outbound message context implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class OutboundMessageContext {
private static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/ParameterizedHeader.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/ParameterizedHeader.java
index 2dd0154..7b71c95 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/ParameterizedHeader.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/ParameterizedHeader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
* parameter is separated with a ';'.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ParameterizedHeader {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/Qualified.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/Qualified.java
index 21b7a5b..fd14322 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/Qualified.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/Qualified.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +20,7 @@
* Quality factor for acceptable header types represented as a "parts per thousand" (i.e. per mille) value.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Qualified {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/Quality.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/Quality.java
index 9ebed32..f0ef76e 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/Quality.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/Quality.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
/**
* Quality parameter constants.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class Quality {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/QualitySourceMediaType.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/QualitySourceMediaType.java
index b58a83d..261a248 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/QualitySourceMediaType.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/QualitySourceMediaType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,7 +26,7 @@
* A quality source media type.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class QualitySourceMediaType extends MediaType implements Qualified {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/ReaderInterceptorExecutor.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/ReaderInterceptorExecutor.java
index 9b2a25f..5263fff 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/ReaderInterceptorExecutor.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/ReaderInterceptorExecutor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -51,7 +51,7 @@
* which finally reads an entity from the output stream provided by the chain.
*
* @author Miroslav Fuksa
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class ReaderInterceptorExecutor extends InterceptorExecutor<ReaderInterceptor>
implements ReaderInterceptorContext, InjectionManagerSupplier {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/RenderedImageProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/RenderedImageProvider.java
index bce792f..7a53ea2 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/RenderedImageProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/RenderedImageProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -43,7 +43,7 @@
* {@link BufferedImage buffered} image instance.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Produces("image/*")
@Consumes({"image/*", "application/octet-stream"})
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/SourceProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/SourceProvider.java
index 70e530f..acd27d8 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/SourceProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/SourceProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -54,7 +54,7 @@
* Collection of {@link Source XML source} providers.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public final class SourceProvider {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/StringBuilderUtils.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/StringBuilderUtils.java
index 70d6a61..459231a 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/StringBuilderUtils.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/StringBuilderUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -21,7 +21,7 @@
* values.
*
* @author Marc Hadley
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
*/
public class StringBuilderUtils {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/StringHeaderProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/StringHeaderProvider.java
index 1375693..49dc845 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/StringHeaderProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/StringHeaderProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -28,7 +28,7 @@
* {@code String} {@link HeaderDelegateProvider header delegate provider}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public class StringHeaderProvider implements HeaderDelegateProvider<String> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/Token.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/Token.java
index 81e210f..8e4abe1 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/Token.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/Token.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
* A token.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class Token {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingAwarePropertiesDelegate.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingAwarePropertiesDelegate.java
index 197f488..ee5d7d8 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingAwarePropertiesDelegate.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingAwarePropertiesDelegate.java
@@ -24,7 +24,7 @@
* Delegating properties delegate backed by another {@code PropertiesDelegate} with implemented "cache" or direct reference to
* tracing support related classes (e.g. {@code TracingLogger}) to improve performance of lookup tracing context instance.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.3
*/
public final class TracingAwarePropertiesDelegate implements PropertiesDelegate {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingInfo.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingInfo.java
index 776c30a..329eb3a 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingInfo.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
/**
* Collects tracing messages for a request.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.3
*/
final class TracingInfo {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingLogger.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingLogger.java
index 1c844c2..fd5b8d8 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingLogger.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/TracingLogger.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -32,7 +32,7 @@
*
* Use one instance per request.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.3
*/
public abstract class TracingLogger {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/UriProvider.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/UriProvider.java
index 041b69d..2feac33 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/UriProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/UriProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -30,7 +30,7 @@
* {@code URI} {@link HeaderDelegateProvider header delegate provider}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public class UriProvider implements HeaderDelegateProvider<URI> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java
index 6efa892..c4f035e 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
/**
* Utility class.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class Utils {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/VariantListBuilder.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/VariantListBuilder.java
index f2b7776..b0e81e1 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/VariantListBuilder.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/VariantListBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -28,7 +28,7 @@
* An implementation of {@link VariantListBuilder}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class VariantListBuilder extends Variant.VariantListBuilder {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/VariantSelector.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/VariantSelector.java
index 93efd46..292c3ea 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/VariantSelector.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/VariantSelector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -35,7 +35,7 @@
* Utility for selecting variant that best matches request from a list of variants.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class VariantSelector {
diff --git a/core-common/src/main/java/org/glassfish/jersey/message/internal/WriterInterceptorExecutor.java b/core-common/src/main/java/org/glassfish/jersey/message/internal/WriterInterceptorExecutor.java
index 9de9564..29236d0 100644
--- a/core-common/src/main/java/org/glassfish/jersey/message/internal/WriterInterceptorExecutor.java
+++ b/core-common/src/main/java/org/glassfish/jersey/message/internal/WriterInterceptorExecutor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -49,7 +49,7 @@
* which writes entity to the output stream provided by the chain.
*
* @author Miroslav Fuksa
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class WriterInterceptorExecutor extends InterceptorExecutor<WriterInterceptor>
implements WriterInterceptorContext, InjectionManagerSupplier {
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java b/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java
new file mode 100644
index 0000000..f612fc5
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/model/AnnotatedMethod.java
@@ -0,0 +1,350 @@
+/*
+ * Copyright (c) 2010, 2019 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.model;
+
+import org.glassfish.jersey.internal.util.ReflectionHelper;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.CookieParam;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.Encoded;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.security.AccessController;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Annotated method representation.
+ *
+ * @author Paul Sandoz
+ */
+public class AnnotatedMethod implements AnnotatedElement {
+
+ @SuppressWarnings("unchecked")
+ private static final Set<Class<? extends Annotation>> METHOD_META_ANNOTATIONS = getSet(
+ HttpMethod.class);
+ @SuppressWarnings("unchecked")
+ private static final Set<Class<? extends Annotation>> METHOD_ANNOTATIONS = getSet(
+ Path.class,
+ Produces.class,
+ Consumes.class);
+ @SuppressWarnings("unchecked")
+ private static final Set<Class<? extends Annotation>> PARAMETER_ANNOTATIONS = getSet(
+ Context.class,
+ Encoded.class,
+ DefaultValue.class,
+ MatrixParam.class,
+ QueryParam.class,
+ CookieParam.class,
+ HeaderParam.class,
+ PathParam.class,
+ FormParam.class);
+
+ @SafeVarargs
+ private static Set<Class<? extends Annotation>> getSet(final Class<? extends Annotation>... cs) {
+ final Set<Class<? extends Annotation>> s = new HashSet<>();
+ s.addAll(Arrays.asList(cs));
+ return s;
+ }
+
+ private final Method m;
+ private final Method am;
+ private final Annotation[] methodAnnotations;
+ private final Annotation[][] parameterAnnotations;
+
+ /**
+ * Create annotated method instance from the {@link Method Java method}.
+ *
+ * @param method Java method.
+ */
+ public AnnotatedMethod(final Method method) {
+ this.m = method;
+ this.am = findAnnotatedMethod(method);
+
+ if (method.equals(am)) {
+ methodAnnotations = method.getAnnotations();
+ parameterAnnotations = method.getParameterAnnotations();
+ } else {
+ methodAnnotations = mergeMethodAnnotations(method, am);
+ parameterAnnotations = mergeParameterAnnotations(method, am);
+ }
+ }
+
+ /**
+ * Get the underlying Java method.
+ *
+ * @return the underlying Java method.
+ */
+ public Method getMethod() {
+ return am;
+ }
+
+ /**
+ * Get the underlying declared Java method. This method overrides or is the same as the one retrieved by {@code getMethod}.
+ *
+ * @return the underlying declared Java method.
+ */
+ public Method getDeclaredMethod() {
+ return m;
+ }
+
+ /**
+ * Get method parameter annotations.
+ *
+ * @return method parameter annotations.
+ */
+ public Annotation[][] getParameterAnnotations() {
+ return parameterAnnotations.clone();
+ }
+
+ /**
+ * Get method parameter types.
+ *
+ * See also {@link Method#getParameterTypes()}.
+ *
+ * @return method parameter types.
+ */
+ public Class<?>[] getParameterTypes() {
+ return am.getParameterTypes();
+ }
+
+ /**
+ * Get method type parameters.
+ *
+ * See also {@link Method#getTypeParameters()}.
+ *
+ * @return method type parameters.
+ */
+ @SuppressWarnings("UnusedDeclaration")
+ public TypeVariable<Method>[] getTypeParameters() {
+ return am.getTypeParameters();
+ }
+
+ /**
+ * Get generic method parameter types.
+ *
+ * See also {@link Method#getGenericParameterTypes()}.
+ *
+ * @return generic method parameter types.
+ */
+ public Type[] getGenericParameterTypes() {
+ return am.getGenericParameterTypes();
+ }
+
+ /**
+ * Get all instances of the specified meta-annotation type found on the method
+ * annotations.
+ *
+ * @param <T> meta-annotation type.
+ * @param annotation meta-annotation class to be searched for.
+ * @return meta-annotation instances of a given type annotating the method
+ * annotations.
+ */
+ public <T extends Annotation> List<T> getMetaMethodAnnotations(
+ final Class<T> annotation) {
+ final List<T> ma = new ArrayList<>();
+ for (final Annotation a : methodAnnotations) {
+ final T metaAnnotation = a.annotationType().getAnnotation(annotation);
+ if (metaAnnotation != null) {
+ ma.add(metaAnnotation);
+ }
+ }
+
+ return ma;
+ }
+
+ @Override
+ public String toString() {
+ return m.toString();
+ }
+
+ // AnnotatedElement
+ @Override
+ public boolean isAnnotationPresent(final Class<? extends Annotation> annotationType) {
+ for (final Annotation ma : methodAnnotations) {
+ if (ma.annotationType() == annotationType) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public <T extends Annotation> T getAnnotation(final Class<T> annotationType) {
+ for (final Annotation ma : methodAnnotations) {
+ if (ma.annotationType() == annotationType) {
+ return annotationType.cast(ma);
+ }
+ }
+ return am.getAnnotation(annotationType);
+ }
+
+ @Override
+ public Annotation[] getAnnotations() {
+ return methodAnnotations.clone();
+ }
+
+ @Override
+ public Annotation[] getDeclaredAnnotations() {
+ return getAnnotations();
+ }
+
+ private static Annotation[] mergeMethodAnnotations(final Method m, final Method am) {
+ final List<Annotation> al = asList(m.getAnnotations());
+ for (final Annotation a : am.getAnnotations()) {
+ if (!m.isAnnotationPresent(a.getClass())) {
+ al.add(a);
+ }
+ }
+
+ return al.toArray(new Annotation[al.size()]);
+ }
+
+ private static Annotation[][] mergeParameterAnnotations(final Method m, final Method am) {
+ final Annotation[][] methodParamAnnotations = m.getParameterAnnotations();
+ final Annotation[][] annotatedMethodParamAnnotations = am.getParameterAnnotations();
+
+ final List<List<Annotation>> methodParamAnnotationsList = new ArrayList<>();
+ for (int i = 0; i < methodParamAnnotations.length; i++) {
+ final List<Annotation> al = asList(methodParamAnnotations[i]);
+ for (final Annotation a : annotatedMethodParamAnnotations[i]) {
+ if (annotationNotInList(a.getClass(), al)) {
+ al.add(a);
+ }
+ }
+ methodParamAnnotationsList.add(al);
+ }
+
+ final Annotation[][] mergedAnnotations = new Annotation[methodParamAnnotations.length][];
+ for (int i = 0; i < methodParamAnnotations.length; i++) {
+ final List<Annotation> paramAnnotations = methodParamAnnotationsList.get(i);
+ mergedAnnotations[i] = paramAnnotations.toArray(new Annotation[paramAnnotations.size()]);
+ }
+
+ return mergedAnnotations;
+ }
+
+ private static boolean annotationNotInList(final Class<? extends Annotation> ca, final List<Annotation> la) {
+ for (final Annotation a : la) {
+ if (ca == a.getClass()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static Method findAnnotatedMethod(final Method m) {
+ final Method am = findAnnotatedMethod(m.getDeclaringClass(), m);
+ return (am != null) ? am : m;
+ }
+
+ private static Method findAnnotatedMethod(final Class<?> c, Method m) {
+ if (c == Object.class) {
+ return null;
+ }
+
+ m = AccessController.doPrivileged(ReflectionHelper.findMethodOnClassPA(c, m));
+ if (m == null) {
+ return null;
+ }
+
+ if (hasAnnotations(m)) {
+ return m;
+ }
+
+ // Super classes take precedence over interfaces
+ final Class<?> sc = c.getSuperclass();
+ if (sc != null && sc != Object.class) {
+ final Method sm = findAnnotatedMethod(sc, m);
+ if (sm != null) {
+ return sm;
+ }
+ }
+
+ for (final Class<?> ic : c.getInterfaces()) {
+ final Method im = findAnnotatedMethod(ic, m);
+ if (im != null) {
+ return im;
+ }
+ }
+
+ return null;
+ }
+
+ private static boolean hasAnnotations(final Method m) {
+ return hasMetaMethodAnnotations(m)
+ || hasMethodAnnotations(m)
+ || hasParameterAnnotations(m);
+ }
+
+ private static boolean hasMetaMethodAnnotations(final Method m) {
+ for (final Class<? extends Annotation> ac : METHOD_META_ANNOTATIONS) {
+ for (final Annotation a : m.getAnnotations()) {
+ if (a.annotationType().getAnnotation(ac) != null) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private static boolean hasMethodAnnotations(final Method m) {
+ for (final Class<? extends Annotation> ac : METHOD_ANNOTATIONS) {
+ if (m.isAnnotationPresent(ac)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static boolean hasParameterAnnotations(final Method m) {
+ for (final Annotation[] as : m.getParameterAnnotations()) {
+ for (final Annotation a : as) {
+ if (PARAMETER_ANNOTATIONS.contains(a.annotationType())) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ @SafeVarargs
+ private static <T> List<T> asList(final T... ts) {
+ final List<T> l = new ArrayList<>();
+ l.addAll(Arrays.asList(ts));
+ return l;
+ }
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/ContractProvider.java b/core-common/src/main/java/org/glassfish/jersey/model/ContractProvider.java
index 45479ee..d690f1f 100644
--- a/core-common/src/main/java/org/glassfish/jersey/model/ContractProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/model/ContractProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
/**
* Jersey contract provider model.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class ContractProvider implements Scoped, NameBound {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java b/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java
new file mode 100644
index 0000000..126621a
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java
@@ -0,0 +1,775 @@
+/*
+ * Copyright (c) 2010, 2019 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.model;
+
+import org.glassfish.jersey.internal.LocalizationMessages;
+import org.glassfish.jersey.internal.ServiceFinder;
+import org.glassfish.jersey.internal.guava.Lists;
+import org.glassfish.jersey.internal.util.ReflectionHelper;
+import org.glassfish.jersey.internal.util.collection.ClassTypePair;
+import org.glassfish.jersey.model.internal.spi.ParameterServiceProvider;
+
+import javax.ws.rs.BeanParam;
+import javax.ws.rs.CookieParam;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.Encoded;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.container.Suspended;
+import javax.ws.rs.core.Context;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class Parameter implements AnnotatedElement {
+ private static final Logger LOGGER = Logger.getLogger(Parameter.class.getName());
+
+ /**
+ * Parameter injection sources type.
+ */
+ public enum Source {
+
+ /**
+ * Context parameter injection source.
+ */
+ CONTEXT,
+ /**
+ * Cookie parameter injection source.
+ */
+ COOKIE,
+ /**
+ * Entity parameter injection source.
+ */
+ ENTITY,
+ /**
+ * Form parameter injection source.
+ */
+ FORM,
+ /**
+ * Header parameter injection source.
+ */
+ HEADER,
+ /**
+ * Uri parameter injection source.
+ */
+ URI,
+ /**
+ * Matrix parameter injection source.
+ */
+ MATRIX,
+ /**
+ * Path parameter injection source.
+ */
+ PATH,
+ /**
+ * Query parameter injection source.
+ */
+ QUERY,
+ /**
+ * Suspended async response injection source.
+ */
+ SUSPENDED,
+ /**
+ * Bean param parameter injection source.
+ */
+ BEAN_PARAM,
+ /**
+ * Unknown parameter injection source.
+ */
+ UNKNOWN
+ }
+
+ static {
+ List<ParameterServiceProvider> PARAMETER_SERVICE_PROVIDERS = Lists
+ .newArrayList(ServiceFinder.find(ParameterServiceProvider.class));
+ PARAMETER_SERVICE_PROVIDERS.add(new ParameterService());
+ PARAM_CREATION_FACTORIES = Collections.unmodifiableList(
+ PARAMETER_SERVICE_PROVIDERS.stream().map(a -> a.getParameterCreationFactory())
+ .collect(Collectors.toList())
+ );
+ ANNOTATION_HELPER_MAP = Collections.unmodifiableMap(
+ PARAMETER_SERVICE_PROVIDERS.stream()
+ .map(a -> a.getParameterAnnotationHelperMap())
+ .collect(WeakHashMap::new, Map::putAll, Map::putAll)
+ );
+ };
+ private static final List<ParamCreationFactory> PARAM_CREATION_FACTORIES;
+ private static final Map<Class, ParamAnnotationHelper> ANNOTATION_HELPER_MAP;
+
+ public interface ParamAnnotationHelper<T extends Annotation> {
+
+ public String getValueOf(T a);
+
+ public Parameter.Source getSource();
+ }
+
+ /**
+ * A factory service to found in a runtime to be used to instantiate the given {@link Parameter} class.
+ * @param <PARAMETER> the {@code Parameter} to be instatiated
+ */
+ public interface ParamCreationFactory<PARAMETER extends Parameter> {
+ /**
+ * Determine whether the Factory is for the given class to be instantiated.
+ * @param clazz The class of determining the source of origin (core, server). Each source of origin
+ * has its own {@code ParamCreationFactory}
+ * @return {@code true} if the source of origin corresponds to the {@code ParamCreationFactory},
+ * {@code false} otherwise.
+ */
+ boolean isFor(Class<?> clazz);
+
+ /**
+ * Factory method to instantiate {@link Parameter} of given properties
+ * @return instantiated {@code Parameter}
+ */
+ PARAMETER createParameter(Annotation[] markers, Annotation marker, Source source, String sourceName, Class<?> rawType,
+ Type type, boolean encoded, String defaultValue);
+
+ /**
+ * Factory method to instantiate {@code BeanParameter} of given properties
+ * @return instantiated {@code BeanParameter}
+ */
+ PARAMETER createBeanParameter(Annotation[] markers, Annotation marker, Source source, String sourceName, Class<?> rawType,
+ Type type, boolean encoded, String defaultValue);
+ }
+
+ // Instance
+ private final Annotation[] annotations;
+ private final Annotation sourceAnnotation;
+ private final Parameter.Source source;
+ private final String sourceName;
+ private final boolean encoded;
+ private final String defaultValue;
+ private final Class<?> rawType;
+ private final Type type;
+
+ protected Parameter(
+ Annotation[] markers,
+ Annotation marker,
+ Source source,
+ String sourceName,
+ Class<?> rawType,
+ Type type,
+ boolean encoded,
+ String defaultValue) {
+ this.annotations = markers;
+ this.sourceAnnotation = marker;
+ this.source = source;
+ this.sourceName = sourceName;
+ this.rawType = rawType;
+ this.type = type;
+ this.encoded = encoded;
+ this.defaultValue = defaultValue;
+ }
+ /**
+ * Create a parameter model.
+ *
+ * @param concreteClass concrete resource method handler implementation class.
+ * @param declaringClass declaring class of the method the parameter belongs to or field that this parameter represents.
+ * @param encodeByDefault flag indicating whether the parameter should be encoded by default or not. Note that a presence
+ * of {@link Encoded} annotation in the list of the parameter {@code annotations} will override any
+ * value set in the flag to {@code true}.
+ * @param rawType raw Java parameter type.
+ * @param type generic Java parameter type.
+ * @param annotations parameter annotations.
+ * @return new parameter model.
+ */
+ @SuppressWarnings("unchecked")
+ public static <PARAMETER extends Parameter> PARAMETER create(
+ Class concreteClass,
+ Class declaringClass,
+ boolean encodeByDefault,
+ Class<?> rawType,
+ Type type,
+ Annotation[] annotations) {
+ return (PARAMETER) create(concreteClass, declaringClass, encodeByDefault, rawType, type, annotations, Parameter.class);
+ }
+
+ /**
+ * Create a parameter model.
+ *
+ * @param concreteClass concrete resource method handler implementation class.
+ * @param declaringClass declaring class of the method the parameter belongs to or field that this parameter represents.
+ * @param encodeByDefault flag indicating whether the parameter should be encoded by default or not. Note that a presence
+ * of {@link Encoded} annotation in the list of the parameter {@code annotations} will override any
+ * value set in the flag to {@code true}.
+ * @param rawType raw Java parameter type.
+ * @param type generic Java parameter type.
+ * @param annotations parameter annotations.
+ * @param parameterClass class of the parameter to be used by {@link ParamCreationFactory}
+ * @return new parameter model.
+ */
+ @SuppressWarnings("unchecked")
+ protected static <PARAMETER extends Parameter> PARAMETER create(
+ Class concreteClass,
+ Class declaringClass,
+ boolean encodeByDefault,
+ Class<?> rawType,
+ Type type,
+ Annotation[] annotations,
+ Class<?> parameterClass) {
+
+ if (null == annotations) {
+ return null;
+ }
+
+ Annotation paramAnnotation = null;
+ Parameter.Source paramSource = null;
+ String paramName = null;
+ boolean paramEncoded = encodeByDefault;
+ String paramDefault = null;
+
+ /**
+ * Create a parameter from the list of annotations. Unknown annotated
+ * parameters are also supported, and in such a cases the last
+ * unrecognized annotation is taken to be that associated with the
+ * parameter.
+ */
+ for (Annotation annotation : annotations) {
+ if (ANNOTATION_HELPER_MAP.containsKey(annotation.annotationType())) {
+ ParamAnnotationHelper helper = ANNOTATION_HELPER_MAP.get(annotation.annotationType());
+ paramAnnotation = annotation;
+ paramSource = helper.getSource();
+ paramName = helper.getValueOf(annotation);
+ } else if (Encoded.class == annotation.annotationType()) {
+ paramEncoded = true;
+ } else if (DefaultValue.class == annotation.annotationType()) {
+ paramDefault = ((DefaultValue) annotation).value();
+ } else {
+ // Take latest unknown annotation, but don't override known annotation
+ if ((paramAnnotation == null) || (paramSource == Source.UNKNOWN)) {
+ paramAnnotation = annotation;
+ paramSource = Source.UNKNOWN;
+ paramName = getValue(annotation);
+ }
+ }
+ }
+
+ if (paramAnnotation == null) {
+ paramSource = Parameter.Source.ENTITY;
+ }
+
+ ClassTypePair ct = ReflectionHelper.resolveGenericType(
+ concreteClass, declaringClass, rawType, type);
+
+ if (paramSource == Source.BEAN_PARAM) {
+ return createBeanParameter(
+ annotations,
+ paramAnnotation,
+ paramSource,
+ paramName,
+ ct.rawClass(),
+ ct.type(),
+ paramEncoded,
+ paramDefault,
+ parameterClass);
+ } else {
+ return createParameter(
+ annotations,
+ paramAnnotation,
+ paramSource,
+ paramName,
+ ct.rawClass(),
+ ct.type(),
+ paramEncoded,
+ paramDefault,
+ parameterClass);
+ }
+ }
+
+ private static <PARAMETER extends Parameter> PARAMETER createBeanParameter(Annotation[] markers, Annotation marker,
+ Source source, String sourceName,
+ Class<?> rawType, Type type, boolean encoded,
+ String defaultValue,
+ Class<?> parameterClass) {
+ for (ParamCreationFactory<?> factory : PARAM_CREATION_FACTORIES) {
+ if (factory.isFor(parameterClass)) {
+ return (PARAMETER) factory.createBeanParameter(markers, marker, source, sourceName, rawType, type, encoded,
+ defaultValue);
+ }
+ }
+
+ if (LOGGER.isLoggable(Level.FINER)) {
+ LOGGER.log(Level.FINER, LocalizationMessages.PARAM_CREATION_FACTORY_NOT_FOUND(parameterClass.getName()));
+ }
+ throw new IllegalStateException(LocalizationMessages.PARAM_CREATION_FACTORY_NOT_FOUND(parameterClass.getName()));
+ }
+
+ private static <PARAMETER extends Parameter> PARAMETER createParameter(Annotation[] markers, Annotation marker,
+ Source source, String sourceName, Class<?> rawType,
+ Type type, boolean encoded, String defaultValue,
+ Class<?> parameterClass) {
+ for (ParamCreationFactory<?> factory : PARAM_CREATION_FACTORIES) {
+ if (factory.isFor(parameterClass)) {
+ return (PARAMETER) factory.createParameter(markers, marker, source, sourceName, rawType, type, encoded,
+ defaultValue);
+ }
+ }
+
+ if (LOGGER.isLoggable(Level.FINER)) {
+ LOGGER.log(Level.FINER, LocalizationMessages.PARAM_CREATION_FACTORY_NOT_FOUND(parameterClass.getName()));
+ }
+ throw new IllegalStateException(LocalizationMessages.PARAM_CREATION_FACTORY_NOT_FOUND(parameterClass.getName()));
+ }
+
+ /**
+ * Create a list of parameter models for a given Java method handling a resource
+ * method, sub-resource method or a sub-resource locator.
+ *
+ * @param concreteClass concrete resource method handler implementation class.
+ * @param declaringClass the class declaring the handling Java method.
+ * @param javaMethod Java method handling a resource method, sub-resource
+ * method or a sub-resource locator.
+ * @param keepEncoded set to {@code true} to disable automatic decoding
+ * of all the method parameters. (See {@link Encoded}.
+ * @return a list of handling method parameter models.
+ */
+ public static <PARAMETER extends Parameter> List<PARAMETER> create(
+ Class concreteClass,
+ Class declaringClass,
+ Method javaMethod,
+ boolean keepEncoded) {
+ return createList(concreteClass, declaringClass, javaMethod, keepEncoded, Parameter.class);
+ }
+
+ /**
+ * Create a list of parameter models for a given Java method handling a resource
+ * method, sub-resource method or a sub-resource locator.
+ *
+ * @param concreteClass concrete resource method handler implementation class.
+ * @param declaringClass the class declaring the handling Java method.
+ * @param javaMethod Java method handling a resource method, sub-resource
+ * method or a sub-resource locator.
+ * @param keepEncoded set to {@code true} to disable automatic decoding
+ * of all the method parameters. (See {@link Encoded}.
+ * @param parameterClass Class of a Parameter in returned list
+ * @return a list of handling method parameter models.
+ */
+ protected static <PARAMETER extends Parameter> List<PARAMETER> createList(
+ Class concreteClass,
+ Class declaringClass,
+ Method javaMethod,
+ boolean keepEncoded,
+ Class parameterClass) {
+ AnnotatedMethod method = new AnnotatedMethod(javaMethod);
+
+ return createList(
+ concreteClass, declaringClass,
+ ((null != method.getAnnotation(Encoded.class)) || keepEncoded),
+ method.getParameterTypes(),
+ method.getGenericParameterTypes(),
+ method.getParameterAnnotations(),
+ parameterClass);
+ }
+
+ private static <PARAMETER extends Parameter> List<PARAMETER> createList(Class concreteClass, Class declaringClass,
+ boolean keepEncoded, Class[] parameterTypes,
+ Type[] genericParameterTypes,
+ Annotation[][] parameterAnnotations,
+ Class<?> parameterClass) {
+ final List<PARAMETER> parameters = new ArrayList<>(parameterTypes.length);
+
+ for (int i = 0; i < parameterTypes.length; i++) {
+ final PARAMETER parameter = Parameter.create(concreteClass, declaringClass, keepEncoded, parameterTypes[i],
+ genericParameterTypes[i], parameterAnnotations[i], parameterClass);
+ if (null != parameter) {
+ parameters.add(parameter);
+ } else {
+ // TODO throw IllegalStateException instead?
+ return Collections.emptyList();
+ }
+ }
+
+ return parameters;
+ }
+
+ /**
+ * Create a list of parameter models for a given resource method handler
+ * injectable constructor.
+ *
+ * @param concreteClass concrete resource method handler implementation class.
+ * @param declaringClass class where the method has been declared.
+ * @param ctor injectable constructor of the resource method handler.
+ * @param keepEncoded set to {@code true} to disable automatic decoding
+ * of all the constructor parameters. (See {@link Encoded}.
+ * @return a list of constructor parameter models.
+ */
+ protected static <PARAMETER extends org.glassfish.jersey.model.Parameter> List<PARAMETER> createList(
+ Class concreteClass,
+ Class declaringClass,
+ Constructor<?> ctor,
+ boolean keepEncoded,
+ Class<?> parameterClass) {
+
+ Class[] parameterTypes = ctor.getParameterTypes();
+ Type[] genericParameterTypes = ctor.getGenericParameterTypes();
+ // Workaround bug http://bugs.sun.com/view_bug.do?bug_id=5087240
+ if (parameterTypes.length != genericParameterTypes.length) {
+ Type[] _genericParameterTypes = new Type[parameterTypes.length];
+ _genericParameterTypes[0] = parameterTypes[0];
+ System.arraycopy(genericParameterTypes, 0, _genericParameterTypes, 1, genericParameterTypes.length);
+ genericParameterTypes = _genericParameterTypes;
+ }
+
+ return createList(
+ concreteClass, declaringClass,
+ ((null != ctor.getAnnotation(Encoded.class)) || keepEncoded),
+ parameterTypes,
+ genericParameterTypes,
+ ctor.getParameterAnnotations(),
+ parameterClass);
+ }
+
+
+ private static String getValue(Annotation a) {
+ try {
+ Method m = a.annotationType().getMethod("value");
+ if (m.getReturnType() != String.class) {
+ return null;
+ }
+ return (String) m.invoke(a);
+ } catch (Exception ex) {
+ if (LOGGER.isLoggable(Level.FINER)) {
+ LOGGER.log(Level.FINER,
+ String.format("Unable to get the %s annotation value property", a.getClass().getName()), ex);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get the parameter source annotation.
+ *
+ * @return parameter source annotation.
+ */
+ public Annotation getSourceAnnotation() {
+ return sourceAnnotation;
+ }
+
+ /**
+ * Get the parameter value source type.
+ *
+ * @return parameter value source type.
+ */
+ public Parameter.Source getSource() {
+ return source;
+ }
+
+ /**
+ * Get the parameter source name, i.e. value of the parameter source annotation.
+ *
+ * @return parameter source name.
+ */
+ public String getSourceName() {
+ return sourceName;
+ }
+
+ /**
+ * If {@code true}, the injected parameter value should remain encoded.
+ *
+ * @return {@code true} if the parameter value should remain encoded,
+ * {@code false} otherwise.
+ */
+ public boolean isEncoded() {
+ return encoded;
+ }
+
+ /**
+ * Check if the parameter has a default value set.
+ *
+ * @return {@code true} if the default parameter value has been set,
+ * {@code false} otherwise.
+ */
+ public boolean hasDefaultValue() {
+ return defaultValue != null;
+ }
+
+ /**
+ * Get the default parameter value.
+ *
+ * @return default parameter value or {@code null} if no default value has
+ * been set for the parameter.
+ */
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ /**
+ * Get raw type information for the parameter.
+ *
+ * @return raw parameter type information.
+ */
+ public Class<?> getRawType() {
+ return rawType;
+ }
+
+ /**
+ * Get generic type information for the parameter.
+ *
+ * @return generic parameter type information.
+ */
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * Check if the parameter is qualified.
+ *
+ * @return {@code false}.
+ */
+ public boolean isQualified() {
+ return false;
+ }
+
+ @Override
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
+ return getAnnotation(annotationClass) != null;
+ }
+
+ @Override
+ public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+ if (annotationClass == null) {
+ return null;
+ }
+ for (Annotation a : annotations) {
+ if (a.annotationType() == annotationClass) {
+ return annotationClass.cast(a);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Annotation[] getAnnotations() {
+ return annotations.clone();
+ }
+
+ @Override
+ public Annotation[] getDeclaredAnnotations() {
+ return annotations.clone();
+ }
+
+ @Override
+ public String toString() {
+ return String.format("Parameter [type=%s, source=%s, defaultValue=%s]",
+ getRawType(), getSourceName(), getDefaultValue());
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ Parameter parameter = (Parameter) o;
+
+ if (encoded != parameter.encoded) {
+ return false;
+ }
+ if (!Arrays.equals(annotations, parameter.annotations)) {
+ return false;
+ }
+ if (defaultValue != null ? !defaultValue.equals(parameter.defaultValue) : parameter.defaultValue != null) {
+ return false;
+ }
+ if (rawType != null ? !rawType.equals(parameter.rawType) : parameter.rawType != null) {
+ return false;
+ }
+ if (source != parameter.source) {
+ return false;
+ }
+ if (sourceAnnotation != null ? !sourceAnnotation.equals(parameter.sourceAnnotation) : parameter.sourceAnnotation
+ != null) {
+ return false;
+ }
+ if (sourceName != null ? !sourceName.equals(parameter.sourceName) : parameter.sourceName != null) {
+ return false;
+ }
+ if (type != null ? !type.equals(parameter.type) : parameter.type != null) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = annotations != null ? Arrays.hashCode(annotations) : 0;
+ result = 31 * result + (sourceAnnotation != null ? sourceAnnotation.hashCode() : 0);
+ result = 31 * result + (source != null ? source.hashCode() : 0);
+ result = 31 * result + (sourceName != null ? sourceName.hashCode() : 0);
+ result = 31 * result + (encoded ? 1 : 0);
+ result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0);
+ result = 31 * result + (rawType != null ? rawType.hashCode() : 0);
+ result = 31 * result + (type != null ? type.hashCode() : 0);
+ return result;
+ }
+
+ public static class ParameterService implements ParameterServiceProvider {
+ @Override
+ public Map<Class, ParamAnnotationHelper> getParameterAnnotationHelperMap() {
+ Map<Class, ParamAnnotationHelper> m = new WeakHashMap<Class, ParamAnnotationHelper>();
+ m.put(Context.class, new ParamAnnotationHelper<Context>() {
+
+ @Override
+ public String getValueOf(Context a) {
+ return null;
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.CONTEXT;
+ }
+ });
+ m.put(CookieParam.class, new ParamAnnotationHelper<CookieParam>() {
+
+ @Override
+ public String getValueOf(CookieParam a) {
+ return a.value();
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.COOKIE;
+ }
+ });
+ m.put(FormParam.class, new ParamAnnotationHelper<FormParam>() {
+
+ @Override
+ public String getValueOf(FormParam a) {
+ return a.value();
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.FORM;
+ }
+ });
+ m.put(HeaderParam.class, new ParamAnnotationHelper<HeaderParam>() {
+
+ @Override
+ public String getValueOf(HeaderParam a) {
+ return a.value();
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.HEADER;
+ }
+ });
+ m.put(MatrixParam.class, new ParamAnnotationHelper<MatrixParam>() {
+
+ @Override
+ public String getValueOf(MatrixParam a) {
+ return a.value();
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.MATRIX;
+ }
+ });
+ m.put(PathParam.class, new ParamAnnotationHelper<PathParam>() {
+
+ @Override
+ public String getValueOf(PathParam a) {
+ return a.value();
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.PATH;
+ }
+ });
+ m.put(QueryParam.class, new ParamAnnotationHelper<QueryParam>() {
+
+ @Override
+ public String getValueOf(QueryParam a) {
+ return a.value();
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.QUERY;
+ }
+ });
+ m.put(Suspended.class, new ParamAnnotationHelper<Suspended>() {
+
+ @Override
+ public String getValueOf(Suspended a) {
+ return Suspended.class.getName();
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.SUSPENDED;
+ }
+ });
+ m.put(BeanParam.class, new ParamAnnotationHelper<BeanParam>() {
+
+ @Override
+ public String getValueOf(BeanParam a) {
+ return null;
+ }
+
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.BEAN_PARAM;
+ }
+ });
+ return m;
+ }
+
+ @Override
+ public ParamCreationFactory<Parameter> getParameterCreationFactory() {
+ return new ParamCreationFactory<Parameter>() {
+ @Override
+ public boolean isFor(Class<?> clazz) {
+ return clazz == Parameter.class;
+ }
+
+ @Override
+ public Parameter createParameter(Annotation[] markers, Annotation marker, Source source, String sourceName,
+ Class<?> rawType, Type type, boolean encoded, String defaultValue) {
+ return new Parameter(markers, marker, source, sourceName, rawType, type, encoded, defaultValue);
+ }
+
+ @Override
+ public Parameter createBeanParameter(Annotation[] markers, Annotation marker, Source source, String sourceName,
+ Class<?> rawType, Type type, boolean encoded, String defaultValue) {
+ return createParameter(markers, marker, source, sourceName, rawType, type, encoded, defaultValue);
+ }
+ };
+ }
+ }
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/Scoped.java b/core-common/src/main/java/org/glassfish/jersey/model/Scoped.java
index ea4b49e..77b3d80 100644
--- a/core-common/src/main/java/org/glassfish/jersey/model/Scoped.java
+++ b/core-common/src/main/java/org/glassfish/jersey/model/Scoped.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Scoped Jersey application model component.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Scoped {
/**
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/internal/CommonConfig.java b/core-common/src/main/java/org/glassfish/jersey/model/internal/CommonConfig.java
index 9dedb80..5775d6d 100644
--- a/core-common/src/main/java/org/glassfish/jersey/model/internal/CommonConfig.java
+++ b/core-common/src/main/java/org/glassfish/jersey/model/internal/CommonConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,11 +28,9 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
-import java.util.function.Function;
import java.util.function.Predicate;
import java.util.logging.Level;
import java.util.logging.Logger;
-import java.util.stream.Collectors;
import javax.ws.rs.ConstrainedTo;
import javax.ws.rs.Priorities;
@@ -44,11 +42,12 @@
import javax.annotation.Priority;
import org.glassfish.jersey.ExtendedConfig;
+import org.glassfish.jersey.inject.spi.BinderConfigurationFactory;
import org.glassfish.jersey.internal.LocalizationMessages;
import org.glassfish.jersey.internal.ServiceFinder;
-import org.glassfish.jersey.internal.inject.Binder;
-import org.glassfish.jersey.internal.inject.CompositeBinder;
import org.glassfish.jersey.internal.inject.InjectionManager;
+import org.glassfish.jersey.internal.inject.JerseyBinderConfigurationFactory;
+import org.glassfish.jersey.internal.inject.ProviderBinder;
import org.glassfish.jersey.internal.spi.AutoDiscoverable;
import org.glassfish.jersey.internal.spi.ForcedAutoDiscoverable;
import org.glassfish.jersey.internal.util.PropertiesHelper;
@@ -60,12 +59,11 @@
* server and client.
*
* @author Michal Gajdos
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CommonConfig implements FeatureContext, ExtendedConfig {
private static final Logger LOGGER = Logger.getLogger(CommonConfig.class.getName());
- private static final Function<Object, Binder> CAST_TO_BINDER = Binder.class::cast;
/**
* Configuration runtime type.
@@ -100,21 +98,62 @@
private boolean disableMetaProviderConfiguration;
/**
+ * A utility class that binds binders on all {@link BinderConfigurationFactory.BinderConfiguration BinderConfiguration}
+ * created upon creation of this BinderConfigurations from all {@link BinderConfigurationFactory BinderConfigurationFactories}
+ */
+ private static final class BinderConfigurations {
+ private static final List<BinderConfigurationFactory> BINDER_CONFIGURATION_FACTORIES;
+ static {
+ final ServiceFinder<BinderConfigurationFactory> factoriesFinder =
+ ServiceFinder.find(BinderConfigurationFactory.class);
+ final List<BinderConfigurationFactory> configurationFactories = new LinkedList<>();
+ configurationFactories.add(new JerseyBinderConfigurationFactory());
+ for (BinderConfigurationFactory configurationFactory : factoriesFinder) {
+ configurationFactories.add(configurationFactory);
+ }
+ BINDER_CONFIGURATION_FACTORIES = Collections.unmodifiableList(configurationFactories);
+ }
+
+ private final List<BinderConfigurationFactory.BinderConfiguration> binderConfigurations;
+
+ private BinderConfigurations(ComponentBag componentBag) {
+ binderConfigurations = new LinkedList<>();
+ for (BinderConfigurationFactory factory : BINDER_CONFIGURATION_FACTORIES) {
+ BinderConfigurationFactory.BinderConfiguration configuration =
+ factory.createBinderConfiguration(componentBag::getInstances);
+ binderConfigurations.add(configuration);
+ }
+ }
+
+ private void configureBinders(InjectionManager injectionManager) {
+ for (BinderConfigurationFactory.BinderConfiguration configuration : binderConfigurations) {
+ configuration.configureBinders(injectionManager);
+ }
+ }
+
+ }
+
+ /**
* A single feature registration record.
*/
private static final class FeatureRegistration {
private final Class<? extends Feature> featureClass;
private final Feature feature;
+ private final RuntimeType runtimeType;
private FeatureRegistration(final Class<? extends Feature> featureClass) {
this.featureClass = featureClass;
this.feature = null;
+ final ConstrainedTo runtimeTypeConstraint = featureClass.getAnnotation(ConstrainedTo.class);
+ this.runtimeType = runtimeTypeConstraint == null ? null : runtimeTypeConstraint.value();
}
private FeatureRegistration(final Feature feature) {
this.featureClass = feature.getClass();
this.feature = feature;
+ final ConstrainedTo runtimeTypeConstraint = featureClass.getAnnotation(ConstrainedTo.class);
+ this.runtimeType = runtimeTypeConstraint == null ? null : runtimeTypeConstraint.value();
}
/**
@@ -122,7 +161,7 @@
*
* @return registered feature class.
*/
- Class<? extends Feature> getFeatureClass() {
+ private Class<? extends Feature> getFeatureClass() {
return featureClass;
}
@@ -133,10 +172,21 @@
* @return the registered feature instance or {@code null} if this is a
* class based feature registration.
*/
- public Feature getFeature() {
+ private Feature getFeature() {
return feature;
}
+ /**
+ * Get the {@code RuntimeType} constraint given by {@code ConstrainedTo} annotated
+ * the Feature or {@code null} if not annotated.
+ *
+ * @return the {@code RuntimeType} constraint given by {@code ConstrainedTo} annotated
+ * the Feature or {@code null} if not annotated.
+ */
+ private RuntimeType getFeatureRuntimeType() {
+ return runtimeType;
+ }
+
@Override
public boolean equals(final Object obj) {
if (this == obj) {
@@ -554,7 +604,8 @@
* @param forcedOnly defines whether all or only forced auto-discoverables should be configured.
*/
public void configureAutoDiscoverableProviders(final InjectionManager injectionManager,
- final Collection<AutoDiscoverable> autoDiscoverables, final boolean forcedOnly) {
+ final Collection<AutoDiscoverable> autoDiscoverables,
+ final boolean forcedOnly) {
// Check whether meta providers have been initialized for a config this config has been loaded from.
if (!disableMetaProviderConfiguration) {
final Set<AutoDiscoverable> providers = new TreeSet<>((o1, o2) -> {
@@ -587,7 +638,7 @@
autoDiscoverable.configure(this);
} catch (final Exception e) {
LOGGER.log(Level.FINE,
- LocalizationMessages.AUTODISCOVERABLE_CONFIGURATION_FAILED(autoDiscoverable.getClass()), e);
+ LocalizationMessages.AUTODISCOVERABLE_CONFIGURATION_FAILED(autoDiscoverable.getClass()), e);
}
}
}
@@ -601,7 +652,8 @@
*/
public void configureMetaProviders(InjectionManager injectionManager, ManagedObjectsFinalizer finalizer) {
// First, configure existing binders
- Set<Binder> configuredBinders = configureBinders(injectionManager, Collections.emptySet());
+ BinderConfigurations binderConfigurations = new BinderConfigurations(componentBag);
+ binderConfigurations.configureBinders(injectionManager);
// Check whether meta providers have been initialized for a config this config has been loaded from.
if (!disableMetaProviderConfiguration) {
@@ -610,36 +662,15 @@
// Next, configure all features
configureFeatures(injectionManager, new HashSet<>(), resetRegistrations(), finalizer);
// At last, configure any new binders added by features
- configureBinders(injectionManager, configuredBinders);
+ binderConfigurations.configureBinders(injectionManager);
}
}
- private Set<Binder> configureBinders(InjectionManager injectionManager, Set<Binder> configured) {
- Set<Binder> allConfigured = Collections.newSetFromMap(new IdentityHashMap<>());
- allConfigured.addAll(configured);
-
- Collection<Binder> binders = getBinder(configured);
- if (!binders.isEmpty()) {
- injectionManager.register(CompositeBinder.wrap(binders));
- allConfigured.addAll(binders);
- }
-
- return allConfigured;
- }
-
- private Collection<Binder> getBinder(Set<Binder> configured) {
- return componentBag.getInstances(ComponentBag.BINDERS_ONLY)
- .stream()
- .map(CAST_TO_BINDER)
- .filter(binder -> !configured.contains(binder))
- .collect(Collectors.toList());
- }
-
private void configureExternalObjects(InjectionManager injectionManager) {
- componentBag.getInstances(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager))
- .forEach(injectionManager::register);
- componentBag.getClasses(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager))
- .forEach(injectionManager::register);
+ componentBag.getInstances(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager))
+ .forEach(injectionManager::register);
+ componentBag.getClasses(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager))
+ .forEach(injectionManager::register);
}
private void configureFeatures(InjectionManager injectionManager,
@@ -653,6 +684,13 @@
continue;
}
+ final RuntimeType runtimeTypeConstraint = registration.getFeatureRuntimeType();
+ if (runtimeTypeConstraint != null && !type.equals(runtimeTypeConstraint)) {
+ LOGGER.config(LocalizationMessages.FEATURE_CONSTRAINED_TO_IGNORED(
+ registration.getFeatureClass(), registration.runtimeType, type));
+ continue;
+ }
+
Feature feature = registration.getFeature();
if (feature == null) {
feature = injectionManager.createAndInitialize(registration.getFeatureClass());
@@ -678,6 +716,10 @@
if (success) {
processed.add(registration);
+ final ContractProvider providerModel = componentBag.getModel(feature.getClass());
+ if (providerModel != null) {
+ ProviderBinder.bindProvider(feature, providerModel, injectionManager);
+ }
configureFeatures(injectionManager, processed, resetRegistrations(), managedObjectsFinalizer);
enabledFeatureClasses.add(registration.getFeatureClass());
enabledFeatures.add(feature);
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/internal/ComponentBag.java b/core-common/src/main/java/org/glassfish/jersey/model/internal/ComponentBag.java
index ca1ea30..fd1aaeb 100644
--- a/core-common/src/main/java/org/glassfish/jersey/model/internal/ComponentBag.java
+++ b/core-common/src/main/java/org/glassfish/jersey/model/internal/ComponentBag.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,6 +18,7 @@
import java.lang.annotation.Annotation;
import java.util.Collections;
+import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
@@ -67,7 +68,7 @@
* </ul>
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ComponentBag {
/**
@@ -432,7 +433,7 @@
* (if any).
* @param contractMap map of contracts and their binding priorities. If {@code null}, the contracts will
* gathered by introspecting the component class. Content of the contract map
- * may be modified during the registration processing.
+ * is not modified during the registration processing.
* @param modelEnhancer custom contract provider model enhancer.
* @return {@code true} upon successful registration of a contract provider model for a given component class,
* {@code false} otherwise.
@@ -481,7 +482,7 @@
* (if any).
* @param contractMap map of contracts and their binding priorities. If {@code null}, the contracts will
* gathered by introspecting the component class. Content of the contract map
- * may be modified during the registration processing.
+ * is not modified during the registration processing.
* @param modelEnhancer custom contract provider model enhancer.
* @return contract provider model for the class.
*/
@@ -489,10 +490,11 @@
final int defaultPriority,
final Map<Class<?>, Integer> contractMap,
final Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) {
- Map<Class<?>, Integer> contracts = contractMap;
- if (contracts == null) { // introspect
+ Map<Class<?>, Integer> contracts;
+ if (contractMap == null) { // introspect
contracts = asMap(Providers.getProviderContracts(componentClass));
} else { // filter custom contracts
+ contracts = new HashMap<>(contractMap);
final Iterator<Class<?>> it = contracts.keySet().iterator();
while (it.hasNext()) {
final Class<?> contract = it.next();
@@ -679,7 +681,7 @@
/**
* Immutable version of {@link org.glassfish.jersey.model.internal.ComponentBag}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
private static class ImmutableComponentBag extends ComponentBag {
ImmutableComponentBag(ComponentBag original) {
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/internal/ImmutableCommonConfig.java b/core-common/src/main/java/org/glassfish/jersey/model/internal/ImmutableCommonConfig.java
index bc6aa57..287f8b8 100644
--- a/core-common/src/main/java/org/glassfish/jersey/model/internal/ImmutableCommonConfig.java
+++ b/core-common/src/main/java/org/glassfish/jersey/model/internal/ImmutableCommonConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
/**
* Immutable runtime configuration.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ImmutableCommonConfig extends CommonConfig {
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/internal/ManagedObjectsFinalizer.java b/core-common/src/main/java/org/glassfish/jersey/model/internal/ManagedObjectsFinalizer.java
index 8edaa1f..3c7f17a 100644
--- a/core-common/src/main/java/org/glassfish/jersey/model/internal/ManagedObjectsFinalizer.java
+++ b/core-common/src/main/java/org/glassfish/jersey/model/internal/ManagedObjectsFinalizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -35,7 +35,7 @@
* on the injection manager where this service is registered. Therefore only classes with their lifecycle linked
* to the injection manager that created them should be registered here.
*
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
@Singleton
public class ManagedObjectsFinalizer {
diff --git a/core-common/src/main/java/org/glassfish/jersey/model/internal/spi/ParameterServiceProvider.java b/core-common/src/main/java/org/glassfish/jersey/model/internal/spi/ParameterServiceProvider.java
new file mode 100644
index 0000000..bed5372
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/model/internal/spi/ParameterServiceProvider.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2019 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.model.internal.spi;
+
+import org.glassfish.jersey.model.Parameter;
+
+import java.util.Map;
+
+/**
+ * Implementation of this service is used by any Parameter implementation
+ * to overcome the inheritance of static methods.
+ */
+public interface ParameterServiceProvider {
+ /**
+ * A map of supported Parameter Annotations. The maps from each found {@link ParameterServiceProvider}
+ * are combined to provide a list of Parameter Annotations for the given {@link Parameter}.
+ * @return A map of subset of Parameter Annotations known to the ParameterServiceProvider
+ */
+ Map<Class, Parameter.ParamAnnotationHelper> getParameterAnnotationHelperMap();
+
+ /**
+ * Get a factory to be used to instantiate the {@link Parameter}
+ * @return {@code Parameter} instantiating factory
+ */
+ Parameter.ParamCreationFactory<? extends Parameter> getParameterCreationFactory();
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/Inflector.java b/core-common/src/main/java/org/glassfish/jersey/process/Inflector.java
index 310ba23..4526341 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/Inflector.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/Inflector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
* @param <DATA> transformable data type.
* @param <RESULT> type of result produced by a successful inflector data transformation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Inflector<DATA, RESULT> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/JerseyProcessingUncaughtExceptionHandler.java b/core-common/src/main/java/org/glassfish/jersey/process/JerseyProcessingUncaughtExceptionHandler.java
index 47fd8f2..9b6fe99 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/JerseyProcessingUncaughtExceptionHandler.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/JerseyProcessingUncaughtExceptionHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Uncaught exception handler that can be used by various Jersey request processing thread pools uncaught exceptions.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.17
*/
public class JerseyProcessingUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/internal/AbstractChainableStage.java b/core-common/src/main/java/org/glassfish/jersey/process/internal/AbstractChainableStage.java
index f4f1cbe..52a24d1 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/internal/AbstractChainableStage.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/internal/AbstractChainableStage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
* Implements support for managing the default next stage value.
*
* @param <DATA> processed data type.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractChainableStage<DATA> implements ChainableStage<DATA> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/internal/ChainableStage.java b/core-common/src/main/java/org/glassfish/jersey/process/internal/ChainableStage.java
index 81c103b..0d33fa6 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/internal/ChainableStage.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/internal/ChainableStage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -35,7 +35,7 @@
* </p>
*
* @param <DATA> processed data type.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface ChainableStage<DATA> extends Stage<DATA> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/internal/ExecutorProviders.java b/core-common/src/main/java/org/glassfish/jersey/process/internal/ExecutorProviders.java
index 55bcf56..72a2c5e 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/internal/ExecutorProviders.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/internal/ExecutorProviders.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -46,7 +46,7 @@
/**
* A utility class with a methods for handling executor injection registration and proper disposal.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class ExecutorProviders {
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/internal/Inflecting.java b/core-common/src/main/java/org/glassfish/jersey/process/internal/Inflecting.java
index d57f468..5b0505b 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/internal/Inflecting.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/internal/Inflecting.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -28,7 +28,7 @@
* @param <DATA> data type transformable by the provided inflector.
* @param <RESULT> type of a result produced by the provided inflector on success.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Inflecting<DATA, RESULT> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScope.java b/core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScope.java
index c867196..ced41cd 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScope.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScope.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -97,7 +97,7 @@
* which this scope context is used.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav Fuksa
*/
public abstract class RequestScope {
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScoped.java b/core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScoped.java
index 5bbffa3..8a2b5ea 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScoped.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScoped.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -27,7 +27,7 @@
/**
* Request scope binding annotation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Target({TYPE, METHOD})
@Retention(RUNTIME)
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/internal/Stage.java b/core-common/src/main/java/org/glassfish/jersey/process/internal/Stage.java
index 9a78c2a..97c9efc 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/internal/Stage.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/internal/Stage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
* </p>
*
* @param <DATA> processed data type.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Stage<DATA> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/process/internal/Stages.java b/core-common/src/main/java/org/glassfish/jersey/process/internal/Stages.java
index 0c87d01..b7c7388 100644
--- a/core-common/src/main/java/org/glassfish/jersey/process/internal/Stages.java
+++ b/core-common/src/main/java/org/glassfish/jersey/process/internal/Stages.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,7 +26,7 @@
/**
* A stage-related collection of utility methods.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class Stages {
private static final ChainableStage IDENTITY = new AbstractChainableStage() {
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/AbstractThreadPoolProvider.java b/core-common/src/main/java/org/glassfish/jersey/spi/AbstractThreadPoolProvider.java
index 33a02c8..27cf449 100644
--- a/core-common/src/main/java/org/glassfish/jersey/spi/AbstractThreadPoolProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/AbstractThreadPoolProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -54,7 +54,7 @@
* <em>at most once</em> during the lifetime of any particular provider instance.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.18
*/
public abstract class AbstractThreadPoolProvider<E extends ThreadPoolExecutor> implements AutoCloseable {
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/ContextResolvers.java b/core-common/src/main/java/org/glassfish/jersey/spi/ContextResolvers.java
index 8096815..0163fcc 100644
--- a/core-common/src/main/java/org/glassfish/jersey/spi/ContextResolvers.java
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/ContextResolvers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
* An injectable interface providing look-up for {@link ContextResolver ContextResolver<T>}
* provider instances.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface ContextResolvers {
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/Contract.java b/core-common/src/main/java/org/glassfish/jersey/spi/Contract.java
index 58f5afa..00889eb 100644
--- a/core-common/src/main/java/org/glassfish/jersey/spi/Contract.java
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/Contract.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -33,7 +33,7 @@
* </p>
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/ExecutorServiceProvider.java b/core-common/src/main/java/org/glassfish/jersey/spi/ExecutorServiceProvider.java
index 59f623c..9cda634 100644
--- a/core-common/src/main/java/org/glassfish/jersey/spi/ExecutorServiceProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/ExecutorServiceProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -63,7 +63,7 @@
* @Inject @Named("my-executor") ExecutorService myExecutor;
* </pre>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see ScheduledExecutorServiceProvider
* @see ThreadPoolExecutorProvider
* @since 2.18
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/ExternalConfigurationModel.java b/core-common/src/main/java/org/glassfish/jersey/spi/ExternalConfigurationModel.java
new file mode 100644
index 0000000..333cd35
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/ExternalConfigurationModel.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2019 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.spi;
+
+import org.glassfish.jersey.ExtendedConfig;
+
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * Model of configuration for external properties. Requires certain utilities methods to be implemented
+ * @param <CONFIG> type of an external config
+ */
+public interface ExternalConfigurationModel<CONFIG> extends ExtendedConfig {
+
+ /**
+ * Get value of a property as a definite type
+ *
+ * property shall exist in order for this method to be used. Otherwise exception is thrown
+ *
+ * @param name property name
+ * @param clazz class type of an expected value
+ * @param <T> type of an expected value
+ * @return value of an expected type
+ */
+ <T> T as(String name, Class<T> clazz);
+
+ /**
+ * Get value of a property as a definite type
+ *
+ * property may not exist, an empty Optional object is returned in case of an empty property
+ *
+ * @param name property name
+ * @param clazz class type of an expected value
+ * @param <T> type of an expected value
+ * @return Optional object filled by a value of an expected type or by the NULL value (
+ */
+ <T> Optional<T> getOptionalProperty(String name, Class<T> clazz);
+
+ /**
+ * Merge properties from other (found) external configuration.
+ *
+ * @param inputProperties those properties will be merged into ours
+ * @return current instance of the model
+ */
+ ExternalConfigurationModel mergeProperties(Map<String, Object> inputProperties);
+
+ /**
+ * Obtain config object
+ *
+ * @return external config provider
+ */
+ CONFIG getConfig();
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/ExternalConfigurationProvider.java b/core-common/src/main/java/org/glassfish/jersey/spi/ExternalConfigurationProvider.java
new file mode 100644
index 0000000..80e0784
--- /dev/null
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/ExternalConfigurationProvider.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019 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.spi;
+
+import java.util.Map;
+
+/**
+ * Provider interface for external (SPI) providers to provide
+ * their configuration properties implementations
+ *
+ * Priority of providers can be adjusted by Priority annotation
+ * or just alphabetically (if no Provider annotation is found)
+ */
+public interface ExternalConfigurationProvider {
+
+ /**
+ * Map of properties from the model (external config file)
+ *
+ * @return Map of properties loaded by a model from config file
+ */
+ Map<String, Object> getProperties();
+
+ /**
+ * obrain model object which has direct access to external configuration
+ *
+ * @return model of external properties
+ */
+ ExternalConfigurationModel getConfiguration();
+
+ /**
+ * Merge properties from other provider/model
+ *
+ * @param input those properties will be merged into ours
+ * @return current instance of provider
+ */
+ ExternalConfigurationModel merge(ExternalConfigurationModel input);
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/HeaderDelegateProvider.java b/core-common/src/main/java/org/glassfish/jersey/spi/HeaderDelegateProvider.java
index 6993e30..daa18c3 100644
--- a/core-common/src/main/java/org/glassfish/jersey/spi/HeaderDelegateProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/HeaderDelegateProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -30,7 +30,7 @@
* @param <T> the type of the header.
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Contract
public interface HeaderDelegateProvider<T> extends HeaderDelegate<T> {
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/ScheduledExecutorServiceProvider.java b/core-common/src/main/java/org/glassfish/jersey/spi/ScheduledExecutorServiceProvider.java
index a8f801b..fc79865 100644
--- a/core-common/src/main/java/org/glassfish/jersey/spi/ScheduledExecutorServiceProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/ScheduledExecutorServiceProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -47,7 +47,7 @@
* @Inject @Named("my-scheduler") ScheduledExecutorService myScheduler;
* </pre>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see ExecutorServiceProvider
* @see ScheduledThreadPoolExecutorProvider
* @since 2.18
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/ScheduledThreadPoolExecutorProvider.java b/core-common/src/main/java/org/glassfish/jersey/spi/ScheduledThreadPoolExecutorProvider.java
index 171491a..486226c 100644
--- a/core-common/src/main/java/org/glassfish/jersey/spi/ScheduledThreadPoolExecutorProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/ScheduledThreadPoolExecutorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -50,7 +50,7 @@
* that are created and managed by the container.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.18
*/
public class ScheduledThreadPoolExecutorProvider extends AbstractThreadPoolProvider<ScheduledThreadPoolExecutor>
diff --git a/core-common/src/main/java/org/glassfish/jersey/spi/ThreadPoolExecutorProvider.java b/core-common/src/main/java/org/glassfish/jersey/spi/ThreadPoolExecutorProvider.java
index fbaa383..dbcec55 100644
--- a/core-common/src/main/java/org/glassfish/jersey/spi/ThreadPoolExecutorProvider.java
+++ b/core-common/src/main/java/org/glassfish/jersey/spi/ThreadPoolExecutorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -43,7 +43,7 @@
* Subclasses may override the respective methods to customize the parameters of the provisioned thread pool executor.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.18
*/
public class ThreadPoolExecutorProvider extends AbstractThreadPoolProvider<ThreadPoolExecutor>
diff --git a/core-common/src/main/java/org/glassfish/jersey/uri/UriComponent.java b/core-common/src/main/java/org/glassfish/jersey/uri/UriComponent.java
index bee5af7..4c846f3 100644
--- a/core-common/src/main/java/org/glassfish/jersey/uri/UriComponent.java
+++ b/core-common/src/main/java/org/glassfish/jersey/uri/UriComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,6 +20,7 @@
import java.net.URI;
import java.net.URLDecoder;
import java.nio.ByteBuffer;
+import java.nio.Buffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.util.ArrayList;
@@ -38,7 +39,7 @@
* of a URI.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UriComponent {
@@ -806,7 +807,7 @@
if (bb == null) {
bb = ByteBuffer.allocate(1);
} else {
- bb.clear();
+ ((Buffer) bb).clear();
}
while (true) {
@@ -824,8 +825,8 @@
}
// Check if the byte buffer needs to be increased in size
- if (bb.position() == bb.capacity()) {
- bb.flip();
+ if (((Buffer) bb).position() == bb.capacity()) {
+ ((Buffer) bb).flip();
// Create a new byte buffer with the maximum number of possible
// octets, hence resize should only occur once
final ByteBuffer bb_new = ByteBuffer.allocate(s.length() / 3);
@@ -834,7 +835,7 @@
}
}
- bb.flip();
+ ((Buffer) bb).flip();
return bb;
}
@@ -846,7 +847,7 @@
*/
private static int decodeOctets(final int i, final ByteBuffer bb, final StringBuilder sb) {
// If there is only one octet and is an ASCII character
- if (bb.limit() == 1 && (bb.get(0) & 0xFF) < 0x80) {
+ if (((Buffer) bb).limit() == 1 && (bb.get(0) & 0xFF) < 0x80) {
// Octet can be appended directly
sb.append((char) bb.get(0));
return i + 2;
@@ -854,7 +855,7 @@
//
final CharBuffer cb = UTF_8_CHARSET.decode(bb);
sb.append(cb.toString());
- return i + bb.limit() * 3 - 1;
+ return i + ((Buffer) bb).limit() * 3 - 1;
}
}
diff --git a/core-common/src/main/java/org/glassfish/jersey/uri/UriTemplate.java b/core-common/src/main/java/org/glassfish/jersey/uri/UriTemplate.java
index 6876f20..1ed213b 100644
--- a/core-common/src/main/java/org/glassfish/jersey/uri/UriTemplate.java
+++ b/core-common/src/main/java/org/glassfish/jersey/uri/UriTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -102,10 +102,10 @@
}
// If the number of explicit characters and template variables
- // are equal then comapre the regexes
- // The order does not matter as long as templates with different
+ // are equal then
+ // the order does not matter as long as templates with different
// explicit characters are distinguishable
- return o2.pattern.getRegex().compareTo(o1.pattern.getRegex());
+ return 0;
}
};
diff --git a/core-common/src/main/java/org/glassfish/jersey/uri/internal/UriParser.java b/core-common/src/main/java/org/glassfish/jersey/uri/internal/UriParser.java
index 50c8386..1b742ed 100644
--- a/core-common/src/main/java/org/glassfish/jersey/uri/internal/UriParser.java
+++ b/core-common/src/main/java/org/glassfish/jersey/uri/internal/UriParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +24,7 @@
* The parser is not thread safe.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class UriParser {
private static final String ERROR_STATE = LocalizationMessages.URI_PARSER_NOT_EXECUTED();
diff --git a/core-common/src/main/java11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java b/core-common/src/main/java11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java
new file mode 100644
index 0000000..7a7ce4e
--- /dev/null
+++ b/core-common/src/main/java11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java
@@ -0,0 +1,387 @@
+/*
+ * Copyright (c) 2019 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.internal.jsr166;
+
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+import java.util.concurrent.TimeUnit;
+import java.util.function.BiConsumer;
+import java.util.function.BiPredicate;
+import java.util.function.Consumer;
+
+/**
+ * A {@link Flow.Publisher} that asynchronously issues submitted
+ * (non-null) items to current subscribers until it is closed. Each
+ * current subscriber receives newly submitted items in the same order
+ * unless drops or exceptions are encountered. Using a
+ * SubmissionPublisher allows item generators to act as compliant <a
+ * href="http://www.reactive-streams.org/"> reactive-streams</a>
+ * Publishers relying on drop handling and/or blocking for flow
+ * control.
+ * <p>
+ * <p>A SubmissionPublisher uses the {@link Executor} supplied in its
+ * constructor for delivery to subscribers. The best choice of
+ * Executor depends on expected usage. If the generator(s) of
+ * submitted items run in separate threads, and the number of
+ * subscribers can be estimated, consider using a {@link
+ * Executors#newFixedThreadPool}. Otherwise consider using the
+ * default, normally the {@link ForkJoinPool#commonPool}.
+ * <p>
+ * <p>Buffering allows producers and consumers to transiently operate
+ * at different rates. Each subscriber uses an independent buffer.
+ * Buffers are created upon first use and expanded as needed up to the
+ * given maximum. (The enforced capacity may be rounded up to the
+ * nearest power of two and/or bounded by the largest value supported
+ * by this implementation.) Invocations of {@link
+ * Flow.Subscription#request(long) request} do not directly result in
+ * buffer expansion, but risk saturation if unfilled requests exceed
+ * the maximum capacity. The default value of {@link
+ * Flow#defaultBufferSize()} may provide a useful starting point for
+ * choosing a capacity based on expected rates, resources, and usages.
+ * <p>
+ * <p>Publication methods support different policies about what to do
+ * when buffers are saturated. Method {@link #submit(Object) submit}
+ * blocks until resources are available. This is simplest, but least
+ * responsive. The {@code offer} methods may drop items (either
+ * immediately or with bounded timeout), but provide an opportunity to
+ * interpose a handler and then retry.
+ * <p>
+ * <p>If any Subscriber method throws an exception, its subscription
+ * is cancelled. If a handler is supplied as a constructor argument,
+ * it is invoked before cancellation upon an exception in method
+ * {@link Flow.Subscriber#onNext onNext}, but exceptions in methods
+ * {@link Flow.Subscriber#onSubscribe onSubscribe},
+ * {@link Flow.Subscriber#onError(Throwable) onError} and
+ * {@link Flow.Subscriber#onComplete() onComplete} are not recorded or
+ * handled before cancellation. If the supplied Executor throws
+ * {@link RejectedExecutionException} (or any other RuntimeException
+ * or Error) when attempting to execute a task, or a drop handler
+ * throws an exception when processing a dropped item, then the
+ * exception is rethrown. In these cases, not all subscribers will
+ * have been issued the published item. It is usually good practice to
+ * {@link #closeExceptionally closeExceptionally} in these cases.
+ * <p>
+ * <p>Method {@link #consume(Consumer)} simplifies support for a
+ * common case in which the only action of a subscriber is to request
+ * and process all items using a supplied function.
+ * <p>
+ * <p>This class may also serve as a convenient base for subclasses
+ * that generate items, and use the methods in this class to publish
+ * them. For example here is a class that periodically publishes the
+ * items generated from a supplier. (In practice you might add methods
+ * to independently start and stop generation, to share Executors
+ * among publishers, and so on, or use a SubmissionPublisher as a
+ * component rather than a superclass.)
+ * <p>
+ * <pre> {@code
+ * class PeriodicPublisher<T> extends SubmissionPublisher<T> {
+ * final ScheduledFuture<?> periodicTask;
+ * final ScheduledExecutorService scheduler;
+ * PeriodicPublisher(Executor executor, int maxBufferCapacity,
+ * Supplier<? extends T> supplier,
+ * long period, TimeUnit unit) {
+ * super(executor, maxBufferCapacity);
+ * scheduler = new ScheduledThreadPoolExecutor(1);
+ * periodicTask = scheduler.scheduleAtFixedRate(
+ * () -> submit(supplier.get()), 0, period, unit);
+ * }
+ * public void close() {
+ * periodicTask.cancel(false);
+ * scheduler.shutdown();
+ * super.close();
+ * }
+ * }}</pre>
+ * <p>
+ * <p>Here is an example of a {@link Flow.Processor} implementation.
+ * It uses single-step requests to its publisher for simplicity of
+ * illustration. A more adaptive version could monitor flow using the
+ * lag estimate returned from {@code submit}, along with other utility
+ * methods.
+ * <p>
+ * <pre> {@code
+ * class TransformProcessor<S,T> extends SubmissionPublisher<T>
+ * implements Flow.Processor<S,T> {
+ * final Function<? super S, ? extends T> function;
+ * Flow.Subscription subscription;
+ * TransformProcessor(Executor executor, int maxBufferCapacity,
+ * Function<? super S, ? extends T> function) {
+ * super(executor, maxBufferCapacity);
+ * this.function = function;
+ * }
+ * public void onSubscribe(Flow.Subscription subscription) {
+ * (this.subscription = subscription).request(1);
+ * }
+ * public void onNext(S item) {
+ * subscription.request(1);
+ * submit(function.apply(item));
+ * }
+ * public void onError(Throwable ex) { closeExceptionally(ex); }
+ * public void onComplete() { close(); }
+ * }}</pre>
+ *
+ * @param <T> the published item type
+ * @author Doug Lea
+ * @since 9
+ */
+public class SubmissionPublisher<T> implements SubmittableFlowPublisher<T> {
+
+ private final java.util.concurrent.SubmissionPublisher<T> publisher;
+
+ /**
+ * Creates a new SubmissionPublisher using the given Executor for
+ * async delivery to subscribers, with the given maximum buffer size
+ * for each subscriber, and, if non-null, the given handler invoked
+ * when any Subscriber throws an exception in method {@link
+ * Flow.Subscriber#onNext(Object) onNext}.
+ *
+ * @param executor the executor to use for async delivery,
+ * supporting creation of at least one independent thread
+ * @param maxBufferCapacity the maximum capacity for each
+ * subscriber's buffer (the enforced capacity may be rounded up to
+ * the nearest power of two and/or bounded by the largest value
+ * supported by this implementation; method {@link #getMaxBufferCapacity}
+ * returns the actual value)
+ * @param handler if non-null, procedure to invoke upon exception
+ * thrown in method {@code onNext}
+ * @throws NullPointerException if executor is null
+ * @throws IllegalArgumentException if maxBufferCapacity not
+ * positive
+ */
+ public SubmissionPublisher(Executor executor, int maxBufferCapacity,
+ BiConsumer<? super Flow.Subscriber<? super T>, ? super Throwable> handler) {
+ publisher = new java.util.concurrent.SubmissionPublisher<T>(executor, maxBufferCapacity, convertConsumer(handler));
+ }
+
+ /**
+ * Creates a new SubmissionPublisher using the given Executor for
+ * async delivery to subscribers, with the given maximum buffer size
+ * for each subscriber, and no handler for Subscriber exceptions in
+ * method {@link Flow.Subscriber#onNext(Object) onNext}.
+ *
+ * @param executor the executor to use for async delivery,
+ * supporting creation of at least one independent thread
+ * @param maxBufferCapacity the maximum capacity for each
+ * subscriber's buffer (the enforced capacity may be rounded up to
+ * the nearest power of two and/or bounded by the largest value
+ * supported by this implementation; method {@link #getMaxBufferCapacity}
+ * returns the actual value)
+ * @throws NullPointerException if executor is null
+ * @throws IllegalArgumentException if maxBufferCapacity not
+ * positive
+ */
+ public SubmissionPublisher(Executor executor, int maxBufferCapacity) {
+ publisher = new java.util.concurrent.SubmissionPublisher<T>(executor, maxBufferCapacity);
+ }
+
+ /**
+ * Creates a new SubmissionPublisher using the {@link
+ * ForkJoinPool#commonPool()} for async delivery to subscribers
+ * (unless it does not support a parallelism level of at least two,
+ * in which case, a new Thread is created to run each task), with
+ * maximum buffer capacity of {@link Flow#defaultBufferSize}, and no
+ * handler for Subscriber exceptions in method {@link
+ * Flow.Subscriber#onNext(Object) onNext}.
+ */
+ public SubmissionPublisher() {
+ publisher = new java.util.concurrent.SubmissionPublisher<T>();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public CompletableFuture<Void> consume(Consumer<? super T> consumer) {
+ return publisher.consume(consumer);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void close() {
+ publisher.close();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void closeExceptionally(Throwable error) {
+ publisher.closeExceptionally(error);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public long estimateMinimumDemand() {
+ return publisher.estimateMinimumDemand();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int estimateMaximumLag() {
+ return publisher.estimateMaximumLag();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Throwable getClosedException() {
+ return publisher.getClosedException();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getMaxBufferCapacity() {
+ return publisher.getMaxBufferCapacity();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int offer(T item, long timeout, TimeUnit unit, BiPredicate<Flow.Subscriber<? super T>, ? super T> onDrop) {
+ return publisher.offer(item, timeout, unit, convertPredicate(onDrop));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int offer(T item, BiPredicate<Flow.Subscriber<? super T>, ? super T> onDrop) {
+ return publisher.offer(item, convertPredicate(onDrop));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int submit(T item) {
+ return publisher.submit(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void subscribe(Flow.Subscriber<? super T> subscriber) {
+ publisher.subscribe(convertSubscriber(subscriber));
+ }
+
+ private static <T> BiConsumer<? super java.util.concurrent.Flow.Subscriber<? super T>, ? super Throwable> convertConsumer(
+ BiConsumer<? super Flow.Subscriber<? super T>, ? super Throwable> consumer) {
+ return new BiConsumer<java.util.concurrent.Flow.Subscriber<? super T>, Throwable>() {
+ @Override
+ public void accept(java.util.concurrent.Flow.Subscriber<? super T> subscriber, Throwable throwable) {
+ consumer.accept(convertSubscriber(subscriber), throwable);
+ }
+ };
+ }
+
+ private static <T> BiPredicate<java.util.concurrent.Flow.Subscriber<? super T>, ? super T> convertPredicate(
+ BiPredicate<Flow.Subscriber<? super T>, ? super T> predicate) {
+ return new BiPredicate<java.util.concurrent.Flow.Subscriber<? super T>, T>() {
+ @Override
+ public boolean test(java.util.concurrent.Flow.Subscriber<? super T> subscriber, T t) {
+ return predicate.test(convertSubscriber(subscriber), t);
+ }
+ };
+ }
+
+ private static <T> Flow.Subscriber<? super T> convertSubscriber(java.util.concurrent.Flow.Subscriber<? super T> subscriber) {
+ return new Flow.Subscriber<T>() {
+
+ @Override
+ public void onSubscribe(Flow.Subscription subscription) {
+ subscriber.onSubscribe(convertSubscription(subscription));
+ }
+
+ @Override
+ public void onNext(T item) {
+ subscriber.onNext(item);
+ }
+
+ @Override
+ public void onError(Throwable throwable) {
+ subscriber.onError(throwable);
+ }
+
+ @Override
+ public void onComplete() {
+ subscriber.onComplete();
+ }
+ };
+ }
+
+ private static <T> java.util.concurrent.Flow.Subscriber<T> convertSubscriber(Flow.Subscriber<T> subscriber) {
+ return new java.util.concurrent.Flow.Subscriber<T>() {
+
+ @Override
+ public void onSubscribe(java.util.concurrent.Flow.Subscription subscription) {
+ subscriber.onSubscribe(convertSubscription(subscription));
+ }
+
+ @Override
+ public void onNext(T item) {
+ subscriber.onNext(item);
+ }
+
+ @Override
+ public void onError(Throwable throwable) {
+ subscriber.onError(throwable);
+ }
+
+ @Override
+ public void onComplete() {
+ subscriber.onComplete();
+ }
+ };
+ }
+
+ private static java.util.concurrent.Flow.Subscription convertSubscription(Flow.Subscription subscription) {
+ return new java.util.concurrent.Flow.Subscription() {
+ @Override
+ public void request(long n) {
+ subscription.request(n);
+ }
+
+ @Override
+ public void cancel() {
+ subscription.cancel();
+ }
+ };
+ }
+
+ private static Flow.Subscription convertSubscription(java.util.concurrent.Flow.Subscription subscription) {
+ return new Flow.Subscription() {
+ @Override
+ public void request(long n) {
+ subscription.request(n);
+ }
+
+ @Override
+ public void cancel() {
+ subscription.cancel();
+ }
+ };
+ }
+}
diff --git a/core-common/src/main/java11/org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory.java b/core-common/src/main/java11/org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory.java
new file mode 100644
index 0000000..ecdc41a
--- /dev/null
+++ b/core-common/src/main/java11/org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2019 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.internal.jsr166;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ForkJoinPool;
+import java.util.function.BiConsumer;
+
+/**
+ * Factory creating JDK8 compatible SubmissionPublisher (Jdk8SubmissionPublisher) or JDK 9+ SubmissionPublisher
+ */
+public class SubmissionPublisherFactory {
+
+ /**
+ * Creates a new SubmittableFlowPublisher using the {@link
+ * ForkJoinPool#commonPool()} for async delivery to subscribers
+ * (unless it does not support a parallelism level of at least two,
+ * in which case, a new Thread is created to run each task), with
+ * maximum buffer capacity of {@link Flow#defaultBufferSize}, and no
+ * handler for Subscriber exceptions in method {@link
+ * Flow.Subscriber#onNext(Object) onNext}.
+ */
+ public static <T> SubmittableFlowPublisher<T> createSubmissionPublisher() {
+ return new SubmissionPublisher<T>();
+ }
+
+ /**
+ * Creates a new Jdk9SubmissionPublisher using the given Executor for
+ * async delivery to subscribers, with the given maximum buffer size
+ * for each subscriber, and no handler for Subscriber exceptions in
+ * method {@link Flow.Subscriber#onNext(Object) onNext}.
+ *
+ * @param executor the executor to use for async delivery,
+ * supporting creation of at least one independent thread
+ * @param maxBufferCapacity the maximum capacity for each
+ * subscriber's buffer (the enforced capacity may be rounded up to
+ * the nearest power of two and/or bounded by the largest value
+ * supported by this implementation; method {@link #getMaxBufferCapacity}
+ * returns the actual value)
+ * @throws NullPointerException if executor is null
+ * @throws IllegalArgumentException if maxBufferCapacity not
+ * positive
+ */
+ public static <T> SubmittableFlowPublisher<T> createSubmissionPublisher(Executor executor,
+ int maxBufferCapacity) {
+ return new SubmissionPublisher<T>(executor, maxBufferCapacity);
+ }
+
+ /**
+ * Creates a new SubmittableFlowPublisher using the given Executor for
+ * async delivery to subscribers, with the given maximum buffer size
+ * for each subscriber, and, if non-null, the given handler invoked
+ * when any Subscriber throws an exception in method {@link
+ * Flow.Subscriber#onNext(Object) onNext}.
+ *
+ * @param executor the executor to use for async delivery,
+ * supporting creation of at least one independent thread
+ * @param maxBufferCapacity the maximum capacity for each
+ * subscriber's buffer (the enforced capacity may be rounded up to
+ * the nearest power of two and/or bounded by the largest value
+ * supported by this implementation; method {@link #getMaxBufferCapacity}
+ * returns the actual value)
+ * @param handler if non-null, procedure to invoke upon exception
+ * thrown in method {@code onNext}
+ * @throws NullPointerException if executor is null
+ * @throws IllegalArgumentException if maxBufferCapacity not
+ * positive
+ */
+ public static <T> SubmittableFlowPublisher<T> createSubmissionPublisher(Executor executor,
+ int maxBufferCapacity,
+ BiConsumer<? super Flow.Subscriber<? super T>,
+ ? super Throwable> handler) {
+ return new SubmissionPublisher<T>(executor, maxBufferCapacity, handler);
+ }
+
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java b/core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java
similarity index 99%
rename from core-common/src/main/java/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java
rename to core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java
index 7ca48ee..6eb4cb5 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java
+++ b/core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.java
@@ -134,7 +134,7 @@
* @author Doug Lea
* @since 9
*/
-public class SubmissionPublisher<T> implements Flow.Publisher<T>,
+public class SubmissionPublisher<T> implements Flow.Publisher<T>, SubmittableFlowPublisher<T>,
AutoCloseable {
/*
* Most mechanics are handled by BufferedSubscription. This class
diff --git a/core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory.java b/core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory.java
new file mode 100644
index 0000000..3729469
--- /dev/null
+++ b/core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2019 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.internal.jsr166;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ForkJoinPool;
+import java.util.function.BiConsumer;
+
+/**
+ * Factory creating JDK8 compatible SubmissionPublisher (Jdk8SubmissionPublisher) or JDK 9+ SubmissionPublisher
+ */
+public class SubmissionPublisherFactory {
+
+ /**
+ * Creates a new SubmissionPublisher using the {@link
+ * ForkJoinPool#commonPool()} for async delivery to subscribers
+ * (unless it does not support a parallelism level of at least two,
+ * in which case, a new Thread is created to run each task), with
+ * maximum buffer capacity of {@link Flow#defaultBufferSize}, and no
+ * handler for Subscriber exceptions in method {@link
+ * Flow.Subscriber#onNext(Object) onNext}.
+ */
+ public static <T> SubmittableFlowPublisher<T> createSubmissionPublisher() {
+ return new SubmissionPublisher<T>();
+ }
+
+ public static <T> SubmittableFlowPublisher<T> createSubmissionPublisher(Executor executor,
+ int maxBufferCapacity) {
+ return new SubmissionPublisher<T>(executor, maxBufferCapacity);
+ }
+
+ public static <T> SubmittableFlowPublisher<T> createSubmissionPublisher(Executor executor,
+ int maxBufferCapacity,
+ BiConsumer<? super Flow.Subscriber<? super T>,
+ ? super Throwable> handler) {
+ return new SubmissionPublisher<T>(executor, maxBufferCapacity, handler);
+ }
+
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/jsr166/UnsafeAccessor.java b/core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/UnsafeAccessor.java
similarity index 93%
rename from core-common/src/main/java/org/glassfish/jersey/internal/jsr166/UnsafeAccessor.java
rename to core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/UnsafeAccessor.java
index c682beb..19f9887 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/jsr166/UnsafeAccessor.java
+++ b/core-common/src/main/java8/org/glassfish/jersey/internal/jsr166/UnsafeAccessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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,7 +24,7 @@
/**
* Helper for classes in the jsr166 package to access the {@code sun.misc.Unsafe} instance.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
class UnsafeAccessor {
static sun.misc.Unsafe getUnsafe() {
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/jsr166/Flow.java b/core-common/src/main/jsr166/org/glassfish/jersey/internal/jsr166/Flow.java
similarity index 98%
rename from core-common/src/main/java/org/glassfish/jersey/internal/jsr166/Flow.java
rename to core-common/src/main/jsr166/org/glassfish/jersey/internal/jsr166/Flow.java
index fe64d88..bcb90c8 100644
--- a/core-common/src/main/java/org/glassfish/jersey/internal/jsr166/Flow.java
+++ b/core-common/src/main/jsr166/org/glassfish/jersey/internal/jsr166/Flow.java
@@ -26,7 +26,7 @@
* {@link Subscription} implementation; constructing one in method
* {@code subscribe} and issuing it to the calling {@link
* Subscriber}. It publishes items to the subscriber asynchronously,
- * normally using an {@link Executor}. For example, here is a very
+ * normally using an {@link java.util.concurrent.Executor}. For example, here is a very
* simple publisher that only issues (when requested) a single {@code
* TRUE} item to a single subscriber. Because the subscriber receives
* only a single item, this class does not use buffering and ordering
diff --git a/core-common/src/main/jsr166/org/glassfish/jersey/internal/jsr166/SubmittableFlowPublisher.java b/core-common/src/main/jsr166/org/glassfish/jersey/internal/jsr166/SubmittableFlowPublisher.java
new file mode 100644
index 0000000..0978463
--- /dev/null
+++ b/core-common/src/main/jsr166/org/glassfish/jersey/internal/jsr166/SubmittableFlowPublisher.java
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2019 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.internal.jsr166;
+
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.function.BiPredicate;
+import java.util.function.Consumer;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ForkJoinPool;
+import java.util.concurrent.RejectedExecutionException;
+
+
+/**
+ * A {@link Flow.Publisher} that asynchronously issues submitted
+ * (non-null) items to current subscribers until it is closed. Each
+ * current subscriber receives newly submitted items in the same order
+ * unless drops or exceptions are encountered. Using a
+ * SubmittableFlowPublisher allows item generators to act as compliant <a
+ * href="http://www.reactive-streams.org/"> reactive-streams</a>
+ * Publishers relying on drop handling and/or blocking for flow
+ * control.
+ * <p>
+ * <p>An implementation of SubmittableFlowPublisher uses the {@link Executor} supplied in its
+ * constructor for delivery to subscribers. The best choice of
+ * Executor depends on expected usage. If the generator(s) of
+ * submitted items run in separate threads, and the number of
+ * subscribers can be estimated, consider using a {@link
+ * Executors#newFixedThreadPool}. Otherwise consider using the
+ * default, normally the {@link ForkJoinPool#commonPool}.
+ * <p>
+ * <p>Buffering allows producers and consumers to transiently operate
+ * at different rates. Each subscriber uses an independent buffer.
+ * Buffers are created upon first use and expanded as needed up to the
+ * given maximum. (The enforced capacity may be rounded up to the
+ * nearest power of two and/or bounded by the largest value supported
+ * by this implementation.) Invocations of {@link
+ * Flow.Subscription#request(long) request} do not directly result in
+ * buffer expansion, but risk saturation if unfilled requests exceed
+ * the maximum capacity. The default value of {@link
+ * Flow#defaultBufferSize()} may provide a useful starting point for
+ * choosing a capacity based on expected rates, resources, and usages.
+ * <p>
+ * <p>Publication methods support different policies about what to do
+ * when buffers are saturated. Method {@link #submit(Object) submit}
+ * blocks until resources are available. This is simplest, but least
+ * responsive. The {@code offer} methods may drop items (either
+ * immediately or with bounded timeout), but provide an opportunity to
+ * interpose a handler and then retry.
+ * <p>
+ * <p>If any Subscriber method throws an exception, its subscription
+ * is cancelled. If a handler is supplied as a constructor argument,
+ * it is invoked before cancellation upon an exception in method
+ * {@link Flow.Subscriber#onNext onNext}, but exceptions in methods
+ * {@link Flow.Subscriber#onSubscribe onSubscribe},
+ * {@link Flow.Subscriber#onError(Throwable) onError} and
+ * {@link Flow.Subscriber#onComplete() onComplete} are not recorded or
+ * handled before cancellation. If the supplied Executor throws
+ * {@link RejectedExecutionException} (or any other RuntimeException
+ * or Error) when attempting to execute a task, or a drop handler
+ * throws an exception when processing a dropped item, then the
+ * exception is rethrown. In these cases, not all subscribers will
+ * have been issued the published item. It is usually good practice to
+ * {@link #closeExceptionally closeExceptionally} in these cases.
+ * <p>
+ * <p>Method {@link #consume(Consumer)} simplifies support for a
+ * common case in which the only action of a subscriber is to request
+ * and process all items using a supplied function.
+ *
+ * @param <T> the published item type
+ */
+public interface SubmittableFlowPublisher<T> extends Flow.Publisher<T>, AutoCloseable {
+
+ /**
+ * Processes all published items using the given Consumer function.
+ * Returns a CompletableFuture that is completed normally when this
+ * publisher signals {@link Flow.Subscriber#onComplete()
+ * onComplete}, or completed exceptionally upon any error, or an
+ * exception is thrown by the Consumer, or the returned
+ * CompletableFuture is cancelled, in which case no further items
+ * are processed.
+ *
+ * @param consumer the function applied to each onNext item
+ * @return a CompletableFuture that is completed normally
+ * when the publisher signals onComplete, and exceptionally
+ * upon any error or cancellation
+ * @throws NullPointerException if consumer is null
+ */
+ CompletableFuture<Void> consume(final Consumer<? super T> consumer);
+
+ /**
+ * Unless already closed, issues {@link
+ * Flow.Subscriber#onComplete() onComplete} signals to current
+ * subscribers, and disallows subsequent attempts to publish.
+ * Upon return, this method does <em>NOT</em> guarantee that all
+ * subscribers have yet completed.
+ */
+ void close();
+
+ /**
+ * Unless already closed, issues {@link
+ * Flow.Subscriber#onError(Throwable) onError} signals to current
+ * subscribers with the given error, and disallows subsequent
+ * attempts to publish. Future subscribers also receive the given
+ * error. Upon return, this method does <em>NOT</em> guarantee
+ * that all subscribers have yet completed.
+ *
+ * @param error the {@code onError} argument sent to subscribers
+ * @throws NullPointerException if error is null
+ */
+ void closeExceptionally(final Throwable error);
+
+ /**
+ * Returns an estimate of the minimum number of items requested
+ * (via {@link Flow.Subscription#request(long) request}) but not
+ * yet produced, among all current subscribers.
+ *
+ * @return the estimate, or zero if no subscribers
+ */
+ long estimateMinimumDemand();
+
+ /**
+ * Returns an estimate of the maximum number of items produced but
+ * not yet consumed among all current subscribers.
+ *
+ * @return the estimate
+ */
+ int estimateMaximumLag();
+
+ /**
+ * Returns the exception associated with {@link
+ * #closeExceptionally(Throwable) closeExceptionally}, or null if
+ * not closed or if closed normally.
+ *
+ * @return the exception, or null if none
+ */
+ Throwable getClosedException();
+
+ /**
+ * Returns the maximum per-subscriber buffer capacity.
+ *
+ * @return the maximum per-subscriber buffer capacity
+ */
+ int getMaxBufferCapacity();
+
+ /**
+ * Publishes the given item, if possible, to each current subscriber
+ * by asynchronously invoking its {@link
+ * Flow.Subscriber#onNext(Object) onNext} method, blocking while
+ * resources for any subscription are unavailable, up to the
+ * specified timeout or until the caller thread is interrupted, at
+ * which point the given handler (if non-null) is invoked, and if it
+ * returns true, retried once. (The drop handler may distinguish
+ * timeouts from interrupts by checking whether the current thread
+ * is interrupted.) Other calls to methods in this class by other
+ * threads are blocked while the handler is invoked. Unless
+ * recovery is assured, options are usually limited to logging the
+ * error and/or issuing an {@link Flow.Subscriber#onError(Throwable)
+ * onError} signal to the subscriber.
+ * <p>
+ * <p>This method returns a status indicator: If negative, it
+ * represents the (negative) number of drops (failed attempts to
+ * issue the item to a subscriber). Otherwise it is an estimate of
+ * the maximum lag (number of items submitted but not yet
+ * consumed) among all current subscribers. This value is at least
+ * one (accounting for this submitted item) if there are any
+ * subscribers, else zero.
+ * <p>
+ * <p>If the Executor for this publisher throws a
+ * RejectedExecutionException (or any other RuntimeException or
+ * Error) when attempting to asynchronously notify subscribers, or
+ * the drop handler throws an exception when processing a dropped
+ * item, then this exception is rethrown.
+ *
+ * @param item the (non-null) item to publish
+ * @param timeout how long to wait for resources for any subscriber
+ * before giving up, in units of {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @param onDrop if non-null, the handler invoked upon a drop to a
+ * subscriber, with arguments of the subscriber and item; if it
+ * returns true, an offer is re-attempted (once)
+ * @return if negative, the (negative) number of drops; otherwise
+ * an estimate of maximum lag
+ * @throws IllegalStateException if closed
+ * @throws NullPointerException if item is null
+ * @throws RejectedExecutionException if thrown by Executor
+ */
+ int offer(T item, long timeout, TimeUnit unit, BiPredicate<Flow.Subscriber<? super T>, ? super T> onDrop);
+
+ /**
+ * Publishes the given item, if possible, to each current subscriber
+ * by asynchronously invoking its {@link
+ * Flow.Subscriber#onNext(Object) onNext} method. The item may be
+ * dropped by one or more subscribers if resource limits are
+ * exceeded, in which case the given handler (if non-null) is
+ * invoked, and if it returns true, retried once. Other calls to
+ * methods in this class by other threads are blocked while the
+ * handler is invoked. Unless recovery is assured, options are
+ * usually limited to logging the error and/or issuing an {@link
+ * Flow.Subscriber#onError(Throwable) onError} signal to the
+ * subscriber.
+ * <p>
+ * <p>This method returns a status indicator: If negative, it
+ * represents the (negative) number of drops (failed attempts to
+ * issue the item to a subscriber). Otherwise it is an estimate of
+ * the maximum lag (number of items submitted but not yet
+ * consumed) among all current subscribers. This value is at least
+ * one (accounting for this submitted item) if there are any
+ * subscribers, else zero.
+ * <p>
+ * <p>If the Executor for this publisher throws a
+ * RejectedExecutionException (or any other RuntimeException or
+ * Error) when attempting to asynchronously notify subscribers, or
+ * the drop handler throws an exception when processing a dropped
+ * item, then this exception is rethrown.
+ *
+ * @param item the (non-null) item to publish
+ * @param onDrop if non-null, the handler invoked upon a drop to a
+ * subscriber, with arguments of the subscriber and item; if it
+ * returns true, an offer is re-attempted (once)
+ * @return if negative, the (negative) number of drops; otherwise
+ * an estimate of maximum lag
+ * @throws IllegalStateException if closed
+ * @throws NullPointerException if item is null
+ * @throws RejectedExecutionException if thrown by Executor
+ */
+ int offer(T item, BiPredicate<Flow.Subscriber<? super T>, ? super T> onDrop);
+
+ /**
+ * Publishes the given item to each current subscriber by
+ * asynchronously invoking its {@link Flow.Subscriber#onNext(Object)
+ * onNext} method, blocking uninterruptibly while resources for any
+ * subscriber are unavailable. This method returns an estimate of
+ * the maximum lag (number of items submitted but not yet consumed)
+ * among all current subscribers. This value is at least one
+ * (accounting for this submitted item) if there are any
+ * subscribers, else zero.
+ * <p>
+ * <p>If the Executor for this publisher throws a
+ * RejectedExecutionException (or any other RuntimeException or
+ * Error) when attempting to asynchronously notify subscribers,
+ * then this exception is rethrown, in which case not all
+ * subscribers will have been issued this item.
+ *
+ * @param item the (non-null) item to publish
+ * @return the estimated maximum lag among subscribers
+ * @throws IllegalStateException if closed
+ * @throws NullPointerException if item is null
+ * @throws RejectedExecutionException if thrown by Executor
+ */
+ int submit(T item);
+
+ /**
+ * Adds the given Subscriber unless already subscribed. If already
+ * subscribed, the Subscriber's {@link
+ * Flow.Subscriber#onError(Throwable) onError} method is invoked on
+ * the existing subscription with an {@link IllegalStateException}.
+ * Otherwise, upon success, the Subscriber's {@link
+ * Flow.Subscriber#onSubscribe onSubscribe} method is invoked
+ * asynchronously with a new {@link Flow.Subscription}. If {@link
+ * Flow.Subscriber#onSubscribe onSubscribe} throws an exception, the
+ * subscription is cancelled. Otherwise, if this SubmittableFlowPublisher
+ * was closed exceptionally, then the subscriber's {@link
+ * Flow.Subscriber#onError onError} method is invoked with the
+ * corresponding exception, or if closed without exception, the
+ * subscriber's {@link Flow.Subscriber#onComplete() onComplete}
+ * method is invoked. Subscribers may enable receiving items by
+ * invoking the {@link Flow.Subscription#request(long) request}
+ * method of the new Subscription, and may unsubscribe by invoking
+ * its {@link Flow.Subscription#cancel() cancel} method.
+ *
+ * @param subscriber the subscriber
+ * @throws NullPointerException if subscriber is null
+ */
+ void subscribe(Flow.Subscriber<? super T> subscriber);
+}
diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/jsr166/package-info.java b/core-common/src/main/jsr166/org/glassfish/jersey/internal/jsr166/package-info.java
similarity index 100%
rename from core-common/src/main/java/org/glassfish/jersey/internal/jsr166/package-info.java
rename to core-common/src/main/jsr166/org/glassfish/jersey/internal/jsr166/package-info.java
diff --git a/core-common/src/main/resources/META-INF/services/org.glassfish.jersey.internal.spi.AutoDiscoverable b/core-common/src/main/resources/META-INF/services/org.glassfish.jersey.internal.spi.AutoDiscoverable
index 371b37b..abc1825 100644
--- a/core-common/src/main/resources/META-INF/services/org.glassfish.jersey.internal.spi.AutoDiscoverable
+++ b/core-common/src/main/resources/META-INF/services/org.glassfish.jersey.internal.spi.AutoDiscoverable
@@ -1 +1,2 @@
-org.glassfish.jersey.logging.LoggingFeatureAutoDiscoverable
\ No newline at end of file
+org.glassfish.jersey.logging.LoggingFeatureAutoDiscoverable
+org.glassfish.jersey.internal.config.ExternalPropertiesAutoDiscoverable
\ No newline at end of file
diff --git a/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties b/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties
index 791997d..6b56cf5 100644
--- a/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties
+++ b/core-common/src/main/resources/org/glassfish/jersey/internal/localization.properties
@@ -1,5 +1,6 @@
#
-# Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2018 Payara Foundation and/or its affiliates.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
@@ -47,6 +48,7 @@
error.newcookie.expires=NewCookie Expires header value ({0}) cannot be read.
error.notfound.messagebodywriter=MessageBodyWriter not found for media type={0}, type={1}, genericType={2}.
error.notfound.messagebodyreader=MessageBodyReader not found for media type={0}, type={1}, genericType={2}.
+error.parameter.invalid.char.value=Value "{0}" is not a character.
error.parsing.entity.tag=Error parsing entity tag: {0}
error.provider.constrainedTo.wrong.package=A registered provider {0} is constrained (via @ConstrainedTo) to {1} runtime but does not implement any provider interface usable in the runtime.
error.provider.constrainedTo.wrong.runtime=A provider {0} registered in {2} runtime is constrained (via @ConstrainedTo) to {1} runtime.
@@ -70,6 +72,7 @@
exception.caught.while.loading.spi.providers=Exception caught while loading SPI providers.
exception.mapper.supported.type.unknown=Unable to retrieve the supported exception type for a registered exception mapper service class "{0}".
feature.has.already.been.processed=Feature [{0}] has already been processed.
+feature.constrainedTo.ignored=Feature {0} registered in {2} runtime is constrained to {1} runtime and is ignored.
hint.msg=HINT: {0}
hints.detected=The following hints have been detected: {0}
http.header.comments.not.allowed=Comments are not allowed.
@@ -107,6 +110,7 @@
message.content.input.stream.close.failed=Error closing message content input stream.
message.content.buffer.reset.failed=Error resetting the buffered message content input stream.
method.not.getter.nor.setter=Method is neither getter nor setter.
+method.parameter.cannot.be.null=Method parameter "{0}" cannot be null.
multiple.matching.constructors.found=Found {0} constructors with {1} parameters in {2} class. Selecting the first found constructor: {3}
new.cookie.is.null=New cookie is null.
no.container.available=No container available.
@@ -116,6 +120,7 @@
osgi.registry.error.processing.resource.stream=Unexpected error occurred while processing resource stream {0}.
output.stream.closed=The output stream has already been closed.
overriding.method.cannot.be.found=Method that overrides {0} cannot be found on class {1}.
+param.creation.factory.not.found=No ParamCreationFactory found for Parameter source {0}.
param.null="{0}" parameter is null.
# {0} - value to string; {1} - type of value; {2} - desired value type/class
properties.helper.get.value.no.transform=There is no way how to transform value "{0}" [{1}] to type [{2}].
@@ -188,3 +193,5 @@
warning.provider.constrainedTo.wrong.package=A registered provider {0} constrained (via @ConstrainedTo) to {1} runtime implements interface {2} which is only usable in a {3} runtime context.
# {0} - List of arbitrary localized messages, e.g.: [FATAL] <localized_message>; source=<object>
warnings.detected=The following warnings have been detected: {0}
+warning.properties=System properties configuration provider not allowed
+system.properties.warning=Could not read system properties
diff --git a/core-common/src/test/java/org/glassfish/jersey/SecurityManagerConfiguredTest.java b/core-common/src/test/java/org/glassfish/jersey/SecurityManagerConfiguredTest.java
index b08d014..cfae326 100644
--- a/core-common/src/test/java/org/glassfish/jersey/SecurityManagerConfiguredTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/SecurityManagerConfiguredTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
/**
* Test that verifies that security manager is setup to run the Jersey core server unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class SecurityManagerConfiguredTest {
/**
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/TestRuntimeDelegate.java b/core-common/src/test/java/org/glassfish/jersey/internal/TestRuntimeDelegate.java
index 7808866..de8a25e 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/TestRuntimeDelegate.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/TestRuntimeDelegate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -36,7 +36,7 @@
/**
* Test runtime delegate.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TestRuntimeDelegate extends AbstractRuntimeDelegate {
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactoryTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactoryTest.java
new file mode 100644
index 0000000..d0df568
--- /dev/null
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactoryTest.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2019 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.internal.config;
+
+import org.glassfish.jersey.CommonProperties;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.glassfish.jersey.internal.config.ExternalPropertiesConfigurationFactory.getConfig;
+import static org.glassfish.jersey.internal.config.ExternalPropertiesConfigurationFactory.readExternalPropertiesMap;
+
+public class ExternalPropertiesConfigurationFactoryTest {
+
+ /**
+ * Predefine some properties to be read from config
+ */
+ @BeforeClass
+ public static void setUp() {
+ System.setProperty(CommonProperties.ALLOW_SYSTEM_PROPERTIES_PROVIDER, Boolean.TRUE.toString());
+
+ System.setProperty("jersey.config.server.provider.scanning.recursive", "PASSED");
+ System.setProperty(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, "1");
+ System.setProperty("jersey.config.client.readTimeout", "10");
+ }
+
+ @AfterClass
+ public static void tearDown() {
+ System.clearProperty("jersey.config.server.provider.scanning.recursive");
+ System.clearProperty(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE);
+ System.clearProperty("jersey.config.client.readTimeout");
+ }
+
+ @Test
+ public void readSystemPropertiesTest() {
+ final Object result =
+ readExternalPropertiesMap().get("jersey.config.server.provider.scanning.recursive");
+ Assert.assertNull(result);
+ Assert.assertEquals(Boolean.TRUE,
+ getConfig().as(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, Boolean.class));
+ Assert.assertEquals(Boolean.FALSE,
+ getConfig().as("jersey.config.client.readTimeout", Boolean.class));
+ Assert.assertEquals(1,
+ getConfig().as(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, Integer.class));
+ Assert.assertEquals(10,
+ getConfig().as("jersey.config.client.readTimeout", Integer.class));
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void unsupportedMapperTest() {
+ getConfig().as(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, Double.class);
+ }
+
+ @Test
+ public void mergePropertiesTest() {
+ final Map<String, Object> inputProperties = new HashMap<>();
+ inputProperties.put("jersey.config.server.provider.scanning.recursive", "MODIFIED");
+ inputProperties.put("org.jersey.microprofile.config.added", "ADDED");
+ getConfig().mergeProperties(inputProperties);
+ final Object result = readExternalPropertiesMap().get("jersey.config.server.provider.scanning.recursive");
+ Assert.assertNull(result);
+ Assert.assertNull(readExternalPropertiesMap().get("org.jersey.microprofile.config.added"));
+ }
+
+}
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/inject/ProvidersTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/inject/ProvidersTest.java
index 919b1ed..dc15766 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/inject/ProvidersTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/inject/ProvidersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -35,7 +35,7 @@
* Tests {@link Providers}.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ProvidersTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/routing/CombinedMediaTypeTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/routing/CombinedMediaTypeTest.java
similarity index 97%
rename from core-server/src/test/java/org/glassfish/jersey/server/internal/routing/CombinedMediaTypeTest.java
rename to core-common/src/test/java/org/glassfish/jersey/internal/routing/CombinedMediaTypeTest.java
index 273fdee..f4414f5 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/routing/CombinedMediaTypeTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/routing/CombinedMediaTypeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package org.glassfish.jersey.server.internal.routing;
+package org.glassfish.jersey.internal.routing;
import java.util.ArrayList;
import java.util.Arrays;
@@ -33,7 +33,7 @@
* Combined media type tests.
*
* @author Jakub Podlesak
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CombinedMediaTypeTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/sonar/SonarJerseyCommonTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/sonar/SonarJerseyCommonTest.java
index b35a505..06a97ad 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/sonar/SonarJerseyCommonTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/sonar/SonarJerseyCommonTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +20,7 @@
import org.junit.Test;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class SonarJerseyCommonTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/JdkVersionCompareTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/JdkVersionCompareTest.java
new file mode 100644
index 0000000..62c1021
--- /dev/null
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/JdkVersionCompareTest.java
@@ -0,0 +1,35 @@
+package org.glassfish.jersey.internal.util;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class JdkVersionCompareTest {
+
+ @Test
+ public void testCompareJava8WithJava9() {
+ JdkVersion java8 = JdkVersion.parseVersion("1.8.0_141");
+ JdkVersion java9 = JdkVersion.parseVersion("9");
+
+ assertEquals(1, java9.compareTo(java8));
+ assertEquals(-1, java8.compareTo(java9));
+ }
+
+ @Test
+ public void testCompareJava8Updates() {
+ JdkVersion java8u141 = JdkVersion.parseVersion("1.8.0_141");
+ JdkVersion java8u152 = JdkVersion.parseVersion("1.8.0_152");
+
+ assertEquals(1, java8u152.compareTo(java8u141));
+ assertEquals(-1, java8u141.compareTo(java8u152));
+ }
+
+ @Test
+ public void testCompareJava9Versions() {
+ JdkVersion java900 = JdkVersion.parseVersion("9.0.0");
+ JdkVersion java901 = JdkVersion.parseVersion("9.0.1");
+
+ assertEquals(1, java901.compareTo(java900));
+ assertEquals(-1, java900.compareTo(java901));
+ }
+}
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/JdkVersionParseTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/JdkVersionParseTest.java
new file mode 100644
index 0000000..fc14fbb
--- /dev/null
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/JdkVersionParseTest.java
@@ -0,0 +1,52 @@
+package org.glassfish.jersey.internal.util;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+@RunWith(Parameterized.class)
+public class JdkVersionParseTest {
+
+ @Parameterized.Parameter
+ public String rawVersionString;
+ @Parameterized.Parameter(1)
+ public int expectedMajorVersion;
+ @Parameterized.Parameter(2)
+ public int expectedMinorVersion;
+ @Parameterized.Parameter(3)
+ public int expectedMaintenanceVersion;
+ @Parameterized.Parameter(4)
+ public int expectedUpdateVersion;
+
+ @Parameterized.Parameters
+ public static Collection<Object[]> provideVersions() {
+ return Arrays.asList(new Object[][]{
+ // Java 8
+ {"1.8.0_141-b15", 1, 8, 0, 141},
+ {"1.8.0_141", 1, 8, 0, 141},
+
+ // Java 9 and above
+ {"9", 9, 0, 0, 0},
+ {"9.0.3", 9, 0, 3, 0},
+ {"11", 11, 0, 0, 0},
+
+ // malformed version
+ {"invalid version", -1, -1, -1, -1}
+ });
+ }
+
+ @Test
+ public void testParseVersion() {
+ JdkVersion version = JdkVersion.parseVersion(rawVersionString);
+
+ assertEquals(expectedMajorVersion, version.getMajor());
+ assertEquals(expectedMinorVersion, version.getMinor());
+ assertEquals(expectedMaintenanceVersion, version.getMaintenance());
+ assertEquals(expectedUpdateVersion, version.getUpdate());
+ }
+}
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/JerseyPublisherTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/JerseyPublisherTest.java
index 6ae6280..e830445 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/util/JerseyPublisherTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/JerseyPublisherTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -36,7 +36,7 @@
/**
* Test Jersey {@link Flow.Publisher} implementation, {@link JerseyPublisher}.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class JerseyPublisherTest {
@@ -111,11 +111,13 @@
@Test
public void testNonBlocking() throws InterruptedException {
final int MSG_COUNT = 300;
+ final int DATA_COUNT = Flow.defaultBufferSize() + 2;
+ final int WAIT_TIME = 20 * DATA_COUNT;
final JerseyPublisher<String> publisher = new JerseyPublisher<>();
final CountDownLatch openLatchActive = new CountDownLatch(1);
- final CountDownLatch writeLatch = new CountDownLatch(MSG_COUNT);
+ final CountDownLatch writeLatch = new CountDownLatch(DATA_COUNT);
final CountDownLatch closeLatch = new CountDownLatch(1);
final CountDownLatch openLatchDead = new CountDownLatch(1);
@@ -147,9 +149,10 @@
publisher.publish("MSG-" + i);
}, 0, 10, TimeUnit.MILLISECONDS);
- assertTrue(writeLatch.await(6000, TimeUnit.MILLISECONDS));
+ writeLatch.await(WAIT_TIME, TimeUnit.MILLISECONDS);
+ assertTrue(writeLatch.getCount() <= 1);
- assertEquals(MSG_COUNT, activeSubscriber.getReceivedData().size());
+ assertTrue(DATA_COUNT - activeSubscriber.getReceivedData().size() <= 1);
assertEquals(0, deadSubscriber.getReceivedData().size());
assertFalse(activeSubscriber.hasError());
@@ -157,7 +160,7 @@
publisher.close();
- assertTrue(closeLatch.await(6000, TimeUnit.MILLISECONDS));
+ assertTrue(closeLatch.await(WAIT_TIME, TimeUnit.MILLISECONDS));
assertTrue(activeSubscriber.isCompleted());
assertFalse(deadSubscriber.isCompleted());
}
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/OsgiRegistryTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/OsgiRegistryTest.java
index a66cb6e..fe3de0c 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/util/OsgiRegistryTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/OsgiRegistryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Utility class {@ling OsgiRegistry} tests.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class OsgiRegistryTest {
@@ -113,6 +113,12 @@
}
@Test
+ public void testDotClassInPackageName() {
+ String className = OsgiRegistry.bundleEntryPathToClassName("/", "com/classification/Test");
+ Assert.assertEquals("com.classification.Test", className);
+ }
+
+ @Test
public void testRootWebInfClassesBundleEntryPathEsTranslation() {
String className = OsgiRegistry.bundleEntryPathToClassName("es", "/WEB-INF/classes/es/a/Test.class");
Assert.assertEquals("es.a.Test", className);
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/ReflectionHelperTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/ReflectionHelperTest.java
index 6b358ee..edeef20 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/util/ReflectionHelperTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/ReflectionHelperTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
/**
* {@code ReflectionHelper} unit tests.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class ReflectionHelperTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/TokenizerTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/TokenizerTest.java
index b4746b4..02ba36a 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/util/TokenizerTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/TokenizerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
/**
* Tokenizer utility unit test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TokenizerTest {
@Test
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/collection/ByteBufferInputStreamTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/collection/ByteBufferInputStreamTest.java
index 5d5bc28..b5fbeba 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/util/collection/ByteBufferInputStreamTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/collection/ByteBufferInputStreamTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
/**
* {@link ByteBufferInputStream} unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ByteBufferInputStreamTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/collection/ViewsTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/collection/ViewsTest.java
index 1cd4e54..11bb457 100644
--- a/core-common/src/test/java/org/glassfish/jersey/internal/util/collection/ViewsTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/collection/ViewsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -30,7 +30,7 @@
import static org.junit.Assert.fail;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ViewsTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/logging/LoggingInterceptorTest.java b/core-common/src/test/java/org/glassfish/jersey/logging/LoggingInterceptorTest.java
index 59f2755..e4e5e91 100644
--- a/core-common/src/test/java/org/glassfish/jersey/logging/LoggingInterceptorTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/logging/LoggingInterceptorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -29,7 +29,7 @@
import static javax.ws.rs.core.MediaType.TEXT_HTML_TYPE;
/**
- * @author Ondrej Kosatka (ondrej.kosatka at oracle.com)
+ * @author Ondrej Kosatka
*/
public class LoggingInterceptorTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/message/internal/DateProviderTest.java b/core-common/src/test/java/org/glassfish/jersey/message/internal/DateProviderTest.java
index 607ca9a..9c5a132 100644
--- a/core-common/src/test/java/org/glassfish/jersey/message/internal/DateProviderTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/message/internal/DateProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class DateProviderTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/message/internal/QualityTest.java b/core-common/src/test/java/org/glassfish/jersey/message/internal/QualityTest.java
index d67b86d..1856c92 100644
--- a/core-common/src/test/java/org/glassfish/jersey/message/internal/QualityTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/message/internal/QualityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -33,7 +33,7 @@
/**
* Quality unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@RunWith(Parameterized.class)
public class QualityTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/message/internal/VariantListBuilderTest.java b/core-common/src/test/java/org/glassfish/jersey/message/internal/VariantListBuilderTest.java
index 175f28a..06032e9 100644
--- a/core-common/src/test/java/org/glassfish/jersey/message/internal/VariantListBuilderTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/message/internal/VariantListBuilderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -29,7 +29,7 @@
/**
* TODO: javadoc.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class VariantListBuilderTest {
@Test
diff --git a/core-common/src/test/java/org/glassfish/jersey/uri/PathPatternTest.java b/core-common/src/test/java/org/glassfish/jersey/uri/PathPatternTest.java
index 06b66e3..e876ae2 100644
--- a/core-common/src/test/java/org/glassfish/jersey/uri/PathPatternTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/uri/PathPatternTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -27,7 +27,7 @@
/**
* Tests {@link PathTemplate}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Gerard Davison (gerard.davison at oracle.com)
*/
public class PathPatternTest {
diff --git a/core-common/src/test/java/org/glassfish/jersey/uri/UriComponentTest.java b/core-common/src/test/java/org/glassfish/jersey/uri/UriComponentTest.java
index 767e3ec..8e26e49 100644
--- a/core-common/src/test/java/org/glassfish/jersey/uri/UriComponentTest.java
+++ b/core-common/src/test/java/org/glassfish/jersey/uri/UriComponentTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -35,7 +35,7 @@
* <li>{@code com.sun.jersey.impl.uri.riComponentValidateTest}</li>
* </ul>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UriComponentTest {
diff --git a/core-common/src/test/resources/surefire.policy b/core-common/src/test/resources/surefire.policy
index f181fe4..77fa02a 100644
--- a/core-common/src/test/resources/surefire.policy
+++ b/core-common/src/test/resources/surefire.policy
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -47,3 +47,12 @@
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc.*";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};
+
+// JDK 11 permissions
+grant {
+ permission com.sun.tools.attach.AttachPermission "createAttachProvider";
+ permission com.sun.tools.attach.AttachPermission "attachVirtualMachine";
+ permission java.lang.RuntimePermission "loadLibrary.attach";
+ permission java.lang.RuntimePermission "manageProcess";
+ permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc";
+};
diff --git a/core-server/pom.xml b/core-server/pom.xml
index 3069a25..78c0569 100644
--- a/core-server/pom.xml
+++ b/core-server/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.core</groupId>
@@ -94,7 +94,7 @@
com.sun.research.ws.wadl.*;version=${project.version}
</Export-Package>
<Import-Package>
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
javax.validation.*;resolution:=optional;version="${range;[==,3);${javax.validation.api.version}}",
*
</Import-Package>
@@ -189,8 +189,8 @@
</dependency>
<dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
@@ -200,11 +200,6 @@
</dependency>
<dependency>
- <groupId>org.jmockit</groupId>
- <artifactId>jmockit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -232,6 +227,23 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>securityOff</id>
<properties>
<surefire.security.argline />
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 83a1c97..545b79f 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
@@ -1,169 +1,145 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A visitor to visit a Java annotation. The methods of this class must be
- * called in the following order: ( <tt>visit</tt> | <tt>visitEnum</tt> |
- * <tt>visitAnnotation</tt> | <tt>visitArray</tt> )* <tt>visitEnd</tt>.
+ * A visitor to visit a Java annotation. The methods of this class must be called in the following
+ * order: ( {@code visit} | {@code visitEnum} | {@code visitAnnotation} | {@code visitArray} )*
+ * {@code visitEnd}.
*
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
public abstract class AnnotationVisitor {
- /**
- * The ASM API version implemented by this visitor. The value of this field
- * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- */
- protected final int api;
+ /**
+ * 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}.
+ */
+ protected final int api;
- /**
- * The annotation visitor to which this visitor must delegate method calls.
- * May be null.
- */
- protected AnnotationVisitor av;
+ /** The annotation visitor to which this visitor must delegate method calls. May be null. */
+ protected AnnotationVisitor av;
- /**
- * Constructs a new {@link AnnotationVisitor}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- */
- public 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}.
+ */
+ public 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 annotationVisitor the annotation visitor to which this visitor must delegate method
+ * calls. May be null.
+ */
+ public AnnotationVisitor(final int api, final AnnotationVisitor annotationVisitor) {
+ if (api != Opcodes.ASM7 && api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4) {
+ throw new IllegalArgumentException("Unsupported api " + api);
}
+ this.api = api;
+ this.av = annotationVisitor;
+ }
- /**
- * Constructs a new {@link AnnotationVisitor}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- * @param av
- * the annotation visitor to which this visitor must delegate
- * method calls. May be null.
- */
- public AnnotationVisitor(final int api, final AnnotationVisitor av) {
- if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
- throw new IllegalArgumentException();
- }
- this.api = api;
- this.av = av;
+ /**
+ * Visits a primitive value of the annotation.
+ *
+ * @param name the value name.
+ * @param value the actual value, whose type must be {@link Byte}, {@link Boolean}, {@link
+ * Character}, {@link Short}, {@link Integer} , {@link Long}, {@link Float}, {@link Double},
+ * {@link String} or {@link Type} of {@link Type#OBJECT} or {@link Type#ARRAY} sort. This
+ * value can also be an array of byte, boolean, short, char, int, long, float or double values
+ * (this is equivalent to using {@link #visitArray} and visiting each array element in turn,
+ * but is more convenient).
+ */
+ public void visit(final String name, final Object value) {
+ if (av != null) {
+ av.visit(name, value);
}
+ }
- /**
- * Visits a primitive value of the annotation.
- *
- * @param name
- * the value name.
- * @param value
- * the actual value, whose type must be {@link Byte},
- * {@link Boolean}, {@link Character}, {@link Short},
- * {@link Integer} , {@link Long}, {@link Float}, {@link Double},
- * {@link String} or {@link Type} or OBJECT or ARRAY sort. This
- * value can also be an array of byte, boolean, short, char, int,
- * long, float or double values (this is equivalent to using
- * {@link #visitArray visitArray} and visiting each array element
- * in turn, but is more convenient).
- */
- public void visit(String name, Object value) {
- if (av != null) {
- av.visit(name, value);
- }
+ /**
+ * Visits an enumeration value of the annotation.
+ *
+ * @param name the value name.
+ * @param descriptor the class descriptor of the enumeration class.
+ * @param value the actual enumeration value.
+ */
+ public void visitEnum(final String name, final String descriptor, final String value) {
+ if (av != null) {
+ av.visitEnum(name, descriptor, value);
}
+ }
- /**
- * Visits an enumeration value of the annotation.
- *
- * @param name
- * the value name.
- * @param desc
- * the class descriptor of the enumeration class.
- * @param value
- * the actual enumeration value.
- */
- public void visitEnum(String name, String desc, String value) {
- if (av != null) {
- av.visitEnum(name, desc, value);
- }
+ /**
+ * Visits a nested annotation value of the annotation.
+ *
+ * @param name the value name.
+ * @param descriptor the class descriptor of the nested annotation class.
+ * @return a visitor to visit the actual nested annotation value, or {@literal null} if this
+ * visitor is not interested in visiting this nested annotation. <i>The nested annotation
+ * value must be fully visited before calling other methods on this annotation visitor</i>.
+ */
+ public AnnotationVisitor visitAnnotation(final String name, final String descriptor) {
+ if (av != null) {
+ return av.visitAnnotation(name, descriptor);
}
+ return null;
+ }
- /**
- * Visits a nested annotation value of the annotation.
- *
- * @param name
- * the value name.
- * @param desc
- * the class descriptor of the nested annotation class.
- * @return a visitor to visit the actual nested annotation value, or
- * <tt>null</tt> if this visitor is not interested in visiting this
- * nested annotation. <i>The nested annotation value must be fully
- * visited before calling other methods on this annotation
- * visitor</i>.
- */
- public AnnotationVisitor visitAnnotation(String name, String desc) {
- if (av != null) {
- return av.visitAnnotation(name, desc);
- }
- return null;
+ /**
+ * Visits an array value of the annotation. Note that arrays of primitive types (such as byte,
+ * boolean, short, char, int, long, float or double) can be passed as value to {@link #visit
+ * visit}. This is what {@link ClassReader} does.
+ *
+ * @param name the value name.
+ * @return a visitor to visit the actual array value elements, or {@literal null} if this visitor
+ * is not interested in visiting these values. The 'name' parameters passed to the methods of
+ * this visitor are ignored. <i>All the array values must be visited before calling other
+ * methods on this annotation visitor</i>.
+ */
+ public AnnotationVisitor visitArray(final String name) {
+ if (av != null) {
+ return av.visitArray(name);
}
+ return null;
+ }
- /**
- * Visits an array value of the annotation. Note that arrays of primitive
- * types (such as byte, boolean, short, char, int, long, float or double)
- * can be passed as value to {@link #visit visit}. This is what
- * {@link ClassReader} does.
- *
- * @param name
- * the value name.
- * @return a visitor to visit the actual array value elements, or
- * <tt>null</tt> if this visitor is not interested in visiting these
- * values. The 'name' parameters passed to the methods of this
- * visitor are ignored. <i>All the array values must be visited
- * before calling other methods on this annotation visitor</i>.
- */
- public AnnotationVisitor visitArray(String name) {
- if (av != null) {
- return av.visitArray(name);
- }
- return null;
+ /** Visits the end of the annotation. */
+ public void visitEnd() {
+ if (av != null) {
+ av.visitEnd();
}
-
- /**
- * Visits the end of the annotation.
- */
- public void visitEnd() {
- if (av != null) {
- av.visitEnd();
- }
- }
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationWriter.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationWriter.java
index 17f38c5..2cf9f0f 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationWriter.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationWriter.java
@@ -1,371 +1,551 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * An {@link AnnotationVisitor} that generates annotations in bytecode form.
+ * An {@link AnnotationVisitor} that generates a corresponding 'annotation' or 'type_annotation'
+ * structure, as defined in the Java Virtual Machine Specification (JVMS). AnnotationWriter
+ * instances can be chained in a doubly linked list, from which Runtime[In]Visible[Type]Annotations
+ * attributes can be generated with the {@link #putAnnotations} method. Similarly, arrays of such
+ * lists can be used to generate Runtime[In]VisibleParameterAnnotations attributes.
*
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16">JVMS
+ * 4.7.16</a>
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20">JVMS
+ * 4.7.20</a>
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
final class AnnotationWriter extends AnnotationVisitor {
- /**
- * The class writer to which this annotation must be added.
- */
- private final ClassWriter cw;
+ /** Where the constants used in this AnnotationWriter must be stored. */
+ private final SymbolTable symbolTable;
- /**
- * The number of values in this annotation.
- */
- private int size;
+ /**
+ * Whether values are named or not. AnnotationWriter instances used for annotation default and
+ * annotation arrays use unnamed values (i.e. they generate an 'element_value' structure for each
+ * value, instead of an element_name_index followed by an element_value).
+ */
+ private final boolean useNamedValues;
- /**
- * <tt>true<tt> if values are named, <tt>false</tt> otherwise. Annotation
- * writers used for annotation default and annotation arrays use unnamed
- * values.
- */
- private final boolean named;
+ /**
+ * The 'annotation' or 'type_annotation' JVMS structure corresponding to the annotation values
+ * visited so far. All the fields of these structures, except the last one - the
+ * element_value_pairs array, must be set before this ByteVector is passed to the constructor
+ * (num_element_value_pairs can be set to 0, it is reset to the correct value in {@link
+ * #visitEnd()}). The element_value_pairs array is filled incrementally in the various visit()
+ * methods.
+ *
+ * <p>Note: as an exception to the above rules, for AnnotationDefault attributes (which contain a
+ * single element_value by definition), this ByteVector is initially empty when passed to the
+ * constructor, and {@link #numElementValuePairsOffset} is set to -1.
+ */
+ private final ByteVector annotation;
- /**
- * The annotation values in bytecode form. This byte vector only contains
- * the values themselves, i.e. the number of values must be stored as a
- * unsigned short just before these bytes.
- */
- private final ByteVector bv;
+ /**
+ * The offset in {@link #annotation} where {@link #numElementValuePairs} must be stored (or -1 for
+ * the case of AnnotationDefault attributes).
+ */
+ private final int numElementValuePairsOffset;
- /**
- * The byte vector to be used to store the number of values of this
- * annotation. See {@link #bv}.
- */
- private final ByteVector parent;
+ /** The number of element value pairs visited so far. */
+ private int numElementValuePairs;
- /**
- * Where the number of values of this annotation must be stored in
- * {@link #parent}.
- */
- private final int offset;
+ /**
+ * The previous AnnotationWriter. This field is used to store the list of annotations of a
+ * Runtime[In]Visible[Type]Annotations attribute. It is unused for nested or array annotations
+ * (annotation values of annotation type), or for AnnotationDefault attributes.
+ */
+ private final AnnotationWriter previousAnnotation;
- /**
- * Next annotation writer. This field is used to store annotation lists.
- */
- AnnotationWriter next;
+ /**
+ * The next AnnotationWriter. This field is used to store the list of annotations of a
+ * Runtime[In]Visible[Type]Annotations attribute. It is unused for nested or array annotations
+ * (annotation values of annotation type), or for AnnotationDefault attributes.
+ */
+ private AnnotationWriter nextAnnotation;
- /**
- * Previous annotation writer. This field is used to store annotation lists.
- */
- AnnotationWriter prev;
+ // -----------------------------------------------------------------------------------------------
+ // Constructors and factories
+ // -----------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
-
- /**
- * Constructs a new {@link AnnotationWriter}.
- *
- * @param cw
- * the class writer to which this annotation must be added.
- * @param named
- * <tt>true<tt> if values are named, <tt>false</tt> otherwise.
- * @param bv
- * where the annotation values must be stored.
- * @param parent
- * where the number of annotation values must be stored.
- * @param offset
- * where in <tt>parent</tt> the number of annotation values must
- * be stored.
- */
- AnnotationWriter(final ClassWriter cw, final boolean named,
- final ByteVector bv, final ByteVector parent, final int offset) {
- super(Opcodes.ASM5);
- this.cw = cw;
- this.named = named;
- this.bv = bv;
- this.parent = parent;
- this.offset = offset;
+ /**
+ * Constructs a new {@link AnnotationWriter}.
+ *
+ * @param symbolTable where the constants used in this AnnotationWriter must be stored.
+ * @param useNamedValues whether values are named or not. AnnotationDefault and annotation arrays
+ * use unnamed values.
+ * @param annotation where the 'annotation' or 'type_annotation' JVMS structure corresponding to
+ * the visited content must be stored. This ByteVector must already contain all the fields of
+ * the structure except the last one (the element_value_pairs array).
+ * @param previousAnnotation the previously visited annotation of the
+ * Runtime[In]Visible[Type]Annotations attribute to which this annotation belongs, or null in
+ * other cases (e.g. nested or array annotations).
+ */
+ AnnotationWriter(
+ final SymbolTable symbolTable,
+ final boolean useNamedValues,
+ final ByteVector annotation,
+ final AnnotationWriter previousAnnotation) {
+ super(Opcodes.ASM7);
+ this.symbolTable = symbolTable;
+ this.useNamedValues = useNamedValues;
+ this.annotation = annotation;
+ // By hypothesis, num_element_value_pairs is stored in the last unsigned short of 'annotation'.
+ this.numElementValuePairsOffset = annotation.length == 0 ? -1 : annotation.length - 2;
+ this.previousAnnotation = previousAnnotation;
+ if (previousAnnotation != null) {
+ previousAnnotation.nextAnnotation = this;
}
+ }
- // ------------------------------------------------------------------------
- // Implementation of the AnnotationVisitor abstract class
- // ------------------------------------------------------------------------
+ /**
+ * Creates a new {@link AnnotationWriter} using named values.
+ *
+ * @param symbolTable where the constants used in this AnnotationWriter must be stored.
+ * @param descriptor the class descriptor of the annotation class.
+ * @param previousAnnotation the previously visited annotation of the
+ * Runtime[In]Visible[Type]Annotations attribute to which this annotation belongs, or null in
+ * other cases (e.g. nested or array annotations).
+ */
+ static AnnotationWriter create(
+ final SymbolTable symbolTable,
+ final String descriptor,
+ final AnnotationWriter previousAnnotation) {
+ // Create a ByteVector to hold an 'annotation' JVMS structure.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16.
+ ByteVector annotation = new ByteVector();
+ // Write type_index and reserve space for num_element_value_pairs.
+ annotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0);
+ return new AnnotationWriter(
+ symbolTable, /* useNamedValues = */ true, annotation, previousAnnotation);
+ }
- @Override
- public void visit(final String name, final Object value) {
- ++size;
- if (named) {
- bv.putShort(cw.newUTF8(name));
- }
- if (value instanceof String) {
- bv.put12('s', cw.newUTF8((String) value));
- } else if (value instanceof Byte) {
- bv.put12('B', cw.newInteger(((Byte) value).byteValue()).index);
- } else if (value instanceof Boolean) {
- int v = ((Boolean) value).booleanValue() ? 1 : 0;
- bv.put12('Z', cw.newInteger(v).index);
- } else if (value instanceof Character) {
- bv.put12('C', cw.newInteger(((Character) value).charValue()).index);
- } else if (value instanceof Short) {
- bv.put12('S', cw.newInteger(((Short) value).shortValue()).index);
- } else if (value instanceof Type) {
- bv.put12('c', cw.newUTF8(((Type) value).getDescriptor()));
- } else if (value instanceof byte[]) {
- byte[] v = (byte[]) value;
- bv.put12('[', v.length);
- for (int i = 0; i < v.length; i++) {
- bv.put12('B', cw.newInteger(v[i]).index);
- }
- } else if (value instanceof boolean[]) {
- boolean[] v = (boolean[]) value;
- bv.put12('[', v.length);
- for (int i = 0; i < v.length; i++) {
- bv.put12('Z', cw.newInteger(v[i] ? 1 : 0).index);
- }
- } else if (value instanceof short[]) {
- short[] v = (short[]) value;
- bv.put12('[', v.length);
- for (int i = 0; i < v.length; i++) {
- bv.put12('S', cw.newInteger(v[i]).index);
- }
- } else if (value instanceof char[]) {
- char[] v = (char[]) value;
- bv.put12('[', v.length);
- for (int i = 0; i < v.length; i++) {
- bv.put12('C', cw.newInteger(v[i]).index);
- }
- } else if (value instanceof int[]) {
- int[] v = (int[]) value;
- bv.put12('[', v.length);
- for (int i = 0; i < v.length; i++) {
- bv.put12('I', cw.newInteger(v[i]).index);
- }
- } else if (value instanceof long[]) {
- long[] v = (long[]) value;
- bv.put12('[', v.length);
- for (int i = 0; i < v.length; i++) {
- bv.put12('J', cw.newLong(v[i]).index);
- }
- } else if (value instanceof float[]) {
- float[] v = (float[]) value;
- bv.put12('[', v.length);
- for (int i = 0; i < v.length; i++) {
- bv.put12('F', cw.newFloat(v[i]).index);
- }
- } else if (value instanceof double[]) {
- double[] v = (double[]) value;
- bv.put12('[', v.length);
- for (int i = 0; i < v.length; i++) {
- bv.put12('D', cw.newDouble(v[i]).index);
- }
- } else {
- Item i = cw.newConstItem(value);
- bv.put12(".s.IFJDCS".charAt(i.type), i.index);
- }
+ /**
+ * Creates a new {@link AnnotationWriter} using named values.
+ *
+ * @param symbolTable where the constants used in this AnnotationWriter must be stored.
+ * @param typeRef a reference to the annotated type. The sort of this type reference must be
+ * {@link TypeReference#CLASS_TYPE_PARAMETER}, {@link
+ * TypeReference#CLASS_TYPE_PARAMETER_BOUND} or {@link TypeReference#CLASS_EXTENDS}. See
+ * {@link TypeReference}.
+ * @param typePath the path to the annotated type argument, wildcard bound, array element type, or
+ * static inner type within 'typeRef'. May be {@literal null} if the annotation targets
+ * 'typeRef' as a whole.
+ * @param descriptor the class descriptor of the annotation class.
+ * @param previousAnnotation the previously visited annotation of the
+ * Runtime[In]Visible[Type]Annotations attribute to which this annotation belongs, or null in
+ * other cases (e.g. nested or array annotations).
+ */
+ static AnnotationWriter create(
+ final SymbolTable symbolTable,
+ final int typeRef,
+ final TypePath typePath,
+ final String descriptor,
+ final AnnotationWriter previousAnnotation) {
+ // Create a ByteVector to hold a 'type_annotation' JVMS structure.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20.
+ ByteVector typeAnnotation = new ByteVector();
+ // Write target_type, target_info, and target_path.
+ TypeReference.putTarget(typeRef, typeAnnotation);
+ TypePath.put(typePath, typeAnnotation);
+ // Write type_index and reserve space for num_element_value_pairs.
+ typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0);
+ return new AnnotationWriter(
+ symbolTable, /* useNamedValues = */ true, typeAnnotation, previousAnnotation);
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Implementation of the AnnotationVisitor abstract class
+ // -----------------------------------------------------------------------------------------------
+
+ @Override
+ public void visit(final String name, final Object value) {
+ // Case of an element_value with a const_value_index, class_info_index or array_index field.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16.1.
+ ++numElementValuePairs;
+ if (useNamedValues) {
+ annotation.putShort(symbolTable.addConstantUtf8(name));
}
-
- @Override
- public void visitEnum(final String name, final String desc,
- final String value) {
- ++size;
- if (named) {
- bv.putShort(cw.newUTF8(name));
- }
- bv.put12('e', cw.newUTF8(desc)).putShort(cw.newUTF8(value));
+ if (value instanceof String) {
+ annotation.put12('s', symbolTable.addConstantUtf8((String) value));
+ } else if (value instanceof Byte) {
+ annotation.put12('B', symbolTable.addConstantInteger(((Byte) value).byteValue()).index);
+ } else if (value instanceof Boolean) {
+ int booleanValue = ((Boolean) value).booleanValue() ? 1 : 0;
+ annotation.put12('Z', symbolTable.addConstantInteger(booleanValue).index);
+ } else if (value instanceof Character) {
+ annotation.put12('C', symbolTable.addConstantInteger(((Character) value).charValue()).index);
+ } else if (value instanceof Short) {
+ annotation.put12('S', symbolTable.addConstantInteger(((Short) value).shortValue()).index);
+ } else if (value instanceof Type) {
+ annotation.put12('c', symbolTable.addConstantUtf8(((Type) value).getDescriptor()));
+ } else if (value instanceof byte[]) {
+ byte[] byteArray = (byte[]) value;
+ annotation.put12('[', byteArray.length);
+ for (byte byteValue : byteArray) {
+ annotation.put12('B', symbolTable.addConstantInteger(byteValue).index);
+ }
+ } else if (value instanceof boolean[]) {
+ boolean[] booleanArray = (boolean[]) value;
+ annotation.put12('[', booleanArray.length);
+ for (boolean booleanValue : booleanArray) {
+ annotation.put12('Z', symbolTable.addConstantInteger(booleanValue ? 1 : 0).index);
+ }
+ } else if (value instanceof short[]) {
+ short[] shortArray = (short[]) value;
+ annotation.put12('[', shortArray.length);
+ for (short shortValue : shortArray) {
+ annotation.put12('S', symbolTable.addConstantInteger(shortValue).index);
+ }
+ } else if (value instanceof char[]) {
+ char[] charArray = (char[]) value;
+ annotation.put12('[', charArray.length);
+ for (char charValue : charArray) {
+ annotation.put12('C', symbolTable.addConstantInteger(charValue).index);
+ }
+ } else if (value instanceof int[]) {
+ int[] intArray = (int[]) value;
+ annotation.put12('[', intArray.length);
+ for (int intValue : intArray) {
+ annotation.put12('I', symbolTable.addConstantInteger(intValue).index);
+ }
+ } else if (value instanceof long[]) {
+ long[] longArray = (long[]) value;
+ annotation.put12('[', longArray.length);
+ for (long longValue : longArray) {
+ annotation.put12('J', symbolTable.addConstantLong(longValue).index);
+ }
+ } else if (value instanceof float[]) {
+ float[] floatArray = (float[]) value;
+ annotation.put12('[', floatArray.length);
+ for (float floatValue : floatArray) {
+ annotation.put12('F', symbolTable.addConstantFloat(floatValue).index);
+ }
+ } else if (value instanceof double[]) {
+ double[] doubleArray = (double[]) value;
+ annotation.put12('[', doubleArray.length);
+ for (double doubleValue : doubleArray) {
+ annotation.put12('D', symbolTable.addConstantDouble(doubleValue).index);
+ }
+ } else {
+ Symbol symbol = symbolTable.addConstant(value);
+ annotation.put12(".s.IFJDCS".charAt(symbol.tag), symbol.index);
}
+ }
- @Override
- public AnnotationVisitor visitAnnotation(final String name,
- final String desc) {
- ++size;
- if (named) {
- bv.putShort(cw.newUTF8(name));
- }
- // write tag and type, and reserve space for values count
- bv.put12('@', cw.newUTF8(desc)).putShort(0);
- return new AnnotationWriter(cw, true, bv, bv, bv.length - 2);
+ @Override
+ public void visitEnum(final String name, final String descriptor, final String value) {
+ // Case of an element_value with an enum_const_value field.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16.1.
+ ++numElementValuePairs;
+ if (useNamedValues) {
+ annotation.putShort(symbolTable.addConstantUtf8(name));
}
+ annotation
+ .put12('e', symbolTable.addConstantUtf8(descriptor))
+ .putShort(symbolTable.addConstantUtf8(value));
+ }
- @Override
- public AnnotationVisitor visitArray(final String name) {
- ++size;
- if (named) {
- bv.putShort(cw.newUTF8(name));
- }
- // write tag, and reserve space for array size
- bv.put12('[', 0);
- return new AnnotationWriter(cw, false, bv, bv, bv.length - 2);
+ @Override
+ public AnnotationVisitor visitAnnotation(final String name, final String descriptor) {
+ // Case of an element_value with an annotation_value field.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16.1.
+ ++numElementValuePairs;
+ if (useNamedValues) {
+ annotation.putShort(symbolTable.addConstantUtf8(name));
}
+ // Write tag and type_index, and reserve 2 bytes for num_element_value_pairs.
+ annotation.put12('@', symbolTable.addConstantUtf8(descriptor)).putShort(0);
+ return new AnnotationWriter(symbolTable, /* useNamedValues = */ true, annotation, null);
+ }
- @Override
- public void visitEnd() {
- if (parent != null) {
- byte[] data = parent.data;
- data[offset] = (byte) (size >>> 8);
- data[offset + 1] = (byte) size;
- }
+ @Override
+ public AnnotationVisitor visitArray(final String name) {
+ // Case of an element_value with an array_value field.
+ // https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16.1
+ ++numElementValuePairs;
+ if (useNamedValues) {
+ annotation.putShort(symbolTable.addConstantUtf8(name));
}
+ // Write tag, and reserve 2 bytes for num_values. Here we take advantage of the fact that the
+ // end of an element_value of array type is similar to the end of an 'annotation' structure: an
+ // unsigned short num_values followed by num_values element_value, versus an unsigned short
+ // num_element_value_pairs, followed by num_element_value_pairs { element_name_index,
+ // element_value } tuples. This allows us to use an AnnotationWriter with unnamed values to
+ // visit the array elements. Its num_element_value_pairs will correspond to the number of array
+ // elements and will be stored in what is in fact num_values.
+ annotation.put12('[', 0);
+ return new AnnotationWriter(symbolTable, /* useNamedValues = */ false, annotation, null);
+ }
- // ------------------------------------------------------------------------
- // Utility methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns the size of this annotation writer list.
- *
- * @return the size of this annotation writer list.
- */
- int getSize() {
- int size = 0;
- AnnotationWriter aw = this;
- while (aw != null) {
- size += aw.bv.length;
- aw = aw.next;
- }
- return size;
+ @Override
+ public void visitEnd() {
+ if (numElementValuePairsOffset != -1) {
+ byte[] data = annotation.data;
+ data[numElementValuePairsOffset] = (byte) (numElementValuePairs >>> 8);
+ data[numElementValuePairsOffset + 1] = (byte) numElementValuePairs;
}
+ }
- /**
- * Puts the annotations of this annotation writer list into the given byte
- * vector.
- *
- * @param out
- * where the annotations must be put.
- */
- void put(final ByteVector out) {
- int n = 0;
- int size = 2;
- AnnotationWriter aw = this;
- AnnotationWriter last = null;
- while (aw != null) {
- ++n;
- size += aw.bv.length;
- aw.visitEnd(); // in case user forgot to call visitEnd
- aw.prev = last;
- last = aw;
- aw = aw.next;
- }
- out.putInt(size);
- out.putShort(n);
- aw = last;
- while (aw != null) {
- out.putByteArray(aw.bv.data, 0, aw.bv.length);
- aw = aw.prev;
- }
- }
+ // -----------------------------------------------------------------------------------------------
+ // Utility methods
+ // -----------------------------------------------------------------------------------------------
- /**
- * Puts the given annotation lists into the given byte vector.
- *
- * @param panns
- * an array of annotation writer lists.
- * @param off
- * index of the first annotation to be written.
- * @param out
- * where the annotations must be put.
- */
- static void put(final AnnotationWriter[] panns, final int off,
- final ByteVector out) {
- int size = 1 + 2 * (panns.length - off);
- for (int i = off; i < panns.length; ++i) {
- size += panns[i] == null ? 0 : panns[i].getSize();
- }
- out.putInt(size).putByte(panns.length - off);
- for (int i = off; i < panns.length; ++i) {
- AnnotationWriter aw = panns[i];
- AnnotationWriter last = null;
- int n = 0;
- while (aw != null) {
- ++n;
- aw.visitEnd(); // in case user forgot to call visitEnd
- aw.prev = last;
- last = aw;
- aw = aw.next;
- }
- out.putShort(n);
- aw = last;
- while (aw != null) {
- out.putByteArray(aw.bv.data, 0, aw.bv.length);
- aw = aw.prev;
- }
- }
+ /**
+ * Returns the size of a Runtime[In]Visible[Type]Annotations attribute containing this annotation
+ * and all its <i>predecessors</i> (see {@link #previousAnnotation}. Also adds the attribute name
+ * to the constant pool of the class (if not null).
+ *
+ * @param attributeName one of "Runtime[In]Visible[Type]Annotations", or null.
+ * @return the size in bytes of a Runtime[In]Visible[Type]Annotations attribute containing this
+ * annotation and all its predecessors. This includes the size of the attribute_name_index and
+ * attribute_length fields.
+ */
+ int computeAnnotationsSize(final String attributeName) {
+ if (attributeName != null) {
+ symbolTable.addConstantUtf8(attributeName);
}
+ // The attribute_name_index, attribute_length and num_annotations fields use 8 bytes.
+ int attributeSize = 8;
+ AnnotationWriter annotationWriter = this;
+ while (annotationWriter != null) {
+ attributeSize += annotationWriter.annotation.length;
+ annotationWriter = annotationWriter.previousAnnotation;
+ }
+ return attributeSize;
+ }
- /**
- * Puts the given type reference and type path into the given bytevector.
- * LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported.
- *
- * @param typeRef
- * a reference to the annotated type. See {@link TypeReference}.
- * @param typePath
- * the path to the annotated type argument, wildcard bound, array
- * element type, or static inner type within 'typeRef'. May be
- * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
- * @param out
- * where the type reference and type path must be put.
- */
- static void putTarget(int typeRef, TypePath typePath, ByteVector out) {
- switch (typeRef >>> 24) {
- case 0x00: // CLASS_TYPE_PARAMETER
- case 0x01: // METHOD_TYPE_PARAMETER
- case 0x16: // METHOD_FORMAL_PARAMETER
- out.putShort(typeRef >>> 16);
- break;
- case 0x13: // FIELD
- case 0x14: // METHOD_RETURN
- case 0x15: // METHOD_RECEIVER
- out.putByte(typeRef >>> 24);
- break;
- case 0x47: // CAST
- case 0x48: // CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
- case 0x49: // METHOD_INVOCATION_TYPE_ARGUMENT
- case 0x4A: // CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
- case 0x4B: // METHOD_REFERENCE_TYPE_ARGUMENT
- out.putInt(typeRef);
- break;
- // case 0x10: // CLASS_EXTENDS
- // case 0x11: // CLASS_TYPE_PARAMETER_BOUND
- // case 0x12: // METHOD_TYPE_PARAMETER_BOUND
- // case 0x17: // THROWS
- // case 0x42: // EXCEPTION_PARAMETER
- // case 0x43: // INSTANCEOF
- // case 0x44: // NEW
- // case 0x45: // CONSTRUCTOR_REFERENCE
- // case 0x46: // METHOD_REFERENCE
- default:
- out.put12(typeRef >>> 24, (typeRef & 0xFFFF00) >> 8);
- break;
- }
- if (typePath == null) {
- out.putByte(0);
- } else {
- int length = typePath.b[typePath.offset] * 2 + 1;
- out.putByteArray(typePath.b, typePath.offset, length);
- }
+ /**
+ * Returns the size of the Runtime[In]Visible[Type]Annotations attributes containing the given
+ * annotations and all their <i>predecessors</i> (see {@link #previousAnnotation}. Also adds the
+ * attribute names to the constant pool of the class (if not null).
+ *
+ * @param lastRuntimeVisibleAnnotation The last runtime visible annotation of a field, method or
+ * class. The previous ones can be accessed with the {@link #previousAnnotation} field. May be
+ * {@literal null}.
+ * @param lastRuntimeInvisibleAnnotation The last runtime invisible annotation of this a field,
+ * method or class. The previous ones can be accessed with the {@link #previousAnnotation}
+ * field. May be {@literal null}.
+ * @param lastRuntimeVisibleTypeAnnotation The last runtime visible type annotation of this a
+ * field, method or class. The previous ones can be accessed with the {@link
+ * #previousAnnotation} field. May be {@literal null}.
+ * @param lastRuntimeInvisibleTypeAnnotation The last runtime invisible type annotation of a
+ * field, method or class field. The previous ones can be accessed with the {@link
+ * #previousAnnotation} field. May be {@literal null}.
+ * @return the size in bytes of a Runtime[In]Visible[Type]Annotations attribute containing the
+ * given annotations and all their predecessors. This includes the size of the
+ * attribute_name_index and attribute_length fields.
+ */
+ static int computeAnnotationsSize(
+ final AnnotationWriter lastRuntimeVisibleAnnotation,
+ final AnnotationWriter lastRuntimeInvisibleAnnotation,
+ final AnnotationWriter lastRuntimeVisibleTypeAnnotation,
+ final AnnotationWriter lastRuntimeInvisibleTypeAnnotation) {
+ int size = 0;
+ if (lastRuntimeVisibleAnnotation != null) {
+ size +=
+ lastRuntimeVisibleAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_VISIBLE_ANNOTATIONS);
}
+ if (lastRuntimeInvisibleAnnotation != null) {
+ size +=
+ lastRuntimeInvisibleAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_INVISIBLE_ANNOTATIONS);
+ }
+ if (lastRuntimeVisibleTypeAnnotation != null) {
+ size +=
+ lastRuntimeVisibleTypeAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS);
+ }
+ if (lastRuntimeInvisibleTypeAnnotation != null) {
+ size +=
+ lastRuntimeInvisibleTypeAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS);
+ }
+ return size;
+ }
+
+ /**
+ * Puts a Runtime[In]Visible[Type]Annotations attribute containing this annotations and all its
+ * <i>predecessors</i> (see {@link #previousAnnotation} in the given ByteVector. Annotations are
+ * put in the same order they have been visited.
+ *
+ * @param attributeNameIndex the constant pool index of the attribute name (one of
+ * "Runtime[In]Visible[Type]Annotations").
+ * @param output where the attribute must be put.
+ */
+ void putAnnotations(final int attributeNameIndex, final ByteVector output) {
+ int attributeLength = 2; // For num_annotations.
+ int numAnnotations = 0;
+ AnnotationWriter annotationWriter = this;
+ AnnotationWriter firstAnnotation = null;
+ while (annotationWriter != null) {
+ // In case the user forgot to call visitEnd().
+ annotationWriter.visitEnd();
+ attributeLength += annotationWriter.annotation.length;
+ numAnnotations++;
+ firstAnnotation = annotationWriter;
+ annotationWriter = annotationWriter.previousAnnotation;
+ }
+ output.putShort(attributeNameIndex);
+ output.putInt(attributeLength);
+ output.putShort(numAnnotations);
+ annotationWriter = firstAnnotation;
+ while (annotationWriter != null) {
+ output.putByteArray(annotationWriter.annotation.data, 0, annotationWriter.annotation.length);
+ annotationWriter = annotationWriter.nextAnnotation;
+ }
+ }
+
+ /**
+ * Puts the Runtime[In]Visible[Type]Annotations attributes containing the given annotations and
+ * all their <i>predecessors</i> (see {@link #previousAnnotation} in the given ByteVector.
+ * Annotations are put in the same order they have been visited.
+ *
+ * @param symbolTable where the constants used in the AnnotationWriter instances are stored.
+ * @param lastRuntimeVisibleAnnotation The last runtime visible annotation of a field, method or
+ * class. The previous ones can be accessed with the {@link #previousAnnotation} field. May be
+ * {@literal null}.
+ * @param lastRuntimeInvisibleAnnotation The last runtime invisible annotation of this a field,
+ * method or class. The previous ones can be accessed with the {@link #previousAnnotation}
+ * field. May be {@literal null}.
+ * @param lastRuntimeVisibleTypeAnnotation The last runtime visible type annotation of this a
+ * field, method or class. The previous ones can be accessed with the {@link
+ * #previousAnnotation} field. May be {@literal null}.
+ * @param lastRuntimeInvisibleTypeAnnotation The last runtime invisible type annotation of a
+ * field, method or class field. The previous ones can be accessed with the {@link
+ * #previousAnnotation} field. May be {@literal null}.
+ * @param output where the attributes must be put.
+ */
+ static void putAnnotations(
+ final SymbolTable symbolTable,
+ final AnnotationWriter lastRuntimeVisibleAnnotation,
+ final AnnotationWriter lastRuntimeInvisibleAnnotation,
+ final AnnotationWriter lastRuntimeVisibleTypeAnnotation,
+ final AnnotationWriter lastRuntimeInvisibleTypeAnnotation,
+ final ByteVector output) {
+ if (lastRuntimeVisibleAnnotation != null) {
+ lastRuntimeVisibleAnnotation.putAnnotations(
+ symbolTable.addConstantUtf8(Constants.RUNTIME_VISIBLE_ANNOTATIONS), output);
+ }
+ if (lastRuntimeInvisibleAnnotation != null) {
+ lastRuntimeInvisibleAnnotation.putAnnotations(
+ symbolTable.addConstantUtf8(Constants.RUNTIME_INVISIBLE_ANNOTATIONS), output);
+ }
+ if (lastRuntimeVisibleTypeAnnotation != null) {
+ lastRuntimeVisibleTypeAnnotation.putAnnotations(
+ symbolTable.addConstantUtf8(Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS), output);
+ }
+ if (lastRuntimeInvisibleTypeAnnotation != null) {
+ lastRuntimeInvisibleTypeAnnotation.putAnnotations(
+ symbolTable.addConstantUtf8(Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS), output);
+ }
+ }
+
+ /**
+ * Returns the size of a Runtime[In]VisibleParameterAnnotations attribute containing all the
+ * annotation lists from the given AnnotationWriter sub-array. Also adds the attribute name to the
+ * constant pool of the class.
+ *
+ * @param attributeName one of "Runtime[In]VisibleParameterAnnotations".
+ * @param annotationWriters an array of AnnotationWriter lists (designated by their <i>last</i>
+ * element).
+ * @param annotableParameterCount the number of elements in annotationWriters to take into account
+ * (elements [0..annotableParameterCount[ are taken into account).
+ * @return the size in bytes of a Runtime[In]VisibleParameterAnnotations attribute corresponding
+ * to the given sub-array of AnnotationWriter lists. This includes the size of the
+ * attribute_name_index and attribute_length fields.
+ */
+ static int computeParameterAnnotationsSize(
+ final String attributeName,
+ final AnnotationWriter[] annotationWriters,
+ final int annotableParameterCount) {
+ // Note: attributeName is added to the constant pool by the call to computeAnnotationsSize
+ // below. This assumes that there is at least one non-null element in the annotationWriters
+ // sub-array (which is ensured by the lazy instantiation of this array in MethodWriter).
+ // The attribute_name_index, attribute_length and num_parameters fields use 7 bytes, and each
+ // element of the parameter_annotations array uses 2 bytes for its num_annotations field.
+ int attributeSize = 7 + 2 * annotableParameterCount;
+ for (int i = 0; i < annotableParameterCount; ++i) {
+ AnnotationWriter annotationWriter = annotationWriters[i];
+ attributeSize +=
+ annotationWriter == null ? 0 : annotationWriter.computeAnnotationsSize(attributeName) - 8;
+ }
+ return attributeSize;
+ }
+
+ /**
+ * Puts a Runtime[In]VisibleParameterAnnotations attribute containing all the annotation lists
+ * from the given AnnotationWriter sub-array in the given ByteVector.
+ *
+ * @param attributeNameIndex constant pool index of the attribute name (one of
+ * Runtime[In]VisibleParameterAnnotations).
+ * @param annotationWriters an array of AnnotationWriter lists (designated by their <i>last</i>
+ * element).
+ * @param annotableParameterCount the number of elements in annotationWriters to put (elements
+ * [0..annotableParameterCount[ are put).
+ * @param output where the attribute must be put.
+ */
+ static void putParameterAnnotations(
+ final int attributeNameIndex,
+ final AnnotationWriter[] annotationWriters,
+ final int annotableParameterCount,
+ final ByteVector output) {
+ // The num_parameters field uses 1 byte, and each element of the parameter_annotations array
+ // uses 2 bytes for its num_annotations field.
+ int attributeLength = 1 + 2 * annotableParameterCount;
+ for (int i = 0; i < annotableParameterCount; ++i) {
+ AnnotationWriter annotationWriter = annotationWriters[i];
+ attributeLength +=
+ annotationWriter == null ? 0 : annotationWriter.computeAnnotationsSize(null) - 8;
+ }
+ output.putShort(attributeNameIndex);
+ output.putInt(attributeLength);
+ output.putByte(annotableParameterCount);
+ for (int i = 0; i < annotableParameterCount; ++i) {
+ AnnotationWriter annotationWriter = annotationWriters[i];
+ AnnotationWriter firstAnnotation = null;
+ int numAnnotations = 0;
+ while (annotationWriter != null) {
+ // In case user the forgot to call visitEnd().
+ annotationWriter.visitEnd();
+ numAnnotations++;
+ firstAnnotation = annotationWriter;
+ annotationWriter = annotationWriter.previousAnnotation;
+ }
+ output.putShort(numAnnotations);
+ annotationWriter = firstAnnotation;
+ while (annotationWriter != null) {
+ output.putByteArray(
+ annotationWriter.annotation.data, 0, annotationWriter.annotation.length);
+ annotationWriter = annotationWriter.nextAnnotation;
+ }
+ }
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Attribute.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Attribute.java
index cdf1c0e..bd090e6 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Attribute.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Attribute.java
@@ -1,255 +1,392 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A non standard class, field, method or code attribute.
+ * A non standard class, field, method or code attribute, as defined in the Java Virtual Machine
+ * Specification (JVMS).
*
+ * @see <a href= "https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7">JVMS
+ * 4.7</a>
+ * @see <a href= "https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.3">JVMS
+ * 4.7.3</a>
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
public class Attribute {
- /**
- * The type of this attribute.
- */
- public final String type;
+ /** The type of this attribute, also called its name in the JVMS. */
+ public final String type;
- /**
- * The raw value of this attribute, used only for unknown attributes.
- */
- byte[] value;
+ /**
+ * The raw content of this attribute, only used for unknown attributes (see {@link #isUnknown()}).
+ * The 6 header bytes of the attribute (attribute_name_index and attribute_length) are <i>not</i>
+ * included.
+ */
+ private byte[] content;
- /**
- * The next attribute in this attribute list. May be <tt>null</tt>.
- */
- Attribute next;
+ /**
+ * The next attribute in this attribute list (Attribute instances can be linked via this field to
+ * store a list of class, field, method or code attributes). May be {@literal null}.
+ */
+ Attribute nextAttribute;
- /**
- * Constructs a new empty attribute.
- *
- * @param type
- * the type of the attribute.
- */
- protected Attribute(final String type) {
- this.type = type;
+ /**
+ * Constructs a new empty attribute.
+ *
+ * @param type the type of the attribute.
+ */
+ protected Attribute(final String type) {
+ this.type = type;
+ }
+
+ /**
+ * Returns {@literal true} if this type of attribute is unknown. This means that the attribute
+ * content can't be parsed to extract constant pool references, labels, etc. Instead, the
+ * attribute content is read as an opaque byte array, and written back as is. This can lead to
+ * invalid attributes, if the content actually contains constant pool references, labels, or other
+ * symbolic references that need to be updated when there are changes to the constant pool, the
+ * method bytecode, etc. The default implementation of this method always returns {@literal true}.
+ *
+ * @return {@literal true} if this type of attribute is unknown.
+ */
+ public boolean isUnknown() {
+ return true;
+ }
+
+ /**
+ * Returns {@literal true} if this type of attribute is a code attribute.
+ *
+ * @return {@literal true} if this type of attribute is a code attribute.
+ */
+ public boolean isCodeAttribute() {
+ return false;
+ }
+
+ /**
+ * Returns the labels corresponding to this attribute.
+ *
+ * @return the labels corresponding to this attribute, or {@literal null} if this attribute is not
+ * a code attribute that contains labels.
+ */
+ protected Label[] getLabels() {
+ return new Label[0];
+ }
+
+ /**
+ * Reads a {@link #type} attribute. This method must return a <i>new</i> {@link Attribute} object,
+ * of type {@link #type}, corresponding to the 'length' bytes starting at 'offset', in the given
+ * ClassReader.
+ *
+ * @param classReader the class that contains the attribute to be read.
+ * @param offset index of the first byte of the attribute's content in {@link ClassReader}. The 6
+ * attribute header bytes (attribute_name_index and attribute_length) are not taken into
+ * account here.
+ * @param length the length of the attribute's content (excluding the 6 attribute header bytes).
+ * @param charBuffer the buffer to be used to call the ClassReader methods requiring a
+ * 'charBuffer' parameter.
+ * @param codeAttributeOffset index of the first byte of content of the enclosing Code attribute
+ * in {@link ClassReader}, or -1 if the attribute to be read is not a code attribute. The 6
+ * attribute header bytes (attribute_name_index and attribute_length) are not taken into
+ * account here.
+ * @param labels the labels of the method's code, or {@literal null} if the attribute to be read
+ * is not a code attribute.
+ * @return a <i>new</i> {@link Attribute} object corresponding to the specified bytes.
+ */
+ protected Attribute read(
+ final ClassReader classReader,
+ final int offset,
+ final int length,
+ final char[] charBuffer,
+ final int codeAttributeOffset,
+ final Label[] labels) {
+ Attribute attribute = new Attribute(type);
+ attribute.content = new byte[length];
+ System.arraycopy(classReader.classFileBuffer, offset, attribute.content, 0, length);
+ return attribute;
+ }
+
+ /**
+ * Returns the byte array form of the content of this attribute. The 6 header bytes
+ * (attribute_name_index and attribute_length) must <i>not</i> be added in the returned
+ * ByteVector.
+ *
+ * @param classWriter the class to which this attribute must be added. This parameter can be used
+ * to add the items that corresponds to this attribute to the constant pool of this class.
+ * @param code the bytecode of the method corresponding to this code attribute, or {@literal null}
+ * if this attribute is not a code attribute. Corresponds to the 'code' field of the Code
+ * attribute.
+ * @param codeLength the length of the bytecode of the method corresponding to this code
+ * attribute, or 0 if this attribute is not a code attribute. Corresponds to the 'code_length'
+ * field of the Code attribute.
+ * @param maxStack the maximum stack size of the method corresponding to this code attribute, or
+ * -1 if this attribute is not a code attribute.
+ * @param maxLocals the maximum number of local variables of the method corresponding to this code
+ * attribute, or -1 if this attribute is not a code attribute.
+ * @return the byte array form of this attribute.
+ */
+ protected ByteVector write(
+ final ClassWriter classWriter,
+ final byte[] code,
+ final int codeLength,
+ final int maxStack,
+ final int maxLocals) {
+ return new ByteVector(content);
+ }
+
+ /**
+ * Returns the number of attributes of the attribute list that begins with this attribute.
+ *
+ * @return the number of attributes of the attribute list that begins with this attribute.
+ */
+ final int getAttributeCount() {
+ int count = 0;
+ Attribute attribute = this;
+ while (attribute != null) {
+ count += 1;
+ attribute = attribute.nextAttribute;
}
+ return count;
+ }
- /**
- * Returns <tt>true</tt> if this type of attribute is unknown. The default
- * implementation of this method always returns <tt>true</tt>.
- *
- * @return <tt>true</tt> if this type of attribute is unknown.
- */
- public boolean isUnknown() {
- return true;
+ /**
+ * Returns the total size in bytes of all the attributes in the attribute list that begins with
+ * this attribute. This size includes the 6 header bytes (attribute_name_index and
+ * attribute_length) per attribute. Also adds the attribute type names to the constant pool.
+ *
+ * @param symbolTable where the constants used in the attributes must be stored.
+ * @return the size of all the attributes in this attribute list. This size includes the size of
+ * the attribute headers.
+ */
+ final int computeAttributesSize(final SymbolTable symbolTable) {
+ final byte[] code = null;
+ final int codeLength = 0;
+ final int maxStack = -1;
+ final int maxLocals = -1;
+ return computeAttributesSize(symbolTable, code, codeLength, maxStack, maxLocals);
+ }
+
+ /**
+ * Returns the total size in bytes of all the attributes in the attribute list that begins with
+ * this attribute. This size includes the 6 header bytes (attribute_name_index and
+ * attribute_length) per attribute. Also adds the attribute type names to the constant pool.
+ *
+ * @param symbolTable where the constants used in the attributes must be stored.
+ * @param code the bytecode of the method corresponding to these code attributes, or {@literal
+ * null} if they are not code attributes. Corresponds to the 'code' field of the Code
+ * attribute.
+ * @param codeLength the length of the bytecode of the method corresponding to these code
+ * attributes, or 0 if they are not code attributes. Corresponds to the 'code_length' field of
+ * the Code attribute.
+ * @param maxStack the maximum stack size of the method corresponding to these code attributes, or
+ * -1 if they are not code attributes.
+ * @param maxLocals the maximum number of local variables of the method corresponding to these
+ * code attributes, or -1 if they are not code attribute.
+ * @return the size of all the attributes in this attribute list. This size includes the size of
+ * the attribute headers.
+ */
+ final int computeAttributesSize(
+ final SymbolTable symbolTable,
+ final byte[] code,
+ final int codeLength,
+ final int maxStack,
+ final int maxLocals) {
+ final ClassWriter classWriter = symbolTable.classWriter;
+ int size = 0;
+ Attribute attribute = this;
+ while (attribute != null) {
+ symbolTable.addConstantUtf8(attribute.type);
+ size += 6 + attribute.write(classWriter, code, codeLength, maxStack, maxLocals).length;
+ attribute = attribute.nextAttribute;
}
+ return size;
+ }
- /**
- * Returns <tt>true</tt> if this type of attribute is a code attribute.
- *
- * @return <tt>true</tt> if this type of attribute is a code attribute.
- */
- public boolean isCodeAttribute() {
- return false;
+ /**
+ * Returns the total size in bytes of all the attributes that correspond to the given field,
+ * method or class access flags and signature. This size includes the 6 header bytes
+ * (attribute_name_index and attribute_length) per attribute. Also adds the attribute type names
+ * to the constant pool.
+ *
+ * @param symbolTable where the constants used in the attributes must be stored.
+ * @param accessFlags some field, method or class access flags.
+ * @param signatureIndex the constant pool index of a field, method of class signature.
+ * @return the size of all the attributes in bytes. This size includes the size of the attribute
+ * headers.
+ */
+ static int computeAttributesSize(
+ final SymbolTable symbolTable, final int accessFlags, final int signatureIndex) {
+ int size = 0;
+ // Before Java 1.5, synthetic fields are represented with a Synthetic attribute.
+ if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0
+ && symbolTable.getMajorVersion() < Opcodes.V1_5) {
+ // Synthetic attributes always use 6 bytes.
+ symbolTable.addConstantUtf8(Constants.SYNTHETIC);
+ size += 6;
}
-
- /**
- * Returns the labels corresponding to this attribute.
- *
- * @return the labels corresponding to this attribute, or <tt>null</tt> if
- * this attribute is not a code attribute that contains labels.
- */
- protected Label[] getLabels() {
- return null;
+ if (signatureIndex != 0) {
+ // Signature attributes always use 8 bytes.
+ symbolTable.addConstantUtf8(Constants.SIGNATURE);
+ size += 8;
}
-
- /**
- * Reads a {@link #type type} attribute. This method must return a
- * <i>new</i> {@link Attribute} object, of type {@link #type type},
- * corresponding to the <tt>len</tt> bytes starting at the given offset, in
- * the given class reader.
- *
- * @param cr
- * the class that contains the attribute to be read.
- * @param off
- * index of the first byte of the attribute's content in
- * {@link ClassReader#b cr.b}. The 6 attribute header bytes,
- * containing the type and the length of the attribute, are not
- * taken into account here.
- * @param len
- * the length of the attribute's content.
- * @param buf
- * buffer to be used to call {@link ClassReader#readUTF8
- * readUTF8}, {@link ClassReader#readClass(int,char[]) readClass}
- * or {@link ClassReader#readConst readConst}.
- * @param codeOff
- * index of the first byte of code's attribute content in
- * {@link ClassReader#b cr.b}, or -1 if the attribute to be read
- * is not a code attribute. The 6 attribute header bytes,
- * containing the type and the length of the attribute, are not
- * taken into account here.
- * @param labels
- * the labels of the method's code, or <tt>null</tt> if the
- * attribute to be read is not a code attribute.
- * @return a <i>new</i> {@link Attribute} object corresponding to the given
- * bytes.
- */
- protected Attribute read(final ClassReader cr, final int off,
- final int len, final char[] buf, final int codeOff,
- final Label[] labels) {
- Attribute attr = new Attribute(type);
- attr.value = new byte[len];
- System.arraycopy(cr.b, off, attr.value, 0, len);
- return attr;
+ // ACC_DEPRECATED is ASM specific, the ClassFile format uses a Deprecated attribute instead.
+ if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
+ // Deprecated attributes always use 6 bytes.
+ symbolTable.addConstantUtf8(Constants.DEPRECATED);
+ size += 6;
}
+ return size;
+ }
- /**
- * Returns the byte array form of this attribute.
- *
- * @param cw
- * the class to which this attribute must be added. This
- * parameter can be used to add to the constant pool of this
- * class the items that corresponds to this attribute.
- * @param code
- * the bytecode of the method corresponding to this code
- * attribute, or <tt>null</tt> if this attribute is not a code
- * attributes.
- * @param len
- * the length of the bytecode of the method corresponding to this
- * code attribute, or <tt>null</tt> if this attribute is not a
- * code attribute.
- * @param maxStack
- * the maximum stack size of the method corresponding to this
- * code attribute, or -1 if this attribute is not a code
- * attribute.
- * @param maxLocals
- * the maximum number of local variables of the method
- * corresponding to this code attribute, or -1 if this attribute
- * is not a code attribute.
- * @return the byte array form of this attribute.
- */
- protected ByteVector write(final ClassWriter cw, final byte[] code,
- final int len, final int maxStack, final int maxLocals) {
- ByteVector v = new ByteVector();
- v.data = value;
- v.length = value.length;
- return v;
+ /**
+ * Puts all the attributes of the attribute list that begins with this attribute, in the given
+ * byte vector. This includes the 6 header bytes (attribute_name_index and attribute_length) per
+ * attribute.
+ *
+ * @param symbolTable where the constants used in the attributes must be stored.
+ * @param output where the attributes must be written.
+ */
+ final void putAttributes(final SymbolTable symbolTable, final ByteVector output) {
+ final byte[] code = null;
+ final int codeLength = 0;
+ final int maxStack = -1;
+ final int maxLocals = -1;
+ putAttributes(symbolTable, code, codeLength, maxStack, maxLocals, output);
+ }
+
+ /**
+ * Puts all the attributes of the attribute list that begins with this attribute, in the given
+ * byte vector. This includes the 6 header bytes (attribute_name_index and attribute_length) per
+ * attribute.
+ *
+ * @param symbolTable where the constants used in the attributes must be stored.
+ * @param code the bytecode of the method corresponding to these code attributes, or {@literal
+ * null} if they are not code attributes. Corresponds to the 'code' field of the Code
+ * attribute.
+ * @param codeLength the length of the bytecode of the method corresponding to these code
+ * attributes, or 0 if they are not code attributes. Corresponds to the 'code_length' field of
+ * the Code attribute.
+ * @param maxStack the maximum stack size of the method corresponding to these code attributes, or
+ * -1 if they are not code attributes.
+ * @param maxLocals the maximum number of local variables of the method corresponding to these
+ * code attributes, or -1 if they are not code attribute.
+ * @param output where the attributes must be written.
+ */
+ final void putAttributes(
+ final SymbolTable symbolTable,
+ final byte[] code,
+ final int codeLength,
+ final int maxStack,
+ final int maxLocals,
+ final ByteVector output) {
+ final ClassWriter classWriter = symbolTable.classWriter;
+ Attribute attribute = this;
+ while (attribute != null) {
+ ByteVector attributeContent =
+ attribute.write(classWriter, code, codeLength, maxStack, maxLocals);
+ // Put attribute_name_index and attribute_length.
+ output.putShort(symbolTable.addConstantUtf8(attribute.type)).putInt(attributeContent.length);
+ output.putByteArray(attributeContent.data, 0, attributeContent.length);
+ attribute = attribute.nextAttribute;
}
+ }
- /**
- * Returns the length of the attribute list that begins with this attribute.
- *
- * @return the length of the attribute list that begins with this attribute.
- */
- final int getCount() {
- int count = 0;
- Attribute attr = this;
- while (attr != null) {
- count += 1;
- attr = attr.next;
+ /**
+ * Puts all the attributes that correspond to the given field, method or class access flags and
+ * signature, in the given byte vector. This includes the 6 header bytes (attribute_name_index and
+ * attribute_length) per attribute.
+ *
+ * @param symbolTable where the constants used in the attributes must be stored.
+ * @param accessFlags some field, method or class access flags.
+ * @param signatureIndex the constant pool index of a field, method of class signature.
+ * @param output where the attributes must be written.
+ */
+ static void putAttributes(
+ final SymbolTable symbolTable,
+ final int accessFlags,
+ final int signatureIndex,
+ final ByteVector output) {
+ // Before Java 1.5, synthetic fields are represented with a Synthetic attribute.
+ if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0
+ && symbolTable.getMajorVersion() < Opcodes.V1_5) {
+ output.putShort(symbolTable.addConstantUtf8(Constants.SYNTHETIC)).putInt(0);
+ }
+ if (signatureIndex != 0) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.SIGNATURE))
+ .putInt(2)
+ .putShort(signatureIndex);
+ }
+ if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
+ output.putShort(symbolTable.addConstantUtf8(Constants.DEPRECATED)).putInt(0);
+ }
+ }
+
+ /** A set of attribute prototypes (attributes with the same type are considered equal). */
+ static final class Set {
+
+ private static final int SIZE_INCREMENT = 6;
+
+ private int size;
+ private Attribute[] data = new Attribute[SIZE_INCREMENT];
+
+ void addAttributes(final Attribute attributeList) {
+ Attribute attribute = attributeList;
+ while (attribute != null) {
+ if (!contains(attribute)) {
+ add(attribute);
}
- return count;
+ attribute = attribute.nextAttribute;
+ }
}
- /**
- * Returns the size of all the attributes in this attribute list.
- *
- * @param cw
- * the class writer to be used to convert the attributes into
- * byte arrays, with the {@link #write write} method.
- * @param code
- * the bytecode of the method corresponding to these code
- * attributes, or <tt>null</tt> if these attributes are not code
- * attributes.
- * @param len
- * the length of the bytecode of the method corresponding to
- * these code attributes, or <tt>null</tt> if these attributes
- * are not code attributes.
- * @param maxStack
- * the maximum stack size of the method corresponding to these
- * code attributes, or -1 if these attributes are not code
- * attributes.
- * @param maxLocals
- * the maximum number of local variables of the method
- * corresponding to these code attributes, or -1 if these
- * attributes are not code attributes.
- * @return the size of all the attributes in this attribute list. This size
- * includes the size of the attribute headers.
- */
- final int getSize(final ClassWriter cw, final byte[] code, final int len,
- final int maxStack, final int maxLocals) {
- Attribute attr = this;
- int size = 0;
- while (attr != null) {
- cw.newUTF8(attr.type);
- size += attr.write(cw, code, len, maxStack, maxLocals).length + 6;
- attr = attr.next;
- }
- return size;
+ Attribute[] toArray() {
+ Attribute[] result = new Attribute[size];
+ System.arraycopy(data, 0, result, 0, size);
+ return result;
}
- /**
- * Writes all the attributes of this attribute list in the given byte
- * vector.
- *
- * @param cw
- * the class writer to be used to convert the attributes into
- * byte arrays, with the {@link #write write} method.
- * @param code
- * the bytecode of the method corresponding to these code
- * attributes, or <tt>null</tt> if these attributes are not code
- * attributes.
- * @param len
- * the length of the bytecode of the method corresponding to
- * these code attributes, or <tt>null</tt> if these attributes
- * are not code attributes.
- * @param maxStack
- * the maximum stack size of the method corresponding to these
- * code attributes, or -1 if these attributes are not code
- * attributes.
- * @param maxLocals
- * the maximum number of local variables of the method
- * corresponding to these code attributes, or -1 if these
- * attributes are not code attributes.
- * @param out
- * where the attributes must be written.
- */
- final void put(final ClassWriter cw, final byte[] code, final int len,
- final int maxStack, final int maxLocals, final ByteVector out) {
- Attribute attr = this;
- while (attr != null) {
- ByteVector b = attr.write(cw, code, len, maxStack, maxLocals);
- out.putShort(cw.newUTF8(attr.type)).putInt(b.length);
- out.putByteArray(b.data, 0, b.length);
- attr = attr.next;
+ private boolean contains(final Attribute attribute) {
+ for (int i = 0; i < size; ++i) {
+ if (data[i].type.equals(attribute.type)) {
+ return true;
}
+ }
+ return false;
}
+
+ private void add(final Attribute attribute) {
+ if (size >= data.length) {
+ Attribute[] newData = new Attribute[data.length + SIZE_INCREMENT];
+ System.arraycopy(data, 0, newData, 0, size);
+ data = newData;
+ }
+ data[size++] = attribute;
+ }
+ }
}
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 92011a9..7b386a0 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
@@ -1,339 +1,361 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A dynamically extensible vector of bytes. This class is roughly equivalent to
- * a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient.
+ * A dynamically extensible vector of bytes. This class is roughly equivalent to a DataOutputStream
+ * on top of a ByteArrayOutputStream, but is more efficient.
*
* @author Eric Bruneton
*/
public class ByteVector {
- /**
- * The content of this vector.
- */
- byte[] data;
+ /** The content of this vector. Only the first {@link #length} bytes contain real data. */
+ byte[] data;
- /**
- * Actual number of bytes in this vector.
- */
- int length;
+ /** The actual number of bytes in this vector. */
+ int length;
- /**
- * Constructs a new {@link ByteVector ByteVector} with a default initial
- * size.
- */
- public ByteVector() {
- data = new byte[64];
+ /** Constructs a new {@link ByteVector} with a default initial capacity. */
+ public ByteVector() {
+ data = new byte[64];
+ }
+
+ /**
+ * Constructs a new {@link ByteVector} with the given initial capacity.
+ *
+ * @param initialCapacity the initial capacity of the byte vector to be constructed.
+ */
+ public ByteVector(final int initialCapacity) {
+ data = new byte[initialCapacity];
+ }
+
+ /**
+ * Constructs a new {@link ByteVector} from the given initial data.
+ *
+ * @param data the initial data of the new byte vector.
+ */
+ ByteVector(final byte[] data) {
+ this.data = data;
+ this.length = data.length;
+ }
+
+ /**
+ * Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary.
+ *
+ * @param byteValue a byte.
+ * @return this byte vector.
+ */
+ public ByteVector putByte(final int byteValue) {
+ int currentLength = length;
+ if (currentLength + 1 > data.length) {
+ enlarge(1);
}
+ data[currentLength++] = (byte) byteValue;
+ length = currentLength;
+ return this;
+ }
- /**
- * Constructs a new {@link ByteVector ByteVector} with the given initial
- * size.
- *
- * @param initialSize
- * the initial size of the byte vector to be constructed.
- */
- public ByteVector(final int initialSize) {
- data = new byte[initialSize];
+ /**
+ * Puts two bytes into this byte vector. The byte vector is automatically enlarged if necessary.
+ *
+ * @param byteValue1 a byte.
+ * @param byteValue2 another byte.
+ * @return this byte vector.
+ */
+ final ByteVector put11(final int byteValue1, final int byteValue2) {
+ int currentLength = length;
+ if (currentLength + 2 > data.length) {
+ enlarge(2);
}
+ byte[] currentData = data;
+ currentData[currentLength++] = (byte) byteValue1;
+ currentData[currentLength++] = (byte) byteValue2;
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts a byte into this byte vector. The byte vector is automatically
- * enlarged if necessary.
- *
- * @param b
- * a byte.
- * @return this byte vector.
- */
- public ByteVector putByte(final int b) {
- int length = this.length;
- if (length + 1 > data.length) {
- enlarge(1);
- }
- data[length++] = (byte) b;
- this.length = length;
- return this;
+ /**
+ * Puts a short into this byte vector. The byte vector is automatically enlarged if necessary.
+ *
+ * @param shortValue a short.
+ * @return this byte vector.
+ */
+ public ByteVector putShort(final int shortValue) {
+ int currentLength = length;
+ if (currentLength + 2 > data.length) {
+ enlarge(2);
}
+ byte[] currentData = data;
+ currentData[currentLength++] = (byte) (shortValue >>> 8);
+ currentData[currentLength++] = (byte) shortValue;
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts two bytes into this byte vector. The byte vector is automatically
- * enlarged if necessary.
- *
- * @param b1
- * a byte.
- * @param b2
- * another byte.
- * @return this byte vector.
- */
- ByteVector put11(final int b1, final int b2) {
- int length = this.length;
- if (length + 2 > data.length) {
- enlarge(2);
- }
- byte[] data = this.data;
- data[length++] = (byte) b1;
- data[length++] = (byte) b2;
- this.length = length;
- return this;
+ /**
+ * Puts a byte and a short into this byte vector. The byte vector is automatically enlarged if
+ * necessary.
+ *
+ * @param byteValue a byte.
+ * @param shortValue a short.
+ * @return this byte vector.
+ */
+ final ByteVector put12(final int byteValue, final int shortValue) {
+ int currentLength = length;
+ if (currentLength + 3 > data.length) {
+ enlarge(3);
}
+ byte[] currentData = data;
+ currentData[currentLength++] = (byte) byteValue;
+ currentData[currentLength++] = (byte) (shortValue >>> 8);
+ currentData[currentLength++] = (byte) shortValue;
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts a short into this byte vector. The byte vector is automatically
- * enlarged if necessary.
- *
- * @param s
- * a short.
- * @return this byte vector.
- */
- public ByteVector putShort(final int s) {
- int length = this.length;
- if (length + 2 > data.length) {
- enlarge(2);
- }
- byte[] data = this.data;
- data[length++] = (byte) (s >>> 8);
- data[length++] = (byte) s;
- this.length = length;
- return this;
+ /**
+ * Puts two bytes and a short into this byte vector. The byte vector is automatically enlarged if
+ * necessary.
+ *
+ * @param byteValue1 a byte.
+ * @param byteValue2 another byte.
+ * @param shortValue a short.
+ * @return this byte vector.
+ */
+ final ByteVector put112(final int byteValue1, final int byteValue2, final int shortValue) {
+ int currentLength = length;
+ if (currentLength + 4 > data.length) {
+ enlarge(4);
}
+ byte[] currentData = data;
+ currentData[currentLength++] = (byte) byteValue1;
+ currentData[currentLength++] = (byte) byteValue2;
+ currentData[currentLength++] = (byte) (shortValue >>> 8);
+ currentData[currentLength++] = (byte) shortValue;
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts a byte and a short into this byte vector. The byte vector is
- * automatically enlarged if necessary.
- *
- * @param b
- * a byte.
- * @param s
- * a short.
- * @return this byte vector.
- */
- ByteVector put12(final int b, final int s) {
- int length = this.length;
- if (length + 3 > data.length) {
- enlarge(3);
- }
- byte[] data = this.data;
- data[length++] = (byte) b;
- data[length++] = (byte) (s >>> 8);
- data[length++] = (byte) s;
- this.length = length;
- return this;
+ /**
+ * Puts an int into this byte vector. The byte vector is automatically enlarged if necessary.
+ *
+ * @param intValue an int.
+ * @return this byte vector.
+ */
+ public ByteVector putInt(final int intValue) {
+ int currentLength = length;
+ if (currentLength + 4 > data.length) {
+ enlarge(4);
}
+ byte[] currentData = data;
+ currentData[currentLength++] = (byte) (intValue >>> 24);
+ currentData[currentLength++] = (byte) (intValue >>> 16);
+ currentData[currentLength++] = (byte) (intValue >>> 8);
+ currentData[currentLength++] = (byte) intValue;
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts an int into this byte vector. The byte vector is automatically
- * enlarged if necessary.
- *
- * @param i
- * an int.
- * @return this byte vector.
- */
- public ByteVector putInt(final int i) {
- int length = this.length;
- if (length + 4 > data.length) {
- enlarge(4);
- }
- byte[] data = this.data;
- data[length++] = (byte) (i >>> 24);
- data[length++] = (byte) (i >>> 16);
- data[length++] = (byte) (i >>> 8);
- data[length++] = (byte) i;
- this.length = length;
- return this;
+ /**
+ * Puts one byte and two shorts into this byte vector. The byte vector is automatically enlarged
+ * if necessary.
+ *
+ * @param byteValue a byte.
+ * @param shortValue1 a short.
+ * @param shortValue2 another short.
+ * @return this byte vector.
+ */
+ final ByteVector put122(final int byteValue, final int shortValue1, final int shortValue2) {
+ int currentLength = length;
+ if (currentLength + 5 > data.length) {
+ enlarge(5);
}
+ byte[] currentData = data;
+ currentData[currentLength++] = (byte) byteValue;
+ currentData[currentLength++] = (byte) (shortValue1 >>> 8);
+ currentData[currentLength++] = (byte) shortValue1;
+ currentData[currentLength++] = (byte) (shortValue2 >>> 8);
+ currentData[currentLength++] = (byte) shortValue2;
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts a long into this byte vector. The byte vector is automatically
- * enlarged if necessary.
- *
- * @param l
- * a long.
- * @return this byte vector.
- */
- public ByteVector putLong(final long l) {
- int length = this.length;
- if (length + 8 > data.length) {
- enlarge(8);
- }
- byte[] data = this.data;
- int i = (int) (l >>> 32);
- data[length++] = (byte) (i >>> 24);
- data[length++] = (byte) (i >>> 16);
- data[length++] = (byte) (i >>> 8);
- data[length++] = (byte) i;
- i = (int) l;
- data[length++] = (byte) (i >>> 24);
- data[length++] = (byte) (i >>> 16);
- data[length++] = (byte) (i >>> 8);
- data[length++] = (byte) i;
- this.length = length;
- return this;
+ /**
+ * Puts a long into this byte vector. The byte vector is automatically enlarged if necessary.
+ *
+ * @param longValue a long.
+ * @return this byte vector.
+ */
+ public ByteVector putLong(final long longValue) {
+ int currentLength = length;
+ if (currentLength + 8 > data.length) {
+ enlarge(8);
}
+ byte[] currentData = data;
+ int intValue = (int) (longValue >>> 32);
+ currentData[currentLength++] = (byte) (intValue >>> 24);
+ currentData[currentLength++] = (byte) (intValue >>> 16);
+ currentData[currentLength++] = (byte) (intValue >>> 8);
+ currentData[currentLength++] = (byte) intValue;
+ intValue = (int) longValue;
+ currentData[currentLength++] = (byte) (intValue >>> 24);
+ currentData[currentLength++] = (byte) (intValue >>> 16);
+ currentData[currentLength++] = (byte) (intValue >>> 8);
+ currentData[currentLength++] = (byte) intValue;
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts an UTF8 string into this byte vector. The byte vector is
- * automatically enlarged if necessary.
- *
- * @param s
- * a String whose UTF8 encoded length must be less than 65536.
- * @return this byte vector.
- */
- public ByteVector putUTF8(final String s) {
- int charLength = s.length();
- if (charLength > 65535) {
- throw new IllegalArgumentException();
- }
- int len = length;
- if (len + 2 + charLength > data.length) {
- enlarge(2 + charLength);
- }
- byte[] data = this.data;
- // optimistic algorithm: instead of computing the byte length and then
- // serializing the string (which requires two loops), we assume the byte
- // length is equal to char length (which is the most frequent case), and
- // we start serializing the string right away. During the serialization,
- // if we find that this assumption is wrong, we continue with the
- // general method.
- data[len++] = (byte) (charLength >>> 8);
- data[len++] = (byte) charLength;
- for (int i = 0; i < charLength; ++i) {
- char c = s.charAt(i);
- if (c >= '\001' && c <= '\177') {
- data[len++] = (byte) c;
- } else {
- length = len;
- return encodeUTF8(s, i, 65535);
- }
- }
- length = len;
- return this;
+ /**
+ * Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if
+ * necessary.
+ *
+ * @param stringValue a String whose UTF8 encoded length must be less than 65536.
+ * @return this byte vector.
+ */
+ // DontCheck(AbbreviationAsWordInName): can't be renamed (for backward binary compatibility).
+ public ByteVector putUTF8(final String stringValue) {
+ int charLength = stringValue.length();
+ if (charLength > 65535) {
+ throw new IllegalArgumentException("UTF8 string too large");
}
+ int currentLength = length;
+ if (currentLength + 2 + charLength > data.length) {
+ enlarge(2 + charLength);
+ }
+ byte[] currentData = data;
+ // Optimistic algorithm: instead of computing the byte length and then serializing the string
+ // (which requires two loops), we assume the byte length is equal to char length (which is the
+ // most frequent case), and we start serializing the string right away. During the
+ // serialization, if we find that this assumption is wrong, we continue with the general method.
+ currentData[currentLength++] = (byte) (charLength >>> 8);
+ currentData[currentLength++] = (byte) charLength;
+ for (int i = 0; i < charLength; ++i) {
+ char charValue = stringValue.charAt(i);
+ if (charValue >= '\u0001' && charValue <= '\u007F') {
+ currentData[currentLength++] = (byte) charValue;
+ } else {
+ length = currentLength;
+ return encodeUtf8(stringValue, i, 65535);
+ }
+ }
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts an UTF8 string into this byte vector. The byte vector is
- * automatically enlarged if necessary. The string length is encoded in two
- * bytes before the encoded characters, if there is space for that (i.e. if
- * this.length - i - 2 >= 0).
- *
- * @param s
- * the String to encode.
- * @param i
- * the index of the first character to encode. The previous
- * characters are supposed to have already been encoded, using
- * only one byte per character.
- * @param maxByteLength
- * the maximum byte length of the encoded string, including the
- * already encoded characters.
- * @return this byte vector.
- */
- ByteVector encodeUTF8(final String s, int i, int maxByteLength) {
- int charLength = s.length();
- int byteLength = i;
- char c;
- for (int j = i; j < charLength; ++j) {
- c = s.charAt(j);
- if (c >= '\001' && c <= '\177') {
- byteLength++;
- } else if (c > '\u07FF') {
- byteLength += 3;
- } else {
- byteLength += 2;
- }
- }
- if (byteLength > maxByteLength) {
- throw new IllegalArgumentException();
- }
- int start = length - i - 2;
- if (start >= 0) {
- data[start] = (byte) (byteLength >>> 8);
- data[start + 1] = (byte) byteLength;
- }
- if (length + byteLength - i > data.length) {
- enlarge(byteLength - i);
- }
- int len = length;
- for (int j = i; j < charLength; ++j) {
- c = s.charAt(j);
- if (c >= '\001' && c <= '\177') {
- data[len++] = (byte) c;
- } else if (c > '\u07FF') {
- data[len++] = (byte) (0xE0 | c >> 12 & 0xF);
- data[len++] = (byte) (0x80 | c >> 6 & 0x3F);
- data[len++] = (byte) (0x80 | c & 0x3F);
- } else {
- data[len++] = (byte) (0xC0 | c >> 6 & 0x1F);
- data[len++] = (byte) (0x80 | c & 0x3F);
- }
- }
- length = len;
- return this;
+ /**
+ * Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if
+ * necessary. The string length is encoded in two bytes before the encoded characters, if there is
+ * space for that (i.e. if this.length - offset - 2 >= 0).
+ *
+ * @param stringValue the String to encode.
+ * @param offset the index of the first character to encode. The previous characters are supposed
+ * to have already been encoded, using only one byte per character.
+ * @param maxByteLength the maximum byte length of the encoded string, including the already
+ * encoded characters.
+ * @return this byte vector.
+ */
+ final ByteVector encodeUtf8(final String stringValue, final int offset, final int maxByteLength) {
+ int charLength = stringValue.length();
+ int byteLength = offset;
+ for (int i = offset; i < charLength; ++i) {
+ char charValue = stringValue.charAt(i);
+ if (charValue >= 0x0001 && charValue <= 0x007F) {
+ byteLength++;
+ } else if (charValue <= 0x07FF) {
+ byteLength += 2;
+ } else {
+ byteLength += 3;
+ }
}
+ if (byteLength > maxByteLength) {
+ throw new IllegalArgumentException("UTF8 string too large");
+ }
+ // Compute where 'byteLength' must be stored in 'data', and store it at this location.
+ int byteLengthOffset = length - offset - 2;
+ if (byteLengthOffset >= 0) {
+ data[byteLengthOffset] = (byte) (byteLength >>> 8);
+ data[byteLengthOffset + 1] = (byte) byteLength;
+ }
+ if (length + byteLength - offset > data.length) {
+ enlarge(byteLength - offset);
+ }
+ int currentLength = length;
+ for (int i = offset; i < charLength; ++i) {
+ char charValue = stringValue.charAt(i);
+ if (charValue >= 0x0001 && charValue <= 0x007F) {
+ data[currentLength++] = (byte) charValue;
+ } else if (charValue <= 0x07FF) {
+ data[currentLength++] = (byte) (0xC0 | charValue >> 6 & 0x1F);
+ data[currentLength++] = (byte) (0x80 | charValue & 0x3F);
+ } else {
+ data[currentLength++] = (byte) (0xE0 | charValue >> 12 & 0xF);
+ data[currentLength++] = (byte) (0x80 | charValue >> 6 & 0x3F);
+ data[currentLength++] = (byte) (0x80 | charValue & 0x3F);
+ }
+ }
+ length = currentLength;
+ return this;
+ }
- /**
- * Puts an array of bytes into this byte vector. The byte vector is
- * automatically enlarged if necessary.
- *
- * @param b
- * an array of bytes. May be <tt>null</tt> to put <tt>len</tt>
- * null bytes into this byte vector.
- * @param off
- * index of the fist byte of b that must be copied.
- * @param len
- * number of bytes of b that must be copied.
- * @return this byte vector.
- */
- public ByteVector putByteArray(final byte[] b, final int off, final int len) {
- if (length + len > data.length) {
- enlarge(len);
- }
- if (b != null) {
- System.arraycopy(b, off, data, length, len);
- }
- length += len;
- return this;
+ /**
+ * Puts an array of bytes into this byte vector. The byte vector is automatically enlarged if
+ * necessary.
+ *
+ * @param byteArrayValue an array of bytes. May be {@literal null} to put {@code byteLength} null
+ * bytes into this byte vector.
+ * @param byteOffset index of the first byte of byteArrayValue that must be copied.
+ * @param byteLength number of bytes of byteArrayValue that must be copied.
+ * @return this byte vector.
+ */
+ public ByteVector putByteArray(
+ final byte[] byteArrayValue, final int byteOffset, final int byteLength) {
+ if (length + byteLength > data.length) {
+ enlarge(byteLength);
}
+ if (byteArrayValue != null) {
+ System.arraycopy(byteArrayValue, byteOffset, data, length, byteLength);
+ }
+ length += byteLength;
+ return this;
+ }
- /**
- * Enlarge this byte vector so that it can receive n more bytes.
- *
- * @param size
- * number of additional bytes that this byte vector should be
- * able to receive.
- */
- private void enlarge(final int size) {
- int length1 = 2 * data.length;
- int length2 = length + size;
- byte[] newData = new byte[length1 > length2 ? length1 : length2];
- System.arraycopy(data, 0, newData, 0, length);
- data = newData;
- }
+ /**
+ * Enlarges this byte vector so that it can receive 'size' more bytes.
+ *
+ * @param size number of additional bytes that this byte vector should be able to receive.
+ */
+ private void enlarge(final int size) {
+ int doubleCapacity = 2 * data.length;
+ int minimalCapacity = length + size;
+ byte[] newData = new byte[doubleCapacity > minimalCapacity ? doubleCapacity : minimalCapacity];
+ System.arraycopy(data, 0, newData, 0, length);
+ data = newData;
+ }
}
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 6246bcf..29e9b7a 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
@@ -1,2507 +1,3625 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.logging.Logger;
/**
- * A Java class parser to make a {@link ClassVisitor} visit an existing class.
- * This class parses a byte array conforming to the Java class file format and
- * calls the appropriate visit methods of a given class visitor for each field,
- * method and bytecode instruction encountered.
+ * A parser to make a {@link ClassVisitor} visit a ClassFile structure, as defined in the Java
+ * Virtual Machine Specification (JVMS). This class parses the ClassFile content and calls the
+ * appropriate visit methods of a given {@link ClassVisitor} for each field, method and bytecode
+ * instruction encountered.
*
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html">JVMS 4</a>
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
public class ClassReader {
- /**
- * True to enable signatures support.
- */
- static final boolean SIGNATURES = true;
+ private static final Logger LOGGER = Logger.getLogger(ClassReader.class.getName());
- /**
- * True to enable annotations support.
- */
- static final boolean ANNOTATIONS = true;
+ /**
+ * A flag to skip the Code attributes. If this flag is set the Code attributes are neither parsed
+ * nor visited.
+ */
+ public static final int SKIP_CODE = 1;
- /**
- * True to enable stack map frames support.
- */
- static final boolean FRAMES = true;
+ /**
+ * A flag to skip the SourceFile, SourceDebugExtension, LocalVariableTable, LocalVariableTypeTable
+ * and LineNumberTable attributes. If this flag is set these attributes are neither parsed nor
+ * visited (i.e. {@link ClassVisitor#visitSource}, {@link MethodVisitor#visitLocalVariable} and
+ * {@link MethodVisitor#visitLineNumber} are not called).
+ */
+ public static final int SKIP_DEBUG = 2;
- /**
- * True to enable bytecode writing support.
- */
- static final boolean WRITER = true;
+ /**
+ * A flag to skip the StackMap and StackMapTable attributes. If this flag is set these attributes
+ * are neither parsed nor visited (i.e. {@link MethodVisitor#visitFrame} is not called). This flag
+ * is useful when the {@link ClassWriter#COMPUTE_FRAMES} option is used: it avoids visiting frames
+ * that will be ignored and recomputed from scratch.
+ */
+ public static final int SKIP_FRAMES = 4;
- /**
- * True to enable JSR_W and GOTO_W support.
- */
- static final boolean RESIZE = true;
+ /**
+ * A flag to expand the stack map frames. By default stack map frames are visited in their
+ * original format (i.e. "expanded" for classes whose version is less than V1_6, and "compressed"
+ * for the other classes). If this flag is set, stack map frames are always visited in expanded
+ * format (this option adds a decompression/compression step in ClassReader and ClassWriter which
+ * degrades performance quite a lot).
+ */
+ public static final int EXPAND_FRAMES = 8;
- /**
- * Flag to skip method code. If this class is set <code>CODE</code>
- * attribute won't be visited. This can be used, for example, to retrieve
- * annotations for methods and method parameters.
- */
- public static final int SKIP_CODE = 1;
+ /**
+ * A flag to expand the ASM specific instructions into an equivalent sequence of standard bytecode
+ * instructions. When resolving a forward jump it may happen that the signed 2 bytes offset
+ * reserved for it is not sufficient to store the bytecode offset. In this case the jump
+ * instruction is replaced with a temporary ASM specific instruction using an unsigned 2 bytes
+ * offset (see {@link Label#resolve}). This internal flag is used to re-read classes containing
+ * such instructions, in order to replace them with standard instructions. In addition, when this
+ * flag is used, goto_w and jsr_w are <i>not</i> converted into goto and jsr, to make sure that
+ * infinite loops where a goto_w is replaced with a goto in ClassReader and converted back to a
+ * goto_w in ClassWriter cannot occur.
+ */
+ static final int EXPAND_ASM_INSNS = 256;
- /**
- * Flag to skip the debug information in the class. If this flag is set the
- * debug information of the class is not visited, i.e. the
- * {@link MethodVisitor#visitLocalVariable visitLocalVariable} and
- * {@link MethodVisitor#visitLineNumber visitLineNumber} methods will not be
- * called.
- */
- public static final int SKIP_DEBUG = 2;
+ /** The size of the temporary byte array used to read class input streams chunk by chunk. */
+ private static final int INPUT_STREAM_DATA_CHUNK_SIZE = 4096;
- /**
- * Flag to skip the stack map frames in the class. If this flag is set the
- * stack map frames of the class is not visited, i.e. the
- * {@link MethodVisitor#visitFrame visitFrame} method will not be called.
- * This flag is useful when the {@link ClassWriter#COMPUTE_FRAMES} option is
- * used: it avoids visiting frames that will be ignored and recomputed from
- * scratch in the class writer.
- */
- public static final int SKIP_FRAMES = 4;
+ /**
+ * A byte array containing the JVMS ClassFile structure to be parsed.
+ *
+ * @deprecated Use {@link #readByte(int)} and the other read methods instead. This field will
+ * eventually be deleted.
+ */
+ @Deprecated
+ // DontCheck(MemberName): can't be renamed (for backward binary compatibility).
+ public final byte[] b;
- /**
- * Flag to expand the stack map frames. By default stack map frames are
- * visited in their original format (i.e. "expanded" for classes whose
- * version is less than V1_6, and "compressed" for the other classes). If
- * this flag is set, stack map frames are always visited in expanded format
- * (this option adds a decompression/recompression step in ClassReader and
- * ClassWriter which degrades performances quite a lot).
- */
- public static final int EXPAND_FRAMES = 8;
+ /**
+ * A byte array containing the JVMS ClassFile structure to be parsed. <i>The content of this array
+ * must not be modified. This field is intended for {@link Attribute} sub classes, and is normally
+ * not needed by class visitors.</i>
+ *
+ * <p>NOTE: the ClassFile structure can start at any offset within this array, i.e. it does not
+ * necessarily start at offset 0. Use {@link #getItem} and {@link #header} to get correct
+ * ClassFile element offsets within this byte array.
+ */
+ final byte[] classFileBuffer;
- /**
- * The class to be parsed. <i>The content of this array must not be
- * modified. This field is intended for {@link Attribute} sub classes, and
- * is normally not needed by class generators or adapters.</i>
- */
- public final byte[] b;
+ /**
+ * The offset in bytes, in {@link #classFileBuffer}, of each cp_info entry of the ClassFile's
+ * constant_pool array, <i>plus one</i>. In other words, the offset of constant pool entry i is
+ * given by cpInfoOffsets[i] - 1, i.e. its cp_info's tag field is given by b[cpInfoOffsets[i] -
+ * 1].
+ */
+ private final int[] cpInfoOffsets;
- /**
- * The start index of each constant pool item in {@link #b b}, plus one. The
- * one byte offset skips the constant pool item tag that indicates its type.
- */
- private final int[] items;
+ /**
+ * The String objects corresponding to the CONSTANT_Utf8 constant pool items. This cache avoids
+ * multiple parsing of a given CONSTANT_Utf8 constant pool item.
+ */
+ private final String[] constantUtf8Values;
- /**
- * The String objects corresponding to the CONSTANT_Utf8 items. This cache
- * avoids multiple parsing of a given CONSTANT_Utf8 constant pool item,
- * which GREATLY improves performances (by a factor 2 to 3). This caching
- * strategy could be extended to all constant pool items, but its benefit
- * would not be so great for these items (because they are much less
- * expensive to parse than CONSTANT_Utf8 items).
- */
- private final String[] strings;
+ /**
+ * The ConstantDynamic objects corresponding to the CONSTANT_Dynamic constant pool items. This
+ * cache avoids multiple parsing of a given CONSTANT_Dynamic constant pool item.
+ */
+ private final ConstantDynamic[] constantDynamicValues;
- /**
- * Maximum length of the strings contained in the constant pool of the
- * class.
- */
- private final int maxStringLength;
+ /**
+ * The start offsets in {@link #classFileBuffer} of each element of the bootstrap_methods array
+ * (in the BootstrapMethods attribute).
+ *
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.23">JVMS
+ * 4.7.23</a>
+ */
+ private final int[] bootstrapMethodOffsets;
- /**
- * Start index of the class header information (access, name...) in
- * {@link #b b}.
- */
- public final int header;
+ /**
+ * A conservative estimate of the maximum length of the strings contained in the constant pool of
+ * the class.
+ */
+ private final int maxStringLength;
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
+ /** The offset in bytes of the ClassFile's access_flags field. */
+ public final int header;
- /**
- * Constructs a new {@link ClassReader} object.
- *
- * @param b
- * the bytecode of the class to be read.
- */
- public ClassReader(final byte[] b) {
- this(b, 0, b.length);
+ // -----------------------------------------------------------------------------------------------
+ // Constructors
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Constructs a new {@link ClassReader} object.
+ *
+ * @param classFile the JVMS ClassFile structure to be read.
+ */
+ public ClassReader(final byte[] classFile) {
+ this(classFile, 0, classFile.length);
+ }
+
+ /**
+ * Constructs a new {@link ClassReader} object.
+ *
+ * @param classFileBuffer a byte array containing the JVMS ClassFile structure to be read.
+ * @param classFileOffset the offset in byteBuffer of the first byte of the ClassFile to be read.
+ * @param classFileLength the length in bytes of the ClassFile to be read.
+ */
+ public ClassReader(
+ final byte[] classFileBuffer,
+ final int classFileOffset,
+ final int classFileLength) { // NOPMD(UnusedFormalParameter) used for backward compatibility.
+ this(classFileBuffer, classFileOffset, /* checkClassVersion = */ true);
+ }
+
+ /**
+ * Constructs a new {@link ClassReader} object. <i>This internal constructor must not be exposed
+ * as a public API</i>.
+ *
+ * @param classFileBuffer a byte array containing the JVMS ClassFile structure to be read.
+ * @param classFileOffset the offset in byteBuffer of the first byte of the ClassFile to be read.
+ * @param checkClassVersion whether to check the class version or not.
+ */
+ ClassReader(
+ final byte[] classFileBuffer, final int classFileOffset, final boolean checkClassVersion) {
+ this.classFileBuffer = classFileBuffer;
+ 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.V14) {
+ LOGGER.warning("Unsupported class file major version " + readShort(classFileOffset + 6));
+ }
+ if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V14) {
+ throw new IllegalArgumentException(
+ "Unsupported class file major version " + readShort(classFileOffset + 6));
+ }
+ // Create the constant pool arrays. The constant_pool_count field is after the magic,
+ // minor_version and major_version fields, which use 4, 2 and 2 bytes respectively.
+ int constantPoolCount = readUnsignedShort(classFileOffset + 8);
+ cpInfoOffsets = new int[constantPoolCount];
+ constantUtf8Values = new String[constantPoolCount];
+ // Compute the offset of each constant pool entry, as well as a conservative estimate of the
+ // maximum length of the constant pool strings. The first constant pool entry is after the
+ // magic, minor_version, major_version and constant_pool_count fields, which use 4, 2, 2 and 2
+ // bytes respectively.
+ int currentCpInfoIndex = 1;
+ int currentCpInfoOffset = classFileOffset + 10;
+ int currentMaxStringLength = 0;
+ boolean hasBootstrapMethods = false;
+ boolean hasConstantDynamic = false;
+ // The offset of the other entries depend on the total size of all the previous entries.
+ while (currentCpInfoIndex < constantPoolCount) {
+ cpInfoOffsets[currentCpInfoIndex++] = currentCpInfoOffset + 1;
+ int cpInfoSize;
+ switch (classFileBuffer[currentCpInfoOffset]) {
+ case Symbol.CONSTANT_FIELDREF_TAG:
+ case Symbol.CONSTANT_METHODREF_TAG:
+ case Symbol.CONSTANT_INTERFACE_METHODREF_TAG:
+ case Symbol.CONSTANT_INTEGER_TAG:
+ case Symbol.CONSTANT_FLOAT_TAG:
+ case Symbol.CONSTANT_NAME_AND_TYPE_TAG:
+ cpInfoSize = 5;
+ break;
+ case Symbol.CONSTANT_DYNAMIC_TAG:
+ cpInfoSize = 5;
+ hasBootstrapMethods = true;
+ hasConstantDynamic = true;
+ break;
+ case Symbol.CONSTANT_INVOKE_DYNAMIC_TAG:
+ cpInfoSize = 5;
+ hasBootstrapMethods = true;
+ break;
+ case Symbol.CONSTANT_LONG_TAG:
+ case Symbol.CONSTANT_DOUBLE_TAG:
+ cpInfoSize = 9;
+ currentCpInfoIndex++;
+ break;
+ case Symbol.CONSTANT_UTF8_TAG:
+ cpInfoSize = 3 + readUnsignedShort(currentCpInfoOffset + 1);
+ if (cpInfoSize > currentMaxStringLength) {
+ // The size in bytes of this CONSTANT_Utf8 structure provides a conservative estimate
+ // of the length in characters of the corresponding string, and is much cheaper to
+ // compute than this exact length.
+ currentMaxStringLength = cpInfoSize;
+ }
+ break;
+ case Symbol.CONSTANT_METHOD_HANDLE_TAG:
+ cpInfoSize = 4;
+ break;
+ case Symbol.CONSTANT_CLASS_TAG:
+ case Symbol.CONSTANT_STRING_TAG:
+ case Symbol.CONSTANT_METHOD_TYPE_TAG:
+ case Symbol.CONSTANT_PACKAGE_TAG:
+ case Symbol.CONSTANT_MODULE_TAG:
+ cpInfoSize = 3;
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ currentCpInfoOffset += cpInfoSize;
+ }
+ maxStringLength = currentMaxStringLength;
+ // The Classfile's access_flags field is just after the last constant pool entry.
+ header = currentCpInfoOffset;
+
+ // Allocate the cache of ConstantDynamic values, if there is at least one.
+ constantDynamicValues = hasConstantDynamic ? new ConstantDynamic[constantPoolCount] : null;
+
+ // Read the BootstrapMethods attribute, if any (only get the offset of each method).
+ bootstrapMethodOffsets =
+ hasBootstrapMethods ? readBootstrapMethodsAttribute(currentMaxStringLength) : null;
+ }
+
+ /**
+ * Constructs a new {@link ClassReader} object.
+ *
+ * @param inputStream an input stream of the JVMS ClassFile structure to be read. This input
+ * stream must contain nothing more than the ClassFile structure itself. It is read from its
+ * current position to its end.
+ * @throws IOException if a problem occurs during reading.
+ */
+ public ClassReader(final InputStream inputStream) throws IOException {
+ this(readStream(inputStream, false));
+ }
+
+ /**
+ * Constructs a new {@link ClassReader} object.
+ *
+ * @param className the fully qualified name of the class to be read. The ClassFile structure is
+ * retrieved with the current class loader's {@link ClassLoader#getSystemResourceAsStream}.
+ * @throws IOException if an exception occurs during reading.
+ */
+ public ClassReader(final String className) throws IOException {
+ this(
+ readStream(
+ ClassLoader.getSystemResourceAsStream(className.replace('.', '/') + ".class"), true));
+ }
+
+ /**
+ * Reads the given input stream and returns its content as a byte array.
+ *
+ * @param inputStream an input stream.
+ * @param close true to close the input stream after reading.
+ * @return the content of the given input stream.
+ * @throws IOException if a problem occurs during reading.
+ */
+ private static byte[] readStream(final InputStream inputStream, final boolean close)
+ throws IOException {
+ if (inputStream == null) {
+ throw new IOException("Class not found");
+ }
+ try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
+ byte[] data = new byte[INPUT_STREAM_DATA_CHUNK_SIZE];
+ int bytesRead;
+ while ((bytesRead = inputStream.read(data, 0, data.length)) != -1) {
+ outputStream.write(data, 0, bytesRead);
+ }
+ outputStream.flush();
+ return outputStream.toByteArray();
+ } finally {
+ if (close) {
+ inputStream.close();
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Accessors
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the class's access flags (see {@link Opcodes}). This value may not reflect Deprecated
+ * and Synthetic flags when bytecode is before 1.5 and those flags are represented by attributes.
+ *
+ * @return the class access flags.
+ * @see ClassVisitor#visit(int, int, String, String, String, String[])
+ */
+ public int getAccess() {
+ return readUnsignedShort(header);
+ }
+
+ /**
+ * Returns the internal name of the class (see {@link Type#getInternalName()}).
+ *
+ * @return the internal class name.
+ * @see ClassVisitor#visit(int, int, String, String, String, String[])
+ */
+ public String getClassName() {
+ // this_class is just after the access_flags field (using 2 bytes).
+ return readClass(header + 2, new char[maxStringLength]);
+ }
+
+ /**
+ * Returns the internal of name of the super class (see {@link Type#getInternalName()}). For
+ * interfaces, the super class is {@link Object}.
+ *
+ * @return the internal name of the super class, or {@literal null} for {@link Object} class.
+ * @see ClassVisitor#visit(int, int, String, String, String, String[])
+ */
+ public String getSuperName() {
+ // super_class is after the access_flags and this_class fields (2 bytes each).
+ return readClass(header + 4, new char[maxStringLength]);
+ }
+
+ /**
+ * Returns the internal names of the implemented interfaces (see {@link Type#getInternalName()}).
+ *
+ * @return the internal names of the directly implemented interfaces. Inherited implemented
+ * interfaces are not returned.
+ * @see ClassVisitor#visit(int, int, String, String, String, String[])
+ */
+ public String[] getInterfaces() {
+ // interfaces_count is after the access_flags, this_class and super_class fields (2 bytes each).
+ int currentOffset = header + 6;
+ int interfacesCount = readUnsignedShort(currentOffset);
+ String[] interfaces = new String[interfacesCount];
+ if (interfacesCount > 0) {
+ char[] charBuffer = new char[maxStringLength];
+ for (int i = 0; i < interfacesCount; ++i) {
+ currentOffset += 2;
+ interfaces[i] = readClass(currentOffset, charBuffer);
+ }
+ }
+ return interfaces;
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Public methods
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Makes the given visitor visit the JVMS ClassFile structure passed to the constructor of this
+ * {@link ClassReader}.
+ *
+ * @param classVisitor the visitor that must visit this class.
+ * @param parsingOptions the options to use to parse this class. One or more of {@link
+ * #SKIP_CODE}, {@link #SKIP_DEBUG}, {@link #SKIP_FRAMES} or {@link #EXPAND_FRAMES}.
+ */
+ public void accept(final ClassVisitor classVisitor, final int parsingOptions) {
+ accept(classVisitor, new Attribute[0], parsingOptions);
+ }
+
+ /**
+ * Makes the given visitor visit the JVMS ClassFile structure passed to the constructor of this
+ * {@link ClassReader}.
+ *
+ * @param classVisitor the visitor that must visit this class.
+ * @param attributePrototypes prototypes of the attributes that must be parsed during the visit of
+ * the class. Any attribute whose type is not equal to the type of one the prototypes will not
+ * be parsed: its byte array value will be passed unchanged to the ClassWriter. <i>This may
+ * corrupt it if this value contains references to the constant pool, or has syntactic or
+ * semantic links with a class element that has been transformed by a class adapter between
+ * the reader and the writer</i>.
+ * @param parsingOptions the options to use to parse this class. One or more of {@link
+ * #SKIP_CODE}, {@link #SKIP_DEBUG}, {@link #SKIP_FRAMES} or {@link #EXPAND_FRAMES}.
+ */
+ public void accept(
+ final ClassVisitor classVisitor,
+ final Attribute[] attributePrototypes,
+ final int parsingOptions) {
+ Context context = new Context();
+ context.attributePrototypes = attributePrototypes;
+ context.parsingOptions = parsingOptions;
+ context.charBuffer = new char[maxStringLength];
+
+ // Read the access_flags, this_class, super_class, interface_count and interfaces fields.
+ char[] charBuffer = context.charBuffer;
+ int currentOffset = header;
+ int accessFlags = readUnsignedShort(currentOffset);
+ String thisClass = readClass(currentOffset + 2, charBuffer);
+ String superClass = readClass(currentOffset + 4, charBuffer);
+ String[] interfaces = new String[readUnsignedShort(currentOffset + 6)];
+ currentOffset += 8;
+ for (int i = 0; i < interfaces.length; ++i) {
+ interfaces[i] = readClass(currentOffset, charBuffer);
+ currentOffset += 2;
}
- /**
- * Constructs a new {@link ClassReader} object.
- *
- * @param b
- * the bytecode of the class to be read.
- * @param off
- * the start offset of the class data.
- * @param len
- * the length of the class data.
- */
- public ClassReader(final byte[] b, final int off, final int len) {
- this.b = b;
- // checks the class version
- // added "support" for java 11 compiled classes
- if (readShort(off + 6) > Opcodes.V12) {
- throw new IllegalArgumentException();
- }
- // parses the constant pool
- items = new int[readUnsignedShort(off + 8)];
- int n = items.length;
- strings = new String[n];
- int max = 0;
- int index = off + 10;
- for (int i = 1; i < n; ++i) {
- items[i] = index + 1;
- int size;
- switch (b[index]) {
- case ClassWriter.FIELD:
- case ClassWriter.METH:
- case ClassWriter.IMETH:
- case ClassWriter.INT:
- case ClassWriter.FLOAT:
- case ClassWriter.NAME_TYPE:
- case ClassWriter.INDY:
- size = 5;
- break;
- case ClassWriter.LONG:
- case ClassWriter.DOUBLE:
- size = 9;
- ++i;
- break;
- case ClassWriter.UTF8:
- size = 3 + readUnsignedShort(index + 1);
- if (size > max) {
- max = size;
- }
- break;
- case ClassWriter.HANDLE:
- size = 4;
- break;
- // case ClassWriter.CLASS:
- // case ClassWriter.STR:
- // case ClassWriter.MTYPE
- default:
- size = 3;
- break;
- }
- index += size;
- }
- maxStringLength = max;
- // the class header information starts just after the constant pool
- header = index;
+ // Read the class attributes (the variables are ordered as in Section 4.7 of the JVMS).
+ // Attribute offsets exclude the attribute_name_index and attribute_length fields.
+ // - The offset of the InnerClasses attribute, or 0.
+ int innerClassesOffset = 0;
+ // - The offset of the EnclosingMethod attribute, or 0.
+ int enclosingMethodOffset = 0;
+ // - The string corresponding to the Signature attribute, or null.
+ String signature = null;
+ // - The string corresponding to the SourceFile attribute, or null.
+ String sourceFile = null;
+ // - The string corresponding to the SourceDebugExtension attribute, or null.
+ String sourceDebugExtension = null;
+ // - The offset of the RuntimeVisibleAnnotations attribute, or 0.
+ int runtimeVisibleAnnotationsOffset = 0;
+ // - The offset of the RuntimeInvisibleAnnotations attribute, or 0.
+ int runtimeInvisibleAnnotationsOffset = 0;
+ // - The offset of the RuntimeVisibleTypeAnnotations attribute, or 0.
+ int runtimeVisibleTypeAnnotationsOffset = 0;
+ // - The offset of the RuntimeInvisibleTypeAnnotations attribute, or 0.
+ int runtimeInvisibleTypeAnnotationsOffset = 0;
+ // - The offset of the Module attribute, or 0.
+ int moduleOffset = 0;
+ // - The offset of the ModulePackages attribute, or 0.
+ int modulePackagesOffset = 0;
+ // - The string corresponding to the ModuleMainClass attribute, or null.
+ String moduleMainClass = null;
+ // - The string corresponding to the NestHost attribute, or null.
+ String nestHostClass = null;
+ // - The offset of the NestMembers attribute, or 0.
+ int nestMembersOffset = 0;
+ // - The non standard attributes (linked with their {@link Attribute#nextAttribute} field).
+ // This list in the <i>reverse order</i> or their order in the ClassFile structure.
+ Attribute attributes = null;
+
+ int currentAttributeOffset = getFirstAttributeOffset();
+ for (int i = readUnsignedShort(currentAttributeOffset - 2); i > 0; --i) {
+ // Read the attribute_info's attribute_name and attribute_length fields.
+ String attributeName = readUTF8(currentAttributeOffset, charBuffer);
+ int attributeLength = readInt(currentAttributeOffset + 2);
+ currentAttributeOffset += 6;
+ // The tests are sorted in decreasing frequency order (based on frequencies observed on
+ // typical classes).
+ if (Constants.SOURCE_FILE.equals(attributeName)) {
+ sourceFile = readUTF8(currentAttributeOffset, charBuffer);
+ } else if (Constants.INNER_CLASSES.equals(attributeName)) {
+ innerClassesOffset = currentAttributeOffset;
+ } else if (Constants.ENCLOSING_METHOD.equals(attributeName)) {
+ enclosingMethodOffset = currentAttributeOffset;
+ } else if (Constants.NEST_HOST.equals(attributeName)) {
+ nestHostClass = readClass(currentAttributeOffset, charBuffer);
+ } else if (Constants.NEST_MEMBERS.equals(attributeName)) {
+ nestMembersOffset = currentAttributeOffset;
+ } else if (Constants.SIGNATURE.equals(attributeName)) {
+ signature = readUTF8(currentAttributeOffset, charBuffer);
+ } else if (Constants.RUNTIME_VISIBLE_ANNOTATIONS.equals(attributeName)) {
+ runtimeVisibleAnnotationsOffset = currentAttributeOffset;
+ } else if (Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
+ runtimeVisibleTypeAnnotationsOffset = currentAttributeOffset;
+ } else if (Constants.DEPRECATED.equals(attributeName)) {
+ accessFlags |= Opcodes.ACC_DEPRECATED;
+ } else if (Constants.SYNTHETIC.equals(attributeName)) {
+ accessFlags |= Opcodes.ACC_SYNTHETIC;
+ } else if (Constants.SOURCE_DEBUG_EXTENSION.equals(attributeName)) {
+ sourceDebugExtension =
+ readUtf(currentAttributeOffset, attributeLength, new char[attributeLength]);
+ } else if (Constants.RUNTIME_INVISIBLE_ANNOTATIONS.equals(attributeName)) {
+ runtimeInvisibleAnnotationsOffset = currentAttributeOffset;
+ } else if (Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
+ runtimeInvisibleTypeAnnotationsOffset = currentAttributeOffset;
+ } else if (Constants.MODULE.equals(attributeName)) {
+ moduleOffset = currentAttributeOffset;
+ } else if (Constants.MODULE_MAIN_CLASS.equals(attributeName)) {
+ moduleMainClass = readClass(currentAttributeOffset, charBuffer);
+ } else if (Constants.MODULE_PACKAGES.equals(attributeName)) {
+ modulePackagesOffset = currentAttributeOffset;
+ } else if (!Constants.BOOTSTRAP_METHODS.equals(attributeName)) {
+ // The BootstrapMethods attribute is read in the constructor.
+ Attribute attribute =
+ readAttribute(
+ attributePrototypes,
+ attributeName,
+ currentAttributeOffset,
+ attributeLength,
+ charBuffer,
+ -1,
+ null);
+ attribute.nextAttribute = attributes;
+ attributes = attribute;
+ }
+ currentAttributeOffset += attributeLength;
}
- /**
- * Returns the class's access flags (see {@link Opcodes}). This value may
- * not reflect Deprecated and Synthetic flags when bytecode is before 1.5
- * and those flags are represented by attributes.
- *
- * @return the class access flags
- *
- * @see ClassVisitor#visit(int, int, String, String, String, String[])
- */
- public int getAccess() {
- return readUnsignedShort(header);
+ // Visit the class declaration. The minor_version and major_version fields start 6 bytes before
+ // the first constant pool entry, which itself starts at cpInfoOffsets[1] - 1 (by definition).
+ classVisitor.visit(
+ readInt(cpInfoOffsets[1] - 7), accessFlags, thisClass, signature, superClass, interfaces);
+
+ // Visit the SourceFile and SourceDebugExtenstion attributes.
+ if ((parsingOptions & SKIP_DEBUG) == 0
+ && (sourceFile != null || sourceDebugExtension != null)) {
+ classVisitor.visitSource(sourceFile, sourceDebugExtension);
}
- /**
- * Returns the internal name of the class (see
- * {@link Type#getInternalName() getInternalName}).
- *
- * @return the internal class name
- *
- * @see ClassVisitor#visit(int, int, String, String, String, String[])
- */
- public String getClassName() {
- return readClass(header + 2, new char[maxStringLength]);
+ // Visit the Module, ModulePackages and ModuleMainClass attributes.
+ if (moduleOffset != 0) {
+ readModuleAttributes(
+ classVisitor, context, moduleOffset, modulePackagesOffset, moduleMainClass);
}
- /**
- * Returns the internal of name of the super class (see
- * {@link Type#getInternalName() getInternalName}). For interfaces, the
- * super class is {@link Object}.
- *
- * @return the internal name of super class, or <tt>null</tt> for
- * {@link Object} class.
- *
- * @see ClassVisitor#visit(int, int, String, String, String, String[])
- */
- public String getSuperName() {
- return readClass(header + 4, new char[maxStringLength]);
+ // Visit the NestHost attribute.
+ if (nestHostClass != null) {
+ classVisitor.visitNestHost(nestHostClass);
}
- /**
- * Returns the internal names of the class's interfaces (see
- * {@link Type#getInternalName() getInternalName}).
- *
- * @return the array of internal names for all implemented interfaces or
- * <tt>null</tt>.
- *
- * @see ClassVisitor#visit(int, int, String, String, String, String[])
- */
- public String[] getInterfaces() {
- int index = header + 6;
- int n = readUnsignedShort(index);
- String[] interfaces = new String[n];
- if (n > 0) {
- char[] buf = new char[maxStringLength];
- for (int i = 0; i < n; ++i) {
- index += 2;
- interfaces[i] = readClass(index, buf);
- }
- }
- return interfaces;
+ // Visit the EnclosingMethod attribute.
+ if (enclosingMethodOffset != 0) {
+ String className = readClass(enclosingMethodOffset, charBuffer);
+ int methodIndex = readUnsignedShort(enclosingMethodOffset + 2);
+ String name = methodIndex == 0 ? null : readUTF8(cpInfoOffsets[methodIndex], charBuffer);
+ String type = methodIndex == 0 ? null : readUTF8(cpInfoOffsets[methodIndex] + 2, charBuffer);
+ classVisitor.visitOuterClass(className, name, type);
}
- /**
- * Copies the constant pool data into the given {@link ClassWriter}. Should
- * be called before the {@link #accept(ClassVisitor,int)} method.
- *
- * @param classWriter
- * the {@link ClassWriter} to copy constant pool into.
- */
- void copyPool(final ClassWriter classWriter) {
- char[] buf = new char[maxStringLength];
- int ll = items.length;
- Item[] items2 = new Item[ll];
- for (int i = 1; i < ll; i++) {
- int index = items[i];
- int tag = b[index - 1];
- Item item = new Item(i);
- int nameType;
- switch (tag) {
- case ClassWriter.FIELD:
- case ClassWriter.METH:
- case ClassWriter.IMETH:
- nameType = items[readUnsignedShort(index + 2)];
- item.set(tag, readClass(index, buf), readUTF8(nameType, buf),
- readUTF8(nameType + 2, buf));
- break;
- case ClassWriter.INT:
- item.set(readInt(index));
- break;
- case ClassWriter.FLOAT:
- item.set(Float.intBitsToFloat(readInt(index)));
- break;
- case ClassWriter.NAME_TYPE:
- item.set(tag, readUTF8(index, buf), readUTF8(index + 2, buf),
- null);
- break;
- case ClassWriter.LONG:
- item.set(readLong(index));
- ++i;
- break;
- case ClassWriter.DOUBLE:
- item.set(Double.longBitsToDouble(readLong(index)));
- ++i;
- break;
- case ClassWriter.UTF8: {
- String s = strings[i];
- if (s == null) {
- index = items[i];
- s = strings[i] = readUTF(index + 2,
- readUnsignedShort(index), buf);
- }
- item.set(tag, s, null, null);
- break;
- }
- case ClassWriter.HANDLE: {
- int fieldOrMethodRef = items[readUnsignedShort(index + 1)];
- nameType = items[readUnsignedShort(fieldOrMethodRef + 2)];
- item.set(ClassWriter.HANDLE_BASE + readByte(index),
- readClass(fieldOrMethodRef, buf),
- readUTF8(nameType, buf), readUTF8(nameType + 2, buf));
- break;
- }
- case ClassWriter.INDY:
- if (classWriter.bootstrapMethods == null) {
- copyBootstrapMethods(classWriter, items2, buf);
- }
- nameType = items[readUnsignedShort(index + 2)];
- item.set(readUTF8(nameType, buf), readUTF8(nameType + 2, buf),
- readUnsignedShort(index));
- break;
- // case ClassWriter.STR:
- // case ClassWriter.CLASS:
- // case ClassWriter.MTYPE
- default:
- item.set(tag, readUTF8(index, buf), null, null);
- break;
- }
-
- int index2 = item.hashCode % items2.length;
- item.next = items2[index2];
- items2[index2] = item;
- }
-
- int off = items[1] - 1;
- classWriter.pool.putByteArray(b, off, header - off);
- classWriter.items = items2;
- classWriter.threshold = (int) (0.75d * ll);
- classWriter.index = ll;
+ // Visit the RuntimeVisibleAnnotations attribute.
+ if (runtimeVisibleAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeVisibleAnnotationsOffset);
+ int currentAnnotationOffset = runtimeVisibleAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ classVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
}
- /**
- * Copies the bootstrap method data into the given {@link ClassWriter}.
- * Should be called before the {@link #accept(ClassVisitor,int)} method.
- *
- * @param classWriter
- * the {@link ClassWriter} to copy bootstrap methods into.
- */
- private void copyBootstrapMethods(final ClassWriter classWriter,
- final Item[] items, final char[] c) {
- // finds the "BootstrapMethods" attribute
- int u = getAttributes();
- boolean found = false;
- for (int i = readUnsignedShort(u); i > 0; --i) {
- String attrName = readUTF8(u + 2, c);
- if ("BootstrapMethods".equals(attrName)) {
- found = true;
- break;
- }
- u += 6 + readInt(u + 4);
- }
- if (!found) {
- return;
- }
- // copies the bootstrap methods in the class writer
- int boostrapMethodCount = readUnsignedShort(u + 8);
- for (int j = 0, v = u + 10; j < boostrapMethodCount; j++) {
- int position = v - u - 10;
- int hashCode = readConst(readUnsignedShort(v), c).hashCode();
- for (int k = readUnsignedShort(v + 2); k > 0; --k) {
- hashCode ^= readConst(readUnsignedShort(v + 4), c).hashCode();
- v += 2;
- }
- v += 4;
- Item item = new Item(j);
- item.set(position, hashCode & 0x7FFFFFFF);
- int index = item.hashCode % items.length;
- item.next = items[index];
- items[index] = item;
- }
- int attrSize = readInt(u + 4);
- ByteVector bootstrapMethods = new ByteVector(attrSize + 62);
- bootstrapMethods.putByteArray(b, u + 10, attrSize - 2);
- classWriter.bootstrapMethodsCount = boostrapMethodCount;
- classWriter.bootstrapMethods = bootstrapMethods;
+ // Visit the RuntimeInvisibleAnnotations attribute.
+ if (runtimeInvisibleAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeInvisibleAnnotationsOffset);
+ int currentAnnotationOffset = runtimeInvisibleAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ classVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
}
- /**
- * Constructs a new {@link ClassReader} object.
- *
- * @param is
- * an input stream from which to read the class.
- * @throws IOException
- * if a problem occurs during reading.
- */
- public ClassReader(final InputStream is) throws IOException {
- this(readClass(is, false));
+ // Visit the RuntimeVisibleTypeAnnotations attribute.
+ if (runtimeVisibleTypeAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeVisibleTypeAnnotationsOffset);
+ int currentAnnotationOffset = runtimeVisibleTypeAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the target_type, target_info and target_path fields.
+ currentAnnotationOffset = readTypeAnnotationTarget(context, currentAnnotationOffset);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ classVisitor.visitTypeAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ annotationDescriptor,
+ /* visible = */ true),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
}
- /**
- * Constructs a new {@link ClassReader} object.
- *
- * @param name
- * the binary qualified name of the class to be read.
- * @throws IOException
- * if an exception occurs during reading.
- */
- public ClassReader(final String name) throws IOException {
- this(readClass(
- ClassLoader.getSystemResourceAsStream(name.replace('.', '/')
- + ".class"), true));
+ // Visit the RuntimeInvisibleTypeAnnotations attribute.
+ if (runtimeInvisibleTypeAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeInvisibleTypeAnnotationsOffset);
+ int currentAnnotationOffset = runtimeInvisibleTypeAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the target_type, target_info and target_path fields.
+ currentAnnotationOffset = readTypeAnnotationTarget(context, currentAnnotationOffset);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ classVisitor.visitTypeAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ annotationDescriptor,
+ /* visible = */ false),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
}
- /**
- * Reads the bytecode of a class.
- *
- * @param is
- * an input stream from which to read the class.
- * @param close
- * true to close the input stream after reading.
- * @return the bytecode read from the given input stream.
- * @throws IOException
- * if a problem occurs during reading.
- */
- private static byte[] readClass(final InputStream is, boolean close)
- throws IOException {
- if (is == null) {
- throw new IOException("Class not found");
- }
- try {
- byte[] b = new byte[is.available()];
- int len = 0;
- while (true) {
- int n = is.read(b, len, b.length - len);
- if (n == -1) {
- if (len < b.length) {
- byte[] c = new byte[len];
- System.arraycopy(b, 0, c, 0, len);
- b = c;
- }
- return b;
- }
- len += n;
- if (len == b.length) {
- int last = is.read();
- if (last < 0) {
- return b;
- }
- byte[] c = new byte[b.length + 1000];
- System.arraycopy(b, 0, c, 0, len);
- c[len++] = (byte) last;
- b = c;
- }
- }
- } finally {
- if (close) {
- is.close();
- }
- }
+ // Visit the non standard attributes.
+ while (attributes != null) {
+ // Copy and reset the nextAttribute field so that it can also be used in ClassWriter.
+ Attribute nextAttribute = attributes.nextAttribute;
+ attributes.nextAttribute = null;
+ classVisitor.visitAttribute(attributes);
+ attributes = nextAttribute;
}
- // ------------------------------------------------------------------------
- // Public methods
- // ------------------------------------------------------------------------
-
- /**
- * Makes the given visitor visit the Java class of this {@link ClassReader}
- * . This class is the one specified in the constructor (see
- * {@link #ClassReader(byte[]) ClassReader}).
- *
- * @param classVisitor
- * the visitor that must visit this class.
- * @param flags
- * option flags that can be used to modify the default behavior
- * of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES}
- * , {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
- */
- public void accept(final ClassVisitor classVisitor, final int flags) {
- accept(classVisitor, new Attribute[0], flags);
+ // Visit the NestedMembers attribute.
+ if (nestMembersOffset != 0) {
+ int numberOfNestMembers = readUnsignedShort(nestMembersOffset);
+ int currentNestMemberOffset = nestMembersOffset + 2;
+ while (numberOfNestMembers-- > 0) {
+ classVisitor.visitNestMember(readClass(currentNestMemberOffset, charBuffer));
+ currentNestMemberOffset += 2;
+ }
}
- /**
- * Makes the given visitor visit the Java class of this {@link ClassReader}.
- * This class is the one specified in the constructor (see
- * {@link #ClassReader(byte[]) ClassReader}).
- *
- * @param classVisitor
- * the visitor that must visit this class.
- * @param attrs
- * prototypes of the attributes that must be parsed during the
- * visit of the class. Any attribute whose type is not equal to
- * the type of one the prototypes will not be parsed: its byte
- * array value will be passed unchanged to the ClassWriter.
- * <i>This may corrupt it if this value contains references to
- * the constant pool, or has syntactic or semantic links with a
- * class element that has been transformed by a class adapter
- * between the reader and the writer</i>.
- * @param flags
- * option flags that can be used to modify the default behavior
- * of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES}
- * , {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
- */
- public void accept(final ClassVisitor classVisitor,
- final Attribute[] attrs, final int flags) {
- int u = header; // current offset in the class file
- char[] c = new char[maxStringLength]; // buffer used to read strings
-
- Context context = new Context();
- context.attrs = attrs;
- context.flags = flags;
- context.buffer = c;
-
- // reads the class declaration
- int access = readUnsignedShort(u);
- String name = readClass(u + 2, c);
- String superClass = readClass(u + 4, c);
- String[] interfaces = new String[readUnsignedShort(u + 6)];
- u += 8;
- for (int i = 0; i < interfaces.length; ++i) {
- interfaces[i] = readClass(u, c);
- u += 2;
- }
-
- // reads the class attributes
- String signature = null;
- String sourceFile = null;
- String sourceDebug = null;
- String enclosingOwner = null;
- String enclosingName = null;
- String enclosingDesc = null;
- int anns = 0;
- int ianns = 0;
- int tanns = 0;
- int itanns = 0;
- int innerClasses = 0;
- Attribute attributes = null;
-
- u = getAttributes();
- for (int i = readUnsignedShort(u); i > 0; --i) {
- String attrName = readUTF8(u + 2, c);
- // tests are sorted in decreasing frequency order
- // (based on frequencies observed on typical classes)
- if ("SourceFile".equals(attrName)) {
- sourceFile = readUTF8(u + 8, c);
- } else if ("InnerClasses".equals(attrName)) {
- innerClasses = u + 8;
- } else if ("EnclosingMethod".equals(attrName)) {
- enclosingOwner = readClass(u + 8, c);
- int item = readUnsignedShort(u + 10);
- if (item != 0) {
- enclosingName = readUTF8(items[item], c);
- enclosingDesc = readUTF8(items[item] + 2, c);
- }
- } else if (SIGNATURES && "Signature".equals(attrName)) {
- signature = readUTF8(u + 8, c);
- } else if (ANNOTATIONS
- && "RuntimeVisibleAnnotations".equals(attrName)) {
- anns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
- tanns = u + 8;
- } else if ("Deprecated".equals(attrName)) {
- access |= Opcodes.ACC_DEPRECATED;
- } else if ("Synthetic".equals(attrName)) {
- access |= Opcodes.ACC_SYNTHETIC
- | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
- } else if ("SourceDebugExtension".equals(attrName)) {
- int len = readInt(u + 4);
- sourceDebug = readUTF(u + 8, len, new char[len]);
- } else if (ANNOTATIONS
- && "RuntimeInvisibleAnnotations".equals(attrName)) {
- ianns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
- itanns = u + 8;
- } else if ("BootstrapMethods".equals(attrName)) {
- int[] bootstrapMethods = new int[readUnsignedShort(u + 8)];
- for (int j = 0, v = u + 10; j < bootstrapMethods.length; j++) {
- bootstrapMethods[j] = v;
- v += 2 + readUnsignedShort(v + 2) << 1;
- }
- context.bootstrapMethods = bootstrapMethods;
- } else {
- Attribute attr = readAttribute(attrs, attrName, u + 8,
- readInt(u + 4), c, -1, null);
- if (attr != null) {
- attr.next = attributes;
- attributes = attr;
- }
- }
- u += 6 + readInt(u + 4);
- }
-
- // visits the class declaration
- classVisitor.visit(readInt(items[1] - 7), access, name, signature,
- superClass, interfaces);
-
- // visits the source and debug info
- if ((flags & SKIP_DEBUG) == 0
- && (sourceFile != null || sourceDebug != null)) {
- classVisitor.visitSource(sourceFile, sourceDebug);
- }
-
- // visits the outer class
- if (enclosingOwner != null) {
- classVisitor.visitOuterClass(enclosingOwner, enclosingName,
- enclosingDesc);
- }
-
- // visits the class annotations and type annotations
- if (ANNOTATIONS && anns != 0) {
- for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
- v = readAnnotationValues(v + 2, c, true,
- classVisitor.visitAnnotation(readUTF8(v, c), true));
- }
- }
- if (ANNOTATIONS && ianns != 0) {
- for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
- v = readAnnotationValues(v + 2, c, true,
- classVisitor.visitAnnotation(readUTF8(v, c), false));
- }
- }
- if (ANNOTATIONS && tanns != 0) {
- for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
- v = readAnnotationTarget(context, v);
- v = readAnnotationValues(v + 2, c, true,
- classVisitor.visitTypeAnnotation(context.typeRef,
- context.typePath, readUTF8(v, c), true));
- }
- }
- if (ANNOTATIONS && itanns != 0) {
- for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
- v = readAnnotationTarget(context, v);
- v = readAnnotationValues(v + 2, c, true,
- classVisitor.visitTypeAnnotation(context.typeRef,
- context.typePath, readUTF8(v, c), false));
- }
- }
-
- // visits the attributes
- while (attributes != null) {
- Attribute attr = attributes.next;
- attributes.next = null;
- classVisitor.visitAttribute(attributes);
- attributes = attr;
- }
-
- // visits the inner classes
- if (innerClasses != 0) {
- int v = innerClasses + 2;
- for (int i = readUnsignedShort(innerClasses); i > 0; --i) {
- classVisitor.visitInnerClass(readClass(v, c),
- readClass(v + 2, c), readUTF8(v + 4, c),
- readUnsignedShort(v + 6));
- v += 8;
- }
- }
-
- // visits the fields and methods
- u = header + 10 + 2 * interfaces.length;
- for (int i = readUnsignedShort(u - 2); i > 0; --i) {
- u = readField(classVisitor, context, u);
- }
- u += 2;
- for (int i = readUnsignedShort(u - 2); i > 0; --i) {
- u = readMethod(classVisitor, context, u);
- }
-
- // visits the end of the class
- classVisitor.visitEnd();
+ // Visit the InnerClasses attribute.
+ if (innerClassesOffset != 0) {
+ int numberOfClasses = readUnsignedShort(innerClassesOffset);
+ int currentClassesOffset = innerClassesOffset + 2;
+ while (numberOfClasses-- > 0) {
+ classVisitor.visitInnerClass(
+ readClass(currentClassesOffset, charBuffer),
+ readClass(currentClassesOffset + 2, charBuffer),
+ readUTF8(currentClassesOffset + 4, charBuffer),
+ readUnsignedShort(currentClassesOffset + 6));
+ currentClassesOffset += 8;
+ }
}
- /**
- * Reads a field and makes the given visitor visit it.
- *
- * @param classVisitor
- * the visitor that must visit the field.
- * @param context
- * information about the class being parsed.
- * @param u
- * the start offset of the field in the class file.
- * @return the offset of the first byte following the field in the class.
- */
- private int readField(final ClassVisitor classVisitor,
- final Context context, int u) {
- // reads the field declaration
- char[] c = context.buffer;
- int access = readUnsignedShort(u);
- String name = readUTF8(u + 2, c);
- String desc = readUTF8(u + 4, c);
- u += 6;
-
- // reads the field attributes
- String signature = null;
- int anns = 0;
- int ianns = 0;
- int tanns = 0;
- int itanns = 0;
- Object value = null;
- Attribute attributes = null;
-
- for (int i = readUnsignedShort(u); i > 0; --i) {
- String attrName = readUTF8(u + 2, c);
- // tests are sorted in decreasing frequency order
- // (based on frequencies observed on typical classes)
- if ("ConstantValue".equals(attrName)) {
- int item = readUnsignedShort(u + 8);
- value = item == 0 ? null : readConst(item, c);
- } else if (SIGNATURES && "Signature".equals(attrName)) {
- signature = readUTF8(u + 8, c);
- } else if ("Deprecated".equals(attrName)) {
- access |= Opcodes.ACC_DEPRECATED;
- } else if ("Synthetic".equals(attrName)) {
- access |= Opcodes.ACC_SYNTHETIC
- | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
- } else if (ANNOTATIONS
- && "RuntimeVisibleAnnotations".equals(attrName)) {
- anns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
- tanns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleAnnotations".equals(attrName)) {
- ianns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
- itanns = u + 8;
- } else {
- Attribute attr = readAttribute(context.attrs, attrName, u + 8,
- readInt(u + 4), c, -1, null);
- if (attr != null) {
- attr.next = attributes;
- attributes = attr;
- }
- }
- u += 6 + readInt(u + 4);
- }
- u += 2;
-
- // visits the field declaration
- FieldVisitor fv = classVisitor.visitField(access, name, desc,
- signature, value);
- if (fv == null) {
- return u;
- }
-
- // visits the field annotations and type annotations
- if (ANNOTATIONS && anns != 0) {
- for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
- v = readAnnotationValues(v + 2, c, true,
- fv.visitAnnotation(readUTF8(v, c), true));
- }
- }
- if (ANNOTATIONS && ianns != 0) {
- for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
- v = readAnnotationValues(v + 2, c, true,
- fv.visitAnnotation(readUTF8(v, c), false));
- }
- }
- if (ANNOTATIONS && tanns != 0) {
- for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
- v = readAnnotationTarget(context, v);
- v = readAnnotationValues(v + 2, c, true,
- fv.visitTypeAnnotation(context.typeRef,
- context.typePath, readUTF8(v, c), true));
- }
- }
- if (ANNOTATIONS && itanns != 0) {
- for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
- v = readAnnotationTarget(context, v);
- v = readAnnotationValues(v + 2, c, true,
- fv.visitTypeAnnotation(context.typeRef,
- context.typePath, readUTF8(v, c), false));
- }
- }
-
- // visits the field attributes
- while (attributes != null) {
- Attribute attr = attributes.next;
- attributes.next = null;
- fv.visitAttribute(attributes);
- attributes = attr;
- }
-
- // visits the end of the field
- fv.visitEnd();
-
- return u;
+ // Visit the fields and methods.
+ int fieldsCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (fieldsCount-- > 0) {
+ currentOffset = readField(classVisitor, context, currentOffset);
+ }
+ int methodsCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (methodsCount-- > 0) {
+ currentOffset = readMethod(classVisitor, context, currentOffset);
}
- /**
- * Reads a method and makes the given visitor visit it.
- *
- * @param classVisitor
- * the visitor that must visit the method.
- * @param context
- * information about the class being parsed.
- * @param u
- * the start offset of the method in the class file.
- * @return the offset of the first byte following the method in the class.
- */
- private int readMethod(final ClassVisitor classVisitor,
- final Context context, int u) {
- // reads the method declaration
- char[] c = context.buffer;
- context.access = readUnsignedShort(u);
- context.name = readUTF8(u + 2, c);
- context.desc = readUTF8(u + 4, c);
- u += 6;
+ // Visit the end of the class.
+ classVisitor.visitEnd();
+ }
- // reads the method attributes
- int code = 0;
- int exception = 0;
- String[] exceptions = null;
- String signature = null;
- int methodParameters = 0;
- int anns = 0;
- int ianns = 0;
- int tanns = 0;
- int itanns = 0;
- int dann = 0;
- int mpanns = 0;
- int impanns = 0;
- int firstAttribute = u;
- Attribute attributes = null;
+ // ----------------------------------------------------------------------------------------------
+ // Methods to parse modules, fields and methods
+ // ----------------------------------------------------------------------------------------------
- for (int i = readUnsignedShort(u); i > 0; --i) {
- String attrName = readUTF8(u + 2, c);
- // tests are sorted in decreasing frequency order
- // (based on frequencies observed on typical classes)
- if ("Code".equals(attrName)) {
- if ((context.flags & SKIP_CODE) == 0) {
- code = u + 8;
- }
- } else if ("Exceptions".equals(attrName)) {
- exceptions = new String[readUnsignedShort(u + 8)];
- exception = u + 10;
- for (int j = 0; j < exceptions.length; ++j) {
- exceptions[j] = readClass(exception, c);
- exception += 2;
- }
- } else if (SIGNATURES && "Signature".equals(attrName)) {
- signature = readUTF8(u + 8, c);
- } else if ("Deprecated".equals(attrName)) {
- context.access |= Opcodes.ACC_DEPRECATED;
- } else if (ANNOTATIONS
- && "RuntimeVisibleAnnotations".equals(attrName)) {
- anns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
- tanns = u + 8;
- } else if (ANNOTATIONS && "AnnotationDefault".equals(attrName)) {
- dann = u + 8;
- } else if ("Synthetic".equals(attrName)) {
- context.access |= Opcodes.ACC_SYNTHETIC
- | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleAnnotations".equals(attrName)) {
- ianns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
- itanns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeVisibleParameterAnnotations".equals(attrName)) {
- mpanns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleParameterAnnotations".equals(attrName)) {
- impanns = u + 8;
- } else if ("MethodParameters".equals(attrName)) {
- methodParameters = u + 8;
- } else {
- Attribute attr = readAttribute(context.attrs, attrName, u + 8,
- readInt(u + 4), c, -1, null);
- if (attr != null) {
- attr.next = attributes;
- attributes = attr;
- }
- }
- u += 6 + readInt(u + 4);
- }
- u += 2;
+ /**
+ * Reads the Module, ModulePackages and ModuleMainClass attributes and visit them.
+ *
+ * @param classVisitor the current class visitor
+ * @param context information about the class being parsed.
+ * @param moduleOffset the offset of the Module attribute (excluding the attribute_info's
+ * attribute_name_index and attribute_length fields).
+ * @param modulePackagesOffset the offset of the ModulePackages attribute (excluding the
+ * attribute_info's attribute_name_index and attribute_length fields), or 0.
+ * @param moduleMainClass the string corresponding to the ModuleMainClass attribute, or null.
+ */
+ private void readModuleAttributes(
+ final ClassVisitor classVisitor,
+ final Context context,
+ final int moduleOffset,
+ final int modulePackagesOffset,
+ final String moduleMainClass) {
+ char[] buffer = context.charBuffer;
- // visits the method declaration
- MethodVisitor mv = classVisitor.visitMethod(context.access,
- context.name, context.desc, signature, exceptions);
- if (mv == null) {
- return u;
- }
-
- /*
- * if the returned MethodVisitor is in fact a MethodWriter, it means
- * there is no method adapter between the reader and the writer. If, in
- * addition, the writer's constant pool was copied from this reader
- * (mw.cw.cr == this), and the signature and exceptions of the method
- * have not been changed, then it is possible to skip all visit events
- * and just copy the original code of the method to the writer (the
- * access, name and descriptor can have been changed, this is not
- * important since they are not copied as is from the reader).
- */
- if (WRITER && mv instanceof MethodWriter) {
- MethodWriter mw = (MethodWriter) mv;
- if (mw.cw.cr == this && signature == mw.signature) {
- boolean sameExceptions = false;
- if (exceptions == null) {
- sameExceptions = mw.exceptionCount == 0;
- } else if (exceptions.length == mw.exceptionCount) {
- sameExceptions = true;
- for (int j = exceptions.length - 1; j >= 0; --j) {
- exception -= 2;
- if (mw.exceptions[j] != readUnsignedShort(exception)) {
- sameExceptions = false;
- break;
- }
- }
- }
- if (sameExceptions) {
- /*
- * we do not copy directly the code into MethodWriter to
- * save a byte array copy operation. The real copy will be
- * done in ClassWriter.toByteArray().
- */
- mw.classReaderOffset = firstAttribute;
- mw.classReaderLength = u - firstAttribute;
- return u;
- }
- }
- }
-
- // visit the method parameters
- if (methodParameters != 0) {
- for (int i = b[methodParameters] & 0xFF, v = methodParameters + 1; i > 0; --i, v = v + 4) {
- mv.visitParameter(readUTF8(v, c), readUnsignedShort(v + 2));
- }
- }
-
- // visits the method annotations
- if (ANNOTATIONS && dann != 0) {
- AnnotationVisitor dv = mv.visitAnnotationDefault();
- readAnnotationValue(dann, c, null, dv);
- if (dv != null) {
- dv.visitEnd();
- }
- }
- if (ANNOTATIONS && anns != 0) {
- for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
- v = readAnnotationValues(v + 2, c, true,
- mv.visitAnnotation(readUTF8(v, c), true));
- }
- }
- if (ANNOTATIONS && ianns != 0) {
- for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
- v = readAnnotationValues(v + 2, c, true,
- mv.visitAnnotation(readUTF8(v, c), false));
- }
- }
- if (ANNOTATIONS && tanns != 0) {
- for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
- v = readAnnotationTarget(context, v);
- v = readAnnotationValues(v + 2, c, true,
- mv.visitTypeAnnotation(context.typeRef,
- context.typePath, readUTF8(v, c), true));
- }
- }
- if (ANNOTATIONS && itanns != 0) {
- for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
- v = readAnnotationTarget(context, v);
- v = readAnnotationValues(v + 2, c, true,
- mv.visitTypeAnnotation(context.typeRef,
- context.typePath, readUTF8(v, c), false));
- }
- }
- if (ANNOTATIONS && mpanns != 0) {
- readParameterAnnotations(mv, context, mpanns, true);
- }
- if (ANNOTATIONS && impanns != 0) {
- readParameterAnnotations(mv, context, impanns, false);
- }
-
- // visits the method attributes
- while (attributes != null) {
- Attribute attr = attributes.next;
- attributes.next = null;
- mv.visitAttribute(attributes);
- attributes = attr;
- }
-
- // visits the method code
- if (code != 0) {
- mv.visitCode();
- readCode(mv, context, code);
- }
-
- // visits the end of the method
- mv.visitEnd();
-
- return u;
+ // Read the module_name_index, module_flags and module_version_index fields and visit them.
+ int currentOffset = moduleOffset;
+ String moduleName = readModule(currentOffset, buffer);
+ int moduleFlags = readUnsignedShort(currentOffset + 2);
+ String moduleVersion = readUTF8(currentOffset + 4, buffer);
+ currentOffset += 6;
+ ModuleVisitor moduleVisitor = classVisitor.visitModule(moduleName, moduleFlags, moduleVersion);
+ if (moduleVisitor == null) {
+ return;
}
- /**
- * Reads the bytecode of a method and makes the given visitor visit it.
- *
- * @param mv
- * the visitor that must visit the method's code.
- * @param context
- * information about the class being parsed.
- * @param u
- * the start offset of the code attribute in the class file.
- */
- private void readCode(final MethodVisitor mv, final Context context, int u) {
- // reads the header
- byte[] b = this.b;
- char[] c = context.buffer;
- int maxStack = readUnsignedShort(u);
- int maxLocals = readUnsignedShort(u + 2);
- int codeLength = readInt(u + 4);
- u += 8;
-
- // reads the bytecode to find the labels
- int codeStart = u;
- int codeEnd = u + codeLength;
- Label[] labels = context.labels = new Label[codeLength + 2];
- readLabel(codeLength + 1, labels);
- while (u < codeEnd) {
- int offset = u - codeStart;
- int opcode = b[u] & 0xFF;
- switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- case ClassWriter.IMPLVAR_INSN:
- u += 1;
- break;
- case ClassWriter.LABEL_INSN:
- readLabel(offset + readShort(u + 1), labels);
- u += 3;
- break;
- case ClassWriter.LABELW_INSN:
- readLabel(offset + readInt(u + 1), labels);
- u += 5;
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[u + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- u += 6;
- } else {
- u += 4;
- }
- break;
- case ClassWriter.TABL_INSN:
- // skips 0 to 3 padding bytes
- u = u + 4 - (offset & 3);
- // reads instruction
- readLabel(offset + readInt(u), labels);
- for (int i = readInt(u + 8) - readInt(u + 4) + 1; i > 0; --i) {
- readLabel(offset + readInt(u + 12), labels);
- u += 4;
- }
- u += 12;
- break;
- case ClassWriter.LOOK_INSN:
- // skips 0 to 3 padding bytes
- u = u + 4 - (offset & 3);
- // reads instruction
- readLabel(offset + readInt(u), labels);
- for (int i = readInt(u + 4); i > 0; --i) {
- readLabel(offset + readInt(u + 12), labels);
- u += 8;
- }
- u += 8;
- break;
- case ClassWriter.VAR_INSN:
- case ClassWriter.SBYTE_INSN:
- case ClassWriter.LDC_INSN:
- u += 2;
- break;
- case ClassWriter.SHORT_INSN:
- case ClassWriter.LDCW_INSN:
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.TYPE_INSN:
- case ClassWriter.IINC_INSN:
- u += 3;
- break;
- case ClassWriter.ITFMETH_INSN:
- case ClassWriter.INDYMETH_INSN:
- u += 5;
- break;
- // case MANA_INSN:
- default:
- u += 4;
- break;
- }
- }
-
- // reads the try catch entries to find the labels, and also visits them
- for (int i = readUnsignedShort(u); i > 0; --i) {
- Label start = readLabel(readUnsignedShort(u + 2), labels);
- Label end = readLabel(readUnsignedShort(u + 4), labels);
- Label handler = readLabel(readUnsignedShort(u + 6), labels);
- String type = readUTF8(items[readUnsignedShort(u + 8)], c);
- mv.visitTryCatchBlock(start, end, handler, type);
- u += 8;
- }
- u += 2;
-
- // reads the code attributes
- int[] tanns = null; // start index of each visible type annotation
- int[] itanns = null; // start index of each invisible type annotation
- int tann = 0; // current index in tanns array
- int itann = 0; // current index in itanns array
- int ntoff = -1; // next visible type annotation code offset
- int nitoff = -1; // next invisible type annotation code offset
- int varTable = 0;
- int varTypeTable = 0;
- boolean zip = true;
- boolean unzip = (context.flags & EXPAND_FRAMES) != 0;
- int stackMap = 0;
- int stackMapSize = 0;
- int frameCount = 0;
- Context frame = null;
- Attribute attributes = null;
-
- for (int i = readUnsignedShort(u); i > 0; --i) {
- String attrName = readUTF8(u + 2, c);
- if ("LocalVariableTable".equals(attrName)) {
- if ((context.flags & SKIP_DEBUG) == 0) {
- varTable = u + 8;
- for (int j = readUnsignedShort(u + 8), v = u; j > 0; --j) {
- int label = readUnsignedShort(v + 10);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
- label += readUnsignedShort(v + 12);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
- v += 10;
- }
- }
- } else if ("LocalVariableTypeTable".equals(attrName)) {
- varTypeTable = u + 8;
- } else if ("LineNumberTable".equals(attrName)) {
- if ((context.flags & SKIP_DEBUG) == 0) {
- for (int j = readUnsignedShort(u + 8), v = u; j > 0; --j) {
- int label = readUnsignedShort(v + 10);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
- Label l = labels[label];
- while (l.line > 0) {
- if (l.next == null) {
- l.next = new Label();
- }
- l = l.next;
- }
- l.line = readUnsignedShort(v + 12);
- v += 4;
- }
- }
- } else if (ANNOTATIONS
- && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
- tanns = readTypeAnnotations(mv, context, u + 8, true);
- ntoff = tanns.length == 0 || readByte(tanns[0]) < 0x43 ? -1
- : readUnsignedShort(tanns[0] + 1);
- } else if (ANNOTATIONS
- && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
- itanns = readTypeAnnotations(mv, context, u + 8, false);
- nitoff = itanns.length == 0 || readByte(itanns[0]) < 0x43 ? -1
- : readUnsignedShort(itanns[0] + 1);
- } else if (FRAMES && "StackMapTable".equals(attrName)) {
- if ((context.flags & SKIP_FRAMES) == 0) {
- stackMap = u + 10;
- stackMapSize = readInt(u + 4);
- frameCount = readUnsignedShort(u + 8);
- }
- /*
- * here we do not extract the labels corresponding to the
- * attribute content. This would require a full parsing of the
- * attribute, which would need to be repeated in the second
- * phase (see below). Instead the content of the attribute is
- * read one frame at a time (i.e. after a frame has been
- * visited, the next frame is read), and the labels it contains
- * are also extracted one frame at a time. Thanks to the
- * ordering of frames, having only a "one frame lookahead" is
- * not a problem, i.e. it is not possible to see an offset
- * smaller than the offset of the current insn and for which no
- * Label exist.
- */
- /*
- * This is not true for UNINITIALIZED type offsets. We solve
- * this by parsing the stack map table without a full decoding
- * (see below).
- */
- } else if (FRAMES && "StackMap".equals(attrName)) {
- if ((context.flags & SKIP_FRAMES) == 0) {
- zip = false;
- stackMap = u + 10;
- stackMapSize = readInt(u + 4);
- frameCount = readUnsignedShort(u + 8);
- }
- /*
- * IMPORTANT! here we assume that the frames are ordered, as in
- * the StackMapTable attribute, although this is not guaranteed
- * by the attribute format.
- */
- } else {
- for (int j = 0; j < context.attrs.length; ++j) {
- if (context.attrs[j].type.equals(attrName)) {
- Attribute attr = context.attrs[j].read(this, u + 8,
- readInt(u + 4), c, codeStart - 8, labels);
- if (attr != null) {
- attr.next = attributes;
- attributes = attr;
- }
- }
- }
- }
- u += 6 + readInt(u + 4);
- }
- u += 2;
-
- // generates the first (implicit) stack map frame
- if (FRAMES && stackMap != 0) {
- /*
- * for the first explicit frame the offset is not offset_delta + 1
- * but only offset_delta; setting the implicit frame offset to -1
- * allow the use of the "offset_delta + 1" rule in all cases
- */
- frame = context;
- frame.offset = -1;
- frame.mode = 0;
- frame.localCount = 0;
- frame.localDiff = 0;
- frame.stackCount = 0;
- frame.local = new Object[maxLocals];
- frame.stack = new Object[maxStack];
- if (unzip) {
- getImplicitFrame(context);
- }
- /*
- * Finds labels for UNINITIALIZED frame types. Instead of decoding
- * each element of the stack map table, we look for 3 consecutive
- * bytes that "look like" an UNINITIALIZED type (tag 8, offset
- * within code bounds, NEW instruction at this offset). We may find
- * false positives (i.e. not real UNINITIALIZED types), but this
- * should be rare, and the only consequence will be the creation of
- * an unneeded label. This is better than creating a label for each
- * NEW instruction, and faster than fully decoding the whole stack
- * map table.
- */
- for (int i = stackMap; i < stackMap + stackMapSize - 2; ++i) {
- if (b[i] == 8) { // UNINITIALIZED FRAME TYPE
- int v = readUnsignedShort(i + 1);
- if (v >= 0 && v < codeLength) {
- if ((b[codeStart + v] & 0xFF) == Opcodes.NEW) {
- readLabel(v, labels);
- }
- }
- }
- }
- }
-
- // visits the instructions
- u = codeStart;
- while (u < codeEnd) {
- int offset = u - codeStart;
-
- // visits the label and line number for this offset, if any
- Label l = labels[offset];
- if (l != null) {
- Label next = l.next;
- l.next = null;
- mv.visitLabel(l);
- if ((context.flags & SKIP_DEBUG) == 0 && l.line > 0) {
- mv.visitLineNumber(l.line, l);
- while (next != null) {
- mv.visitLineNumber(next.line, l);
- next = next.next;
- }
- }
- }
-
- // visits the frame for this offset, if any
- while (FRAMES && frame != null
- && (frame.offset == offset || frame.offset == -1)) {
- // if there is a frame for this offset, makes the visitor visit
- // it, and reads the next frame if there is one.
- if (frame.offset != -1) {
- if (!zip || unzip) {
- mv.visitFrame(Opcodes.F_NEW, frame.localCount,
- frame.local, frame.stackCount, frame.stack);
- } else {
- mv.visitFrame(frame.mode, frame.localDiff, frame.local,
- frame.stackCount, frame.stack);
- }
- }
- if (frameCount > 0) {
- stackMap = readFrame(stackMap, zip, unzip, frame);
- --frameCount;
- } else {
- frame = null;
- }
- }
-
- // visits the instruction at this offset
- int opcode = b[u] & 0xFF;
- switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- mv.visitInsn(opcode);
- u += 1;
- break;
- case ClassWriter.IMPLVAR_INSN:
- if (opcode > Opcodes.ISTORE) {
- opcode -= 59; // ISTORE_0
- mv.visitVarInsn(Opcodes.ISTORE + (opcode >> 2),
- opcode & 0x3);
- } else {
- opcode -= 26; // ILOAD_0
- mv.visitVarInsn(Opcodes.ILOAD + (opcode >> 2), opcode & 0x3);
- }
- u += 1;
- break;
- case ClassWriter.LABEL_INSN:
- mv.visitJumpInsn(opcode, labels[offset + readShort(u + 1)]);
- u += 3;
- break;
- case ClassWriter.LABELW_INSN:
- mv.visitJumpInsn(opcode - 33, labels[offset + readInt(u + 1)]);
- u += 5;
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[u + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- mv.visitIincInsn(readUnsignedShort(u + 2), readShort(u + 4));
- u += 6;
- } else {
- mv.visitVarInsn(opcode, readUnsignedShort(u + 2));
- u += 4;
- }
- break;
- case ClassWriter.TABL_INSN: {
- // skips 0 to 3 padding bytes
- u = u + 4 - (offset & 3);
- // reads instruction
- int label = offset + readInt(u);
- int min = readInt(u + 4);
- int max = readInt(u + 8);
- Label[] table = new Label[max - min + 1];
- u += 12;
- for (int i = 0; i < table.length; ++i) {
- table[i] = labels[offset + readInt(u)];
- u += 4;
- }
- mv.visitTableSwitchInsn(min, max, labels[label], table);
- break;
- }
- case ClassWriter.LOOK_INSN: {
- // skips 0 to 3 padding bytes
- u = u + 4 - (offset & 3);
- // reads instruction
- int label = offset + readInt(u);
- int len = readInt(u + 4);
- int[] keys = new int[len];
- Label[] values = new Label[len];
- u += 8;
- for (int i = 0; i < len; ++i) {
- keys[i] = readInt(u);
- values[i] = labels[offset + readInt(u + 4)];
- u += 8;
- }
- mv.visitLookupSwitchInsn(labels[label], keys, values);
- break;
- }
- case ClassWriter.VAR_INSN:
- mv.visitVarInsn(opcode, b[u + 1] & 0xFF);
- u += 2;
- break;
- case ClassWriter.SBYTE_INSN:
- mv.visitIntInsn(opcode, b[u + 1]);
- u += 2;
- break;
- case ClassWriter.SHORT_INSN:
- mv.visitIntInsn(opcode, readShort(u + 1));
- u += 3;
- break;
- case ClassWriter.LDC_INSN:
- mv.visitLdcInsn(readConst(b[u + 1] & 0xFF, c));
- u += 2;
- break;
- case ClassWriter.LDCW_INSN:
- mv.visitLdcInsn(readConst(readUnsignedShort(u + 1), c));
- u += 3;
- break;
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.ITFMETH_INSN: {
- int cpIndex = items[readUnsignedShort(u + 1)];
- boolean itf = b[cpIndex - 1] == ClassWriter.IMETH;
- String iowner = readClass(cpIndex, c);
- cpIndex = items[readUnsignedShort(cpIndex + 2)];
- String iname = readUTF8(cpIndex, c);
- String idesc = readUTF8(cpIndex + 2, c);
- if (opcode < Opcodes.INVOKEVIRTUAL) {
- mv.visitFieldInsn(opcode, iowner, iname, idesc);
- } else {
- mv.visitMethodInsn(opcode, iowner, iname, idesc, itf);
- }
- if (opcode == Opcodes.INVOKEINTERFACE) {
- u += 5;
- } else {
- u += 3;
- }
- break;
- }
- case ClassWriter.INDYMETH_INSN: {
- int cpIndex = items[readUnsignedShort(u + 1)];
- int bsmIndex = context.bootstrapMethods[readUnsignedShort(cpIndex)];
- Handle bsm = (Handle) readConst(readUnsignedShort(bsmIndex), c);
- int bsmArgCount = readUnsignedShort(bsmIndex + 2);
- Object[] bsmArgs = new Object[bsmArgCount];
- bsmIndex += 4;
- for (int i = 0; i < bsmArgCount; i++) {
- bsmArgs[i] = readConst(readUnsignedShort(bsmIndex), c);
- bsmIndex += 2;
- }
- cpIndex = items[readUnsignedShort(cpIndex + 2)];
- String iname = readUTF8(cpIndex, c);
- String idesc = readUTF8(cpIndex + 2, c);
- mv.visitInvokeDynamicInsn(iname, idesc, bsm, bsmArgs);
- u += 5;
- break;
- }
- case ClassWriter.TYPE_INSN:
- mv.visitTypeInsn(opcode, readClass(u + 1, c));
- u += 3;
- break;
- case ClassWriter.IINC_INSN:
- mv.visitIincInsn(b[u + 1] & 0xFF, b[u + 2]);
- u += 3;
- break;
- // case MANA_INSN:
- default:
- mv.visitMultiANewArrayInsn(readClass(u + 1, c), b[u + 3] & 0xFF);
- u += 4;
- break;
- }
-
- // visit the instruction annotations, if any
- while (tanns != null && tann < tanns.length && ntoff <= offset) {
- if (ntoff == offset) {
- int v = readAnnotationTarget(context, tanns[tann]);
- readAnnotationValues(v + 2, c, true,
- mv.visitInsnAnnotation(context.typeRef,
- context.typePath, readUTF8(v, c), true));
- }
- ntoff = ++tann >= tanns.length || readByte(tanns[tann]) < 0x43 ? -1
- : readUnsignedShort(tanns[tann] + 1);
- }
- while (itanns != null && itann < itanns.length && nitoff <= offset) {
- if (nitoff == offset) {
- int v = readAnnotationTarget(context, itanns[itann]);
- readAnnotationValues(v + 2, c, true,
- mv.visitInsnAnnotation(context.typeRef,
- context.typePath, readUTF8(v, c), false));
- }
- nitoff = ++itann >= itanns.length
- || readByte(itanns[itann]) < 0x43 ? -1
- : readUnsignedShort(itanns[itann] + 1);
- }
- }
- if (labels[codeLength] != null) {
- mv.visitLabel(labels[codeLength]);
- }
-
- // visits the local variable tables
- if ((context.flags & SKIP_DEBUG) == 0 && varTable != 0) {
- int[] typeTable = null;
- if (varTypeTable != 0) {
- u = varTypeTable + 2;
- typeTable = new int[readUnsignedShort(varTypeTable) * 3];
- for (int i = typeTable.length; i > 0;) {
- typeTable[--i] = u + 6; // signature
- typeTable[--i] = readUnsignedShort(u + 8); // index
- typeTable[--i] = readUnsignedShort(u); // start
- u += 10;
- }
- }
- u = varTable + 2;
- for (int i = readUnsignedShort(varTable); i > 0; --i) {
- int start = readUnsignedShort(u);
- int length = readUnsignedShort(u + 2);
- int index = readUnsignedShort(u + 8);
- String vsignature = null;
- if (typeTable != null) {
- for (int j = 0; j < typeTable.length; j += 3) {
- if (typeTable[j] == start && typeTable[j + 1] == index) {
- vsignature = readUTF8(typeTable[j + 2], c);
- break;
- }
- }
- }
- mv.visitLocalVariable(readUTF8(u + 4, c), readUTF8(u + 6, c),
- vsignature, labels[start], labels[start + length],
- index);
- u += 10;
- }
- }
-
- // visits the local variables type annotations
- if (tanns != null) {
- for (int i = 0; i < tanns.length; ++i) {
- if ((readByte(tanns[i]) >> 1) == (0x40 >> 1)) {
- int v = readAnnotationTarget(context, tanns[i]);
- v = readAnnotationValues(v + 2, c, true,
- mv.visitLocalVariableAnnotation(context.typeRef,
- context.typePath, context.start,
- context.end, context.index, readUTF8(v, c),
- true));
- }
- }
- }
- if (itanns != null) {
- for (int i = 0; i < itanns.length; ++i) {
- if ((readByte(itanns[i]) >> 1) == (0x40 >> 1)) {
- int v = readAnnotationTarget(context, itanns[i]);
- v = readAnnotationValues(v + 2, c, true,
- mv.visitLocalVariableAnnotation(context.typeRef,
- context.typePath, context.start,
- context.end, context.index, readUTF8(v, c),
- false));
- }
- }
- }
-
- // visits the code attributes
- while (attributes != null) {
- Attribute attr = attributes.next;
- attributes.next = null;
- mv.visitAttribute(attributes);
- attributes = attr;
- }
-
- // visits the max stack and max locals values
- mv.visitMaxs(maxStack, maxLocals);
+ // Visit the ModuleMainClass attribute.
+ if (moduleMainClass != null) {
+ moduleVisitor.visitMainClass(moduleMainClass);
}
- /**
- * Parses a type annotation table to find the labels, and to visit the try
- * catch block annotations.
- *
- * @param u
- * the start offset of a type annotation table.
- * @param mv
- * the method visitor to be used to visit the try catch block
- * annotations.
- * @param context
- * information about the class being parsed.
- * @param visible
- * if the type annotation table to parse contains runtime visible
- * annotations.
- * @return the start offset of each type annotation in the parsed table.
- */
- private int[] readTypeAnnotations(final MethodVisitor mv,
- final Context context, int u, boolean visible) {
- char[] c = context.buffer;
- int[] offsets = new int[readUnsignedShort(u)];
- u += 2;
- for (int i = 0; i < offsets.length; ++i) {
- offsets[i] = u;
- int target = readInt(u);
- switch (target >>> 24) {
- case 0x00: // CLASS_TYPE_PARAMETER
- case 0x01: // METHOD_TYPE_PARAMETER
- case 0x16: // METHOD_FORMAL_PARAMETER
- u += 2;
- break;
- case 0x13: // FIELD
- case 0x14: // METHOD_RETURN
- case 0x15: // METHOD_RECEIVER
- u += 1;
- break;
- case 0x40: // LOCAL_VARIABLE
- case 0x41: // RESOURCE_VARIABLE
- for (int j = readUnsignedShort(u + 1); j > 0; --j) {
- int start = readUnsignedShort(u + 3);
- int length = readUnsignedShort(u + 5);
- readLabel(start, context.labels);
- readLabel(start + length, context.labels);
- u += 6;
- }
- u += 3;
- break;
- case 0x47: // CAST
- case 0x48: // CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
- case 0x49: // METHOD_INVOCATION_TYPE_ARGUMENT
- case 0x4A: // CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
- case 0x4B: // METHOD_REFERENCE_TYPE_ARGUMENT
- u += 4;
- break;
- // case 0x10: // CLASS_EXTENDS
- // case 0x11: // CLASS_TYPE_PARAMETER_BOUND
- // case 0x12: // METHOD_TYPE_PARAMETER_BOUND
- // case 0x17: // THROWS
- // case 0x42: // EXCEPTION_PARAMETER
- // case 0x43: // INSTANCEOF
- // case 0x44: // NEW
- // case 0x45: // CONSTRUCTOR_REFERENCE
- // case 0x46: // METHOD_REFERENCE
- default:
- u += 3;
- break;
- }
- int pathLength = readByte(u);
- if ((target >>> 24) == 0x42) {
- TypePath path = pathLength == 0 ? null : new TypePath(b, u);
- u += 1 + 2 * pathLength;
- u = readAnnotationValues(u + 2, c, true,
- mv.visitTryCatchAnnotation(target, path,
- readUTF8(u, c), visible));
- } else {
- u = readAnnotationValues(u + 3 + 2 * pathLength, c, true, null);
- }
- }
- return offsets;
+ // Visit the ModulePackages attribute.
+ if (modulePackagesOffset != 0) {
+ int packageCount = readUnsignedShort(modulePackagesOffset);
+ int currentPackageOffset = modulePackagesOffset + 2;
+ while (packageCount-- > 0) {
+ moduleVisitor.visitPackage(readPackage(currentPackageOffset, buffer));
+ currentPackageOffset += 2;
+ }
}
- /**
- * Parses the header of a type annotation to extract its target_type and
- * target_path (the result is stored in the given context), and returns the
- * start offset of the rest of the type_annotation structure (i.e. the
- * offset to the type_index field, which is followed by
- * num_element_value_pairs and then the name,value pairs).
- *
- * @param context
- * information about the class being parsed. This is where the
- * extracted target_type and target_path must be stored.
- * @param u
- * the start offset of a type_annotation structure.
- * @return the start offset of the rest of the type_annotation structure.
- */
- private int readAnnotationTarget(final Context context, int u) {
- int target = readInt(u);
- switch (target >>> 24) {
- case 0x00: // CLASS_TYPE_PARAMETER
- case 0x01: // METHOD_TYPE_PARAMETER
- case 0x16: // METHOD_FORMAL_PARAMETER
- target &= 0xFFFF0000;
- u += 2;
- break;
- case 0x13: // FIELD
- case 0x14: // METHOD_RETURN
- case 0x15: // METHOD_RECEIVER
- target &= 0xFF000000;
- u += 1;
- break;
- case 0x40: // LOCAL_VARIABLE
- case 0x41: { // RESOURCE_VARIABLE
- target &= 0xFF000000;
- int n = readUnsignedShort(u + 1);
- context.start = new Label[n];
- context.end = new Label[n];
- context.index = new int[n];
- u += 3;
- for (int i = 0; i < n; ++i) {
- int start = readUnsignedShort(u);
- int length = readUnsignedShort(u + 2);
- context.start[i] = readLabel(start, context.labels);
- context.end[i] = readLabel(start + length, context.labels);
- context.index[i] = readUnsignedShort(u + 4);
- u += 6;
- }
- break;
- }
- case 0x47: // CAST
- case 0x48: // CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
- case 0x49: // METHOD_INVOCATION_TYPE_ARGUMENT
- case 0x4A: // CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
- case 0x4B: // METHOD_REFERENCE_TYPE_ARGUMENT
- target &= 0xFF0000FF;
- u += 4;
- break;
- // case 0x10: // CLASS_EXTENDS
- // case 0x11: // CLASS_TYPE_PARAMETER_BOUND
- // case 0x12: // METHOD_TYPE_PARAMETER_BOUND
- // case 0x17: // THROWS
- // case 0x42: // EXCEPTION_PARAMETER
- // case 0x43: // INSTANCEOF
- // case 0x44: // NEW
- // case 0x45: // CONSTRUCTOR_REFERENCE
- // case 0x46: // METHOD_REFERENCE
+ // Read the 'requires_count' and 'requires' fields.
+ int requiresCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (requiresCount-- > 0) {
+ // Read the requires_index, requires_flags and requires_version fields and visit them.
+ String requires = readModule(currentOffset, buffer);
+ int requiresFlags = readUnsignedShort(currentOffset + 2);
+ String requiresVersion = readUTF8(currentOffset + 4, buffer);
+ currentOffset += 6;
+ moduleVisitor.visitRequire(requires, requiresFlags, requiresVersion);
+ }
+
+ // Read the 'exports_count' and 'exports' fields.
+ int exportsCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (exportsCount-- > 0) {
+ // Read the exports_index, exports_flags, exports_to_count and exports_to_index fields
+ // and visit them.
+ String exports = readPackage(currentOffset, buffer);
+ int exportsFlags = readUnsignedShort(currentOffset + 2);
+ int exportsToCount = readUnsignedShort(currentOffset + 4);
+ currentOffset += 6;
+ String[] exportsTo = null;
+ if (exportsToCount != 0) {
+ exportsTo = new String[exportsToCount];
+ for (int i = 0; i < exportsToCount; ++i) {
+ exportsTo[i] = readModule(currentOffset, buffer);
+ currentOffset += 2;
+ }
+ }
+ moduleVisitor.visitExport(exports, exportsFlags, exportsTo);
+ }
+
+ // Reads the 'opens_count' and 'opens' fields.
+ int opensCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (opensCount-- > 0) {
+ // Read the opens_index, opens_flags, opens_to_count and opens_to_index fields and visit them.
+ String opens = readPackage(currentOffset, buffer);
+ int opensFlags = readUnsignedShort(currentOffset + 2);
+ int opensToCount = readUnsignedShort(currentOffset + 4);
+ currentOffset += 6;
+ String[] opensTo = null;
+ if (opensToCount != 0) {
+ opensTo = new String[opensToCount];
+ for (int i = 0; i < opensToCount; ++i) {
+ opensTo[i] = readModule(currentOffset, buffer);
+ currentOffset += 2;
+ }
+ }
+ moduleVisitor.visitOpen(opens, opensFlags, opensTo);
+ }
+
+ // Read the 'uses_count' and 'uses' fields.
+ int usesCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (usesCount-- > 0) {
+ moduleVisitor.visitUse(readClass(currentOffset, buffer));
+ currentOffset += 2;
+ }
+
+ // Read the 'provides_count' and 'provides' fields.
+ int providesCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (providesCount-- > 0) {
+ // Read the provides_index, provides_with_count and provides_with_index fields and visit them.
+ String provides = readClass(currentOffset, buffer);
+ int providesWithCount = readUnsignedShort(currentOffset + 2);
+ currentOffset += 4;
+ String[] providesWith = new String[providesWithCount];
+ for (int i = 0; i < providesWithCount; ++i) {
+ providesWith[i] = readClass(currentOffset, buffer);
+ currentOffset += 2;
+ }
+ moduleVisitor.visitProvide(provides, providesWith);
+ }
+
+ // Visit the end of the module attributes.
+ moduleVisitor.visitEnd();
+ }
+
+ /**
+ * Reads a JVMS field_info structure and makes the given visitor visit it.
+ *
+ * @param classVisitor the visitor that must visit the field.
+ * @param context information about the class being parsed.
+ * @param fieldInfoOffset the start offset of the field_info structure.
+ * @return the offset of the first byte following the field_info structure.
+ */
+ private int readField(
+ final ClassVisitor classVisitor, final Context context, final int fieldInfoOffset) {
+ char[] charBuffer = context.charBuffer;
+
+ // Read the access_flags, name_index and descriptor_index fields.
+ int currentOffset = fieldInfoOffset;
+ int accessFlags = readUnsignedShort(currentOffset);
+ String name = readUTF8(currentOffset + 2, charBuffer);
+ String descriptor = readUTF8(currentOffset + 4, charBuffer);
+ currentOffset += 6;
+
+ // Read the field attributes (the variables are ordered as in Section 4.7 of the JVMS).
+ // Attribute offsets exclude the attribute_name_index and attribute_length fields.
+ // - The value corresponding to the ConstantValue attribute, or null.
+ Object constantValue = null;
+ // - The string corresponding to the Signature attribute, or null.
+ String signature = null;
+ // - The offset of the RuntimeVisibleAnnotations attribute, or 0.
+ int runtimeVisibleAnnotationsOffset = 0;
+ // - The offset of the RuntimeInvisibleAnnotations attribute, or 0.
+ int runtimeInvisibleAnnotationsOffset = 0;
+ // - The offset of the RuntimeVisibleTypeAnnotations attribute, or 0.
+ int runtimeVisibleTypeAnnotationsOffset = 0;
+ // - The offset of the RuntimeInvisibleTypeAnnotations attribute, or 0.
+ int runtimeInvisibleTypeAnnotationsOffset = 0;
+ // - The non standard attributes (linked with their {@link Attribute#nextAttribute} field).
+ // This list in the <i>reverse order</i> or their order in the ClassFile structure.
+ Attribute attributes = null;
+
+ int attributesCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (attributesCount-- > 0) {
+ // Read the attribute_info's attribute_name and attribute_length fields.
+ String attributeName = readUTF8(currentOffset, charBuffer);
+ int attributeLength = readInt(currentOffset + 2);
+ currentOffset += 6;
+ // The tests are sorted in decreasing frequency order (based on frequencies observed on
+ // typical classes).
+ if (Constants.CONSTANT_VALUE.equals(attributeName)) {
+ int constantvalueIndex = readUnsignedShort(currentOffset);
+ constantValue = constantvalueIndex == 0 ? null : readConst(constantvalueIndex, charBuffer);
+ } else if (Constants.SIGNATURE.equals(attributeName)) {
+ signature = readUTF8(currentOffset, charBuffer);
+ } else if (Constants.DEPRECATED.equals(attributeName)) {
+ accessFlags |= Opcodes.ACC_DEPRECATED;
+ } else if (Constants.SYNTHETIC.equals(attributeName)) {
+ accessFlags |= Opcodes.ACC_SYNTHETIC;
+ } else if (Constants.RUNTIME_VISIBLE_ANNOTATIONS.equals(attributeName)) {
+ runtimeVisibleAnnotationsOffset = currentOffset;
+ } else if (Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
+ runtimeVisibleTypeAnnotationsOffset = currentOffset;
+ } else if (Constants.RUNTIME_INVISIBLE_ANNOTATIONS.equals(attributeName)) {
+ runtimeInvisibleAnnotationsOffset = currentOffset;
+ } else if (Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
+ runtimeInvisibleTypeAnnotationsOffset = currentOffset;
+ } else {
+ Attribute attribute =
+ readAttribute(
+ context.attributePrototypes,
+ attributeName,
+ currentOffset,
+ attributeLength,
+ charBuffer,
+ -1,
+ null);
+ attribute.nextAttribute = attributes;
+ attributes = attribute;
+ }
+ currentOffset += attributeLength;
+ }
+
+ // Visit the field declaration.
+ FieldVisitor fieldVisitor =
+ classVisitor.visitField(accessFlags, name, descriptor, signature, constantValue);
+ if (fieldVisitor == null) {
+ return currentOffset;
+ }
+
+ // Visit the RuntimeVisibleAnnotations attribute.
+ if (runtimeVisibleAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeVisibleAnnotationsOffset);
+ int currentAnnotationOffset = runtimeVisibleAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ fieldVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+
+ // Visit the RuntimeInvisibleAnnotations attribute.
+ if (runtimeInvisibleAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeInvisibleAnnotationsOffset);
+ int currentAnnotationOffset = runtimeInvisibleAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ fieldVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+
+ // Visit the RuntimeVisibleTypeAnnotations attribute.
+ if (runtimeVisibleTypeAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeVisibleTypeAnnotationsOffset);
+ int currentAnnotationOffset = runtimeVisibleTypeAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the target_type, target_info and target_path fields.
+ currentAnnotationOffset = readTypeAnnotationTarget(context, currentAnnotationOffset);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ fieldVisitor.visitTypeAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ annotationDescriptor,
+ /* visible = */ true),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+
+ // Visit the RuntimeInvisibleTypeAnnotations attribute.
+ if (runtimeInvisibleTypeAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeInvisibleTypeAnnotationsOffset);
+ int currentAnnotationOffset = runtimeInvisibleTypeAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the target_type, target_info and target_path fields.
+ currentAnnotationOffset = readTypeAnnotationTarget(context, currentAnnotationOffset);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ fieldVisitor.visitTypeAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ annotationDescriptor,
+ /* visible = */ false),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+
+ // Visit the non standard attributes.
+ while (attributes != null) {
+ // Copy and reset the nextAttribute field so that it can also be used in FieldWriter.
+ Attribute nextAttribute = attributes.nextAttribute;
+ attributes.nextAttribute = null;
+ fieldVisitor.visitAttribute(attributes);
+ attributes = nextAttribute;
+ }
+
+ // Visit the end of the field.
+ fieldVisitor.visitEnd();
+ return currentOffset;
+ }
+
+ /**
+ * Reads a JVMS method_info structure and makes the given visitor visit it.
+ *
+ * @param classVisitor the visitor that must visit the method.
+ * @param context information about the class being parsed.
+ * @param methodInfoOffset the start offset of the method_info structure.
+ * @return the offset of the first byte following the method_info structure.
+ */
+ private int readMethod(
+ final ClassVisitor classVisitor, final Context context, final int methodInfoOffset) {
+ char[] charBuffer = context.charBuffer;
+
+ // Read the access_flags, name_index and descriptor_index fields.
+ int currentOffset = methodInfoOffset;
+ context.currentMethodAccessFlags = readUnsignedShort(currentOffset);
+ context.currentMethodName = readUTF8(currentOffset + 2, charBuffer);
+ context.currentMethodDescriptor = readUTF8(currentOffset + 4, charBuffer);
+ currentOffset += 6;
+
+ // Read the method attributes (the variables are ordered as in Section 4.7 of the JVMS).
+ // Attribute offsets exclude the attribute_name_index and attribute_length fields.
+ // - The offset of the Code attribute, or 0.
+ int codeOffset = 0;
+ // - The offset of the Exceptions attribute, or 0.
+ int exceptionsOffset = 0;
+ // - The strings corresponding to the Exceptions attribute, or null.
+ String[] exceptions = null;
+ // - Whether the method has a Synthetic attribute.
+ boolean synthetic = false;
+ // - The constant pool index contained in the Signature attribute, or 0.
+ int signatureIndex = 0;
+ // - The offset of the RuntimeVisibleAnnotations attribute, or 0.
+ int runtimeVisibleAnnotationsOffset = 0;
+ // - The offset of the RuntimeInvisibleAnnotations attribute, or 0.
+ int runtimeInvisibleAnnotationsOffset = 0;
+ // - The offset of the RuntimeVisibleParameterAnnotations attribute, or 0.
+ int runtimeVisibleParameterAnnotationsOffset = 0;
+ // - The offset of the RuntimeInvisibleParameterAnnotations attribute, or 0.
+ int runtimeInvisibleParameterAnnotationsOffset = 0;
+ // - The offset of the RuntimeVisibleTypeAnnotations attribute, or 0.
+ int runtimeVisibleTypeAnnotationsOffset = 0;
+ // - The offset of the RuntimeInvisibleTypeAnnotations attribute, or 0.
+ int runtimeInvisibleTypeAnnotationsOffset = 0;
+ // - The offset of the AnnotationDefault attribute, or 0.
+ int annotationDefaultOffset = 0;
+ // - The offset of the MethodParameters attribute, or 0.
+ int methodParametersOffset = 0;
+ // - The non standard attributes (linked with their {@link Attribute#nextAttribute} field).
+ // This list in the <i>reverse order</i> or their order in the ClassFile structure.
+ Attribute attributes = null;
+
+ int attributesCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (attributesCount-- > 0) {
+ // Read the attribute_info's attribute_name and attribute_length fields.
+ String attributeName = readUTF8(currentOffset, charBuffer);
+ int attributeLength = readInt(currentOffset + 2);
+ currentOffset += 6;
+ // The tests are sorted in decreasing frequency order (based on frequencies observed on
+ // typical classes).
+ if (Constants.CODE.equals(attributeName)) {
+ if ((context.parsingOptions & SKIP_CODE) == 0) {
+ codeOffset = currentOffset;
+ }
+ } else if (Constants.EXCEPTIONS.equals(attributeName)) {
+ exceptionsOffset = currentOffset;
+ exceptions = new String[readUnsignedShort(exceptionsOffset)];
+ int currentExceptionOffset = exceptionsOffset + 2;
+ for (int i = 0; i < exceptions.length; ++i) {
+ exceptions[i] = readClass(currentExceptionOffset, charBuffer);
+ currentExceptionOffset += 2;
+ }
+ } else if (Constants.SIGNATURE.equals(attributeName)) {
+ signatureIndex = readUnsignedShort(currentOffset);
+ } else if (Constants.DEPRECATED.equals(attributeName)) {
+ context.currentMethodAccessFlags |= Opcodes.ACC_DEPRECATED;
+ } else if (Constants.RUNTIME_VISIBLE_ANNOTATIONS.equals(attributeName)) {
+ runtimeVisibleAnnotationsOffset = currentOffset;
+ } else if (Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
+ runtimeVisibleTypeAnnotationsOffset = currentOffset;
+ } else if (Constants.ANNOTATION_DEFAULT.equals(attributeName)) {
+ annotationDefaultOffset = currentOffset;
+ } else if (Constants.SYNTHETIC.equals(attributeName)) {
+ synthetic = true;
+ context.currentMethodAccessFlags |= Opcodes.ACC_SYNTHETIC;
+ } else if (Constants.RUNTIME_INVISIBLE_ANNOTATIONS.equals(attributeName)) {
+ runtimeInvisibleAnnotationsOffset = currentOffset;
+ } else if (Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
+ runtimeInvisibleTypeAnnotationsOffset = currentOffset;
+ } else if (Constants.RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS.equals(attributeName)) {
+ runtimeVisibleParameterAnnotationsOffset = currentOffset;
+ } else if (Constants.RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS.equals(attributeName)) {
+ runtimeInvisibleParameterAnnotationsOffset = currentOffset;
+ } else if (Constants.METHOD_PARAMETERS.equals(attributeName)) {
+ methodParametersOffset = currentOffset;
+ } else {
+ Attribute attribute =
+ readAttribute(
+ context.attributePrototypes,
+ attributeName,
+ currentOffset,
+ attributeLength,
+ charBuffer,
+ -1,
+ null);
+ attribute.nextAttribute = attributes;
+ attributes = attribute;
+ }
+ currentOffset += attributeLength;
+ }
+
+ // Visit the method declaration.
+ MethodVisitor methodVisitor =
+ classVisitor.visitMethod(
+ context.currentMethodAccessFlags,
+ context.currentMethodName,
+ context.currentMethodDescriptor,
+ signatureIndex == 0 ? null : readUtf(signatureIndex, charBuffer),
+ exceptions);
+ if (methodVisitor == null) {
+ return currentOffset;
+ }
+
+ // If the returned MethodVisitor is in fact a MethodWriter, it means there is no method
+ // adapter between the reader and the writer. In this case, it might be possible to copy
+ // the method attributes directly into the writer. If so, return early without visiting
+ // the content of these attributes.
+ if (methodVisitor instanceof MethodWriter) {
+ MethodWriter methodWriter = (MethodWriter) methodVisitor;
+ if (methodWriter.canCopyMethodAttributes(
+ this,
+ synthetic,
+ (context.currentMethodAccessFlags & Opcodes.ACC_DEPRECATED) != 0,
+ readUnsignedShort(methodInfoOffset + 4),
+ signatureIndex,
+ exceptionsOffset)) {
+ methodWriter.setMethodAttributesSource(methodInfoOffset, currentOffset - methodInfoOffset);
+ return currentOffset;
+ }
+ }
+
+ // Visit the MethodParameters attribute.
+ if (methodParametersOffset != 0) {
+ int parametersCount = readByte(methodParametersOffset);
+ int currentParameterOffset = methodParametersOffset + 1;
+ while (parametersCount-- > 0) {
+ // Read the name_index and access_flags fields and visit them.
+ methodVisitor.visitParameter(
+ readUTF8(currentParameterOffset, charBuffer),
+ readUnsignedShort(currentParameterOffset + 2));
+ currentParameterOffset += 4;
+ }
+ }
+
+ // Visit the AnnotationDefault attribute.
+ if (annotationDefaultOffset != 0) {
+ AnnotationVisitor annotationVisitor = methodVisitor.visitAnnotationDefault();
+ readElementValue(annotationVisitor, annotationDefaultOffset, null, charBuffer);
+ if (annotationVisitor != null) {
+ annotationVisitor.visitEnd();
+ }
+ }
+
+ // Visit the RuntimeVisibleAnnotations attribute.
+ if (runtimeVisibleAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeVisibleAnnotationsOffset);
+ int currentAnnotationOffset = runtimeVisibleAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ methodVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+
+ // Visit the RuntimeInvisibleAnnotations attribute.
+ if (runtimeInvisibleAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeInvisibleAnnotationsOffset);
+ int currentAnnotationOffset = runtimeInvisibleAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ methodVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+
+ // Visit the RuntimeVisibleTypeAnnotations attribute.
+ if (runtimeVisibleTypeAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeVisibleTypeAnnotationsOffset);
+ int currentAnnotationOffset = runtimeVisibleTypeAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the target_type, target_info and target_path fields.
+ currentAnnotationOffset = readTypeAnnotationTarget(context, currentAnnotationOffset);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ methodVisitor.visitTypeAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ annotationDescriptor,
+ /* visible = */ true),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+
+ // Visit the RuntimeInvisibleTypeAnnotations attribute.
+ if (runtimeInvisibleTypeAnnotationsOffset != 0) {
+ int numAnnotations = readUnsignedShort(runtimeInvisibleTypeAnnotationsOffset);
+ int currentAnnotationOffset = runtimeInvisibleTypeAnnotationsOffset + 2;
+ while (numAnnotations-- > 0) {
+ // Parse the target_type, target_info and target_path fields.
+ currentAnnotationOffset = readTypeAnnotationTarget(context, currentAnnotationOffset);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentAnnotationOffset =
+ readElementValues(
+ methodVisitor.visitTypeAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ annotationDescriptor,
+ /* visible = */ false),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+
+ // Visit the RuntimeVisibleParameterAnnotations attribute.
+ if (runtimeVisibleParameterAnnotationsOffset != 0) {
+ readParameterAnnotations(
+ methodVisitor, context, runtimeVisibleParameterAnnotationsOffset, /* visible = */ true);
+ }
+
+ // Visit the RuntimeInvisibleParameterAnnotations attribute.
+ if (runtimeInvisibleParameterAnnotationsOffset != 0) {
+ readParameterAnnotations(
+ methodVisitor,
+ context,
+ runtimeInvisibleParameterAnnotationsOffset,
+ /* visible = */ false);
+ }
+
+ // Visit the non standard attributes.
+ while (attributes != null) {
+ // Copy and reset the nextAttribute field so that it can also be used in MethodWriter.
+ Attribute nextAttribute = attributes.nextAttribute;
+ attributes.nextAttribute = null;
+ methodVisitor.visitAttribute(attributes);
+ attributes = nextAttribute;
+ }
+
+ // Visit the Code attribute.
+ if (codeOffset != 0) {
+ methodVisitor.visitCode();
+ readCode(methodVisitor, context, codeOffset);
+ }
+
+ // Visit the end of the method.
+ methodVisitor.visitEnd();
+ return currentOffset;
+ }
+
+ // ----------------------------------------------------------------------------------------------
+ // Methods to parse a Code attribute
+ // ----------------------------------------------------------------------------------------------
+
+ /**
+ * Reads a JVMS 'Code' attribute and makes the given visitor visit it.
+ *
+ * @param methodVisitor the visitor that must visit the Code attribute.
+ * @param context information about the class being parsed.
+ * @param codeOffset the start offset in {@link #classFileBuffer} of the Code attribute, excluding
+ * its attribute_name_index and attribute_length fields.
+ */
+ private void readCode(
+ final MethodVisitor methodVisitor, final Context context, final int codeOffset) {
+ int currentOffset = codeOffset;
+
+ // Read the max_stack, max_locals and code_length fields.
+ final byte[] classBuffer = classFileBuffer;
+ final char[] charBuffer = context.charBuffer;
+ final int maxStack = readUnsignedShort(currentOffset);
+ final int maxLocals = readUnsignedShort(currentOffset + 2);
+ final int codeLength = readInt(currentOffset + 4);
+ currentOffset += 8;
+
+ // Read the bytecode 'code' array to create a label for each referenced instruction.
+ final int bytecodeStartOffset = currentOffset;
+ final int bytecodeEndOffset = currentOffset + codeLength;
+ final Label[] labels = context.currentMethodLabels = new Label[codeLength + 1];
+ while (currentOffset < bytecodeEndOffset) {
+ final int bytecodeOffset = currentOffset - bytecodeStartOffset;
+ final int opcode = classBuffer[currentOffset] & 0xFF;
+ switch (opcode) {
+ case Constants.NOP:
+ case Constants.ACONST_NULL:
+ case Constants.ICONST_M1:
+ case Constants.ICONST_0:
+ case Constants.ICONST_1:
+ case Constants.ICONST_2:
+ case Constants.ICONST_3:
+ case Constants.ICONST_4:
+ case Constants.ICONST_5:
+ case Constants.LCONST_0:
+ case Constants.LCONST_1:
+ case Constants.FCONST_0:
+ case Constants.FCONST_1:
+ case Constants.FCONST_2:
+ case Constants.DCONST_0:
+ case Constants.DCONST_1:
+ case Constants.IALOAD:
+ case Constants.LALOAD:
+ case Constants.FALOAD:
+ case Constants.DALOAD:
+ case Constants.AALOAD:
+ case Constants.BALOAD:
+ case Constants.CALOAD:
+ case Constants.SALOAD:
+ case Constants.IASTORE:
+ case Constants.LASTORE:
+ case Constants.FASTORE:
+ case Constants.DASTORE:
+ case Constants.AASTORE:
+ case Constants.BASTORE:
+ case Constants.CASTORE:
+ case Constants.SASTORE:
+ case Constants.POP:
+ case Constants.POP2:
+ case Constants.DUP:
+ case Constants.DUP_X1:
+ case Constants.DUP_X2:
+ case Constants.DUP2:
+ case Constants.DUP2_X1:
+ case Constants.DUP2_X2:
+ case Constants.SWAP:
+ case Constants.IADD:
+ case Constants.LADD:
+ case Constants.FADD:
+ case Constants.DADD:
+ case Constants.ISUB:
+ case Constants.LSUB:
+ case Constants.FSUB:
+ case Constants.DSUB:
+ case Constants.IMUL:
+ case Constants.LMUL:
+ case Constants.FMUL:
+ case Constants.DMUL:
+ case Constants.IDIV:
+ case Constants.LDIV:
+ case Constants.FDIV:
+ case Constants.DDIV:
+ case Constants.IREM:
+ case Constants.LREM:
+ case Constants.FREM:
+ case Constants.DREM:
+ case Constants.INEG:
+ case Constants.LNEG:
+ case Constants.FNEG:
+ case Constants.DNEG:
+ case Constants.ISHL:
+ case Constants.LSHL:
+ case Constants.ISHR:
+ case Constants.LSHR:
+ case Constants.IUSHR:
+ case Constants.LUSHR:
+ case Constants.IAND:
+ case Constants.LAND:
+ case Constants.IOR:
+ case Constants.LOR:
+ case Constants.IXOR:
+ case Constants.LXOR:
+ case Constants.I2L:
+ case Constants.I2F:
+ case Constants.I2D:
+ case Constants.L2I:
+ case Constants.L2F:
+ case Constants.L2D:
+ case Constants.F2I:
+ case Constants.F2L:
+ case Constants.F2D:
+ case Constants.D2I:
+ case Constants.D2L:
+ case Constants.D2F:
+ case Constants.I2B:
+ case Constants.I2C:
+ case Constants.I2S:
+ case Constants.LCMP:
+ case Constants.FCMPL:
+ case Constants.FCMPG:
+ case Constants.DCMPL:
+ case Constants.DCMPG:
+ case Constants.IRETURN:
+ case Constants.LRETURN:
+ case Constants.FRETURN:
+ case Constants.DRETURN:
+ case Constants.ARETURN:
+ case Constants.RETURN:
+ case Constants.ARRAYLENGTH:
+ case Constants.ATHROW:
+ case Constants.MONITORENTER:
+ case Constants.MONITOREXIT:
+ case Constants.ILOAD_0:
+ case Constants.ILOAD_1:
+ case Constants.ILOAD_2:
+ case Constants.ILOAD_3:
+ case Constants.LLOAD_0:
+ case Constants.LLOAD_1:
+ case Constants.LLOAD_2:
+ case Constants.LLOAD_3:
+ case Constants.FLOAD_0:
+ case Constants.FLOAD_1:
+ case Constants.FLOAD_2:
+ case Constants.FLOAD_3:
+ case Constants.DLOAD_0:
+ case Constants.DLOAD_1:
+ case Constants.DLOAD_2:
+ case Constants.DLOAD_3:
+ case Constants.ALOAD_0:
+ case Constants.ALOAD_1:
+ case Constants.ALOAD_2:
+ case Constants.ALOAD_3:
+ case Constants.ISTORE_0:
+ case Constants.ISTORE_1:
+ case Constants.ISTORE_2:
+ case Constants.ISTORE_3:
+ case Constants.LSTORE_0:
+ case Constants.LSTORE_1:
+ case Constants.LSTORE_2:
+ case Constants.LSTORE_3:
+ case Constants.FSTORE_0:
+ case Constants.FSTORE_1:
+ case Constants.FSTORE_2:
+ case Constants.FSTORE_3:
+ case Constants.DSTORE_0:
+ case Constants.DSTORE_1:
+ case Constants.DSTORE_2:
+ case Constants.DSTORE_3:
+ case Constants.ASTORE_0:
+ case Constants.ASTORE_1:
+ case Constants.ASTORE_2:
+ case Constants.ASTORE_3:
+ currentOffset += 1;
+ break;
+ case Constants.IFEQ:
+ case Constants.IFNE:
+ case Constants.IFLT:
+ case Constants.IFGE:
+ case Constants.IFGT:
+ case Constants.IFLE:
+ case Constants.IF_ICMPEQ:
+ case Constants.IF_ICMPNE:
+ case Constants.IF_ICMPLT:
+ case Constants.IF_ICMPGE:
+ case Constants.IF_ICMPGT:
+ case Constants.IF_ICMPLE:
+ case Constants.IF_ACMPEQ:
+ case Constants.IF_ACMPNE:
+ case Constants.GOTO:
+ case Constants.JSR:
+ case Constants.IFNULL:
+ case Constants.IFNONNULL:
+ createLabel(bytecodeOffset + readShort(currentOffset + 1), labels);
+ currentOffset += 3;
+ break;
+ case Constants.ASM_IFEQ:
+ case Constants.ASM_IFNE:
+ case Constants.ASM_IFLT:
+ case Constants.ASM_IFGE:
+ case Constants.ASM_IFGT:
+ case Constants.ASM_IFLE:
+ case Constants.ASM_IF_ICMPEQ:
+ case Constants.ASM_IF_ICMPNE:
+ case Constants.ASM_IF_ICMPLT:
+ case Constants.ASM_IF_ICMPGE:
+ case Constants.ASM_IF_ICMPGT:
+ case Constants.ASM_IF_ICMPLE:
+ case Constants.ASM_IF_ACMPEQ:
+ case Constants.ASM_IF_ACMPNE:
+ case Constants.ASM_GOTO:
+ case Constants.ASM_JSR:
+ case Constants.ASM_IFNULL:
+ case Constants.ASM_IFNONNULL:
+ createLabel(bytecodeOffset + readUnsignedShort(currentOffset + 1), labels);
+ currentOffset += 3;
+ break;
+ case Constants.GOTO_W:
+ case Constants.JSR_W:
+ case Constants.ASM_GOTO_W:
+ createLabel(bytecodeOffset + readInt(currentOffset + 1), labels);
+ currentOffset += 5;
+ break;
+ case Constants.WIDE:
+ switch (classBuffer[currentOffset + 1] & 0xFF) {
+ case Constants.ILOAD:
+ case Constants.FLOAD:
+ case Constants.ALOAD:
+ case Constants.LLOAD:
+ case Constants.DLOAD:
+ case Constants.ISTORE:
+ case Constants.FSTORE:
+ case Constants.ASTORE:
+ case Constants.LSTORE:
+ case Constants.DSTORE:
+ case Constants.RET:
+ currentOffset += 4;
+ break;
+ case Constants.IINC:
+ currentOffset += 6;
+ break;
default:
- target &= (target >>> 24) < 0x43 ? 0xFFFFFF00 : 0xFF000000;
- u += 3;
- break;
- }
- int pathLength = readByte(u);
- context.typeRef = target;
- context.typePath = pathLength == 0 ? null : new TypePath(b, u);
- return u + 1 + 2 * pathLength;
+ throw new IllegalArgumentException();
+ }
+ break;
+ case Constants.TABLESWITCH:
+ // Skip 0 to 3 padding bytes.
+ currentOffset += 4 - (bytecodeOffset & 3);
+ // Read the default label and the number of table entries.
+ createLabel(bytecodeOffset + readInt(currentOffset), labels);
+ int numTableEntries = readInt(currentOffset + 8) - readInt(currentOffset + 4) + 1;
+ currentOffset += 12;
+ // Read the table labels.
+ while (numTableEntries-- > 0) {
+ createLabel(bytecodeOffset + readInt(currentOffset), labels);
+ currentOffset += 4;
+ }
+ break;
+ case Constants.LOOKUPSWITCH:
+ // Skip 0 to 3 padding bytes.
+ currentOffset += 4 - (bytecodeOffset & 3);
+ // Read the default label and the number of switch cases.
+ createLabel(bytecodeOffset + readInt(currentOffset), labels);
+ int numSwitchCases = readInt(currentOffset + 4);
+ currentOffset += 8;
+ // Read the switch labels.
+ while (numSwitchCases-- > 0) {
+ createLabel(bytecodeOffset + readInt(currentOffset + 4), labels);
+ currentOffset += 8;
+ }
+ break;
+ case Constants.ILOAD:
+ case Constants.LLOAD:
+ case Constants.FLOAD:
+ case Constants.DLOAD:
+ case Constants.ALOAD:
+ case Constants.ISTORE:
+ case Constants.LSTORE:
+ case Constants.FSTORE:
+ case Constants.DSTORE:
+ case Constants.ASTORE:
+ case Constants.RET:
+ case Constants.BIPUSH:
+ case Constants.NEWARRAY:
+ case Constants.LDC:
+ currentOffset += 2;
+ break;
+ case Constants.SIPUSH:
+ case Constants.LDC_W:
+ case Constants.LDC2_W:
+ case Constants.GETSTATIC:
+ case Constants.PUTSTATIC:
+ case Constants.GETFIELD:
+ case Constants.PUTFIELD:
+ case Constants.INVOKEVIRTUAL:
+ case Constants.INVOKESPECIAL:
+ case Constants.INVOKESTATIC:
+ case Constants.NEW:
+ case Constants.ANEWARRAY:
+ case Constants.CHECKCAST:
+ case Constants.INSTANCEOF:
+ case Constants.IINC:
+ currentOffset += 3;
+ break;
+ case Constants.INVOKEINTERFACE:
+ case Constants.INVOKEDYNAMIC:
+ currentOffset += 5;
+ break;
+ case Constants.MULTIANEWARRAY:
+ currentOffset += 4;
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
}
- /**
- * Reads parameter annotations and makes the given visitor visit them.
- *
- * @param mv
- * the visitor that must visit the annotations.
- * @param context
- * information about the class being parsed.
- * @param v
- * start offset in {@link #b b} of the annotations to be read.
- * @param visible
- * <tt>true</tt> if the annotations to be read are visible at
- * runtime.
- */
- private void readParameterAnnotations(final MethodVisitor mv,
- final Context context, int v, final boolean visible) {
- int i;
- int n = b[v++] & 0xFF;
- // workaround for a bug in javac (javac compiler generates a parameter
- // annotation array whose size is equal to the number of parameters in
- // the Java source file, while it should generate an array whose size is
- // equal to the number of parameters in the method descriptor - which
- // includes the synthetic parameters added by the compiler). This work-
- // around supposes that the synthetic parameters are the first ones.
- int synthetics = Type.getArgumentTypes(context.desc).length - n;
- AnnotationVisitor av;
- for (i = 0; i < synthetics; ++i) {
- // virtual annotation to detect synthetic parameters in MethodWriter
- av = mv.visitParameterAnnotation(i, "Ljava/lang/Synthetic;", false);
- if (av != null) {
- av.visitEnd();
- }
- }
- char[] c = context.buffer;
- for (; i < n + synthetics; ++i) {
- int j = readUnsignedShort(v);
- v += 2;
- for (; j > 0; --j) {
- av = mv.visitParameterAnnotation(i, readUTF8(v, c), visible);
- v = readAnnotationValues(v + 2, c, true, av);
- }
- }
+ // Read the 'exception_table_length' and 'exception_table' field to create a label for each
+ // referenced instruction, and to make methodVisitor visit the corresponding try catch blocks.
+ int exceptionTableLength = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (exceptionTableLength-- > 0) {
+ Label start = createLabel(readUnsignedShort(currentOffset), labels);
+ Label end = createLabel(readUnsignedShort(currentOffset + 2), labels);
+ Label handler = createLabel(readUnsignedShort(currentOffset + 4), labels);
+ String catchType = readUTF8(cpInfoOffsets[readUnsignedShort(currentOffset + 6)], charBuffer);
+ currentOffset += 8;
+ methodVisitor.visitTryCatchBlock(start, end, handler, catchType);
}
- /**
- * Reads the values of an annotation and makes the given visitor visit them.
- *
- * @param v
- * the start offset in {@link #b b} of the values to be read
- * (including the unsigned short that gives the number of
- * values).
- * @param buf
- * buffer to be used to call {@link #readUTF8 readUTF8},
- * {@link #readClass(int,char[]) readClass} or {@link #readConst
- * readConst}.
- * @param named
- * if the annotation values are named or not.
- * @param av
- * the visitor that must visit the values.
- * @return the end offset of the annotation values.
- */
- private int readAnnotationValues(int v, final char[] buf,
- final boolean named, final AnnotationVisitor av) {
- int i = readUnsignedShort(v);
- v += 2;
- if (named) {
- for (; i > 0; --i) {
- v = readAnnotationValue(v + 2, buf, readUTF8(v, buf), av);
- }
+ // Read the Code attributes to create a label for each referenced instruction (the variables
+ // are ordered as in Section 4.7 of the JVMS). Attribute offsets exclude the
+ // attribute_name_index and attribute_length fields.
+ // - The offset of the current 'stack_map_frame' in the StackMap[Table] attribute, or 0.
+ // Initially, this is the offset of the first 'stack_map_frame' entry. Then this offset is
+ // updated after each stack_map_frame is read.
+ int stackMapFrameOffset = 0;
+ // - The end offset of the StackMap[Table] attribute, or 0.
+ int stackMapTableEndOffset = 0;
+ // - Whether the stack map frames are compressed (i.e. in a StackMapTable) or not.
+ boolean compressedFrames = true;
+ // - The offset of the LocalVariableTable attribute, or 0.
+ int localVariableTableOffset = 0;
+ // - The offset of the LocalVariableTypeTable attribute, or 0.
+ int localVariableTypeTableOffset = 0;
+ // - The offset of each 'type_annotation' entry in the RuntimeVisibleTypeAnnotations
+ // attribute, or null.
+ int[] visibleTypeAnnotationOffsets = null;
+ // - The offset of each 'type_annotation' entry in the RuntimeInvisibleTypeAnnotations
+ // attribute, or null.
+ int[] invisibleTypeAnnotationOffsets = null;
+ // - The non standard attributes (linked with their {@link Attribute#nextAttribute} field).
+ // This list in the <i>reverse order</i> or their order in the ClassFile structure.
+ Attribute attributes = null;
+
+ int attributesCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (attributesCount-- > 0) {
+ // Read the attribute_info's attribute_name and attribute_length fields.
+ String attributeName = readUTF8(currentOffset, charBuffer);
+ int attributeLength = readInt(currentOffset + 2);
+ currentOffset += 6;
+ if (Constants.LOCAL_VARIABLE_TABLE.equals(attributeName)) {
+ if ((context.parsingOptions & SKIP_DEBUG) == 0) {
+ localVariableTableOffset = currentOffset;
+ // Parse the attribute to find the corresponding (debug only) labels.
+ int currentLocalVariableTableOffset = currentOffset;
+ int localVariableTableLength = readUnsignedShort(currentLocalVariableTableOffset);
+ currentLocalVariableTableOffset += 2;
+ while (localVariableTableLength-- > 0) {
+ int startPc = readUnsignedShort(currentLocalVariableTableOffset);
+ createDebugLabel(startPc, labels);
+ int length = readUnsignedShort(currentLocalVariableTableOffset + 2);
+ createDebugLabel(startPc + length, labels);
+ // Skip the name_index, descriptor_index and index fields (2 bytes each).
+ currentLocalVariableTableOffset += 10;
+ }
+ }
+ } else if (Constants.LOCAL_VARIABLE_TYPE_TABLE.equals(attributeName)) {
+ localVariableTypeTableOffset = currentOffset;
+ // Here we do not extract the labels corresponding to the attribute content. We assume they
+ // are the same or a subset of those of the LocalVariableTable attribute.
+ } else if (Constants.LINE_NUMBER_TABLE.equals(attributeName)) {
+ if ((context.parsingOptions & SKIP_DEBUG) == 0) {
+ // Parse the attribute to find the corresponding (debug only) labels.
+ int currentLineNumberTableOffset = currentOffset;
+ int lineNumberTableLength = readUnsignedShort(currentLineNumberTableOffset);
+ currentLineNumberTableOffset += 2;
+ while (lineNumberTableLength-- > 0) {
+ int startPc = readUnsignedShort(currentLineNumberTableOffset);
+ int lineNumber = readUnsignedShort(currentLineNumberTableOffset + 2);
+ currentLineNumberTableOffset += 4;
+ createDebugLabel(startPc, labels);
+ labels[startPc].addLineNumber(lineNumber);
+ }
+ }
+ } else if (Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
+ visibleTypeAnnotationOffsets =
+ readTypeAnnotations(methodVisitor, context, currentOffset, /* visible = */ true);
+ // Here we do not extract the labels corresponding to the attribute content. This would
+ // require a full parsing of the attribute, which would need to be repeated when parsing
+ // the bytecode instructions (see below). Instead, the content of the attribute is read one
+ // type annotation at a time (i.e. after a type annotation has been visited, the next type
+ // annotation is read), and the labels it contains are also extracted one annotation at a
+ // time. This assumes that type annotations are ordered by increasing bytecode offset.
+ } else if (Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
+ invisibleTypeAnnotationOffsets =
+ readTypeAnnotations(methodVisitor, context, currentOffset, /* visible = */ false);
+ // Same comment as above for the RuntimeVisibleTypeAnnotations attribute.
+ } else if (Constants.STACK_MAP_TABLE.equals(attributeName)) {
+ if ((context.parsingOptions & SKIP_FRAMES) == 0) {
+ stackMapFrameOffset = currentOffset + 2;
+ stackMapTableEndOffset = currentOffset + attributeLength;
+ }
+ // Here we do not extract the labels corresponding to the attribute content. This would
+ // require a full parsing of the attribute, which would need to be repeated when parsing
+ // the bytecode instructions (see below). Instead, the content of the attribute is read one
+ // frame at a time (i.e. after a frame has been visited, the next frame is read), and the
+ // labels it contains are also extracted one frame at a time. Thanks to the ordering of
+ // frames, having only a "one frame lookahead" is not a problem, i.e. it is not possible to
+ // see an offset smaller than the offset of the current instruction and for which no Label
+ // exist. Except for UNINITIALIZED type offsets. We solve this by parsing the stack map
+ // table without a full decoding (see below).
+ } else if ("StackMap".equals(attributeName)) {
+ if ((context.parsingOptions & SKIP_FRAMES) == 0) {
+ stackMapFrameOffset = currentOffset + 2;
+ stackMapTableEndOffset = currentOffset + attributeLength;
+ compressedFrames = false;
+ }
+ // IMPORTANT! Here we assume that the frames are ordered, as in the StackMapTable attribute,
+ // although this is not guaranteed by the attribute format. This allows an incremental
+ // extraction of the labels corresponding to this attribute (see the comment above for the
+ // StackMapTable attribute).
+ } else {
+ Attribute attribute =
+ readAttribute(
+ context.attributePrototypes,
+ attributeName,
+ currentOffset,
+ attributeLength,
+ charBuffer,
+ codeOffset,
+ labels);
+ attribute.nextAttribute = attributes;
+ attributes = attribute;
+ }
+ currentOffset += attributeLength;
+ }
+
+ // Initialize the context fields related to stack map frames, and generate the first
+ // (implicit) stack map frame, if needed.
+ final boolean expandFrames = (context.parsingOptions & EXPAND_FRAMES) != 0;
+ if (stackMapFrameOffset != 0) {
+ // The bytecode offset of the first explicit frame is not offset_delta + 1 but only
+ // offset_delta. Setting the implicit frame offset to -1 allows us to use of the
+ // "offset_delta + 1" rule in all cases.
+ context.currentFrameOffset = -1;
+ context.currentFrameType = 0;
+ context.currentFrameLocalCount = 0;
+ context.currentFrameLocalCountDelta = 0;
+ context.currentFrameLocalTypes = new Object[maxLocals];
+ context.currentFrameStackCount = 0;
+ context.currentFrameStackTypes = new Object[maxStack];
+ if (expandFrames) {
+ computeImplicitFrame(context);
+ }
+ // Find the labels for UNINITIALIZED frame types. Instead of decoding each element of the
+ // stack map table, we look for 3 consecutive bytes that "look like" an UNINITIALIZED type
+ // (tag ITEM_Uninitialized, offset within bytecode bounds, NEW instruction at this offset).
+ // We may find false positives (i.e. not real UNINITIALIZED types), but this should be rare,
+ // and the only consequence will be the creation of an unneeded label. This is better than
+ // creating a label for each NEW instruction, and faster than fully decoding the whole stack
+ // map table.
+ for (int offset = stackMapFrameOffset; offset < stackMapTableEndOffset - 2; ++offset) {
+ if (classBuffer[offset] == Frame.ITEM_UNINITIALIZED) {
+ int potentialBytecodeOffset = readUnsignedShort(offset + 1);
+ if (potentialBytecodeOffset >= 0
+ && potentialBytecodeOffset < codeLength
+ && (classBuffer[bytecodeStartOffset + potentialBytecodeOffset] & 0xFF)
+ == Opcodes.NEW) {
+ createLabel(potentialBytecodeOffset, labels);
+ }
+ }
+ }
+ }
+ if (expandFrames && (context.parsingOptions & EXPAND_ASM_INSNS) != 0) {
+ // Expanding the ASM specific instructions can introduce F_INSERT frames, even if the method
+ // does not currently have any frame. These inserted frames must be computed by simulating the
+ // effect of the bytecode instructions, one by one, starting from the implicit first frame.
+ // For this, MethodWriter needs to know maxLocals before the first instruction is visited. To
+ // ensure this, we visit the implicit first frame here (passing only maxLocals - the rest is
+ // computed in MethodWriter).
+ methodVisitor.visitFrame(Opcodes.F_NEW, maxLocals, null, 0, null);
+ }
+
+ // Visit the bytecode instructions. First, introduce state variables for the incremental parsing
+ // of the type annotations.
+
+ // Index of the next runtime visible type annotation to read (in the
+ // visibleTypeAnnotationOffsets array).
+ int currentVisibleTypeAnnotationIndex = 0;
+ // The bytecode offset of the next runtime visible type annotation to read, or -1.
+ int currentVisibleTypeAnnotationBytecodeOffset =
+ getTypeAnnotationBytecodeOffset(visibleTypeAnnotationOffsets, 0);
+ // Index of the next runtime invisible type annotation to read (in the
+ // invisibleTypeAnnotationOffsets array).
+ int currentInvisibleTypeAnnotationIndex = 0;
+ // The bytecode offset of the next runtime invisible type annotation to read, or -1.
+ int currentInvisibleTypeAnnotationBytecodeOffset =
+ getTypeAnnotationBytecodeOffset(invisibleTypeAnnotationOffsets, 0);
+
+ // Whether a F_INSERT stack map frame must be inserted before the current instruction.
+ boolean insertFrame = false;
+
+ // The delta to subtract from a goto_w or jsr_w opcode to get the corresponding goto or jsr
+ // opcode, or 0 if goto_w and jsr_w must be left unchanged (i.e. when expanding ASM specific
+ // instructions).
+ final int wideJumpOpcodeDelta =
+ (context.parsingOptions & EXPAND_ASM_INSNS) == 0 ? Constants.WIDE_JUMP_OPCODE_DELTA : 0;
+
+ currentOffset = bytecodeStartOffset;
+ while (currentOffset < bytecodeEndOffset) {
+ final int currentBytecodeOffset = currentOffset - bytecodeStartOffset;
+
+ // Visit the label and the line number(s) for this bytecode offset, if any.
+ Label currentLabel = labels[currentBytecodeOffset];
+ if (currentLabel != null) {
+ currentLabel.accept(methodVisitor, (context.parsingOptions & SKIP_DEBUG) == 0);
+ }
+
+ // Visit the stack map frame for this bytecode offset, if any.
+ while (stackMapFrameOffset != 0
+ && (context.currentFrameOffset == currentBytecodeOffset
+ || context.currentFrameOffset == -1)) {
+ // If there is a stack map frame for this offset, make methodVisitor visit it, and read the
+ // next stack map frame if there is one.
+ if (context.currentFrameOffset != -1) {
+ if (!compressedFrames || expandFrames) {
+ methodVisitor.visitFrame(
+ Opcodes.F_NEW,
+ context.currentFrameLocalCount,
+ context.currentFrameLocalTypes,
+ context.currentFrameStackCount,
+ context.currentFrameStackTypes);
+ } else {
+ methodVisitor.visitFrame(
+ context.currentFrameType,
+ context.currentFrameLocalCountDelta,
+ context.currentFrameLocalTypes,
+ context.currentFrameStackCount,
+ context.currentFrameStackTypes);
+ }
+ // Since there is already a stack map frame for this bytecode offset, there is no need to
+ // insert a new one.
+ insertFrame = false;
+ }
+ if (stackMapFrameOffset < stackMapTableEndOffset) {
+ stackMapFrameOffset =
+ readStackMapFrame(stackMapFrameOffset, compressedFrames, expandFrames, context);
} else {
- for (; i > 0; --i) {
- v = readAnnotationValue(v, buf, null, av);
- }
+ stackMapFrameOffset = 0;
}
- if (av != null) {
- av.visitEnd();
- }
- return v;
- }
+ }
- /**
- * Reads a value of an annotation and makes the given visitor visit it.
- *
- * @param v
- * the start offset in {@link #b b} of the value to be read
- * (<i>not including the value name constant pool index</i>).
- * @param buf
- * buffer to be used to call {@link #readUTF8 readUTF8},
- * {@link #readClass(int,char[]) readClass} or {@link #readConst
- * readConst}.
- * @param name
- * the name of the value to be read.
- * @param av
- * the visitor that must visit the value.
- * @return the end offset of the annotation value.
- */
- private int readAnnotationValue(int v, final char[] buf, final String name,
- final AnnotationVisitor av) {
- int i;
- if (av == null) {
- switch (b[v] & 0xFF) {
- case 'e': // enum_const_value
- return v + 5;
- case '@': // annotation_value
- return readAnnotationValues(v + 3, buf, true, null);
- case '[': // array_value
- return readAnnotationValues(v + 1, buf, false, null);
- default:
- return v + 3;
- }
+ // Insert a stack map frame for this bytecode offset, if requested by setting insertFrame to
+ // true during the previous iteration. The actual frame content is computed in MethodWriter.
+ if (insertFrame) {
+ if ((context.parsingOptions & EXPAND_FRAMES) != 0) {
+ methodVisitor.visitFrame(Constants.F_INSERT, 0, null, 0, null);
}
- switch (b[v++] & 0xFF) {
- case 'I': // pointer to CONSTANT_Integer
- case 'J': // pointer to CONSTANT_Long
- case 'F': // pointer to CONSTANT_Float
- case 'D': // pointer to CONSTANT_Double
- av.visit(name, readConst(readUnsignedShort(v), buf));
- v += 2;
- break;
- case 'B': // pointer to CONSTANT_Byte
- av.visit(name, (byte) readInt(items[readUnsignedShort(v)]));
- v += 2;
- break;
- case 'Z': // pointer to CONSTANT_Boolean
- av.visit(name,
- readInt(items[readUnsignedShort(v)]) == 0 ? Boolean.FALSE
- : Boolean.TRUE);
- v += 2;
- break;
- case 'S': // pointer to CONSTANT_Short
- av.visit(name, (short) readInt(items[readUnsignedShort(v)]));
- v += 2;
- break;
- case 'C': // pointer to CONSTANT_Char
- av.visit(name, (char) readInt(items[readUnsignedShort(v)]));
- v += 2;
- break;
- case 's': // pointer to CONSTANT_Utf8
- av.visit(name, readUTF8(v, buf));
- v += 2;
- break;
- case 'e': // enum_const_value
- av.visitEnum(name, readUTF8(v, buf), readUTF8(v + 2, buf));
- v += 4;
- break;
- case 'c': // class_info
- av.visit(name, Type.getType(readUTF8(v, buf)));
- v += 2;
- break;
- case '@': // annotation_value
- v = readAnnotationValues(v + 2, buf, true,
- av.visitAnnotation(name, readUTF8(v, buf)));
- break;
- case '[': // array_value
- int size = readUnsignedShort(v);
- v += 2;
- if (size == 0) {
- return readAnnotationValues(v - 2, buf, false,
- av.visitArray(name));
- }
- switch (this.b[v++] & 0xFF) {
- case 'B':
- byte[] bv = new byte[size];
- for (i = 0; i < size; i++) {
- bv[i] = (byte) readInt(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, bv);
- --v;
- break;
- case 'Z':
- boolean[] zv = new boolean[size];
- for (i = 0; i < size; i++) {
- zv[i] = readInt(items[readUnsignedShort(v)]) != 0;
- v += 3;
- }
- av.visit(name, zv);
- --v;
- break;
- case 'S':
- short[] sv = new short[size];
- for (i = 0; i < size; i++) {
- sv[i] = (short) readInt(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, sv);
- --v;
- break;
- case 'C':
- char[] cv = new char[size];
- for (i = 0; i < size; i++) {
- cv[i] = (char) readInt(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, cv);
- --v;
- break;
- case 'I':
- int[] iv = new int[size];
- for (i = 0; i < size; i++) {
- iv[i] = readInt(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, iv);
- --v;
- break;
- case 'J':
- long[] lv = new long[size];
- for (i = 0; i < size; i++) {
- lv[i] = readLong(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, lv);
- --v;
- break;
- case 'F':
- float[] fv = new float[size];
- for (i = 0; i < size; i++) {
- fv[i] = Float
- .intBitsToFloat(readInt(items[readUnsignedShort(v)]));
- v += 3;
- }
- av.visit(name, fv);
- --v;
- break;
- case 'D':
- double[] dv = new double[size];
- for (i = 0; i < size; i++) {
- dv[i] = Double
- .longBitsToDouble(readLong(items[readUnsignedShort(v)]));
- v += 3;
- }
- av.visit(name, dv);
- --v;
- break;
- default:
- v = readAnnotationValues(v - 3, buf, false, av.visitArray(name));
- }
- }
- return v;
- }
+ insertFrame = false;
+ }
- /**
- * Computes the implicit frame of the method currently being parsed (as
- * defined in the given {@link Context}) and stores it in the given context.
- *
- * @param frame
- * information about the class being parsed.
- */
- private void getImplicitFrame(final Context frame) {
- String desc = frame.desc;
- Object[] locals = frame.local;
- int local = 0;
- if ((frame.access & Opcodes.ACC_STATIC) == 0) {
- if ("<init>".equals(frame.name)) {
- locals[local++] = Opcodes.UNINITIALIZED_THIS;
+ // Visit the instruction at this bytecode offset.
+ int opcode = classBuffer[currentOffset] & 0xFF;
+ switch (opcode) {
+ case Constants.NOP:
+ case Constants.ACONST_NULL:
+ case Constants.ICONST_M1:
+ case Constants.ICONST_0:
+ case Constants.ICONST_1:
+ case Constants.ICONST_2:
+ case Constants.ICONST_3:
+ case Constants.ICONST_4:
+ case Constants.ICONST_5:
+ case Constants.LCONST_0:
+ case Constants.LCONST_1:
+ case Constants.FCONST_0:
+ case Constants.FCONST_1:
+ case Constants.FCONST_2:
+ case Constants.DCONST_0:
+ case Constants.DCONST_1:
+ case Constants.IALOAD:
+ case Constants.LALOAD:
+ case Constants.FALOAD:
+ case Constants.DALOAD:
+ case Constants.AALOAD:
+ case Constants.BALOAD:
+ case Constants.CALOAD:
+ case Constants.SALOAD:
+ case Constants.IASTORE:
+ case Constants.LASTORE:
+ case Constants.FASTORE:
+ case Constants.DASTORE:
+ case Constants.AASTORE:
+ case Constants.BASTORE:
+ case Constants.CASTORE:
+ case Constants.SASTORE:
+ case Constants.POP:
+ case Constants.POP2:
+ case Constants.DUP:
+ case Constants.DUP_X1:
+ case Constants.DUP_X2:
+ case Constants.DUP2:
+ case Constants.DUP2_X1:
+ case Constants.DUP2_X2:
+ case Constants.SWAP:
+ case Constants.IADD:
+ case Constants.LADD:
+ case Constants.FADD:
+ case Constants.DADD:
+ case Constants.ISUB:
+ case Constants.LSUB:
+ case Constants.FSUB:
+ case Constants.DSUB:
+ case Constants.IMUL:
+ case Constants.LMUL:
+ case Constants.FMUL:
+ case Constants.DMUL:
+ case Constants.IDIV:
+ case Constants.LDIV:
+ case Constants.FDIV:
+ case Constants.DDIV:
+ case Constants.IREM:
+ case Constants.LREM:
+ case Constants.FREM:
+ case Constants.DREM:
+ case Constants.INEG:
+ case Constants.LNEG:
+ case Constants.FNEG:
+ case Constants.DNEG:
+ case Constants.ISHL:
+ case Constants.LSHL:
+ case Constants.ISHR:
+ case Constants.LSHR:
+ case Constants.IUSHR:
+ case Constants.LUSHR:
+ case Constants.IAND:
+ case Constants.LAND:
+ case Constants.IOR:
+ case Constants.LOR:
+ case Constants.IXOR:
+ case Constants.LXOR:
+ case Constants.I2L:
+ case Constants.I2F:
+ case Constants.I2D:
+ case Constants.L2I:
+ case Constants.L2F:
+ case Constants.L2D:
+ case Constants.F2I:
+ case Constants.F2L:
+ case Constants.F2D:
+ case Constants.D2I:
+ case Constants.D2L:
+ case Constants.D2F:
+ case Constants.I2B:
+ case Constants.I2C:
+ case Constants.I2S:
+ case Constants.LCMP:
+ case Constants.FCMPL:
+ case Constants.FCMPG:
+ case Constants.DCMPL:
+ case Constants.DCMPG:
+ case Constants.IRETURN:
+ case Constants.LRETURN:
+ case Constants.FRETURN:
+ case Constants.DRETURN:
+ case Constants.ARETURN:
+ case Constants.RETURN:
+ case Constants.ARRAYLENGTH:
+ case Constants.ATHROW:
+ case Constants.MONITORENTER:
+ case Constants.MONITOREXIT:
+ methodVisitor.visitInsn(opcode);
+ currentOffset += 1;
+ break;
+ case Constants.ILOAD_0:
+ case Constants.ILOAD_1:
+ case Constants.ILOAD_2:
+ case Constants.ILOAD_3:
+ case Constants.LLOAD_0:
+ case Constants.LLOAD_1:
+ case Constants.LLOAD_2:
+ case Constants.LLOAD_3:
+ case Constants.FLOAD_0:
+ case Constants.FLOAD_1:
+ case Constants.FLOAD_2:
+ case Constants.FLOAD_3:
+ case Constants.DLOAD_0:
+ case Constants.DLOAD_1:
+ case Constants.DLOAD_2:
+ case Constants.DLOAD_3:
+ case Constants.ALOAD_0:
+ case Constants.ALOAD_1:
+ case Constants.ALOAD_2:
+ case Constants.ALOAD_3:
+ opcode -= Constants.ILOAD_0;
+ methodVisitor.visitVarInsn(Opcodes.ILOAD + (opcode >> 2), opcode & 0x3);
+ currentOffset += 1;
+ break;
+ case Constants.ISTORE_0:
+ case Constants.ISTORE_1:
+ case Constants.ISTORE_2:
+ case Constants.ISTORE_3:
+ case Constants.LSTORE_0:
+ case Constants.LSTORE_1:
+ case Constants.LSTORE_2:
+ case Constants.LSTORE_3:
+ case Constants.FSTORE_0:
+ case Constants.FSTORE_1:
+ case Constants.FSTORE_2:
+ case Constants.FSTORE_3:
+ case Constants.DSTORE_0:
+ case Constants.DSTORE_1:
+ case Constants.DSTORE_2:
+ case Constants.DSTORE_3:
+ case Constants.ASTORE_0:
+ case Constants.ASTORE_1:
+ case Constants.ASTORE_2:
+ case Constants.ASTORE_3:
+ opcode -= Constants.ISTORE_0;
+ methodVisitor.visitVarInsn(Opcodes.ISTORE + (opcode >> 2), opcode & 0x3);
+ currentOffset += 1;
+ break;
+ case Constants.IFEQ:
+ case Constants.IFNE:
+ case Constants.IFLT:
+ case Constants.IFGE:
+ case Constants.IFGT:
+ case Constants.IFLE:
+ case Constants.IF_ICMPEQ:
+ case Constants.IF_ICMPNE:
+ case Constants.IF_ICMPLT:
+ case Constants.IF_ICMPGE:
+ case Constants.IF_ICMPGT:
+ case Constants.IF_ICMPLE:
+ case Constants.IF_ACMPEQ:
+ case Constants.IF_ACMPNE:
+ case Constants.GOTO:
+ case Constants.JSR:
+ case Constants.IFNULL:
+ case Constants.IFNONNULL:
+ methodVisitor.visitJumpInsn(
+ opcode, labels[currentBytecodeOffset + readShort(currentOffset + 1)]);
+ currentOffset += 3;
+ break;
+ case Constants.GOTO_W:
+ case Constants.JSR_W:
+ methodVisitor.visitJumpInsn(
+ opcode - wideJumpOpcodeDelta,
+ labels[currentBytecodeOffset + readInt(currentOffset + 1)]);
+ currentOffset += 5;
+ break;
+ case Constants.ASM_IFEQ:
+ case Constants.ASM_IFNE:
+ case Constants.ASM_IFLT:
+ case Constants.ASM_IFGE:
+ case Constants.ASM_IFGT:
+ case Constants.ASM_IFLE:
+ case Constants.ASM_IF_ICMPEQ:
+ case Constants.ASM_IF_ICMPNE:
+ case Constants.ASM_IF_ICMPLT:
+ case Constants.ASM_IF_ICMPGE:
+ case Constants.ASM_IF_ICMPGT:
+ case Constants.ASM_IF_ICMPLE:
+ case Constants.ASM_IF_ACMPEQ:
+ case Constants.ASM_IF_ACMPNE:
+ case Constants.ASM_GOTO:
+ case Constants.ASM_JSR:
+ case Constants.ASM_IFNULL:
+ case Constants.ASM_IFNONNULL:
+ {
+ // A forward jump with an offset > 32767. In this case we automatically replace ASM_GOTO
+ // with GOTO_W, ASM_JSR with JSR_W and ASM_IFxxx <l> with IFNOTxxx <L> GOTO_W <l> L:...,
+ // where IFNOTxxx is the "opposite" opcode of ASMS_IFxxx (e.g. IFNE for ASM_IFEQ) and
+ // where <L> designates the instruction just after the GOTO_W.
+ // First, change the ASM specific opcodes ASM_IFEQ ... ASM_JSR, ASM_IFNULL and
+ // ASM_IFNONNULL to IFEQ ... JSR, IFNULL and IFNONNULL.
+ opcode =
+ opcode < Constants.ASM_IFNULL
+ ? opcode - Constants.ASM_OPCODE_DELTA
+ : opcode - Constants.ASM_IFNULL_OPCODE_DELTA;
+ Label target = labels[currentBytecodeOffset + readUnsignedShort(currentOffset + 1)];
+ if (opcode == Opcodes.GOTO || opcode == Opcodes.JSR) {
+ // Replace GOTO with GOTO_W and JSR with JSR_W.
+ methodVisitor.visitJumpInsn(opcode + Constants.WIDE_JUMP_OPCODE_DELTA, target);
} else {
- locals[local++] = readClass(header + 2, frame.buffer);
+ // Compute the "opposite" of opcode. This can be done by flipping the least
+ // significant bit for IFNULL and IFNONNULL, and similarly for IFEQ ... IF_ACMPEQ
+ // (with a pre and post offset by 1).
+ opcode = opcode < Opcodes.GOTO ? ((opcode + 1) ^ 1) - 1 : opcode ^ 1;
+ Label endif = createLabel(currentBytecodeOffset + 3, labels);
+ methodVisitor.visitJumpInsn(opcode, endif);
+ methodVisitor.visitJumpInsn(Constants.GOTO_W, target);
+ // endif designates the instruction just after GOTO_W, and is visited as part of the
+ // next instruction. Since it is a jump target, we need to insert a frame here.
+ insertFrame = true;
}
- }
- int i = 1;
- loop: while (true) {
- int j = i;
- switch (desc.charAt(i++)) {
- case 'Z':
- case 'C':
- case 'B':
- case 'S':
- case 'I':
- locals[local++] = Opcodes.INTEGER;
- break;
- case 'F':
- locals[local++] = Opcodes.FLOAT;
- break;
- case 'J':
- locals[local++] = Opcodes.LONG;
- break;
- case 'D':
- locals[local++] = Opcodes.DOUBLE;
- break;
- case '[':
- while (desc.charAt(i) == '[') {
- ++i;
- }
- if (desc.charAt(i) == 'L') {
- ++i;
- while (desc.charAt(i) != ';') {
- ++i;
- }
- }
- locals[local++] = desc.substring(j, ++i);
- break;
- case 'L':
- while (desc.charAt(i) != ';') {
- ++i;
- }
- locals[local++] = desc.substring(j + 1, i++);
- break;
- default:
- break loop;
+ currentOffset += 3;
+ break;
+ }
+ case Constants.ASM_GOTO_W:
+ // Replace ASM_GOTO_W with GOTO_W.
+ methodVisitor.visitJumpInsn(
+ Constants.GOTO_W, labels[currentBytecodeOffset + readInt(currentOffset + 1)]);
+ // The instruction just after is a jump target (because ASM_GOTO_W is used in patterns
+ // IFNOTxxx <L> ASM_GOTO_W <l> L:..., see MethodWriter), so we need to insert a frame
+ // here.
+ insertFrame = true;
+ currentOffset += 5;
+ break;
+ case Constants.WIDE:
+ opcode = classBuffer[currentOffset + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ methodVisitor.visitIincInsn(
+ readUnsignedShort(currentOffset + 2), readShort(currentOffset + 4));
+ currentOffset += 6;
+ } else {
+ methodVisitor.visitVarInsn(opcode, readUnsignedShort(currentOffset + 2));
+ currentOffset += 4;
+ }
+ break;
+ case Constants.TABLESWITCH:
+ {
+ // Skip 0 to 3 padding bytes.
+ currentOffset += 4 - (currentBytecodeOffset & 3);
+ // Read the instruction.
+ Label defaultLabel = labels[currentBytecodeOffset + readInt(currentOffset)];
+ int low = readInt(currentOffset + 4);
+ int high = readInt(currentOffset + 8);
+ currentOffset += 12;
+ Label[] table = new Label[high - low + 1];
+ for (int i = 0; i < table.length; ++i) {
+ table[i] = labels[currentBytecodeOffset + readInt(currentOffset)];
+ currentOffset += 4;
}
- }
- frame.localCount = local;
- }
-
- /**
- * Reads a stack map frame and stores the result in the given
- * {@link Context} object.
- *
- * @param stackMap
- * the start offset of a stack map frame in the class file.
- * @param zip
- * if the stack map frame at stackMap is compressed or not.
- * @param unzip
- * if the stack map frame must be uncompressed.
- * @param frame
- * where the parsed stack map frame must be stored.
- * @return the offset of the first byte following the parsed frame.
- */
- private int readFrame(int stackMap, boolean zip, boolean unzip,
- Context frame) {
- char[] c = frame.buffer;
- Label[] labels = frame.labels;
- int tag;
- int delta;
- if (zip) {
- tag = b[stackMap++] & 0xFF;
- } else {
- tag = MethodWriter.FULL_FRAME;
- frame.offset = -1;
- }
- frame.localDiff = 0;
- if (tag < MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME) {
- delta = tag;
- frame.mode = Opcodes.F_SAME;
- frame.stackCount = 0;
- } else if (tag < MethodWriter.RESERVED) {
- delta = tag - MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME;
- stackMap = readFrameType(frame.stack, 0, stackMap, c, labels);
- frame.mode = Opcodes.F_SAME1;
- frame.stackCount = 1;
- } else {
- delta = readUnsignedShort(stackMap);
- stackMap += 2;
- if (tag == MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
- stackMap = readFrameType(frame.stack, 0, stackMap, c, labels);
- frame.mode = Opcodes.F_SAME1;
- frame.stackCount = 1;
- } else if (tag >= MethodWriter.CHOP_FRAME
- && tag < MethodWriter.SAME_FRAME_EXTENDED) {
- frame.mode = Opcodes.F_CHOP;
- frame.localDiff = MethodWriter.SAME_FRAME_EXTENDED - tag;
- frame.localCount -= frame.localDiff;
- frame.stackCount = 0;
- } else if (tag == MethodWriter.SAME_FRAME_EXTENDED) {
- frame.mode = Opcodes.F_SAME;
- frame.stackCount = 0;
- } else if (tag < MethodWriter.FULL_FRAME) {
- int local = unzip ? frame.localCount : 0;
- for (int i = tag - MethodWriter.SAME_FRAME_EXTENDED; i > 0; i--) {
- stackMap = readFrameType(frame.local, local++, stackMap, c,
- labels);
- }
- frame.mode = Opcodes.F_APPEND;
- frame.localDiff = tag - MethodWriter.SAME_FRAME_EXTENDED;
- frame.localCount += frame.localDiff;
- frame.stackCount = 0;
- } else { // if (tag == FULL_FRAME) {
- frame.mode = Opcodes.F_FULL;
- int n = readUnsignedShort(stackMap);
- stackMap += 2;
- frame.localDiff = n;
- frame.localCount = n;
- for (int local = 0; n > 0; n--) {
- stackMap = readFrameType(frame.local, local++, stackMap, c,
- labels);
- }
- n = readUnsignedShort(stackMap);
- stackMap += 2;
- frame.stackCount = n;
- for (int stack = 0; n > 0; n--) {
- stackMap = readFrameType(frame.stack, stack++, stackMap, c,
- labels);
- }
+ methodVisitor.visitTableSwitchInsn(low, high, defaultLabel, table);
+ break;
+ }
+ case Constants.LOOKUPSWITCH:
+ {
+ // Skip 0 to 3 padding bytes.
+ currentOffset += 4 - (currentBytecodeOffset & 3);
+ // Read the instruction.
+ Label defaultLabel = labels[currentBytecodeOffset + readInt(currentOffset)];
+ int numPairs = readInt(currentOffset + 4);
+ currentOffset += 8;
+ int[] keys = new int[numPairs];
+ Label[] values = new Label[numPairs];
+ for (int i = 0; i < numPairs; ++i) {
+ keys[i] = readInt(currentOffset);
+ values[i] = labels[currentBytecodeOffset + readInt(currentOffset + 4)];
+ currentOffset += 8;
}
- }
- frame.offset += delta + 1;
- readLabel(frame.offset, labels);
- return stackMap;
- }
-
- /**
- * Reads a stack map frame type and stores it at the given index in the
- * given array.
- *
- * @param frame
- * the array where the parsed type must be stored.
- * @param index
- * the index in 'frame' where the parsed type must be stored.
- * @param v
- * the start offset of the stack map frame type to read.
- * @param buf
- * a buffer to read strings.
- * @param labels
- * the labels of the method currently being parsed, indexed by
- * their offset. If the parsed type is an Uninitialized type, a
- * new label for the corresponding NEW instruction is stored in
- * this array if it does not already exist.
- * @return the offset of the first byte after the parsed type.
- */
- private int readFrameType(final Object[] frame, final int index, int v,
- final char[] buf, final Label[] labels) {
- int type = b[v++] & 0xFF;
- switch (type) {
- case 0:
- frame[index] = Opcodes.TOP;
- break;
- case 1:
- frame[index] = Opcodes.INTEGER;
- break;
- case 2:
- frame[index] = Opcodes.FLOAT;
- break;
- case 3:
- frame[index] = Opcodes.DOUBLE;
- break;
- case 4:
- frame[index] = Opcodes.LONG;
- break;
- case 5:
- frame[index] = Opcodes.NULL;
- break;
- case 6:
- frame[index] = Opcodes.UNINITIALIZED_THIS;
- break;
- case 7: // Object
- frame[index] = readClass(v, buf);
- v += 2;
- break;
- default: // Uninitialized
- frame[index] = readLabel(readUnsignedShort(v), labels);
- v += 2;
- }
- return v;
- }
-
- /**
- * Returns the label corresponding to the given offset. The default
- * implementation of this method creates a label for the given offset if it
- * has not been already created.
- *
- * @param offset
- * a bytecode offset in a method.
- * @param labels
- * the already created labels, indexed by their offset. If a
- * label already exists for offset this method must not create a
- * new one. Otherwise it must store the new label in this array.
- * @return a non null Label, which must be equal to labels[offset].
- */
- protected Label readLabel(int offset, Label[] labels) {
- if (labels[offset] == null) {
- labels[offset] = new Label();
- }
- return labels[offset];
- }
-
- /**
- * Returns the start index of the attribute_info structure of this class.
- *
- * @return the start index of the attribute_info structure of this class.
- */
- private int getAttributes() {
- // skips the header
- int u = header + 8 + readUnsignedShort(header + 6) * 2;
- // skips fields and methods
- for (int i = readUnsignedShort(u); i > 0; --i) {
- for (int j = readUnsignedShort(u + 8); j > 0; --j) {
- u += 6 + readInt(u + 12);
+ methodVisitor.visitLookupSwitchInsn(defaultLabel, keys, values);
+ break;
+ }
+ case Constants.ILOAD:
+ case Constants.LLOAD:
+ case Constants.FLOAD:
+ case Constants.DLOAD:
+ case Constants.ALOAD:
+ case Constants.ISTORE:
+ case Constants.LSTORE:
+ case Constants.FSTORE:
+ case Constants.DSTORE:
+ case Constants.ASTORE:
+ case Constants.RET:
+ methodVisitor.visitVarInsn(opcode, classBuffer[currentOffset + 1] & 0xFF);
+ currentOffset += 2;
+ break;
+ case Constants.BIPUSH:
+ case Constants.NEWARRAY:
+ methodVisitor.visitIntInsn(opcode, classBuffer[currentOffset + 1]);
+ currentOffset += 2;
+ break;
+ case Constants.SIPUSH:
+ methodVisitor.visitIntInsn(opcode, readShort(currentOffset + 1));
+ currentOffset += 3;
+ break;
+ case Constants.LDC:
+ methodVisitor.visitLdcInsn(readConst(classBuffer[currentOffset + 1] & 0xFF, charBuffer));
+ currentOffset += 2;
+ break;
+ case Constants.LDC_W:
+ case Constants.LDC2_W:
+ methodVisitor.visitLdcInsn(readConst(readUnsignedShort(currentOffset + 1), charBuffer));
+ currentOffset += 3;
+ break;
+ case Constants.GETSTATIC:
+ case Constants.PUTSTATIC:
+ case Constants.GETFIELD:
+ case Constants.PUTFIELD:
+ case Constants.INVOKEVIRTUAL:
+ case Constants.INVOKESPECIAL:
+ case Constants.INVOKESTATIC:
+ case Constants.INVOKEINTERFACE:
+ {
+ int cpInfoOffset = cpInfoOffsets[readUnsignedShort(currentOffset + 1)];
+ int nameAndTypeCpInfoOffset = cpInfoOffsets[readUnsignedShort(cpInfoOffset + 2)];
+ String owner = readClass(cpInfoOffset, charBuffer);
+ String name = readUTF8(nameAndTypeCpInfoOffset, charBuffer);
+ String descriptor = readUTF8(nameAndTypeCpInfoOffset + 2, charBuffer);
+ if (opcode < Opcodes.INVOKEVIRTUAL) {
+ methodVisitor.visitFieldInsn(opcode, owner, name, descriptor);
+ } else {
+ boolean isInterface =
+ classBuffer[cpInfoOffset - 1] == Symbol.CONSTANT_INTERFACE_METHODREF_TAG;
+ methodVisitor.visitMethodInsn(opcode, owner, name, descriptor, isInterface);
}
- u += 8;
- }
- u += 2;
- for (int i = readUnsignedShort(u); i > 0; --i) {
- for (int j = readUnsignedShort(u + 8); j > 0; --j) {
- u += 6 + readInt(u + 12);
+ if (opcode == Opcodes.INVOKEINTERFACE) {
+ currentOffset += 5;
+ } else {
+ currentOffset += 3;
}
- u += 8;
- }
- // the attribute_info structure starts just after the methods
- return u + 2;
- }
-
- /**
- * Reads an attribute in {@link #b b}.
- *
- * @param attrs
- * prototypes of the attributes that must be parsed during the
- * visit of the class. Any attribute whose type is not equal to
- * the type of one the prototypes is ignored (i.e. an empty
- * {@link Attribute} instance is returned).
- * @param type
- * the type of the attribute.
- * @param off
- * index of the first byte of the attribute's content in
- * {@link #b b}. The 6 attribute header bytes, containing the
- * type and the length of the attribute, are not taken into
- * account here (they have already been read).
- * @param len
- * the length of the attribute's content.
- * @param buf
- * buffer to be used to call {@link #readUTF8 readUTF8},
- * {@link #readClass(int,char[]) readClass} or {@link #readConst
- * readConst}.
- * @param codeOff
- * index of the first byte of code's attribute content in
- * {@link #b b}, or -1 if the attribute to be read is not a code
- * attribute. The 6 attribute header bytes, containing the type
- * and the length of the attribute, are not taken into account
- * here.
- * @param labels
- * the labels of the method's code, or <tt>null</tt> if the
- * attribute to be read is not a code attribute.
- * @return the attribute that has been read, or <tt>null</tt> to skip this
- * attribute.
- */
- private Attribute readAttribute(final Attribute[] attrs, final String type,
- final int off, final int len, final char[] buf, final int codeOff,
- final Label[] labels) {
- for (int i = 0; i < attrs.length; ++i) {
- if (attrs[i].type.equals(type)) {
- return attrs[i].read(this, off, len, buf, codeOff, labels);
+ break;
+ }
+ case Constants.INVOKEDYNAMIC:
+ {
+ int cpInfoOffset = cpInfoOffsets[readUnsignedShort(currentOffset + 1)];
+ int nameAndTypeCpInfoOffset = cpInfoOffsets[readUnsignedShort(cpInfoOffset + 2)];
+ String name = readUTF8(nameAndTypeCpInfoOffset, charBuffer);
+ String descriptor = readUTF8(nameAndTypeCpInfoOffset + 2, charBuffer);
+ int bootstrapMethodOffset = bootstrapMethodOffsets[readUnsignedShort(cpInfoOffset)];
+ Handle handle =
+ (Handle) readConst(readUnsignedShort(bootstrapMethodOffset), charBuffer);
+ Object[] bootstrapMethodArguments =
+ new Object[readUnsignedShort(bootstrapMethodOffset + 2)];
+ bootstrapMethodOffset += 4;
+ for (int i = 0; i < bootstrapMethodArguments.length; i++) {
+ bootstrapMethodArguments[i] =
+ readConst(readUnsignedShort(bootstrapMethodOffset), charBuffer);
+ bootstrapMethodOffset += 2;
}
+ methodVisitor.visitInvokeDynamicInsn(
+ name, descriptor, handle, bootstrapMethodArguments);
+ currentOffset += 5;
+ break;
+ }
+ case Constants.NEW:
+ case Constants.ANEWARRAY:
+ case Constants.CHECKCAST:
+ case Constants.INSTANCEOF:
+ methodVisitor.visitTypeInsn(opcode, readClass(currentOffset + 1, charBuffer));
+ currentOffset += 3;
+ break;
+ case Constants.IINC:
+ methodVisitor.visitIincInsn(
+ classBuffer[currentOffset + 1] & 0xFF, classBuffer[currentOffset + 2]);
+ currentOffset += 3;
+ break;
+ case Constants.MULTIANEWARRAY:
+ methodVisitor.visitMultiANewArrayInsn(
+ readClass(currentOffset + 1, charBuffer), classBuffer[currentOffset + 3] & 0xFF);
+ currentOffset += 4;
+ break;
+ default:
+ throw new AssertionError();
+ }
+
+ // Visit the runtime visible instruction annotations, if any.
+ while (visibleTypeAnnotationOffsets != null
+ && currentVisibleTypeAnnotationIndex < visibleTypeAnnotationOffsets.length
+ && currentVisibleTypeAnnotationBytecodeOffset <= currentBytecodeOffset) {
+ if (currentVisibleTypeAnnotationBytecodeOffset == currentBytecodeOffset) {
+ // Parse the target_type, target_info and target_path fields.
+ int currentAnnotationOffset =
+ readTypeAnnotationTarget(
+ context, visibleTypeAnnotationOffsets[currentVisibleTypeAnnotationIndex]);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ readElementValues(
+ methodVisitor.visitInsnAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ annotationDescriptor,
+ /* visible = */ true),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
}
- return new Attribute(type).read(this, off, len, null, -1, null);
- }
+ currentVisibleTypeAnnotationBytecodeOffset =
+ getTypeAnnotationBytecodeOffset(
+ visibleTypeAnnotationOffsets, ++currentVisibleTypeAnnotationIndex);
+ }
- // ------------------------------------------------------------------------
- // Utility methods: low level parsing
- // ------------------------------------------------------------------------
-
- /**
- * Returns the number of constant pool items in {@link #b b}.
- *
- * @return the number of constant pool items in {@link #b b}.
- */
- public int getItemCount() {
- return items.length;
- }
-
- /**
- * Returns the start index of the constant pool item in {@link #b b}, plus
- * one. <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param item
- * the index a constant pool item.
- * @return the start index of the constant pool item in {@link #b b}, plus
- * one.
- */
- public int getItem(final int item) {
- return items[item];
- }
-
- /**
- * Returns the maximum length of the strings contained in the constant pool
- * of the class.
- *
- * @return the maximum length of the strings contained in the constant pool
- * of the class.
- */
- public int getMaxStringLength() {
- return maxStringLength;
- }
-
- /**
- * Reads a byte value in {@link #b b}. <i>This method is intended for
- * {@link Attribute} sub classes, and is normally not needed by class
- * generators or adapters.</i>
- *
- * @param index
- * the start index of the value to be read in {@link #b b}.
- * @return the read value.
- */
- public int readByte(final int index) {
- return b[index] & 0xFF;
- }
-
- /**
- * Reads an unsigned short value in {@link #b b}. <i>This method is intended
- * for {@link Attribute} sub classes, and is normally not needed by class
- * generators or adapters.</i>
- *
- * @param index
- * the start index of the value to be read in {@link #b b}.
- * @return the read value.
- */
- public int readUnsignedShort(final int index) {
- byte[] b = this.b;
- return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
- }
-
- /**
- * Reads a signed short value in {@link #b b}. <i>This method is intended
- * for {@link Attribute} sub classes, and is normally not needed by class
- * generators or adapters.</i>
- *
- * @param index
- * the start index of the value to be read in {@link #b b}.
- * @return the read value.
- */
- public short readShort(final int index) {
- byte[] b = this.b;
- return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
- }
-
- /**
- * Reads a signed int value in {@link #b b}. <i>This method is intended for
- * {@link Attribute} sub classes, and is normally not needed by class
- * generators or adapters.</i>
- *
- * @param index
- * the start index of the value to be read in {@link #b b}.
- * @return the read value.
- */
- public int readInt(final int index) {
- byte[] b = this.b;
- return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
- | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
- }
-
- /**
- * Reads a signed long value in {@link #b b}. <i>This method is intended for
- * {@link Attribute} sub classes, and is normally not needed by class
- * generators or adapters.</i>
- *
- * @param index
- * the start index of the value to be read in {@link #b b}.
- * @return the read value.
- */
- public long readLong(final int index) {
- long l1 = readInt(index);
- long l0 = readInt(index + 4) & 0xFFFFFFFFL;
- return (l1 << 32) | l0;
- }
-
- /**
- * Reads an UTF8 string constant pool item in {@link #b b}. <i>This method
- * is intended for {@link Attribute} sub classes, and is normally not needed
- * by class generators or adapters.</i>
- *
- * @param index
- * the start index of an unsigned short value in {@link #b b},
- * whose value is the index of an UTF8 constant pool item.
- * @param buf
- * buffer to be used to read the item. This buffer must be
- * sufficiently large. It is not automatically resized.
- * @return the String corresponding to the specified UTF8 item.
- */
- public String readUTF8(int index, final char[] buf) {
- int item = readUnsignedShort(index);
- if (index == 0 || item == 0) {
- return null;
+ // Visit the runtime invisible instruction annotations, if any.
+ while (invisibleTypeAnnotationOffsets != null
+ && currentInvisibleTypeAnnotationIndex < invisibleTypeAnnotationOffsets.length
+ && currentInvisibleTypeAnnotationBytecodeOffset <= currentBytecodeOffset) {
+ if (currentInvisibleTypeAnnotationBytecodeOffset == currentBytecodeOffset) {
+ // Parse the target_type, target_info and target_path fields.
+ int currentAnnotationOffset =
+ readTypeAnnotationTarget(
+ context, invisibleTypeAnnotationOffsets[currentInvisibleTypeAnnotationIndex]);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentAnnotationOffset, charBuffer);
+ currentAnnotationOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ readElementValues(
+ methodVisitor.visitInsnAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ annotationDescriptor,
+ /* visible = */ false),
+ currentAnnotationOffset,
+ /* named = */ true,
+ charBuffer);
}
- String s = strings[item];
- if (s != null) {
- return s;
- }
- index = items[item];
- return strings[item] = readUTF(index + 2, readUnsignedShort(index), buf);
+ currentInvisibleTypeAnnotationBytecodeOffset =
+ getTypeAnnotationBytecodeOffset(
+ invisibleTypeAnnotationOffsets, ++currentInvisibleTypeAnnotationIndex);
+ }
+ }
+ if (labels[codeLength] != null) {
+ methodVisitor.visitLabel(labels[codeLength]);
}
- /**
- * Reads UTF8 string in {@link #b b}.
- *
- * @param index
- * start offset of the UTF8 string to be read.
- * @param utfLen
- * length of the UTF8 string to be read.
- * @param buf
- * buffer to be used to read the string. This buffer must be
- * sufficiently large. It is not automatically resized.
- * @return the String corresponding to the specified UTF8 string.
- */
- private String readUTF(int index, final int utfLen, final char[] buf) {
- int endIndex = index + utfLen;
- byte[] b = this.b;
- int strLen = 0;
- int c;
- int st = 0;
- char cc = 0;
- while (index < endIndex) {
- c = b[index++];
- switch (st) {
- case 0:
- c = c & 0xFF;
- if (c < 0x80) { // 0xxxxxxx
- buf[strLen++] = (char) c;
- } else if (c < 0xE0 && c > 0xBF) { // 110x xxxx 10xx xxxx
- cc = (char) (c & 0x1F);
- st = 1;
- } else { // 1110 xxxx 10xx xxxx 10xx xxxx
- cc = (char) (c & 0x0F);
- st = 2;
- }
- break;
-
- case 1: // byte 2 of 2-byte char or byte 3 of 3-byte char
- buf[strLen++] = (char) ((cc << 6) | (c & 0x3F));
- st = 0;
- break;
-
- case 2: // byte 2 of 3-byte char
- cc = (char) ((cc << 6) | (c & 0x3F));
- st = 1;
- break;
+ // Visit LocalVariableTable and LocalVariableTypeTable attributes.
+ if (localVariableTableOffset != 0 && (context.parsingOptions & SKIP_DEBUG) == 0) {
+ // The (start_pc, index, signature_index) fields of each entry of the LocalVariableTypeTable.
+ int[] typeTable = null;
+ if (localVariableTypeTableOffset != 0) {
+ typeTable = new int[readUnsignedShort(localVariableTypeTableOffset) * 3];
+ currentOffset = localVariableTypeTableOffset + 2;
+ int typeTableIndex = typeTable.length;
+ while (typeTableIndex > 0) {
+ // Store the offset of 'signature_index', and the value of 'index' and 'start_pc'.
+ typeTable[--typeTableIndex] = currentOffset + 6;
+ typeTable[--typeTableIndex] = readUnsignedShort(currentOffset + 8);
+ typeTable[--typeTableIndex] = readUnsignedShort(currentOffset);
+ currentOffset += 10;
+ }
+ }
+ int localVariableTableLength = readUnsignedShort(localVariableTableOffset);
+ currentOffset = localVariableTableOffset + 2;
+ while (localVariableTableLength-- > 0) {
+ int startPc = readUnsignedShort(currentOffset);
+ int length = readUnsignedShort(currentOffset + 2);
+ String name = readUTF8(currentOffset + 4, charBuffer);
+ String descriptor = readUTF8(currentOffset + 6, charBuffer);
+ int index = readUnsignedShort(currentOffset + 8);
+ currentOffset += 10;
+ String signature = null;
+ if (typeTable != null) {
+ for (int i = 0; i < typeTable.length; i += 3) {
+ if (typeTable[i] == startPc && typeTable[i + 1] == index) {
+ signature = readUTF8(typeTable[i + 2], charBuffer);
+ break;
}
+ }
}
- return new String(buf, 0, strLen);
+ methodVisitor.visitLocalVariable(
+ name, descriptor, signature, labels[startPc], labels[startPc + length], index);
+ }
}
- /**
- * Reads a class constant pool item in {@link #b b}. <i>This method is
- * intended for {@link Attribute} sub classes, and is normally not needed by
- * class generators or adapters.</i>
- *
- * @param index
- * the start index of an unsigned short value in {@link #b b},
- * whose value is the index of a class constant pool item.
- * @param buf
- * buffer to be used to read the item. This buffer must be
- * sufficiently large. It is not automatically resized.
- * @return the String corresponding to the specified class item.
- */
- public String readClass(final int index, final char[] buf) {
- // computes the start index of the CONSTANT_Class item in b
- // and reads the CONSTANT_Utf8 item designated by
- // the first two bytes of this CONSTANT_Class item
- return readUTF8(items[readUnsignedShort(index)], buf);
+ // Visit the local variable type annotations of the RuntimeVisibleTypeAnnotations attribute.
+ if (visibleTypeAnnotationOffsets != null) {
+ for (int typeAnnotationOffset : visibleTypeAnnotationOffsets) {
+ int targetType = readByte(typeAnnotationOffset);
+ if (targetType == TypeReference.LOCAL_VARIABLE
+ || targetType == TypeReference.RESOURCE_VARIABLE) {
+ // Parse the target_type, target_info and target_path fields.
+ currentOffset = readTypeAnnotationTarget(context, typeAnnotationOffset);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentOffset, charBuffer);
+ currentOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ readElementValues(
+ methodVisitor.visitLocalVariableAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ context.currentLocalVariableAnnotationRangeStarts,
+ context.currentLocalVariableAnnotationRangeEnds,
+ context.currentLocalVariableAnnotationRangeIndices,
+ annotationDescriptor,
+ /* visible = */ true),
+ currentOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
}
- /**
- * Reads a numeric or string constant pool item in {@link #b b}. <i>This
- * method is intended for {@link Attribute} sub classes, and is normally not
- * needed by class generators or adapters.</i>
- *
- * @param item
- * the index of a constant pool item.
- * @param buf
- * buffer to be used to read the item. This buffer must be
- * sufficiently large. It is not automatically resized.
- * @return the {@link Integer}, {@link Float}, {@link Long}, {@link Double},
- * {@link String}, {@link Type} or {@link Handle} corresponding to
- * the given constant pool item.
- */
- public Object readConst(final int item, final char[] buf) {
- int index = items[item];
- switch (b[index - 1]) {
- case ClassWriter.INT:
- return readInt(index);
- case ClassWriter.FLOAT:
- return Float.intBitsToFloat(readInt(index));
- case ClassWriter.LONG:
- return readLong(index);
- case ClassWriter.DOUBLE:
- return Double.longBitsToDouble(readLong(index));
- case ClassWriter.CLASS:
- return Type.getObjectType(readUTF8(index, buf));
- case ClassWriter.STR:
- return readUTF8(index, buf);
- case ClassWriter.MTYPE:
- return Type.getMethodType(readUTF8(index, buf));
- default: // case ClassWriter.HANDLE_BASE + [1..9]:
- int tag = readByte(index);
- int[] items = this.items;
- int cpIndex = items[readUnsignedShort(index + 1)];
- String owner = readClass(cpIndex, buf);
- cpIndex = items[readUnsignedShort(cpIndex + 2)];
- String name = readUTF8(cpIndex, buf);
- String desc = readUTF8(cpIndex + 2, buf);
- return new Handle(tag, owner, name, desc);
+ // Visit the local variable type annotations of the RuntimeInvisibleTypeAnnotations attribute.
+ if (invisibleTypeAnnotationOffsets != null) {
+ for (int typeAnnotationOffset : invisibleTypeAnnotationOffsets) {
+ int targetType = readByte(typeAnnotationOffset);
+ if (targetType == TypeReference.LOCAL_VARIABLE
+ || targetType == TypeReference.RESOURCE_VARIABLE) {
+ // Parse the target_type, target_info and target_path fields.
+ currentOffset = readTypeAnnotationTarget(context, typeAnnotationOffset);
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentOffset, charBuffer);
+ currentOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ readElementValues(
+ methodVisitor.visitLocalVariableAnnotation(
+ context.currentTypeAnnotationTarget,
+ context.currentTypeAnnotationTargetPath,
+ context.currentLocalVariableAnnotationRangeStarts,
+ context.currentLocalVariableAnnotationRangeEnds,
+ context.currentLocalVariableAnnotationRangeIndices,
+ annotationDescriptor,
+ /* visible = */ false),
+ currentOffset,
+ /* named = */ true,
+ charBuffer);
}
+ }
}
+
+ // Visit the non standard attributes.
+ while (attributes != null) {
+ // Copy and reset the nextAttribute field so that it can also be used in MethodWriter.
+ Attribute nextAttribute = attributes.nextAttribute;
+ attributes.nextAttribute = null;
+ methodVisitor.visitAttribute(attributes);
+ attributes = nextAttribute;
+ }
+
+ // Visit the max stack and max locals values.
+ methodVisitor.visitMaxs(maxStack, maxLocals);
+ }
+
+ /**
+ * Returns the label corresponding to the given bytecode offset. The default implementation of
+ * this method creates a label for the given offset if it has not been already created.
+ *
+ * @param bytecodeOffset a bytecode offset in a method.
+ * @param labels the already created labels, indexed by their offset. If a label already exists
+ * for bytecodeOffset this method must not create a new one. Otherwise it must store the new
+ * label in this array.
+ * @return a non null Label, which must be equal to labels[bytecodeOffset].
+ */
+ protected Label readLabel(final int bytecodeOffset, final Label[] labels) {
+ if (labels[bytecodeOffset] == null) {
+ labels[bytecodeOffset] = new Label();
+ }
+ return labels[bytecodeOffset];
+ }
+
+ /**
+ * Creates a label without the {@link Label#FLAG_DEBUG_ONLY} flag set, for the given bytecode
+ * offset. The label is created with a call to {@link #readLabel} and its {@link
+ * Label#FLAG_DEBUG_ONLY} flag is cleared.
+ *
+ * @param bytecodeOffset a bytecode offset in a method.
+ * @param labels the already created labels, indexed by their offset.
+ * @return a Label without the {@link Label#FLAG_DEBUG_ONLY} flag set.
+ */
+ private Label createLabel(final int bytecodeOffset, final Label[] labels) {
+ Label label = readLabel(bytecodeOffset, labels);
+ label.flags &= ~Label.FLAG_DEBUG_ONLY;
+ return label;
+ }
+
+ /**
+ * Creates a label with the {@link Label#FLAG_DEBUG_ONLY} flag set, if there is no already
+ * existing label for the given bytecode offset (otherwise does nothing). The label is created
+ * with a call to {@link #readLabel}.
+ *
+ * @param bytecodeOffset a bytecode offset in a method.
+ * @param labels the already created labels, indexed by their offset.
+ */
+ private void createDebugLabel(final int bytecodeOffset, final Label[] labels) {
+ if (labels[bytecodeOffset] == null) {
+ readLabel(bytecodeOffset, labels).flags |= Label.FLAG_DEBUG_ONLY;
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------
+ // Methods to parse annotations, type annotations and parameter annotations
+ // ----------------------------------------------------------------------------------------------
+
+ /**
+ * Parses a Runtime[In]VisibleTypeAnnotations attribute to find the offset of each type_annotation
+ * entry it contains, to find the corresponding labels, and to visit the try catch block
+ * annotations.
+ *
+ * @param methodVisitor the method visitor to be used to visit the try catch block annotations.
+ * @param context information about the class being parsed.
+ * @param runtimeTypeAnnotationsOffset the start offset of a Runtime[In]VisibleTypeAnnotations
+ * attribute, excluding the attribute_info's attribute_name_index and attribute_length fields.
+ * @param visible true if the attribute to parse is a RuntimeVisibleTypeAnnotations attribute,
+ * false it is a RuntimeInvisibleTypeAnnotations attribute.
+ * @return the start offset of each entry of the Runtime[In]VisibleTypeAnnotations_attribute's
+ * 'annotations' array field.
+ */
+ private int[] readTypeAnnotations(
+ final MethodVisitor methodVisitor,
+ final Context context,
+ final int runtimeTypeAnnotationsOffset,
+ final boolean visible) {
+ char[] charBuffer = context.charBuffer;
+ int currentOffset = runtimeTypeAnnotationsOffset;
+ // Read the num_annotations field and create an array to store the type_annotation offsets.
+ int[] typeAnnotationsOffsets = new int[readUnsignedShort(currentOffset)];
+ currentOffset += 2;
+ // Parse the 'annotations' array field.
+ for (int i = 0; i < typeAnnotationsOffsets.length; ++i) {
+ typeAnnotationsOffsets[i] = currentOffset;
+ // Parse the type_annotation's target_type and the target_info fields. The size of the
+ // target_info field depends on the value of target_type.
+ int targetType = readInt(currentOffset);
+ switch (targetType >>> 24) {
+ case TypeReference.LOCAL_VARIABLE:
+ case TypeReference.RESOURCE_VARIABLE:
+ // A localvar_target has a variable size, which depends on the value of their table_length
+ // field. It also references bytecode offsets, for which we need labels.
+ int tableLength = readUnsignedShort(currentOffset + 1);
+ currentOffset += 3;
+ while (tableLength-- > 0) {
+ int startPc = readUnsignedShort(currentOffset);
+ int length = readUnsignedShort(currentOffset + 2);
+ // Skip the index field (2 bytes).
+ currentOffset += 6;
+ createLabel(startPc, context.currentMethodLabels);
+ createLabel(startPc + length, context.currentMethodLabels);
+ }
+ break;
+ case TypeReference.CAST:
+ case TypeReference.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT:
+ case TypeReference.METHOD_INVOCATION_TYPE_ARGUMENT:
+ case TypeReference.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT:
+ case TypeReference.METHOD_REFERENCE_TYPE_ARGUMENT:
+ currentOffset += 4;
+ break;
+ case TypeReference.CLASS_EXTENDS:
+ case TypeReference.CLASS_TYPE_PARAMETER_BOUND:
+ case TypeReference.METHOD_TYPE_PARAMETER_BOUND:
+ case TypeReference.THROWS:
+ case TypeReference.EXCEPTION_PARAMETER:
+ case TypeReference.INSTANCEOF:
+ case TypeReference.NEW:
+ case TypeReference.CONSTRUCTOR_REFERENCE:
+ case TypeReference.METHOD_REFERENCE:
+ currentOffset += 3;
+ break;
+ case TypeReference.CLASS_TYPE_PARAMETER:
+ case TypeReference.METHOD_TYPE_PARAMETER:
+ case TypeReference.METHOD_FORMAL_PARAMETER:
+ case TypeReference.FIELD:
+ case TypeReference.METHOD_RETURN:
+ case TypeReference.METHOD_RECEIVER:
+ default:
+ // TypeReference type which can't be used in Code attribute, or which is unknown.
+ throw new IllegalArgumentException();
+ }
+ // Parse the rest of the type_annotation structure, starting with the target_path structure
+ // (whose size depends on its path_length field).
+ int pathLength = readByte(currentOffset);
+ if ((targetType >>> 24) == TypeReference.EXCEPTION_PARAMETER) {
+ // Parse the target_path structure and create a corresponding TypePath.
+ TypePath path = pathLength == 0 ? null : new TypePath(classFileBuffer, currentOffset);
+ currentOffset += 1 + 2 * pathLength;
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentOffset, charBuffer);
+ currentOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentOffset =
+ readElementValues(
+ methodVisitor.visitTryCatchAnnotation(
+ targetType & 0xFFFFFF00, path, annotationDescriptor, visible),
+ currentOffset,
+ /* named = */ true,
+ charBuffer);
+ } else {
+ // We don't want to visit the other target_type annotations, so we just skip them (which
+ // requires some parsing because the element_value_pairs array has a variable size). First,
+ // skip the target_path structure:
+ currentOffset += 3 + 2 * pathLength;
+ // Then skip the num_element_value_pairs and element_value_pairs fields (by reading them
+ // with a null AnnotationVisitor).
+ currentOffset =
+ readElementValues(
+ /* annotationVisitor = */ null, currentOffset, /* named = */ true, charBuffer);
+ }
+ }
+ return typeAnnotationsOffsets;
+ }
+
+ /**
+ * Returns the bytecode offset corresponding to the specified JVMS 'type_annotation' structure, or
+ * -1 if there is no such type_annotation of if it does not have a bytecode offset.
+ *
+ * @param typeAnnotationOffsets the offset of each 'type_annotation' entry in a
+ * Runtime[In]VisibleTypeAnnotations attribute, or null.
+ * @param typeAnnotationIndex the index a 'type_annotation' entry in typeAnnotationOffsets.
+ * @return bytecode offset corresponding to the specified JVMS 'type_annotation' structure, or -1
+ * if there is no such type_annotation of if it does not have a bytecode offset.
+ */
+ private int getTypeAnnotationBytecodeOffset(
+ final int[] typeAnnotationOffsets, final int typeAnnotationIndex) {
+ if (typeAnnotationOffsets == null
+ || typeAnnotationIndex >= typeAnnotationOffsets.length
+ || readByte(typeAnnotationOffsets[typeAnnotationIndex]) < TypeReference.INSTANCEOF) {
+ return -1;
+ }
+ return readUnsignedShort(typeAnnotationOffsets[typeAnnotationIndex] + 1);
+ }
+
+ /**
+ * Parses the header of a JVMS type_annotation structure to extract its target_type, target_info
+ * and target_path (the result is stored in the given context), and returns the start offset of
+ * the rest of the type_annotation structure.
+ *
+ * @param context information about the class being parsed. This is where the extracted
+ * target_type and target_path must be stored.
+ * @param typeAnnotationOffset the start offset of a type_annotation structure.
+ * @return the start offset of the rest of the type_annotation structure.
+ */
+ private int readTypeAnnotationTarget(final Context context, final int typeAnnotationOffset) {
+ int currentOffset = typeAnnotationOffset;
+ // Parse and store the target_type structure.
+ int targetType = readInt(typeAnnotationOffset);
+ switch (targetType >>> 24) {
+ case TypeReference.CLASS_TYPE_PARAMETER:
+ case TypeReference.METHOD_TYPE_PARAMETER:
+ case TypeReference.METHOD_FORMAL_PARAMETER:
+ targetType &= 0xFFFF0000;
+ currentOffset += 2;
+ break;
+ case TypeReference.FIELD:
+ case TypeReference.METHOD_RETURN:
+ case TypeReference.METHOD_RECEIVER:
+ targetType &= 0xFF000000;
+ currentOffset += 1;
+ break;
+ case TypeReference.LOCAL_VARIABLE:
+ case TypeReference.RESOURCE_VARIABLE:
+ targetType &= 0xFF000000;
+ int tableLength = readUnsignedShort(currentOffset + 1);
+ currentOffset += 3;
+ context.currentLocalVariableAnnotationRangeStarts = new Label[tableLength];
+ context.currentLocalVariableAnnotationRangeEnds = new Label[tableLength];
+ context.currentLocalVariableAnnotationRangeIndices = new int[tableLength];
+ for (int i = 0; i < tableLength; ++i) {
+ int startPc = readUnsignedShort(currentOffset);
+ int length = readUnsignedShort(currentOffset + 2);
+ int index = readUnsignedShort(currentOffset + 4);
+ currentOffset += 6;
+ context.currentLocalVariableAnnotationRangeStarts[i] =
+ createLabel(startPc, context.currentMethodLabels);
+ context.currentLocalVariableAnnotationRangeEnds[i] =
+ createLabel(startPc + length, context.currentMethodLabels);
+ context.currentLocalVariableAnnotationRangeIndices[i] = index;
+ }
+ break;
+ case TypeReference.CAST:
+ case TypeReference.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT:
+ case TypeReference.METHOD_INVOCATION_TYPE_ARGUMENT:
+ case TypeReference.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT:
+ case TypeReference.METHOD_REFERENCE_TYPE_ARGUMENT:
+ targetType &= 0xFF0000FF;
+ currentOffset += 4;
+ break;
+ case TypeReference.CLASS_EXTENDS:
+ case TypeReference.CLASS_TYPE_PARAMETER_BOUND:
+ case TypeReference.METHOD_TYPE_PARAMETER_BOUND:
+ case TypeReference.THROWS:
+ case TypeReference.EXCEPTION_PARAMETER:
+ targetType &= 0xFFFFFF00;
+ currentOffset += 3;
+ break;
+ case TypeReference.INSTANCEOF:
+ case TypeReference.NEW:
+ case TypeReference.CONSTRUCTOR_REFERENCE:
+ case TypeReference.METHOD_REFERENCE:
+ targetType &= 0xFF000000;
+ currentOffset += 3;
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ context.currentTypeAnnotationTarget = targetType;
+ // Parse and store the target_path structure.
+ int pathLength = readByte(currentOffset);
+ context.currentTypeAnnotationTargetPath =
+ pathLength == 0 ? null : new TypePath(classFileBuffer, currentOffset);
+ // Return the start offset of the rest of the type_annotation structure.
+ return currentOffset + 1 + 2 * pathLength;
+ }
+
+ /**
+ * Reads a Runtime[In]VisibleParameterAnnotations attribute and makes the given visitor visit it.
+ *
+ * @param methodVisitor the visitor that must visit the parameter annotations.
+ * @param context information about the class being parsed.
+ * @param runtimeParameterAnnotationsOffset the start offset of a
+ * Runtime[In]VisibleParameterAnnotations attribute, excluding the attribute_info's
+ * attribute_name_index and attribute_length fields.
+ * @param visible true if the attribute to parse is a RuntimeVisibleParameterAnnotations
+ * attribute, false it is a RuntimeInvisibleParameterAnnotations attribute.
+ */
+ private void readParameterAnnotations(
+ final MethodVisitor methodVisitor,
+ final Context context,
+ final int runtimeParameterAnnotationsOffset,
+ final boolean visible) {
+ int currentOffset = runtimeParameterAnnotationsOffset;
+ int numParameters = classFileBuffer[currentOffset++] & 0xFF;
+ methodVisitor.visitAnnotableParameterCount(numParameters, visible);
+ char[] charBuffer = context.charBuffer;
+ for (int i = 0; i < numParameters; ++i) {
+ int numAnnotations = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (numAnnotations-- > 0) {
+ // Parse the type_index field.
+ String annotationDescriptor = readUTF8(currentOffset, charBuffer);
+ currentOffset += 2;
+ // Parse num_element_value_pairs and element_value_pairs and visit these values.
+ currentOffset =
+ readElementValues(
+ methodVisitor.visitParameterAnnotation(i, annotationDescriptor, visible),
+ currentOffset,
+ /* named = */ true,
+ charBuffer);
+ }
+ }
+ }
+
+ /**
+ * Reads the element values of a JVMS 'annotation' structure and makes the given visitor visit
+ * them. This method can also be used to read the values of the JVMS 'array_value' field of an
+ * annotation's 'element_value'.
+ *
+ * @param annotationVisitor the visitor that must visit the values.
+ * @param annotationOffset the start offset of an 'annotation' structure (excluding its type_index
+ * field) or of an 'array_value' structure.
+ * @param named if the annotation values are named or not. This should be true to parse the values
+ * of a JVMS 'annotation' structure, and false to parse the JVMS 'array_value' of an
+ * annotation's element_value.
+ * @param charBuffer the buffer used to read strings in the constant pool.
+ * @return the end offset of the JVMS 'annotation' or 'array_value' structure.
+ */
+ private int readElementValues(
+ final AnnotationVisitor annotationVisitor,
+ final int annotationOffset,
+ final boolean named,
+ final char[] charBuffer) {
+ int currentOffset = annotationOffset;
+ // Read the num_element_value_pairs field (or num_values field for an array_value).
+ int numElementValuePairs = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ if (named) {
+ // Parse the element_value_pairs array.
+ while (numElementValuePairs-- > 0) {
+ String elementName = readUTF8(currentOffset, charBuffer);
+ currentOffset =
+ readElementValue(annotationVisitor, currentOffset + 2, elementName, charBuffer);
+ }
+ } else {
+ // Parse the array_value array.
+ while (numElementValuePairs-- > 0) {
+ currentOffset =
+ readElementValue(annotationVisitor, currentOffset, /* named = */ null, charBuffer);
+ }
+ }
+ if (annotationVisitor != null) {
+ annotationVisitor.visitEnd();
+ }
+ return currentOffset;
+ }
+
+ /**
+ * Reads a JVMS 'element_value' structure and makes the given visitor visit it.
+ *
+ * @param annotationVisitor the visitor that must visit the element_value structure.
+ * @param elementValueOffset the start offset in {@link #classFileBuffer} of the element_value
+ * structure to be read.
+ * @param elementName the name of the element_value structure to be read, or {@literal null}.
+ * @param charBuffer the buffer used to read strings in the constant pool.
+ * @return the end offset of the JVMS 'element_value' structure.
+ */
+ private int readElementValue(
+ final AnnotationVisitor annotationVisitor,
+ final int elementValueOffset,
+ final String elementName,
+ final char[] charBuffer) {
+ int currentOffset = elementValueOffset;
+ if (annotationVisitor == null) {
+ switch (classFileBuffer[currentOffset] & 0xFF) {
+ case 'e': // enum_const_value
+ return currentOffset + 5;
+ case '@': // annotation_value
+ return readElementValues(null, currentOffset + 3, /* named = */ true, charBuffer);
+ case '[': // array_value
+ return readElementValues(null, currentOffset + 1, /* named = */ false, charBuffer);
+ default:
+ return currentOffset + 3;
+ }
+ }
+ switch (classFileBuffer[currentOffset++] & 0xFF) {
+ case 'B': // const_value_index, CONSTANT_Integer
+ annotationVisitor.visit(
+ elementName, (byte) readInt(cpInfoOffsets[readUnsignedShort(currentOffset)]));
+ currentOffset += 2;
+ break;
+ case 'C': // const_value_index, CONSTANT_Integer
+ annotationVisitor.visit(
+ elementName, (char) readInt(cpInfoOffsets[readUnsignedShort(currentOffset)]));
+ currentOffset += 2;
+ break;
+ case 'D': // const_value_index, CONSTANT_Double
+ case 'F': // const_value_index, CONSTANT_Float
+ case 'I': // const_value_index, CONSTANT_Integer
+ case 'J': // const_value_index, CONSTANT_Long
+ annotationVisitor.visit(
+ elementName, readConst(readUnsignedShort(currentOffset), charBuffer));
+ currentOffset += 2;
+ break;
+ case 'S': // const_value_index, CONSTANT_Integer
+ annotationVisitor.visit(
+ elementName, (short) readInt(cpInfoOffsets[readUnsignedShort(currentOffset)]));
+ currentOffset += 2;
+ break;
+
+ case 'Z': // const_value_index, CONSTANT_Integer
+ annotationVisitor.visit(
+ elementName,
+ readInt(cpInfoOffsets[readUnsignedShort(currentOffset)]) == 0
+ ? Boolean.FALSE
+ : Boolean.TRUE);
+ currentOffset += 2;
+ break;
+ case 's': // const_value_index, CONSTANT_Utf8
+ annotationVisitor.visit(elementName, readUTF8(currentOffset, charBuffer));
+ currentOffset += 2;
+ break;
+ case 'e': // enum_const_value
+ annotationVisitor.visitEnum(
+ elementName,
+ readUTF8(currentOffset, charBuffer),
+ readUTF8(currentOffset + 2, charBuffer));
+ currentOffset += 4;
+ break;
+ case 'c': // class_info
+ annotationVisitor.visit(elementName, Type.getType(readUTF8(currentOffset, charBuffer)));
+ currentOffset += 2;
+ break;
+ case '@': // annotation_value
+ currentOffset =
+ readElementValues(
+ annotationVisitor.visitAnnotation(elementName, readUTF8(currentOffset, charBuffer)),
+ currentOffset + 2,
+ true,
+ charBuffer);
+ break;
+ case '[': // array_value
+ int numValues = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ if (numValues == 0) {
+ return readElementValues(
+ annotationVisitor.visitArray(elementName),
+ currentOffset - 2,
+ /* named = */ false,
+ charBuffer);
+ }
+ switch (classFileBuffer[currentOffset] & 0xFF) {
+ case 'B':
+ byte[] byteValues = new byte[numValues];
+ for (int i = 0; i < numValues; i++) {
+ byteValues[i] = (byte) readInt(cpInfoOffsets[readUnsignedShort(currentOffset + 1)]);
+ currentOffset += 3;
+ }
+ annotationVisitor.visit(elementName, byteValues);
+ break;
+ case 'Z':
+ boolean[] booleanValues = new boolean[numValues];
+ for (int i = 0; i < numValues; i++) {
+ booleanValues[i] = readInt(cpInfoOffsets[readUnsignedShort(currentOffset + 1)]) != 0;
+ currentOffset += 3;
+ }
+ annotationVisitor.visit(elementName, booleanValues);
+ break;
+ case 'S':
+ short[] shortValues = new short[numValues];
+ for (int i = 0; i < numValues; i++) {
+ shortValues[i] = (short) readInt(cpInfoOffsets[readUnsignedShort(currentOffset + 1)]);
+ currentOffset += 3;
+ }
+ annotationVisitor.visit(elementName, shortValues);
+ break;
+ case 'C':
+ char[] charValues = new char[numValues];
+ for (int i = 0; i < numValues; i++) {
+ charValues[i] = (char) readInt(cpInfoOffsets[readUnsignedShort(currentOffset + 1)]);
+ currentOffset += 3;
+ }
+ annotationVisitor.visit(elementName, charValues);
+ break;
+ case 'I':
+ int[] intValues = new int[numValues];
+ for (int i = 0; i < numValues; i++) {
+ intValues[i] = readInt(cpInfoOffsets[readUnsignedShort(currentOffset + 1)]);
+ currentOffset += 3;
+ }
+ annotationVisitor.visit(elementName, intValues);
+ break;
+ case 'J':
+ long[] longValues = new long[numValues];
+ for (int i = 0; i < numValues; i++) {
+ longValues[i] = readLong(cpInfoOffsets[readUnsignedShort(currentOffset + 1)]);
+ currentOffset += 3;
+ }
+ annotationVisitor.visit(elementName, longValues);
+ break;
+ case 'F':
+ float[] floatValues = new float[numValues];
+ for (int i = 0; i < numValues; i++) {
+ floatValues[i] =
+ Float.intBitsToFloat(
+ readInt(cpInfoOffsets[readUnsignedShort(currentOffset + 1)]));
+ currentOffset += 3;
+ }
+ annotationVisitor.visit(elementName, floatValues);
+ break;
+ case 'D':
+ double[] doubleValues = new double[numValues];
+ for (int i = 0; i < numValues; i++) {
+ doubleValues[i] =
+ Double.longBitsToDouble(
+ readLong(cpInfoOffsets[readUnsignedShort(currentOffset + 1)]));
+ currentOffset += 3;
+ }
+ annotationVisitor.visit(elementName, doubleValues);
+ break;
+ default:
+ currentOffset =
+ readElementValues(
+ annotationVisitor.visitArray(elementName),
+ currentOffset - 2,
+ /* named = */ false,
+ charBuffer);
+ break;
+ }
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ return currentOffset;
+ }
+
+ // ----------------------------------------------------------------------------------------------
+ // Methods to parse stack map frames
+ // ----------------------------------------------------------------------------------------------
+
+ /**
+ * Computes the implicit frame of the method currently being parsed (as defined in the given
+ * {@link Context}) and stores it in the given context.
+ *
+ * @param context information about the class being parsed.
+ */
+ private void computeImplicitFrame(final Context context) {
+ String methodDescriptor = context.currentMethodDescriptor;
+ Object[] locals = context.currentFrameLocalTypes;
+ int numLocal = 0;
+ if ((context.currentMethodAccessFlags & Opcodes.ACC_STATIC) == 0) {
+ if ("<init>".equals(context.currentMethodName)) {
+ locals[numLocal++] = Opcodes.UNINITIALIZED_THIS;
+ } else {
+ locals[numLocal++] = readClass(header + 2, context.charBuffer);
+ }
+ }
+ // Parse the method descriptor, one argument type descriptor at each iteration. Start by
+ // skipping the first method descriptor character, which is always '('.
+ int currentMethodDescritorOffset = 1;
+ while (true) {
+ int currentArgumentDescriptorStartOffset = currentMethodDescritorOffset;
+ switch (methodDescriptor.charAt(currentMethodDescritorOffset++)) {
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ locals[numLocal++] = Opcodes.INTEGER;
+ break;
+ case 'F':
+ locals[numLocal++] = Opcodes.FLOAT;
+ break;
+ case 'J':
+ locals[numLocal++] = Opcodes.LONG;
+ break;
+ case 'D':
+ locals[numLocal++] = Opcodes.DOUBLE;
+ break;
+ case '[':
+ while (methodDescriptor.charAt(currentMethodDescritorOffset) == '[') {
+ ++currentMethodDescritorOffset;
+ }
+ if (methodDescriptor.charAt(currentMethodDescritorOffset) == 'L') {
+ ++currentMethodDescritorOffset;
+ while (methodDescriptor.charAt(currentMethodDescritorOffset) != ';') {
+ ++currentMethodDescritorOffset;
+ }
+ }
+ locals[numLocal++] =
+ methodDescriptor.substring(
+ currentArgumentDescriptorStartOffset, ++currentMethodDescritorOffset);
+ break;
+ case 'L':
+ while (methodDescriptor.charAt(currentMethodDescritorOffset) != ';') {
+ ++currentMethodDescritorOffset;
+ }
+ locals[numLocal++] =
+ methodDescriptor.substring(
+ currentArgumentDescriptorStartOffset + 1, currentMethodDescritorOffset++);
+ break;
+ default:
+ context.currentFrameLocalCount = numLocal;
+ return;
+ }
+ }
+ }
+
+ /**
+ * Reads a JVMS 'stack_map_frame' structure and stores the result in the given {@link Context}
+ * object. This method can also be used to read a full_frame structure, excluding its frame_type
+ * field (this is used to parse the legacy StackMap attributes).
+ *
+ * @param stackMapFrameOffset the start offset in {@link #classFileBuffer} of the
+ * stack_map_frame_value structure to be read, or the start offset of a full_frame structure
+ * (excluding its frame_type field).
+ * @param compressed true to read a 'stack_map_frame' structure, false to read a 'full_frame'
+ * structure without its frame_type field.
+ * @param expand if the stack map frame must be expanded. See {@link #EXPAND_FRAMES}.
+ * @param context where the parsed stack map frame must be stored.
+ * @return the end offset of the JVMS 'stack_map_frame' or 'full_frame' structure.
+ */
+ private int readStackMapFrame(
+ final int stackMapFrameOffset,
+ final boolean compressed,
+ final boolean expand,
+ final Context context) {
+ int currentOffset = stackMapFrameOffset;
+ final char[] charBuffer = context.charBuffer;
+ final Label[] labels = context.currentMethodLabels;
+ int frameType;
+ if (compressed) {
+ // Read the frame_type field.
+ frameType = classFileBuffer[currentOffset++] & 0xFF;
+ } else {
+ frameType = Frame.FULL_FRAME;
+ context.currentFrameOffset = -1;
+ }
+ int offsetDelta;
+ context.currentFrameLocalCountDelta = 0;
+ if (frameType < Frame.SAME_LOCALS_1_STACK_ITEM_FRAME) {
+ offsetDelta = frameType;
+ context.currentFrameType = Opcodes.F_SAME;
+ context.currentFrameStackCount = 0;
+ } else if (frameType < Frame.RESERVED) {
+ offsetDelta = frameType - Frame.SAME_LOCALS_1_STACK_ITEM_FRAME;
+ currentOffset =
+ readVerificationTypeInfo(
+ currentOffset, context.currentFrameStackTypes, 0, charBuffer, labels);
+ context.currentFrameType = Opcodes.F_SAME1;
+ context.currentFrameStackCount = 1;
+ } else if (frameType >= Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
+ offsetDelta = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ if (frameType == Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
+ currentOffset =
+ readVerificationTypeInfo(
+ currentOffset, context.currentFrameStackTypes, 0, charBuffer, labels);
+ context.currentFrameType = Opcodes.F_SAME1;
+ context.currentFrameStackCount = 1;
+ } else if (frameType >= Frame.CHOP_FRAME && frameType < Frame.SAME_FRAME_EXTENDED) {
+ context.currentFrameType = Opcodes.F_CHOP;
+ context.currentFrameLocalCountDelta = Frame.SAME_FRAME_EXTENDED - frameType;
+ context.currentFrameLocalCount -= context.currentFrameLocalCountDelta;
+ context.currentFrameStackCount = 0;
+ } else if (frameType == Frame.SAME_FRAME_EXTENDED) {
+ context.currentFrameType = Opcodes.F_SAME;
+ context.currentFrameStackCount = 0;
+ } else if (frameType < Frame.FULL_FRAME) {
+ int local = expand ? context.currentFrameLocalCount : 0;
+ for (int k = frameType - Frame.SAME_FRAME_EXTENDED; k > 0; k--) {
+ currentOffset =
+ readVerificationTypeInfo(
+ currentOffset, context.currentFrameLocalTypes, local++, charBuffer, labels);
+ }
+ context.currentFrameType = Opcodes.F_APPEND;
+ context.currentFrameLocalCountDelta = frameType - Frame.SAME_FRAME_EXTENDED;
+ context.currentFrameLocalCount += context.currentFrameLocalCountDelta;
+ context.currentFrameStackCount = 0;
+ } else {
+ final int numberOfLocals = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ context.currentFrameType = Opcodes.F_FULL;
+ context.currentFrameLocalCountDelta = numberOfLocals;
+ context.currentFrameLocalCount = numberOfLocals;
+ for (int local = 0; local < numberOfLocals; ++local) {
+ currentOffset =
+ readVerificationTypeInfo(
+ currentOffset, context.currentFrameLocalTypes, local, charBuffer, labels);
+ }
+ final int numberOfStackItems = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ context.currentFrameStackCount = numberOfStackItems;
+ for (int stack = 0; stack < numberOfStackItems; ++stack) {
+ currentOffset =
+ readVerificationTypeInfo(
+ currentOffset, context.currentFrameStackTypes, stack, charBuffer, labels);
+ }
+ }
+ } else {
+ throw new IllegalArgumentException();
+ }
+ context.currentFrameOffset += offsetDelta + 1;
+ createLabel(context.currentFrameOffset, labels);
+ return currentOffset;
+ }
+
+ /**
+ * Reads a JVMS 'verification_type_info' structure and stores it at the given index in the given
+ * array.
+ *
+ * @param verificationTypeInfoOffset the start offset of the 'verification_type_info' structure to
+ * read.
+ * @param frame the array where the parsed type must be stored.
+ * @param index the index in 'frame' where the parsed type must be stored.
+ * @param charBuffer the buffer used to read strings in the constant pool.
+ * @param labels the labels of the method currently being parsed, indexed by their offset. If the
+ * parsed type is an ITEM_Uninitialized, a new label for the corresponding NEW instruction is
+ * stored in this array if it does not already exist.
+ * @return the end offset of the JVMS 'verification_type_info' structure.
+ */
+ private int readVerificationTypeInfo(
+ final int verificationTypeInfoOffset,
+ final Object[] frame,
+ final int index,
+ final char[] charBuffer,
+ final Label[] labels) {
+ int currentOffset = verificationTypeInfoOffset;
+ int tag = classFileBuffer[currentOffset++] & 0xFF;
+ switch (tag) {
+ case Frame.ITEM_TOP:
+ frame[index] = Opcodes.TOP;
+ break;
+ case Frame.ITEM_INTEGER:
+ frame[index] = Opcodes.INTEGER;
+ break;
+ case Frame.ITEM_FLOAT:
+ frame[index] = Opcodes.FLOAT;
+ break;
+ case Frame.ITEM_DOUBLE:
+ frame[index] = Opcodes.DOUBLE;
+ break;
+ case Frame.ITEM_LONG:
+ frame[index] = Opcodes.LONG;
+ break;
+ case Frame.ITEM_NULL:
+ frame[index] = Opcodes.NULL;
+ break;
+ case Frame.ITEM_UNINITIALIZED_THIS:
+ frame[index] = Opcodes.UNINITIALIZED_THIS;
+ break;
+ case Frame.ITEM_OBJECT:
+ frame[index] = readClass(currentOffset, charBuffer);
+ currentOffset += 2;
+ break;
+ case Frame.ITEM_UNINITIALIZED:
+ frame[index] = createLabel(readUnsignedShort(currentOffset), labels);
+ currentOffset += 2;
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ return currentOffset;
+ }
+
+ // ----------------------------------------------------------------------------------------------
+ // Methods to parse attributes
+ // ----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the offset in {@link #classFileBuffer} of the first ClassFile's 'attributes' array
+ * field entry.
+ *
+ * @return the offset in {@link #classFileBuffer} of the first ClassFile's 'attributes' array
+ * field entry.
+ */
+ final int getFirstAttributeOffset() {
+ // Skip the access_flags, this_class, super_class, and interfaces_count fields (using 2 bytes
+ // each), as well as the interfaces array field (2 bytes per interface).
+ int currentOffset = header + 8 + readUnsignedShort(header + 6) * 2;
+
+ // Read the fields_count field.
+ int fieldsCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ // Skip the 'fields' array field.
+ while (fieldsCount-- > 0) {
+ // Invariant: currentOffset is the offset of a field_info structure.
+ // Skip the access_flags, name_index and descriptor_index fields (2 bytes each), and read the
+ // attributes_count field.
+ int attributesCount = readUnsignedShort(currentOffset + 6);
+ currentOffset += 8;
+ // Skip the 'attributes' array field.
+ while (attributesCount-- > 0) {
+ // Invariant: currentOffset is the offset of an attribute_info structure.
+ // Read the attribute_length field (2 bytes after the start of the attribute_info) and skip
+ // this many bytes, plus 6 for the attribute_name_index and attribute_length fields
+ // (yielding the total size of the attribute_info structure).
+ currentOffset += 6 + readInt(currentOffset + 2);
+ }
+ }
+
+ // Skip the methods_count and 'methods' fields, using the same method as above.
+ int methodsCount = readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ while (methodsCount-- > 0) {
+ int attributesCount = readUnsignedShort(currentOffset + 6);
+ currentOffset += 8;
+ while (attributesCount-- > 0) {
+ currentOffset += 6 + readInt(currentOffset + 2);
+ }
+ }
+
+ // Skip the ClassFile's attributes_count field.
+ return currentOffset + 2;
+ }
+
+ /**
+ * Reads the BootstrapMethods attribute to compute the offset of each bootstrap method.
+ *
+ * @param maxStringLength a conservative estimate of the maximum length of the strings contained
+ * in the constant pool of the class.
+ * @return the offsets of the bootstrap methods.
+ */
+ private int[] readBootstrapMethodsAttribute(final int maxStringLength) {
+ char[] charBuffer = new char[maxStringLength];
+ int currentAttributeOffset = getFirstAttributeOffset();
+ int[] currentBootstrapMethodOffsets = null;
+ for (int i = readUnsignedShort(currentAttributeOffset - 2); i > 0; --i) {
+ // Read the attribute_info's attribute_name and attribute_length fields.
+ String attributeName = readUTF8(currentAttributeOffset, charBuffer);
+ int attributeLength = readInt(currentAttributeOffset + 2);
+ currentAttributeOffset += 6;
+ if (Constants.BOOTSTRAP_METHODS.equals(attributeName)) {
+ // Read the num_bootstrap_methods field and create an array of this size.
+ currentBootstrapMethodOffsets = new int[readUnsignedShort(currentAttributeOffset)];
+ // Compute and store the offset of each 'bootstrap_methods' array field entry.
+ int currentBootstrapMethodOffset = currentAttributeOffset + 2;
+ for (int j = 0; j < currentBootstrapMethodOffsets.length; ++j) {
+ currentBootstrapMethodOffsets[j] = currentBootstrapMethodOffset;
+ // Skip the bootstrap_method_ref and num_bootstrap_arguments fields (2 bytes each),
+ // as well as the bootstrap_arguments array field (of size num_bootstrap_arguments * 2).
+ currentBootstrapMethodOffset +=
+ 4 + readUnsignedShort(currentBootstrapMethodOffset + 2) * 2;
+ }
+ return currentBootstrapMethodOffsets;
+ }
+ currentAttributeOffset += attributeLength;
+ }
+ throw new IllegalArgumentException();
+ }
+
+ /**
+ * Reads a non standard JVMS 'attribute' structure in {@link #classFileBuffer}.
+ *
+ * @param attributePrototypes prototypes of the attributes that must be parsed during the visit of
+ * the class. Any attribute whose type is not equal to the type of one the prototypes will not
+ * be parsed: its byte array value will be passed unchanged to the ClassWriter.
+ * @param type the type of the attribute.
+ * @param offset the start offset of the JVMS 'attribute' structure in {@link #classFileBuffer}.
+ * The 6 attribute header bytes (attribute_name_index and attribute_length) are not taken into
+ * account here.
+ * @param length the length of the attribute's content (excluding the 6 attribute header bytes).
+ * @param charBuffer the buffer to be used to read strings in the constant pool.
+ * @param codeAttributeOffset the start offset of the enclosing Code attribute in {@link
+ * #classFileBuffer}, or -1 if the attribute to be read is not a code attribute. The 6
+ * attribute header bytes (attribute_name_index and attribute_length) are not taken into
+ * account here.
+ * @param labels the labels of the method's code, or {@literal null} if the attribute to be read
+ * is not a code attribute.
+ * @return the attribute that has been read.
+ */
+ private Attribute readAttribute(
+ final Attribute[] attributePrototypes,
+ final String type,
+ final int offset,
+ final int length,
+ final char[] charBuffer,
+ final int codeAttributeOffset,
+ final Label[] labels) {
+ for (Attribute attributePrototype : attributePrototypes) {
+ if (attributePrototype.type.equals(type)) {
+ return attributePrototype.read(
+ this, offset, length, charBuffer, codeAttributeOffset, labels);
+ }
+ }
+ return new Attribute(type).read(this, offset, length, null, -1, null);
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Utility methods: low level parsing
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the number of entries in the class's constant pool table.
+ *
+ * @return the number of entries in the class's constant pool table.
+ */
+ public int getItemCount() {
+ return cpInfoOffsets.length;
+ }
+
+ /**
+ * Returns the start offset in this {@link ClassReader} of a JVMS 'cp_info' structure (i.e. a
+ * constant pool entry), plus one. <i>This method is intended for {@link Attribute} sub classes,
+ * and is normally not needed by class generators or adapters.</i>
+ *
+ * @param constantPoolEntryIndex the index a constant pool entry in the class's constant pool
+ * table.
+ * @return the start offset in this {@link ClassReader} of the corresponding JVMS 'cp_info'
+ * structure, plus one.
+ */
+ public int getItem(final int constantPoolEntryIndex) {
+ return cpInfoOffsets[constantPoolEntryIndex];
+ }
+
+ /**
+ * Returns a conservative estimate of the maximum length of the strings contained in the class's
+ * constant pool table.
+ *
+ * @return a conservative estimate of the maximum length of the strings contained in the class's
+ * constant pool table.
+ */
+ public int getMaxStringLength() {
+ return maxStringLength;
+ }
+
+ /**
+ * Reads a byte value in this {@link ClassReader}. <i>This method is intended for {@link
+ * Attribute} sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param offset the start offset of the value to be read in this {@link ClassReader}.
+ * @return the read value.
+ */
+ public int readByte(final int offset) {
+ return classFileBuffer[offset] & 0xFF;
+ }
+
+ /**
+ * Reads an unsigned short value in this {@link ClassReader}. <i>This method is intended for
+ * {@link Attribute} sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param offset the start index of the value to be read in this {@link ClassReader}.
+ * @return the read value.
+ */
+ public int readUnsignedShort(final int offset) {
+ byte[] classBuffer = classFileBuffer;
+ return ((classBuffer[offset] & 0xFF) << 8) | (classBuffer[offset + 1] & 0xFF);
+ }
+
+ /**
+ * Reads a signed short value in this {@link ClassReader}. <i>This method is intended for {@link
+ * Attribute} sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param offset the start offset of the value to be read in this {@link ClassReader}.
+ * @return the read value.
+ */
+ public short readShort(final int offset) {
+ byte[] classBuffer = classFileBuffer;
+ return (short) (((classBuffer[offset] & 0xFF) << 8) | (classBuffer[offset + 1] & 0xFF));
+ }
+
+ /**
+ * Reads a signed int value in this {@link ClassReader}. <i>This method is intended for {@link
+ * Attribute} sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param offset the start offset of the value to be read in this {@link ClassReader}.
+ * @return the read value.
+ */
+ public int readInt(final int offset) {
+ byte[] classBuffer = classFileBuffer;
+ return ((classBuffer[offset] & 0xFF) << 24)
+ | ((classBuffer[offset + 1] & 0xFF) << 16)
+ | ((classBuffer[offset + 2] & 0xFF) << 8)
+ | (classBuffer[offset + 3] & 0xFF);
+ }
+
+ /**
+ * Reads a signed long value in this {@link ClassReader}. <i>This method is intended for {@link
+ * Attribute} sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param offset the start offset of the value to be read in this {@link ClassReader}.
+ * @return the read value.
+ */
+ public long readLong(final int offset) {
+ long l1 = readInt(offset);
+ long l0 = readInt(offset + 4) & 0xFFFFFFFFL;
+ return (l1 << 32) | l0;
+ }
+
+ /**
+ * Reads a CONSTANT_Utf8 constant pool entry in this {@link ClassReader}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by class generators or
+ * adapters.</i>
+ *
+ * @param offset the start offset of an unsigned short value in this {@link ClassReader}, whose
+ * value is the index of a CONSTANT_Utf8 entry in the class's constant pool table.
+ * @param charBuffer the buffer to be used to read the string. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the String corresponding to the specified CONSTANT_Utf8 entry.
+ */
+ // DontCheck(AbbreviationAsWordInName): can't be renamed (for backward binary compatibility).
+ public String readUTF8(final int offset, final char[] charBuffer) {
+ int constantPoolEntryIndex = readUnsignedShort(offset);
+ if (offset == 0 || constantPoolEntryIndex == 0) {
+ return null;
+ }
+ return readUtf(constantPoolEntryIndex, charBuffer);
+ }
+
+ /**
+ * Reads a CONSTANT_Utf8 constant pool entry in {@link #classFileBuffer}.
+ *
+ * @param constantPoolEntryIndex the index of a CONSTANT_Utf8 entry in the class's constant pool
+ * table.
+ * @param charBuffer the buffer to be used to read the string. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the String corresponding to the specified CONSTANT_Utf8 entry.
+ */
+ final String readUtf(final int constantPoolEntryIndex, final char[] charBuffer) {
+ String value = constantUtf8Values[constantPoolEntryIndex];
+ if (value != null) {
+ return value;
+ }
+ int cpInfoOffset = cpInfoOffsets[constantPoolEntryIndex];
+ return constantUtf8Values[constantPoolEntryIndex] =
+ readUtf(cpInfoOffset + 2, readUnsignedShort(cpInfoOffset), charBuffer);
+ }
+
+ /**
+ * Reads an UTF8 string in {@link #classFileBuffer}.
+ *
+ * @param utfOffset the start offset of the UTF8 string to be read.
+ * @param utfLength the length of the UTF8 string to be read.
+ * @param charBuffer the buffer to be used to read the string. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the String corresponding to the specified UTF8 string.
+ */
+ private String readUtf(final int utfOffset, final int utfLength, final char[] charBuffer) {
+ int currentOffset = utfOffset;
+ int endOffset = currentOffset + utfLength;
+ int strLength = 0;
+ byte[] classBuffer = classFileBuffer;
+ while (currentOffset < endOffset) {
+ int currentByte = classBuffer[currentOffset++];
+ if ((currentByte & 0x80) == 0) {
+ charBuffer[strLength++] = (char) (currentByte & 0x7F);
+ } else if ((currentByte & 0xE0) == 0xC0) {
+ charBuffer[strLength++] =
+ (char) (((currentByte & 0x1F) << 6) + (classBuffer[currentOffset++] & 0x3F));
+ } else {
+ charBuffer[strLength++] =
+ (char)
+ (((currentByte & 0xF) << 12)
+ + ((classBuffer[currentOffset++] & 0x3F) << 6)
+ + (classBuffer[currentOffset++] & 0x3F));
+ }
+ }
+ return new String(charBuffer, 0, strLength);
+ }
+
+ /**
+ * Reads a CONSTANT_Class, CONSTANT_String, CONSTANT_MethodType, CONSTANT_Module or
+ * CONSTANT_Package constant pool entry in {@link #classFileBuffer}. <i>This method is intended
+ * for {@link Attribute} sub classes, and is normally not needed by class generators or
+ * adapters.</i>
+ *
+ * @param offset the start offset of an unsigned short value in {@link #classFileBuffer}, whose
+ * value is the index of a CONSTANT_Class, CONSTANT_String, CONSTANT_MethodType,
+ * CONSTANT_Module or CONSTANT_Package entry in class's constant pool table.
+ * @param charBuffer the buffer to be used to read the item. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the String corresponding to the specified constant pool entry.
+ */
+ private String readStringish(final int offset, final char[] charBuffer) {
+ // Get the start offset of the cp_info structure (plus one), and read the CONSTANT_Utf8 entry
+ // designated by the first two bytes of this cp_info.
+ return readUTF8(cpInfoOffsets[readUnsignedShort(offset)], charBuffer);
+ }
+
+ /**
+ * Reads a CONSTANT_Class constant pool entry in this {@link ClassReader}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by class generators or
+ * adapters.</i>
+ *
+ * @param offset the start offset of an unsigned short value in this {@link ClassReader}, whose
+ * value is the index of a CONSTANT_Class entry in class's constant pool table.
+ * @param charBuffer the buffer to be used to read the item. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the String corresponding to the specified CONSTANT_Class entry.
+ */
+ public String readClass(final int offset, final char[] charBuffer) {
+ return readStringish(offset, charBuffer);
+ }
+
+ /**
+ * Reads a CONSTANT_Module constant pool entry in this {@link ClassReader}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by class generators or
+ * adapters.</i>
+ *
+ * @param offset the start offset of an unsigned short value in this {@link ClassReader}, whose
+ * value is the index of a CONSTANT_Module entry in class's constant pool table.
+ * @param charBuffer the buffer to be used to read the item. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the String corresponding to the specified CONSTANT_Module entry.
+ */
+ public String readModule(final int offset, final char[] charBuffer) {
+ return readStringish(offset, charBuffer);
+ }
+
+ /**
+ * Reads a CONSTANT_Package constant pool entry in this {@link ClassReader}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by class generators or
+ * adapters.</i>
+ *
+ * @param offset the start offset of an unsigned short value in this {@link ClassReader}, whose
+ * value is the index of a CONSTANT_Package entry in class's constant pool table.
+ * @param charBuffer the buffer to be used to read the item. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the String corresponding to the specified CONSTANT_Package entry.
+ */
+ public String readPackage(final int offset, final char[] charBuffer) {
+ return readStringish(offset, charBuffer);
+ }
+
+ /**
+ * Reads a CONSTANT_Dynamic constant pool entry in {@link #classFileBuffer}.
+ *
+ * @param constantPoolEntryIndex the index of a CONSTANT_Dynamic entry in the class's constant
+ * pool table.
+ * @param charBuffer the buffer to be used to read the string. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the ConstantDynamic corresponding to the specified CONSTANT_Dynamic entry.
+ */
+ private ConstantDynamic readConstantDynamic(
+ final int constantPoolEntryIndex, final char[] charBuffer) {
+ ConstantDynamic constantDynamic = constantDynamicValues[constantPoolEntryIndex];
+ if (constantDynamic != null) {
+ return constantDynamic;
+ }
+ int cpInfoOffset = cpInfoOffsets[constantPoolEntryIndex];
+ int nameAndTypeCpInfoOffset = cpInfoOffsets[readUnsignedShort(cpInfoOffset + 2)];
+ String name = readUTF8(nameAndTypeCpInfoOffset, charBuffer);
+ String descriptor = readUTF8(nameAndTypeCpInfoOffset + 2, charBuffer);
+ int bootstrapMethodOffset = bootstrapMethodOffsets[readUnsignedShort(cpInfoOffset)];
+ Handle handle = (Handle) readConst(readUnsignedShort(bootstrapMethodOffset), charBuffer);
+ Object[] bootstrapMethodArguments = new Object[readUnsignedShort(bootstrapMethodOffset + 2)];
+ bootstrapMethodOffset += 4;
+ for (int i = 0; i < bootstrapMethodArguments.length; i++) {
+ bootstrapMethodArguments[i] = readConst(readUnsignedShort(bootstrapMethodOffset), charBuffer);
+ bootstrapMethodOffset += 2;
+ }
+ return constantDynamicValues[constantPoolEntryIndex] =
+ new ConstantDynamic(name, descriptor, handle, bootstrapMethodArguments);
+ }
+
+ /**
+ * Reads a numeric or string constant pool entry in this {@link ClassReader}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by class generators or
+ * adapters.</i>
+ *
+ * @param constantPoolEntryIndex the index of a CONSTANT_Integer, CONSTANT_Float, CONSTANT_Long,
+ * CONSTANT_Double, CONSTANT_Class, CONSTANT_String, CONSTANT_MethodType,
+ * CONSTANT_MethodHandle or CONSTANT_Dynamic entry in the class's constant pool.
+ * @param charBuffer the buffer to be used to read strings. This buffer must be sufficiently
+ * large. It is not automatically resized.
+ * @return the {@link Integer}, {@link Float}, {@link Long}, {@link Double}, {@link String},
+ * {@link Type}, {@link Handle} or {@link ConstantDynamic} corresponding to the specified
+ * constant pool entry.
+ */
+ public Object readConst(final int constantPoolEntryIndex, final char[] charBuffer) {
+ int cpInfoOffset = cpInfoOffsets[constantPoolEntryIndex];
+ switch (classFileBuffer[cpInfoOffset - 1]) {
+ case Symbol.CONSTANT_INTEGER_TAG:
+ return readInt(cpInfoOffset);
+ case Symbol.CONSTANT_FLOAT_TAG:
+ return Float.intBitsToFloat(readInt(cpInfoOffset));
+ case Symbol.CONSTANT_LONG_TAG:
+ return readLong(cpInfoOffset);
+ case Symbol.CONSTANT_DOUBLE_TAG:
+ return Double.longBitsToDouble(readLong(cpInfoOffset));
+ case Symbol.CONSTANT_CLASS_TAG:
+ return Type.getObjectType(readUTF8(cpInfoOffset, charBuffer));
+ case Symbol.CONSTANT_STRING_TAG:
+ return readUTF8(cpInfoOffset, charBuffer);
+ case Symbol.CONSTANT_METHOD_TYPE_TAG:
+ return Type.getMethodType(readUTF8(cpInfoOffset, charBuffer));
+ case Symbol.CONSTANT_METHOD_HANDLE_TAG:
+ int referenceKind = readByte(cpInfoOffset);
+ int referenceCpInfoOffset = cpInfoOffsets[readUnsignedShort(cpInfoOffset + 1)];
+ int nameAndTypeCpInfoOffset = cpInfoOffsets[readUnsignedShort(referenceCpInfoOffset + 2)];
+ String owner = readClass(referenceCpInfoOffset, charBuffer);
+ String name = readUTF8(nameAndTypeCpInfoOffset, charBuffer);
+ String descriptor = readUTF8(nameAndTypeCpInfoOffset + 2, charBuffer);
+ boolean isInterface =
+ classFileBuffer[referenceCpInfoOffset - 1] == Symbol.CONSTANT_INTERFACE_METHODREF_TAG;
+ return new Handle(referenceKind, owner, name, descriptor, isInterface);
+ case Symbol.CONSTANT_DYNAMIC_TAG:
+ return readConstantDynamic(constantPoolEntryIndex, charBuffer);
+ default:
+ throw new IllegalArgumentException();
+ }
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassTooLargeException.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassTooLargeException.java
new file mode 100644
index 0000000..8b46201
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassTooLargeException.java
@@ -0,0 +1,71 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * Exception thrown when the constant pool of a class produced by a {@link ClassWriter} is too
+ * large.
+ *
+ * @author Jason Zaugg
+ */
+public final class ClassTooLargeException extends IndexOutOfBoundsException {
+ private static final long serialVersionUID = 160715609518896765L;
+
+ private final String className;
+ private final int constantPoolCount;
+
+ /**
+ * Constructs a new {@link ClassTooLargeException}.
+ *
+ * @param className the internal name of the class.
+ * @param constantPoolCount the number of constant pool items of the class.
+ */
+ public ClassTooLargeException(final String className, final int constantPoolCount) {
+ super("Class too large: " + className);
+ this.className = className;
+ this.constantPoolCount = constantPoolCount;
+ }
+
+ /**
+ * Returns the internal name of the class.
+ *
+ * @return the internal name of the class.
+ */
+ public String getClassName() {
+ return className;
+ }
+
+ /**
+ * Returns the number of constant pool items of the class.
+ *
+ * @return the number of constant pool items of the class.
+ */
+ public int getConstantPoolCount() {
+ return constantPoolCount;
+ }
+}
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 4e3d0b9..49b5de3 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
@@ -1,320 +1,329 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A visitor to visit a Java class. The methods of this class must be called in
- * the following order: <tt>visit</tt> [ <tt>visitSource</tt> ] [
- * <tt>visitOuterClass</tt> ] ( <tt>visitAnnotation</tt> |
- * <tt>visitTypeAnnotation</tt> | <tt>visitAttribute</tt> )* (
- * <tt>visitInnerClass</tt> | <tt>visitField</tt> | <tt>visitMethod</tt> )*
- * <tt>visitEnd</tt>.
+ * A visitor to visit a Java class. The methods of this class must be called in the following order:
+ * {@code visit} [ {@code visitSource} ] [ {@code visitModule} ][ {@code visitNestHost} ][ {@code
+ * visitOuterClass} ] ( {@code visitAnnotation} | {@code visitTypeAnnotation} | {@code
+ * visitAttribute} )* ( {@code visitNestMember} | {@code visitInnerClass} | {@code visitField} |
+ * {@code visitMethod} )* {@code visitEnd}.
*
* @author Eric Bruneton
*/
public abstract class ClassVisitor {
- /**
- * The ASM API version implemented by this visitor. The value of this field
- * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- */
- protected final int api;
+ /**
+ * 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}.
+ */
+ protected final int api;
- /**
- * The class visitor to which this visitor must delegate method calls. May
- * be null.
- */
- protected ClassVisitor cv;
+ /** The class visitor to which this visitor must delegate method calls. May be null. */
+ protected ClassVisitor cv;
- /**
- * Constructs a new {@link ClassVisitor}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- */
- public 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} or {@link Opcodes#ASM7}.
+ */
+ public 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} or {@link Opcodes#ASM7}.
+ * @param classVisitor the class visitor to which this visitor must delegate method calls. May be
+ * null.
+ */
+ public ClassVisitor(final int api, final ClassVisitor classVisitor) {
+ if (api != Opcodes.ASM7 && api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4) {
+ throw new IllegalArgumentException("Unsupported api " + api);
}
+ this.api = api;
+ this.cv = classVisitor;
+ }
- /**
- * Constructs a new {@link ClassVisitor}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- * @param cv
- * the class visitor to which this visitor must delegate method
- * calls. May be null.
- */
- public ClassVisitor(final int api, final ClassVisitor cv) {
- if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
- throw new IllegalArgumentException();
- }
- this.api = api;
- this.cv = cv;
+ /**
+ * Visits the header of the class.
+ *
+ * @param version the class version. The minor version is stored in the 16 most significant bits,
+ * and the major version in the 16 least significant bits.
+ * @param access the class's access flags (see {@link Opcodes}). This parameter also indicates if
+ * the class is deprecated.
+ * @param name the internal name of the class (see {@link Type#getInternalName()}).
+ * @param signature the signature of this class. May be {@literal null} if the class is not a
+ * generic one, and does not extend or implement generic classes or interfaces.
+ * @param superName the internal of name of the super class (see {@link Type#getInternalName()}).
+ * For interfaces, the super class is {@link Object}. May be {@literal null}, but only for the
+ * {@link Object} class.
+ * @param interfaces the internal names of the class's interfaces (see {@link
+ * Type#getInternalName()}). May be {@literal null}.
+ */
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces) {
+ if (cv != null) {
+ cv.visit(version, access, name, signature, superName, interfaces);
}
+ }
- /**
- * Visits the header of the class.
- *
- * @param version
- * the class version.
- * @param access
- * the class's access flags (see {@link Opcodes}). This parameter
- * also indicates if the class is deprecated.
- * @param name
- * the internal name of the class (see
- * {@link Type#getInternalName() getInternalName}).
- * @param signature
- * the signature of this class. May be <tt>null</tt> if the class
- * is not a generic one, and does not extend or implement generic
- * classes or interfaces.
- * @param superName
- * the internal of name of the super class (see
- * {@link Type#getInternalName() getInternalName}). For
- * interfaces, the super class is {@link Object}. May be
- * <tt>null</tt>, but only for the {@link Object} class.
- * @param interfaces
- * the internal names of the class's interfaces (see
- * {@link Type#getInternalName() getInternalName}). May be
- * <tt>null</tt>.
- */
- public void visit(int version, int access, String name, String signature,
- String superName, String[] interfaces) {
- if (cv != null) {
- cv.visit(version, access, name, signature, superName, interfaces);
- }
+ /**
+ * Visits the source of the class.
+ *
+ * @param source the name of the source file from which the class was compiled. May be {@literal
+ * null}.
+ * @param debug additional debug information to compute the correspondence between source and
+ * compiled elements of the class. May be {@literal null}.
+ */
+ public void visitSource(final String source, final String debug) {
+ if (cv != null) {
+ cv.visitSource(source, debug);
}
+ }
- /**
- * Visits the source of the class.
- *
- * @param source
- * the name of the source file from which the class was compiled.
- * May be <tt>null</tt>.
- * @param debug
- * additional debug information to compute the correspondance
- * between source and compiled elements of the class. May be
- * <tt>null</tt>.
- */
- public void visitSource(String source, String debug) {
- if (cv != null) {
- cv.visitSource(source, debug);
- }
+ /**
+ * Visit the module corresponding to the class.
+ *
+ * @param name the fully qualified name (using dots) of the module.
+ * @param access the module access flags, among {@code ACC_OPEN}, {@code ACC_SYNTHETIC} and {@code
+ * ACC_MANDATED}.
+ * @param version the module version, or {@literal null}.
+ * @return a visitor to visit the module values, or {@literal null} if this visitor is not
+ * interested in visiting this module.
+ */
+ public ModuleVisitor visitModule(final String name, final int access, final String version) {
+ if (api < Opcodes.ASM6) {
+ throw new UnsupportedOperationException("This feature requires ASM6");
}
+ if (cv != null) {
+ return cv.visitModule(name, access, version);
+ }
+ return null;
+ }
- /**
- * Visits the enclosing class of the class. This method must be called only
- * if the class has an enclosing class.
- *
- * @param owner
- * internal name of the enclosing class of the class.
- * @param name
- * the name of the method that contains the class, or
- * <tt>null</tt> if the class is not enclosed in a method of its
- * enclosing class.
- * @param desc
- * the descriptor of the method that contains the class, or
- * <tt>null</tt> if the class is not enclosed in a method of its
- * enclosing class.
- */
- public void visitOuterClass(String owner, String name, String desc) {
- if (cv != null) {
- cv.visitOuterClass(owner, name, desc);
- }
+ /**
+ * Visits the nest host class of the class. A nest is a set of classes of the same package that
+ * share access to their private members. One of these classes, called the host, lists the other
+ * members of the nest, which in turn should link to the host of their nest. This method must be
+ * called only once and only if the visited class is a non-host member of a nest. A class is
+ * implicitly its own nest, so it's invalid to call this method with the visited class name as
+ * argument.
+ *
+ * @param nestHost the internal name of the host class of the nest.
+ */
+ public void visitNestHost(final String nestHost) {
+ if (api < Opcodes.ASM7) {
+ throw new UnsupportedOperationException("This feature requires ASM7");
}
+ if (cv != null) {
+ cv.visitNestHost(nestHost);
+ }
+ }
- /**
- * Visits an annotation of the class.
- *
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
- if (cv != null) {
- return cv.visitAnnotation(desc, visible);
- }
- return null;
+ /**
+ * Visits the enclosing class of the class. This method must be called only if the class has an
+ * enclosing class.
+ *
+ * @param owner internal name of the enclosing class of the class.
+ * @param name the name of the method that contains the class, or {@literal null} if the class is
+ * not enclosed in a method of its enclosing class.
+ * @param descriptor the descriptor of the method that contains the class, or {@literal null} if
+ * the class is not enclosed in a method of its enclosing class.
+ */
+ public void visitOuterClass(final String owner, final String name, final String descriptor) {
+ if (cv != null) {
+ cv.visitOuterClass(owner, name, descriptor);
}
+ }
- /**
- * Visits an annotation on a type in the class signature.
- *
- * @param typeRef
- * a reference to the annotated type. The sort of this type
- * reference must be {@link TypeReference#CLASS_TYPE_PARAMETER
- * CLASS_TYPE_PARAMETER},
- * {@link TypeReference#CLASS_TYPE_PARAMETER_BOUND
- * CLASS_TYPE_PARAMETER_BOUND} or
- * {@link TypeReference#CLASS_EXTENDS CLASS_EXTENDS}. See
- * {@link TypeReference}.
- * @param typePath
- * the path to the annotated type argument, wildcard bound, array
- * element type, or static inner type within 'typeRef'. May be
- * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- if (api < Opcodes.ASM5) {
- throw new RuntimeException();
- }
- if (cv != null) {
- return cv.visitTypeAnnotation(typeRef, typePath, desc, visible);
- }
- return null;
+ /**
+ * Visits an annotation of the class.
+ *
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) {
+ if (cv != null) {
+ return cv.visitAnnotation(descriptor, visible);
}
+ return null;
+ }
- /**
- * Visits a non standard attribute of the class.
- *
- * @param attr
- * an attribute.
- */
- public void visitAttribute(Attribute attr) {
- if (cv != null) {
- cv.visitAttribute(attr);
- }
+ /**
+ * Visits an annotation on a type in the class signature.
+ *
+ * @param typeRef a reference to the annotated type. The sort of this type reference must be
+ * {@link TypeReference#CLASS_TYPE_PARAMETER}, {@link
+ * TypeReference#CLASS_TYPE_PARAMETER_BOUND} or {@link TypeReference#CLASS_EXTENDS}. See
+ * {@link TypeReference}.
+ * @param typePath the path to the annotated type argument, wildcard bound, array element type, or
+ * static inner type within 'typeRef'. May be {@literal null} if the annotation targets
+ * 'typeRef' as a whole.
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitTypeAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new UnsupportedOperationException("This feature requires ASM5");
}
+ if (cv != null) {
+ return cv.visitTypeAnnotation(typeRef, typePath, descriptor, visible);
+ }
+ return null;
+ }
- /**
- * Visits information about an inner class. This inner class is not
- * necessarily a member of the class being visited.
- *
- * @param name
- * the internal name of an inner class (see
- * {@link Type#getInternalName() getInternalName}).
- * @param outerName
- * the internal name of the class to which the inner class
- * belongs (see {@link Type#getInternalName() getInternalName}).
- * May be <tt>null</tt> for not member classes.
- * @param innerName
- * the (simple) name of the inner class inside its enclosing
- * class. May be <tt>null</tt> for anonymous inner classes.
- * @param access
- * the access flags of the inner class as originally declared in
- * the enclosing class.
- */
- public void visitInnerClass(String name, String outerName,
- String innerName, int access) {
- if (cv != null) {
- cv.visitInnerClass(name, outerName, innerName, access);
- }
+ /**
+ * Visits a non standard attribute of the class.
+ *
+ * @param attribute an attribute.
+ */
+ public void visitAttribute(final Attribute attribute) {
+ if (cv != null) {
+ cv.visitAttribute(attribute);
}
+ }
- /**
- * Visits a field of the class.
- *
- * @param access
- * the field's access flags (see {@link Opcodes}). This parameter
- * also indicates if the field is synthetic and/or deprecated.
- * @param name
- * the field's name.
- * @param desc
- * the field's descriptor (see {@link Type Type}).
- * @param signature
- * the field's signature. May be <tt>null</tt> if the field's
- * type does not use generic types.
- * @param value
- * the field's initial value. This parameter, which may be
- * <tt>null</tt> if the field does not have an initial value,
- * must be an {@link Integer}, a {@link Float}, a {@link Long}, a
- * {@link Double} or a {@link String} (for <tt>int</tt>,
- * <tt>float</tt>, <tt>long</tt> or <tt>String</tt> fields
- * respectively). <i>This parameter is only used for static
- * fields</i>. Its value is ignored for non static fields, which
- * must be initialized through bytecode instructions in
- * constructors or methods.
- * @return a visitor to visit field annotations and attributes, or
- * <tt>null</tt> if this class visitor is not interested in visiting
- * these annotations and attributes.
- */
- public FieldVisitor visitField(int access, String name, String desc,
- String signature, Object value) {
- if (cv != null) {
- return cv.visitField(access, name, desc, signature, value);
- }
- return null;
+ /**
+ * Visits a member of the nest. A nest is a set of classes of the same package that share access
+ * to their private members. One of these classes, called the host, lists the other members of the
+ * nest, which in turn should link to the host of their nest. This method must be called only if
+ * the visited class is the host of a nest. A nest host is implicitly a member of its own nest, so
+ * it's invalid to call this method with the visited class name as argument.
+ *
+ * @param nestMember the internal name of a nest member.
+ */
+ public void visitNestMember(final String nestMember) {
+ if (api < Opcodes.ASM7) {
+ throw new UnsupportedOperationException("This feature requires ASM7");
}
+ if (cv != null) {
+ cv.visitNestMember(nestMember);
+ }
+ }
- /**
- * Visits a method of the class. This method <i>must</i> return a new
- * {@link MethodVisitor} instance (or <tt>null</tt>) each time it is called,
- * i.e., it should not return a previously returned visitor.
- *
- * @param access
- * the method's access flags (see {@link Opcodes}). This
- * parameter also indicates if the method is synthetic and/or
- * deprecated.
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
- * @param signature
- * the method's signature. May be <tt>null</tt> if the method
- * parameters, return type and exceptions do not use generic
- * types.
- * @param exceptions
- * the internal names of the method's exception classes (see
- * {@link Type#getInternalName() getInternalName}). May be
- * <tt>null</tt>.
- * @return an object to visit the byte code of the method, or <tt>null</tt>
- * if this class visitor is not interested in visiting the code of
- * this method.
- */
- public MethodVisitor visitMethod(int access, String name, String desc,
- String signature, String[] exceptions) {
- if (cv != null) {
- return cv.visitMethod(access, name, desc, signature, exceptions);
- }
- return null;
+ /**
+ * Visits information about an inner class. This inner class is not necessarily a member of the
+ * class being visited.
+ *
+ * @param name the internal name of an inner class (see {@link Type#getInternalName()}).
+ * @param outerName the internal name of the class to which the inner class belongs (see {@link
+ * Type#getInternalName()}). May be {@literal null} for not member classes.
+ * @param innerName the (simple) name of the inner class inside its enclosing class. May be
+ * {@literal null} for anonymous inner classes.
+ * @param access the access flags of the inner class as originally declared in the enclosing
+ * class.
+ */
+ public void visitInnerClass(
+ final String name, final String outerName, final String innerName, final int access) {
+ if (cv != null) {
+ cv.visitInnerClass(name, outerName, innerName, access);
}
+ }
- /**
- * Visits the end of the class. This method, which is the last one to be
- * called, is used to inform the visitor that all the fields and methods of
- * the class have been visited.
- */
- public void visitEnd() {
- if (cv != null) {
- cv.visitEnd();
- }
+ /**
+ * Visits a field of the class.
+ *
+ * @param access the field's access flags (see {@link Opcodes}). This parameter also indicates if
+ * the field is synthetic and/or deprecated.
+ * @param name the field's name.
+ * @param descriptor the field's descriptor (see {@link Type}).
+ * @param signature the field's signature. May be {@literal null} if the field's type does not use
+ * generic types.
+ * @param value the field's initial value. This parameter, which may be {@literal null} if the
+ * field does not have an initial value, must be an {@link Integer}, a {@link Float}, a {@link
+ * Long}, a {@link Double} or a {@link String} (for {@code int}, {@code float}, {@code long}
+ * or {@code String} fields respectively). <i>This parameter is only used for static
+ * fields</i>. Its value is ignored for non static fields, which must be initialized through
+ * bytecode instructions in constructors or methods.
+ * @return a visitor to visit field annotations and attributes, or {@literal null} if this class
+ * visitor is not interested in visiting these annotations and attributes.
+ */
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String descriptor,
+ final String signature,
+ final Object value) {
+ if (cv != null) {
+ return cv.visitField(access, name, descriptor, signature, value);
}
+ return null;
+ }
+
+ /**
+ * Visits a method of the class. This method <i>must</i> return a new {@link MethodVisitor}
+ * instance (or {@literal null}) each time it is called, i.e., it should not return a previously
+ * returned visitor.
+ *
+ * @param access the method's access flags (see {@link Opcodes}). This parameter also indicates if
+ * the method is synthetic and/or deprecated.
+ * @param name the method's name.
+ * @param descriptor the method's descriptor (see {@link Type}).
+ * @param signature the method's signature. May be {@literal null} if the method parameters,
+ * return type and exceptions do not use generic types.
+ * @param exceptions the internal names of the method's exception classes (see {@link
+ * Type#getInternalName()}). May be {@literal null}.
+ * @return an object to visit the byte code of the method, or {@literal null} if this class
+ * visitor is not interested in visiting the code of this method.
+ */
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String descriptor,
+ final String signature,
+ final String[] exceptions) {
+ if (cv != null) {
+ return cv.visitMethod(access, name, descriptor, signature, exceptions);
+ }
+ return null;
+ }
+
+ /**
+ * Visits the end of the class. This method, which is the last one to be called, is used to inform
+ * the visitor that all the fields and methods of the class have been visited.
+ */
+ public void visitEnd() {
+ if (cv != null) {
+ cv.visitEnd();
+ }
+ }
}
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 6b2fd4e..80f0e7c 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
@@ -1,1776 +1,965 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A {@link ClassVisitor} that generates classes in bytecode form. More
- * precisely this visitor generates a byte array conforming to the Java class
- * file format. It can be used alone, to generate a Java class "from scratch",
- * or with one or more {@link ClassReader ClassReader} and adapter class visitor
- * to generate a modified class from one or more existing Java classes.
+ * A {@link ClassVisitor} that generates a corresponding ClassFile structure, as defined in the Java
+ * Virtual Machine Specification (JVMS). It can be used alone, to generate a Java class "from
+ * scratch", or with one or more {@link ClassReader} and adapter {@link ClassVisitor} to generate a
+ * modified class from one or more existing Java classes.
*
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html">JVMS 4</a>
* @author Eric Bruneton
*/
public class ClassWriter extends ClassVisitor {
- /**
- * Flag to automatically compute the maximum stack size and the maximum
- * number of local variables of methods. If this flag is set, then the
- * arguments of the {@link MethodVisitor#visitMaxs visitMaxs} method of the
- * {@link MethodVisitor} returned by the {@link #visitMethod visitMethod}
- * method will be ignored, and computed automatically from the signature and
- * the bytecode of each method.
- *
- * @see #ClassWriter(int)
- */
- public static final int COMPUTE_MAXS = 1;
+ /**
+ * A flag to automatically compute the maximum stack size and the maximum number of local
+ * variables of methods. If this flag is set, then the arguments of the {@link
+ * MethodVisitor#visitMaxs} method of the {@link MethodVisitor} returned by the {@link
+ * #visitMethod} method will be ignored, and computed automatically from the signature and the
+ * bytecode of each method.
+ *
+ * <p><b>Note:</b> for classes whose version is {@link Opcodes#V1_7} of more, this option requires
+ * valid stack map frames. The maximum stack size is then computed from these frames, and from the
+ * bytecode instructions in between. If stack map frames are not present or must be recomputed,
+ * used {@link #COMPUTE_FRAMES} instead.
+ *
+ * @see #ClassWriter(int)
+ */
+ public static final int COMPUTE_MAXS = 1;
- /**
- * Flag to automatically compute the stack map frames of methods from
- * scratch. If this flag is set, then the calls to the
- * {@link MethodVisitor#visitFrame} method are ignored, and the stack map
- * frames are recomputed from the methods bytecode. The arguments of the
- * {@link MethodVisitor#visitMaxs visitMaxs} method are also ignored and
- * recomputed from the bytecode. In other words, computeFrames implies
- * computeMaxs.
- *
- * @see #ClassWriter(int)
- */
- public static final int COMPUTE_FRAMES = 2;
+ /**
+ * A flag to automatically compute the stack map frames of methods from scratch. If this flag is
+ * set, then the calls to the {@link MethodVisitor#visitFrame} method are ignored, and the stack
+ * map frames are recomputed from the methods bytecode. The arguments of the {@link
+ * MethodVisitor#visitMaxs} method are also ignored and recomputed from the bytecode. In other
+ * words, {@link #COMPUTE_FRAMES} implies {@link #COMPUTE_MAXS}.
+ *
+ * @see #ClassWriter(int)
+ */
+ public static final int COMPUTE_FRAMES = 2;
- /**
- * Pseudo access flag to distinguish between the synthetic attribute and the
- * synthetic access flag.
- */
- static final int ACC_SYNTHETIC_ATTRIBUTE = 0x40000;
+ // Note: fields are ordered as in the ClassFile structure, and those related to attributes are
+ // ordered as in Section 4.7 of the JVMS.
- /**
- * Factor to convert from ACC_SYNTHETIC_ATTRIBUTE to Opcode.ACC_SYNTHETIC.
- */
- static final int TO_ACC_SYNTHETIC = ACC_SYNTHETIC_ATTRIBUTE
- / Opcodes.ACC_SYNTHETIC;
+ /**
+ * The minor_version and major_version fields of the JVMS ClassFile structure. minor_version is
+ * stored in the 16 most significant bits, and major_version in the 16 least significant bits.
+ */
+ private int version;
- /**
- * The type of instructions without any argument.
- */
- static final int NOARG_INSN = 0;
+ /** The symbol table for this class (contains the constant_pool and the BootstrapMethods). */
+ private final SymbolTable symbolTable;
- /**
- * The type of instructions with an signed byte argument.
- */
- static final int SBYTE_INSN = 1;
+ /**
+ * The access_flags field of the JVMS ClassFile structure. This field can contain ASM specific
+ * access flags, such as {@link Opcodes#ACC_DEPRECATED}, which are removed when generating the
+ * ClassFile structure.
+ */
+ private int accessFlags;
- /**
- * The type of instructions with an signed short argument.
- */
- static final int SHORT_INSN = 2;
+ /** The this_class field of the JVMS ClassFile structure. */
+ private int thisClass;
- /**
- * The type of instructions with a local variable index argument.
- */
- static final int VAR_INSN = 3;
+ /** The super_class field of the JVMS ClassFile structure. */
+ private int superClass;
- /**
- * The type of instructions with an implicit local variable index argument.
- */
- static final int IMPLVAR_INSN = 4;
+ /** The interface_count field of the JVMS ClassFile structure. */
+ private int interfaceCount;
- /**
- * The type of instructions with a type descriptor argument.
- */
- static final int TYPE_INSN = 5;
+ /** The 'interfaces' array of the JVMS ClassFile structure. */
+ private int[] interfaces;
- /**
- * The type of field and method invocations instructions.
- */
- static final int FIELDORMETH_INSN = 6;
+ /**
+ * The fields of this class, stored in a linked list of {@link FieldWriter} linked via their
+ * {@link FieldWriter#fv} field. This field stores the first element of this list.
+ */
+ private FieldWriter firstField;
- /**
- * The type of the INVOKEINTERFACE/INVOKEDYNAMIC instruction.
- */
- static final int ITFMETH_INSN = 7;
+ /**
+ * The fields of this class, stored in a linked list of {@link FieldWriter} linked via their
+ * {@link FieldWriter#fv} field. This field stores the last element of this list.
+ */
+ private FieldWriter lastField;
- /**
- * The type of the INVOKEDYNAMIC instruction.
- */
- static final int INDYMETH_INSN = 8;
+ /**
+ * The methods of this class, stored in a linked list of {@link MethodWriter} linked via their
+ * {@link MethodWriter#mv} field. This field stores the first element of this list.
+ */
+ private MethodWriter firstMethod;
- /**
- * The type of instructions with a 2 bytes bytecode offset label.
- */
- static final int LABEL_INSN = 9;
+ /**
+ * The methods of this class, stored in a linked list of {@link MethodWriter} linked via their
+ * {@link MethodWriter#mv} field. This field stores the last element of this list.
+ */
+ private MethodWriter lastMethod;
- /**
- * The type of instructions with a 4 bytes bytecode offset label.
- */
- static final int LABELW_INSN = 10;
+ /** The number_of_classes field of the InnerClasses attribute, or 0. */
+ private int numberOfInnerClasses;
- /**
- * The type of the LDC instruction.
- */
- static final int LDC_INSN = 11;
+ /** The 'classes' array of the InnerClasses attribute, or {@literal null}. */
+ private ByteVector innerClasses;
- /**
- * The type of the LDC_W and LDC2_W instructions.
- */
- static final int LDCW_INSN = 12;
+ /** The class_index field of the EnclosingMethod attribute, or 0. */
+ private int enclosingClassIndex;
- /**
- * The type of the IINC instruction.
- */
- static final int IINC_INSN = 13;
+ /** The method_index field of the EnclosingMethod attribute. */
+ private int enclosingMethodIndex;
- /**
- * The type of the TABLESWITCH instruction.
- */
- static final int TABL_INSN = 14;
+ /** The signature_index field of the Signature attribute, or 0. */
+ private int signatureIndex;
- /**
- * The type of the LOOKUPSWITCH instruction.
- */
- static final int LOOK_INSN = 15;
+ /** The source_file_index field of the SourceFile attribute, or 0. */
+ private int sourceFileIndex;
- /**
- * The type of the MULTIANEWARRAY instruction.
- */
- static final int MANA_INSN = 16;
+ /** The debug_extension field of the SourceDebugExtension attribute, or {@literal null}. */
+ private ByteVector debugExtension;
- /**
- * The type of the WIDE instruction.
- */
- static final int WIDE_INSN = 17;
+ /**
+ * The last runtime visible annotation of this class. The previous ones can be accessed with the
+ * {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeVisibleAnnotation;
- /**
- * The instruction types of all JVM opcodes.
- */
- static final byte[] TYPE;
+ /**
+ * The last runtime invisible annotation of this class. The previous ones can be accessed with the
+ * {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeInvisibleAnnotation;
- /**
- * The type of CONSTANT_Class constant pool items.
- */
- static final int CLASS = 7;
+ /**
+ * The last runtime visible type annotation of this class. The previous ones can be accessed with
+ * the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeVisibleTypeAnnotation;
- /**
- * The type of CONSTANT_Fieldref constant pool items.
- */
- static final int FIELD = 9;
+ /**
+ * The last runtime invisible type annotation of this class. The previous ones can be accessed
+ * with the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeInvisibleTypeAnnotation;
- /**
- * The type of CONSTANT_Methodref constant pool items.
- */
- static final int METH = 10;
+ /** The Module attribute of this class, or {@literal null}. */
+ private ModuleWriter moduleWriter;
- /**
- * The type of CONSTANT_InterfaceMethodref constant pool items.
- */
- static final int IMETH = 11;
+ /** The host_class_index field of the NestHost attribute, or 0. */
+ private int nestHostClassIndex;
- /**
- * The type of CONSTANT_String constant pool items.
- */
- static final int STR = 8;
+ /** The number_of_classes field of the NestMembers attribute, or 0. */
+ private int numberOfNestMemberClasses;
- /**
- * The type of CONSTANT_Integer constant pool items.
- */
- static final int INT = 3;
+ /** The 'classes' array of the NestMembers attribute, or {@literal null}. */
+ private ByteVector nestMemberClasses;
- /**
- * The type of CONSTANT_Float constant pool items.
- */
- static final int FLOAT = 4;
+ /**
+ * The first non standard attribute of this class. The next ones can be accessed with the {@link
+ * Attribute#nextAttribute} field. May be {@literal null}.
+ *
+ * <p><b>WARNING</b>: this list stores the attributes in the <i>reverse</i> order of their visit.
+ * firstAttribute is actually the last attribute visited in {@link #visitAttribute}. The {@link
+ * #toByteArray} method writes the attributes in the order defined by this list, i.e. in the
+ * reverse order specified by the user.
+ */
+ private Attribute firstAttribute;
- /**
- * The type of CONSTANT_Long constant pool items.
- */
- static final int LONG = 5;
+ /**
+ * Indicates what must be automatically computed in {@link MethodWriter}. Must be one of {@link
+ * MethodWriter#COMPUTE_NOTHING}, {@link MethodWriter#COMPUTE_MAX_STACK_AND_LOCAL}, {@link
+ * MethodWriter#COMPUTE_INSERTED_FRAMES}, or {@link MethodWriter#COMPUTE_ALL_FRAMES}.
+ */
+ private int compute;
- /**
- * The type of CONSTANT_Double constant pool items.
- */
- static final int DOUBLE = 6;
+ // -----------------------------------------------------------------------------------------------
+ // Constructor
+ // -----------------------------------------------------------------------------------------------
- /**
- * The type of CONSTANT_NameAndType constant pool items.
- */
- static final int NAME_TYPE = 12;
+ /**
+ * Constructs a new {@link ClassWriter} object.
+ *
+ * @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}.
+ */
+ public ClassWriter(final int flags) {
+ this(null, flags);
+ }
- /**
- * The type of CONSTANT_Utf8 constant pool items.
- */
- static final int UTF8 = 1;
+ /**
+ * Constructs a new {@link ClassWriter} object and enables optimizations for "mostly add" bytecode
+ * transformations. These optimizations are the following:
+ *
+ * <ul>
+ * <li>The constant pool and bootstrap methods from the original class are copied as is in the
+ * new class, which saves time. New constant pool entries and new bootstrap methods will be
+ * added at the end if necessary, but unused constant pool entries or bootstrap methods
+ * <i>won't be removed</i>.
+ * <li>Methods that are not transformed are copied as is in the new class, directly from the
+ * original class bytecode (i.e. without emitting visit events for all the method
+ * instructions), which saves a <i>lot</i> of time. Untransformed methods are detected by
+ * the fact that the {@link ClassReader} receives {@link MethodVisitor} objects that come
+ * from a {@link ClassWriter} (and not from any other {@link ClassVisitor} instance).
+ * </ul>
+ *
+ * @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}. <i>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</i>.
+ */
+ public ClassWriter(final ClassReader classReader, final int flags) {
+ super(Opcodes.ASM7);
+ symbolTable = classReader == null ? new SymbolTable(this) : new SymbolTable(this, classReader);
+ if ((flags & COMPUTE_FRAMES) != 0) {
+ this.compute = MethodWriter.COMPUTE_ALL_FRAMES;
+ } else if ((flags & COMPUTE_MAXS) != 0) {
+ this.compute = MethodWriter.COMPUTE_MAX_STACK_AND_LOCAL;
+ } else {
+ this.compute = MethodWriter.COMPUTE_NOTHING;
+ }
+ }
- /**
- * The type of CONSTANT_MethodType constant pool items.
- */
- static final int MTYPE = 16;
+ // -----------------------------------------------------------------------------------------------
+ // Implementation of the ClassVisitor abstract class
+ // -----------------------------------------------------------------------------------------------
- /**
- * The type of CONSTANT_MethodHandle constant pool items.
- */
- static final int HANDLE = 15;
+ @Override
+ public final void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces) {
+ this.version = version;
+ this.accessFlags = access;
+ this.thisClass = symbolTable.setMajorVersionAndClassName(version & 0xFFFF, name);
+ if (signature != null) {
+ this.signatureIndex = symbolTable.addConstantUtf8(signature);
+ }
+ this.superClass = superName == null ? 0 : symbolTable.addConstantClass(superName).index;
+ if (interfaces != null && interfaces.length > 0) {
+ interfaceCount = interfaces.length;
+ this.interfaces = new int[interfaceCount];
+ for (int i = 0; i < interfaceCount; ++i) {
+ this.interfaces[i] = symbolTable.addConstantClass(interfaces[i]).index;
+ }
+ }
+ if (compute == MethodWriter.COMPUTE_MAX_STACK_AND_LOCAL && (version & 0xFFFF) >= Opcodes.V1_7) {
+ compute = MethodWriter.COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES;
+ }
+ }
- /**
- * The type of CONSTANT_InvokeDynamic constant pool items.
- */
- static final int INDY = 18;
+ @Override
+ public final void visitSource(final String file, final String debug) {
+ if (file != null) {
+ sourceFileIndex = symbolTable.addConstantUtf8(file);
+ }
+ if (debug != null) {
+ debugExtension = new ByteVector().encodeUtf8(debug, 0, Integer.MAX_VALUE);
+ }
+ }
- /**
- * The base value for all CONSTANT_MethodHandle constant pool items.
- * Internally, ASM store the 9 variations of CONSTANT_MethodHandle into 9
- * different items.
- */
- static final int HANDLE_BASE = 20;
+ @Override
+ public final ModuleVisitor visitModule(
+ final String name, final int access, final String version) {
+ return moduleWriter =
+ new ModuleWriter(
+ symbolTable,
+ symbolTable.addConstantModule(name).index,
+ access,
+ version == null ? 0 : symbolTable.addConstantUtf8(version));
+ }
- /**
- * Normal type Item stored in the ClassWriter {@link ClassWriter#typeTable},
- * instead of the constant pool, in order to avoid clashes with normal
- * constant pool items in the ClassWriter constant pool's hash table.
- */
- static final int TYPE_NORMAL = 30;
+ @Override
+ public void visitNestHost(final String nestHost) {
+ nestHostClassIndex = symbolTable.addConstantClass(nestHost).index;
+ }
- /**
- * Uninitialized type Item stored in the ClassWriter
- * {@link ClassWriter#typeTable}, instead of the constant pool, in order to
- * avoid clashes with normal constant pool items in the ClassWriter constant
- * pool's hash table.
- */
- static final int TYPE_UNINIT = 31;
+ @Override
+ public final void visitOuterClass(
+ final String owner, final String name, final String descriptor) {
+ enclosingClassIndex = symbolTable.addConstantClass(owner).index;
+ if (name != null && descriptor != null) {
+ enclosingMethodIndex = symbolTable.addConstantNameAndType(name, descriptor);
+ }
+ }
- /**
- * Merged type Item stored in the ClassWriter {@link ClassWriter#typeTable},
- * instead of the constant pool, in order to avoid clashes with normal
- * constant pool items in the ClassWriter constant pool's hash table.
- */
- static final int TYPE_MERGED = 32;
+ @Override
+ public final AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) {
+ if (visible) {
+ return lastRuntimeVisibleAnnotation =
+ AnnotationWriter.create(symbolTable, descriptor, lastRuntimeVisibleAnnotation);
+ } else {
+ return lastRuntimeInvisibleAnnotation =
+ AnnotationWriter.create(symbolTable, descriptor, lastRuntimeInvisibleAnnotation);
+ }
+ }
- /**
- * The type of BootstrapMethods items. These items are stored in a special
- * class attribute named BootstrapMethods and not in the constant pool.
- */
- static final int BSM = 33;
+ @Override
+ public final AnnotationVisitor visitTypeAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (visible) {
+ return lastRuntimeVisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable, typeRef, typePath, descriptor, lastRuntimeVisibleTypeAnnotation);
+ } else {
+ return lastRuntimeInvisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable, typeRef, typePath, descriptor, lastRuntimeInvisibleTypeAnnotation);
+ }
+ }
- /**
- * The class reader from which this class writer was constructed, if any.
- */
- ClassReader cr;
+ @Override
+ public final void visitAttribute(final Attribute attribute) {
+ // Store the attributes in the <i>reverse</i> order of their visit by this method.
+ attribute.nextAttribute = firstAttribute;
+ firstAttribute = attribute;
+ }
- /**
- * Minor and major version numbers of the class to be generated.
- */
- int version;
+ @Override
+ public void visitNestMember(final String nestMember) {
+ if (nestMemberClasses == null) {
+ nestMemberClasses = new ByteVector();
+ }
+ ++numberOfNestMemberClasses;
+ nestMemberClasses.putShort(symbolTable.addConstantClass(nestMember).index);
+ }
- /**
- * Index of the next item to be added in the constant pool.
- */
- int index;
-
- /**
- * The constant pool of this class.
- */
- final ByteVector pool;
-
- /**
- * The constant pool's hash table data.
- */
- Item[] items;
-
- /**
- * The threshold of the constant pool's hash table.
- */
- int threshold;
-
- /**
- * A reusable key used to look for items in the {@link #items} hash table.
- */
- final Item key;
-
- /**
- * A reusable key used to look for items in the {@link #items} hash table.
- */
- final Item key2;
-
- /**
- * A reusable key used to look for items in the {@link #items} hash table.
- */
- final Item key3;
-
- /**
- * A reusable key used to look for items in the {@link #items} hash table.
- */
- final Item key4;
-
- /**
- * A type table used to temporarily store internal names that will not
- * necessarily be stored in the constant pool. This type table is used by
- * the control flow and data flow analysis algorithm used to compute stack
- * map frames from scratch. This array associates to each index <tt>i</tt>
- * the Item whose index is <tt>i</tt>. All Item objects stored in this array
- * are also stored in the {@link #items} hash table. These two arrays allow
- * to retrieve an Item from its index or, conversely, to get the index of an
- * Item from its value. Each Item stores an internal name in its
- * {@link Item#strVal1} field.
- */
- Item[] typeTable;
-
- /**
- * Number of elements in the {@link #typeTable} array.
- */
- private short typeCount;
-
- /**
- * The access flags of this class.
- */
- private int access;
-
- /**
- * The constant pool item that contains the internal name of this class.
- */
- private int name;
-
- /**
- * The internal name of this class.
- */
- String thisName;
-
- /**
- * The constant pool item that contains the signature of this class.
- */
- private int signature;
-
- /**
- * The constant pool item that contains the internal name of the super class
- * of this class.
- */
- private int superName;
-
- /**
- * Number of interfaces implemented or extended by this class or interface.
- */
- private int interfaceCount;
-
- /**
- * The interfaces implemented or extended by this class or interface. More
- * precisely, this array contains the indexes of the constant pool items
- * that contain the internal names of these interfaces.
- */
- private int[] interfaces;
-
- /**
- * The index of the constant pool item that contains the name of the source
- * file from which this class was compiled.
- */
- private int sourceFile;
-
- /**
- * The SourceDebug attribute of this class.
- */
- private ByteVector sourceDebug;
-
- /**
- * The constant pool item that contains the name of the enclosing class of
- * this class.
- */
- private int enclosingMethodOwner;
-
- /**
- * The constant pool item that contains the name and descriptor of the
- * enclosing method of this class.
- */
- private int enclosingMethod;
-
- /**
- * The runtime visible annotations of this class.
- */
- private AnnotationWriter anns;
-
- /**
- * The runtime invisible annotations of this class.
- */
- private AnnotationWriter ianns;
-
- /**
- * The runtime visible type annotations of this class.
- */
- private AnnotationWriter tanns;
-
- /**
- * The runtime invisible type annotations of this class.
- */
- private AnnotationWriter itanns;
-
- /**
- * The non standard attributes of this class.
- */
- private Attribute attrs;
-
- /**
- * The number of entries in the InnerClasses attribute.
- */
- private int innerClassesCount;
-
- /**
- * The InnerClasses attribute.
- */
- private ByteVector innerClasses;
-
- /**
- * The number of entries in the BootstrapMethods attribute.
- */
- int bootstrapMethodsCount;
-
- /**
- * The BootstrapMethods attribute.
- */
- ByteVector bootstrapMethods;
-
- /**
- * The fields of this class. These fields are stored in a linked list of
- * {@link FieldWriter} objects, linked to each other by their
- * {@link FieldWriter#fv} field. This field stores the first element of this
- * list.
- */
- FieldWriter firstField;
-
- /**
- * The fields of this class. These fields are stored in a linked list of
- * {@link FieldWriter} objects, linked to each other by their
- * {@link FieldWriter#fv} field. This field stores the last element of this
- * list.
- */
- FieldWriter lastField;
-
- /**
- * The methods of this class. These methods are stored in a linked list of
- * {@link MethodWriter} objects, linked to each other by their
- * {@link MethodWriter#mv} field. This field stores the first element of
- * this list.
- */
- MethodWriter firstMethod;
-
- /**
- * The methods of this class. These methods are stored in a linked list of
- * {@link MethodWriter} objects, linked to each other by their
- * {@link MethodWriter#mv} field. This field stores the last element of this
- * list.
- */
- MethodWriter lastMethod;
-
- /**
- * <tt>true</tt> if the maximum stack size and number of local variables
- * must be automatically computed.
- */
- private boolean computeMaxs;
+ @Override
+ public final void visitInnerClass(
+ final String name, final String outerName, final String innerName, final int access) {
+ if (innerClasses == null) {
+ innerClasses = new ByteVector();
+ }
+ // Section 4.7.6 of the JVMS states "Every CONSTANT_Class_info entry in the constant_pool table
+ // which represents a class or interface C that is not a package member must have exactly one
+ // corresponding entry in the classes array". To avoid duplicates we keep track in the info
+ // field of the Symbol of each CONSTANT_Class_info entry C whether an inner class entry has
+ // already been added for C. If so, we store the index of this inner class entry (plus one) in
+ // the info field. This trick allows duplicate detection in O(1) time.
+ Symbol nameSymbol = symbolTable.addConstantClass(name);
+ if (nameSymbol.info == 0) {
+ ++numberOfInnerClasses;
+ innerClasses.putShort(nameSymbol.index);
+ innerClasses.putShort(outerName == null ? 0 : symbolTable.addConstantClass(outerName).index);
+ innerClasses.putShort(innerName == null ? 0 : symbolTable.addConstantUtf8(innerName));
+ innerClasses.putShort(access);
+ nameSymbol.info = numberOfInnerClasses;
+ }
+ // Else, compare the inner classes entry nameSymbol.info - 1 with the arguments of this method
+ // and throw an exception if there is a difference?
+ }
- /**
- * <tt>true</tt> if the stack map frames must be recomputed from scratch.
- */
- private boolean computeFrames;
+ @Override
+ public final FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String descriptor,
+ final String signature,
+ final Object value) {
+ FieldWriter fieldWriter =
+ new FieldWriter(symbolTable, access, name, descriptor, signature, value);
+ if (firstField == null) {
+ firstField = fieldWriter;
+ } else {
+ lastField.fv = fieldWriter;
+ }
+ return lastField = fieldWriter;
+ }
- /**
- * <tt>true</tt> if the stack map tables of this class are invalid. The
- * {@link MethodWriter#resizeInstructions} method cannot transform existing
- * stack map tables, and so produces potentially invalid classes when it is
- * executed. In this case the class is reread and rewritten with the
- * {@link #COMPUTE_FRAMES} option (the resizeInstructions method can resize
- * stack map tables when this option is used).
- */
- boolean invalidFrames;
+ @Override
+ public final MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String descriptor,
+ final String signature,
+ final String[] exceptions) {
+ MethodWriter methodWriter =
+ new MethodWriter(symbolTable, access, name, descriptor, signature, exceptions, compute);
+ if (firstMethod == null) {
+ firstMethod = methodWriter;
+ } else {
+ lastMethod.mv = methodWriter;
+ }
+ return lastMethod = methodWriter;
+ }
- // ------------------------------------------------------------------------
- // Static initializer
- // ------------------------------------------------------------------------
+ @Override
+ public final void visitEnd() {
+ // Nothing to do.
+ }
- /**
- * Computes the instruction types of JVM opcodes.
- */
- static {
- int i;
- byte[] b = new byte[220];
- String s = "AAAAAAAAAAAAAAAABCLMMDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADD"
- + "DDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
- + "AAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAJJJJJJJJJJJJJJJJDOPAA"
- + "AAAAGGGGGGGHIFBFAAFFAARQJJKKJJJJJJJJJJJJJJJJJJ";
- for (i = 0; i < b.length; ++i) {
- b[i] = (byte) (s.charAt(i) - 'A');
- }
- TYPE = b;
+ // -----------------------------------------------------------------------------------------------
+ // Other public methods
+ // -----------------------------------------------------------------------------------------------
- // code to generate the above string
- //
- // // SBYTE_INSN instructions
- // b[Constants.NEWARRAY] = SBYTE_INSN;
- // b[Constants.BIPUSH] = SBYTE_INSN;
- //
- // // SHORT_INSN instructions
- // b[Constants.SIPUSH] = SHORT_INSN;
- //
- // // (IMPL)VAR_INSN instructions
- // b[Constants.RET] = VAR_INSN;
- // for (i = Constants.ILOAD; i <= Constants.ALOAD; ++i) {
- // b[i] = VAR_INSN;
- // }
- // for (i = Constants.ISTORE; i <= Constants.ASTORE; ++i) {
- // b[i] = VAR_INSN;
- // }
- // for (i = 26; i <= 45; ++i) { // ILOAD_0 to ALOAD_3
- // b[i] = IMPLVAR_INSN;
- // }
- // for (i = 59; i <= 78; ++i) { // ISTORE_0 to ASTORE_3
- // b[i] = IMPLVAR_INSN;
- // }
- //
- // // TYPE_INSN instructions
- // b[Constants.NEW] = TYPE_INSN;
- // b[Constants.ANEWARRAY] = TYPE_INSN;
- // b[Constants.CHECKCAST] = TYPE_INSN;
- // b[Constants.INSTANCEOF] = TYPE_INSN;
- //
- // // (Set)FIELDORMETH_INSN instructions
- // for (i = Constants.GETSTATIC; i <= Constants.INVOKESTATIC; ++i) {
- // b[i] = FIELDORMETH_INSN;
- // }
- // b[Constants.INVOKEINTERFACE] = ITFMETH_INSN;
- // b[Constants.INVOKEDYNAMIC] = INDYMETH_INSN;
- //
- // // LABEL(W)_INSN instructions
- // for (i = Constants.IFEQ; i <= Constants.JSR; ++i) {
- // b[i] = LABEL_INSN;
- // }
- // b[Constants.IFNULL] = LABEL_INSN;
- // b[Constants.IFNONNULL] = LABEL_INSN;
- // b[200] = LABELW_INSN; // GOTO_W
- // b[201] = LABELW_INSN; // JSR_W
- // // temporary opcodes used internally by ASM - see Label and
- // MethodWriter
- // for (i = 202; i < 220; ++i) {
- // b[i] = LABEL_INSN;
- // }
- //
- // // LDC(_W) instructions
- // b[Constants.LDC] = LDC_INSN;
- // b[19] = LDCW_INSN; // LDC_W
- // b[20] = LDCW_INSN; // LDC2_W
- //
- // // special instructions
- // b[Constants.IINC] = IINC_INSN;
- // b[Constants.TABLESWITCH] = TABL_INSN;
- // b[Constants.LOOKUPSWITCH] = LOOK_INSN;
- // b[Constants.MULTIANEWARRAY] = MANA_INSN;
- // b[196] = WIDE_INSN; // WIDE
- //
- // for (i = 0; i < b.length; ++i) {
- // System.err.print((char)('A' + b[i]));
- // }
- // System.err.println();
+ /**
+ * Returns the content of the class file that was built by this ClassWriter.
+ *
+ * @return the binary content of the JVMS ClassFile structure that was built by this ClassWriter.
+ * @throws ClassTooLargeException if the constant pool of the class is too large.
+ * @throws MethodTooLargeException if the Code attribute of a method is too large.
+ */
+ public byte[] toByteArray() {
+ // First step: compute the size in bytes of the ClassFile structure.
+ // The magic field uses 4 bytes, 10 mandatory fields (minor_version, major_version,
+ // constant_pool_count, access_flags, this_class, super_class, interfaces_count, fields_count,
+ // methods_count and attributes_count) use 2 bytes each, and each interface uses 2 bytes too.
+ int size = 24 + 2 * interfaceCount;
+ int fieldsCount = 0;
+ FieldWriter fieldWriter = firstField;
+ while (fieldWriter != null) {
+ ++fieldsCount;
+ size += fieldWriter.computeFieldInfoSize();
+ fieldWriter = (FieldWriter) fieldWriter.fv;
+ }
+ int methodsCount = 0;
+ MethodWriter methodWriter = firstMethod;
+ while (methodWriter != null) {
+ ++methodsCount;
+ size += methodWriter.computeMethodInfoSize();
+ methodWriter = (MethodWriter) methodWriter.mv;
+ }
+ // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
+ int attributesCount = 0;
+ if (innerClasses != null) {
+ ++attributesCount;
+ size += 8 + innerClasses.length;
+ symbolTable.addConstantUtf8(Constants.INNER_CLASSES);
+ }
+ if (enclosingClassIndex != 0) {
+ ++attributesCount;
+ size += 10;
+ symbolTable.addConstantUtf8(Constants.ENCLOSING_METHOD);
+ }
+ if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && (version & 0xFFFF) < Opcodes.V1_5) {
+ ++attributesCount;
+ size += 6;
+ symbolTable.addConstantUtf8(Constants.SYNTHETIC);
+ }
+ if (signatureIndex != 0) {
+ ++attributesCount;
+ size += 8;
+ symbolTable.addConstantUtf8(Constants.SIGNATURE);
+ }
+ if (sourceFileIndex != 0) {
+ ++attributesCount;
+ size += 8;
+ symbolTable.addConstantUtf8(Constants.SOURCE_FILE);
+ }
+ if (debugExtension != null) {
+ ++attributesCount;
+ size += 6 + debugExtension.length;
+ symbolTable.addConstantUtf8(Constants.SOURCE_DEBUG_EXTENSION);
+ }
+ if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
+ ++attributesCount;
+ size += 6;
+ symbolTable.addConstantUtf8(Constants.DEPRECATED);
+ }
+ if (lastRuntimeVisibleAnnotation != null) {
+ ++attributesCount;
+ size +=
+ lastRuntimeVisibleAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_VISIBLE_ANNOTATIONS);
+ }
+ if (lastRuntimeInvisibleAnnotation != null) {
+ ++attributesCount;
+ size +=
+ lastRuntimeInvisibleAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_INVISIBLE_ANNOTATIONS);
+ }
+ if (lastRuntimeVisibleTypeAnnotation != null) {
+ ++attributesCount;
+ size +=
+ lastRuntimeVisibleTypeAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS);
+ }
+ if (lastRuntimeInvisibleTypeAnnotation != null) {
+ ++attributesCount;
+ size +=
+ lastRuntimeInvisibleTypeAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS);
+ }
+ if (symbolTable.computeBootstrapMethodsSize() > 0) {
+ ++attributesCount;
+ size += symbolTable.computeBootstrapMethodsSize();
+ }
+ if (moduleWriter != null) {
+ attributesCount += moduleWriter.getAttributeCount();
+ size += moduleWriter.computeAttributesSize();
+ }
+ if (nestHostClassIndex != 0) {
+ ++attributesCount;
+ size += 8;
+ symbolTable.addConstantUtf8(Constants.NEST_HOST);
+ }
+ if (nestMemberClasses != null) {
+ ++attributesCount;
+ size += 8 + nestMemberClasses.length;
+ symbolTable.addConstantUtf8(Constants.NEST_MEMBERS);
+ }
+ if (firstAttribute != null) {
+ attributesCount += firstAttribute.getAttributeCount();
+ size += firstAttribute.computeAttributesSize(symbolTable);
+ }
+ // IMPORTANT: this must be the last part of the ClassFile size computation, because the previous
+ // statements can add attribute names to the constant pool, thereby changing its size!
+ size += symbolTable.getConstantPoolLength();
+ int constantPoolCount = symbolTable.getConstantPoolCount();
+ if (constantPoolCount > 0xFFFF) {
+ throw new ClassTooLargeException(symbolTable.getClassName(), constantPoolCount);
}
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
-
- /**
- * Constructs a new {@link ClassWriter} object.
- *
- * @param flags
- * option flags that can be used to modify the default behavior
- * of this class. See {@link #COMPUTE_MAXS},
- * {@link #COMPUTE_FRAMES}.
- */
- public ClassWriter(final int flags) {
- super(Opcodes.ASM5);
- index = 1;
- pool = new ByteVector();
- items = new Item[256];
- threshold = (int) (0.75d * items.length);
- key = new Item();
- key2 = new Item();
- key3 = new Item();
- key4 = new Item();
- this.computeMaxs = (flags & COMPUTE_MAXS) != 0;
- this.computeFrames = (flags & COMPUTE_FRAMES) != 0;
+ // Second step: allocate a ByteVector of the correct size (in order to avoid any array copy in
+ // dynamic resizes) and fill it with the ClassFile content.
+ ByteVector result = new ByteVector(size);
+ result.putInt(0xCAFEBABE).putInt(version);
+ symbolTable.putConstantPool(result);
+ int mask = (version & 0xFFFF) < Opcodes.V1_5 ? Opcodes.ACC_SYNTHETIC : 0;
+ result.putShort(accessFlags & ~mask).putShort(thisClass).putShort(superClass);
+ result.putShort(interfaceCount);
+ for (int i = 0; i < interfaceCount; ++i) {
+ result.putShort(interfaces[i]);
+ }
+ result.putShort(fieldsCount);
+ fieldWriter = firstField;
+ while (fieldWriter != null) {
+ fieldWriter.putFieldInfo(result);
+ fieldWriter = (FieldWriter) fieldWriter.fv;
+ }
+ result.putShort(methodsCount);
+ boolean hasFrames = false;
+ boolean hasAsmInstructions = false;
+ methodWriter = firstMethod;
+ while (methodWriter != null) {
+ hasFrames |= methodWriter.hasFrames();
+ hasAsmInstructions |= methodWriter.hasAsmInstructions();
+ methodWriter.putMethodInfo(result);
+ methodWriter = (MethodWriter) methodWriter.mv;
+ }
+ // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
+ result.putShort(attributesCount);
+ if (innerClasses != null) {
+ result
+ .putShort(symbolTable.addConstantUtf8(Constants.INNER_CLASSES))
+ .putInt(innerClasses.length + 2)
+ .putShort(numberOfInnerClasses)
+ .putByteArray(innerClasses.data, 0, innerClasses.length);
+ }
+ if (enclosingClassIndex != 0) {
+ result
+ .putShort(symbolTable.addConstantUtf8(Constants.ENCLOSING_METHOD))
+ .putInt(4)
+ .putShort(enclosingClassIndex)
+ .putShort(enclosingMethodIndex);
+ }
+ if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && (version & 0xFFFF) < Opcodes.V1_5) {
+ result.putShort(symbolTable.addConstantUtf8(Constants.SYNTHETIC)).putInt(0);
+ }
+ if (signatureIndex != 0) {
+ result
+ .putShort(symbolTable.addConstantUtf8(Constants.SIGNATURE))
+ .putInt(2)
+ .putShort(signatureIndex);
+ }
+ if (sourceFileIndex != 0) {
+ result
+ .putShort(symbolTable.addConstantUtf8(Constants.SOURCE_FILE))
+ .putInt(2)
+ .putShort(sourceFileIndex);
+ }
+ if (debugExtension != null) {
+ int length = debugExtension.length;
+ result
+ .putShort(symbolTable.addConstantUtf8(Constants.SOURCE_DEBUG_EXTENSION))
+ .putInt(length)
+ .putByteArray(debugExtension.data, 0, length);
+ }
+ if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
+ result.putShort(symbolTable.addConstantUtf8(Constants.DEPRECATED)).putInt(0);
+ }
+ AnnotationWriter.putAnnotations(
+ symbolTable,
+ lastRuntimeVisibleAnnotation,
+ lastRuntimeInvisibleAnnotation,
+ lastRuntimeVisibleTypeAnnotation,
+ lastRuntimeInvisibleTypeAnnotation,
+ result);
+ symbolTable.putBootstrapMethods(result);
+ if (moduleWriter != null) {
+ moduleWriter.putAttributes(result);
+ }
+ if (nestHostClassIndex != 0) {
+ result
+ .putShort(symbolTable.addConstantUtf8(Constants.NEST_HOST))
+ .putInt(2)
+ .putShort(nestHostClassIndex);
+ }
+ if (nestMemberClasses != null) {
+ result
+ .putShort(symbolTable.addConstantUtf8(Constants.NEST_MEMBERS))
+ .putInt(nestMemberClasses.length + 2)
+ .putShort(numberOfNestMemberClasses)
+ .putByteArray(nestMemberClasses.data, 0, nestMemberClasses.length);
+ }
+ if (firstAttribute != null) {
+ firstAttribute.putAttributes(symbolTable, result);
}
- /**
- * Constructs a new {@link ClassWriter} object and enables optimizations for
- * "mostly add" bytecode transformations. These optimizations are the
- * following:
- *
- * <ul>
- * <li>The constant pool from the original class is copied as is in the new
- * class, which saves time. New constant pool entries will be added at the
- * end if necessary, but unused constant pool entries <i>won't be
- * removed</i>.</li>
- * <li>Methods that are not transformed are copied as is in the new class,
- * directly from the original class bytecode (i.e. without emitting visit
- * events for all the method instructions), which saves a <i>lot</i> of
- * time. Untransformed methods are detected by the fact that the
- * {@link ClassReader} receives {@link MethodVisitor} objects that come from
- * a {@link ClassWriter} (and not from any other {@link ClassVisitor}
- * instance).</li>
- * </ul>
- *
- * @param classReader
- * the {@link ClassReader} used to read the original class. It
- * will be used to copy the entire constant pool 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. <i>These option flags do not affect methods
- * that are copied as is in the new class. This means that the
- * maximum stack size nor the stack frames will be computed for
- * these methods</i>. See {@link #COMPUTE_MAXS},
- * {@link #COMPUTE_FRAMES}.
- */
- public ClassWriter(final ClassReader classReader, final int flags) {
- this(flags);
- classReader.copyPool(this);
- this.cr = classReader;
+ // Third step: replace the ASM specific instructions, if any.
+ if (hasAsmInstructions) {
+ return replaceAsmInstructions(result.data, hasFrames);
+ } else {
+ return result.data;
}
+ }
- // ------------------------------------------------------------------------
- // Implementation of the ClassVisitor abstract class
- // ------------------------------------------------------------------------
+ /**
+ * Returns the equivalent of the given class file, with the ASM specific instructions replaced
+ * with standard ones. This is done with a ClassReader -> ClassWriter round trip.
+ *
+ * @param classFile a class file containing ASM specific instructions, generated by this
+ * ClassWriter.
+ * @param hasFrames whether there is at least one stack map frames in 'classFile'.
+ * @return an equivalent of 'classFile', with the ASM specific instructions replaced with standard
+ * ones.
+ */
+ private byte[] replaceAsmInstructions(final byte[] classFile, final boolean hasFrames) {
+ final Attribute[] attributes = getAttributePrototypes();
+ firstField = null;
+ lastField = null;
+ firstMethod = null;
+ lastMethod = null;
+ lastRuntimeVisibleAnnotation = null;
+ lastRuntimeInvisibleAnnotation = null;
+ lastRuntimeVisibleTypeAnnotation = null;
+ lastRuntimeInvisibleTypeAnnotation = null;
+ moduleWriter = null;
+ nestHostClassIndex = 0;
+ numberOfNestMemberClasses = 0;
+ nestMemberClasses = null;
+ firstAttribute = null;
+ compute = hasFrames ? MethodWriter.COMPUTE_INSERTED_FRAMES : MethodWriter.COMPUTE_NOTHING;
+ new ClassReader(classFile, 0, /* checkClassVersion = */ false)
+ .accept(
+ this,
+ attributes,
+ (hasFrames ? ClassReader.EXPAND_FRAMES : 0) | ClassReader.EXPAND_ASM_INSNS);
+ return toByteArray();
+ }
- @Override
- public final void visit(final int version, final int access,
- final String name, final String signature, final String superName,
- final String[] interfaces) {
- this.version = version;
- this.access = access;
- this.name = newClass(name);
- thisName = name;
- if (ClassReader.SIGNATURES && signature != null) {
- this.signature = newUTF8(signature);
- }
- this.superName = superName == null ? 0 : newClass(superName);
- if (interfaces != null && interfaces.length > 0) {
- interfaceCount = interfaces.length;
- this.interfaces = new int[interfaceCount];
- for (int i = 0; i < interfaceCount; ++i) {
- this.interfaces[i] = newClass(interfaces[i]);
- }
- }
+ /**
+ * Returns the prototypes of the attributes used by this class, its fields and its methods.
+ *
+ * @return the prototypes of the attributes used by this class, its fields and its methods.
+ */
+ private Attribute[] getAttributePrototypes() {
+ Attribute.Set attributePrototypes = new Attribute.Set();
+ attributePrototypes.addAttributes(firstAttribute);
+ FieldWriter fieldWriter = firstField;
+ while (fieldWriter != null) {
+ fieldWriter.collectAttributePrototypes(attributePrototypes);
+ fieldWriter = (FieldWriter) fieldWriter.fv;
}
-
- @Override
- public final void visitSource(final String file, final String debug) {
- if (file != null) {
- sourceFile = newUTF8(file);
- }
- if (debug != null) {
- sourceDebug = new ByteVector().encodeUTF8(debug, 0,
- Integer.MAX_VALUE);
- }
+ MethodWriter methodWriter = firstMethod;
+ while (methodWriter != null) {
+ methodWriter.collectAttributePrototypes(attributePrototypes);
+ methodWriter = (MethodWriter) methodWriter.mv;
}
+ return attributePrototypes.toArray();
+ }
- @Override
- public final void visitOuterClass(final String owner, final String name,
- final String desc) {
- enclosingMethodOwner = newClass(owner);
- if (name != null && desc != null) {
- enclosingMethod = newNameType(name, desc);
- }
+ // -----------------------------------------------------------------------------------------------
+ // Utility methods: constant pool management for Attribute sub classes
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Adds a number or string constant to the constant pool of the class being build. Does nothing if
+ * the constant pool already contains a similar item. <i>This method is intended for {@link
+ * Attribute} sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param value the value of the constant to be added to the constant pool. This parameter must be
+ * an {@link Integer}, a {@link Float}, a {@link Long}, a {@link Double} or a {@link String}.
+ * @return the index of a new or already existing constant item with the given value.
+ */
+ public int newConst(final Object value) {
+ return symbolTable.addConstant(value).index;
+ }
+
+ /**
+ * Adds an UTF8 string to the constant pool of the class being build. Does nothing if the constant
+ * pool already contains a similar item. <i>This method is intended for {@link Attribute} sub
+ * classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param value the String value.
+ * @return the index of a new or already existing UTF8 item.
+ */
+ // DontCheck(AbbreviationAsWordInName): can't be renamed (for backward binary compatibility).
+ public int newUTF8(final String value) {
+ return symbolTable.addConstantUtf8(value);
+ }
+
+ /**
+ * Adds a class reference to the constant pool of the class being build. Does nothing if the
+ * constant pool already contains a similar item. <i>This method is intended for {@link Attribute}
+ * sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param value the internal name of the class.
+ * @return the index of a new or already existing class reference item.
+ */
+ public int newClass(final String value) {
+ return symbolTable.addConstantClass(value).index;
+ }
+
+ /**
+ * Adds a method type reference to the constant pool of the class being build. Does nothing if the
+ * constant pool already contains a similar item. <i>This method is intended for {@link Attribute}
+ * sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param methodDescriptor method descriptor of the method type.
+ * @return the index of a new or already existing method type reference item.
+ */
+ public int newMethodType(final String methodDescriptor) {
+ return symbolTable.addConstantMethodType(methodDescriptor).index;
+ }
+
+ /**
+ * Adds a module reference to the constant pool of the class being build. Does nothing if the
+ * constant pool already contains a similar item. <i>This method is intended for {@link Attribute}
+ * sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param moduleName name of the module.
+ * @return the index of a new or already existing module reference item.
+ */
+ public int newModule(final String moduleName) {
+ return symbolTable.addConstantModule(moduleName).index;
+ }
+
+ /**
+ * Adds a package reference to the constant pool of the class being build. Does nothing if the
+ * constant pool already contains a similar item. <i>This method is intended for {@link Attribute}
+ * sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param packageName name of the package in its internal form.
+ * @return the index of a new or already existing module reference item.
+ */
+ public int newPackage(final String packageName) {
+ return symbolTable.addConstantPackage(packageName).index;
+ }
+
+ /**
+ * Adds a handle to the constant pool of the class being build. Does nothing if the constant pool
+ * already contains a similar item. <i>This method is intended for {@link Attribute} sub classes,
+ * and is normally not needed by class generators or adapters.</i>
+ *
+ * @param tag the kind of this handle. Must be {@link Opcodes#H_GETFIELD}, {@link
+ * Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, {@link
+ * Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC}, {@link Opcodes#H_INVOKESPECIAL},
+ * {@link Opcodes#H_NEWINVOKESPECIAL} or {@link Opcodes#H_INVOKEINTERFACE}.
+ * @param owner the internal name of the field or method owner class.
+ * @param name the name of the field or method.
+ * @param descriptor the descriptor of the field or method.
+ * @return the index of a new or already existing method type reference item.
+ * @deprecated this method is superseded by {@link #newHandle(int, String, String, String,
+ * boolean)}.
+ */
+ @Deprecated
+ public int newHandle(
+ final int tag, final String owner, final String name, final String descriptor) {
+ return newHandle(tag, owner, name, descriptor, tag == Opcodes.H_INVOKEINTERFACE);
+ }
+
+ /**
+ * Adds a handle to the constant pool of the class being build. Does nothing if the constant pool
+ * already contains a similar item. <i>This method is intended for {@link Attribute} sub classes,
+ * and is normally not needed by class generators or adapters.</i>
+ *
+ * @param tag the kind of this handle. Must be {@link Opcodes#H_GETFIELD}, {@link
+ * Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, {@link
+ * Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC}, {@link Opcodes#H_INVOKESPECIAL},
+ * {@link Opcodes#H_NEWINVOKESPECIAL} or {@link Opcodes#H_INVOKEINTERFACE}.
+ * @param owner the internal name of the field or method owner class.
+ * @param name the name of the field or method.
+ * @param descriptor the descriptor of the field or method.
+ * @param isInterface true if the owner is an interface.
+ * @return the index of a new or already existing method type reference item.
+ */
+ public int newHandle(
+ final int tag,
+ final String owner,
+ final String name,
+ final String descriptor,
+ final boolean isInterface) {
+ return symbolTable.addConstantMethodHandle(tag, owner, name, descriptor, isInterface).index;
+ }
+
+ /**
+ * Adds a dynamic constant reference to the constant pool of the class being build. Does nothing
+ * if the constant pool already contains a similar item. <i>This method is intended for {@link
+ * Attribute} sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param name name of the invoked method.
+ * @param descriptor field descriptor of the constant type.
+ * @param bootstrapMethodHandle the bootstrap method.
+ * @param bootstrapMethodArguments the bootstrap method constant arguments.
+ * @return the index of a new or already existing dynamic constant reference item.
+ */
+ public int newConstantDynamic(
+ final String name,
+ final String descriptor,
+ final Handle bootstrapMethodHandle,
+ final Object... bootstrapMethodArguments) {
+ return symbolTable.addConstantDynamic(
+ name, descriptor, bootstrapMethodHandle, bootstrapMethodArguments)
+ .index;
+ }
+
+ /**
+ * Adds an invokedynamic reference to the constant pool of the class being build. Does nothing if
+ * the constant pool already contains a similar item. <i>This method is intended for {@link
+ * Attribute} sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param name name of the invoked method.
+ * @param descriptor descriptor of the invoke method.
+ * @param bootstrapMethodHandle the bootstrap method.
+ * @param bootstrapMethodArguments the bootstrap method constant arguments.
+ * @return the index of a new or already existing invokedynamic reference item.
+ */
+ public int newInvokeDynamic(
+ final String name,
+ final String descriptor,
+ final Handle bootstrapMethodHandle,
+ final Object... bootstrapMethodArguments) {
+ return symbolTable.addConstantInvokeDynamic(
+ name, descriptor, bootstrapMethodHandle, bootstrapMethodArguments)
+ .index;
+ }
+
+ /**
+ * Adds a field reference to the constant pool of the class being build. Does nothing if the
+ * constant pool already contains a similar item. <i>This method is intended for {@link Attribute}
+ * sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param owner the internal name of the field's owner class.
+ * @param name the field's name.
+ * @param descriptor the field's descriptor.
+ * @return the index of a new or already existing field reference item.
+ */
+ public int newField(final String owner, final String name, final String descriptor) {
+ return symbolTable.addConstantFieldref(owner, name, descriptor).index;
+ }
+
+ /**
+ * Adds a method reference to the constant pool of the class being build. Does nothing if the
+ * constant pool already contains a similar item. <i>This method is intended for {@link Attribute}
+ * sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param owner the internal name of the method's owner class.
+ * @param name the method's name.
+ * @param descriptor the method's descriptor.
+ * @param isInterface {@literal true} if {@code owner} is an interface.
+ * @return the index of a new or already existing method reference item.
+ */
+ public int newMethod(
+ final String owner, final String name, final String descriptor, final boolean isInterface) {
+ return symbolTable.addConstantMethodref(owner, name, descriptor, isInterface).index;
+ }
+
+ /**
+ * Adds a name and type to the constant pool of the class being build. Does nothing if the
+ * constant pool already contains a similar item. <i>This method is intended for {@link Attribute}
+ * sub classes, and is normally not needed by class generators or adapters.</i>
+ *
+ * @param name a name.
+ * @param descriptor a type descriptor.
+ * @return the index of a new or already existing name and type item.
+ */
+ public int newNameType(final String name, final String descriptor) {
+ return symbolTable.addConstantNameAndType(name, descriptor);
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Default method to compute common super classes when computing stack map frames
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the common super type of the two given types. The default implementation of this method
+ * <i>loads</i> the two given classes and uses the java.lang.Class methods to find the common
+ * super class. It can be overridden to compute this common super type in other ways, in
+ * particular without actually loading any class, or to take into account the class that is
+ * currently being generated by this ClassWriter, which can of course not be loaded since it is
+ * under construction.
+ *
+ * @param type1 the internal name of a class.
+ * @param type2 the internal name of another class.
+ * @return the internal name of the common super class of the two given classes.
+ */
+ protected String getCommonSuperClass(final String type1, final String type2) {
+ ClassLoader classLoader = getClassLoader();
+ Class<?> class1;
+ try {
+ class1 = Class.forName(type1.replace('/', '.'), false, classLoader);
+ } catch (ClassNotFoundException e) {
+ throw new TypeNotPresentException(type1, e);
}
-
- @Override
- public final AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- // write type, and reserve space for values count
- bv.putShort(newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(this, true, bv, bv, 2);
- if (visible) {
- aw.next = anns;
- anns = aw;
- } else {
- aw.next = ianns;
- ianns = aw;
- }
- return aw;
+ Class<?> class2;
+ try {
+ class2 = Class.forName(type2.replace('/', '.'), false, classLoader);
+ } catch (ClassNotFoundException e) {
+ throw new TypeNotPresentException(type2, e);
}
-
- @Override
- public final AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, final String desc, final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- // write target_type and target_info
- AnnotationWriter.putTarget(typeRef, typePath, bv);
- // write type, and reserve space for values count
- bv.putShort(newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(this, true, bv, bv,
- bv.length - 2);
- if (visible) {
- aw.next = tanns;
- tanns = aw;
- } else {
- aw.next = itanns;
- itanns = aw;
- }
- return aw;
+ if (class1.isAssignableFrom(class2)) {
+ return type1;
}
-
- @Override
- public final void visitAttribute(final Attribute attr) {
- attr.next = attrs;
- attrs = attr;
+ if (class2.isAssignableFrom(class1)) {
+ return type2;
}
-
- @Override
- public final void visitInnerClass(final String name,
- final String outerName, final String innerName, final int access) {
- if (innerClasses == null) {
- innerClasses = new ByteVector();
- }
- // Sec. 4.7.6 of the JVMS states "Every CONSTANT_Class_info entry in the
- // constant_pool table which represents a class or interface C that is
- // not a package member must have exactly one corresponding entry in the
- // classes array". To avoid duplicates we keep track in the intVal field
- // of the Item of each CONSTANT_Class_info entry C whether an inner
- // class entry has already been added for C (this field is unused for
- // class entries, and changing its value does not change the hashcode
- // and equality tests). If so we store the index of this inner class
- // entry (plus one) in intVal. This hack allows duplicate detection in
- // O(1) time.
- Item nameItem = newClassItem(name);
- if (nameItem.intVal == 0) {
- ++innerClassesCount;
- innerClasses.putShort(nameItem.index);
- innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
- innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
- innerClasses.putShort(access);
- nameItem.intVal = innerClassesCount;
- } else {
- // Compare the inner classes entry nameItem.intVal - 1 with the
- // arguments of this method and throw an exception if there is a
- // difference?
- }
+ if (class1.isInterface() || class2.isInterface()) {
+ return "java/lang/Object";
+ } else {
+ do {
+ class1 = class1.getSuperclass();
+ } while (!class1.isAssignableFrom(class2));
+ return class1.getName().replace('.', '/');
}
+ }
- @Override
- public final FieldVisitor visitField(final int access, final String name,
- final String desc, final String signature, final Object value) {
- return new FieldWriter(this, access, name, desc, signature, value);
- }
-
- @Override
- public final MethodVisitor visitMethod(final int access, final String name,
- final String desc, final String signature, final String[] exceptions) {
- return new MethodWriter(this, access, name, desc, signature,
- exceptions, computeMaxs, computeFrames);
- }
-
- @Override
- public final void visitEnd() {
- }
-
- // ------------------------------------------------------------------------
- // Other public methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns the bytecode of the class that was build with this class writer.
- *
- * @return the bytecode of the class that was build with this class writer.
- */
- public byte[] toByteArray() {
- if (index > 0xFFFF) {
- throw new RuntimeException("Class file too large!");
- }
- // computes the real size of the bytecode of this class
- int size = 24 + 2 * interfaceCount;
- int nbFields = 0;
- FieldWriter fb = firstField;
- while (fb != null) {
- ++nbFields;
- size += fb.getSize();
- fb = (FieldWriter) fb.fv;
- }
- int nbMethods = 0;
- MethodWriter mb = firstMethod;
- while (mb != null) {
- ++nbMethods;
- size += mb.getSize();
- mb = (MethodWriter) mb.mv;
- }
- int attributeCount = 0;
- if (bootstrapMethods != null) {
- // we put it as first attribute in order to improve a bit
- // ClassReader.copyBootstrapMethods
- ++attributeCount;
- size += 8 + bootstrapMethods.length;
- newUTF8("BootstrapMethods");
- }
- if (ClassReader.SIGNATURES && signature != 0) {
- ++attributeCount;
- size += 8;
- newUTF8("Signature");
- }
- if (sourceFile != 0) {
- ++attributeCount;
- size += 8;
- newUTF8("SourceFile");
- }
- if (sourceDebug != null) {
- ++attributeCount;
- size += sourceDebug.length + 6;
- newUTF8("SourceDebugExtension");
- }
- if (enclosingMethodOwner != 0) {
- ++attributeCount;
- size += 10;
- newUTF8("EnclosingMethod");
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- ++attributeCount;
- size += 6;
- newUTF8("Deprecated");
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- if ((version & 0xFFFF) < Opcodes.V1_5
- || (access & ACC_SYNTHETIC_ATTRIBUTE) != 0) {
- ++attributeCount;
- size += 6;
- newUTF8("Synthetic");
- }
- }
- if (innerClasses != null) {
- ++attributeCount;
- size += 8 + innerClasses.length;
- newUTF8("InnerClasses");
- }
- if (ClassReader.ANNOTATIONS && anns != null) {
- ++attributeCount;
- size += 8 + anns.getSize();
- newUTF8("RuntimeVisibleAnnotations");
- }
- if (ClassReader.ANNOTATIONS && ianns != null) {
- ++attributeCount;
- size += 8 + ianns.getSize();
- newUTF8("RuntimeInvisibleAnnotations");
- }
- if (ClassReader.ANNOTATIONS && tanns != null) {
- ++attributeCount;
- size += 8 + tanns.getSize();
- newUTF8("RuntimeVisibleTypeAnnotations");
- }
- if (ClassReader.ANNOTATIONS && itanns != null) {
- ++attributeCount;
- size += 8 + itanns.getSize();
- newUTF8("RuntimeInvisibleTypeAnnotations");
- }
- if (attrs != null) {
- attributeCount += attrs.getCount();
- size += attrs.getSize(this, null, 0, -1, -1);
- }
- size += pool.length;
- // allocates a byte vector of this size, in order to avoid unnecessary
- // arraycopy operations in the ByteVector.enlarge() method
- ByteVector out = new ByteVector(size);
- out.putInt(0xCAFEBABE).putInt(version);
- out.putShort(index).putByteArray(pool.data, 0, pool.length);
- int mask = Opcodes.ACC_DEPRECATED | ACC_SYNTHETIC_ATTRIBUTE
- | ((access & ACC_SYNTHETIC_ATTRIBUTE) / TO_ACC_SYNTHETIC);
- out.putShort(access & ~mask).putShort(name).putShort(superName);
- out.putShort(interfaceCount);
- for (int i = 0; i < interfaceCount; ++i) {
- out.putShort(interfaces[i]);
- }
- out.putShort(nbFields);
- fb = firstField;
- while (fb != null) {
- fb.put(out);
- fb = (FieldWriter) fb.fv;
- }
- out.putShort(nbMethods);
- mb = firstMethod;
- while (mb != null) {
- mb.put(out);
- mb = (MethodWriter) mb.mv;
- }
- out.putShort(attributeCount);
- if (bootstrapMethods != null) {
- out.putShort(newUTF8("BootstrapMethods"));
- out.putInt(bootstrapMethods.length + 2).putShort(
- bootstrapMethodsCount);
- out.putByteArray(bootstrapMethods.data, 0, bootstrapMethods.length);
- }
- if (ClassReader.SIGNATURES && signature != 0) {
- out.putShort(newUTF8("Signature")).putInt(2).putShort(signature);
- }
- if (sourceFile != 0) {
- out.putShort(newUTF8("SourceFile")).putInt(2).putShort(sourceFile);
- }
- if (sourceDebug != null) {
- int len = sourceDebug.length;
- out.putShort(newUTF8("SourceDebugExtension")).putInt(len);
- out.putByteArray(sourceDebug.data, 0, len);
- }
- if (enclosingMethodOwner != 0) {
- out.putShort(newUTF8("EnclosingMethod")).putInt(4);
- out.putShort(enclosingMethodOwner).putShort(enclosingMethod);
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- out.putShort(newUTF8("Deprecated")).putInt(0);
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- if ((version & 0xFFFF) < Opcodes.V1_5
- || (access & ACC_SYNTHETIC_ATTRIBUTE) != 0) {
- out.putShort(newUTF8("Synthetic")).putInt(0);
- }
- }
- if (innerClasses != null) {
- out.putShort(newUTF8("InnerClasses"));
- out.putInt(innerClasses.length + 2).putShort(innerClassesCount);
- out.putByteArray(innerClasses.data, 0, innerClasses.length);
- }
- if (ClassReader.ANNOTATIONS && anns != null) {
- out.putShort(newUTF8("RuntimeVisibleAnnotations"));
- anns.put(out);
- }
- if (ClassReader.ANNOTATIONS && ianns != null) {
- out.putShort(newUTF8("RuntimeInvisibleAnnotations"));
- ianns.put(out);
- }
- if (ClassReader.ANNOTATIONS && tanns != null) {
- out.putShort(newUTF8("RuntimeVisibleTypeAnnotations"));
- tanns.put(out);
- }
- if (ClassReader.ANNOTATIONS && itanns != null) {
- out.putShort(newUTF8("RuntimeInvisibleTypeAnnotations"));
- itanns.put(out);
- }
- if (attrs != null) {
- attrs.put(this, null, 0, -1, -1, out);
- }
- if (invalidFrames) {
- anns = null;
- ianns = null;
- attrs = null;
- innerClassesCount = 0;
- innerClasses = null;
- bootstrapMethodsCount = 0;
- bootstrapMethods = null;
- firstField = null;
- lastField = null;
- firstMethod = null;
- lastMethod = null;
- computeMaxs = false;
- computeFrames = true;
- invalidFrames = false;
- new ClassReader(out.data).accept(this, ClassReader.SKIP_FRAMES);
- return toByteArray();
- }
- return out.data;
- }
-
- // ------------------------------------------------------------------------
- // Utility methods: constant pool management
- // ------------------------------------------------------------------------
-
- /**
- * Adds a number or string constant to the constant pool of the class being
- * build. Does nothing if the constant pool already contains a similar item.
- *
- * @param cst
- * the value of the constant to be added to the constant pool.
- * This parameter must be an {@link Integer}, a {@link Float}, a
- * {@link Long}, a {@link Double}, a {@link String} or a
- * {@link Type}.
- * @return a new or already existing constant item with the given value.
- */
- Item newConstItem(final Object cst) {
- if (cst instanceof Integer) {
- int val = ((Integer) cst).intValue();
- return newInteger(val);
- } else if (cst instanceof Byte) {
- int val = ((Byte) cst).intValue();
- return newInteger(val);
- } else if (cst instanceof Character) {
- int val = ((Character) cst).charValue();
- return newInteger(val);
- } else if (cst instanceof Short) {
- int val = ((Short) cst).intValue();
- return newInteger(val);
- } else if (cst instanceof Boolean) {
- int val = ((Boolean) cst).booleanValue() ? 1 : 0;
- return newInteger(val);
- } else if (cst instanceof Float) {
- float val = ((Float) cst).floatValue();
- return newFloat(val);
- } else if (cst instanceof Long) {
- long val = ((Long) cst).longValue();
- return newLong(val);
- } else if (cst instanceof Double) {
- double val = ((Double) cst).doubleValue();
- return newDouble(val);
- } else if (cst instanceof String) {
- return newString((String) cst);
- } else if (cst instanceof Type) {
- Type t = (Type) cst;
- int s = t.getSort();
- if (s == Type.OBJECT) {
- return newClassItem(t.getInternalName());
- } else if (s == Type.METHOD) {
- return newMethodTypeItem(t.getDescriptor());
- } else { // s == primitive type or array
- return newClassItem(t.getDescriptor());
- }
- } else if (cst instanceof Handle) {
- Handle h = (Handle) cst;
- return newHandleItem(h.tag, h.owner, h.name, h.desc);
- } else {
- throw new IllegalArgumentException("value " + cst);
- }
- }
-
- /**
- * Adds a number or string constant to the constant pool of the class being
- * build. Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param cst
- * the value of the constant to be added to the constant pool.
- * This parameter must be an {@link Integer}, a {@link Float}, a
- * {@link Long}, a {@link Double} or a {@link String}.
- * @return the index of a new or already existing constant item with the
- * given value.
- */
- public int newConst(final Object cst) {
- return newConstItem(cst).index;
- }
-
- /**
- * Adds an UTF8 string to the constant pool of the class being build. Does
- * nothing if the constant pool already contains a similar item. <i>This
- * method is intended for {@link Attribute} sub classes, and is normally not
- * needed by class generators or adapters.</i>
- *
- * @param value
- * the String value.
- * @return the index of a new or already existing UTF8 item.
- */
- public int newUTF8(final String value) {
- key.set(UTF8, value, null, null);
- Item result = get(key);
- if (result == null) {
- pool.putByte(UTF8).putUTF8(value);
- result = new Item(index++, key);
- put(result);
- }
- return result.index;
- }
-
- /**
- * Adds a class reference to the constant pool of the class being build.
- * Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param value
- * the internal name of the class.
- * @return a new or already existing class reference item.
- */
- Item newClassItem(final String value) {
- key2.set(CLASS, value, null, null);
- Item result = get(key2);
- if (result == null) {
- pool.put12(CLASS, newUTF8(value));
- result = new Item(index++, key2);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a class reference to the constant pool of the class being build.
- * Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param value
- * the internal name of the class.
- * @return the index of a new or already existing class reference item.
- */
- public int newClass(final String value) {
- return newClassItem(value).index;
- }
-
- /**
- * Adds a method type reference to the constant pool of the class being
- * build. Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param methodDesc
- * method descriptor of the method type.
- * @return a new or already existing method type reference item.
- */
- Item newMethodTypeItem(final String methodDesc) {
- key2.set(MTYPE, methodDesc, null, null);
- Item result = get(key2);
- if (result == null) {
- pool.put12(MTYPE, newUTF8(methodDesc));
- result = new Item(index++, key2);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a method type reference to the constant pool of the class being
- * build. Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param methodDesc
- * method descriptor of the method type.
- * @return the index of a new or already existing method type reference
- * item.
- */
- public int newMethodType(final String methodDesc) {
- return newMethodTypeItem(methodDesc).index;
- }
-
- /**
- * Adds a handle to the constant pool of the class being build. Does nothing
- * if the constant pool already contains a similar item. <i>This method is
- * intended for {@link Attribute} sub classes, and is normally not needed by
- * class generators or adapters.</i>
- *
- * @param tag
- * the kind of this handle. Must be {@link Opcodes#H_GETFIELD},
- * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD},
- * {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL},
- * {@link Opcodes#H_INVOKESTATIC},
- * {@link Opcodes#H_INVOKESPECIAL},
- * {@link Opcodes#H_NEWINVOKESPECIAL} or
- * {@link Opcodes#H_INVOKEINTERFACE}.
- * @param owner
- * the internal name of the field or method owner class.
- * @param name
- * the name of the field or method.
- * @param desc
- * the descriptor of the field or method.
- * @return a new or an already existing method type reference item.
- */
- Item newHandleItem(final int tag, final String owner, final String name,
- final String desc) {
- key4.set(HANDLE_BASE + tag, owner, name, desc);
- Item result = get(key4);
- if (result == null) {
- if (tag <= Opcodes.H_PUTSTATIC) {
- put112(HANDLE, tag, newField(owner, name, desc));
- } else {
- put112(HANDLE,
- tag,
- newMethod(owner, name, desc,
- tag == Opcodes.H_INVOKEINTERFACE));
- }
- result = new Item(index++, key4);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a handle to the constant pool of the class being build. Does nothing
- * if the constant pool already contains a similar item. <i>This method is
- * intended for {@link Attribute} sub classes, and is normally not needed by
- * class generators or adapters.</i>
- *
- * @param tag
- * the kind of this handle. Must be {@link Opcodes#H_GETFIELD},
- * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD},
- * {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL},
- * {@link Opcodes#H_INVOKESTATIC},
- * {@link Opcodes#H_INVOKESPECIAL},
- * {@link Opcodes#H_NEWINVOKESPECIAL} or
- * {@link Opcodes#H_INVOKEINTERFACE}.
- * @param owner
- * the internal name of the field or method owner class.
- * @param name
- * the name of the field or method.
- * @param desc
- * the descriptor of the field or method.
- * @return the index of a new or already existing method type reference
- * item.
- */
- public int newHandle(final int tag, final String owner, final String name,
- final String desc) {
- return newHandleItem(tag, owner, name, desc).index;
- }
-
- /**
- * Adds an invokedynamic reference to the constant pool of the class being
- * build. Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param name
- * name of the invoked method.
- * @param desc
- * descriptor of the invoke method.
- * @param bsm
- * the bootstrap method.
- * @param bsmArgs
- * the bootstrap method constant arguments.
- *
- * @return a new or an already existing invokedynamic type reference item.
- */
- Item newInvokeDynamicItem(final String name, final String desc,
- final Handle bsm, final Object... bsmArgs) {
- // cache for performance
- ByteVector bootstrapMethods = this.bootstrapMethods;
- if (bootstrapMethods == null) {
- bootstrapMethods = this.bootstrapMethods = new ByteVector();
- }
-
- int position = bootstrapMethods.length; // record current position
-
- int hashCode = bsm.hashCode();
- bootstrapMethods.putShort(newHandle(bsm.tag, bsm.owner, bsm.name,
- bsm.desc));
-
- int argsLength = bsmArgs.length;
- bootstrapMethods.putShort(argsLength);
-
- for (int i = 0; i < argsLength; i++) {
- Object bsmArg = bsmArgs[i];
- hashCode ^= bsmArg.hashCode();
- bootstrapMethods.putShort(newConst(bsmArg));
- }
-
- byte[] data = bootstrapMethods.data;
- int length = (1 + 1 + argsLength) << 1; // (bsm + argCount + arguments)
- hashCode &= 0x7FFFFFFF;
- Item result = items[hashCode % items.length];
- loop: while (result != null) {
- if (result.type != BSM || result.hashCode != hashCode) {
- result = result.next;
- continue;
- }
-
- // because the data encode the size of the argument
- // we don't need to test if these size are equals
- int resultPosition = result.intVal;
- for (int p = 0; p < length; p++) {
- if (data[position + p] != data[resultPosition + p]) {
- result = result.next;
- continue loop;
- }
- }
- break;
- }
-
- int bootstrapMethodIndex;
- if (result != null) {
- bootstrapMethodIndex = result.index;
- bootstrapMethods.length = position; // revert to old position
- } else {
- bootstrapMethodIndex = bootstrapMethodsCount++;
- result = new Item(bootstrapMethodIndex);
- result.set(position, hashCode);
- put(result);
- }
-
- // now, create the InvokeDynamic constant
- key3.set(name, desc, bootstrapMethodIndex);
- result = get(key3);
- if (result == null) {
- put122(INDY, bootstrapMethodIndex, newNameType(name, desc));
- result = new Item(index++, key3);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds an invokedynamic reference to the constant pool of the class being
- * build. Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param name
- * name of the invoked method.
- * @param desc
- * descriptor of the invoke method.
- * @param bsm
- * the bootstrap method.
- * @param bsmArgs
- * the bootstrap method constant arguments.
- *
- * @return the index of a new or already existing invokedynamic reference
- * item.
- */
- public int newInvokeDynamic(final String name, final String desc,
- final Handle bsm, final Object... bsmArgs) {
- return newInvokeDynamicItem(name, desc, bsm, bsmArgs).index;
- }
-
- /**
- * Adds a field reference to the constant pool of the class being build.
- * Does nothing if the constant pool already contains a similar item.
- *
- * @param owner
- * the internal name of the field's owner class.
- * @param name
- * the field's name.
- * @param desc
- * the field's descriptor.
- * @return a new or already existing field reference item.
- */
- Item newFieldItem(final String owner, final String name, final String desc) {
- key3.set(FIELD, owner, name, desc);
- Item result = get(key3);
- if (result == null) {
- put122(FIELD, newClass(owner), newNameType(name, desc));
- result = new Item(index++, key3);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a field reference to the constant pool of the class being build.
- * Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param owner
- * the internal name of the field's owner class.
- * @param name
- * the field's name.
- * @param desc
- * the field's descriptor.
- * @return the index of a new or already existing field reference item.
- */
- public int newField(final String owner, final String name, final String desc) {
- return newFieldItem(owner, name, desc).index;
- }
-
- /**
- * Adds a method reference to the constant pool of the class being build.
- * Does nothing if the constant pool already contains a similar item.
- *
- * @param owner
- * the internal name of the method's owner class.
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor.
- * @param itf
- * <tt>true</tt> if <tt>owner</tt> is an interface.
- * @return a new or already existing method reference item.
- */
- Item newMethodItem(final String owner, final String name,
- final String desc, final boolean itf) {
- int type = itf ? IMETH : METH;
- key3.set(type, owner, name, desc);
- Item result = get(key3);
- if (result == null) {
- put122(type, newClass(owner), newNameType(name, desc));
- result = new Item(index++, key3);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a method reference to the constant pool of the class being build.
- * Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param owner
- * the internal name of the method's owner class.
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor.
- * @param itf
- * <tt>true</tt> if <tt>owner</tt> is an interface.
- * @return the index of a new or already existing method reference item.
- */
- public int newMethod(final String owner, final String name,
- final String desc, final boolean itf) {
- return newMethodItem(owner, name, desc, itf).index;
- }
-
- /**
- * Adds an integer to the constant pool of the class being build. Does
- * nothing if the constant pool already contains a similar item.
- *
- * @param value
- * the int value.
- * @return a new or already existing int item.
- */
- Item newInteger(final int value) {
- key.set(value);
- Item result = get(key);
- if (result == null) {
- pool.putByte(INT).putInt(value);
- result = new Item(index++, key);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a float to the constant pool of the class being build. Does nothing
- * if the constant pool already contains a similar item.
- *
- * @param value
- * the float value.
- * @return a new or already existing float item.
- */
- Item newFloat(final float value) {
- key.set(value);
- Item result = get(key);
- if (result == null) {
- pool.putByte(FLOAT).putInt(key.intVal);
- result = new Item(index++, key);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a long to the constant pool of the class being build. Does nothing
- * if the constant pool already contains a similar item.
- *
- * @param value
- * the long value.
- * @return a new or already existing long item.
- */
- Item newLong(final long value) {
- key.set(value);
- Item result = get(key);
- if (result == null) {
- pool.putByte(LONG).putLong(value);
- result = new Item(index, key);
- index += 2;
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a double to the constant pool of the class being build. Does nothing
- * if the constant pool already contains a similar item.
- *
- * @param value
- * the double value.
- * @return a new or already existing double item.
- */
- Item newDouble(final double value) {
- key.set(value);
- Item result = get(key);
- if (result == null) {
- pool.putByte(DOUBLE).putLong(key.longVal);
- result = new Item(index, key);
- index += 2;
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a string to the constant pool of the class being build. Does nothing
- * if the constant pool already contains a similar item.
- *
- * @param value
- * the String value.
- * @return a new or already existing string item.
- */
- private Item newString(final String value) {
- key2.set(STR, value, null, null);
- Item result = get(key2);
- if (result == null) {
- pool.put12(STR, newUTF8(value));
- result = new Item(index++, key2);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds a name and type to the constant pool of the class being build. Does
- * nothing if the constant pool already contains a similar item. <i>This
- * method is intended for {@link Attribute} sub classes, and is normally not
- * needed by class generators or adapters.</i>
- *
- * @param name
- * a name.
- * @param desc
- * a type descriptor.
- * @return the index of a new or already existing name and type item.
- */
- public int newNameType(final String name, final String desc) {
- return newNameTypeItem(name, desc).index;
- }
-
- /**
- * Adds a name and type to the constant pool of the class being build. Does
- * nothing if the constant pool already contains a similar item.
- *
- * @param name
- * a name.
- * @param desc
- * a type descriptor.
- * @return a new or already existing name and type item.
- */
- Item newNameTypeItem(final String name, final String desc) {
- key2.set(NAME_TYPE, name, desc, null);
- Item result = get(key2);
- if (result == null) {
- put122(NAME_TYPE, newUTF8(name), newUTF8(desc));
- result = new Item(index++, key2);
- put(result);
- }
- return result;
- }
-
- /**
- * Adds the given internal name to {@link #typeTable} and returns its index.
- * Does nothing if the type table already contains this internal name.
- *
- * @param type
- * the internal name to be added to the type table.
- * @return the index of this internal name in the type table.
- */
- int addType(final String type) {
- key.set(TYPE_NORMAL, type, null, null);
- Item result = get(key);
- if (result == null) {
- result = addType(key);
- }
- return result.index;
- }
-
- /**
- * Adds the given "uninitialized" type to {@link #typeTable} and returns its
- * index. This method is used for UNINITIALIZED types, made of an internal
- * name and a bytecode offset.
- *
- * @param type
- * the internal name to be added to the type table.
- * @param offset
- * the bytecode offset of the NEW instruction that created this
- * UNINITIALIZED type value.
- * @return the index of this internal name in the type table.
- */
- int addUninitializedType(final String type, final int offset) {
- key.type = TYPE_UNINIT;
- key.intVal = offset;
- key.strVal1 = type;
- key.hashCode = 0x7FFFFFFF & (TYPE_UNINIT + type.hashCode() + offset);
- Item result = get(key);
- if (result == null) {
- result = addType(key);
- }
- return result.index;
- }
-
- /**
- * Adds the given Item to {@link #typeTable}.
- *
- * @param item
- * the value to be added to the type table.
- * @return the added Item, which a new Item instance with the same value as
- * the given Item.
- */
- private Item addType(final Item item) {
- ++typeCount;
- Item result = new Item(typeCount, key);
- put(result);
- if (typeTable == null) {
- typeTable = new Item[16];
- }
- if (typeCount == typeTable.length) {
- Item[] newTable = new Item[2 * typeTable.length];
- System.arraycopy(typeTable, 0, newTable, 0, typeTable.length);
- typeTable = newTable;
- }
- typeTable[typeCount] = result;
- return result;
- }
-
- /**
- * Returns the index of the common super type of the two given types. This
- * method calls {@link #getCommonSuperClass} and caches the result in the
- * {@link #items} hash table to speedup future calls with the same
- * parameters.
- *
- * @param type1
- * index of an internal name in {@link #typeTable}.
- * @param type2
- * index of an internal name in {@link #typeTable}.
- * @return the index of the common super type of the two given types.
- */
- int getMergedType(final int type1, final int type2) {
- key2.type = TYPE_MERGED;
- key2.longVal = type1 | (((long) type2) << 32);
- key2.hashCode = 0x7FFFFFFF & (TYPE_MERGED + type1 + type2);
- Item result = get(key2);
- if (result == null) {
- String t = typeTable[type1].strVal1;
- String u = typeTable[type2].strVal1;
- key2.intVal = addType(getCommonSuperClass(t, u));
- result = new Item((short) 0, key2);
- put(result);
- }
- return result.intVal;
- }
-
- /**
- * Returns the common super type of the two given types. The default
- * implementation of this method <i>loads</i> the two given classes and uses
- * the java.lang.Class methods to find the common super class. It can be
- * overridden to compute this common super type in other ways, in particular
- * without actually loading any class, or to take into account the class
- * that is currently being generated by this ClassWriter, which can of
- * course not be loaded since it is under construction.
- *
- * @param type1
- * the internal name of a class.
- * @param type2
- * the internal name of another class.
- * @return the internal name of the common super class of the two given
- * classes.
- */
- protected String getCommonSuperClass(final String type1, final String type2) {
- Class<?> c, d;
- ClassLoader classLoader = getClass().getClassLoader();
- try {
- c = Class.forName(type1.replace('/', '.'), false, classLoader);
- d = Class.forName(type2.replace('/', '.'), false, classLoader);
- } catch (Exception e) {
- throw new RuntimeException(e.toString());
- }
- if (c.isAssignableFrom(d)) {
- return type1;
- }
- if (d.isAssignableFrom(c)) {
- return type2;
- }
- if (c.isInterface() || d.isInterface()) {
- return "java/lang/Object";
- } else {
- do {
- c = c.getSuperclass();
- } while (!c.isAssignableFrom(d));
- return c.getName().replace('.', '/');
- }
- }
-
- /**
- * Returns the constant pool's hash table item which is equal to the given
- * item.
- *
- * @param key
- * a constant pool item.
- * @return the constant pool's hash table item which is equal to the given
- * item, or <tt>null</tt> if there is no such item.
- */
- private Item get(final Item key) {
- Item i = items[key.hashCode % items.length];
- while (i != null && (i.type != key.type || !key.isEqualTo(i))) {
- i = i.next;
- }
- return i;
- }
-
- /**
- * Puts the given item in the constant pool's hash table. The hash table
- * <i>must</i> not already contains this item.
- *
- * @param i
- * the item to be added to the constant pool's hash table.
- */
- private void put(final Item i) {
- if (index + typeCount > threshold) {
- int ll = items.length;
- int nl = ll * 2 + 1;
- Item[] newItems = new Item[nl];
- for (int l = ll - 1; l >= 0; --l) {
- Item j = items[l];
- while (j != null) {
- int index = j.hashCode % newItems.length;
- Item k = j.next;
- j.next = newItems[index];
- newItems[index] = j;
- j = k;
- }
- }
- items = newItems;
- threshold = (int) (nl * 0.75);
- }
- int index = i.hashCode % items.length;
- i.next = items[index];
- items[index] = i;
- }
-
- /**
- * Puts one byte and two shorts into the constant pool.
- *
- * @param b
- * a byte.
- * @param s1
- * a short.
- * @param s2
- * another short.
- */
- private void put122(final int b, final int s1, final int s2) {
- pool.put12(b, s1).putShort(s2);
- }
-
- /**
- * Puts two bytes and one short into the constant pool.
- *
- * @param b1
- * a byte.
- * @param b2
- * another byte.
- * @param s
- * a short.
- */
- private void put112(final int b1, final int b2, final int s) {
- pool.put11(b1, b2).putShort(s);
- }
+ /**
+ * Returns the {@link ClassLoader} to be used by the default implementation of {@link
+ * #getCommonSuperClass(String, String)}, that of this {@link ClassWriter}'s runtime type by
+ * default.
+ *
+ * @return ClassLoader
+ */
+ protected ClassLoader getClassLoader() {
+ return getClass().getClassLoader();
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ConstantDynamic.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ConstantDynamic.java
new file mode 100644
index 0000000..5a98fb9
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ConstantDynamic.java
@@ -0,0 +1,183 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+package jersey.repackaged.org.objectweb.asm;
+
+import java.util.Arrays;
+
+/**
+ * A constant whose value is computed at runtime, with a bootstrap method.
+ *
+ * @author Remi Forax
+ */
+public final class ConstantDynamic {
+
+ /** The constant name (can be arbitrary). */
+ private final String name;
+
+ /** The constant type (must be a field descriptor). */
+ private final String descriptor;
+
+ /** The bootstrap method to use to compute the constant value at runtime. */
+ private final Handle bootstrapMethod;
+
+ /**
+ * The arguments to pass to the bootstrap method, in order to compute the constant value at
+ * runtime.
+ */
+ private final Object[] bootstrapMethodArguments;
+
+ /**
+ * Constructs a new {@link ConstantDynamic}.
+ *
+ * @param name the constant name (can be arbitrary).
+ * @param descriptor the constant type (must be a field descriptor).
+ * @param bootstrapMethod the bootstrap method to use to compute the constant value at runtime.
+ * @param bootstrapMethodArguments the arguments to pass to the bootstrap method, in order to
+ * compute the constant value at runtime.
+ */
+ public ConstantDynamic(
+ final String name,
+ final String descriptor,
+ final Handle bootstrapMethod,
+ final Object... bootstrapMethodArguments) {
+ this.name = name;
+ this.descriptor = descriptor;
+ this.bootstrapMethod = bootstrapMethod;
+ this.bootstrapMethodArguments = bootstrapMethodArguments;
+ }
+
+ /**
+ * Returns the name of this constant.
+ *
+ * @return the name of this constant.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns the type of this constant.
+ *
+ * @return the type of this constant, as a field descriptor.
+ */
+ public String getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Returns the bootstrap method used to compute the value of this constant.
+ *
+ * @return the bootstrap method used to compute the value of this constant.
+ */
+ public Handle getBootstrapMethod() {
+ return bootstrapMethod;
+ }
+
+ /**
+ * Returns the number of arguments passed to the bootstrap method, in order to compute the value
+ * of this constant.
+ *
+ * @return the number of arguments passed to the bootstrap method, in order to compute the value
+ * of this constant.
+ */
+ public int getBootstrapMethodArgumentCount() {
+ return bootstrapMethodArguments.length;
+ }
+
+ /**
+ * Returns an argument passed to the bootstrap method, in order to compute the value of this
+ * constant.
+ *
+ * @param index an argument index, between 0 and {@link #getBootstrapMethodArgumentCount()}
+ * (exclusive).
+ * @return the argument passed to the bootstrap method, with the given index.
+ */
+ public Object getBootstrapMethodArgument(final int index) {
+ return bootstrapMethodArguments[index];
+ }
+
+ /**
+ * Returns the arguments to pass to the bootstrap method, in order to compute the value of this
+ * constant. WARNING: this array must not be modified, and must not be returned to the user.
+ *
+ * @return the arguments to pass to the bootstrap method, in order to compute the value of this
+ * constant.
+ */
+ Object[] getBootstrapMethodArgumentsUnsafe() {
+ return bootstrapMethodArguments;
+ }
+
+ /**
+ * Returns the size of this constant.
+ *
+ * @return the size of this constant, i.e., 2 for {@code long} and {@code double}, 1 otherwise.
+ */
+ public int getSize() {
+ char firstCharOfDescriptor = descriptor.charAt(0);
+ return (firstCharOfDescriptor == 'J' || firstCharOfDescriptor == 'D') ? 2 : 1;
+ }
+
+ void accept(final MethodVisitor methodVisitor) {
+ methodVisitor.visitInvokeDynamicInsn(
+ name, descriptor, bootstrapMethod, bootstrapMethodArguments);
+ }
+
+ @Override
+ public boolean equals(final Object object) {
+ if (object == this) {
+ return true;
+ }
+ if (!(object instanceof ConstantDynamic)) {
+ return false;
+ }
+ ConstantDynamic constantDynamic = (ConstantDynamic) object;
+ return name.equals(constantDynamic.name)
+ && descriptor.equals(constantDynamic.descriptor)
+ && bootstrapMethod.equals(constantDynamic.bootstrapMethod)
+ && Arrays.equals(bootstrapMethodArguments, constantDynamic.bootstrapMethodArguments);
+ }
+
+ @Override
+ public int hashCode() {
+ return name.hashCode()
+ ^ Integer.rotateLeft(descriptor.hashCode(), 8)
+ ^ Integer.rotateLeft(bootstrapMethod.hashCode(), 16)
+ ^ Integer.rotateLeft(Arrays.hashCode(bootstrapMethodArguments), 24);
+ }
+
+ @Override
+ public String toString() {
+ return name
+ + " : "
+ + descriptor
+ + ' '
+ + bootstrapMethod
+ + ' '
+ + Arrays.toString(bootstrapMethodArguments);
+ }
+}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Constants.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Constants.java
new file mode 100644
index 0000000..6cbbf42
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Constants.java
@@ -0,0 +1,177 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * Defines additional JVM opcodes, access flags and constants which are not part of the ASM public
+ * API.
+ *
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-6.html">JVMS 6</a>
+ * @author Eric Bruneton
+ */
+final class Constants implements Opcodes {
+
+ // The ClassFile attribute names, in the order they are defined in
+ // https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.7-300.
+
+ static final String CONSTANT_VALUE = "ConstantValue";
+ static final String CODE = "Code";
+ static final String STACK_MAP_TABLE = "StackMapTable";
+ static final String EXCEPTIONS = "Exceptions";
+ static final String INNER_CLASSES = "InnerClasses";
+ static final String ENCLOSING_METHOD = "EnclosingMethod";
+ static final String SYNTHETIC = "Synthetic";
+ static final String SIGNATURE = "Signature";
+ static final String SOURCE_FILE = "SourceFile";
+ static final String SOURCE_DEBUG_EXTENSION = "SourceDebugExtension";
+ static final String LINE_NUMBER_TABLE = "LineNumberTable";
+ static final String LOCAL_VARIABLE_TABLE = "LocalVariableTable";
+ static final String LOCAL_VARIABLE_TYPE_TABLE = "LocalVariableTypeTable";
+ static final String DEPRECATED = "Deprecated";
+ static final String RUNTIME_VISIBLE_ANNOTATIONS = "RuntimeVisibleAnnotations";
+ static final String RUNTIME_INVISIBLE_ANNOTATIONS = "RuntimeInvisibleAnnotations";
+ static final String RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS = "RuntimeVisibleParameterAnnotations";
+ static final String RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS =
+ "RuntimeInvisibleParameterAnnotations";
+ static final String RUNTIME_VISIBLE_TYPE_ANNOTATIONS = "RuntimeVisibleTypeAnnotations";
+ static final String RUNTIME_INVISIBLE_TYPE_ANNOTATIONS = "RuntimeInvisibleTypeAnnotations";
+ static final String ANNOTATION_DEFAULT = "AnnotationDefault";
+ static final String BOOTSTRAP_METHODS = "BootstrapMethods";
+ static final String METHOD_PARAMETERS = "MethodParameters";
+ static final String MODULE = "Module";
+ static final String MODULE_PACKAGES = "ModulePackages";
+ static final String MODULE_MAIN_CLASS = "ModuleMainClass";
+ static final String NEST_HOST = "NestHost";
+ static final String NEST_MEMBERS = "NestMembers";
+
+ // ASM specific access flags.
+ // WARNING: the 16 least significant bits must NOT be used, to avoid conflicts with standard
+ // access flags, and also to make sure that these flags are automatically filtered out when
+ // written in class files (because access flags are stored using 16 bits only).
+
+ static final int ACC_CONSTRUCTOR = 0x40000; // method access flag.
+
+ // ASM specific stack map frame types, used in {@link ClassVisitor#visitFrame}.
+
+ /**
+ * A frame inserted between already existing frames. This internal stack map frame type (in
+ * addition to the ones declared in {@link Opcodes}) can only be used if the frame content can be
+ * computed from the previous existing frame and from the instructions between this existing frame
+ * and the inserted one, without any knowledge of the type hierarchy. This kind of frame is only
+ * used when an unconditional jump is inserted in a method while expanding an ASM specific
+ * instruction. Keep in sync with Opcodes.java.
+ */
+ static final int F_INSERT = 256;
+
+ // The JVM opcode values which are not part of the ASM public API.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-6.html.
+
+ static final int LDC_W = 19;
+ static final int LDC2_W = 20;
+ static final int ILOAD_0 = 26;
+ static final int ILOAD_1 = 27;
+ static final int ILOAD_2 = 28;
+ static final int ILOAD_3 = 29;
+ static final int LLOAD_0 = 30;
+ static final int LLOAD_1 = 31;
+ static final int LLOAD_2 = 32;
+ static final int LLOAD_3 = 33;
+ static final int FLOAD_0 = 34;
+ static final int FLOAD_1 = 35;
+ static final int FLOAD_2 = 36;
+ static final int FLOAD_3 = 37;
+ static final int DLOAD_0 = 38;
+ static final int DLOAD_1 = 39;
+ static final int DLOAD_2 = 40;
+ static final int DLOAD_3 = 41;
+ static final int ALOAD_0 = 42;
+ static final int ALOAD_1 = 43;
+ static final int ALOAD_2 = 44;
+ static final int ALOAD_3 = 45;
+ static final int ISTORE_0 = 59;
+ static final int ISTORE_1 = 60;
+ static final int ISTORE_2 = 61;
+ static final int ISTORE_3 = 62;
+ static final int LSTORE_0 = 63;
+ static final int LSTORE_1 = 64;
+ static final int LSTORE_2 = 65;
+ static final int LSTORE_3 = 66;
+ static final int FSTORE_0 = 67;
+ static final int FSTORE_1 = 68;
+ static final int FSTORE_2 = 69;
+ static final int FSTORE_3 = 70;
+ static final int DSTORE_0 = 71;
+ static final int DSTORE_1 = 72;
+ static final int DSTORE_2 = 73;
+ static final int DSTORE_3 = 74;
+ static final int ASTORE_0 = 75;
+ static final int ASTORE_1 = 76;
+ static final int ASTORE_2 = 77;
+ static final int ASTORE_3 = 78;
+ static final int WIDE = 196;
+ static final int GOTO_W = 200;
+ static final int JSR_W = 201;
+
+ // Constants to convert between normal and wide jump instructions.
+
+ // The delta between the GOTO_W and JSR_W opcodes and GOTO and JUMP.
+ static final int WIDE_JUMP_OPCODE_DELTA = GOTO_W - GOTO;
+
+ // Constants to convert JVM opcodes to the equivalent ASM specific opcodes, and vice versa.
+
+ // The delta between the ASM_IFEQ, ..., ASM_IF_ACMPNE, ASM_GOTO and ASM_JSR opcodes
+ // and IFEQ, ..., IF_ACMPNE, GOTO and JSR.
+ static final int ASM_OPCODE_DELTA = 49;
+
+ // The delta between the ASM_IFNULL and ASM_IFNONNULL opcodes and IFNULL and IFNONNULL.
+ static final int ASM_IFNULL_OPCODE_DELTA = 20;
+
+ // ASM specific opcodes, used for long forward jump instructions.
+
+ static final int ASM_IFEQ = IFEQ + ASM_OPCODE_DELTA;
+ static final int ASM_IFNE = IFNE + ASM_OPCODE_DELTA;
+ static final int ASM_IFLT = IFLT + ASM_OPCODE_DELTA;
+ static final int ASM_IFGE = IFGE + ASM_OPCODE_DELTA;
+ static final int ASM_IFGT = IFGT + ASM_OPCODE_DELTA;
+ static final int ASM_IFLE = IFLE + ASM_OPCODE_DELTA;
+ static final int ASM_IF_ICMPEQ = IF_ICMPEQ + ASM_OPCODE_DELTA;
+ static final int ASM_IF_ICMPNE = IF_ICMPNE + ASM_OPCODE_DELTA;
+ static final int ASM_IF_ICMPLT = IF_ICMPLT + ASM_OPCODE_DELTA;
+ static final int ASM_IF_ICMPGE = IF_ICMPGE + ASM_OPCODE_DELTA;
+ static final int ASM_IF_ICMPGT = IF_ICMPGT + ASM_OPCODE_DELTA;
+ static final int ASM_IF_ICMPLE = IF_ICMPLE + ASM_OPCODE_DELTA;
+ static final int ASM_IF_ACMPEQ = IF_ACMPEQ + ASM_OPCODE_DELTA;
+ static final int ASM_IF_ACMPNE = IF_ACMPNE + ASM_OPCODE_DELTA;
+ static final int ASM_GOTO = GOTO + ASM_OPCODE_DELTA;
+ static final int ASM_JSR = JSR + ASM_OPCODE_DELTA;
+ static final int ASM_IFNULL = IFNULL + ASM_IFNULL_OPCODE_DELTA;
+ static final int ASM_IFNONNULL = IFNONNULL + ASM_IFNULL_OPCODE_DELTA;
+ static final int ASM_GOTO_W = 220;
+
+ private Constants() {}
+}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Context.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Context.java
index 016c085..c0b53b6 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Context.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Context.java
@@ -1,145 +1,137 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package jersey.repackaged.org.objectweb.asm;
-
-/**
- * Information about a class being parsed in a {@link ClassReader}.
- *
- * @author Eric Bruneton
- */
-class Context {
-
- /**
- * Prototypes of the attributes that must be parsed for this class.
- */
- Attribute[] attrs;
-
- /**
- * The {@link ClassReader} option flags for the parsing of this class.
- */
- int flags;
-
- /**
- * The buffer used to read strings.
- */
- char[] buffer;
-
- /**
- * The start index of each bootstrap method.
- */
- int[] bootstrapMethods;
-
- /**
- * The access flags of the method currently being parsed.
- */
- int access;
-
- /**
- * The name of the method currently being parsed.
- */
- String name;
-
- /**
- * The descriptor of the method currently being parsed.
- */
- String desc;
-
- /**
- * The label objects, indexed by bytecode offset, of the method currently
- * being parsed (only bytecode offsets for which a label is needed have a
- * non null associated Label object).
- */
- Label[] labels;
-
- /**
- * The target of the type annotation currently being parsed.
- */
- int typeRef;
-
- /**
- * The path of the type annotation currently being parsed.
- */
- TypePath typePath;
-
- /**
- * The offset of the latest stack map frame that has been parsed.
- */
- int offset;
-
- /**
- * The labels corresponding to the start of the local variable ranges in the
- * local variable type annotation currently being parsed.
- */
- Label[] start;
-
- /**
- * The labels corresponding to the end of the local variable ranges in the
- * local variable type annotation currently being parsed.
- */
- Label[] end;
-
- /**
- * The local variable indices for each local variable range in the local
- * variable type annotation currently being parsed.
- */
- int[] index;
-
- /**
- * The encoding of the latest stack map frame that has been parsed.
- */
- int mode;
-
- /**
- * The number of locals in the latest stack map frame that has been parsed.
- */
- int localCount;
-
- /**
- * The number locals in the latest stack map frame that has been parsed,
- * minus the number of locals in the previous frame.
- */
- int localDiff;
-
- /**
- * The local values of the latest stack map frame that has been parsed.
- */
- Object[] local;
-
- /**
- * The stack size of the latest stack map frame that has been parsed.
- */
- int stackCount;
-
- /**
- * The stack values of the latest stack map frame that has been parsed.
- */
- Object[] stack;
-}
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * Information about a class being parsed in a {@link ClassReader}.
+ *
+ * @author Eric Bruneton
+ */
+final class Context {
+
+ /** The prototypes of the attributes that must be parsed in this class. */
+ Attribute[] attributePrototypes;
+
+ /**
+ * The options used to parse this class. One or more of {@link ClassReader#SKIP_CODE}, {@link
+ * ClassReader#SKIP_DEBUG}, {@link ClassReader#SKIP_FRAMES}, {@link ClassReader#EXPAND_FRAMES} or
+ * {@link ClassReader#EXPAND_ASM_INSNS}.
+ */
+ int parsingOptions;
+
+ /** The buffer used to read strings in the constant pool. */
+ char[] charBuffer;
+
+ // Information about the current method, i.e. the one read in the current (or latest) call
+ // to {@link ClassReader#readMethod()}.
+
+ /** The access flags of the current method. */
+ int currentMethodAccessFlags;
+
+ /** The name of the current method. */
+ String currentMethodName;
+
+ /** The descriptor of the current method. */
+ String currentMethodDescriptor;
+
+ /**
+ * The labels of the current method, indexed by bytecode offset (only bytecode offsets for which a
+ * label is needed have a non null associated Label).
+ */
+ Label[] currentMethodLabels;
+
+ // Information about the current type annotation target, i.e. the one read in the current
+ // (or latest) call to {@link ClassReader#readAnnotationTarget()}.
+
+ /**
+ * The target_type and target_info of the current type annotation target, encoded as described in
+ * {@link TypeReference}.
+ */
+ int currentTypeAnnotationTarget;
+
+ /** The target_path of the current type annotation target. */
+ TypePath currentTypeAnnotationTargetPath;
+
+ /** The start of each local variable range in the current local variable annotation. */
+ Label[] currentLocalVariableAnnotationRangeStarts;
+
+ /** The end of each local variable range in the current local variable annotation. */
+ Label[] currentLocalVariableAnnotationRangeEnds;
+
+ /**
+ * The local variable index of each local variable range in the current local variable annotation.
+ */
+ int[] currentLocalVariableAnnotationRangeIndices;
+
+ // Information about the current stack map frame, i.e. the one read in the current (or latest)
+ // call to {@link ClassReader#readFrame()}.
+
+ /** The bytecode offset of the current stack map frame. */
+ int currentFrameOffset;
+
+ /**
+ * The type of the current stack map frame. One of {@link Opcodes#F_FULL}, {@link
+ * Opcodes#F_APPEND}, {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or {@link Opcodes#F_SAME1}.
+ */
+ int currentFrameType;
+
+ /**
+ * The number of local variable types in the current stack map frame. Each type is represented
+ * with a single array element (even long and double).
+ */
+ int currentFrameLocalCount;
+
+ /**
+ * The delta number of local variable types in the current stack map frame (each type is
+ * represented with a single array element - even long and double). This is the number of local
+ * variable types in this frame, minus the number of local variable types in the previous frame.
+ */
+ int currentFrameLocalCountDelta;
+
+ /**
+ * The types of the local variables in the current stack map frame. Each type is represented with
+ * a single array element (even long and double), using the format described in {@link
+ * MethodVisitor#visitFrame}. Depending on {@link #currentFrameType}, this contains the types of
+ * all the local variables, or only those of the additional ones (compared to the previous frame).
+ */
+ Object[] currentFrameLocalTypes;
+
+ /**
+ * The number stack element types in the current stack map frame. Each type is represented with a
+ * single array element (even long and double).
+ */
+ int currentFrameStackCount;
+
+ /**
+ * The types of the stack elements in the current stack map frame. Each type is represented with a
+ * single array element (even long and double), using the format described in {@link
+ * MethodVisitor#visitFrame}.
+ */
+ Object[] currentFrameStackTypes;
+}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/CurrentFrame.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/CurrentFrame.java
new file mode 100644
index 0000000..074c81d
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/CurrentFrame.java
@@ -0,0 +1,56 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * Information about the input stack map frame at the "current" instruction of a method. This is
+ * implemented as a Frame subclass for a "basic block" containing only one instruction.
+ *
+ * @author Eric Bruneton
+ */
+final class CurrentFrame extends Frame {
+
+ CurrentFrame(final Label owner) {
+ super(owner);
+ }
+
+ /**
+ * Sets this CurrentFrame to the input stack map frame of the next "current" instruction, i.e. the
+ * instruction just after the given one. It is assumed that the value of this object when this
+ * method is called is the stack map frame status just before the given instruction is executed.
+ */
+ @Override
+ void execute(
+ final int opcode, final int arg, final Symbol symbolArg, final SymbolTable symbolTable) {
+ super.execute(opcode, arg, symbolArg, symbolTable);
+ Frame successor = new Frame(null);
+ merge(symbolTable, successor, 0);
+ copyFrom(successor);
+ }
+}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Edge.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Edge.java
index 24dfa2d..d66656d 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Edge.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Edge.java
@@ -1,75 +1,91 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * An edge in the control flow graph of a method body. See {@link Label Label}.
+ * An edge in the control flow graph of a method. Each node of this graph is a basic block,
+ * represented with the Label corresponding to its first instruction. Each edge goes from one node
+ * to another, i.e. from one basic block to another (called the predecessor and successor blocks,
+ * respectively). An edge corresponds either to a jump or ret instruction or to an exception
+ * handler.
*
+ * @see Label
* @author Eric Bruneton
*/
-class Edge {
+final class Edge {
- /**
- * Denotes a normal control flow graph edge.
- */
- static final int NORMAL = 0;
+ /**
+ * A control flow graph edge corresponding to a jump or ret instruction. Only used with {@link
+ * ClassWriter#COMPUTE_FRAMES}.
+ */
+ static final int JUMP = 0;
- /**
- * Denotes a control flow graph edge corresponding to an exception handler.
- * More precisely any {@link Edge} whose {@link #info} is strictly positive
- * corresponds to an exception handler. The actual value of {@link #info} is
- * the index, in the {@link ClassWriter} type table, of the exception that
- * is catched.
- */
- static final int EXCEPTION = 0x7FFFFFFF;
+ /**
+ * A control flow graph edge corresponding to an exception handler. Only used with {@link
+ * ClassWriter#COMPUTE_MAXS}.
+ */
+ static final int EXCEPTION = 0x7FFFFFFF;
- /**
- * Information about this control flow graph edge. If
- * {@link ClassWriter#COMPUTE_MAXS} is used this field is the (relative)
- * stack size in the basic block from which this edge originates. This size
- * is equal to the stack size at the "jump" instruction to which this edge
- * corresponds, relatively to the stack size at the beginning of the
- * originating basic block. If {@link ClassWriter#COMPUTE_FRAMES} is used,
- * this field is the kind of this control flow graph edge (i.e. NORMAL or
- * EXCEPTION).
- */
- int info;
+ /**
+ * Information about this control flow graph edge.
+ *
+ * <ul>
+ * <li>If {@link ClassWriter#COMPUTE_MAXS} is used, this field contains either a stack size
+ * delta (for an edge corresponding to a jump instruction), or the value EXCEPTION (for an
+ * edge corresponding to an exception handler). The stack size delta is the stack size just
+ * after the jump instruction, minus the stack size at the beginning of the predecessor
+ * basic block, i.e. the one containing the jump instruction.
+ * <li>If {@link ClassWriter#COMPUTE_FRAMES} is used, this field contains either the value JUMP
+ * (for an edge corresponding to a jump instruction), or the index, in the {@link
+ * ClassWriter} type table, of the exception type that is handled (for an edge corresponding
+ * to an exception handler).
+ * </ul>
+ */
+ final int info;
- /**
- * The successor block of the basic block from which this edge originates.
- */
- Label successor;
+ /** The successor block of this control flow graph edge. */
+ final Label successor;
- /**
- * The next edge in the list of successors of the originating basic block.
- * See {@link Label#successors successors}.
- */
- Edge next;
+ /**
+ * The next edge in the list of outgoing edges of a basic block. See {@link Label#outgoingEdges}.
+ */
+ Edge nextEdge;
+
+ /**
+ * Constructs a new Edge.
+ *
+ * @param info see {@link #info}.
+ * @param successor see {@link #successor}.
+ * @param nextEdge see {@link #nextEdge}.
+ */
+ Edge(final int info, final Label successor, final Edge nextEdge) {
+ this.info = info;
+ this.successor = successor;
+ this.nextEdge = nextEdge;
+ }
}
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 d627eaa..0df3e62 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
@@ -1,150 +1,133 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A visitor to visit a Java field. The methods of this class must be called in
- * the following order: ( <tt>visitAnnotation</tt> |
- * <tt>visitTypeAnnotation</tt> | <tt>visitAttribute</tt> )* <tt>visitEnd</tt>.
+ * A visitor to visit a Java field. The methods of this class must be called in the following order:
+ * ( {@code visitAnnotation} | {@code visitTypeAnnotation} | {@code visitAttribute} )* {@code
+ * visitEnd}.
*
* @author Eric Bruneton
*/
public abstract class FieldVisitor {
- /**
- * The ASM API version implemented by this visitor. The value of this field
- * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- */
- protected final int api;
+ /**
+ * 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}.
+ */
+ protected final int api;
- /**
- * The field visitor to which this visitor must delegate method calls. May
- * be null.
- */
- protected FieldVisitor fv;
+ /** The field visitor to which this visitor must delegate method calls. May be null. */
+ protected FieldVisitor fv;
- /**
- * Constructs a new {@link FieldVisitor}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- */
- public 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} or {@link Opcodes#ASM7}.
+ */
+ public 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} or {@link Opcodes#ASM7}.
+ * @param fieldVisitor the field visitor to which this visitor must delegate method calls. May be
+ * null.
+ */
+ public FieldVisitor(final int api, final FieldVisitor fieldVisitor) {
+ if (api != Opcodes.ASM7 && api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4) {
+ throw new IllegalArgumentException("Unsupported api " + api);
}
+ this.api = api;
+ this.fv = fieldVisitor;
+ }
- /**
- * Constructs a new {@link FieldVisitor}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- * @param fv
- * the field visitor to which this visitor must delegate method
- * calls. May be null.
- */
- public FieldVisitor(final int api, final FieldVisitor fv) {
- if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
- throw new IllegalArgumentException();
- }
- this.api = api;
- this.fv = fv;
+ /**
+ * Visits an annotation of the field.
+ *
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) {
+ if (fv != null) {
+ return fv.visitAnnotation(descriptor, visible);
}
+ return null;
+ }
- /**
- * Visits an annotation of the field.
- *
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
- if (fv != null) {
- return fv.visitAnnotation(desc, visible);
- }
- return null;
+ /**
+ * Visits an annotation on the type of the field.
+ *
+ * @param typeRef a reference to the annotated type. The sort of this type reference must be
+ * {@link TypeReference#FIELD}. See {@link TypeReference}.
+ * @param typePath the path to the annotated type argument, wildcard bound, array element type, or
+ * static inner type within 'typeRef'. May be {@literal null} if the annotation targets
+ * 'typeRef' as a whole.
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitTypeAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new UnsupportedOperationException("This feature requires ASM5");
}
+ if (fv != null) {
+ return fv.visitTypeAnnotation(typeRef, typePath, descriptor, visible);
+ }
+ return null;
+ }
- /**
- * Visits an annotation on the type of the field.
- *
- * @param typeRef
- * a reference to the annotated type. The sort of this type
- * reference must be {@link TypeReference#FIELD FIELD}. See
- * {@link TypeReference}.
- * @param typePath
- * the path to the annotated type argument, wildcard bound, array
- * element type, or static inner type within 'typeRef'. May be
- * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- if (api < Opcodes.ASM5) {
- throw new RuntimeException();
- }
- if (fv != null) {
- return fv.visitTypeAnnotation(typeRef, typePath, desc, visible);
- }
- return null;
+ /**
+ * Visits a non standard attribute of the field.
+ *
+ * @param attribute an attribute.
+ */
+ public void visitAttribute(final Attribute attribute) {
+ if (fv != null) {
+ fv.visitAttribute(attribute);
}
+ }
- /**
- * Visits a non standard attribute of the field.
- *
- * @param attr
- * an attribute.
- */
- public void visitAttribute(Attribute attr) {
- if (fv != null) {
- fv.visitAttribute(attr);
- }
+ /**
+ * Visits the end of the field. This method, which is the last one to be called, is used to inform
+ * the visitor that all the annotations and attributes of the field have been visited.
+ */
+ public void visitEnd() {
+ if (fv != null) {
+ fv.visitEnd();
}
-
- /**
- * Visits the end of the field. This method, which is the last one to be
- * called, is used to inform the visitor that all the annotations and
- * attributes of the field have been visited.
- */
- public void visitEnd() {
- if (fv != null) {
- fv.visitEnd();
- }
- }
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/FieldWriter.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/FieldWriter.java
index 1c88bef..93f4802 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/FieldWriter.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/FieldWriter.java
@@ -1,329 +1,284 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * An {@link FieldVisitor} that generates Java fields in bytecode form.
+ * A {@link FieldVisitor} that generates a corresponding 'field_info' structure, as defined in the
+ * Java Virtual Machine Specification (JVMS).
*
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.5">JVMS
+ * 4.5</a>
* @author Eric Bruneton
*/
final class FieldWriter extends FieldVisitor {
- /**
- * The class writer to which this field must be added.
- */
- private final ClassWriter cw;
+ /** Where the constants used in this FieldWriter must be stored. */
+ private final SymbolTable symbolTable;
- /**
- * Access flags of this field.
- */
- private final int access;
+ // Note: fields are ordered as in the field_info structure, and those related to attributes are
+ // ordered as in Section 4.7 of the JVMS.
- /**
- * The index of the constant pool item that contains the name of this
- * method.
- */
- private final int name;
+ /**
+ * The access_flags field of the field_info JVMS structure. This field can contain ASM specific
+ * access flags, such as {@link Opcodes#ACC_DEPRECATED}, which are removed when generating the
+ * ClassFile structure.
+ */
+ private final int accessFlags;
- /**
- * The index of the constant pool item that contains the descriptor of this
- * field.
- */
- private final int desc;
+ /** The name_index field of the field_info JVMS structure. */
+ private final int nameIndex;
- /**
- * The index of the constant pool item that contains the signature of this
- * field.
- */
- private int signature;
+ /** The descriptor_index field of the field_info JVMS structure. */
+ private final int descriptorIndex;
- /**
- * The index of the constant pool item that contains the constant value of
- * this field.
- */
- private int value;
+ /**
+ * The signature_index field of the Signature attribute of this field_info, or 0 if there is no
+ * Signature attribute.
+ */
+ private int signatureIndex;
- /**
- * The runtime visible annotations of this field. May be <tt>null</tt>.
- */
- private AnnotationWriter anns;
+ /**
+ * The constantvalue_index field of the ConstantValue attribute of this field_info, or 0 if there
+ * is no ConstantValue attribute.
+ */
+ private int constantValueIndex;
- /**
- * The runtime invisible annotations of this field. May be <tt>null</tt>.
- */
- private AnnotationWriter ianns;
+ /**
+ * The last runtime visible annotation of this field. The previous ones can be accessed with the
+ * {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeVisibleAnnotation;
- /**
- * The runtime visible type annotations of this field. May be <tt>null</tt>.
- */
- private AnnotationWriter tanns;
+ /**
+ * The last runtime invisible annotation of this field. The previous ones can be accessed with the
+ * {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeInvisibleAnnotation;
- /**
- * The runtime invisible type annotations of this field. May be
- * <tt>null</tt>.
- */
- private AnnotationWriter itanns;
+ /**
+ * The last runtime visible type annotation of this field. The previous ones can be accessed with
+ * the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeVisibleTypeAnnotation;
- /**
- * The non standard attributes of this field. May be <tt>null</tt>.
- */
- private Attribute attrs;
+ /**
+ * The last runtime invisible type annotation of this field. The previous ones can be accessed
+ * with the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeInvisibleTypeAnnotation;
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
+ /**
+ * The first non standard attribute of this field. The next ones can be accessed with the {@link
+ * Attribute#nextAttribute} field. May be {@literal null}.
+ *
+ * <p><b>WARNING</b>: this list stores the attributes in the <i>reverse</i> order of their visit.
+ * firstAttribute is actually the last attribute visited in {@link #visitAttribute}. The {@link
+ * #putFieldInfo} method writes the attributes in the order defined by this list, i.e. in the
+ * reverse order specified by the user.
+ */
+ private Attribute firstAttribute;
- /**
- * Constructs a new {@link FieldWriter}.
- *
- * @param cw
- * the class writer to which this field must be added.
- * @param access
- * the field's access flags (see {@link Opcodes}).
- * @param name
- * the field's name.
- * @param desc
- * the field's descriptor (see {@link Type}).
- * @param signature
- * the field's signature. May be <tt>null</tt>.
- * @param value
- * the field's constant value. May be <tt>null</tt>.
- */
- FieldWriter(final ClassWriter cw, final int access, final String name,
- final String desc, final String signature, final Object value) {
- super(Opcodes.ASM5);
- if (cw.firstField == null) {
- cw.firstField = this;
- } else {
- cw.lastField.fv = this;
- }
- cw.lastField = this;
- this.cw = cw;
- this.access = access;
- this.name = cw.newUTF8(name);
- this.desc = cw.newUTF8(desc);
- if (ClassReader.SIGNATURES && signature != null) {
- this.signature = cw.newUTF8(signature);
- }
- if (value != null) {
- this.value = cw.newConstItem(value).index;
- }
+ // -----------------------------------------------------------------------------------------------
+ // Constructor
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Constructs a new {@link FieldWriter}.
+ *
+ * @param symbolTable where the constants used in this FieldWriter must be stored.
+ * @param access the field's access flags (see {@link Opcodes}).
+ * @param name the field's name.
+ * @param descriptor the field's descriptor (see {@link Type}).
+ * @param signature the field's signature. May be {@literal null}.
+ * @param constantValue the field's constant value. May be {@literal null}.
+ */
+ FieldWriter(
+ final SymbolTable symbolTable,
+ final int access,
+ final String name,
+ final String descriptor,
+ final String signature,
+ final Object constantValue) {
+ super(Opcodes.ASM7);
+ this.symbolTable = symbolTable;
+ this.accessFlags = access;
+ this.nameIndex = symbolTable.addConstantUtf8(name);
+ this.descriptorIndex = symbolTable.addConstantUtf8(descriptor);
+ if (signature != null) {
+ this.signatureIndex = symbolTable.addConstantUtf8(signature);
}
-
- // ------------------------------------------------------------------------
- // Implementation of the FieldVisitor abstract class
- // ------------------------------------------------------------------------
-
- @Override
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- // write type, and reserve space for values count
- bv.putShort(cw.newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
- if (visible) {
- aw.next = anns;
- anns = aw;
- } else {
- aw.next = ianns;
- ianns = aw;
- }
- return aw;
+ if (constantValue != null) {
+ this.constantValueIndex = symbolTable.addConstant(constantValue).index;
}
+ }
- @Override
- public AnnotationVisitor visitTypeAnnotation(final int typeRef,
- final TypePath typePath, final String desc, final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- // write target_type and target_info
- AnnotationWriter.putTarget(typeRef, typePath, bv);
- // write type, and reserve space for values count
- bv.putShort(cw.newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv,
- bv.length - 2);
- if (visible) {
- aw.next = tanns;
- tanns = aw;
- } else {
- aw.next = itanns;
- itanns = aw;
- }
- return aw;
+ // -----------------------------------------------------------------------------------------------
+ // Implementation of the FieldVisitor abstract class
+ // -----------------------------------------------------------------------------------------------
+
+ @Override
+ public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) {
+ if (visible) {
+ return lastRuntimeVisibleAnnotation =
+ AnnotationWriter.create(symbolTable, descriptor, lastRuntimeVisibleAnnotation);
+ } else {
+ return lastRuntimeInvisibleAnnotation =
+ AnnotationWriter.create(symbolTable, descriptor, lastRuntimeInvisibleAnnotation);
}
+ }
- @Override
- public void visitAttribute(final Attribute attr) {
- attr.next = attrs;
- attrs = attr;
+ @Override
+ public AnnotationVisitor visitTypeAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (visible) {
+ return lastRuntimeVisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable, typeRef, typePath, descriptor, lastRuntimeVisibleTypeAnnotation);
+ } else {
+ return lastRuntimeInvisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable, typeRef, typePath, descriptor, lastRuntimeInvisibleTypeAnnotation);
}
+ }
- @Override
- public void visitEnd() {
+ @Override
+ public void visitAttribute(final Attribute attribute) {
+ // Store the attributes in the <i>reverse</i> order of their visit by this method.
+ attribute.nextAttribute = firstAttribute;
+ firstAttribute = attribute;
+ }
+
+ @Override
+ public void visitEnd() {
+ // Nothing to do.
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Utility methods
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the size of the field_info JVMS structure generated by this FieldWriter. Also adds the
+ * names of the attributes of this field in the constant pool.
+ *
+ * @return the size in bytes of the field_info JVMS structure.
+ */
+ int computeFieldInfoSize() {
+ // The access_flags, name_index, descriptor_index and attributes_count fields use 8 bytes.
+ int size = 8;
+ // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
+ if (constantValueIndex != 0) {
+ // ConstantValue attributes always use 8 bytes.
+ symbolTable.addConstantUtf8(Constants.CONSTANT_VALUE);
+ size += 8;
}
-
- // ------------------------------------------------------------------------
- // Utility methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns the size of this field.
- *
- * @return the size of this field.
- */
- int getSize() {
- int size = 8;
- if (value != 0) {
- cw.newUTF8("ConstantValue");
- size += 8;
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- if ((cw.version & 0xFFFF) < Opcodes.V1_5
- || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
- cw.newUTF8("Synthetic");
- size += 6;
- }
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- cw.newUTF8("Deprecated");
- size += 6;
- }
- if (ClassReader.SIGNATURES && signature != 0) {
- cw.newUTF8("Signature");
- size += 8;
- }
- if (ClassReader.ANNOTATIONS && anns != null) {
- cw.newUTF8("RuntimeVisibleAnnotations");
- size += 8 + anns.getSize();
- }
- if (ClassReader.ANNOTATIONS && ianns != null) {
- cw.newUTF8("RuntimeInvisibleAnnotations");
- size += 8 + ianns.getSize();
- }
- if (ClassReader.ANNOTATIONS && tanns != null) {
- cw.newUTF8("RuntimeVisibleTypeAnnotations");
- size += 8 + tanns.getSize();
- }
- if (ClassReader.ANNOTATIONS && itanns != null) {
- cw.newUTF8("RuntimeInvisibleTypeAnnotations");
- size += 8 + itanns.getSize();
- }
- if (attrs != null) {
- size += attrs.getSize(cw, null, 0, -1, -1);
- }
- return size;
+ size += Attribute.computeAttributesSize(symbolTable, accessFlags, signatureIndex);
+ size +=
+ AnnotationWriter.computeAnnotationsSize(
+ lastRuntimeVisibleAnnotation,
+ lastRuntimeInvisibleAnnotation,
+ lastRuntimeVisibleTypeAnnotation,
+ lastRuntimeInvisibleTypeAnnotation);
+ if (firstAttribute != null) {
+ size += firstAttribute.computeAttributesSize(symbolTable);
}
+ return size;
+ }
- /**
- * Puts the content of this field into the given byte vector.
- *
- * @param out
- * where the content of this field must be put.
- */
- void put(final ByteVector out) {
- final int FACTOR = ClassWriter.TO_ACC_SYNTHETIC;
- int mask = Opcodes.ACC_DEPRECATED | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
- | ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / FACTOR);
- out.putShort(access & ~mask).putShort(name).putShort(desc);
- int attributeCount = 0;
- if (value != 0) {
- ++attributeCount;
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- if ((cw.version & 0xFFFF) < Opcodes.V1_5
- || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
- ++attributeCount;
- }
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- ++attributeCount;
- }
- if (ClassReader.SIGNATURES && signature != 0) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && anns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && ianns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && tanns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && itanns != null) {
- ++attributeCount;
- }
- if (attrs != null) {
- attributeCount += attrs.getCount();
- }
- out.putShort(attributeCount);
- if (value != 0) {
- out.putShort(cw.newUTF8("ConstantValue"));
- out.putInt(2).putShort(value);
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- if ((cw.version & 0xFFFF) < Opcodes.V1_5
- || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
- out.putShort(cw.newUTF8("Synthetic")).putInt(0);
- }
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- out.putShort(cw.newUTF8("Deprecated")).putInt(0);
- }
- if (ClassReader.SIGNATURES && signature != 0) {
- out.putShort(cw.newUTF8("Signature"));
- out.putInt(2).putShort(signature);
- }
- if (ClassReader.ANNOTATIONS && anns != null) {
- out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
- anns.put(out);
- }
- if (ClassReader.ANNOTATIONS && ianns != null) {
- out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
- ianns.put(out);
- }
- if (ClassReader.ANNOTATIONS && tanns != null) {
- out.putShort(cw.newUTF8("RuntimeVisibleTypeAnnotations"));
- tanns.put(out);
- }
- if (ClassReader.ANNOTATIONS && itanns != null) {
- out.putShort(cw.newUTF8("RuntimeInvisibleTypeAnnotations"));
- itanns.put(out);
- }
- if (attrs != null) {
- attrs.put(cw, null, 0, -1, -1, out);
- }
+ /**
+ * Puts the content of the field_info JVMS structure generated by this FieldWriter into the given
+ * ByteVector.
+ *
+ * @param output where the field_info structure must be put.
+ */
+ void putFieldInfo(final ByteVector output) {
+ boolean useSyntheticAttribute = symbolTable.getMajorVersion() < Opcodes.V1_5;
+ // Put the access_flags, name_index and descriptor_index fields.
+ int mask = useSyntheticAttribute ? Opcodes.ACC_SYNTHETIC : 0;
+ output.putShort(accessFlags & ~mask).putShort(nameIndex).putShort(descriptorIndex);
+ // Compute and put the attributes_count field.
+ // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
+ int attributesCount = 0;
+ if (constantValueIndex != 0) {
+ ++attributesCount;
}
+ if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && useSyntheticAttribute) {
+ ++attributesCount;
+ }
+ if (signatureIndex != 0) {
+ ++attributesCount;
+ }
+ if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
+ ++attributesCount;
+ }
+ if (lastRuntimeVisibleAnnotation != null) {
+ ++attributesCount;
+ }
+ if (lastRuntimeInvisibleAnnotation != null) {
+ ++attributesCount;
+ }
+ if (lastRuntimeVisibleTypeAnnotation != null) {
+ ++attributesCount;
+ }
+ if (lastRuntimeInvisibleTypeAnnotation != null) {
+ ++attributesCount;
+ }
+ if (firstAttribute != null) {
+ attributesCount += firstAttribute.getAttributeCount();
+ }
+ output.putShort(attributesCount);
+ // Put the field_info attributes.
+ // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
+ if (constantValueIndex != 0) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.CONSTANT_VALUE))
+ .putInt(2)
+ .putShort(constantValueIndex);
+ }
+ Attribute.putAttributes(symbolTable, accessFlags, signatureIndex, output);
+ AnnotationWriter.putAnnotations(
+ symbolTable,
+ lastRuntimeVisibleAnnotation,
+ lastRuntimeInvisibleAnnotation,
+ lastRuntimeVisibleTypeAnnotation,
+ lastRuntimeInvisibleTypeAnnotation,
+ output);
+ if (firstAttribute != null) {
+ firstAttribute.putAttributes(symbolTable, output);
+ }
+ }
+
+ /**
+ * Collects the attributes of this field into the given set of attribute prototypes.
+ *
+ * @param attributePrototypes a set of attribute prototypes.
+ */
+ final void collectAttributePrototypes(final Attribute.Set attributePrototypes) {
+ attributePrototypes.addAttributes(firstAttribute);
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Frame.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Frame.java
index 9b18811..c7ce621 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Frame.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Frame.java
@@ -1,1462 +1,1473 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * Information about the input and output stack map frames of a basic block.
+ * The input and output stack map frames of a basic block.
+ *
+ * <p>Stack map frames are computed in two steps:
+ *
+ * <ul>
+ * <li>During the visit of each instruction in MethodWriter, the state of the frame at the end of
+ * the current basic block is updated by simulating the action of the instruction on the
+ * previous state of this so called "output frame".
+ * <li>After all instructions have been visited, a fix point algorithm is used in MethodWriter to
+ * compute the "input frame" of each basic block (i.e. the stack map frame at the beginning of
+ * the basic block). See {@link MethodWriter#computeAllFrames}.
+ * </ul>
+ *
+ * <p>Output stack map frames are computed relatively to the input frame of the basic block, which
+ * is not yet known when output frames are computed. It is therefore necessary to be able to
+ * represent abstract types such as "the type at position x in the input frame locals" or "the type
+ * at position x from the top of the input frame stack" or even "the type at position x in the input
+ * frame, with y more (or less) array dimensions". This explains the rather complicated type format
+ * used in this class, explained below.
+ *
+ * <p>The local variables and the operand stack of input and output frames contain values called
+ * "abstract types" hereafter. An abstract type is represented with 4 fields named DIM, KIND, FLAGS
+ * and VALUE, packed in a single int value for better performance and memory efficiency:
+ *
+ * <pre>
+ * =====================================
+ * |...DIM|KIND|.F|...............VALUE|
+ * =====================================
+ * </pre>
+ *
+ * <ul>
+ * <li>the DIM field, stored in the 6 most significant bits, is a signed number of array
+ * dimensions (from -32 to 31, included). It can be retrieved with {@link #DIM_MASK} and a
+ * right shift of {@link #DIM_SHIFT}.
+ * <li>the KIND field, stored in 4 bits, indicates the kind of VALUE used. These 4 bits can be
+ * retrieved with {@link #KIND_MASK} and, without any shift, must be equal to {@link
+ * #CONSTANT_KIND}, {@link #REFERENCE_KIND}, {@link #UNINITIALIZED_KIND}, {@link #LOCAL_KIND}
+ * or {@link #STACK_KIND}.
+ * <li>the FLAGS field, stored in 2 bits, contains up to 2 boolean flags. Currently only one flag
+ * is defined, namely {@link #TOP_IF_LONG_OR_DOUBLE_FLAG}.
+ * <li>the VALUE field, stored in the remaining 20 bits, contains either
+ * <ul>
+ * <li>one of the constants {@link #ITEM_TOP}, {@link #ITEM_ASM_BOOLEAN}, {@link
+ * #ITEM_ASM_BYTE}, {@link #ITEM_ASM_CHAR} or {@link #ITEM_ASM_SHORT}, {@link
+ * #ITEM_INTEGER}, {@link #ITEM_FLOAT}, {@link #ITEM_LONG}, {@link #ITEM_DOUBLE}, {@link
+ * #ITEM_NULL} or {@link #ITEM_UNINITIALIZED_THIS}, if KIND is equal to {@link
+ * #CONSTANT_KIND}.
+ * <li>the index of a {@link Symbol#TYPE_TAG} {@link Symbol} in the type table of a {@link
+ * SymbolTable}, if KIND is equal to {@link #REFERENCE_KIND}.
+ * <li>the index of an {@link Symbol#UNINITIALIZED_TYPE_TAG} {@link Symbol} in the type
+ * table of a SymbolTable, if KIND is equal to {@link #UNINITIALIZED_KIND}.
+ * <li>the index of a local variable in the input stack frame, if KIND is equal to {@link
+ * #LOCAL_KIND}.
+ * <li>a position relatively to the top of the stack of the input stack frame, if KIND is
+ * equal to {@link #STACK_KIND},
+ * </ul>
+ * </ul>
+ *
+ * <p>Output frames can contain abstract types of any kind and with a positive or negative array
+ * dimension (and even unassigned types, represented by 0 - which does not correspond to any valid
+ * abstract type value). Input frames can only contain CONSTANT_KIND, REFERENCE_KIND or
+ * UNINITIALIZED_KIND abstract types of positive or null array dimension. In all cases the type
+ * table contains only internal type names (array type descriptors are forbidden - array dimensions
+ * must be represented through the DIM field).
+ *
+ * <p>The LONG and DOUBLE types are always represented by using two slots (LONG + TOP or DOUBLE +
+ * TOP), for local variables as well as in the operand stack. This is necessary to be able to
+ * simulate DUPx_y instructions, whose effect would be dependent on the concrete types represented
+ * by the abstract types in the stack (which are not always known).
*
* @author Eric Bruneton
*/
-final class Frame {
+class Frame {
- /*
- * Frames are computed in a two steps process: during the visit of each
- * instruction, the state of the frame at the end of current basic block is
- * updated by simulating the action of the instruction on the previous state
- * of this so called "output frame". In visitMaxs, a fix point algorithm is
- * used to compute the "input frame" of each basic block, i.e. the stack map
- * frame at the beginning of the basic block, starting from the input frame
- * of the first basic block (which is computed from the method descriptor),
- * and by using the previously computed output frames to compute the input
- * state of the other blocks.
- *
- * All output and input frames are stored as arrays of integers. Reference
- * and array types are represented by an index into a type table (which is
- * not the same as the constant pool of the class, in order to avoid adding
- * unnecessary constants in the pool - not all computed frames will end up
- * being stored in the stack map table). This allows very fast type
- * comparisons.
- *
- * Output stack map frames are computed relatively to the input frame of the
- * basic block, which is not yet known when output frames are computed. It
- * is therefore necessary to be able to represent abstract types such as
- * "the type at position x in the input frame locals" or "the type at
- * position x from the top of the input frame stack" or even "the type at
- * position x in the input frame, with y more (or less) array dimensions".
- * This explains the rather complicated type format used in output frames.
- *
- * This format is the following: DIM KIND VALUE (4, 4 and 24 bits). DIM is a
- * signed number of array dimensions (from -8 to 7). KIND is either BASE,
- * LOCAL or STACK. BASE is used for types that are not relative to the input
- * frame. LOCAL is used for types that are relative to the input local
- * variable types. STACK is used for types that are relative to the input
- * stack types. VALUE depends on KIND. For LOCAL types, it is an index in
- * the input local variable types. For STACK types, it is a position
- * relatively to the top of input frame stack. For BASE types, it is either
- * one of the constants defined below, or for OBJECT and UNINITIALIZED
- * types, a tag and an index in the type table.
- *
- * Output frames can contain types of any kind and with a positive or
- * negative dimension (and even unassigned types, represented by 0 - which
- * does not correspond to any valid type value). Input frames can only
- * contain BASE types of positive or null dimension. In all cases the type
- * table contains only internal type names (array type descriptors are
- * forbidden - dimensions must be represented through the DIM field).
- *
- * The LONG and DOUBLE types are always represented by using two slots (LONG
- * + TOP or DOUBLE + TOP), for local variable types as well as in the
- * operand stack. This is necessary to be able to simulate DUPx_y
- * instructions, whose effect would be dependent on the actual type values
- * if types were always represented by a single slot in the stack (and this
- * is not possible, since actual type values are not always known - cf LOCAL
- * and STACK type kinds).
- */
+ // Constants used in the StackMapTable attribute.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.4.
- /**
- * Mask to get the dimension of a frame type. This dimension is a signed
- * integer between -8 and 7.
- */
- static final int DIM = 0xF0000000;
+ static final int SAME_FRAME = 0;
+ static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64;
+ static final int RESERVED = 128;
+ static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247;
+ static final int CHOP_FRAME = 248;
+ static final int SAME_FRAME_EXTENDED = 251;
+ static final int APPEND_FRAME = 252;
+ static final int FULL_FRAME = 255;
- /**
- * Constant to be added to a type to get a type with one more dimension.
- */
- static final int ARRAY_OF = 0x10000000;
+ static final int ITEM_TOP = 0;
+ static final int ITEM_INTEGER = 1;
+ static final int ITEM_FLOAT = 2;
+ static final int ITEM_DOUBLE = 3;
+ static final int ITEM_LONG = 4;
+ static final int ITEM_NULL = 5;
+ static final int ITEM_UNINITIALIZED_THIS = 6;
+ static final int ITEM_OBJECT = 7;
+ static final int ITEM_UNINITIALIZED = 8;
+ // Additional, ASM specific constants used in abstract types below.
+ private static final int ITEM_ASM_BOOLEAN = 9;
+ private static final int ITEM_ASM_BYTE = 10;
+ private static final int ITEM_ASM_CHAR = 11;
+ private static final int ITEM_ASM_SHORT = 12;
- /**
- * Constant to be added to a type to get a type with one less dimension.
- */
- static final int ELEMENT_OF = 0xF0000000;
+ // The size and offset in bits of each field of an abstract type.
- /**
- * Mask to get the kind of a frame type.
- *
- * @see #BASE
- * @see #LOCAL
- * @see #STACK
- */
- static final int KIND = 0xF000000;
+ private static final int DIM_SIZE = 6;
+ private static final int KIND_SIZE = 4;
+ private static final int FLAGS_SIZE = 2;
+ private static final int VALUE_SIZE = 32 - DIM_SIZE - KIND_SIZE - FLAGS_SIZE;
- /**
- * Flag used for LOCAL and STACK types. Indicates that if this type happens
- * to be a long or double type (during the computations of input frames),
- * then it must be set to TOP because the second word of this value has been
- * reused to store other data in the basic block. Hence the first word no
- * longer stores a valid long or double value.
- */
- static final int TOP_IF_LONG_OR_DOUBLE = 0x800000;
+ private static final int DIM_SHIFT = KIND_SIZE + FLAGS_SIZE + VALUE_SIZE;
+ private static final int KIND_SHIFT = FLAGS_SIZE + VALUE_SIZE;
+ private static final int FLAGS_SHIFT = VALUE_SIZE;
- /**
- * Mask to get the value of a frame type.
- */
- static final int VALUE = 0x7FFFFF;
+ // Bitmasks to get each field of an abstract type.
- /**
- * Mask to get the kind of base types.
- */
- static final int BASE_KIND = 0xFF00000;
+ private static final int DIM_MASK = ((1 << DIM_SIZE) - 1) << DIM_SHIFT;
+ private static final int KIND_MASK = ((1 << KIND_SIZE) - 1) << KIND_SHIFT;
+ private static final int VALUE_MASK = (1 << VALUE_SIZE) - 1;
- /**
- * Mask to get the value of base types.
- */
- static final int BASE_VALUE = 0xFFFFF;
+ // Constants to manipulate the DIM field of an abstract type.
- /**
- * Kind of the types that are not relative to an input stack map frame.
- */
- static final int BASE = 0x1000000;
+ /** The constant to be added to an abstract type to get one with one more array dimension. */
+ private static final int ARRAY_OF = +1 << DIM_SHIFT;
- /**
- * Base kind of the base reference types. The BASE_VALUE of such types is an
- * index into the type table.
- */
- static final int OBJECT = BASE | 0x700000;
+ /** The constant to be added to an abstract type to get one with one less array dimension. */
+ private static final int ELEMENT_OF = -1 << DIM_SHIFT;
- /**
- * Base kind of the uninitialized base types. The BASE_VALUE of such types
- * in an index into the type table (the Item at that index contains both an
- * instruction offset and an internal class name).
- */
- static final int UNINITIALIZED = BASE | 0x800000;
+ // Possible values for the KIND field of an abstract type.
- /**
- * Kind of the types that are relative to the local variable types of an
- * input stack map frame. The value of such types is a local variable index.
- */
- private static final int LOCAL = 0x2000000;
+ private static final int CONSTANT_KIND = 1 << KIND_SHIFT;
+ private static final int REFERENCE_KIND = 2 << KIND_SHIFT;
+ private static final int UNINITIALIZED_KIND = 3 << KIND_SHIFT;
+ private static final int LOCAL_KIND = 4 << KIND_SHIFT;
+ private static final int STACK_KIND = 5 << KIND_SHIFT;
- /**
- * Kind of the the types that are relative to the stack of an input stack
- * map frame. The value of such types is a position relatively to the top of
- * this stack.
- */
- private static final int STACK = 0x3000000;
+ // Possible flags for the FLAGS field of an abstract type.
- /**
- * The TOP type. This is a BASE type.
- */
- static final int TOP = BASE | 0;
+ /**
+ * A flag used for LOCAL_KIND and STACK_KIND abstract types, indicating that if the resolved,
+ * concrete type is LONG or DOUBLE, TOP should be used instead (because the value has been
+ * partially overridden with an xSTORE instruction).
+ */
+ private static final int TOP_IF_LONG_OR_DOUBLE_FLAG = 1 << FLAGS_SHIFT;
- /**
- * The BOOLEAN type. This is a BASE type mainly used for array types.
- */
- static final int BOOLEAN = BASE | 9;
+ // Useful predefined abstract types (all the possible CONSTANT_KIND types).
- /**
- * The BYTE type. This is a BASE type mainly used for array types.
- */
- static final int BYTE = BASE | 10;
+ private static final int TOP = CONSTANT_KIND | ITEM_TOP;
+ private static final int BOOLEAN = CONSTANT_KIND | ITEM_ASM_BOOLEAN;
+ private static final int BYTE = CONSTANT_KIND | ITEM_ASM_BYTE;
+ private static final int CHAR = CONSTANT_KIND | ITEM_ASM_CHAR;
+ private static final int SHORT = CONSTANT_KIND | ITEM_ASM_SHORT;
+ private static final int INTEGER = CONSTANT_KIND | ITEM_INTEGER;
+ private static final int FLOAT = CONSTANT_KIND | ITEM_FLOAT;
+ private static final int LONG = CONSTANT_KIND | ITEM_LONG;
+ private static final int DOUBLE = CONSTANT_KIND | ITEM_DOUBLE;
+ private static final int NULL = CONSTANT_KIND | ITEM_NULL;
+ private static final int UNINITIALIZED_THIS = CONSTANT_KIND | ITEM_UNINITIALIZED_THIS;
- /**
- * The CHAR type. This is a BASE type mainly used for array types.
- */
- static final int CHAR = BASE | 11;
+ // -----------------------------------------------------------------------------------------------
+ // Instance fields
+ // -----------------------------------------------------------------------------------------------
- /**
- * The SHORT type. This is a BASE type mainly used for array types.
- */
- static final int SHORT = BASE | 12;
+ /** The basic block to which these input and output stack map frames correspond. */
+ Label owner;
- /**
- * The INTEGER type. This is a BASE type.
- */
- static final int INTEGER = BASE | 1;
+ /** The input stack map frame locals. This is an array of abstract types. */
+ private int[] inputLocals;
- /**
- * The FLOAT type. This is a BASE type.
- */
- static final int FLOAT = BASE | 2;
+ /** The input stack map frame stack. This is an array of abstract types. */
+ private int[] inputStack;
- /**
- * The DOUBLE type. This is a BASE type.
- */
- static final int DOUBLE = BASE | 3;
+ /** The output stack map frame locals. This is an array of abstract types. */
+ private int[] outputLocals;
- /**
- * The LONG type. This is a BASE type.
- */
- static final int LONG = BASE | 4;
+ /** The output stack map frame stack. This is an array of abstract types. */
+ private int[] outputStack;
- /**
- * The NULL type. This is a BASE type.
- */
- static final int NULL = BASE | 5;
+ /**
+ * The start of the output stack, relatively to the input stack. This offset is always negative or
+ * null. A null offset means that the output stack must be appended to the input stack. A -n
+ * offset means that the first n output stack elements must replace the top n input stack
+ * elements, and that the other elements must be appended to the input stack.
+ */
+ private short outputStackStart;
- /**
- * The UNINITIALIZED_THIS type. This is a BASE type.
- */
- static final int UNINITIALIZED_THIS = BASE | 6;
+ /** The index of the top stack element in {@link #outputStack}. */
+ private short outputStackTop;
- /**
- * The stack size variation corresponding to each JVM instruction. This
- * stack variation is equal to the size of the values produced by an
- * instruction, minus the size of the values consumed by this instruction.
- */
- static final int[] SIZE;
+ /** The number of types that are initialized in the basic block. See {@link #initializations}. */
+ private int initializationCount;
- /**
- * Computes the stack size variation corresponding to each JVM instruction.
- */
- static {
- int i;
- int[] b = new int[202];
- String s = "EFFFFFFFFGGFFFGGFFFEEFGFGFEEEEEEEEEEEEEEEEEEEEDEDEDDDDD"
- + "CDCDEEEEEEEEEEEEEEEEEEEEBABABBBBDCFFFGGGEDCDCDCDCDCDCDCDCD"
- + "CDCEEEEDDDDDDDCDCDCEFEFDDEEFFDEDEEEBDDBBDDDDDDCCCCCCCCEFED"
- + "DDCDCDEEEEEEEEEEFEEEEEEDDEEDDEE";
- for (i = 0; i < b.length; ++i) {
- b[i] = s.charAt(i) - 'E';
- }
- SIZE = b;
+ /**
+ * The abstract types that are initialized in the basic block. A constructor invocation on an
+ * UNINITIALIZED or UNINITIALIZED_THIS abstract type must replace <i>every occurrence</i> of this
+ * type in the local variables and in the operand stack. This cannot be done during the first step
+ * of the algorithm since, during this step, the local variables and the operand stack types are
+ * still abstract. It is therefore necessary to store the abstract types of the constructors which
+ * are invoked in the basic block, in order to do this replacement during the second step of the
+ * algorithm, where the frames are fully computed. Note that this array can contain abstract types
+ * that are relative to the input locals or to the input stack.
+ */
+ private int[] initializations;
- // code to generate the above string
- //
- // int NA = 0; // not applicable (unused opcode or variable size opcode)
- //
- // b = new int[] {
- // 0, //NOP, // visitInsn
- // 1, //ACONST_NULL, // -
- // 1, //ICONST_M1, // -
- // 1, //ICONST_0, // -
- // 1, //ICONST_1, // -
- // 1, //ICONST_2, // -
- // 1, //ICONST_3, // -
- // 1, //ICONST_4, // -
- // 1, //ICONST_5, // -
- // 2, //LCONST_0, // -
- // 2, //LCONST_1, // -
- // 1, //FCONST_0, // -
- // 1, //FCONST_1, // -
- // 1, //FCONST_2, // -
- // 2, //DCONST_0, // -
- // 2, //DCONST_1, // -
- // 1, //BIPUSH, // visitIntInsn
- // 1, //SIPUSH, // -
- // 1, //LDC, // visitLdcInsn
- // NA, //LDC_W, // -
- // NA, //LDC2_W, // -
- // 1, //ILOAD, // visitVarInsn
- // 2, //LLOAD, // -
- // 1, //FLOAD, // -
- // 2, //DLOAD, // -
- // 1, //ALOAD, // -
- // NA, //ILOAD_0, // -
- // NA, //ILOAD_1, // -
- // NA, //ILOAD_2, // -
- // NA, //ILOAD_3, // -
- // NA, //LLOAD_0, // -
- // NA, //LLOAD_1, // -
- // NA, //LLOAD_2, // -
- // NA, //LLOAD_3, // -
- // NA, //FLOAD_0, // -
- // NA, //FLOAD_1, // -
- // NA, //FLOAD_2, // -
- // NA, //FLOAD_3, // -
- // NA, //DLOAD_0, // -
- // NA, //DLOAD_1, // -
- // NA, //DLOAD_2, // -
- // NA, //DLOAD_3, // -
- // NA, //ALOAD_0, // -
- // NA, //ALOAD_1, // -
- // NA, //ALOAD_2, // -
- // NA, //ALOAD_3, // -
- // -1, //IALOAD, // visitInsn
- // 0, //LALOAD, // -
- // -1, //FALOAD, // -
- // 0, //DALOAD, // -
- // -1, //AALOAD, // -
- // -1, //BALOAD, // -
- // -1, //CALOAD, // -
- // -1, //SALOAD, // -
- // -1, //ISTORE, // visitVarInsn
- // -2, //LSTORE, // -
- // -1, //FSTORE, // -
- // -2, //DSTORE, // -
- // -1, //ASTORE, // -
- // NA, //ISTORE_0, // -
- // NA, //ISTORE_1, // -
- // NA, //ISTORE_2, // -
- // NA, //ISTORE_3, // -
- // NA, //LSTORE_0, // -
- // NA, //LSTORE_1, // -
- // NA, //LSTORE_2, // -
- // NA, //LSTORE_3, // -
- // NA, //FSTORE_0, // -
- // NA, //FSTORE_1, // -
- // NA, //FSTORE_2, // -
- // NA, //FSTORE_3, // -
- // NA, //DSTORE_0, // -
- // NA, //DSTORE_1, // -
- // NA, //DSTORE_2, // -
- // NA, //DSTORE_3, // -
- // NA, //ASTORE_0, // -
- // NA, //ASTORE_1, // -
- // NA, //ASTORE_2, // -
- // NA, //ASTORE_3, // -
- // -3, //IASTORE, // visitInsn
- // -4, //LASTORE, // -
- // -3, //FASTORE, // -
- // -4, //DASTORE, // -
- // -3, //AASTORE, // -
- // -3, //BASTORE, // -
- // -3, //CASTORE, // -
- // -3, //SASTORE, // -
- // -1, //POP, // -
- // -2, //POP2, // -
- // 1, //DUP, // -
- // 1, //DUP_X1, // -
- // 1, //DUP_X2, // -
- // 2, //DUP2, // -
- // 2, //DUP2_X1, // -
- // 2, //DUP2_X2, // -
- // 0, //SWAP, // -
- // -1, //IADD, // -
- // -2, //LADD, // -
- // -1, //FADD, // -
- // -2, //DADD, // -
- // -1, //ISUB, // -
- // -2, //LSUB, // -
- // -1, //FSUB, // -
- // -2, //DSUB, // -
- // -1, //IMUL, // -
- // -2, //LMUL, // -
- // -1, //FMUL, // -
- // -2, //DMUL, // -
- // -1, //IDIV, // -
- // -2, //LDIV, // -
- // -1, //FDIV, // -
- // -2, //DDIV, // -
- // -1, //IREM, // -
- // -2, //LREM, // -
- // -1, //FREM, // -
- // -2, //DREM, // -
- // 0, //INEG, // -
- // 0, //LNEG, // -
- // 0, //FNEG, // -
- // 0, //DNEG, // -
- // -1, //ISHL, // -
- // -1, //LSHL, // -
- // -1, //ISHR, // -
- // -1, //LSHR, // -
- // -1, //IUSHR, // -
- // -1, //LUSHR, // -
- // -1, //IAND, // -
- // -2, //LAND, // -
- // -1, //IOR, // -
- // -2, //LOR, // -
- // -1, //IXOR, // -
- // -2, //LXOR, // -
- // 0, //IINC, // visitIincInsn
- // 1, //I2L, // visitInsn
- // 0, //I2F, // -
- // 1, //I2D, // -
- // -1, //L2I, // -
- // -1, //L2F, // -
- // 0, //L2D, // -
- // 0, //F2I, // -
- // 1, //F2L, // -
- // 1, //F2D, // -
- // -1, //D2I, // -
- // 0, //D2L, // -
- // -1, //D2F, // -
- // 0, //I2B, // -
- // 0, //I2C, // -
- // 0, //I2S, // -
- // -3, //LCMP, // -
- // -1, //FCMPL, // -
- // -1, //FCMPG, // -
- // -3, //DCMPL, // -
- // -3, //DCMPG, // -
- // -1, //IFEQ, // visitJumpInsn
- // -1, //IFNE, // -
- // -1, //IFLT, // -
- // -1, //IFGE, // -
- // -1, //IFGT, // -
- // -1, //IFLE, // -
- // -2, //IF_ICMPEQ, // -
- // -2, //IF_ICMPNE, // -
- // -2, //IF_ICMPLT, // -
- // -2, //IF_ICMPGE, // -
- // -2, //IF_ICMPGT, // -
- // -2, //IF_ICMPLE, // -
- // -2, //IF_ACMPEQ, // -
- // -2, //IF_ACMPNE, // -
- // 0, //GOTO, // -
- // 1, //JSR, // -
- // 0, //RET, // visitVarInsn
- // -1, //TABLESWITCH, // visiTableSwitchInsn
- // -1, //LOOKUPSWITCH, // visitLookupSwitch
- // -1, //IRETURN, // visitInsn
- // -2, //LRETURN, // -
- // -1, //FRETURN, // -
- // -2, //DRETURN, // -
- // -1, //ARETURN, // -
- // 0, //RETURN, // -
- // NA, //GETSTATIC, // visitFieldInsn
- // NA, //PUTSTATIC, // -
- // NA, //GETFIELD, // -
- // NA, //PUTFIELD, // -
- // NA, //INVOKEVIRTUAL, // visitMethodInsn
- // NA, //INVOKESPECIAL, // -
- // NA, //INVOKESTATIC, // -
- // NA, //INVOKEINTERFACE, // -
- // NA, //INVOKEDYNAMIC, // visitInvokeDynamicInsn
- // 1, //NEW, // visitTypeInsn
- // 0, //NEWARRAY, // visitIntInsn
- // 0, //ANEWARRAY, // visitTypeInsn
- // 0, //ARRAYLENGTH, // visitInsn
- // NA, //ATHROW, // -
- // 0, //CHECKCAST, // visitTypeInsn
- // 0, //INSTANCEOF, // -
- // -1, //MONITORENTER, // visitInsn
- // -1, //MONITOREXIT, // -
- // NA, //WIDE, // NOT VISITED
- // NA, //MULTIANEWARRAY, // visitMultiANewArrayInsn
- // -1, //IFNULL, // visitJumpInsn
- // -1, //IFNONNULL, // -
- // NA, //GOTO_W, // -
- // NA, //JSR_W, // -
- // };
- // for (i = 0; i < b.length; ++i) {
- // System.err.print((char)('E' + b[i]));
- // }
- // System.err.println();
+ // -----------------------------------------------------------------------------------------------
+ // Constructor
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Constructs a new Frame.
+ *
+ * @param owner the basic block to which these input and output stack map frames correspond.
+ */
+ Frame(final Label owner) {
+ this.owner = owner;
+ }
+
+ /**
+ * Sets this frame to the value of the given frame.
+ *
+ * <p>WARNING: after this method is called the two frames share the same data structures. It is
+ * recommended to discard the given frame to avoid unexpected side effects.
+ *
+ * @param frame The new frame value.
+ */
+ final void copyFrom(final Frame frame) {
+ inputLocals = frame.inputLocals;
+ inputStack = frame.inputStack;
+ outputStackStart = 0;
+ outputLocals = frame.outputLocals;
+ outputStack = frame.outputStack;
+ outputStackTop = frame.outputStackTop;
+ initializationCount = frame.initializationCount;
+ initializations = frame.initializations;
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Static methods to get abstract types from other type formats
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the abstract type corresponding to the given public API frame element type.
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param type a frame element type described using the same format as in {@link
+ * MethodVisitor#visitFrame}, i.e. either {@link Opcodes#TOP}, {@link Opcodes#INTEGER}, {@link
+ * Opcodes#FLOAT}, {@link Opcodes#LONG}, {@link Opcodes#DOUBLE}, {@link Opcodes#NULL}, or
+ * {@link Opcodes#UNINITIALIZED_THIS}, or the internal name of a class, or a Label designating
+ * a NEW instruction (for uninitialized types).
+ * @return the abstract type corresponding to the given frame element type.
+ */
+ static int getAbstractTypeFromApiFormat(final SymbolTable symbolTable, final Object type) {
+ if (type instanceof Integer) {
+ return CONSTANT_KIND | ((Integer) type).intValue();
+ } else if (type instanceof String) {
+ String descriptor = Type.getObjectType((String) type).getDescriptor();
+ return getAbstractTypeFromDescriptor(symbolTable, descriptor, 0);
+ } else {
+ return UNINITIALIZED_KIND
+ | symbolTable.addUninitializedType("", ((Label) type).bytecodeOffset);
}
+ }
- /**
- * The label (i.e. basic block) to which these input and output stack map
- * frames correspond.
- */
- Label owner;
+ /**
+ * Returns the abstract type corresponding to the internal name of a class.
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param internalName the internal name of a class. This must <i>not</i> be an array type
+ * descriptor.
+ * @return the abstract type value corresponding to the given internal name.
+ */
+ static int getAbstractTypeFromInternalName(
+ final SymbolTable symbolTable, final String internalName) {
+ return REFERENCE_KIND | symbolTable.addType(internalName);
+ }
- /**
- * The input stack map frame locals.
- */
- int[] inputLocals;
+ /**
+ * Returns the abstract type corresponding to the given type descriptor.
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param buffer a string ending with a type descriptor.
+ * @param offset the start offset of the type descriptor in buffer.
+ * @return the abstract type corresponding to the given type descriptor.
+ */
+ private static int getAbstractTypeFromDescriptor(
+ final SymbolTable symbolTable, final String buffer, final int offset) {
+ String internalName;
+ switch (buffer.charAt(offset)) {
+ case 'V':
+ return 0;
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ return INTEGER;
+ case 'F':
+ return FLOAT;
+ case 'J':
+ return LONG;
+ case 'D':
+ return DOUBLE;
+ case 'L':
+ internalName = buffer.substring(offset + 1, buffer.length() - 1);
+ return REFERENCE_KIND | symbolTable.addType(internalName);
+ case '[':
+ int elementDescriptorOffset = offset + 1;
+ while (buffer.charAt(elementDescriptorOffset) == '[') {
+ ++elementDescriptorOffset;
+ }
+ int typeValue;
+ switch (buffer.charAt(elementDescriptorOffset)) {
+ case 'Z':
+ typeValue = BOOLEAN;
+ break;
+ case 'C':
+ typeValue = CHAR;
+ break;
+ case 'B':
+ typeValue = BYTE;
+ break;
+ case 'S':
+ typeValue = SHORT;
+ break;
+ case 'I':
+ typeValue = INTEGER;
+ break;
+ case 'F':
+ typeValue = FLOAT;
+ break;
+ case 'J':
+ typeValue = LONG;
+ break;
+ case 'D':
+ typeValue = DOUBLE;
+ break;
+ case 'L':
+ internalName = buffer.substring(elementDescriptorOffset + 1, buffer.length() - 1);
+ typeValue = REFERENCE_KIND | symbolTable.addType(internalName);
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ return ((elementDescriptorOffset - offset) << DIM_SHIFT) | typeValue;
+ default:
+ throw new IllegalArgumentException();
+ }
+ }
- /**
- * The input stack map frame stack.
- */
- int[] inputStack;
+ // -----------------------------------------------------------------------------------------------
+ // Methods related to the input frame
+ // -----------------------------------------------------------------------------------------------
- /**
- * The output stack map frame locals.
- */
- private int[] outputLocals;
+ /**
+ * Sets the input frame from the given method description. This method is used to initialize the
+ * first frame of a method, which is implicit (i.e. not stored explicitly in the StackMapTable
+ * attribute).
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param access the method's access flags.
+ * @param descriptor the method descriptor.
+ * @param maxLocals the maximum number of local variables of the method.
+ */
+ final void setInputFrameFromDescriptor(
+ final SymbolTable symbolTable,
+ final int access,
+ final String descriptor,
+ final int maxLocals) {
+ inputLocals = new int[maxLocals];
+ inputStack = new int[0];
+ int inputLocalIndex = 0;
+ if ((access & Opcodes.ACC_STATIC) == 0) {
+ if ((access & Constants.ACC_CONSTRUCTOR) == 0) {
+ inputLocals[inputLocalIndex++] =
+ REFERENCE_KIND | symbolTable.addType(symbolTable.getClassName());
+ } else {
+ inputLocals[inputLocalIndex++] = UNINITIALIZED_THIS;
+ }
+ }
+ for (Type argumentType : Type.getArgumentTypes(descriptor)) {
+ int abstractType =
+ getAbstractTypeFromDescriptor(symbolTable, argumentType.getDescriptor(), 0);
+ inputLocals[inputLocalIndex++] = abstractType;
+ if (abstractType == LONG || abstractType == DOUBLE) {
+ inputLocals[inputLocalIndex++] = TOP;
+ }
+ }
+ while (inputLocalIndex < maxLocals) {
+ inputLocals[inputLocalIndex++] = TOP;
+ }
+ }
- /**
- * The output stack map frame stack.
- */
- private int[] outputStack;
+ /**
+ * Sets the input frame from the given public API frame description.
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param numLocal the number of local variables.
+ * @param local the local variable types, described using the same format as in {@link
+ * MethodVisitor#visitFrame}.
+ * @param numStack the number of operand stack elements.
+ * @param stack the operand stack types, described using the same format as in {@link
+ * MethodVisitor#visitFrame}.
+ */
+ final void setInputFrameFromApiFormat(
+ final SymbolTable symbolTable,
+ final int numLocal,
+ final Object[] local,
+ final int numStack,
+ final Object[] stack) {
+ int inputLocalIndex = 0;
+ for (int i = 0; i < numLocal; ++i) {
+ inputLocals[inputLocalIndex++] = getAbstractTypeFromApiFormat(symbolTable, local[i]);
+ if (local[i] == Opcodes.LONG || local[i] == Opcodes.DOUBLE) {
+ inputLocals[inputLocalIndex++] = TOP;
+ }
+ }
+ while (inputLocalIndex < inputLocals.length) {
+ inputLocals[inputLocalIndex++] = TOP;
+ }
+ int numStackTop = 0;
+ for (int i = 0; i < numStack; ++i) {
+ if (stack[i] == Opcodes.LONG || stack[i] == Opcodes.DOUBLE) {
+ ++numStackTop;
+ }
+ }
+ inputStack = new int[numStack + numStackTop];
+ int inputStackIndex = 0;
+ for (int i = 0; i < numStack; ++i) {
+ inputStack[inputStackIndex++] = getAbstractTypeFromApiFormat(symbolTable, stack[i]);
+ if (stack[i] == Opcodes.LONG || stack[i] == Opcodes.DOUBLE) {
+ inputStack[inputStackIndex++] = TOP;
+ }
+ }
+ outputStackTop = 0;
+ initializationCount = 0;
+ }
- /**
- * Relative size of the output stack. The exact semantics of this field
- * depends on the algorithm that is used.
- *
- * When only the maximum stack size is computed, this field is the size of
- * the output stack relatively to the top of the input stack.
- *
- * When the stack map frames are completely computed, this field is the
- * actual number of types in {@link #outputStack}.
- */
- private int outputStackTop;
+ final int getInputStackSize() {
+ return inputStack.length;
+ }
- /**
- * Number of types that are initialized in the basic block.
- *
- * @see #initializations
- */
- private int initializationCount;
+ // -----------------------------------------------------------------------------------------------
+ // Methods related to the output frame
+ // -----------------------------------------------------------------------------------------------
- /**
- * The types that are initialized in the basic block. A constructor
- * invocation on an UNINITIALIZED or UNINITIALIZED_THIS type must replace
- * <i>every occurence</i> of this type in the local variables and in the
- * operand stack. This cannot be done during the first phase of the
- * algorithm since, during this phase, the local variables and the operand
- * stack are not completely computed. It is therefore necessary to store the
- * types on which constructors are invoked in the basic block, in order to
- * do this replacement during the second phase of the algorithm, where the
- * frames are fully computed. Note that this array can contain types that
- * are relative to input locals or to the input stack (see below for the
- * description of the algorithm).
- */
- private int[] initializations;
+ /**
+ * Returns the abstract type stored at the given local variable index in the output frame.
+ *
+ * @param localIndex the index of the local variable whose value must be returned.
+ * @return the abstract type stored at the given local variable index in the output frame.
+ */
+ private int getLocal(final int localIndex) {
+ if (outputLocals == null || localIndex >= outputLocals.length) {
+ // If this local has never been assigned in this basic block, it is still equal to its value
+ // in the input frame.
+ return LOCAL_KIND | localIndex;
+ } else {
+ int abstractType = outputLocals[localIndex];
+ if (abstractType == 0) {
+ // If this local has never been assigned in this basic block, so it is still equal to its
+ // value in the input frame.
+ abstractType = outputLocals[localIndex] = LOCAL_KIND | localIndex;
+ }
+ return abstractType;
+ }
+ }
- /**
- * Returns the output frame local variable type at the given index.
- *
- * @param local
- * the index of the local that must be returned.
- * @return the output frame local variable type at the given index.
- */
- private int get(final int local) {
- if (outputLocals == null || local >= outputLocals.length) {
- // this local has never been assigned in this basic block,
- // so it is still equal to its value in the input frame
- return LOCAL | local;
+ /**
+ * Replaces the abstract type stored at the given local variable index in the output frame.
+ *
+ * @param localIndex the index of the output frame local variable that must be set.
+ * @param abstractType the value that must be set.
+ */
+ private void setLocal(final int localIndex, final int abstractType) {
+ // Create and/or resize the output local variables array if necessary.
+ if (outputLocals == null) {
+ outputLocals = new int[10];
+ }
+ int outputLocalsLength = outputLocals.length;
+ if (localIndex >= outputLocalsLength) {
+ int[] newOutputLocals = new int[Math.max(localIndex + 1, 2 * outputLocalsLength)];
+ System.arraycopy(outputLocals, 0, newOutputLocals, 0, outputLocalsLength);
+ outputLocals = newOutputLocals;
+ }
+ // Set the local variable.
+ outputLocals[localIndex] = abstractType;
+ }
+
+ /**
+ * Pushes the given abstract type on the output frame stack.
+ *
+ * @param abstractType an abstract type.
+ */
+ private void push(final int abstractType) {
+ // Create and/or resize the output stack array if necessary.
+ if (outputStack == null) {
+ outputStack = new int[10];
+ }
+ int outputStackLength = outputStack.length;
+ if (outputStackTop >= outputStackLength) {
+ int[] newOutputStack = new int[Math.max(outputStackTop + 1, 2 * outputStackLength)];
+ System.arraycopy(outputStack, 0, newOutputStack, 0, outputStackLength);
+ outputStack = newOutputStack;
+ }
+ // Pushes the abstract type on the output stack.
+ outputStack[outputStackTop++] = abstractType;
+ // Updates the maximum size reached by the output stack, if needed (note that this size is
+ // relative to the input stack size, which is not known yet).
+ short outputStackSize = (short) (outputStackStart + outputStackTop);
+ if (outputStackSize > owner.outputStackMax) {
+ owner.outputStackMax = outputStackSize;
+ }
+ }
+
+ /**
+ * Pushes the abstract type corresponding to the given descriptor on the output frame stack.
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param descriptor a type or method descriptor (in which case its return type is pushed).
+ */
+ private void push(final SymbolTable symbolTable, final String descriptor) {
+ int typeDescriptorOffset =
+ descriptor.charAt(0) == '(' ? Type.getReturnTypeOffset(descriptor) : 0;
+ int abstractType = getAbstractTypeFromDescriptor(symbolTable, descriptor, typeDescriptorOffset);
+ if (abstractType != 0) {
+ push(abstractType);
+ if (abstractType == LONG || abstractType == DOUBLE) {
+ push(TOP);
+ }
+ }
+ }
+
+ /**
+ * Pops an abstract type from the output frame stack and returns its value.
+ *
+ * @return the abstract type that has been popped from the output frame stack.
+ */
+ private int pop() {
+ if (outputStackTop > 0) {
+ return outputStack[--outputStackTop];
+ } else {
+ // If the output frame stack is empty, pop from the input stack.
+ return STACK_KIND | -(--outputStackStart);
+ }
+ }
+
+ /**
+ * Pops the given number of abstract types from the output frame stack.
+ *
+ * @param elements the number of abstract types that must be popped.
+ */
+ private void pop(final int elements) {
+ if (outputStackTop >= elements) {
+ outputStackTop -= elements;
+ } else {
+ // If the number of elements to be popped is greater than the number of elements in the output
+ // stack, clear it, and pop the remaining elements from the input stack.
+ outputStackStart -= elements - outputStackTop;
+ outputStackTop = 0;
+ }
+ }
+
+ /**
+ * Pops as many abstract types from the output frame stack as described by the given descriptor.
+ *
+ * @param descriptor a type or method descriptor (in which case its argument types are popped).
+ */
+ private void pop(final String descriptor) {
+ char firstDescriptorChar = descriptor.charAt(0);
+ if (firstDescriptorChar == '(') {
+ pop((Type.getArgumentsAndReturnSizes(descriptor) >> 2) - 1);
+ } else if (firstDescriptorChar == 'J' || firstDescriptorChar == 'D') {
+ pop(2);
+ } else {
+ pop(1);
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Methods to handle uninitialized types
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Adds an abstract type to the list of types on which a constructor is invoked in the basic
+ * block.
+ *
+ * @param abstractType an abstract type on a which a constructor is invoked.
+ */
+ private void addInitializedType(final int abstractType) {
+ // Create and/or resize the initializations array if necessary.
+ if (initializations == null) {
+ initializations = new int[2];
+ }
+ int initializationsLength = initializations.length;
+ if (initializationCount >= initializationsLength) {
+ int[] newInitializations =
+ new int[Math.max(initializationCount + 1, 2 * initializationsLength)];
+ System.arraycopy(initializations, 0, newInitializations, 0, initializationsLength);
+ initializations = newInitializations;
+ }
+ // Store the abstract type.
+ initializations[initializationCount++] = abstractType;
+ }
+
+ /**
+ * Returns the "initialized" abstract type corresponding to the given abstract type.
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param abstractType an abstract type.
+ * @return the REFERENCE_KIND abstract type corresponding to abstractType if it is
+ * UNINITIALIZED_THIS or an UNINITIALIZED_KIND abstract type for one of the types on which a
+ * constructor is invoked in the basic block. Otherwise returns abstractType.
+ */
+ private int getInitializedType(final SymbolTable symbolTable, final int abstractType) {
+ if (abstractType == UNINITIALIZED_THIS
+ || (abstractType & (DIM_MASK | KIND_MASK)) == UNINITIALIZED_KIND) {
+ for (int i = 0; i < initializationCount; ++i) {
+ int initializedType = initializations[i];
+ int dim = initializedType & DIM_MASK;
+ int kind = initializedType & KIND_MASK;
+ int value = initializedType & VALUE_MASK;
+ if (kind == LOCAL_KIND) {
+ initializedType = dim + inputLocals[value];
+ } else if (kind == STACK_KIND) {
+ initializedType = dim + inputStack[inputStack.length - value];
+ }
+ if (abstractType == initializedType) {
+ if (abstractType == UNINITIALIZED_THIS) {
+ return REFERENCE_KIND | symbolTable.addType(symbolTable.getClassName());
+ } else {
+ return REFERENCE_KIND
+ | symbolTable.addType(symbolTable.getType(abstractType & VALUE_MASK).value);
+ }
+ }
+ }
+ }
+ return abstractType;
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Main method, to simulate the execution of each instruction on the output frame
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Simulates the action of the given instruction on the output stack frame.
+ *
+ * @param opcode the opcode of the instruction.
+ * @param arg the numeric operand of the instruction, if any.
+ * @param argSymbol the Symbol operand of the instruction, if any.
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ */
+ void execute(
+ final int opcode, final int arg, final Symbol argSymbol, final SymbolTable symbolTable) {
+ // Abstract types popped from the stack or read from local variables.
+ int abstractType1;
+ int abstractType2;
+ int abstractType3;
+ int abstractType4;
+ switch (opcode) {
+ case Opcodes.NOP:
+ case Opcodes.INEG:
+ case Opcodes.LNEG:
+ case Opcodes.FNEG:
+ case Opcodes.DNEG:
+ case Opcodes.I2B:
+ case Opcodes.I2C:
+ case Opcodes.I2S:
+ case Opcodes.GOTO:
+ case Opcodes.RETURN:
+ break;
+ case Opcodes.ACONST_NULL:
+ push(NULL);
+ break;
+ case Opcodes.ICONST_M1:
+ case Opcodes.ICONST_0:
+ case Opcodes.ICONST_1:
+ case Opcodes.ICONST_2:
+ case Opcodes.ICONST_3:
+ case Opcodes.ICONST_4:
+ case Opcodes.ICONST_5:
+ case Opcodes.BIPUSH:
+ case Opcodes.SIPUSH:
+ case Opcodes.ILOAD:
+ push(INTEGER);
+ break;
+ case Opcodes.LCONST_0:
+ case Opcodes.LCONST_1:
+ case Opcodes.LLOAD:
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.FCONST_0:
+ case Opcodes.FCONST_1:
+ case Opcodes.FCONST_2:
+ case Opcodes.FLOAD:
+ push(FLOAT);
+ break;
+ case Opcodes.DCONST_0:
+ case Opcodes.DCONST_1:
+ case Opcodes.DLOAD:
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Opcodes.LDC:
+ switch (argSymbol.tag) {
+ case Symbol.CONSTANT_INTEGER_TAG:
+ push(INTEGER);
+ break;
+ case Symbol.CONSTANT_LONG_TAG:
+ push(LONG);
+ push(TOP);
+ break;
+ case Symbol.CONSTANT_FLOAT_TAG:
+ push(FLOAT);
+ break;
+ case Symbol.CONSTANT_DOUBLE_TAG:
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Symbol.CONSTANT_CLASS_TAG:
+ push(REFERENCE_KIND | symbolTable.addType("java/lang/Class"));
+ break;
+ case Symbol.CONSTANT_STRING_TAG:
+ push(REFERENCE_KIND | symbolTable.addType("java/lang/String"));
+ break;
+ case Symbol.CONSTANT_METHOD_TYPE_TAG:
+ push(REFERENCE_KIND | symbolTable.addType("java/lang/invoke/MethodType"));
+ break;
+ case Symbol.CONSTANT_METHOD_HANDLE_TAG:
+ push(REFERENCE_KIND | symbolTable.addType("java/lang/invoke/MethodHandle"));
+ break;
+ case Symbol.CONSTANT_DYNAMIC_TAG:
+ push(symbolTable, argSymbol.value);
+ break;
+ default:
+ throw new AssertionError();
+ }
+ break;
+ case Opcodes.ALOAD:
+ push(getLocal(arg));
+ break;
+ case Opcodes.LALOAD:
+ case Opcodes.D2L:
+ pop(2);
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.DALOAD:
+ case Opcodes.L2D:
+ pop(2);
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Opcodes.AALOAD:
+ pop(1);
+ abstractType1 = pop();
+ push(abstractType1 == NULL ? abstractType1 : ELEMENT_OF + abstractType1);
+ break;
+ case Opcodes.ISTORE:
+ case Opcodes.FSTORE:
+ case Opcodes.ASTORE:
+ abstractType1 = pop();
+ setLocal(arg, abstractType1);
+ if (arg > 0) {
+ int previousLocalType = getLocal(arg - 1);
+ if (previousLocalType == LONG || previousLocalType == DOUBLE) {
+ setLocal(arg - 1, TOP);
+ } else if ((previousLocalType & KIND_MASK) == LOCAL_KIND
+ || (previousLocalType & KIND_MASK) == STACK_KIND) {
+ // The type of the previous local variable is not known yet, but if it later appears
+ // to be LONG or DOUBLE, we should then use TOP instead.
+ setLocal(arg - 1, previousLocalType | TOP_IF_LONG_OR_DOUBLE_FLAG);
+ }
+ }
+ break;
+ case Opcodes.LSTORE:
+ case Opcodes.DSTORE:
+ pop(1);
+ abstractType1 = pop();
+ setLocal(arg, abstractType1);
+ setLocal(arg + 1, TOP);
+ if (arg > 0) {
+ int previousLocalType = getLocal(arg - 1);
+ if (previousLocalType == LONG || previousLocalType == DOUBLE) {
+ setLocal(arg - 1, TOP);
+ } else if ((previousLocalType & KIND_MASK) == LOCAL_KIND
+ || (previousLocalType & KIND_MASK) == STACK_KIND) {
+ // The type of the previous local variable is not known yet, but if it later appears
+ // to be LONG or DOUBLE, we should then use TOP instead.
+ setLocal(arg - 1, previousLocalType | TOP_IF_LONG_OR_DOUBLE_FLAG);
+ }
+ }
+ break;
+ case Opcodes.IASTORE:
+ case Opcodes.BASTORE:
+ case Opcodes.CASTORE:
+ case Opcodes.SASTORE:
+ case Opcodes.FASTORE:
+ case Opcodes.AASTORE:
+ pop(3);
+ break;
+ case Opcodes.LASTORE:
+ case Opcodes.DASTORE:
+ pop(4);
+ break;
+ case Opcodes.POP:
+ case Opcodes.IFEQ:
+ case Opcodes.IFNE:
+ case Opcodes.IFLT:
+ case Opcodes.IFGE:
+ case Opcodes.IFGT:
+ case Opcodes.IFLE:
+ case Opcodes.IRETURN:
+ case Opcodes.FRETURN:
+ case Opcodes.ARETURN:
+ case Opcodes.TABLESWITCH:
+ case Opcodes.LOOKUPSWITCH:
+ case Opcodes.ATHROW:
+ case Opcodes.MONITORENTER:
+ case Opcodes.MONITOREXIT:
+ case Opcodes.IFNULL:
+ case Opcodes.IFNONNULL:
+ pop(1);
+ break;
+ case Opcodes.POP2:
+ case Opcodes.IF_ICMPEQ:
+ case Opcodes.IF_ICMPNE:
+ case Opcodes.IF_ICMPLT:
+ case Opcodes.IF_ICMPGE:
+ case Opcodes.IF_ICMPGT:
+ case Opcodes.IF_ICMPLE:
+ case Opcodes.IF_ACMPEQ:
+ case Opcodes.IF_ACMPNE:
+ case Opcodes.LRETURN:
+ case Opcodes.DRETURN:
+ pop(2);
+ break;
+ case Opcodes.DUP:
+ abstractType1 = pop();
+ push(abstractType1);
+ push(abstractType1);
+ break;
+ case Opcodes.DUP_X1:
+ abstractType1 = pop();
+ abstractType2 = pop();
+ push(abstractType1);
+ push(abstractType2);
+ push(abstractType1);
+ break;
+ case Opcodes.DUP_X2:
+ abstractType1 = pop();
+ abstractType2 = pop();
+ abstractType3 = pop();
+ push(abstractType1);
+ push(abstractType3);
+ push(abstractType2);
+ push(abstractType1);
+ break;
+ case Opcodes.DUP2:
+ abstractType1 = pop();
+ abstractType2 = pop();
+ push(abstractType2);
+ push(abstractType1);
+ push(abstractType2);
+ push(abstractType1);
+ break;
+ case Opcodes.DUP2_X1:
+ abstractType1 = pop();
+ abstractType2 = pop();
+ abstractType3 = pop();
+ push(abstractType2);
+ push(abstractType1);
+ push(abstractType3);
+ push(abstractType2);
+ push(abstractType1);
+ break;
+ case Opcodes.DUP2_X2:
+ abstractType1 = pop();
+ abstractType2 = pop();
+ abstractType3 = pop();
+ abstractType4 = pop();
+ push(abstractType2);
+ push(abstractType1);
+ push(abstractType4);
+ push(abstractType3);
+ push(abstractType2);
+ push(abstractType1);
+ break;
+ case Opcodes.SWAP:
+ abstractType1 = pop();
+ abstractType2 = pop();
+ push(abstractType1);
+ push(abstractType2);
+ break;
+ case Opcodes.IALOAD:
+ case Opcodes.BALOAD:
+ case Opcodes.CALOAD:
+ case Opcodes.SALOAD:
+ case Opcodes.IADD:
+ case Opcodes.ISUB:
+ case Opcodes.IMUL:
+ case Opcodes.IDIV:
+ case Opcodes.IREM:
+ case Opcodes.IAND:
+ case Opcodes.IOR:
+ case Opcodes.IXOR:
+ case Opcodes.ISHL:
+ case Opcodes.ISHR:
+ case Opcodes.IUSHR:
+ case Opcodes.L2I:
+ case Opcodes.D2I:
+ case Opcodes.FCMPL:
+ case Opcodes.FCMPG:
+ pop(2);
+ push(INTEGER);
+ break;
+ case Opcodes.LADD:
+ case Opcodes.LSUB:
+ case Opcodes.LMUL:
+ case Opcodes.LDIV:
+ case Opcodes.LREM:
+ case Opcodes.LAND:
+ case Opcodes.LOR:
+ case Opcodes.LXOR:
+ pop(4);
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.FALOAD:
+ case Opcodes.FADD:
+ case Opcodes.FSUB:
+ case Opcodes.FMUL:
+ case Opcodes.FDIV:
+ case Opcodes.FREM:
+ case Opcodes.L2F:
+ case Opcodes.D2F:
+ pop(2);
+ push(FLOAT);
+ break;
+ case Opcodes.DADD:
+ case Opcodes.DSUB:
+ case Opcodes.DMUL:
+ case Opcodes.DDIV:
+ case Opcodes.DREM:
+ pop(4);
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Opcodes.LSHL:
+ case Opcodes.LSHR:
+ case Opcodes.LUSHR:
+ pop(3);
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.IINC:
+ setLocal(arg, INTEGER);
+ break;
+ case Opcodes.I2L:
+ case Opcodes.F2L:
+ pop(1);
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.I2F:
+ pop(1);
+ push(FLOAT);
+ break;
+ case Opcodes.I2D:
+ case Opcodes.F2D:
+ pop(1);
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Opcodes.F2I:
+ case Opcodes.ARRAYLENGTH:
+ case Opcodes.INSTANCEOF:
+ pop(1);
+ push(INTEGER);
+ break;
+ case Opcodes.LCMP:
+ case Opcodes.DCMPL:
+ case Opcodes.DCMPG:
+ pop(4);
+ push(INTEGER);
+ break;
+ case Opcodes.JSR:
+ case Opcodes.RET:
+ throw new IllegalArgumentException("JSR/RET are not supported with computeFrames option");
+ case Opcodes.GETSTATIC:
+ push(symbolTable, argSymbol.value);
+ break;
+ case Opcodes.PUTSTATIC:
+ pop(argSymbol.value);
+ break;
+ case Opcodes.GETFIELD:
+ pop(1);
+ push(symbolTable, argSymbol.value);
+ break;
+ case Opcodes.PUTFIELD:
+ pop(argSymbol.value);
+ pop();
+ break;
+ case Opcodes.INVOKEVIRTUAL:
+ case Opcodes.INVOKESPECIAL:
+ case Opcodes.INVOKESTATIC:
+ case Opcodes.INVOKEINTERFACE:
+ pop(argSymbol.value);
+ if (opcode != Opcodes.INVOKESTATIC) {
+ abstractType1 = pop();
+ if (opcode == Opcodes.INVOKESPECIAL && argSymbol.name.charAt(0) == '<') {
+ addInitializedType(abstractType1);
+ }
+ }
+ push(symbolTable, argSymbol.value);
+ break;
+ case Opcodes.INVOKEDYNAMIC:
+ pop(argSymbol.value);
+ push(symbolTable, argSymbol.value);
+ break;
+ case Opcodes.NEW:
+ push(UNINITIALIZED_KIND | symbolTable.addUninitializedType(argSymbol.value, arg));
+ break;
+ case Opcodes.NEWARRAY:
+ pop();
+ switch (arg) {
+ case Opcodes.T_BOOLEAN:
+ push(ARRAY_OF | BOOLEAN);
+ break;
+ case Opcodes.T_CHAR:
+ push(ARRAY_OF | CHAR);
+ break;
+ case Opcodes.T_BYTE:
+ push(ARRAY_OF | BYTE);
+ break;
+ case Opcodes.T_SHORT:
+ push(ARRAY_OF | SHORT);
+ break;
+ case Opcodes.T_INT:
+ push(ARRAY_OF | INTEGER);
+ break;
+ case Opcodes.T_FLOAT:
+ push(ARRAY_OF | FLOAT);
+ break;
+ case Opcodes.T_DOUBLE:
+ push(ARRAY_OF | DOUBLE);
+ break;
+ case Opcodes.T_LONG:
+ push(ARRAY_OF | LONG);
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ break;
+ case Opcodes.ANEWARRAY:
+ String arrayElementType = argSymbol.value;
+ pop();
+ if (arrayElementType.charAt(0) == '[') {
+ push(symbolTable, '[' + arrayElementType);
} else {
- int type = outputLocals[local];
- if (type == 0) {
- // this local has never been assigned in this basic block,
- // so it is still equal to its value in the input frame
- type = outputLocals[local] = LOCAL | local;
- }
- return type;
+ push(ARRAY_OF | REFERENCE_KIND | symbolTable.addType(arrayElementType));
}
- }
-
- /**
- * Sets the output frame local variable type at the given index.
- *
- * @param local
- * the index of the local that must be set.
- * @param type
- * the value of the local that must be set.
- */
- private void set(final int local, final int type) {
- // creates and/or resizes the output local variables array if necessary
- if (outputLocals == null) {
- outputLocals = new int[10];
- }
- int n = outputLocals.length;
- if (local >= n) {
- int[] t = new int[Math.max(local + 1, 2 * n)];
- System.arraycopy(outputLocals, 0, t, 0, n);
- outputLocals = t;
- }
- // sets the local variable
- outputLocals[local] = type;
- }
-
- /**
- * Pushes a new type onto the output frame stack.
- *
- * @param type
- * the type that must be pushed.
- */
- private void push(final int type) {
- // creates and/or resizes the output stack array if necessary
- if (outputStack == null) {
- outputStack = new int[10];
- }
- int n = outputStack.length;
- if (outputStackTop >= n) {
- int[] t = new int[Math.max(outputStackTop + 1, 2 * n)];
- System.arraycopy(outputStack, 0, t, 0, n);
- outputStack = t;
- }
- // pushes the type on the output stack
- outputStack[outputStackTop++] = type;
- // updates the maximun height reached by the output stack, if needed
- int top = owner.inputStackTop + outputStackTop;
- if (top > owner.outputStackMax) {
- owner.outputStackMax = top;
- }
- }
-
- /**
- * Pushes a new type onto the output frame stack.
- *
- * @param cw
- * the ClassWriter to which this label belongs.
- * @param desc
- * the descriptor of the type to be pushed. Can also be a method
- * descriptor (in this case this method pushes its return type
- * onto the output frame stack).
- */
- private void push(final ClassWriter cw, final String desc) {
- int type = type(cw, desc);
- if (type != 0) {
- push(type);
- if (type == LONG || type == DOUBLE) {
- push(TOP);
- }
- }
- }
-
- /**
- * Returns the int encoding of the given type.
- *
- * @param cw
- * the ClassWriter to which this label belongs.
- * @param desc
- * a type descriptor.
- * @return the int encoding of the given type.
- */
- private static int type(final ClassWriter cw, final String desc) {
- String t;
- int index = desc.charAt(0) == '(' ? desc.indexOf(')') + 1 : 0;
- switch (desc.charAt(index)) {
- case 'V':
- return 0;
- case 'Z':
- case 'C':
- case 'B':
- case 'S':
- case 'I':
- return INTEGER;
- case 'F':
- return FLOAT;
- case 'J':
- return LONG;
- case 'D':
- return DOUBLE;
- case 'L':
- // stores the internal name, not the descriptor!
- t = desc.substring(index + 1, desc.length() - 1);
- return OBJECT | cw.addType(t);
- // case '[':
- default:
- // extracts the dimensions and the element type
- int data;
- int dims = index + 1;
- while (desc.charAt(dims) == '[') {
- ++dims;
- }
- switch (desc.charAt(dims)) {
- case 'Z':
- data = BOOLEAN;
- break;
- case 'C':
- data = CHAR;
- break;
- case 'B':
- data = BYTE;
- break;
- case 'S':
- data = SHORT;
- break;
- case 'I':
- data = INTEGER;
- break;
- case 'F':
- data = FLOAT;
- break;
- case 'J':
- data = LONG;
- break;
- case 'D':
- data = DOUBLE;
- break;
- // case 'L':
- default:
- // stores the internal name, not the descriptor
- t = desc.substring(dims + 1, desc.length() - 1);
- data = OBJECT | cw.addType(t);
- }
- return (dims - index) << 28 | data;
- }
- }
-
- /**
- * Pops a type from the output frame stack and returns its value.
- *
- * @return the type that has been popped from the output frame stack.
- */
- private int pop() {
- if (outputStackTop > 0) {
- return outputStack[--outputStackTop];
+ break;
+ case Opcodes.CHECKCAST:
+ String castType = argSymbol.value;
+ pop();
+ if (castType.charAt(0) == '[') {
+ push(symbolTable, castType);
} else {
- // if the output frame stack is empty, pops from the input stack
- return STACK | -(--owner.inputStackTop);
+ push(REFERENCE_KIND | symbolTable.addType(castType));
}
+ break;
+ case Opcodes.MULTIANEWARRAY:
+ pop(arg);
+ push(symbolTable, argSymbol.value);
+ break;
+ default:
+ throw new IllegalArgumentException();
}
+ }
- /**
- * Pops the given number of types from the output frame stack.
- *
- * @param elements
- * the number of types that must be popped.
- */
- private void pop(final int elements) {
- if (outputStackTop >= elements) {
- outputStackTop -= elements;
+ // -----------------------------------------------------------------------------------------------
+ // Frame merging methods, used in the second step of the stack map frame computation algorithm
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Computes the concrete output type corresponding to a given abstract output type.
+ *
+ * @param abstractOutputType an abstract output type.
+ * @param numStack the size of the input stack, used to resolve abstract output types of
+ * STACK_KIND kind.
+ * @return the concrete output type corresponding to 'abstractOutputType'.
+ */
+ private int getConcreteOutputType(final int abstractOutputType, final int numStack) {
+ int dim = abstractOutputType & DIM_MASK;
+ int kind = abstractOutputType & KIND_MASK;
+ if (kind == LOCAL_KIND) {
+ // By definition, a LOCAL_KIND type designates the concrete type of a local variable at
+ // the beginning of the basic block corresponding to this frame (which is known when
+ // this method is called, but was not when the abstract type was computed).
+ int concreteOutputType = dim + inputLocals[abstractOutputType & VALUE_MASK];
+ if ((abstractOutputType & TOP_IF_LONG_OR_DOUBLE_FLAG) != 0
+ && (concreteOutputType == LONG || concreteOutputType == DOUBLE)) {
+ concreteOutputType = TOP;
+ }
+ return concreteOutputType;
+ } else if (kind == STACK_KIND) {
+ // By definition, a STACK_KIND type designates the concrete type of a local variable at
+ // the beginning of the basic block corresponding to this frame (which is known when
+ // this method is called, but was not when the abstract type was computed).
+ int concreteOutputType = dim + inputStack[numStack - (abstractOutputType & VALUE_MASK)];
+ if ((abstractOutputType & TOP_IF_LONG_OR_DOUBLE_FLAG) != 0
+ && (concreteOutputType == LONG || concreteOutputType == DOUBLE)) {
+ concreteOutputType = TOP;
+ }
+ return concreteOutputType;
+ } else {
+ return abstractOutputType;
+ }
+ }
+
+ /**
+ * Merges the input frame of the given {@link Frame} with the input and output frames of this
+ * {@link Frame}. Returns {@literal true} if the given frame has been changed by this operation
+ * (the input and output frames of this {@link Frame} are never changed).
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param dstFrame the {@link Frame} whose input frame must be updated. This should be the frame
+ * of a successor, in the control flow graph, of the basic block corresponding to this frame.
+ * @param catchTypeIndex if 'frame' corresponds to an exception handler basic block, the type
+ * table index of the caught exception type, otherwise 0.
+ * @return {@literal true} if the input frame of 'frame' has been changed by this operation.
+ */
+ final boolean merge(
+ final SymbolTable symbolTable, final Frame dstFrame, final int catchTypeIndex) {
+ boolean frameChanged = false;
+
+ // Compute the concrete types of the local variables at the end of the basic block corresponding
+ // to this frame, by resolving its abstract output types, and merge these concrete types with
+ // those of the local variables in the input frame of dstFrame.
+ int numLocal = inputLocals.length;
+ int numStack = inputStack.length;
+ if (dstFrame.inputLocals == null) {
+ dstFrame.inputLocals = new int[numLocal];
+ frameChanged = true;
+ }
+ for (int i = 0; i < numLocal; ++i) {
+ int concreteOutputType;
+ if (outputLocals != null && i < outputLocals.length) {
+ int abstractOutputType = outputLocals[i];
+ if (abstractOutputType == 0) {
+ // If the local variable has never been assigned in this basic block, it is equal to its
+ // value at the beginning of the block.
+ concreteOutputType = inputLocals[i];
} else {
- // if the number of elements to be popped is greater than the number
- // of elements in the output stack, clear it, and pops the remaining
- // elements from the input stack.
- owner.inputStackTop -= elements - outputStackTop;
- outputStackTop = 0;
+ concreteOutputType = getConcreteOutputType(abstractOutputType, numStack);
}
+ } else {
+ // If the local variable has never been assigned in this basic block, it is equal to its
+ // value at the beginning of the block.
+ concreteOutputType = inputLocals[i];
+ }
+ // concreteOutputType might be an uninitialized type from the input locals or from the input
+ // stack. However, if a constructor has been called for this class type in the basic block,
+ // then this type is no longer uninitialized at the end of basic block.
+ if (initializations != null) {
+ concreteOutputType = getInitializedType(symbolTable, concreteOutputType);
+ }
+ frameChanged |= merge(symbolTable, concreteOutputType, dstFrame.inputLocals, i);
}
- /**
- * Pops a type from the output frame stack.
- *
- * @param desc
- * the descriptor of the type to be popped. Can also be a method
- * descriptor (in this case this method pops the types
- * corresponding to the method arguments).
- */
- private void pop(final String desc) {
- char c = desc.charAt(0);
- if (c == '(') {
- pop((Type.getArgumentsAndReturnSizes(desc) >> 2) - 1);
- } else if (c == 'J' || c == 'D') {
- pop(2);
- } else {
- pop(1);
- }
+ // If dstFrame is an exception handler block, it can be reached from any instruction of the
+ // basic block corresponding to this frame, in particular from the first one. Therefore, the
+ // input locals of dstFrame should be compatible (i.e. merged) with the input locals of this
+ // frame (and the input stack of dstFrame should be compatible, i.e. merged, with a one
+ // element stack containing the caught exception type).
+ if (catchTypeIndex > 0) {
+ for (int i = 0; i < numLocal; ++i) {
+ frameChanged |= merge(symbolTable, inputLocals[i], dstFrame.inputLocals, i);
+ }
+ if (dstFrame.inputStack == null) {
+ dstFrame.inputStack = new int[1];
+ frameChanged = true;
+ }
+ frameChanged |= merge(symbolTable, catchTypeIndex, dstFrame.inputStack, 0);
+ return frameChanged;
}
- /**
- * Adds a new type to the list of types on which a constructor is invoked in
- * the basic block.
- *
- * @param var
- * a type on a which a constructor is invoked.
- */
- private void init(final int var) {
- // creates and/or resizes the initializations array if necessary
- if (initializations == null) {
- initializations = new int[2];
- }
- int n = initializations.length;
- if (initializationCount >= n) {
- int[] t = new int[Math.max(initializationCount + 1, 2 * n)];
- System.arraycopy(initializations, 0, t, 0, n);
- initializations = t;
- }
- // stores the type to be initialized
- initializations[initializationCount++] = var;
+ // Compute the concrete types of the stack operands at the end of the basic block corresponding
+ // to this frame, by resolving its abstract output types, and merge these concrete types with
+ // those of the stack operands in the input frame of dstFrame.
+ int numInputStack = inputStack.length + outputStackStart;
+ if (dstFrame.inputStack == null) {
+ dstFrame.inputStack = new int[numInputStack + outputStackTop];
+ frameChanged = true;
}
-
- /**
- * Replaces the given type with the appropriate type if it is one of the
- * types on which a constructor is invoked in the basic block.
- *
- * @param cw
- * the ClassWriter to which this label belongs.
- * @param t
- * a type
- * @return t or, if t is one of the types on which a constructor is invoked
- * in the basic block, the type corresponding to this constructor.
- */
- private int init(final ClassWriter cw, final int t) {
- int s;
- if (t == UNINITIALIZED_THIS) {
- s = OBJECT | cw.addType(cw.thisName);
- } else if ((t & (DIM | BASE_KIND)) == UNINITIALIZED) {
- String type = cw.typeTable[t & BASE_VALUE].strVal1;
- s = OBJECT | cw.addType(type);
- } else {
- return t;
- }
- for (int j = 0; j < initializationCount; ++j) {
- int u = initializations[j];
- int dim = u & DIM;
- int kind = u & KIND;
- if (kind == LOCAL) {
- u = dim + inputLocals[u & VALUE];
- } else if (kind == STACK) {
- u = dim + inputStack[inputStack.length - (u & VALUE)];
- }
- if (t == u) {
- return s;
- }
- }
- return t;
+ // First, do this for the stack operands that have not been popped in the basic block
+ // corresponding to this frame, and which are therefore equal to their value in the input
+ // frame (except for uninitialized types, which may have been initialized).
+ for (int i = 0; i < numInputStack; ++i) {
+ int concreteOutputType = inputStack[i];
+ if (initializations != null) {
+ concreteOutputType = getInitializedType(symbolTable, concreteOutputType);
+ }
+ frameChanged |= merge(symbolTable, concreteOutputType, dstFrame.inputStack, i);
}
-
- /**
- * Initializes the input frame of the first basic block from the method
- * descriptor.
- *
- * @param cw
- * the ClassWriter to which this label belongs.
- * @param access
- * the access flags of the method to which this label belongs.
- * @param args
- * the formal parameter types of this method.
- * @param maxLocals
- * the maximum number of local variables of this method.
- */
- void initInputFrame(final ClassWriter cw, final int access,
- final Type[] args, final int maxLocals) {
- inputLocals = new int[maxLocals];
- inputStack = new int[0];
- int i = 0;
- if ((access & Opcodes.ACC_STATIC) == 0) {
- if ((access & MethodWriter.ACC_CONSTRUCTOR) == 0) {
- inputLocals[i++] = OBJECT | cw.addType(cw.thisName);
- } else {
- inputLocals[i++] = UNINITIALIZED_THIS;
- }
- }
- for (int j = 0; j < args.length; ++j) {
- int t = type(cw, args[j].getDescriptor());
- inputLocals[i++] = t;
- if (t == LONG || t == DOUBLE) {
- inputLocals[i++] = TOP;
- }
- }
- while (i < maxLocals) {
- inputLocals[i++] = TOP;
- }
+ // Then, do this for the stack operands that have pushed in the basic block (this code is the
+ // same as the one above for local variables).
+ for (int i = 0; i < outputStackTop; ++i) {
+ int abstractOutputType = outputStack[i];
+ int concreteOutputType = getConcreteOutputType(abstractOutputType, numStack);
+ if (initializations != null) {
+ concreteOutputType = getInitializedType(symbolTable, concreteOutputType);
+ }
+ frameChanged |=
+ merge(symbolTable, concreteOutputType, dstFrame.inputStack, numInputStack + i);
}
+ return frameChanged;
+ }
- /**
- * Simulates the action of the given instruction on the output stack frame.
- *
- * @param opcode
- * the opcode of the instruction.
- * @param arg
- * the operand of the instruction, if any.
- * @param cw
- * the class writer to which this label belongs.
- * @param item
- * the operand of the instructions, if any.
- */
- void execute(final int opcode, final int arg, final ClassWriter cw,
- final Item item) {
- int t1, t2, t3, t4;
- switch (opcode) {
- case Opcodes.NOP:
- case Opcodes.INEG:
- case Opcodes.LNEG:
- case Opcodes.FNEG:
- case Opcodes.DNEG:
- case Opcodes.I2B:
- case Opcodes.I2C:
- case Opcodes.I2S:
- case Opcodes.GOTO:
- case Opcodes.RETURN:
- break;
- case Opcodes.ACONST_NULL:
- push(NULL);
- break;
- case Opcodes.ICONST_M1:
- case Opcodes.ICONST_0:
- case Opcodes.ICONST_1:
- case Opcodes.ICONST_2:
- case Opcodes.ICONST_3:
- case Opcodes.ICONST_4:
- case Opcodes.ICONST_5:
- case Opcodes.BIPUSH:
- case Opcodes.SIPUSH:
- case Opcodes.ILOAD:
- push(INTEGER);
- break;
- case Opcodes.LCONST_0:
- case Opcodes.LCONST_1:
- case Opcodes.LLOAD:
- push(LONG);
- push(TOP);
- break;
- case Opcodes.FCONST_0:
- case Opcodes.FCONST_1:
- case Opcodes.FCONST_2:
- case Opcodes.FLOAD:
- push(FLOAT);
- break;
- case Opcodes.DCONST_0:
- case Opcodes.DCONST_1:
- case Opcodes.DLOAD:
- push(DOUBLE);
- push(TOP);
- break;
- case Opcodes.LDC:
- switch (item.type) {
- case ClassWriter.INT:
- push(INTEGER);
- break;
- case ClassWriter.LONG:
- push(LONG);
- push(TOP);
- break;
- case ClassWriter.FLOAT:
- push(FLOAT);
- break;
- case ClassWriter.DOUBLE:
- push(DOUBLE);
- push(TOP);
- break;
- case ClassWriter.CLASS:
- push(OBJECT | cw.addType("java/lang/Class"));
- break;
- case ClassWriter.STR:
- push(OBJECT | cw.addType("java/lang/String"));
- break;
- case ClassWriter.MTYPE:
- push(OBJECT | cw.addType("java/lang/invoke/MethodType"));
- break;
- // case ClassWriter.HANDLE_BASE + [1..9]:
- default:
- push(OBJECT | cw.addType("java/lang/invoke/MethodHandle"));
- }
- break;
- case Opcodes.ALOAD:
- push(get(arg));
- break;
- case Opcodes.IALOAD:
- case Opcodes.BALOAD:
- case Opcodes.CALOAD:
- case Opcodes.SALOAD:
- pop(2);
- push(INTEGER);
- break;
- case Opcodes.LALOAD:
- case Opcodes.D2L:
- pop(2);
- push(LONG);
- push(TOP);
- break;
- case Opcodes.FALOAD:
- pop(2);
- push(FLOAT);
- break;
- case Opcodes.DALOAD:
- case Opcodes.L2D:
- pop(2);
- push(DOUBLE);
- push(TOP);
- break;
- case Opcodes.AALOAD:
- pop(1);
- t1 = pop();
- push(ELEMENT_OF + t1);
- break;
- case Opcodes.ISTORE:
- case Opcodes.FSTORE:
- case Opcodes.ASTORE:
- t1 = pop();
- set(arg, t1);
- if (arg > 0) {
- t2 = get(arg - 1);
- // if t2 is of kind STACK or LOCAL we cannot know its size!
- if (t2 == LONG || t2 == DOUBLE) {
- set(arg - 1, TOP);
- } else if ((t2 & KIND) != BASE) {
- set(arg - 1, t2 | TOP_IF_LONG_OR_DOUBLE);
- }
- }
- break;
- case Opcodes.LSTORE:
- case Opcodes.DSTORE:
- pop(1);
- t1 = pop();
- set(arg, t1);
- set(arg + 1, TOP);
- if (arg > 0) {
- t2 = get(arg - 1);
- // if t2 is of kind STACK or LOCAL we cannot know its size!
- if (t2 == LONG || t2 == DOUBLE) {
- set(arg - 1, TOP);
- } else if ((t2 & KIND) != BASE) {
- set(arg - 1, t2 | TOP_IF_LONG_OR_DOUBLE);
- }
- }
- break;
- case Opcodes.IASTORE:
- case Opcodes.BASTORE:
- case Opcodes.CASTORE:
- case Opcodes.SASTORE:
- case Opcodes.FASTORE:
- case Opcodes.AASTORE:
- pop(3);
- break;
- case Opcodes.LASTORE:
- case Opcodes.DASTORE:
- pop(4);
- break;
- case Opcodes.POP:
- case Opcodes.IFEQ:
- case Opcodes.IFNE:
- case Opcodes.IFLT:
- case Opcodes.IFGE:
- case Opcodes.IFGT:
- case Opcodes.IFLE:
- case Opcodes.IRETURN:
- case Opcodes.FRETURN:
- case Opcodes.ARETURN:
- case Opcodes.TABLESWITCH:
- case Opcodes.LOOKUPSWITCH:
- case Opcodes.ATHROW:
- case Opcodes.MONITORENTER:
- case Opcodes.MONITOREXIT:
- case Opcodes.IFNULL:
- case Opcodes.IFNONNULL:
- pop(1);
- break;
- case Opcodes.POP2:
- case Opcodes.IF_ICMPEQ:
- case Opcodes.IF_ICMPNE:
- case Opcodes.IF_ICMPLT:
- case Opcodes.IF_ICMPGE:
- case Opcodes.IF_ICMPGT:
- case Opcodes.IF_ICMPLE:
- case Opcodes.IF_ACMPEQ:
- case Opcodes.IF_ACMPNE:
- case Opcodes.LRETURN:
- case Opcodes.DRETURN:
- pop(2);
- break;
- case Opcodes.DUP:
- t1 = pop();
- push(t1);
- push(t1);
- break;
- case Opcodes.DUP_X1:
- t1 = pop();
- t2 = pop();
- push(t1);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP_X2:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- push(t1);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2:
- t1 = pop();
- t2 = pop();
- push(t2);
- push(t1);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2_X1:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- push(t2);
- push(t1);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2_X2:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- t4 = pop();
- push(t2);
- push(t1);
- push(t4);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.SWAP:
- t1 = pop();
- t2 = pop();
- push(t1);
- push(t2);
- break;
- case Opcodes.IADD:
- case Opcodes.ISUB:
- case Opcodes.IMUL:
- case Opcodes.IDIV:
- case Opcodes.IREM:
- case Opcodes.IAND:
- case Opcodes.IOR:
- case Opcodes.IXOR:
- case Opcodes.ISHL:
- case Opcodes.ISHR:
- case Opcodes.IUSHR:
- case Opcodes.L2I:
- case Opcodes.D2I:
- case Opcodes.FCMPL:
- case Opcodes.FCMPG:
- pop(2);
- push(INTEGER);
- break;
- case Opcodes.LADD:
- case Opcodes.LSUB:
- case Opcodes.LMUL:
- case Opcodes.LDIV:
- case Opcodes.LREM:
- case Opcodes.LAND:
- case Opcodes.LOR:
- case Opcodes.LXOR:
- pop(4);
- push(LONG);
- push(TOP);
- break;
- case Opcodes.FADD:
- case Opcodes.FSUB:
- case Opcodes.FMUL:
- case Opcodes.FDIV:
- case Opcodes.FREM:
- case Opcodes.L2F:
- case Opcodes.D2F:
- pop(2);
- push(FLOAT);
- break;
- case Opcodes.DADD:
- case Opcodes.DSUB:
- case Opcodes.DMUL:
- case Opcodes.DDIV:
- case Opcodes.DREM:
- pop(4);
- push(DOUBLE);
- push(TOP);
- break;
- case Opcodes.LSHL:
- case Opcodes.LSHR:
- case Opcodes.LUSHR:
- pop(3);
- push(LONG);
- push(TOP);
- break;
- case Opcodes.IINC:
- set(arg, INTEGER);
- break;
- case Opcodes.I2L:
- case Opcodes.F2L:
- pop(1);
- push(LONG);
- push(TOP);
- break;
- case Opcodes.I2F:
- pop(1);
- push(FLOAT);
- break;
- case Opcodes.I2D:
- case Opcodes.F2D:
- pop(1);
- push(DOUBLE);
- push(TOP);
- break;
- case Opcodes.F2I:
- case Opcodes.ARRAYLENGTH:
- case Opcodes.INSTANCEOF:
- pop(1);
- push(INTEGER);
- break;
- case Opcodes.LCMP:
- case Opcodes.DCMPL:
- case Opcodes.DCMPG:
- pop(4);
- push(INTEGER);
- break;
- case Opcodes.JSR:
- case Opcodes.RET:
- throw new RuntimeException(
- "JSR/RET are not supported with computeFrames option");
- case Opcodes.GETSTATIC:
- push(cw, item.strVal3);
- break;
- case Opcodes.PUTSTATIC:
- pop(item.strVal3);
- break;
- case Opcodes.GETFIELD:
- pop(1);
- push(cw, item.strVal3);
- break;
- case Opcodes.PUTFIELD:
- pop(item.strVal3);
- pop();
- break;
- case Opcodes.INVOKEVIRTUAL:
- case Opcodes.INVOKESPECIAL:
- case Opcodes.INVOKESTATIC:
- case Opcodes.INVOKEINTERFACE:
- pop(item.strVal3);
- if (opcode != Opcodes.INVOKESTATIC) {
- t1 = pop();
- if (opcode == Opcodes.INVOKESPECIAL
- && item.strVal2.charAt(0) == '<') {
- init(t1);
- }
- }
- push(cw, item.strVal3);
- break;
- case Opcodes.INVOKEDYNAMIC:
- pop(item.strVal2);
- push(cw, item.strVal2);
- break;
- case Opcodes.NEW:
- push(UNINITIALIZED | cw.addUninitializedType(item.strVal1, arg));
- break;
- case Opcodes.NEWARRAY:
- pop();
- switch (arg) {
- case Opcodes.T_BOOLEAN:
- push(ARRAY_OF | BOOLEAN);
- break;
- case Opcodes.T_CHAR:
- push(ARRAY_OF | CHAR);
- break;
- case Opcodes.T_BYTE:
- push(ARRAY_OF | BYTE);
- break;
- case Opcodes.T_SHORT:
- push(ARRAY_OF | SHORT);
- break;
- case Opcodes.T_INT:
- push(ARRAY_OF | INTEGER);
- break;
- case Opcodes.T_FLOAT:
- push(ARRAY_OF | FLOAT);
- break;
- case Opcodes.T_DOUBLE:
- push(ARRAY_OF | DOUBLE);
- break;
- // case Opcodes.T_LONG:
- default:
- push(ARRAY_OF | LONG);
- break;
- }
- break;
- case Opcodes.ANEWARRAY:
- String s = item.strVal1;
- pop();
- if (s.charAt(0) == '[') {
- push(cw, '[' + s);
- } else {
- push(ARRAY_OF | OBJECT | cw.addType(s));
- }
- break;
- case Opcodes.CHECKCAST:
- s = item.strVal1;
- pop();
- if (s.charAt(0) == '[') {
- push(cw, s);
- } else {
- push(OBJECT | cw.addType(s));
- }
- break;
- // case Opcodes.MULTIANEWARRAY:
- default:
- pop(arg);
- push(cw, item.strVal1);
- break;
- }
+ /**
+ * Merges the type at the given index in the given abstract type array with the given type.
+ * Returns {@literal true} if the type array has been modified by this operation.
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param sourceType the abstract type with which the abstract type array element must be merged.
+ * This type should be of {@link #CONSTANT_KIND}, {@link #REFERENCE_KIND} or {@link
+ * #UNINITIALIZED_KIND} kind, with positive or null array dimensions.
+ * @param dstTypes an array of abstract types. These types should be of {@link #CONSTANT_KIND},
+ * {@link #REFERENCE_KIND} or {@link #UNINITIALIZED_KIND} kind, with positive or null array
+ * dimensions.
+ * @param dstIndex the index of the type that must be merged in dstTypes.
+ * @return {@literal true} if the type array has been modified by this operation.
+ */
+ private static boolean merge(
+ final SymbolTable symbolTable,
+ final int sourceType,
+ final int[] dstTypes,
+ final int dstIndex) {
+ int dstType = dstTypes[dstIndex];
+ if (dstType == sourceType) {
+ // If the types are equal, merge(sourceType, dstType) = dstType, so there is no change.
+ return false;
}
-
- /**
- * Merges the input frame of the given basic block with the input and output
- * frames of this basic block. Returns <tt>true</tt> if the input frame of
- * the given label has been changed by this operation.
- *
- * @param cw
- * the ClassWriter to which this label belongs.
- * @param frame
- * the basic block whose input frame must be updated.
- * @param edge
- * the kind of the {@link Edge} between this label and 'label'.
- * See {@link Edge#info}.
- * @return <tt>true</tt> if the input frame of the given label has been
- * changed by this operation.
- */
- boolean merge(final ClassWriter cw, final Frame frame, final int edge) {
- boolean changed = false;
- int i, s, dim, kind, t;
-
- int nLocal = inputLocals.length;
- int nStack = inputStack.length;
- if (frame.inputLocals == null) {
- frame.inputLocals = new int[nLocal];
- changed = true;
- }
-
- for (i = 0; i < nLocal; ++i) {
- if (outputLocals != null && i < outputLocals.length) {
- s = outputLocals[i];
- if (s == 0) {
- t = inputLocals[i];
- } else {
- dim = s & DIM;
- kind = s & KIND;
- if (kind == BASE) {
- t = s;
- } else {
- if (kind == LOCAL) {
- t = dim + inputLocals[s & VALUE];
- } else {
- t = dim + inputStack[nStack - (s & VALUE)];
- }
- if ((s & TOP_IF_LONG_OR_DOUBLE) != 0
- && (t == LONG || t == DOUBLE)) {
- t = TOP;
- }
- }
- }
- } else {
- t = inputLocals[i];
- }
- if (initializations != null) {
- t = init(cw, t);
- }
- changed |= merge(cw, t, frame.inputLocals, i);
- }
-
- if (edge > 0) {
- for (i = 0; i < nLocal; ++i) {
- t = inputLocals[i];
- changed |= merge(cw, t, frame.inputLocals, i);
- }
- if (frame.inputStack == null) {
- frame.inputStack = new int[1];
- changed = true;
- }
- changed |= merge(cw, edge, frame.inputStack, 0);
- return changed;
- }
-
- int nInputStack = inputStack.length + owner.inputStackTop;
- if (frame.inputStack == null) {
- frame.inputStack = new int[nInputStack + outputStackTop];
- changed = true;
- }
-
- for (i = 0; i < nInputStack; ++i) {
- t = inputStack[i];
- if (initializations != null) {
- t = init(cw, t);
- }
- changed |= merge(cw, t, frame.inputStack, i);
- }
- for (i = 0; i < outputStackTop; ++i) {
- s = outputStack[i];
- dim = s & DIM;
- kind = s & KIND;
- if (kind == BASE) {
- t = s;
- } else {
- if (kind == LOCAL) {
- t = dim + inputLocals[s & VALUE];
- } else {
- t = dim + inputStack[nStack - (s & VALUE)];
- }
- if ((s & TOP_IF_LONG_OR_DOUBLE) != 0
- && (t == LONG || t == DOUBLE)) {
- t = TOP;
- }
- }
- if (initializations != null) {
- t = init(cw, t);
- }
- changed |= merge(cw, t, frame.inputStack, nInputStack + i);
- }
- return changed;
- }
-
- /**
- * Merges the type at the given index in the given type array with the given
- * type. Returns <tt>true</tt> if the type array has been modified by this
- * operation.
- *
- * @param cw
- * the ClassWriter to which this label belongs.
- * @param t
- * the type with which the type array element must be merged.
- * @param types
- * an array of types.
- * @param index
- * the index of the type that must be merged in 'types'.
- * @return <tt>true</tt> if the type array has been modified by this
- * operation.
- */
- private static boolean merge(final ClassWriter cw, int t,
- final int[] types, final int index) {
- int u = types[index];
- if (u == t) {
- // if the types are equal, merge(u,t)=u, so there is no change
- return false;
- }
- if ((t & ~DIM) == NULL) {
- if (u == NULL) {
- return false;
- }
- t = NULL;
- }
- if (u == 0) {
- // if types[index] has never been assigned, merge(u,t)=t
- types[index] = t;
- return true;
- }
- int v;
- if ((u & BASE_KIND) == OBJECT || (u & DIM) != 0) {
- // if u is a reference type of any dimension
- if (t == NULL) {
- // if t is the NULL type, merge(u,t)=u, so there is no change
- return false;
- } else if ((t & (DIM | BASE_KIND)) == (u & (DIM | BASE_KIND))) {
- // if t and u have the same dimension and same base kind
- if ((u & BASE_KIND) == OBJECT) {
- // if t is also a reference type, and if u and t have the
- // same dimension merge(u,t) = dim(t) | common parent of the
- // element types of u and t
- v = (t & DIM) | OBJECT
- | cw.getMergedType(t & BASE_VALUE, u & BASE_VALUE);
- } else {
- // if u and t are array types, but not with the same element
- // type, merge(u,t) = dim(u) - 1 | java/lang/Object
- int vdim = ELEMENT_OF + (u & DIM);
- v = vdim | OBJECT | cw.addType("java/lang/Object");
- }
- } else if ((t & BASE_KIND) == OBJECT || (t & DIM) != 0) {
- // if t is any other reference or array type, the merged type
- // is min(udim, tdim) | java/lang/Object, where udim is the
- // array dimension of u, minus 1 if u is an array type with a
- // primitive element type (and similarly for tdim).
- int tdim = (((t & DIM) == 0 || (t & BASE_KIND) == OBJECT) ? 0
- : ELEMENT_OF) + (t & DIM);
- int udim = (((u & DIM) == 0 || (u & BASE_KIND) == OBJECT) ? 0
- : ELEMENT_OF) + (u & DIM);
- v = Math.min(tdim, udim) | OBJECT
- | cw.addType("java/lang/Object");
- } else {
- // if t is any other type, merge(u,t)=TOP
- v = TOP;
- }
- } else if (u == NULL) {
- // if u is the NULL type, merge(u,t)=t,
- // or TOP if t is not a reference type
- v = (t & BASE_KIND) == OBJECT || (t & DIM) != 0 ? t : TOP;
- } else {
- // if u is any other type, merge(u,t)=TOP whatever t
- v = TOP;
- }
- if (u != v) {
- types[index] = v;
- return true;
- }
+ int srcType = sourceType;
+ if ((sourceType & ~DIM_MASK) == NULL) {
+ if (dstType == NULL) {
return false;
+ }
+ srcType = NULL;
}
+ if (dstType == 0) {
+ // If dstTypes[dstIndex] has never been assigned, merge(srcType, dstType) = srcType.
+ dstTypes[dstIndex] = srcType;
+ return true;
+ }
+ int mergedType;
+ if ((dstType & DIM_MASK) != 0 || (dstType & KIND_MASK) == REFERENCE_KIND) {
+ // If dstType is a reference type of any array dimension.
+ if (srcType == NULL) {
+ // If srcType is the NULL type, merge(srcType, dstType) = dstType, so there is no change.
+ return false;
+ } else if ((srcType & (DIM_MASK | KIND_MASK)) == (dstType & (DIM_MASK | KIND_MASK))) {
+ // If srcType has the same array dimension and the same kind as dstType.
+ if ((dstType & KIND_MASK) == REFERENCE_KIND) {
+ // If srcType and dstType are reference types with the same array dimension,
+ // merge(srcType, dstType) = dim(srcType) | common super class of srcType and dstType.
+ mergedType =
+ (srcType & DIM_MASK)
+ | REFERENCE_KIND
+ | symbolTable.addMergedType(srcType & VALUE_MASK, dstType & VALUE_MASK);
+ } else {
+ // If srcType and dstType are array types of equal dimension but different element types,
+ // merge(srcType, dstType) = dim(srcType) - 1 | java/lang/Object.
+ int mergedDim = ELEMENT_OF + (srcType & DIM_MASK);
+ mergedType = mergedDim | REFERENCE_KIND | symbolTable.addType("java/lang/Object");
+ }
+ } else if ((srcType & DIM_MASK) != 0 || (srcType & KIND_MASK) == REFERENCE_KIND) {
+ // If srcType is any other reference or array type,
+ // merge(srcType, dstType) = min(srcDdim, dstDim) | java/lang/Object
+ // where srcDim is the array dimension of srcType, minus 1 if srcType is an array type
+ // with a non reference element type (and similarly for dstDim).
+ int srcDim = srcType & DIM_MASK;
+ if (srcDim != 0 && (srcType & KIND_MASK) != REFERENCE_KIND) {
+ srcDim = ELEMENT_OF + srcDim;
+ }
+ int dstDim = dstType & DIM_MASK;
+ if (dstDim != 0 && (dstType & KIND_MASK) != REFERENCE_KIND) {
+ dstDim = ELEMENT_OF + dstDim;
+ }
+ mergedType =
+ Math.min(srcDim, dstDim) | REFERENCE_KIND | symbolTable.addType("java/lang/Object");
+ } else {
+ // If srcType is any other type, merge(srcType, dstType) = TOP.
+ mergedType = TOP;
+ }
+ } else if (dstType == NULL) {
+ // If dstType is the NULL type, merge(srcType, dstType) = srcType, or TOP if srcType is not a
+ // an array type or a reference type.
+ mergedType =
+ (srcType & DIM_MASK) != 0 || (srcType & KIND_MASK) == REFERENCE_KIND ? srcType : TOP;
+ } else {
+ // If dstType is any other type, merge(srcType, dstType) = TOP whatever srcType.
+ mergedType = TOP;
+ }
+ if (mergedType != dstType) {
+ dstTypes[dstIndex] = mergedType;
+ return true;
+ }
+ return false;
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Frame output methods, to generate StackMapFrame attributes
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Makes the given {@link MethodWriter} visit the input frame of this {@link Frame}. The visit is
+ * done with the {@link MethodWriter#visitFrameStart}, {@link MethodWriter#visitAbstractType} and
+ * {@link MethodWriter#visitFrameEnd} methods.
+ *
+ * @param methodWriter the {@link MethodWriter} that should visit the input frame of this {@link
+ * Frame}.
+ */
+ final void accept(final MethodWriter methodWriter) {
+ // Compute the number of locals, ignoring TOP types that are just after a LONG or a DOUBLE, and
+ // all trailing TOP types.
+ int[] localTypes = inputLocals;
+ int numLocal = 0;
+ int numTrailingTop = 0;
+ int i = 0;
+ while (i < localTypes.length) {
+ int localType = localTypes[i];
+ i += (localType == LONG || localType == DOUBLE) ? 2 : 1;
+ if (localType == TOP) {
+ numTrailingTop++;
+ } else {
+ numLocal += numTrailingTop + 1;
+ numTrailingTop = 0;
+ }
+ }
+ // Compute the stack size, ignoring TOP types that are just after a LONG or a DOUBLE.
+ int[] stackTypes = inputStack;
+ int numStack = 0;
+ i = 0;
+ while (i < stackTypes.length) {
+ int stackType = stackTypes[i];
+ i += (stackType == LONG || stackType == DOUBLE) ? 2 : 1;
+ numStack++;
+ }
+ // Visit the frame and its content.
+ int frameIndex = methodWriter.visitFrameStart(owner.bytecodeOffset, numLocal, numStack);
+ i = 0;
+ while (numLocal-- > 0) {
+ int localType = localTypes[i];
+ i += (localType == LONG || localType == DOUBLE) ? 2 : 1;
+ methodWriter.visitAbstractType(frameIndex++, localType);
+ }
+ i = 0;
+ while (numStack-- > 0) {
+ int stackType = stackTypes[i];
+ i += (stackType == LONG || stackType == DOUBLE) ? 2 : 1;
+ methodWriter.visitAbstractType(frameIndex++, stackType);
+ }
+ methodWriter.visitFrameEnd();
+ }
+
+ /**
+ * Put the given abstract type in the given ByteVector, using the JVMS verification_type_info
+ * format used in StackMapTable attributes.
+ *
+ * @param symbolTable the type table to use to lookup and store type {@link Symbol}.
+ * @param abstractType an abstract type, restricted to {@link Frame#CONSTANT_KIND}, {@link
+ * Frame#REFERENCE_KIND} or {@link Frame#UNINITIALIZED_KIND} types.
+ * @param output where the abstract type must be put.
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.4">JVMS
+ * 4.7.4</a>
+ */
+ static void putAbstractType(
+ final SymbolTable symbolTable, final int abstractType, final ByteVector output) {
+ int arrayDimensions = (abstractType & Frame.DIM_MASK) >> DIM_SHIFT;
+ if (arrayDimensions == 0) {
+ int typeValue = abstractType & VALUE_MASK;
+ switch (abstractType & KIND_MASK) {
+ case CONSTANT_KIND:
+ output.putByte(typeValue);
+ break;
+ case REFERENCE_KIND:
+ output
+ .putByte(ITEM_OBJECT)
+ .putShort(symbolTable.addConstantClass(symbolTable.getType(typeValue).value).index);
+ break;
+ case UNINITIALIZED_KIND:
+ output.putByte(ITEM_UNINITIALIZED).putShort((int) symbolTable.getType(typeValue).data);
+ break;
+ default:
+ throw new AssertionError();
+ }
+ } else {
+ // Case of an array type, we need to build its descriptor first.
+ StringBuilder typeDescriptor = new StringBuilder();
+ while (arrayDimensions-- > 0) {
+ typeDescriptor.append('[');
+ }
+ if ((abstractType & KIND_MASK) == REFERENCE_KIND) {
+ typeDescriptor
+ .append('L')
+ .append(symbolTable.getType(abstractType & VALUE_MASK).value)
+ .append(';');
+ } else {
+ switch (abstractType & VALUE_MASK) {
+ case Frame.ITEM_ASM_BOOLEAN:
+ typeDescriptor.append('Z');
+ break;
+ case Frame.ITEM_ASM_BYTE:
+ typeDescriptor.append('B');
+ break;
+ case Frame.ITEM_ASM_CHAR:
+ typeDescriptor.append('C');
+ break;
+ case Frame.ITEM_ASM_SHORT:
+ typeDescriptor.append('S');
+ break;
+ case Frame.ITEM_INTEGER:
+ typeDescriptor.append('I');
+ break;
+ case Frame.ITEM_FLOAT:
+ typeDescriptor.append('F');
+ break;
+ case Frame.ITEM_LONG:
+ typeDescriptor.append('J');
+ break;
+ case Frame.ITEM_DOUBLE:
+ typeDescriptor.append('D');
+ break;
+ default:
+ throw new AssertionError();
+ }
+ }
+ output
+ .putByte(ITEM_OBJECT)
+ .putShort(symbolTable.addConstantClass(typeDescriptor.toString()).index);
+ }
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Handle.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Handle.java
index a1aca9e..69188e0 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Handle.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Handle.java
@@ -1,32 +1,30 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
@@ -38,133 +36,154 @@
*/
public final class Handle {
- /**
- * The kind of field or method designated by this Handle. Should be
- * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
- * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
- * {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
- * {@link Opcodes#H_INVOKESPECIAL}, {@link Opcodes#H_NEWINVOKESPECIAL} or
- * {@link Opcodes#H_INVOKEINTERFACE}.
- */
- final int tag;
+ /**
+ * The kind of field or method designated by this Handle. Should be {@link Opcodes#H_GETFIELD},
+ * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, {@link
+ * Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC}, {@link Opcodes#H_INVOKESPECIAL},
+ * {@link Opcodes#H_NEWINVOKESPECIAL} or {@link Opcodes#H_INVOKEINTERFACE}.
+ */
+ private final int tag;
- /**
- * The internal name of the class that owns the field or method designated
- * by this handle.
- */
- final String owner;
+ /** The internal name of the class that owns the field or method designated by this handle. */
+ private final String owner;
- /**
- * The name of the field or method designated by this handle.
- */
- final String name;
+ /** The name of the field or method designated by this handle. */
+ private final String name;
- /**
- * The descriptor of the field or method designated by this handle.
- */
- final String desc;
+ /** The descriptor of the field or method designated by this handle. */
+ private final String descriptor;
- /**
- * Constructs a new field or method handle.
- *
- * @param tag
- * the kind of field or method designated by this Handle. Must be
- * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
- * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
- * {@link Opcodes#H_INVOKEVIRTUAL},
- * {@link Opcodes#H_INVOKESTATIC},
- * {@link Opcodes#H_INVOKESPECIAL},
- * {@link Opcodes#H_NEWINVOKESPECIAL} or
- * {@link Opcodes#H_INVOKEINTERFACE}.
- * @param owner
- * the internal name of the class that owns the field or method
- * designated by this handle.
- * @param name
- * the name of the field or method designated by this handle.
- * @param desc
- * the descriptor of the field or method designated by this
- * handle.
- */
- public Handle(int tag, String owner, String name, String desc) {
- this.tag = tag;
- this.owner = owner;
- this.name = name;
- this.desc = desc;
+ /** Whether the owner is an interface or not. */
+ private final boolean isInterface;
+
+ /**
+ * Constructs a new field or method handle.
+ *
+ * @param tag the kind of field or method designated by this Handle. Must be {@link
+ * Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, {@link
+ * Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
+ * {@link Opcodes#H_INVOKESPECIAL}, {@link Opcodes#H_NEWINVOKESPECIAL} or {@link
+ * Opcodes#H_INVOKEINTERFACE}.
+ * @param owner the internal name of the class that owns the field or method designated by this
+ * handle.
+ * @param name the name of the field or method designated by this handle.
+ * @param descriptor the descriptor of the field or method designated by this handle.
+ * @deprecated this constructor has been superseded by {@link #Handle(int, String, String, String,
+ * boolean)}.
+ */
+ @Deprecated
+ public Handle(final int tag, final String owner, final String name, final String descriptor) {
+ this(tag, owner, name, descriptor, tag == Opcodes.H_INVOKEINTERFACE);
+ }
+
+ /**
+ * Constructs a new field or method handle.
+ *
+ * @param tag the kind of field or method designated by this Handle. Must be {@link
+ * Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, {@link
+ * Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
+ * {@link Opcodes#H_INVOKESPECIAL}, {@link Opcodes#H_NEWINVOKESPECIAL} or {@link
+ * Opcodes#H_INVOKEINTERFACE}.
+ * @param owner the internal name of the class that owns the field or method designated by this
+ * handle.
+ * @param name the name of the field or method designated by this handle.
+ * @param descriptor the descriptor of the field or method designated by this handle.
+ * @param isInterface whether the owner is an interface or not.
+ */
+ public Handle(
+ final int tag,
+ final String owner,
+ final String name,
+ final String descriptor,
+ final boolean isInterface) {
+ this.tag = tag;
+ this.owner = owner;
+ this.name = name;
+ this.descriptor = descriptor;
+ this.isInterface = isInterface;
+ }
+
+ /**
+ * Returns the kind of field or method designated by this handle.
+ *
+ * @return {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD},
+ * {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL}, {@link
+ * Opcodes#H_INVOKESTATIC}, {@link Opcodes#H_INVOKESPECIAL}, {@link
+ * Opcodes#H_NEWINVOKESPECIAL} or {@link Opcodes#H_INVOKEINTERFACE}.
+ */
+ public int getTag() {
+ return tag;
+ }
+
+ /**
+ * Returns the internal name of the class that owns the field or method designated by this handle.
+ *
+ * @return the internal name of the class that owns the field or method designated by this handle.
+ */
+ public String getOwner() {
+ return owner;
+ }
+
+ /**
+ * Returns the name of the field or method designated by this handle.
+ *
+ * @return the name of the field or method designated by this handle.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns the descriptor of the field or method designated by this handle.
+ *
+ * @return the descriptor of the field or method designated by this handle.
+ */
+ public String getDesc() {
+ return descriptor;
+ }
+
+ /**
+ * Returns true if the owner of the field or method designated by this handle is an interface.
+ *
+ * @return true if the owner of the field or method designated by this handle is an interface.
+ */
+ public boolean isInterface() {
+ return isInterface;
+ }
+
+ @Override
+ public boolean equals(final Object object) {
+ if (object == this) {
+ return true;
}
-
- /**
- * Returns the kind of field or method designated by this handle.
- *
- * @return {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
- * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
- * {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
- * {@link Opcodes#H_INVOKESPECIAL},
- * {@link Opcodes#H_NEWINVOKESPECIAL} or
- * {@link Opcodes#H_INVOKEINTERFACE}.
- */
- public int getTag() {
- return tag;
+ if (!(object instanceof Handle)) {
+ return false;
}
+ Handle handle = (Handle) object;
+ return tag == handle.tag
+ && isInterface == handle.isInterface
+ && owner.equals(handle.owner)
+ && name.equals(handle.name)
+ && descriptor.equals(handle.descriptor);
+ }
- /**
- * Returns the internal name of the class that owns the field or method
- * designated by this handle.
- *
- * @return the internal name of the class that owns the field or method
- * designated by this handle.
- */
- public String getOwner() {
- return owner;
- }
+ @Override
+ public int hashCode() {
+ return tag
+ + (isInterface ? 64 : 0)
+ + owner.hashCode() * name.hashCode() * descriptor.hashCode();
+ }
- /**
- * Returns the name of the field or method designated by this handle.
- *
- * @return the name of the field or method designated by this handle.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Returns the descriptor of the field or method designated by this handle.
- *
- * @return the descriptor of the field or method designated by this handle.
- */
- public String getDesc() {
- return desc;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof Handle)) {
- return false;
- }
- Handle h = (Handle) obj;
- return tag == h.tag && owner.equals(h.owner) && name.equals(h.name)
- && desc.equals(h.desc);
- }
-
- @Override
- public int hashCode() {
- return tag + owner.hashCode() * name.hashCode() * desc.hashCode();
- }
-
- /**
- * Returns the textual representation of this handle. The textual
- * representation is:
- *
- * <pre>
- * owner '.' name desc ' ' '(' tag ')'
- * </pre>
- *
- * . As this format is unambiguous, it can be parsed if necessary.
- */
- @Override
- public String toString() {
- return owner + '.' + name + desc + " (" + tag + ')';
- }
+ /**
+ * Returns the textual representation of this handle. The textual representation is:
+ *
+ * <ul>
+ * <li>for a reference to a class: owner "." name descriptor " (" tag ")",
+ * <li>for a reference to an interface: owner "." name descriptor " (" tag " itf)".
+ * </ul>
+ */
+ @Override
+ public String toString() {
+ return owner + '.' + name + descriptor + " (" + tag + (isInterface ? " itf" : "") + ')';
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Handler.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Handler.java
index feafd10..590698f 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Handler.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Handler.java
@@ -1,121 +1,198 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * Information about an exception handler block.
+ * Information about an exception handler. Corresponds to an element of the exception_table array of
+ * a Code attribute, as defined in the Java Virtual Machine Specification (JVMS). Handler instances
+ * can be chained together, with their {@link #nextHandler} field, to describe a full JVMS
+ * exception_table array.
*
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.3">JVMS
+ * 4.7.3</a>
* @author Eric Bruneton
*/
-class Handler {
+final class Handler {
- /**
- * Beginning of the exception handler's scope (inclusive).
- */
- Label start;
+ /**
+ * The start_pc field of this JVMS exception_table entry. Corresponds to the beginning of the
+ * exception handler's scope (inclusive).
+ */
+ final Label startPc;
- /**
- * End of the exception handler's scope (exclusive).
- */
- Label end;
+ /**
+ * The end_pc field of this JVMS exception_table entry. Corresponds to the end of the exception
+ * handler's scope (exclusive).
+ */
+ final Label endPc;
- /**
- * Beginning of the exception handler's code.
- */
- Label handler;
+ /**
+ * The handler_pc field of this JVMS exception_table entry. Corresponding to the beginning of the
+ * exception handler's code.
+ */
+ final Label handlerPc;
- /**
- * Internal name of the type of exceptions handled by this handler, or
- * <tt>null</tt> to catch any exceptions.
- */
- String desc;
+ /**
+ * The catch_type field of this JVMS exception_table entry. This is the constant pool index of the
+ * internal name of the type of exceptions handled by this handler, or 0 to catch any exceptions.
+ */
+ final int catchType;
- /**
- * Constant pool index of the internal name of the type of exceptions
- * handled by this handler, or 0 to catch any exceptions.
- */
- int type;
+ /**
+ * The internal name of the type of exceptions handled by this handler, or {@literal null} to
+ * catch any exceptions.
+ */
+ final String catchTypeDescriptor;
- /**
- * Next exception handler block info.
- */
- Handler next;
+ /** The next exception handler. */
+ Handler nextHandler;
- /**
- * Removes the range between start and end from the given exception
- * handlers.
- *
- * @param h
- * an exception handler list.
- * @param start
- * the start of the range to be removed.
- * @param end
- * the end of the range to be removed. Maybe null.
- * @return the exception handler list with the start-end range removed.
- */
- static Handler remove(Handler h, Label start, Label end) {
- if (h == null) {
- return null;
- } else {
- h.next = remove(h.next, start, end);
- }
- int hstart = h.start.position;
- int hend = h.end.position;
- int s = start.position;
- int e = end == null ? Integer.MAX_VALUE : end.position;
- // if [hstart,hend[ and [s,e[ intervals intersect...
- if (s < hend && e > hstart) {
- if (s <= hstart) {
- if (e >= hend) {
- // [hstart,hend[ fully included in [s,e[, h removed
- h = h.next;
- } else {
- // [hstart,hend[ minus [s,e[ = [e,hend[
- h.start = end;
- }
- } else if (e >= hend) {
- // [hstart,hend[ minus [s,e[ = [hstart,s[
- h.end = start;
- } else {
- // [hstart,hend[ minus [s,e[ = [hstart,s[ + [e,hend[
- Handler g = new Handler();
- g.start = end;
- g.end = h.end;
- g.handler = h.handler;
- g.desc = h.desc;
- g.type = h.type;
- g.next = h.next;
- h.end = start;
- h.next = g;
- }
- }
- return h;
+ /**
+ * Constructs a new Handler.
+ *
+ * @param startPc the start_pc field of this JVMS exception_table entry.
+ * @param endPc the end_pc field of this JVMS exception_table entry.
+ * @param handlerPc the handler_pc field of this JVMS exception_table entry.
+ * @param catchType The catch_type field of this JVMS exception_table entry.
+ * @param catchTypeDescriptor The internal name of the type of exceptions handled by this handler,
+ * or {@literal null} to catch any exceptions.
+ */
+ Handler(
+ final Label startPc,
+ final Label endPc,
+ final Label handlerPc,
+ final int catchType,
+ final String catchTypeDescriptor) {
+ this.startPc = startPc;
+ this.endPc = endPc;
+ this.handlerPc = handlerPc;
+ this.catchType = catchType;
+ this.catchTypeDescriptor = catchTypeDescriptor;
+ }
+
+ /**
+ * Constructs a new Handler from the given one, with a different scope.
+ *
+ * @param handler an existing Handler.
+ * @param startPc the start_pc field of this JVMS exception_table entry.
+ * @param endPc the end_pc field of this JVMS exception_table entry.
+ */
+ Handler(final Handler handler, final Label startPc, final Label endPc) {
+ this(startPc, endPc, handler.handlerPc, handler.catchType, handler.catchTypeDescriptor);
+ this.nextHandler = handler.nextHandler;
+ }
+
+ /**
+ * Removes the range between start and end from the Handler list that begins with the given
+ * element.
+ *
+ * @param firstHandler the beginning of a Handler list. May be {@literal null}.
+ * @param start the start of the range to be removed.
+ * @param end the end of the range to be removed. Maybe {@literal null}.
+ * @return the exception handler list with the start-end range removed.
+ */
+ static Handler removeRange(final Handler firstHandler, final Label start, final Label end) {
+ if (firstHandler == null) {
+ return null;
+ } else {
+ firstHandler.nextHandler = removeRange(firstHandler.nextHandler, start, end);
}
+ int handlerStart = firstHandler.startPc.bytecodeOffset;
+ int handlerEnd = firstHandler.endPc.bytecodeOffset;
+ int rangeStart = start.bytecodeOffset;
+ int rangeEnd = end == null ? Integer.MAX_VALUE : end.bytecodeOffset;
+ // Return early if [handlerStart,handlerEnd[ and [rangeStart,rangeEnd[ don't intersect.
+ if (rangeStart >= handlerEnd || rangeEnd <= handlerStart) {
+ return firstHandler;
+ }
+ if (rangeStart <= handlerStart) {
+ if (rangeEnd >= handlerEnd) {
+ // If [handlerStart,handlerEnd[ is included in [rangeStart,rangeEnd[, remove firstHandler.
+ return firstHandler.nextHandler;
+ } else {
+ // [handlerStart,handlerEnd[ - [rangeStart,rangeEnd[ = [rangeEnd,handlerEnd[
+ return new Handler(firstHandler, end, firstHandler.endPc);
+ }
+ } else if (rangeEnd >= handlerEnd) {
+ // [handlerStart,handlerEnd[ - [rangeStart,rangeEnd[ = [handlerStart,rangeStart[
+ return new Handler(firstHandler, firstHandler.startPc, start);
+ } else {
+ // [handlerStart,handlerEnd[ - [rangeStart,rangeEnd[ =
+ // [handlerStart,rangeStart[ + [rangeEnd,handerEnd[
+ firstHandler.nextHandler = new Handler(firstHandler, end, firstHandler.endPc);
+ return new Handler(firstHandler, firstHandler.startPc, start);
+ }
+ }
+
+ /**
+ * Returns the number of elements of the Handler list that begins with the given element.
+ *
+ * @param firstHandler the beginning of a Handler list. May be {@literal null}.
+ * @return the number of elements of the Handler list that begins with 'handler'.
+ */
+ static int getExceptionTableLength(final Handler firstHandler) {
+ int length = 0;
+ Handler handler = firstHandler;
+ while (handler != null) {
+ length++;
+ handler = handler.nextHandler;
+ }
+ return length;
+ }
+
+ /**
+ * Returns the size in bytes of the JVMS exception_table corresponding to the Handler list that
+ * begins with the given element. <i>This includes the exception_table_length field.</i>
+ *
+ * @param firstHandler the beginning of a Handler list. May be {@literal null}.
+ * @return the size in bytes of the exception_table_length and exception_table structures.
+ */
+ static int getExceptionTableSize(final Handler firstHandler) {
+ return 2 + 8 * getExceptionTableLength(firstHandler);
+ }
+
+ /**
+ * Puts the JVMS exception_table corresponding to the Handler list that begins with the given
+ * element. <i>This includes the exception_table_length field.</i>
+ *
+ * @param firstHandler the beginning of a Handler list. May be {@literal null}.
+ * @param output where the exception_table_length and exception_table structures must be put.
+ */
+ static void putExceptionTable(final Handler firstHandler, final ByteVector output) {
+ output.putShort(getExceptionTableLength(firstHandler));
+ Handler handler = firstHandler;
+ while (handler != null) {
+ output
+ .putShort(handler.startPc.bytecodeOffset)
+ .putShort(handler.endPc.bytecodeOffset)
+ .putShort(handler.handlerPc.bytecodeOffset)
+ .putShort(handler.catchType);
+ handler = handler.nextHandler;
+ }
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Item.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Item.java
deleted file mode 100644
index bc88b3c..0000000
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Item.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package jersey.repackaged.org.objectweb.asm;
-
-/**
- * A constant pool item. Constant pool items can be created with the 'newXXX'
- * methods in the {@link ClassWriter} class.
- *
- * @author Eric Bruneton
- */
-final class Item {
-
- /**
- * Index of this item in the constant pool.
- */
- int index;
-
- /**
- * Type of this constant pool item. A single class is used to represent all
- * constant pool item types, in order to minimize the bytecode size of this
- * package. The value of this field is one of {@link ClassWriter#INT},
- * {@link ClassWriter#LONG}, {@link ClassWriter#FLOAT},
- * {@link ClassWriter#DOUBLE}, {@link ClassWriter#UTF8},
- * {@link ClassWriter#STR}, {@link ClassWriter#CLASS},
- * {@link ClassWriter#NAME_TYPE}, {@link ClassWriter#FIELD},
- * {@link ClassWriter#METH}, {@link ClassWriter#IMETH},
- * {@link ClassWriter#MTYPE}, {@link ClassWriter#INDY}.
- *
- * MethodHandle constant 9 variations are stored using a range of 9 values
- * from {@link ClassWriter#HANDLE_BASE} + 1 to
- * {@link ClassWriter#HANDLE_BASE} + 9.
- *
- * Special Item types are used for Items that are stored in the ClassWriter
- * {@link ClassWriter#typeTable}, instead of the constant pool, in order to
- * avoid clashes with normal constant pool items in the ClassWriter constant
- * pool's hash table. These special item types are
- * {@link ClassWriter#TYPE_NORMAL}, {@link ClassWriter#TYPE_UNINIT} and
- * {@link ClassWriter#TYPE_MERGED}.
- */
- int type;
-
- /**
- * Value of this item, for an integer item.
- */
- int intVal;
-
- /**
- * Value of this item, for a long item.
- */
- long longVal;
-
- /**
- * First part of the value of this item, for items that do not hold a
- * primitive value.
- */
- String strVal1;
-
- /**
- * Second part of the value of this item, for items that do not hold a
- * primitive value.
- */
- String strVal2;
-
- /**
- * Third part of the value of this item, for items that do not hold a
- * primitive value.
- */
- String strVal3;
-
- /**
- * The hash code value of this constant pool item.
- */
- int hashCode;
-
- /**
- * Link to another constant pool item, used for collision lists in the
- * constant pool's hash table.
- */
- Item next;
-
- /**
- * Constructs an uninitialized {@link Item}.
- */
- Item() {
- }
-
- /**
- * Constructs an uninitialized {@link Item} for constant pool element at
- * given position.
- *
- * @param index
- * index of the item to be constructed.
- */
- Item(final int index) {
- this.index = index;
- }
-
- /**
- * Constructs a copy of the given item.
- *
- * @param index
- * index of the item to be constructed.
- * @param i
- * the item that must be copied into the item to be constructed.
- */
- Item(final int index, final Item i) {
- this.index = index;
- type = i.type;
- intVal = i.intVal;
- longVal = i.longVal;
- strVal1 = i.strVal1;
- strVal2 = i.strVal2;
- strVal3 = i.strVal3;
- hashCode = i.hashCode;
- }
-
- /**
- * Sets this item to an integer item.
- *
- * @param intVal
- * the value of this item.
- */
- void set(final int intVal) {
- this.type = ClassWriter.INT;
- this.intVal = intVal;
- this.hashCode = 0x7FFFFFFF & (type + intVal);
- }
-
- /**
- * Sets this item to a long item.
- *
- * @param longVal
- * the value of this item.
- */
- void set(final long longVal) {
- this.type = ClassWriter.LONG;
- this.longVal = longVal;
- this.hashCode = 0x7FFFFFFF & (type + (int) longVal);
- }
-
- /**
- * Sets this item to a float item.
- *
- * @param floatVal
- * the value of this item.
- */
- void set(final float floatVal) {
- this.type = ClassWriter.FLOAT;
- this.intVal = Float.floatToRawIntBits(floatVal);
- this.hashCode = 0x7FFFFFFF & (type + (int) floatVal);
- }
-
- /**
- * Sets this item to a double item.
- *
- * @param doubleVal
- * the value of this item.
- */
- void set(final double doubleVal) {
- this.type = ClassWriter.DOUBLE;
- this.longVal = Double.doubleToRawLongBits(doubleVal);
- this.hashCode = 0x7FFFFFFF & (type + (int) doubleVal);
- }
-
- /**
- * Sets this item to an item that do not hold a primitive value.
- *
- * @param type
- * the type of this item.
- * @param strVal1
- * first part of the value of this item.
- * @param strVal2
- * second part of the value of this item.
- * @param strVal3
- * third part of the value of this item.
- */
- @SuppressWarnings("fallthrough")
- void set(final int type, final String strVal1, final String strVal2,
- final String strVal3) {
- this.type = type;
- this.strVal1 = strVal1;
- this.strVal2 = strVal2;
- this.strVal3 = strVal3;
- switch (type) {
- case ClassWriter.CLASS:
- this.intVal = 0; // intVal of a class must be zero, see visitInnerClass
- case ClassWriter.UTF8:
- case ClassWriter.STR:
- case ClassWriter.MTYPE:
- case ClassWriter.TYPE_NORMAL:
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
- return;
- case ClassWriter.NAME_TYPE: {
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
- * strVal2.hashCode());
- return;
- }
- // ClassWriter.FIELD:
- // ClassWriter.METH:
- // ClassWriter.IMETH:
- // ClassWriter.HANDLE_BASE + 1..9
- default:
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
- * strVal2.hashCode() * strVal3.hashCode());
- }
- }
-
- /**
- * Sets the item to an InvokeDynamic item.
- *
- * @param name
- * invokedynamic's name.
- * @param desc
- * invokedynamic's desc.
- * @param bsmIndex
- * zero based index into the class attribute BootrapMethods.
- */
- void set(String name, String desc, int bsmIndex) {
- this.type = ClassWriter.INDY;
- this.longVal = bsmIndex;
- this.strVal1 = name;
- this.strVal2 = desc;
- this.hashCode = 0x7FFFFFFF & (ClassWriter.INDY + bsmIndex
- * strVal1.hashCode() * strVal2.hashCode());
- }
-
- /**
- * Sets the item to a BootstrapMethod item.
- *
- * @param position
- * position in byte in the class attribute BootrapMethods.
- * @param hashCode
- * hashcode of the item. This hashcode is processed from the
- * hashcode of the bootstrap method and the hashcode of all
- * bootstrap arguments.
- */
- void set(int position, int hashCode) {
- this.type = ClassWriter.BSM;
- this.intVal = position;
- this.hashCode = hashCode;
- }
-
- /**
- * Indicates if the given item is equal to this one. <i>This method assumes
- * that the two items have the same {@link #type}</i>.
- *
- * @param i
- * the item to be compared to this one. Both items must have the
- * same {@link #type}.
- * @return <tt>true</tt> if the given item if equal to this one,
- * <tt>false</tt> otherwise.
- */
- boolean isEqualTo(final Item i) {
- switch (type) {
- case ClassWriter.UTF8:
- case ClassWriter.STR:
- case ClassWriter.CLASS:
- case ClassWriter.MTYPE:
- case ClassWriter.TYPE_NORMAL:
- return i.strVal1.equals(strVal1);
- case ClassWriter.TYPE_MERGED:
- case ClassWriter.LONG:
- case ClassWriter.DOUBLE:
- return i.longVal == longVal;
- case ClassWriter.INT:
- case ClassWriter.FLOAT:
- return i.intVal == intVal;
- case ClassWriter.TYPE_UNINIT:
- return i.intVal == intVal && i.strVal1.equals(strVal1);
- case ClassWriter.NAME_TYPE:
- return i.strVal1.equals(strVal1) && i.strVal2.equals(strVal2);
- case ClassWriter.INDY: {
- return i.longVal == longVal && i.strVal1.equals(strVal1)
- && i.strVal2.equals(strVal2);
- }
- // case ClassWriter.FIELD:
- // case ClassWriter.METH:
- // case ClassWriter.IMETH:
- // case ClassWriter.HANDLE_BASE + 1..9
- default:
- return i.strVal1.equals(strVal1) && i.strVal2.equals(strVal2)
- && i.strVal3.equals(strVal3);
- }
- }
-
-}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Label.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Label.java
index 0f920af..25814e1 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Label.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Label.java
@@ -1,565 +1,621 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A label represents a position in the bytecode of a method. Labels are used
- * for jump, goto, and switch instructions, and for try catch blocks. A label
- * designates the <i>instruction</i> that is just after. Note however that there
- * can be other elements between a label and the instruction it designates (such
+ * A position in the bytecode of a method. Labels are used for jump, goto, and switch instructions,
+ * and for try catch blocks. A label designates the <i>instruction</i> that is just after. Note
+ * however that there can be other elements between a label and the instruction it designates (such
* as other labels, stack map frames, line numbers, etc.).
*
* @author Eric Bruneton
*/
public class Label {
- /**
- * Indicates if this label is only used for debug attributes. Such a label
- * is not the start of a basic block, the target of a jump instruction, or
- * an exception handler. It can be safely ignored in control flow graph
- * analysis algorithms (for optimization purposes).
- */
- static final int DEBUG = 1;
+ /**
+ * A flag indicating that a label is only used for debug attributes. Such a label is not the start
+ * of a basic block, the target of a jump instruction, or an exception handler. It can be safely
+ * ignored in control flow graph analysis algorithms (for optimization purposes).
+ */
+ static final int FLAG_DEBUG_ONLY = 1;
- /**
- * Indicates if the position of this label is known.
- */
- static final int RESOLVED = 2;
+ /**
+ * A flag indicating that a label is the target of a jump instruction, or the start of an
+ * exception handler.
+ */
+ static final int FLAG_JUMP_TARGET = 2;
- /**
- * Indicates if this label has been updated, after instruction resizing.
- */
- static final int RESIZED = 4;
+ /** A flag indicating that the bytecode offset of a label is known. */
+ static final int FLAG_RESOLVED = 4;
- /**
- * Indicates if this basic block has been pushed in the basic block stack.
- * See {@link MethodWriter#visitMaxs visitMaxs}.
- */
- static final int PUSHED = 8;
+ /** A flag indicating that a label corresponds to a reachable basic block. */
+ static final int FLAG_REACHABLE = 8;
- /**
- * Indicates if this label is the target of a jump instruction, or the start
- * of an exception handler.
- */
- static final int TARGET = 16;
+ /**
+ * A flag indicating that the basic block corresponding to a label ends with a subroutine call. By
+ * construction in {@link MethodWriter#visitJumpInsn}, labels with this flag set have at least two
+ * outgoing edges:
+ *
+ * <ul>
+ * <li>the first one corresponds to the instruction that follows the jsr instruction in the
+ * bytecode, i.e. where execution continues when it returns from the jsr call. This is a
+ * virtual control flow edge, since execution never goes directly from the jsr to the next
+ * instruction. Instead, it goes to the subroutine and eventually returns to the instruction
+ * following the jsr. This virtual edge is used to compute the real outgoing edges of the
+ * basic blocks ending with a ret instruction, in {@link #addSubroutineRetSuccessors}.
+ * <li>the second one corresponds to the target of the jsr instruction,
+ * </ul>
+ */
+ static final int FLAG_SUBROUTINE_CALLER = 16;
- /**
- * Indicates if a stack map frame must be stored for this label.
- */
- static final int STORE = 32;
+ /**
+ * A flag indicating that the basic block corresponding to a label is the start of a subroutine.
+ */
+ static final int FLAG_SUBROUTINE_START = 32;
- /**
- * Indicates if this label corresponds to a reachable basic block.
- */
- static final int REACHABLE = 64;
+ /** A flag indicating that the basic block corresponding to a label is the end of a subroutine. */
+ static final int FLAG_SUBROUTINE_END = 64;
- /**
- * Indicates if this basic block ends with a JSR instruction.
- */
- static final int JSR = 128;
+ /**
+ * The number of elements to add to the {@link #otherLineNumbers} array when it needs to be
+ * resized to store a new source line number.
+ */
+ static final int LINE_NUMBERS_CAPACITY_INCREMENT = 4;
- /**
- * Indicates if this basic block ends with a RET instruction.
- */
- static final int RET = 256;
+ /**
+ * The number of elements to add to the {@link #forwardReferences} array when it needs to be
+ * resized to store a new forward reference.
+ */
+ static final int FORWARD_REFERENCES_CAPACITY_INCREMENT = 6;
- /**
- * Indicates if this basic block is the start of a subroutine.
- */
- static final int SUBROUTINE = 512;
+ /**
+ * The bit mask to extract the type of a forward reference to this label. The extracted type is
+ * either {@link #FORWARD_REFERENCE_TYPE_SHORT} or {@link #FORWARD_REFERENCE_TYPE_WIDE}.
+ *
+ * @see #forwardReferences
+ */
+ static final int FORWARD_REFERENCE_TYPE_MASK = 0xF0000000;
- /**
- * Indicates if this subroutine basic block has been visited by a
- * visitSubroutine(null, ...) call.
- */
- static final int VISITED = 1024;
+ /**
+ * The type of forward references stored with two bytes in the bytecode. This is the case, for
+ * instance, of a forward reference from an ifnull instruction.
+ */
+ static final int FORWARD_REFERENCE_TYPE_SHORT = 0x10000000;
- /**
- * Indicates if this subroutine basic block has been visited by a
- * visitSubroutine(!null, ...) call.
- */
- static final int VISITED2 = 2048;
+ /**
+ * The type of forward references stored in four bytes in the bytecode. This is the case, for
+ * instance, of a forward reference from a lookupswitch instruction.
+ */
+ static final int FORWARD_REFERENCE_TYPE_WIDE = 0x20000000;
- /**
- * Field used to associate user information to a label. Warning: this field
- * is used by the ASM tree package. In order to use it with the ASM tree
- * package you must override the
- * {@link org.objectweb.asm.tree.MethodNode#getLabelNode} method.
- */
- public Object info;
+ /**
+ * The bit mask to extract the 'handle' of a forward reference to this label. The extracted handle
+ * is the bytecode offset where the forward reference value is stored (using either 2 or 4 bytes,
+ * as indicated by the {@link #FORWARD_REFERENCE_TYPE_MASK}).
+ *
+ * @see #forwardReferences
+ */
+ static final int FORWARD_REFERENCE_HANDLE_MASK = 0x0FFFFFFF;
- /**
- * Flags that indicate the status of this label.
- *
- * @see #DEBUG
- * @see #RESOLVED
- * @see #RESIZED
- * @see #PUSHED
- * @see #TARGET
- * @see #STORE
- * @see #REACHABLE
- * @see #JSR
- * @see #RET
- */
- int status;
+ /**
+ * A sentinel element used to indicate the end of a list of labels.
+ *
+ * @see #nextListElement
+ */
+ static final Label EMPTY_LIST = new Label();
- /**
- * The line number corresponding to this label, if known. If there are
- * several lines, each line is stored in a separate label, all linked via
- * their next field (these links are created in ClassReader and removed just
- * before visitLabel is called, so that this does not impact the rest of the
- * code).
- */
- int line;
+ /**
+ * A user managed state associated with this label. Warning: this field is used by the ASM tree
+ * package. In order to use it with the ASM tree package you must override the getLabelNode method
+ * in MethodNode.
+ */
+ public Object info;
- /**
- * The position of this label in the code, if known.
- */
- int position;
+ /**
+ * The type and status of this label or its corresponding basic block. Must be zero or more of
+ * {@link #FLAG_DEBUG_ONLY}, {@link #FLAG_JUMP_TARGET}, {@link #FLAG_RESOLVED}, {@link
+ * #FLAG_REACHABLE}, {@link #FLAG_SUBROUTINE_CALLER}, {@link #FLAG_SUBROUTINE_START}, {@link
+ * #FLAG_SUBROUTINE_END}.
+ */
+ short flags;
- /**
- * Number of forward references to this label, times two.
- */
- private int referenceCount;
+ /**
+ * The source line number corresponding to this label, or 0. If there are several source line
+ * numbers corresponding to this label, the first one is stored in this field, and the remaining
+ * ones are stored in {@link #otherLineNumbers}.
+ */
+ private short lineNumber;
- /**
- * Informations about forward references. Each forward reference is
- * described by two consecutive integers in this array: the first one is the
- * position of the first byte of the bytecode instruction that contains the
- * forward reference, while the second is the position of the first byte of
- * the forward reference itself. In fact the sign of the first integer
- * indicates if this reference uses 2 or 4 bytes, and its absolute value
- * gives the position of the bytecode instruction. This array is also used
- * as a bitset to store the subroutines to which a basic block belongs. This
- * information is needed in {@linked MethodWriter#visitMaxs}, after all
- * forward references have been resolved. Hence the same array can be used
- * for both purposes without problems.
- */
- private int[] srcAndRefPositions;
+ /**
+ * The source line numbers corresponding to this label, in addition to {@link #lineNumber}, or
+ * null. The first element of this array is the number n of source line numbers it contains, which
+ * are stored between indices 1 and n (inclusive).
+ */
+ private int[] otherLineNumbers;
- // ------------------------------------------------------------------------
+ /**
+ * The offset of this label in the bytecode of its method, in bytes. This value is set if and only
+ * if the {@link #FLAG_RESOLVED} flag is set.
+ */
+ int bytecodeOffset;
- /*
- * Fields for the control flow and data flow graph analysis algorithms (used
- * to compute the maximum stack size or the stack map frames). A control
- * flow graph contains one node per "basic block", and one edge per "jump"
- * from one basic block to another. Each node (i.e., each basic block) is
- * represented by the Label object that corresponds to the first instruction
- * of this basic block. Each node also stores the list of its successors in
- * the graph, as a linked list of Edge objects.
- *
- * The control flow analysis algorithms used to compute the maximum stack
- * size or the stack map frames are similar and use two steps. The first
- * step, during the visit of each instruction, builds information about the
- * state of the local variables and the operand stack at the end of each
- * basic block, called the "output frame", <i>relatively</i> to the frame
- * state at the beginning of the basic block, which is called the "input
- * frame", and which is <i>unknown</i> during this step. The second step, in
- * {@link MethodWriter#visitMaxs}, is a fix point algorithm that computes
- * information about the input frame of each basic block, from the input
- * state of the first basic block (known from the method signature), and by
- * the using the previously computed relative output frames.
- *
- * The algorithm used to compute the maximum stack size only computes the
- * relative output and absolute input stack heights, while the algorithm
- * used to compute stack map frames computes relative output frames and
- * absolute input frames.
- */
+ /**
+ * The forward references to this label. The first element is the number of forward references,
+ * times 2 (this corresponds to the index of the last element actually used in this array). Then,
+ * each forward reference is described with two consecutive integers noted
+ * 'sourceInsnBytecodeOffset' and 'reference':
+ *
+ * <ul>
+ * <li>'sourceInsnBytecodeOffset' is the bytecode offset of the instruction that contains the
+ * forward reference,
+ * <li>'reference' contains the type and the offset in the bytecode where the forward reference
+ * value must be stored, which can be extracted with {@link #FORWARD_REFERENCE_TYPE_MASK}
+ * and {@link #FORWARD_REFERENCE_HANDLE_MASK}.
+ * </ul>
+ *
+ * <p>For instance, for an ifnull instruction at bytecode offset x, 'sourceInsnBytecodeOffset' is
+ * equal to x, and 'reference' is of type {@link #FORWARD_REFERENCE_TYPE_SHORT} with value x + 1
+ * (because the ifnull instruction uses a 2 bytes bytecode offset operand stored one byte after
+ * the start of the instruction itself). For the default case of a lookupswitch instruction at
+ * bytecode offset x, 'sourceInsnBytecodeOffset' is equal to x, and 'reference' is of type {@link
+ * #FORWARD_REFERENCE_TYPE_WIDE} with value between x + 1 and x + 4 (because the lookupswitch
+ * instruction uses a 4 bytes bytecode offset operand stored one to four bytes after the start of
+ * the instruction itself).
+ */
+ private int[] forwardReferences;
- /**
- * Start of the output stack relatively to the input stack. The exact
- * semantics of this field depends on the algorithm that is used.
- *
- * When only the maximum stack size is computed, this field is the number of
- * elements in the input stack.
- *
- * When the stack map frames are completely computed, this field is the
- * offset of the first output stack element relatively to the top of the
- * input stack. This offset is always negative or null. A null offset means
- * that the output stack must be appended to the input stack. A -n offset
- * means that the first n output stack elements must replace the top n input
- * stack elements, and that the other elements must be appended to the input
- * stack.
- */
- int inputStackTop;
+ // -----------------------------------------------------------------------------------------------
- /**
- * Maximum height reached by the output stack, relatively to the top of the
- * input stack. This maximum is always positive or null.
- */
- int outputStackMax;
+ // Fields for the control flow and data flow graph analysis algorithms (used to compute the
+ // maximum stack size or the stack map frames). A control flow graph contains one node per "basic
+ // block", and one edge per "jump" from one basic block to another. Each node (i.e., each basic
+ // block) is represented with the Label object that corresponds to the first instruction of this
+ // basic block. Each node also stores the list of its successors in the graph, as a linked list of
+ // Edge objects.
+ //
+ // The control flow analysis algorithms used to compute the maximum stack size or the stack map
+ // frames are similar and use two steps. The first step, during the visit of each instruction,
+ // builds information about the state of the local variables and the operand stack at the end of
+ // each basic block, called the "output frame", <i>relatively</i> to the frame state at the
+ // beginning of the basic block, which is called the "input frame", and which is <i>unknown</i>
+ // during this step. The second step, in {@link MethodWriter#computeAllFrames} and {@link
+ // MethodWriter#computeMaxStackAndLocal}, is a fix point algorithm
+ // that computes information about the input frame of each basic block, from the input state of
+ // the first basic block (known from the method signature), and by the using the previously
+ // computed relative output frames.
+ //
+ // The algorithm used to compute the maximum stack size only computes the relative output and
+ // absolute input stack heights, while the algorithm used to compute stack map frames computes
+ // relative output frames and absolute input frames.
- /**
- * Information about the input and output stack map frames of this basic
- * block. This field is only used when {@link ClassWriter#COMPUTE_FRAMES}
- * option is used.
- */
- Frame frame;
+ /**
+ * The number of elements in the input stack of the basic block corresponding to this label. This
+ * field is computed in {@link MethodWriter#computeMaxStackAndLocal}.
+ */
+ short inputStackSize;
- /**
- * The successor of this label, in the order they are visited. This linked
- * list does not include labels used for debug info only. If
- * {@link ClassWriter#COMPUTE_FRAMES} option is used then, in addition, it
- * does not contain successive labels that denote the same bytecode position
- * (in this case only the first label appears in this list).
- */
- Label successor;
+ /**
+ * The number of elements in the output stack, at the end of the basic block corresponding to this
+ * label. This field is only computed for basic blocks that end with a RET instruction.
+ */
+ short outputStackSize;
- /**
- * The successors of this node in the control flow graph. These successors
- * are stored in a linked list of {@link Edge Edge} objects, linked to each
- * other by their {@link Edge#next} field.
- */
- Edge successors;
+ /**
+ * The maximum height reached by the output stack, relatively to the top of the input stack, in
+ * the basic block corresponding to this label. This maximum is always positive or null.
+ */
+ short outputStackMax;
- /**
- * The next basic block in the basic block stack. This stack is used in the
- * main loop of the fix point algorithm used in the second step of the
- * control flow analysis algorithms. It is also used in
- * {@link #visitSubroutine} to avoid using a recursive method, and in
- * ClassReader to temporarily store multiple source lines for a label.
- *
- * @see MethodWriter#visitMaxs
- */
- Label next;
+ /**
+ * The id of the subroutine to which this basic block belongs, or 0. If the basic block belongs to
+ * several subroutines, this is the id of the "oldest" subroutine that contains it (with the
+ * convention that a subroutine calling another one is "older" than the callee). This field is
+ * computed in {@link MethodWriter#computeMaxStackAndLocal}, if the method contains JSR
+ * instructions.
+ */
+ short subroutineId;
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
+ /**
+ * The input and output stack map frames of the basic block corresponding to this label. This
+ * field is only used when the {@link MethodWriter#COMPUTE_ALL_FRAMES} or {@link
+ * MethodWriter#COMPUTE_INSERTED_FRAMES} option is used.
+ */
+ Frame frame;
- /**
- * Constructs a new label.
- */
- public Label() {
+ /**
+ * The successor of this label, in the order they are visited in {@link MethodVisitor#visitLabel}.
+ * This linked list does not include labels used for debug info only. If the {@link
+ * MethodWriter#COMPUTE_ALL_FRAMES} or {@link MethodWriter#COMPUTE_INSERTED_FRAMES} option is used
+ * then it does not contain either successive labels that denote the same bytecode offset (in this
+ * case only the first label appears in this list).
+ */
+ Label nextBasicBlock;
+
+ /**
+ * The outgoing edges of the basic block corresponding to this label, in the control flow graph of
+ * its method. These edges are stored in a linked list of {@link Edge} objects, linked to each
+ * other by their {@link Edge#nextEdge} field.
+ */
+ Edge outgoingEdges;
+
+ /**
+ * The next element in the list of labels to which this label belongs, or null if it does not
+ * belong to any list. All lists of labels must end with the {@link #EMPTY_LIST} sentinel, in
+ * order to ensure that this field is null if and only if this label does not belong to a list of
+ * labels. Note that there can be several lists of labels at the same time, but that a label can
+ * belong to at most one list at a time (unless some lists share a common tail, but this is not
+ * used in practice).
+ *
+ * <p>List of labels are used in {@link MethodWriter#computeAllFrames} and {@link
+ * MethodWriter#computeMaxStackAndLocal} to compute stack map frames and the maximum stack size,
+ * respectively, as well as in {@link #markSubroutine} and {@link #addSubroutineRetSuccessors} to
+ * compute the basic blocks belonging to subroutines and their outgoing edges. Outside of these
+ * methods, this field should be null (this property is a precondition and a postcondition of
+ * these methods).
+ */
+ Label nextListElement;
+
+ // -----------------------------------------------------------------------------------------------
+ // Constructor and accessors
+ // -----------------------------------------------------------------------------------------------
+
+ /** Constructs a new label. */
+ public Label() {
+ // Nothing to do.
+ }
+
+ /**
+ * Returns the bytecode offset corresponding to this label. This offset is computed from the start
+ * of the method's bytecode. <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @return the bytecode offset corresponding to this label.
+ * @throws IllegalStateException if this label is not resolved yet.
+ */
+ public int getOffset() {
+ if ((flags & FLAG_RESOLVED) == 0) {
+ throw new IllegalStateException("Label offset position has not been resolved yet");
}
+ return bytecodeOffset;
+ }
- // ------------------------------------------------------------------------
- // Methods to compute offsets and to manage forward references
- // ------------------------------------------------------------------------
+ /**
+ * Returns the "canonical" {@link Label} instance corresponding to this label's bytecode offset,
+ * if known, otherwise the label itself. The canonical instance is the first label (in the order
+ * of their visit by {@link MethodVisitor#visitLabel}) corresponding to this bytecode offset. It
+ * cannot be known for labels which have not been visited yet.
+ *
+ * <p><i>This method should only be used when the {@link MethodWriter#COMPUTE_ALL_FRAMES} option
+ * is used.</i>
+ *
+ * @return the label itself if {@link #frame} is null, otherwise the Label's frame owner. This
+ * corresponds to the "canonical" label instance described above thanks to the way the label
+ * frame is set in {@link MethodWriter#visitLabel}.
+ */
+ final Label getCanonicalInstance() {
+ return frame == null ? this : frame.owner;
+ }
- /**
- * Returns the offset corresponding to this label. This offset is computed
- * from the start of the method's bytecode. <i>This method is intended for
- * {@link Attribute} sub classes, and is normally not needed by class
- * generators or adapters.</i>
- *
- * @return the offset corresponding to this label.
- * @throws IllegalStateException
- * if this label is not resolved yet.
- */
- public int getOffset() {
- if ((status & RESOLVED) == 0) {
- throw new IllegalStateException(
- "Label offset position has not been resolved yet");
+ // -----------------------------------------------------------------------------------------------
+ // Methods to manage line numbers
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Adds a source line number corresponding to this label.
+ *
+ * @param lineNumber a source line number (which should be strictly positive).
+ */
+ final void addLineNumber(final int lineNumber) {
+ if (this.lineNumber == 0) {
+ this.lineNumber = (short) lineNumber;
+ } else {
+ if (otherLineNumbers == null) {
+ otherLineNumbers = new int[LINE_NUMBERS_CAPACITY_INCREMENT];
+ }
+ int otherLineNumberIndex = ++otherLineNumbers[0];
+ if (otherLineNumberIndex >= otherLineNumbers.length) {
+ int[] newLineNumbers = new int[otherLineNumbers.length + LINE_NUMBERS_CAPACITY_INCREMENT];
+ System.arraycopy(otherLineNumbers, 0, newLineNumbers, 0, otherLineNumbers.length);
+ otherLineNumbers = newLineNumbers;
+ }
+ otherLineNumbers[otherLineNumberIndex] = lineNumber;
+ }
+ }
+
+ /**
+ * Makes the given visitor visit this label and its source line numbers, if applicable.
+ *
+ * @param methodVisitor a method visitor.
+ * @param visitLineNumbers whether to visit of the label's source line numbers, if any.
+ */
+ final void accept(final MethodVisitor methodVisitor, final boolean visitLineNumbers) {
+ methodVisitor.visitLabel(this);
+ if (visitLineNumbers && lineNumber != 0) {
+ methodVisitor.visitLineNumber(lineNumber & 0xFFFF, this);
+ if (otherLineNumbers != null) {
+ for (int i = 1; i <= otherLineNumbers[0]; ++i) {
+ methodVisitor.visitLineNumber(otherLineNumbers[i], this);
}
- return position;
+ }
}
+ }
- /**
- * Puts a reference to this label in the bytecode of a method. If the
- * position of the label is known, the offset is computed and written
- * directly. Otherwise, a null offset is written and a new forward reference
- * is declared for this label.
- *
- * @param owner
- * the code writer that calls this method.
- * @param out
- * the bytecode of the method.
- * @param source
- * the position of first byte of the bytecode instruction that
- * contains this label.
- * @param wideOffset
- * <tt>true</tt> if the reference must be stored in 4 bytes, or
- * <tt>false</tt> if it must be stored with 2 bytes.
- * @throws IllegalArgumentException
- * if this label has not been created by the given code writer.
- */
- void put(final MethodWriter owner, final ByteVector out, final int source,
- final boolean wideOffset) {
- if ((status & RESOLVED) == 0) {
- if (wideOffset) {
- addReference(-1 - source, out.length);
- out.putInt(-1);
- } else {
- addReference(source, out.length);
- out.putShort(-1);
- }
- } else {
- if (wideOffset) {
- out.putInt(position - source);
- } else {
- out.putShort(position - source);
- }
+ // -----------------------------------------------------------------------------------------------
+ // Methods to compute offsets and to manage forward references
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Puts a reference to this label in the bytecode of a method. If the bytecode offset of the label
+ * is known, the relative bytecode offset between the label and the instruction referencing it is
+ * computed and written directly. Otherwise, a null relative offset is written and a new forward
+ * reference is declared for this label.
+ *
+ * @param code the bytecode of the method. This is where the reference is appended.
+ * @param sourceInsnBytecodeOffset the bytecode offset of the instruction that contains the
+ * reference to be appended.
+ * @param wideReference whether the reference must be stored in 4 bytes (instead of 2 bytes).
+ */
+ final void put(
+ final ByteVector code, final int sourceInsnBytecodeOffset, final boolean wideReference) {
+ if ((flags & FLAG_RESOLVED) == 0) {
+ if (wideReference) {
+ addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_WIDE, code.length);
+ code.putInt(-1);
+ } else {
+ addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_SHORT, code.length);
+ code.putShort(-1);
+ }
+ } else {
+ if (wideReference) {
+ code.putInt(bytecodeOffset - sourceInsnBytecodeOffset);
+ } else {
+ code.putShort(bytecodeOffset - sourceInsnBytecodeOffset);
+ }
+ }
+ }
+
+ /**
+ * Adds a forward reference to this label. This method must be called only for a true forward
+ * reference, i.e. only if this label is not resolved yet. For backward references, the relative
+ * bytecode offset of the reference can be, and must be, computed and stored directly.
+ *
+ * @param sourceInsnBytecodeOffset the bytecode offset of the instruction that contains the
+ * reference stored at referenceHandle.
+ * @param referenceType either {@link #FORWARD_REFERENCE_TYPE_SHORT} or {@link
+ * #FORWARD_REFERENCE_TYPE_WIDE}.
+ * @param referenceHandle the offset in the bytecode where the forward reference value must be
+ * stored.
+ */
+ private void addForwardReference(
+ final int sourceInsnBytecodeOffset, final int referenceType, final int referenceHandle) {
+ if (forwardReferences == null) {
+ forwardReferences = new int[FORWARD_REFERENCES_CAPACITY_INCREMENT];
+ }
+ int lastElementIndex = forwardReferences[0];
+ if (lastElementIndex + 2 >= forwardReferences.length) {
+ int[] newValues = new int[forwardReferences.length + FORWARD_REFERENCES_CAPACITY_INCREMENT];
+ System.arraycopy(forwardReferences, 0, newValues, 0, forwardReferences.length);
+ forwardReferences = newValues;
+ }
+ forwardReferences[++lastElementIndex] = sourceInsnBytecodeOffset;
+ forwardReferences[++lastElementIndex] = referenceType | referenceHandle;
+ forwardReferences[0] = lastElementIndex;
+ }
+
+ /**
+ * Sets the bytecode offset of this label to the given value and resolves the forward references
+ * to this label, if any. This method must be called when this label is added to the bytecode of
+ * the method, i.e. when its bytecode offset becomes known. This method fills in the blanks that
+ * where left in the bytecode by each forward reference previously added to this label.
+ *
+ * @param code the bytecode of the method.
+ * @param bytecodeOffset the bytecode offset of this label.
+ * @return {@literal true} if a blank that was left for this label was too small to store the
+ * offset. In such a case the corresponding jump instruction is replaced with an equivalent
+ * ASM specific instruction using an unsigned two bytes offset. These ASM specific
+ * instructions are later replaced with standard bytecode instructions with wider offsets (4
+ * bytes instead of 2), in ClassReader.
+ */
+ final boolean resolve(final byte[] code, final int bytecodeOffset) {
+ this.flags |= FLAG_RESOLVED;
+ this.bytecodeOffset = bytecodeOffset;
+ if (forwardReferences == null) {
+ return false;
+ }
+ boolean hasAsmInstructions = false;
+ for (int i = forwardReferences[0]; i > 0; i -= 2) {
+ final int sourceInsnBytecodeOffset = forwardReferences[i - 1];
+ final int reference = forwardReferences[i];
+ final int relativeOffset = bytecodeOffset - sourceInsnBytecodeOffset;
+ int handle = reference & FORWARD_REFERENCE_HANDLE_MASK;
+ if ((reference & FORWARD_REFERENCE_TYPE_MASK) == FORWARD_REFERENCE_TYPE_SHORT) {
+ if (relativeOffset < Short.MIN_VALUE || relativeOffset > Short.MAX_VALUE) {
+ // Change the opcode of the jump instruction, in order to be able to find it later in
+ // ClassReader. These ASM specific opcodes are similar to jump instruction opcodes, except
+ // that the 2 bytes offset is unsigned (and can therefore represent values from 0 to
+ // 65535, which is sufficient since the size of a method is limited to 65535 bytes).
+ int opcode = code[sourceInsnBytecodeOffset] & 0xFF;
+ if (opcode < Opcodes.IFNULL) {
+ // Change IFEQ ... JSR to ASM_IFEQ ... ASM_JSR.
+ code[sourceInsnBytecodeOffset] = (byte) (opcode + Constants.ASM_OPCODE_DELTA);
+ } else {
+ // Change IFNULL and IFNONNULL to ASM_IFNULL and ASM_IFNONNULL.
+ code[sourceInsnBytecodeOffset] = (byte) (opcode + Constants.ASM_IFNULL_OPCODE_DELTA);
+ }
+ hasAsmInstructions = true;
}
+ code[handle++] = (byte) (relativeOffset >>> 8);
+ code[handle] = (byte) relativeOffset;
+ } else {
+ code[handle++] = (byte) (relativeOffset >>> 24);
+ code[handle++] = (byte) (relativeOffset >>> 16);
+ code[handle++] = (byte) (relativeOffset >>> 8);
+ code[handle] = (byte) relativeOffset;
+ }
}
+ return hasAsmInstructions;
+ }
- /**
- * Adds a forward reference to this label. This method must be called only
- * for a true forward reference, i.e. only if this label is not resolved
- * yet. For backward references, the offset of the reference can be, and
- * must be, computed and stored directly.
- *
- * @param sourcePosition
- * the position of the referencing instruction. This position
- * will be used to compute the offset of this forward reference.
- * @param referencePosition
- * the position where the offset for this forward reference must
- * be stored.
- */
- private void addReference(final int sourcePosition,
- final int referencePosition) {
- if (srcAndRefPositions == null) {
- srcAndRefPositions = new int[6];
- }
- if (referenceCount >= srcAndRefPositions.length) {
- int[] a = new int[srcAndRefPositions.length + 6];
- System.arraycopy(srcAndRefPositions, 0, a, 0,
- srcAndRefPositions.length);
- srcAndRefPositions = a;
- }
- srcAndRefPositions[referenceCount++] = sourcePosition;
- srcAndRefPositions[referenceCount++] = referencePosition;
+ // -----------------------------------------------------------------------------------------------
+ // Methods related to subroutines
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Finds the basic blocks that belong to the subroutine starting with the basic block
+ * corresponding to this label, and marks these blocks as belonging to this subroutine. This
+ * method follows the control flow graph to find all the blocks that are reachable from the
+ * current basic block WITHOUT following any jsr target.
+ *
+ * <p>Note: a precondition and postcondition of this method is that all labels must have a null
+ * {@link #nextListElement}.
+ *
+ * @param subroutineId the id of the subroutine starting with the basic block corresponding to
+ * this label.
+ */
+ final void markSubroutine(final short subroutineId) {
+ // Data flow algorithm: put this basic block in a list of blocks to process (which are blocks
+ // belonging to subroutine subroutineId) and, while there are blocks to process, remove one from
+ // the list, mark it as belonging to the subroutine, and add its successor basic blocks in the
+ // control flow graph to the list of blocks to process (if not already done).
+ Label listOfBlocksToProcess = this;
+ listOfBlocksToProcess.nextListElement = EMPTY_LIST;
+ while (listOfBlocksToProcess != EMPTY_LIST) {
+ // Remove a basic block from the list of blocks to process.
+ Label basicBlock = listOfBlocksToProcess;
+ listOfBlocksToProcess = listOfBlocksToProcess.nextListElement;
+ basicBlock.nextListElement = null;
+
+ // If it is not already marked as belonging to a subroutine, mark it as belonging to
+ // subroutineId and add its successors to the list of blocks to process (unless already done).
+ if (basicBlock.subroutineId == 0) {
+ basicBlock.subroutineId = subroutineId;
+ listOfBlocksToProcess = basicBlock.pushSuccessors(listOfBlocksToProcess);
+ }
}
+ }
- /**
- * Resolves all forward references to this label. This method must be called
- * when this label is added to the bytecode of the method, i.e. when its
- * position becomes known. This method fills in the blanks that where left
- * in the bytecode by each forward reference previously added to this label.
- *
- * @param owner
- * the code writer that calls this method.
- * @param position
- * the position of this label in the bytecode.
- * @param data
- * the bytecode of the method.
- * @return <tt>true</tt> if a blank that was left for this label was to
- * small to store the offset. In such a case the corresponding jump
- * instruction is replaced with a pseudo instruction (using unused
- * opcodes) using an unsigned two bytes offset. These pseudo
- * instructions will need to be replaced with true instructions with
- * wider offsets (4 bytes instead of 2). This is done in
- * {@link MethodWriter#resizeInstructions}.
- * @throws IllegalArgumentException
- * if this label has already been resolved, or if it has not
- * been created by the given code writer.
- */
- boolean resolve(final MethodWriter owner, final int position,
- final byte[] data) {
- boolean needUpdate = false;
- this.status |= RESOLVED;
- this.position = position;
- int i = 0;
- while (i < referenceCount) {
- int source = srcAndRefPositions[i++];
- int reference = srcAndRefPositions[i++];
- int offset;
- if (source >= 0) {
- offset = position - source;
- if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) {
- /*
- * changes the opcode of the jump instruction, in order to
- * be able to find it later (see resizeInstructions in
- * MethodWriter). These temporary opcodes are similar to
- * jump instruction opcodes, except that the 2 bytes offset
- * is unsigned (and can therefore represent values from 0 to
- * 65535, which is sufficient since the size of a method is
- * limited to 65535 bytes).
- */
- int opcode = data[reference - 1] & 0xFF;
- if (opcode <= Opcodes.JSR) {
- // changes IFEQ ... JSR to opcodes 202 to 217
- data[reference - 1] = (byte) (opcode + 49);
- } else {
- // changes IFNULL and IFNONNULL to opcodes 218 and 219
- data[reference - 1] = (byte) (opcode + 20);
- }
- needUpdate = true;
- }
- data[reference++] = (byte) (offset >>> 8);
- data[reference] = (byte) offset;
- } else {
- offset = position + source + 1;
- data[reference++] = (byte) (offset >>> 24);
- data[reference++] = (byte) (offset >>> 16);
- data[reference++] = (byte) (offset >>> 8);
- data[reference] = (byte) offset;
- }
- }
- return needUpdate;
+ /**
+ * Finds the basic blocks that end a subroutine starting with the basic block corresponding to
+ * this label and, for each one of them, adds an outgoing edge to the basic block following the
+ * given subroutine call. In other words, completes the control flow graph by adding the edges
+ * corresponding to the return from this subroutine, when called from the given caller basic
+ * block.
+ *
+ * <p>Note: a precondition and postcondition of this method is that all labels must have a null
+ * {@link #nextListElement}.
+ *
+ * @param subroutineCaller a basic block that ends with a jsr to the basic block corresponding to
+ * this label. This label is supposed to correspond to the start of a subroutine.
+ */
+ final void addSubroutineRetSuccessors(final Label subroutineCaller) {
+ // Data flow algorithm: put this basic block in a list blocks to process (which are blocks
+ // belonging to a subroutine starting with this label) and, while there are blocks to process,
+ // remove one from the list, put it in a list of blocks that have been processed, add a return
+ // edge to the successor of subroutineCaller if applicable, and add its successor basic blocks
+ // in the control flow graph to the list of blocks to process (if not already done).
+ Label listOfProcessedBlocks = EMPTY_LIST;
+ Label listOfBlocksToProcess = this;
+ listOfBlocksToProcess.nextListElement = EMPTY_LIST;
+ while (listOfBlocksToProcess != EMPTY_LIST) {
+ // Move a basic block from the list of blocks to process to the list of processed blocks.
+ Label basicBlock = listOfBlocksToProcess;
+ listOfBlocksToProcess = basicBlock.nextListElement;
+ basicBlock.nextListElement = listOfProcessedBlocks;
+ listOfProcessedBlocks = basicBlock;
+
+ // Add an edge from this block to the successor of the caller basic block, if this block is
+ // the end of a subroutine and if this block and subroutineCaller do not belong to the same
+ // subroutine.
+ if ((basicBlock.flags & FLAG_SUBROUTINE_END) != 0
+ && basicBlock.subroutineId != subroutineCaller.subroutineId) {
+ basicBlock.outgoingEdges =
+ new Edge(
+ basicBlock.outputStackSize,
+ // By construction, the first outgoing edge of a basic block that ends with a jsr
+ // instruction leads to the jsr continuation block, i.e. where execution continues
+ // when ret is called (see {@link #FLAG_SUBROUTINE_CALLER}).
+ subroutineCaller.outgoingEdges.successor,
+ basicBlock.outgoingEdges);
+ }
+ // Add its successors to the list of blocks to process. Note that {@link #pushSuccessors} does
+ // not push basic blocks which are already in a list. Here this means either in the list of
+ // blocks to process, or in the list of already processed blocks. This second list is
+ // important to make sure we don't reprocess an already processed block.
+ listOfBlocksToProcess = basicBlock.pushSuccessors(listOfBlocksToProcess);
}
-
- /**
- * Returns the first label of the series to which this label belongs. For an
- * isolated label or for the first label in a series of successive labels,
- * this method returns the label itself. For other labels it returns the
- * first label of the series.
- *
- * @return the first label of the series to which this label belongs.
- */
- Label getFirst() {
- return !ClassReader.FRAMES || frame == null ? this : frame.owner;
+ // Reset the {@link #nextListElement} of all the basic blocks that have been processed to null,
+ // so that this method can be called again with a different subroutine or subroutine caller.
+ while (listOfProcessedBlocks != EMPTY_LIST) {
+ Label newListOfProcessedBlocks = listOfProcessedBlocks.nextListElement;
+ listOfProcessedBlocks.nextListElement = null;
+ listOfProcessedBlocks = newListOfProcessedBlocks;
}
+ }
- // ------------------------------------------------------------------------
- // Methods related to subroutines
- // ------------------------------------------------------------------------
-
- /**
- * Returns true is this basic block belongs to the given subroutine.
- *
- * @param id
- * a subroutine id.
- * @return true is this basic block belongs to the given subroutine.
- */
- boolean inSubroutine(final long id) {
- if ((status & Label.VISITED) != 0) {
- return (srcAndRefPositions[(int) (id >>> 32)] & (int) id) != 0;
- }
- return false;
+ /**
+ * Adds the successors of this label in the method's control flow graph (except those
+ * corresponding to a jsr target, and those already in a list of labels) to the given list of
+ * blocks to process, and returns the new list.
+ *
+ * @param listOfLabelsToProcess a list of basic blocks to process, linked together with their
+ * {@link #nextListElement} field.
+ * @return the new list of blocks to process.
+ */
+ private Label pushSuccessors(final Label listOfLabelsToProcess) {
+ Label newListOfLabelsToProcess = listOfLabelsToProcess;
+ Edge outgoingEdge = outgoingEdges;
+ while (outgoingEdge != null) {
+ // By construction, the second outgoing edge of a basic block that ends with a jsr instruction
+ // leads to the jsr target (see {@link #FLAG_SUBROUTINE_CALLER}).
+ boolean isJsrTarget =
+ (flags & Label.FLAG_SUBROUTINE_CALLER) != 0 && outgoingEdge == outgoingEdges.nextEdge;
+ if (!isJsrTarget && outgoingEdge.successor.nextListElement == null) {
+ // Add this successor to the list of blocks to process, if it does not already belong to a
+ // list of labels.
+ outgoingEdge.successor.nextListElement = newListOfLabelsToProcess;
+ newListOfLabelsToProcess = outgoingEdge.successor;
+ }
+ outgoingEdge = outgoingEdge.nextEdge;
}
+ return newListOfLabelsToProcess;
+ }
- /**
- * Returns true if this basic block and the given one belong to a common
- * subroutine.
- *
- * @param block
- * another basic block.
- * @return true if this basic block and the given one belong to a common
- * subroutine.
- */
- boolean inSameSubroutine(final Label block) {
- if ((status & VISITED) == 0 || (block.status & VISITED) == 0) {
- return false;
- }
- for (int i = 0; i < srcAndRefPositions.length; ++i) {
- if ((srcAndRefPositions[i] & block.srcAndRefPositions[i]) != 0) {
- return true;
- }
- }
- return false;
- }
+ // -----------------------------------------------------------------------------------------------
+ // Overridden Object methods
+ // -----------------------------------------------------------------------------------------------
- /**
- * Marks this basic block as belonging to the given subroutine.
- *
- * @param id
- * a subroutine id.
- * @param nbSubroutines
- * the total number of subroutines in the method.
- */
- void addToSubroutine(final long id, final int nbSubroutines) {
- if ((status & VISITED) == 0) {
- status |= VISITED;
- srcAndRefPositions = new int[nbSubroutines / 32 + 1];
- }
- srcAndRefPositions[(int) (id >>> 32)] |= (int) id;
- }
-
- /**
- * Finds the basic blocks that belong to a given subroutine, and marks these
- * blocks as belonging to this subroutine. This method follows the control
- * flow graph to find all the blocks that are reachable from the current
- * block WITHOUT following any JSR target.
- *
- * @param JSR
- * a JSR block that jumps to this subroutine. If this JSR is not
- * null it is added to the successor of the RET blocks found in
- * the subroutine.
- * @param id
- * the id of this subroutine.
- * @param nbSubroutines
- * the total number of subroutines in the method.
- */
- void visitSubroutine(final Label JSR, final long id, final int nbSubroutines) {
- // user managed stack of labels, to avoid using a recursive method
- // (recursivity can lead to stack overflow with very large methods)
- Label stack = this;
- while (stack != null) {
- // removes a label l from the stack
- Label l = stack;
- stack = l.next;
- l.next = null;
-
- if (JSR != null) {
- if ((l.status & VISITED2) != 0) {
- continue;
- }
- l.status |= VISITED2;
- // adds JSR to the successors of l, if it is a RET block
- if ((l.status & RET) != 0) {
- if (!l.inSameSubroutine(JSR)) {
- Edge e = new Edge();
- e.info = l.inputStackTop;
- e.successor = JSR.successors.successor;
- e.next = l.successors;
- l.successors = e;
- }
- }
- } else {
- // if the l block already belongs to subroutine 'id', continue
- if (l.inSubroutine(id)) {
- continue;
- }
- // marks the l block as belonging to subroutine 'id'
- l.addToSubroutine(id, nbSubroutines);
- }
- // pushes each successor of l on the stack, except JSR targets
- Edge e = l.successors;
- while (e != null) {
- // if the l block is a JSR block, then 'l.successors.next' leads
- // to the JSR target (see {@link #visitJumpInsn}) and must
- // therefore not be followed
- if ((l.status & Label.JSR) == 0 || e != l.successors.next) {
- // pushes e.successor on the stack if it not already added
- if (e.successor.next == null) {
- e.successor.next = stack;
- stack = e.successor;
- }
- }
- e = e.next;
- }
- }
- }
-
- // ------------------------------------------------------------------------
- // Overriden Object methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns a string representation of this label.
- *
- * @return a string representation of this label.
- */
- @Override
- public String toString() {
- return "L" + System.identityHashCode(this);
- }
+ /**
+ * Returns a string representation of this label.
+ *
+ * @return a string representation of this label.
+ */
+ @Override
+ public String toString() {
+ return "L" + System.identityHashCode(this);
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodTooLargeException.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodTooLargeException.java
new file mode 100644
index 0000000..5ce29f4
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodTooLargeException.java
@@ -0,0 +1,99 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * Exception thrown when the Code attribute of a method produced by a {@link ClassWriter} is too
+ * large.
+ *
+ * @author Jason Zaugg
+ */
+public final class MethodTooLargeException extends IndexOutOfBoundsException {
+ private static final long serialVersionUID = 6807380416709738314L;
+
+ private final String className;
+ private final String methodName;
+ private final String descriptor;
+ private final int codeSize;
+
+ /**
+ * Constructs a new {@link MethodTooLargeException}.
+ *
+ * @param className the internal name of the owner class.
+ * @param methodName the name of the method.
+ * @param descriptor the descriptor of the method.
+ * @param codeSize the size of the method's Code attribute, in bytes.
+ */
+ public MethodTooLargeException(
+ final String className,
+ final String methodName,
+ final String descriptor,
+ final int codeSize) {
+ super("Method too large: " + className + "." + methodName + " " + descriptor);
+ this.className = className;
+ this.methodName = methodName;
+ this.descriptor = descriptor;
+ this.codeSize = codeSize;
+ }
+
+ /**
+ * Returns the internal name of the owner class.
+ *
+ * @return the internal name of the owner class.
+ */
+ public String getClassName() {
+ return className;
+ }
+
+ /**
+ * Returns the name of the method.
+ *
+ * @return the name of the method.
+ */
+ public String getMethodName() {
+ return methodName;
+ }
+
+ /**
+ * Returns the descriptor of the method.
+ *
+ * @return the descriptor of the method.
+ */
+ public String getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Returns the size of the method's Code attribute, in bytes.
+ *
+ * @return the size of the method's Code attribute, in bytes.
+ */
+ public int getCodeSize() {
+ return codeSize;
+ }
+}
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 bd81a11..b202cf7 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
@@ -1,881 +1,775 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A visitor to visit a Java method. The methods of this class must be called in
- * the following order: ( <tt>visitParameter</tt> )* [
- * <tt>visitAnnotationDefault</tt> ] ( <tt>visitAnnotation</tt> |
- * <tt>visitParameterAnnotation</tt> <tt>visitTypeAnnotation</tt> |
- * <tt>visitAttribute</tt> )* [ <tt>visitCode</tt> ( <tt>visitFrame</tt> |
- * <tt>visit<i>X</i>Insn</tt> | <tt>visitLabel</tt> |
- * <tt>visitInsnAnnotation</tt> | <tt>visitTryCatchBlock</tt> |
- * <tt>visitTryCatchAnnotation</tt> | <tt>visitLocalVariable</tt> |
- * <tt>visitLocalVariableAnnotation</tt> | <tt>visitLineNumber</tt> )*
- * <tt>visitMaxs</tt> ] <tt>visitEnd</tt>. In addition, the
- * <tt>visit<i>X</i>Insn</tt> and <tt>visitLabel</tt> methods must be called in
- * the sequential order of the bytecode instructions of the visited code,
- * <tt>visitInsnAnnotation</tt> must be called <i>after</i> the annotated
- * instruction, <tt>visitTryCatchBlock</tt> must be called <i>before</i> the
- * labels passed as arguments have been visited,
- * <tt>visitTryCatchBlockAnnotation</tt> must be called <i>after</i> the
- * corresponding try catch block has been visited, and the
- * <tt>visitLocalVariable</tt>, <tt>visitLocalVariableAnnotation</tt> and
- * <tt>visitLineNumber</tt> methods must be called <i>after</i> the labels
- * passed as arguments have been visited.
+ * A visitor to visit a Java method. The methods of this class must be called in the following
+ * order: ( {@code visitParameter} )* [ {@code visitAnnotationDefault} ] ( {@code visitAnnotation} |
+ * {@code visitAnnotableParameterCount} | {@code visitParameterAnnotation} {@code
+ * visitTypeAnnotation} | {@code visitAttribute} )* [ {@code visitCode} ( {@code visitFrame} |
+ * {@code visit<i>X</i>Insn} | {@code visitLabel} | {@code visitInsnAnnotation} | {@code
+ * visitTryCatchBlock} | {@code visitTryCatchAnnotation} | {@code visitLocalVariable} | {@code
+ * visitLocalVariableAnnotation} | {@code visitLineNumber} )* {@code visitMaxs} ] {@code visitEnd}.
+ * In addition, the {@code visit<i>X</i>Insn} and {@code visitLabel} methods must be called in the
+ * sequential order of the bytecode instructions of the visited code, {@code visitInsnAnnotation}
+ * must be called <i>after</i> the annotated instruction, {@code visitTryCatchBlock} must be called
+ * <i>before</i> the labels passed as arguments have been visited, {@code
+ * visitTryCatchBlockAnnotation} must be called <i>after</i> the corresponding try catch block has
+ * been visited, and the {@code visitLocalVariable}, {@code visitLocalVariableAnnotation} and {@code
+ * visitLineNumber} methods must be called <i>after</i> the labels passed as arguments have been
+ * visited.
*
* @author Eric Bruneton
*/
public abstract class MethodVisitor {
- /**
- * The ASM API version implemented by this visitor. The value of this field
- * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- */
- protected final int api;
+ private static final String REQUIRES_ASM5 = "This feature requires ASM5";
- /**
- * The method visitor to which this visitor must delegate method calls. May
- * be null.
- */
- protected MethodVisitor mv;
+ /**
+ * 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}.
+ */
+ protected final int api;
- /**
- * Constructs a new {@link MethodVisitor}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- */
- public MethodVisitor(final int api) {
- this(api, null);
+ /** The method visitor to which this visitor must delegate method calls. May be null. */
+ protected MethodVisitor mv;
+
+ /**
+ * 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}.
+ */
+ public 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 methodVisitor the method visitor to which this visitor must delegate method calls. May
+ * be null.
+ */
+ public MethodVisitor(final int api, final MethodVisitor methodVisitor) {
+ if (api != Opcodes.ASM7 && api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4) {
+ throw new IllegalArgumentException("Unsupported api " + api);
}
+ this.api = api;
+ this.mv = methodVisitor;
+ }
- /**
- * Constructs a new {@link MethodVisitor}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
- * @param mv
- * the method visitor to which this visitor must delegate method
- * calls. May be null.
- */
- public MethodVisitor(final int api, final MethodVisitor mv) {
- if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
- throw new IllegalArgumentException();
- }
- this.api = api;
- this.mv = mv;
+ // -----------------------------------------------------------------------------------------------
+ // Parameters, annotations and non standard attributes
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Visits a parameter of this method.
+ *
+ * @param name parameter name or null if none is provided.
+ * @param access the parameter's access flags, only {@code ACC_FINAL}, {@code ACC_SYNTHETIC}
+ * or/and {@code ACC_MANDATED} are allowed (see {@link Opcodes}).
+ */
+ public void visitParameter(final String name, final int access) {
+ if (api < Opcodes.ASM5) {
+ throw new UnsupportedOperationException(REQUIRES_ASM5);
}
-
- // -------------------------------------------------------------------------
- // Parameters, annotations and non standard attributes
- // -------------------------------------------------------------------------
-
- /**
- * Visits a parameter of this method.
- *
- * @param name
- * parameter name or null if none is provided.
- * @param access
- * the parameter's access flags, only <tt>ACC_FINAL</tt>,
- * <tt>ACC_SYNTHETIC</tt> or/and <tt>ACC_MANDATED</tt> are
- * allowed (see {@link Opcodes}).
- */
- public void visitParameter(String name, int access) {
- if (api < Opcodes.ASM5) {
- throw new RuntimeException();
- }
- if (mv != null) {
- mv.visitParameter(name, access);
- }
+ if (mv != null) {
+ mv.visitParameter(name, access);
}
+ }
- /**
- * Visits the default value of this annotation interface method.
- *
- * @return a visitor to the visit the actual default value of this
- * annotation interface method, or <tt>null</tt> if this visitor is
- * not interested in visiting this default value. The 'name'
- * parameters passed to the methods of this annotation visitor are
- * ignored. Moreover, exacly one visit method must be called on this
- * annotation visitor, followed by visitEnd.
- */
- public AnnotationVisitor visitAnnotationDefault() {
- if (mv != null) {
- return mv.visitAnnotationDefault();
- }
- return null;
+ /**
+ * Visits the default value of this annotation interface method.
+ *
+ * @return a visitor to the visit the actual default value of this annotation interface method, or
+ * {@literal null} if this visitor is not interested in visiting this default value. The
+ * 'name' parameters passed to the methods of this annotation visitor are ignored. Moreover,
+ * exacly one visit method must be called on this annotation visitor, followed by visitEnd.
+ */
+ public AnnotationVisitor visitAnnotationDefault() {
+ if (mv != null) {
+ return mv.visitAnnotationDefault();
}
+ return null;
+ }
- /**
- * Visits an annotation of this method.
- *
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
- if (mv != null) {
- return mv.visitAnnotation(desc, visible);
- }
- return null;
+ /**
+ * Visits an annotation of this method.
+ *
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) {
+ if (mv != null) {
+ return mv.visitAnnotation(descriptor, visible);
}
+ return null;
+ }
- /**
- * Visits an annotation on a type in the method signature.
- *
- * @param typeRef
- * a reference to the annotated type. The sort of this type
- * reference must be {@link TypeReference#METHOD_TYPE_PARAMETER
- * METHOD_TYPE_PARAMETER},
- * {@link TypeReference#METHOD_TYPE_PARAMETER_BOUND
- * METHOD_TYPE_PARAMETER_BOUND},
- * {@link TypeReference#METHOD_RETURN METHOD_RETURN},
- * {@link TypeReference#METHOD_RECEIVER METHOD_RECEIVER},
- * {@link TypeReference#METHOD_FORMAL_PARAMETER
- * METHOD_FORMAL_PARAMETER} or {@link TypeReference#THROWS
- * THROWS}. See {@link TypeReference}.
- * @param typePath
- * the path to the annotated type argument, wildcard bound, array
- * element type, or static inner type within 'typeRef'. May be
- * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- if (api < Opcodes.ASM5) {
- throw new RuntimeException();
- }
- if (mv != null) {
- return mv.visitTypeAnnotation(typeRef, typePath, desc, visible);
- }
- return null;
+ /**
+ * Visits an annotation on a type in the method signature.
+ *
+ * @param typeRef a reference to the annotated type. The sort of this type reference must be
+ * {@link TypeReference#METHOD_TYPE_PARAMETER}, {@link
+ * TypeReference#METHOD_TYPE_PARAMETER_BOUND}, {@link TypeReference#METHOD_RETURN}, {@link
+ * TypeReference#METHOD_RECEIVER}, {@link TypeReference#METHOD_FORMAL_PARAMETER} or {@link
+ * TypeReference#THROWS}. See {@link TypeReference}.
+ * @param typePath the path to the annotated type argument, wildcard bound, array element type, or
+ * static inner type within 'typeRef'. May be {@literal null} if the annotation targets
+ * 'typeRef' as a whole.
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitTypeAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new UnsupportedOperationException(REQUIRES_ASM5);
}
-
- /**
- * Visits an annotation of a parameter this method.
- *
- * @param parameter
- * the parameter index.
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitParameterAnnotation(int parameter,
- String desc, boolean visible) {
- if (mv != null) {
- return mv.visitParameterAnnotation(parameter, desc, visible);
- }
- return null;
+ if (mv != null) {
+ return mv.visitTypeAnnotation(typeRef, typePath, descriptor, visible);
}
+ return null;
+ }
- /**
- * Visits a non standard attribute of this method.
- *
- * @param attr
- * an attribute.
- */
- public void visitAttribute(Attribute attr) {
- if (mv != null) {
- mv.visitAttribute(attr);
- }
+ /**
+ * Visits the number of method parameters that can have annotations. By default (i.e. when this
+ * method is not called), all the method parameters defined by the method descriptor can have
+ * annotations.
+ *
+ * @param parameterCount the number of method parameters than can have annotations. This number
+ * must be less or equal than the number of parameter types in the method descriptor. It can
+ * be strictly less when a method has synthetic parameters and when these parameters are
+ * ignored when computing parameter indices for the purpose of parameter annotations (see
+ * https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).
+ * @param visible {@literal true} to define the number of method parameters that can have
+ * annotations visible at runtime, {@literal false} to define the number of method parameters
+ * that can have annotations invisible at runtime.
+ */
+ public void visitAnnotableParameterCount(final int parameterCount, final boolean visible) {
+ if (mv != null) {
+ mv.visitAnnotableParameterCount(parameterCount, visible);
}
+ }
- /**
- * Starts the visit of the method's code, if any (i.e. non abstract method).
- */
- public void visitCode() {
- if (mv != null) {
- mv.visitCode();
- }
+ /**
+ * Visits an annotation of a parameter this method.
+ *
+ * @param parameter the parameter index. This index must be strictly smaller than the number of
+ * parameters in the method descriptor, and strictly smaller than the parameter count
+ * specified in {@link #visitAnnotableParameterCount}. Important note: <i>a parameter index i
+ * is not required to correspond to the i'th parameter descriptor in the method
+ * descriptor</i>, in particular in case of synthetic parameters (see
+ * https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter, final String descriptor, final boolean visible) {
+ if (mv != null) {
+ return mv.visitParameterAnnotation(parameter, descriptor, visible);
}
+ return null;
+ }
- /**
- * Visits the current state of the local variables and operand stack
- * elements. This method must(*) be called <i>just before</i> any
- * instruction <b>i</b> that follows an unconditional branch instruction
- * such as GOTO or THROW, that is the target of a jump instruction, or that
- * starts an exception handler block. The visited types must describe the
- * values of the local variables and of the operand stack elements <i>just
- * before</i> <b>i</b> is executed.<br>
- * <br>
- * (*) this is mandatory only for classes whose version is greater than or
- * equal to {@link Opcodes#V1_6 V1_6}. <br>
- * <br>
- * The frames of a method must be given either in expanded form, or in
- * compressed form (all frames must use the same format, i.e. you must not
- * mix expanded and compressed frames within a single method):
- * <ul>
- * <li>In expanded form, all frames must have the F_NEW type.</li>
- * <li>In compressed form, frames are basically "deltas" from the state of
- * the previous frame:
- * <ul>
- * <li>{@link Opcodes#F_SAME} representing frame with exactly the same
- * locals as the previous frame and with the empty stack.</li>
- * <li>{@link Opcodes#F_SAME1} representing frame with exactly the same
- * locals as the previous frame and with single value on the stack (
- * <code>nStack</code> is 1 and <code>stack[0]</code> contains value for the
- * type of the stack item).</li>
- * <li>{@link Opcodes#F_APPEND} representing frame with current locals are
- * the same as the locals in the previous frame, except that additional
- * locals are defined (<code>nLocal</code> is 1, 2 or 3 and
- * <code>local</code> elements contains values representing added types).</li>
- * <li>{@link Opcodes#F_CHOP} representing frame with current locals are the
- * same as the locals in the previous frame, except that the last 1-3 locals
- * are absent and with the empty stack (<code>nLocals</code> is 1, 2 or 3).</li>
- * <li>{@link Opcodes#F_FULL} representing complete frame data.</li>
- * </ul>
- * </li>
- * </ul>
- * <br>
- * In both cases the first frame, corresponding to the method's parameters
- * and access flags, is implicit and must not be visited. Also, it is
- * illegal to visit two or more frames for the same code location (i.e., at
- * least one instruction must be visited between two calls to visitFrame).
- *
- * @param type
- * the type of this stack map frame. Must be
- * {@link Opcodes#F_NEW} for expanded frames, or
- * {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND},
- * {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or
- * {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for
- * compressed frames.
- * @param nLocal
- * the number of local variables in the visited frame.
- * @param local
- * the local variable types in this frame. This array must not be
- * modified. Primitive types are represented by
- * {@link Opcodes#TOP}, {@link Opcodes#INTEGER},
- * {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
- * {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
- * {@link Opcodes#UNINITIALIZED_THIS} (long and double are
- * represented by a single element). Reference types are
- * represented by String objects (representing internal names),
- * and uninitialized types by Label objects (this label
- * designates the NEW instruction that created this uninitialized
- * value).
- * @param nStack
- * the number of operand stack elements in the visited frame.
- * @param stack
- * the operand stack types in this frame. This array must not be
- * modified. Its content has the same format as the "local"
- * array.
- * @throws IllegalStateException
- * if a frame is visited just after another one, without any
- * instruction between the two (unless this frame is a
- * Opcodes#F_SAME frame, in which case it is silently ignored).
- */
- public void visitFrame(int type, int nLocal, Object[] local, int nStack,
- Object[] stack) {
- if (mv != null) {
- mv.visitFrame(type, nLocal, local, nStack, stack);
- }
+ /**
+ * Visits a non standard attribute of this method.
+ *
+ * @param attribute an attribute.
+ */
+ public void visitAttribute(final Attribute attribute) {
+ if (mv != null) {
+ mv.visitAttribute(attribute);
}
+ }
- // -------------------------------------------------------------------------
- // Normal instructions
- // -------------------------------------------------------------------------
-
- /**
- * Visits a zero operand instruction.
- *
- * @param opcode
- * the opcode of the instruction to be visited. This opcode is
- * either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1,
- * ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1,
- * FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD,
- * LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD,
- * IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE,
- * SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1,
- * DUP2_X2, SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB,
- * IMUL, LMUL, FMUL, DMUL, IDIV, LDIV, FDIV, DDIV, IREM, LREM,
- * FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR,
- * IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, I2L, I2F, I2D,
- * L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B, I2C, I2S,
- * LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN, FRETURN,
- * DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW, MONITORENTER,
- * or MONITOREXIT.
- */
- public void visitInsn(int opcode) {
- if (mv != null) {
- mv.visitInsn(opcode);
- }
+ /** Starts the visit of the method's code, if any (i.e. non abstract method). */
+ public void visitCode() {
+ if (mv != null) {
+ mv.visitCode();
}
+ }
- /**
- * Visits an instruction with a single int operand.
- *
- * @param opcode
- * the opcode of the instruction to be visited. This opcode is
- * either BIPUSH, SIPUSH or NEWARRAY.
- * @param operand
- * the operand of the instruction to be visited.<br>
- * When opcode is BIPUSH, operand value should be between
- * Byte.MIN_VALUE and Byte.MAX_VALUE.<br>
- * When opcode is SIPUSH, operand value should be between
- * Short.MIN_VALUE and Short.MAX_VALUE.<br>
- * When opcode is NEWARRAY, operand value should be one of
- * {@link Opcodes#T_BOOLEAN}, {@link Opcodes#T_CHAR},
- * {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE},
- * {@link Opcodes#T_BYTE}, {@link Opcodes#T_SHORT},
- * {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}.
- */
- public void visitIntInsn(int opcode, int operand) {
- if (mv != null) {
- mv.visitIntInsn(opcode, operand);
- }
+ /**
+ * Visits the current state of the local variables and operand stack elements. This method must(*)
+ * be called <i>just before</i> any instruction <b>i</b> that follows an unconditional branch
+ * instruction such as GOTO or THROW, that is the target of a jump instruction, or that starts an
+ * exception handler block. The visited types must describe the values of the local variables and
+ * of the operand stack elements <i>just before</i> <b>i</b> is executed.<br>
+ * <br>
+ * (*) this is mandatory only for classes whose version is greater than or equal to {@link
+ * Opcodes#V1_6}. <br>
+ * <br>
+ * The frames of a method must be given either in expanded form, or in compressed form (all frames
+ * must use the same format, i.e. you must not mix expanded and compressed frames within a single
+ * method):
+ *
+ * <ul>
+ * <li>In expanded form, all frames must have the F_NEW type.
+ * <li>In compressed form, frames are basically "deltas" from the state of the previous frame:
+ * <ul>
+ * <li>{@link Opcodes#F_SAME} representing frame with exactly the same locals as the
+ * previous frame and with the empty stack.
+ * <li>{@link Opcodes#F_SAME1} representing frame with exactly the same locals as the
+ * previous frame and with single value on the stack ( <code>numStack</code> is 1 and
+ * <code>stack[0]</code> contains value for the type of the stack item).
+ * <li>{@link Opcodes#F_APPEND} representing frame with current locals are the same as the
+ * locals in the previous frame, except that additional locals are defined (<code>
+ * numLocal</code> is 1, 2 or 3 and <code>local</code> elements contains values
+ * representing added types).
+ * <li>{@link Opcodes#F_CHOP} representing frame with current locals are the same as the
+ * locals in the previous frame, except that the last 1-3 locals are absent and with
+ * the empty stack (<code>numLocal</code> is 1, 2 or 3).
+ * <li>{@link Opcodes#F_FULL} representing complete frame data.
+ * </ul>
+ * </ul>
+ *
+ * <br>
+ * In both cases the first frame, corresponding to the method's parameters and access flags, is
+ * implicit and must not be visited. Also, it is illegal to visit two or more frames for the same
+ * code location (i.e., at least one instruction must be visited between two calls to visitFrame).
+ *
+ * @param type the type of this stack map frame. Must be {@link Opcodes#F_NEW} for expanded
+ * frames, or {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND}, {@link Opcodes#F_CHOP}, {@link
+ * Opcodes#F_SAME} or {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for compressed frames.
+ * @param numLocal the number of local variables in the visited frame.
+ * @param local the local variable types in this frame. This array must not be modified. Primitive
+ * types are represented by {@link Opcodes#TOP}, {@link Opcodes#INTEGER}, {@link
+ * Opcodes#FLOAT}, {@link Opcodes#LONG}, {@link Opcodes#DOUBLE}, {@link Opcodes#NULL} or
+ * {@link Opcodes#UNINITIALIZED_THIS} (long and double are represented by a single element).
+ * Reference types are represented by String objects (representing internal names), and
+ * uninitialized types by Label objects (this label designates the NEW instruction that
+ * created this uninitialized value).
+ * @param numStack the number of operand stack elements in the visited frame.
+ * @param stack the operand stack types in this frame. This array must not be modified. Its
+ * content has the same format as the "local" array.
+ * @throws IllegalStateException if a frame is visited just after another one, without any
+ * instruction between the two (unless this frame is a Opcodes#F_SAME frame, in which case it
+ * is silently ignored).
+ */
+ public void visitFrame(
+ final int type,
+ final int numLocal,
+ final Object[] local,
+ final int numStack,
+ final Object[] stack) {
+ if (mv != null) {
+ mv.visitFrame(type, numLocal, local, numStack, stack);
}
+ }
- /**
- * Visits a local variable instruction. A local variable instruction is an
- * instruction that loads or stores the value of a local variable.
- *
- * @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.
- */
- public void visitVarInsn(int opcode, int var) {
- if (mv != null) {
- mv.visitVarInsn(opcode, var);
- }
+ // -----------------------------------------------------------------------------------------------
+ // Normal instructions
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Visits a zero operand instruction.
+ *
+ * @param opcode the opcode of the instruction to be visited. This opcode is either NOP,
+ * ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5,
+ * LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD,
+ * FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE, DASTORE,
+ * AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2,
+ * SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV,
+ * FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR, IUSHR,
+ * LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I,
+ * D2L, D2F, I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN, FRETURN,
+ * DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW, MONITORENTER, or MONITOREXIT.
+ */
+ public void visitInsn(final int opcode) {
+ if (mv != null) {
+ mv.visitInsn(opcode);
}
+ }
- /**
- * Visits a type instruction. A type instruction is an instruction that
- * takes the internal name of a class as parameter.
- *
- * @param opcode
- * the opcode of the type instruction to be visited. This opcode
- * is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
- * @param type
- * the operand of the instruction to be visited. This operand
- * must be the internal name of an object or array class (see
- * {@link Type#getInternalName() getInternalName}).
- */
- public void visitTypeInsn(int opcode, String type) {
- if (mv != null) {
- mv.visitTypeInsn(opcode, type);
- }
+ /**
+ * Visits an instruction with a single int operand.
+ *
+ * @param opcode the opcode of the instruction to be visited. This opcode is either BIPUSH, SIPUSH
+ * or NEWARRAY.
+ * @param operand the operand of the instruction to be visited.<br>
+ * When opcode is BIPUSH, operand value should be between Byte.MIN_VALUE and Byte.MAX_VALUE.
+ * <br>
+ * When opcode is SIPUSH, operand value should be between Short.MIN_VALUE and Short.MAX_VALUE.
+ * <br>
+ * When opcode is NEWARRAY, operand value should be one of {@link Opcodes#T_BOOLEAN}, {@link
+ * Opcodes#T_CHAR}, {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE}, {@link Opcodes#T_BYTE},
+ * {@link Opcodes#T_SHORT}, {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}.
+ */
+ public void visitIntInsn(final int opcode, final int operand) {
+ if (mv != null) {
+ mv.visitIntInsn(opcode, operand);
}
+ }
- /**
- * Visits a field instruction. A field instruction is an instruction that
- * loads or stores the value of a field of an object.
- *
- * @param opcode
- * the opcode of the type instruction to be visited. This opcode
- * is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
- * @param owner
- * the internal name of the field's owner class (see
- * {@link Type#getInternalName() getInternalName}).
- * @param name
- * the field's name.
- * @param desc
- * the field's descriptor (see {@link Type Type}).
- */
- public void visitFieldInsn(int opcode, String owner, String name,
- String desc) {
- if (mv != null) {
- mv.visitFieldInsn(opcode, owner, name, desc);
- }
+ /**
+ * Visits a local variable instruction. A local variable instruction is an instruction that loads
+ * or stores the value of a local variable.
+ *
+ * @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.
+ */
+ public void visitVarInsn(final int opcode, final int var) {
+ if (mv != null) {
+ mv.visitVarInsn(opcode, var);
}
+ }
- /**
- * Visits a method instruction. A method instruction is an instruction that
- * invokes a method.
- *
- * @param opcode
- * the opcode of the type instruction to be visited. This opcode
- * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
- * INVOKEINTERFACE.
- * @param owner
- * the internal name of the method's owner class (see
- * {@link Type#getInternalName() getInternalName}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
- */
- @Deprecated
- public void visitMethodInsn(int opcode, String owner, String name,
- String desc) {
- if (api >= Opcodes.ASM5) {
- boolean itf = opcode == Opcodes.INVOKEINTERFACE;
- visitMethodInsn(opcode, owner, name, desc, itf);
- return;
- }
- if (mv != null) {
- mv.visitMethodInsn(opcode, owner, name, desc);
- }
+ /**
+ * Visits a type instruction. A type instruction is an instruction that takes the internal name of
+ * a class as parameter.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This opcode is either NEW,
+ * ANEWARRAY, CHECKCAST or INSTANCEOF.
+ * @param type the operand of the instruction to be visited. This operand must be the internal
+ * name of an object or array class (see {@link Type#getInternalName()}).
+ */
+ public void visitTypeInsn(final int opcode, final String type) {
+ if (mv != null) {
+ mv.visitTypeInsn(opcode, type);
}
+ }
- /**
- * Visits a method instruction. A method instruction is an instruction that
- * invokes a method.
- *
- * @param opcode
- * the opcode of the type instruction to be visited. This opcode
- * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
- * INVOKEINTERFACE.
- * @param owner
- * the internal name of the method's owner class (see
- * {@link Type#getInternalName() getInternalName}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
- * @param itf
- * if the method's owner class is an interface.
- */
- public void visitMethodInsn(int opcode, String owner, String name,
- String desc, boolean itf) {
- if (api < Opcodes.ASM5) {
- if (itf != (opcode == Opcodes.INVOKEINTERFACE)) {
- throw new IllegalArgumentException(
- "INVOKESPECIAL/STATIC on interfaces require ASM 5");
- }
- visitMethodInsn(opcode, owner, name, desc);
- return;
- }
- if (mv != null) {
- mv.visitMethodInsn(opcode, owner, name, desc, itf);
- }
+ /**
+ * Visits a field instruction. A field instruction is an instruction that loads or stores the
+ * value of a field of an object.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This opcode is either
+ * GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
+ * @param owner the internal name of the field's owner class (see {@link Type#getInternalName()}).
+ * @param name the field's name.
+ * @param descriptor the field's descriptor (see {@link Type}).
+ */
+ public void visitFieldInsn(
+ final int opcode, final String owner, final String name, final String descriptor) {
+ if (mv != null) {
+ mv.visitFieldInsn(opcode, owner, name, descriptor);
}
+ }
- /**
- * Visits an invokedynamic instruction.
- *
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
- * @param bsm
- * the bootstrap method.
- * @param bsmArgs
- * the bootstrap method constant arguments. Each argument must be
- * an {@link Integer}, {@link Float}, {@link Long},
- * {@link Double}, {@link String}, {@link Type} or {@link Handle}
- * value. This method is allowed to modify the content of the
- * array so a caller should expect that this array may change.
- */
- public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
- Object... bsmArgs) {
- if (mv != null) {
- mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
- }
+ /**
+ * Visits a method instruction. A method instruction is an instruction that invokes a method.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This opcode is either
+ * INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
+ * @param owner the internal name of the method's owner class (see {@link
+ * Type#getInternalName()}).
+ * @param name the method's name.
+ * @param descriptor the method's descriptor (see {@link Type}).
+ * @deprecated use {@link #visitMethodInsn(int, String, String, String, boolean)} instead.
+ */
+ @Deprecated
+ public void visitMethodInsn(
+ final int opcode, final String owner, final String name, final String descriptor) {
+ int opcodeAndSource = opcode | (api < Opcodes.ASM5 ? Opcodes.SOURCE_DEPRECATED : 0);
+ visitMethodInsn(opcodeAndSource, owner, name, descriptor, opcode == Opcodes.INVOKEINTERFACE);
+ }
+
+ /**
+ * Visits a method instruction. A method instruction is an instruction that invokes a method.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This opcode is either
+ * INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
+ * @param owner the internal name of the method's owner class (see {@link
+ * Type#getInternalName()}).
+ * @param name the method's name.
+ * @param descriptor the method's descriptor (see {@link Type}).
+ * @param isInterface if the method's owner class is an interface.
+ */
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String descriptor,
+ final boolean isInterface) {
+ if (api < Opcodes.ASM5 && (opcode & Opcodes.SOURCE_DEPRECATED) == 0) {
+ if (isInterface != (opcode == Opcodes.INVOKEINTERFACE)) {
+ throw new UnsupportedOperationException("INVOKESPECIAL/STATIC on interfaces requires ASM5");
+ }
+ visitMethodInsn(opcode, owner, name, descriptor);
+ return;
}
-
- /**
- * Visits a jump instruction. A jump instruction is an instruction that may
- * jump to another instruction.
- *
- * @param opcode
- * the opcode of the type instruction to be visited. This opcode
- * is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
- * IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE,
- * IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
- * @param label
- * the operand of the instruction to be visited. This operand is
- * a label that designates the instruction to which the jump
- * instruction may jump.
- */
- public void visitJumpInsn(int opcode, Label label) {
- if (mv != null) {
- mv.visitJumpInsn(opcode, label);
- }
+ if (mv != null) {
+ mv.visitMethodInsn(opcode & ~Opcodes.SOURCE_MASK, owner, name, descriptor, isInterface);
}
+ }
- /**
- * Visits a label. A label designates the instruction that will be visited
- * just after it.
- *
- * @param label
- * a {@link Label Label} object.
- */
- public void visitLabel(Label label) {
- if (mv != null) {
- mv.visitLabel(label);
- }
+ /**
+ * Visits an invokedynamic instruction.
+ *
+ * @param name the method's name.
+ * @param descriptor the method's descriptor (see {@link Type}).
+ * @param bootstrapMethodHandle the bootstrap method.
+ * @param bootstrapMethodArguments the bootstrap method constant arguments. Each argument must be
+ * an {@link Integer}, {@link Float}, {@link Long}, {@link Double}, {@link String}, {@link
+ * Type}, {@link Handle} or {@link ConstantDynamic} value. This method is allowed to modify
+ * the content of the array so a caller should expect that this array may change.
+ */
+ public void visitInvokeDynamicInsn(
+ final String name,
+ final String descriptor,
+ final Handle bootstrapMethodHandle,
+ final Object... bootstrapMethodArguments) {
+ if (api < Opcodes.ASM5) {
+ throw new UnsupportedOperationException(REQUIRES_ASM5);
}
-
- // -------------------------------------------------------------------------
- // Special instructions
- // -------------------------------------------------------------------------
-
- /**
- * Visits a LDC instruction. Note that new constant types may be added in
- * future versions of the Java Virtual Machine. To easily detect new
- * constant types, implementations of this method should check for
- * unexpected constant types, like this:
- *
- * <pre>
- * if (cst instanceof Integer) {
- * // ...
- * } else if (cst instanceof Float) {
- * // ...
- * } else if (cst instanceof Long) {
- * // ...
- * } else if (cst instanceof Double) {
- * // ...
- * } else if (cst instanceof String) {
- * // ...
- * } else if (cst instanceof Type) {
- * int sort = ((Type) cst).getSort();
- * if (sort == Type.OBJECT) {
- * // ...
- * } else if (sort == Type.ARRAY) {
- * // ...
- * } else if (sort == Type.METHOD) {
- * // ...
- * } else {
- * // throw an exception
- * }
- * } else if (cst instanceof Handle) {
- * // ...
- * } else {
- * // throw an exception
- * }
- * </pre>
- *
- * @param cst
- * the constant to be loaded on the stack. This parameter must be
- * a non null {@link Integer}, a {@link Float}, a {@link Long}, a
- * {@link Double}, a {@link String}, a {@link Type} of OBJECT or
- * ARRAY sort for <tt>.class</tt> constants, for classes whose
- * version is 49.0, a {@link Type} of METHOD sort or a
- * {@link Handle} for MethodType and MethodHandle constants, for
- * classes whose version is 51.0.
- */
- public void visitLdcInsn(Object cst) {
- if (mv != null) {
- mv.visitLdcInsn(cst);
- }
+ if (mv != null) {
+ mv.visitInvokeDynamicInsn(name, descriptor, bootstrapMethodHandle, bootstrapMethodArguments);
}
+ }
- /**
- * Visits an IINC instruction.
- *
- * @param var
- * index of the local variable to be incremented.
- * @param increment
- * amount to increment the local variable by.
- */
- public void visitIincInsn(int var, int increment) {
- if (mv != null) {
- mv.visitIincInsn(var, increment);
- }
+ /**
+ * Visits a jump instruction. A jump instruction is an instruction that may jump to another
+ * instruction.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This opcode is either IFEQ,
+ * IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT,
+ * IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
+ * @param label the operand of the instruction to be visited. This operand is a label that
+ * designates the instruction to which the jump instruction may jump.
+ */
+ public void visitJumpInsn(final int opcode, final Label label) {
+ if (mv != null) {
+ mv.visitJumpInsn(opcode, label);
}
+ }
- /**
- * Visits a TABLESWITCH instruction.
- *
- * @param min
- * the minimum key value.
- * @param max
- * the maximum key value.
- * @param dflt
- * beginning of the default handler block.
- * @param labels
- * beginnings of the handler blocks. <tt>labels[i]</tt> is the
- * beginning of the handler block for the <tt>min + i</tt> key.
- */
- public void visitTableSwitchInsn(int min, int max, Label dflt,
- Label... labels) {
- if (mv != null) {
- mv.visitTableSwitchInsn(min, max, dflt, labels);
- }
+ /**
+ * Visits a label. A label designates the instruction that will be visited just after it.
+ *
+ * @param label a {@link Label} object.
+ */
+ public void visitLabel(final Label label) {
+ if (mv != null) {
+ mv.visitLabel(label);
}
+ }
- /**
- * Visits a LOOKUPSWITCH instruction.
- *
- * @param dflt
- * beginning of the default handler block.
- * @param keys
- * the values of the keys.
- * @param labels
- * beginnings of the handler blocks. <tt>labels[i]</tt> is the
- * beginning of the handler block for the <tt>keys[i]</tt> key.
- */
- public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) {
- if (mv != null) {
- mv.visitLookupSwitchInsn(dflt, keys, labels);
- }
+ // -----------------------------------------------------------------------------------------------
+ // Special instructions
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Visits a LDC instruction. Note that new constant types may be added in future versions of the
+ * Java Virtual Machine. To easily detect new constant types, implementations of this method
+ * should check for unexpected constant types, like this:
+ *
+ * <pre>
+ * if (cst instanceof Integer) {
+ * // ...
+ * } else if (cst instanceof Float) {
+ * // ...
+ * } else if (cst instanceof Long) {
+ * // ...
+ * } else if (cst instanceof Double) {
+ * // ...
+ * } else if (cst instanceof String) {
+ * // ...
+ * } else if (cst instanceof Type) {
+ * int sort = ((Type) cst).getSort();
+ * if (sort == Type.OBJECT) {
+ * // ...
+ * } else if (sort == Type.ARRAY) {
+ * // ...
+ * } else if (sort == Type.METHOD) {
+ * // ...
+ * } else {
+ * // throw an exception
+ * }
+ * } else if (cst instanceof Handle) {
+ * // ...
+ * } else if (cst instanceof ConstantDynamic) {
+ * // ...
+ * } else {
+ * // throw an exception
+ * }
+ * </pre>
+ *
+ * @param value the constant to be loaded on the stack. This parameter must be a non null {@link
+ * Integer}, a {@link Float}, a {@link Long}, a {@link Double}, a {@link String}, a {@link
+ * Type} of OBJECT or ARRAY sort for {@code .class} constants, for classes whose version is
+ * 49, a {@link Type} of METHOD sort for MethodType, a {@link Handle} for MethodHandle
+ * constants, for classes whose version is 51 or a {@link ConstantDynamic} for a constant
+ * dynamic for classes whose version is 55.
+ */
+ public void visitLdcInsn(final Object value) {
+ if (api < Opcodes.ASM5
+ && (value instanceof Handle
+ || (value instanceof Type && ((Type) value).getSort() == Type.METHOD))) {
+ throw new UnsupportedOperationException(REQUIRES_ASM5);
}
-
- /**
- * Visits a MULTIANEWARRAY instruction.
- *
- * @param desc
- * an array type descriptor (see {@link Type Type}).
- * @param dims
- * number of dimensions of the array to allocate.
- */
- public void visitMultiANewArrayInsn(String desc, int dims) {
- if (mv != null) {
- mv.visitMultiANewArrayInsn(desc, dims);
- }
+ if (api != Opcodes.ASM7 && value instanceof ConstantDynamic) {
+ throw new UnsupportedOperationException("This feature requires ASM7");
}
-
- /**
- * Visits an annotation on an instruction. This method must be called just
- * <i>after</i> the annotated instruction. It can be called several times
- * for the same instruction.
- *
- * @param typeRef
- * a reference to the annotated type. The sort of this type
- * reference must be {@link TypeReference#INSTANCEOF INSTANCEOF},
- * {@link TypeReference#NEW NEW},
- * {@link TypeReference#CONSTRUCTOR_REFERENCE
- * CONSTRUCTOR_REFERENCE}, {@link TypeReference#METHOD_REFERENCE
- * METHOD_REFERENCE}, {@link TypeReference#CAST CAST},
- * {@link TypeReference#CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
- * CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT},
- * {@link TypeReference#METHOD_INVOCATION_TYPE_ARGUMENT
- * METHOD_INVOCATION_TYPE_ARGUMENT},
- * {@link TypeReference#CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
- * CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or
- * {@link TypeReference#METHOD_REFERENCE_TYPE_ARGUMENT
- * METHOD_REFERENCE_TYPE_ARGUMENT}. See {@link TypeReference}.
- * @param typePath
- * the path to the annotated type argument, wildcard bound, array
- * element type, or static inner type within 'typeRef'. May be
- * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitInsnAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- if (api < Opcodes.ASM5) {
- throw new RuntimeException();
- }
- if (mv != null) {
- return mv.visitInsnAnnotation(typeRef, typePath, desc, visible);
- }
- return null;
+ if (mv != null) {
+ mv.visitLdcInsn(value);
}
+ }
- // -------------------------------------------------------------------------
- // Exceptions table entries, debug information, max stack and max locals
- // -------------------------------------------------------------------------
-
- /**
- * Visits a try catch block.
- *
- * @param start
- * beginning of the exception handler's scope (inclusive).
- * @param end
- * end of the exception handler's scope (exclusive).
- * @param handler
- * beginning of the exception handler's code.
- * @param type
- * internal name of the type of exceptions handled by the
- * handler, or <tt>null</tt> to catch any exceptions (for
- * "finally" blocks).
- * @throws IllegalArgumentException
- * if one of the labels has already been visited by this visitor
- * (by the {@link #visitLabel visitLabel} method).
- */
- public void visitTryCatchBlock(Label start, Label end, Label handler,
- String type) {
- if (mv != null) {
- mv.visitTryCatchBlock(start, end, handler, type);
- }
+ /**
+ * Visits an IINC instruction.
+ *
+ * @param var 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) {
+ if (mv != null) {
+ mv.visitIincInsn(var, increment);
}
+ }
- /**
- * Visits an annotation on an exception handler type. This method must be
- * called <i>after</i> the {@link #visitTryCatchBlock} for the annotated
- * exception handler. It can be called several times for the same exception
- * handler.
- *
- * @param typeRef
- * a reference to the annotated type. The sort of this type
- * reference must be {@link TypeReference#EXCEPTION_PARAMETER
- * EXCEPTION_PARAMETER}. See {@link TypeReference}.
- * @param typePath
- * the path to the annotated type argument, wildcard bound, array
- * element type, or static inner type within 'typeRef'. May be
- * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitTryCatchAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- if (api < Opcodes.ASM5) {
- throw new RuntimeException();
- }
- if (mv != null) {
- return mv.visitTryCatchAnnotation(typeRef, typePath, desc, visible);
- }
- return null;
+ /**
+ * Visits a TABLESWITCH instruction.
+ *
+ * @param min the minimum key value.
+ * @param max the maximum key value.
+ * @param dflt beginning of the default handler block.
+ * @param labels beginnings of the handler blocks. {@code labels[i]} is the beginning of the
+ * handler block for the {@code min + i} key.
+ */
+ public void visitTableSwitchInsn(
+ final int min, final int max, final Label dflt, final Label... labels) {
+ if (mv != null) {
+ mv.visitTableSwitchInsn(min, max, dflt, labels);
}
+ }
- /**
- * Visits a local variable declaration.
- *
- * @param name
- * the name of a local variable.
- * @param desc
- * the type descriptor of this local variable.
- * @param signature
- * the type signature of this local variable. May be
- * <tt>null</tt> if the local variable type does not use generic
- * types.
- * @param start
- * the first instruction corresponding to the scope of this local
- * variable (inclusive).
- * @param end
- * the last instruction corresponding to the scope of this local
- * variable (exclusive).
- * @param index
- * the local variable's index.
- * @throws IllegalArgumentException
- * if one of the labels has not already been visited by this
- * visitor (by the {@link #visitLabel visitLabel} method).
- */
- public void visitLocalVariable(String name, String desc, String signature,
- Label start, Label end, int index) {
- if (mv != null) {
- mv.visitLocalVariable(name, desc, signature, start, end, index);
- }
+ /**
+ * Visits a LOOKUPSWITCH instruction.
+ *
+ * @param dflt beginning of the default handler block.
+ * @param keys the values of the keys.
+ * @param labels beginnings of the handler blocks. {@code labels[i]} is the beginning of the
+ * handler block for the {@code keys[i]} key.
+ */
+ public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
+ if (mv != null) {
+ mv.visitLookupSwitchInsn(dflt, keys, labels);
}
+ }
- /**
- * Visits an annotation on a local variable type.
- *
- * @param typeRef
- * a reference to the annotated type. The sort of this type
- * reference must be {@link TypeReference#LOCAL_VARIABLE
- * LOCAL_VARIABLE} or {@link TypeReference#RESOURCE_VARIABLE
- * RESOURCE_VARIABLE}. See {@link TypeReference}.
- * @param typePath
- * the path to the annotated type argument, wildcard bound, array
- * element type, or static inner type within 'typeRef'. May be
- * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
- * @param start
- * the fist instructions corresponding to the continuous ranges
- * that make the scope of this local variable (inclusive).
- * @param end
- * the last instructions corresponding to the continuous ranges
- * that make the scope of this local variable (exclusive). This
- * array must have the same size as the 'start' array.
- * @param index
- * the local variable's index in each range. This array must have
- * the same size as the 'start' array.
- * @param desc
- * the class descriptor of the annotation class.
- * @param visible
- * <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values, or <tt>null</tt> if
- * this visitor is not interested in visiting this annotation.
- */
- public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
- TypePath typePath, Label[] start, Label[] end, int[] index,
- String desc, boolean visible) {
- if (api < Opcodes.ASM5) {
- throw new RuntimeException();
- }
- if (mv != null) {
- return mv.visitLocalVariableAnnotation(typeRef, typePath, start,
- end, index, desc, visible);
- }
- return null;
+ /**
+ * Visits a MULTIANEWARRAY instruction.
+ *
+ * @param descriptor an array type descriptor (see {@link Type}).
+ * @param numDimensions the number of dimensions of the array to allocate.
+ */
+ public void visitMultiANewArrayInsn(final String descriptor, final int numDimensions) {
+ if (mv != null) {
+ mv.visitMultiANewArrayInsn(descriptor, numDimensions);
}
+ }
- /**
- * Visits a line number declaration.
- *
- * @param line
- * a line number. This number refers to the source file from
- * which the class was compiled.
- * @param start
- * the first instruction corresponding to this line number.
- * @throws IllegalArgumentException
- * if <tt>start</tt> has not already been visited by this
- * visitor (by the {@link #visitLabel visitLabel} method).
- */
- public void visitLineNumber(int line, Label start) {
- if (mv != null) {
- mv.visitLineNumber(line, start);
- }
+ /**
+ * Visits an annotation on an instruction. This method must be called just <i>after</i> the
+ * annotated instruction. It can be called several times for the same instruction.
+ *
+ * @param typeRef a reference to the annotated type. The sort of this type reference must be
+ * {@link TypeReference#INSTANCEOF}, {@link TypeReference#NEW}, {@link
+ * TypeReference#CONSTRUCTOR_REFERENCE}, {@link TypeReference#METHOD_REFERENCE}, {@link
+ * TypeReference#CAST}, {@link TypeReference#CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT}, {@link
+ * TypeReference#METHOD_INVOCATION_TYPE_ARGUMENT}, {@link
+ * TypeReference#CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or {@link
+ * TypeReference#METHOD_REFERENCE_TYPE_ARGUMENT}. See {@link TypeReference}.
+ * @param typePath the path to the annotated type argument, wildcard bound, array element type, or
+ * static inner type within 'typeRef'. May be {@literal null} if the annotation targets
+ * 'typeRef' as a whole.
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitInsnAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new UnsupportedOperationException(REQUIRES_ASM5);
}
+ if (mv != null) {
+ return mv.visitInsnAnnotation(typeRef, typePath, descriptor, visible);
+ }
+ return null;
+ }
- /**
- * Visits the maximum stack size and the maximum number of local variables
- * of the method.
- *
- * @param maxStack
- * maximum stack size of the method.
- * @param maxLocals
- * maximum number of local variables for the method.
- */
- public void visitMaxs(int maxStack, int maxLocals) {
- if (mv != null) {
- mv.visitMaxs(maxStack, maxLocals);
- }
- }
+ // -----------------------------------------------------------------------------------------------
+ // Exceptions table entries, debug information, max stack and max locals
+ // -----------------------------------------------------------------------------------------------
- /**
- * Visits the end of the method. This method, which is the last one to be
- * called, is used to inform the visitor that all the annotations and
- * attributes of the method have been visited.
- */
- public void visitEnd() {
- if (mv != null) {
- mv.visitEnd();
- }
+ /**
+ * Visits a try catch block.
+ *
+ * @param start the beginning of the exception handler's scope (inclusive).
+ * @param end the end of the exception handler's scope (exclusive).
+ * @param handler the beginning of the exception handler's code.
+ * @param type the internal name of the type of exceptions handled by the handler, or {@literal
+ * null} to catch any exceptions (for "finally" blocks).
+ * @throws IllegalArgumentException if one of the labels has already been visited by this visitor
+ * (by the {@link #visitLabel} method).
+ */
+ public void visitTryCatchBlock(
+ final Label start, final Label end, final Label handler, final String type) {
+ if (mv != null) {
+ mv.visitTryCatchBlock(start, end, handler, type);
}
+ }
+
+ /**
+ * Visits an annotation on an exception handler type. This method must be called <i>after</i> the
+ * {@link #visitTryCatchBlock} for the annotated exception handler. It can be called several times
+ * for the same exception handler.
+ *
+ * @param typeRef a reference to the annotated type. The sort of this type reference must be
+ * {@link TypeReference#EXCEPTION_PARAMETER}. See {@link TypeReference}.
+ * @param typePath the path to the annotated type argument, wildcard bound, array element type, or
+ * static inner type within 'typeRef'. May be {@literal null} if the annotation targets
+ * 'typeRef' as a whole.
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitTryCatchAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new UnsupportedOperationException(REQUIRES_ASM5);
+ }
+ if (mv != null) {
+ return mv.visitTryCatchAnnotation(typeRef, typePath, descriptor, visible);
+ }
+ return null;
+ }
+
+ /**
+ * Visits a local variable declaration.
+ *
+ * @param name the name of a local variable.
+ * @param descriptor the type descriptor of this local variable.
+ * @param signature the type signature of this local variable. May be {@literal null} if the local
+ * variable type does not use generic types.
+ * @param start the first instruction corresponding to the scope of this local variable
+ * (inclusive).
+ * @param end the last instruction corresponding to the scope of this local variable (exclusive).
+ * @param index the local variable's index.
+ * @throws IllegalArgumentException if one of the labels has not already been visited by this
+ * visitor (by the {@link #visitLabel} method).
+ */
+ public void visitLocalVariable(
+ final String name,
+ final String descriptor,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index) {
+ if (mv != null) {
+ mv.visitLocalVariable(name, descriptor, signature, start, end, index);
+ }
+ }
+
+ /**
+ * Visits an annotation on a local variable type.
+ *
+ * @param typeRef a reference to the annotated type. The sort of this type reference must be
+ * {@link TypeReference#LOCAL_VARIABLE} or {@link TypeReference#RESOURCE_VARIABLE}. See {@link
+ * TypeReference}.
+ * @param typePath the path to the annotated type argument, wildcard bound, array element type, or
+ * static inner type within 'typeRef'. May be {@literal null} if the annotation targets
+ * 'typeRef' as a whole.
+ * @param start the fist instructions corresponding to the continuous ranges that make the scope
+ * of this local variable (inclusive).
+ * @param end the last instructions corresponding to the continuous ranges that make the scope of
+ * this local variable (exclusive). This array must have the same size as the 'start' array.
+ * @param index the local variable's index in each range. This array must have the same size as
+ * the 'start' array.
+ * @param descriptor the class descriptor of the annotation class.
+ * @param visible {@literal true} if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not
+ * interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitLocalVariableAnnotation(
+ final int typeRef,
+ final TypePath typePath,
+ final Label[] start,
+ final Label[] end,
+ final int[] index,
+ final String descriptor,
+ final boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new UnsupportedOperationException(REQUIRES_ASM5);
+ }
+ if (mv != null) {
+ return mv.visitLocalVariableAnnotation(
+ typeRef, typePath, start, end, index, descriptor, visible);
+ }
+ return null;
+ }
+
+ /**
+ * Visits a line number declaration.
+ *
+ * @param line a line number. This number refers to the source file from which the class was
+ * compiled.
+ * @param start the first instruction corresponding to this line number.
+ * @throws IllegalArgumentException if {@code start} has not already been visited by this visitor
+ * (by the {@link #visitLabel} method).
+ */
+ public void visitLineNumber(final int line, final Label start) {
+ if (mv != null) {
+ mv.visitLineNumber(line, start);
+ }
+ }
+
+ /**
+ * Visits the maximum stack size and the maximum number of local variables of the method.
+ *
+ * @param maxStack maximum stack size of the method.
+ * @param maxLocals maximum number of local variables for the method.
+ */
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ if (mv != null) {
+ mv.visitMaxs(maxStack, maxLocals);
+ }
+ }
+
+ /**
+ * Visits the end of the method. This method, which is the last one to be called, is used to
+ * inform the visitor that all the annotations and attributes of the method have been visited.
+ */
+ public void visitEnd() {
+ if (mv != null) {
+ mv.visitEnd();
+ }
+ }
}
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 5fa97a1..2cb0354 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
@@ -1,2915 +1,2390 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * A {@link MethodVisitor} that generates methods in bytecode form. Each visit
- * method of this class appends the bytecode corresponding to the visited
- * instruction to a byte vector, in the order these methods are called.
+ * A {@link MethodVisitor} that generates a corresponding 'method_info' structure, as defined in the
+ * Java Virtual Machine Specification (JVMS).
*
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.6">JVMS
+ * 4.6</a>
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
-class MethodWriter extends MethodVisitor {
+final class MethodWriter extends MethodVisitor {
- /**
- * Pseudo access flag used to denote constructors.
- */
- static final int ACC_CONSTRUCTOR = 0x80000;
+ /** Indicates that nothing must be computed. */
+ static final int COMPUTE_NOTHING = 0;
- /**
- * Frame has exactly the same locals as the previous stack map frame and
- * number of stack items is zero.
- */
- static final int SAME_FRAME = 0; // to 63 (0-3f)
+ /**
+ * Indicates that the maximum stack size and the maximum number of local variables must be
+ * computed, from scratch.
+ */
+ static final int COMPUTE_MAX_STACK_AND_LOCAL = 1;
- /**
- * Frame has exactly the same locals as the previous stack map frame and
- * number of stack items is 1
- */
- static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64; // to 127 (40-7f)
+ /**
+ * Indicates that the maximum stack size and the maximum number of local variables must be
+ * computed, from the existing stack map frames. This can be done more efficiently than with the
+ * control flow graph algorithm used for {@link #COMPUTE_MAX_STACK_AND_LOCAL}, by using a linear
+ * scan of the bytecode instructions.
+ */
+ static final int COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES = 2;
- /**
- * Reserved for future use
- */
- static final int RESERVED = 128;
+ /**
+ * Indicates that the stack map frames of type F_INSERT must be computed. The other frames are not
+ * computed. They should all be of type F_NEW and should be sufficient to compute the content of
+ * the F_INSERT frames, together with the bytecode instructions between a F_NEW and a F_INSERT
+ * frame - and without any knowledge of the type hierarchy (by definition of F_INSERT).
+ */
+ static final int COMPUTE_INSERTED_FRAMES = 3;
- /**
- * Frame has exactly the same locals as the previous stack map frame and
- * number of stack items is 1. Offset is bigger then 63;
- */
- static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247; // f7
+ /**
+ * Indicates that all the stack map frames must be computed. In this case the maximum stack size
+ * and the maximum number of local variables is also computed.
+ */
+ static final int COMPUTE_ALL_FRAMES = 4;
- /**
- * Frame where current locals are the same as the locals in the previous
- * frame, except that the k last locals are absent. The value of k is given
- * by the formula 251-frame_type.
- */
- static final int CHOP_FRAME = 248; // to 250 (f8-fA)
+ /** Indicates that {@link #STACK_SIZE_DELTA} is not applicable (not constant or never used). */
+ private static final int NA = 0;
- /**
- * Frame has exactly the same locals as the previous stack map frame and
- * number of stack items is zero. Offset is bigger then 63;
- */
- static final int SAME_FRAME_EXTENDED = 251; // fb
+ /**
+ * The stack size variation corresponding to each JVM opcode. The stack size variation for opcode
+ * 'o' is given by the array element at index 'o'.
+ *
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-6.html">JVMS 6</a>
+ */
+ private static final int[] STACK_SIZE_DELTA = {
+ 0, // nop = 0 (0x0)
+ 1, // aconst_null = 1 (0x1)
+ 1, // iconst_m1 = 2 (0x2)
+ 1, // iconst_0 = 3 (0x3)
+ 1, // iconst_1 = 4 (0x4)
+ 1, // iconst_2 = 5 (0x5)
+ 1, // iconst_3 = 6 (0x6)
+ 1, // iconst_4 = 7 (0x7)
+ 1, // iconst_5 = 8 (0x8)
+ 2, // lconst_0 = 9 (0x9)
+ 2, // lconst_1 = 10 (0xa)
+ 1, // fconst_0 = 11 (0xb)
+ 1, // fconst_1 = 12 (0xc)
+ 1, // fconst_2 = 13 (0xd)
+ 2, // dconst_0 = 14 (0xe)
+ 2, // dconst_1 = 15 (0xf)
+ 1, // bipush = 16 (0x10)
+ 1, // sipush = 17 (0x11)
+ 1, // ldc = 18 (0x12)
+ NA, // ldc_w = 19 (0x13)
+ NA, // ldc2_w = 20 (0x14)
+ 1, // iload = 21 (0x15)
+ 2, // lload = 22 (0x16)
+ 1, // fload = 23 (0x17)
+ 2, // dload = 24 (0x18)
+ 1, // aload = 25 (0x19)
+ NA, // iload_0 = 26 (0x1a)
+ NA, // iload_1 = 27 (0x1b)
+ NA, // iload_2 = 28 (0x1c)
+ NA, // iload_3 = 29 (0x1d)
+ NA, // lload_0 = 30 (0x1e)
+ NA, // lload_1 = 31 (0x1f)
+ NA, // lload_2 = 32 (0x20)
+ NA, // lload_3 = 33 (0x21)
+ NA, // fload_0 = 34 (0x22)
+ NA, // fload_1 = 35 (0x23)
+ NA, // fload_2 = 36 (0x24)
+ NA, // fload_3 = 37 (0x25)
+ NA, // dload_0 = 38 (0x26)
+ NA, // dload_1 = 39 (0x27)
+ NA, // dload_2 = 40 (0x28)
+ NA, // dload_3 = 41 (0x29)
+ NA, // aload_0 = 42 (0x2a)
+ NA, // aload_1 = 43 (0x2b)
+ NA, // aload_2 = 44 (0x2c)
+ NA, // aload_3 = 45 (0x2d)
+ -1, // iaload = 46 (0x2e)
+ 0, // laload = 47 (0x2f)
+ -1, // faload = 48 (0x30)
+ 0, // daload = 49 (0x31)
+ -1, // aaload = 50 (0x32)
+ -1, // baload = 51 (0x33)
+ -1, // caload = 52 (0x34)
+ -1, // saload = 53 (0x35)
+ -1, // istore = 54 (0x36)
+ -2, // lstore = 55 (0x37)
+ -1, // fstore = 56 (0x38)
+ -2, // dstore = 57 (0x39)
+ -1, // astore = 58 (0x3a)
+ NA, // istore_0 = 59 (0x3b)
+ NA, // istore_1 = 60 (0x3c)
+ NA, // istore_2 = 61 (0x3d)
+ NA, // istore_3 = 62 (0x3e)
+ NA, // lstore_0 = 63 (0x3f)
+ NA, // lstore_1 = 64 (0x40)
+ NA, // lstore_2 = 65 (0x41)
+ NA, // lstore_3 = 66 (0x42)
+ NA, // fstore_0 = 67 (0x43)
+ NA, // fstore_1 = 68 (0x44)
+ NA, // fstore_2 = 69 (0x45)
+ NA, // fstore_3 = 70 (0x46)
+ NA, // dstore_0 = 71 (0x47)
+ NA, // dstore_1 = 72 (0x48)
+ NA, // dstore_2 = 73 (0x49)
+ NA, // dstore_3 = 74 (0x4a)
+ NA, // astore_0 = 75 (0x4b)
+ NA, // astore_1 = 76 (0x4c)
+ NA, // astore_2 = 77 (0x4d)
+ NA, // astore_3 = 78 (0x4e)
+ -3, // iastore = 79 (0x4f)
+ -4, // lastore = 80 (0x50)
+ -3, // fastore = 81 (0x51)
+ -4, // dastore = 82 (0x52)
+ -3, // aastore = 83 (0x53)
+ -3, // bastore = 84 (0x54)
+ -3, // castore = 85 (0x55)
+ -3, // sastore = 86 (0x56)
+ -1, // pop = 87 (0x57)
+ -2, // pop2 = 88 (0x58)
+ 1, // dup = 89 (0x59)
+ 1, // dup_x1 = 90 (0x5a)
+ 1, // dup_x2 = 91 (0x5b)
+ 2, // dup2 = 92 (0x5c)
+ 2, // dup2_x1 = 93 (0x5d)
+ 2, // dup2_x2 = 94 (0x5e)
+ 0, // swap = 95 (0x5f)
+ -1, // iadd = 96 (0x60)
+ -2, // ladd = 97 (0x61)
+ -1, // fadd = 98 (0x62)
+ -2, // dadd = 99 (0x63)
+ -1, // isub = 100 (0x64)
+ -2, // lsub = 101 (0x65)
+ -1, // fsub = 102 (0x66)
+ -2, // dsub = 103 (0x67)
+ -1, // imul = 104 (0x68)
+ -2, // lmul = 105 (0x69)
+ -1, // fmul = 106 (0x6a)
+ -2, // dmul = 107 (0x6b)
+ -1, // idiv = 108 (0x6c)
+ -2, // ldiv = 109 (0x6d)
+ -1, // fdiv = 110 (0x6e)
+ -2, // ddiv = 111 (0x6f)
+ -1, // irem = 112 (0x70)
+ -2, // lrem = 113 (0x71)
+ -1, // frem = 114 (0x72)
+ -2, // drem = 115 (0x73)
+ 0, // ineg = 116 (0x74)
+ 0, // lneg = 117 (0x75)
+ 0, // fneg = 118 (0x76)
+ 0, // dneg = 119 (0x77)
+ -1, // ishl = 120 (0x78)
+ -1, // lshl = 121 (0x79)
+ -1, // ishr = 122 (0x7a)
+ -1, // lshr = 123 (0x7b)
+ -1, // iushr = 124 (0x7c)
+ -1, // lushr = 125 (0x7d)
+ -1, // iand = 126 (0x7e)
+ -2, // land = 127 (0x7f)
+ -1, // ior = 128 (0x80)
+ -2, // lor = 129 (0x81)
+ -1, // ixor = 130 (0x82)
+ -2, // lxor = 131 (0x83)
+ 0, // iinc = 132 (0x84)
+ 1, // i2l = 133 (0x85)
+ 0, // i2f = 134 (0x86)
+ 1, // i2d = 135 (0x87)
+ -1, // l2i = 136 (0x88)
+ -1, // l2f = 137 (0x89)
+ 0, // l2d = 138 (0x8a)
+ 0, // f2i = 139 (0x8b)
+ 1, // f2l = 140 (0x8c)
+ 1, // f2d = 141 (0x8d)
+ -1, // d2i = 142 (0x8e)
+ 0, // d2l = 143 (0x8f)
+ -1, // d2f = 144 (0x90)
+ 0, // i2b = 145 (0x91)
+ 0, // i2c = 146 (0x92)
+ 0, // i2s = 147 (0x93)
+ -3, // lcmp = 148 (0x94)
+ -1, // fcmpl = 149 (0x95)
+ -1, // fcmpg = 150 (0x96)
+ -3, // dcmpl = 151 (0x97)
+ -3, // dcmpg = 152 (0x98)
+ -1, // ifeq = 153 (0x99)
+ -1, // ifne = 154 (0x9a)
+ -1, // iflt = 155 (0x9b)
+ -1, // ifge = 156 (0x9c)
+ -1, // ifgt = 157 (0x9d)
+ -1, // ifle = 158 (0x9e)
+ -2, // if_icmpeq = 159 (0x9f)
+ -2, // if_icmpne = 160 (0xa0)
+ -2, // if_icmplt = 161 (0xa1)
+ -2, // if_icmpge = 162 (0xa2)
+ -2, // if_icmpgt = 163 (0xa3)
+ -2, // if_icmple = 164 (0xa4)
+ -2, // if_acmpeq = 165 (0xa5)
+ -2, // if_acmpne = 166 (0xa6)
+ 0, // goto = 167 (0xa7)
+ 1, // jsr = 168 (0xa8)
+ 0, // ret = 169 (0xa9)
+ -1, // tableswitch = 170 (0xaa)
+ -1, // lookupswitch = 171 (0xab)
+ -1, // ireturn = 172 (0xac)
+ -2, // lreturn = 173 (0xad)
+ -1, // freturn = 174 (0xae)
+ -2, // dreturn = 175 (0xaf)
+ -1, // areturn = 176 (0xb0)
+ 0, // return = 177 (0xb1)
+ NA, // getstatic = 178 (0xb2)
+ NA, // putstatic = 179 (0xb3)
+ NA, // getfield = 180 (0xb4)
+ NA, // putfield = 181 (0xb5)
+ NA, // invokevirtual = 182 (0xb6)
+ NA, // invokespecial = 183 (0xb7)
+ NA, // invokestatic = 184 (0xb8)
+ NA, // invokeinterface = 185 (0xb9)
+ NA, // invokedynamic = 186 (0xba)
+ 1, // new = 187 (0xbb)
+ 0, // newarray = 188 (0xbc)
+ 0, // anewarray = 189 (0xbd)
+ 0, // arraylength = 190 (0xbe)
+ NA, // athrow = 191 (0xbf)
+ 0, // checkcast = 192 (0xc0)
+ 0, // instanceof = 193 (0xc1)
+ -1, // monitorenter = 194 (0xc2)
+ -1, // monitorexit = 195 (0xc3)
+ NA, // wide = 196 (0xc4)
+ NA, // multianewarray = 197 (0xc5)
+ -1, // ifnull = 198 (0xc6)
+ -1, // ifnonnull = 199 (0xc7)
+ NA, // goto_w = 200 (0xc8)
+ NA // jsr_w = 201 (0xc9)
+ };
- /**
- * Frame where current locals are the same as the locals in the previous
- * frame, except that k additional locals are defined. The value of k is
- * given by the formula frame_type-251.
- */
- static final int APPEND_FRAME = 252; // to 254 // fc-fe
+ /** Where the constants used in this MethodWriter must be stored. */
+ private final SymbolTable symbolTable;
- /**
- * Full frame
- */
- static final int FULL_FRAME = 255; // ff
+ // Note: fields are ordered as in the method_info structure, and those related to attributes are
+ // ordered as in Section 4.7 of the JVMS.
- /**
- * Indicates that the stack map frames must be recomputed from scratch. In
- * this case the maximum stack size and number of local variables is also
- * recomputed from scratch.
- *
- * @see #compute
- */
- private static final int FRAMES = 0;
+ /**
+ * The access_flags field of the method_info JVMS structure. This field can contain ASM specific
+ * access flags, such as {@link Opcodes#ACC_DEPRECATED}, which are removed when generating the
+ * ClassFile structure.
+ */
+ private final int accessFlags;
- /**
- * Indicates that the maximum stack size and number of local variables must
- * be automatically computed.
- *
- * @see #compute
- */
- private static final int MAXS = 1;
+ /** The name_index field of the method_info JVMS structure. */
+ private final int nameIndex;
- /**
- * Indicates that nothing must be automatically computed.
- *
- * @see #compute
- */
- private static final int NOTHING = 2;
+ /** The name of this method. */
+ private final String name;
- /**
- * The class writer to which this method must be added.
- */
- final ClassWriter cw;
+ /** The descriptor_index field of the method_info JVMS structure. */
+ private final int descriptorIndex;
- /**
- * Access flags of this method.
- */
- private int access;
+ /** The descriptor of this method. */
+ private final String descriptor;
- /**
- * The index of the constant pool item that contains the name of this
- * method.
- */
- private final int name;
+ // Code attribute fields and sub attributes:
- /**
- * The index of the constant pool item that contains the descriptor of this
- * method.
- */
- private final int desc;
+ /** The max_stack field of the Code attribute. */
+ private int maxStack;
- /**
- * The descriptor of this method.
- */
- private final String descriptor;
+ /** The max_locals field of the Code attribute. */
+ private int maxLocals;
- /**
- * The signature of this method.
- */
- String signature;
+ /** The 'code' field of the Code attribute. */
+ private final ByteVector code = new ByteVector();
- /**
- * If not zero, indicates that the code of this method must be copied from
- * the ClassReader associated to this writer in <code>cw.cr</code>. More
- * precisely, this field gives the index of the first byte to copied from
- * <code>cw.cr.b</code>.
- */
- int classReaderOffset;
+ /**
+ * The first element in the exception handler list (used to generate the exception_table of the
+ * Code attribute). The next ones can be accessed with the {@link Handler#nextHandler} field. May
+ * be {@literal null}.
+ */
+ private Handler firstHandler;
- /**
- * If not zero, indicates that the code of this method must be copied from
- * the ClassReader associated to this writer in <code>cw.cr</code>. More
- * precisely, this field gives the number of bytes to copied from
- * <code>cw.cr.b</code>.
- */
- int classReaderLength;
+ /**
+ * The last element in the exception handler list (used to generate the exception_table of the
+ * Code attribute). The next ones can be accessed with the {@link Handler#nextHandler} field. May
+ * be {@literal null}.
+ */
+ private Handler lastHandler;
- /**
- * Number of exceptions that can be thrown by this method.
- */
- int exceptionCount;
+ /** The line_number_table_length field of the LineNumberTable code attribute. */
+ private int lineNumberTableLength;
- /**
- * The exceptions that can be thrown by this method. More precisely, this
- * array contains the indexes of the constant pool items that contain the
- * internal names of these exception classes.
- */
- int[] exceptions;
+ /** The line_number_table array of the LineNumberTable code attribute, or {@literal null}. */
+ private ByteVector lineNumberTable;
- /**
- * The annotation default attribute of this method. May be <tt>null</tt>.
- */
- private ByteVector annd;
+ /** The local_variable_table_length field of the LocalVariableTable code attribute. */
+ private int localVariableTableLength;
- /**
- * The runtime visible annotations of this method. May be <tt>null</tt>.
- */
- private AnnotationWriter anns;
+ /**
+ * The local_variable_table array of the LocalVariableTable code attribute, or {@literal null}.
+ */
+ private ByteVector localVariableTable;
- /**
- * The runtime invisible annotations of this method. May be <tt>null</tt>.
- */
- private AnnotationWriter ianns;
+ /** The local_variable_type_table_length field of the LocalVariableTypeTable code attribute. */
+ private int localVariableTypeTableLength;
- /**
- * The runtime visible type annotations of this method. May be <tt>null</tt>
- * .
- */
- private AnnotationWriter tanns;
+ /**
+ * The local_variable_type_table array of the LocalVariableTypeTable code attribute, or {@literal
+ * null}.
+ */
+ private ByteVector localVariableTypeTable;
- /**
- * The runtime invisible type annotations of this method. May be
- * <tt>null</tt>.
- */
- private AnnotationWriter itanns;
+ /** The number_of_entries field of the StackMapTable code attribute. */
+ private int stackMapTableNumberOfEntries;
- /**
- * The runtime visible parameter annotations of this method. May be
- * <tt>null</tt>.
- */
- private AnnotationWriter[] panns;
+ /** The 'entries' array of the StackMapTable code attribute. */
+ private ByteVector stackMapTableEntries;
- /**
- * The runtime invisible parameter annotations of this method. May be
- * <tt>null</tt>.
- */
- private AnnotationWriter[] ipanns;
+ /**
+ * The last runtime visible type annotation of the Code attribute. The previous ones can be
+ * accessed with the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastCodeRuntimeVisibleTypeAnnotation;
- /**
- * The number of synthetic parameters of this method.
- */
- private int synthetics;
+ /**
+ * The last runtime invisible type annotation of the Code attribute. The previous ones can be
+ * accessed with the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastCodeRuntimeInvisibleTypeAnnotation;
+
+ /**
+ * The first non standard attribute of the Code attribute. The next ones can be accessed with the
+ * {@link Attribute#nextAttribute} field. May be {@literal null}.
+ *
+ * <p><b>WARNING</b>: this list stores the attributes in the <i>reverse</i> order of their visit.
+ * firstAttribute is actually the last attribute visited in {@link #visitAttribute}. The {@link
+ * #putMethodInfo} method writes the attributes in the order defined by this list, i.e. in the
+ * reverse order specified by the user.
+ */
+ private Attribute firstCodeAttribute;
+
+ // Other method_info attributes:
+
+ /** The number_of_exceptions field of the Exceptions attribute. */
+ private final int numberOfExceptions;
+
+ /** The exception_index_table array of the Exceptions attribute, or {@literal null}. */
+ private final int[] exceptionIndexTable;
+
+ /** The signature_index field of the Signature attribute. */
+ private final int signatureIndex;
+
+ /**
+ * The last runtime visible annotation of this method. The previous ones can be accessed with the
+ * {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeVisibleAnnotation;
+
+ /**
+ * The last runtime invisible annotation of this method. The previous ones can be accessed with
+ * the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeInvisibleAnnotation;
+
+ /** The number of method parameters that can have runtime visible annotations, or 0. */
+ private int visibleAnnotableParameterCount;
+
+ /**
+ * The runtime visible parameter annotations of this method. Each array element contains the last
+ * annotation of a parameter (which can be {@literal null} - the previous ones can be accessed
+ * with the {@link AnnotationWriter#previousAnnotation} field). May be {@literal null}.
+ */
+ private AnnotationWriter[] lastRuntimeVisibleParameterAnnotations;
+
+ /** The number of method parameters that can have runtime visible annotations, or 0. */
+ private int invisibleAnnotableParameterCount;
+
+ /**
+ * The runtime invisible parameter annotations of this method. Each array element contains the
+ * last annotation of a parameter (which can be {@literal null} - the previous ones can be
+ * accessed with the {@link AnnotationWriter#previousAnnotation} field). May be {@literal null}.
+ */
+ private AnnotationWriter[] lastRuntimeInvisibleParameterAnnotations;
- /**
- * The non standard attributes of the method.
- */
- private Attribute attrs;
+ /**
+ * The last runtime visible type annotation of this method. The previous ones can be accessed with
+ * the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeVisibleTypeAnnotation;
- /**
- * The bytecode of this method.
- */
- private ByteVector code = new ByteVector();
+ /**
+ * The last runtime invisible type annotation of this method. The previous ones can be accessed
+ * with the {@link AnnotationWriter#previousAnnotation} field. May be {@literal null}.
+ */
+ private AnnotationWriter lastRuntimeInvisibleTypeAnnotation;
- /**
- * Maximum stack size of this method.
- */
- private int maxStack;
+ /** The default_value field of the AnnotationDefault attribute, or {@literal null}. */
+ private ByteVector defaultValue;
- /**
- * Maximum number of local variables for this method.
- */
- private int maxLocals;
+ /** The parameters_count field of the MethodParameters attribute. */
+ private int parametersCount;
- /**
- * Number of local variables in the current stack map frame.
- */
- private int currentLocals;
+ /** The 'parameters' array of the MethodParameters attribute, or {@literal null}. */
+ private ByteVector parameters;
- /**
- * Number of stack map frames in the StackMapTable attribute.
- */
- private int frameCount;
+ /**
+ * The first non standard attribute of this method. The next ones can be accessed with the {@link
+ * Attribute#nextAttribute} field. May be {@literal null}.
+ *
+ * <p><b>WARNING</b>: this list stores the attributes in the <i>reverse</i> order of their visit.
+ * firstAttribute is actually the last attribute visited in {@link #visitAttribute}. The {@link
+ * #putMethodInfo} method writes the attributes in the order defined by this list, i.e. in the
+ * reverse order specified by the user.
+ */
+ private Attribute firstAttribute;
- /**
- * The StackMapTable attribute.
- */
- private ByteVector stackMap;
+ // -----------------------------------------------------------------------------------------------
+ // Fields used to compute the maximum stack size and number of locals, and the stack map frames
+ // -----------------------------------------------------------------------------------------------
- /**
- * The offset of the last frame that was written in the StackMapTable
- * attribute.
- */
- private int previousFrameOffset;
+ /**
+ * 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}.
+ */
+ private final int compute;
- /**
- * The last frame that was written in the StackMapTable attribute.
- *
- * @see #frame
- */
- private int[] previousFrame;
+ /**
+ * The first basic block of the method. The next ones (in bytecode offset order) can be accessed
+ * with the {@link Label#nextBasicBlock} field.
+ */
+ private Label firstBasicBlock;
- /**
- * The current stack map frame. The first element contains the offset of the
- * instruction to which the frame corresponds, the second element is the
- * number of locals and the third one is the number of stack elements. The
- * local variables start at index 3 and are followed by the operand stack
- * values. In summary frame[0] = offset, frame[1] = nLocal, frame[2] =
- * nStack, frame[3] = nLocal. All types are encoded as integers, with the
- * same format as the one used in {@link Label}, but limited to BASE types.
- */
- private int[] frame;
+ /**
+ * The last basic block of the method (in bytecode offset order). This field is updated each time
+ * a basic block is encountered, and is used to append it at the end of the basic block list.
+ */
+ private Label lastBasicBlock;
- /**
- * Number of elements in the exception handler list.
- */
- private int handlerCount;
+ /**
+ * The current basic block, i.e. the basic block of the last visited instruction. When {@link
+ * #compute} is equal to {@link #COMPUTE_MAX_STACK_AND_LOCAL} or {@link #COMPUTE_ALL_FRAMES}, this
+ * field is {@literal null} for unreachable code. When {@link #compute} is equal to {@link
+ * #COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES} or {@link #COMPUTE_INSERTED_FRAMES}, this field stays
+ * unchanged throughout the whole method (i.e. the whole code is seen as a single basic block;
+ * indeed, the existing frames are sufficient by hypothesis to compute any intermediate frame -
+ * and the maximum stack size as well - without using any control flow graph).
+ */
+ private Label currentBasicBlock;
- /**
- * The first element in the exception handler list.
- */
- private Handler firstHandler;
+ /**
+ * The relative stack size after the last visited instruction. This size is relative to the
+ * beginning of {@link #currentBasicBlock}, i.e. the true stack size after the last visited
+ * instruction is equal to the {@link Label#inputStackSize} of the current basic block plus {@link
+ * #relativeStackSize}. When {@link #compute} is equal to {@link
+ * #COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES}, {@link #currentBasicBlock} is always the start of
+ * the method, so this relative size is also equal to the absolute stack size after the last
+ * visited instruction.
+ */
+ private int relativeStackSize;
- /**
- * The last element in the exception handler list.
- */
- private Handler lastHandler;
+ /**
+ * The maximum relative stack size after the last visited instruction. This size is relative to
+ * the beginning of {@link #currentBasicBlock}, i.e. the true maximum stack size after the last
+ * visited instruction is equal to the {@link Label#inputStackSize} of the current basic block
+ * plus {@link #maxRelativeStackSize}.When {@link #compute} is equal to {@link
+ * #COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES}, {@link #currentBasicBlock} is always the start of
+ * the method, so this relative size is also equal to the absolute maximum stack size after the
+ * last visited instruction.
+ */
+ private int maxRelativeStackSize;
- /**
- * Number of entries in the MethodParameters attribute.
- */
- private int methodParametersCount;
+ /** The number of local variables in the last visited stack map frame. */
+ private int currentLocals;
- /**
- * The MethodParameters attribute.
- */
- private ByteVector methodParameters;
+ /** The bytecode offset of the last frame that was written in {@link #stackMapTableEntries}. */
+ private int previousFrameOffset;
- /**
- * Number of entries in the LocalVariableTable attribute.
- */
- private int localVarCount;
+ /**
+ * The last frame that was written in {@link #stackMapTableEntries}. This field has the same
+ * format as {@link #currentFrame}.
+ */
+ private int[] previousFrame;
- /**
- * The LocalVariableTable attribute.
- */
- private ByteVector localVar;
+ /**
+ * The current stack map frame. The first element contains the bytecode offset of the instruction
+ * to which the frame corresponds, the second element is the number of locals and the third one is
+ * the number of stack elements. The local variables start at index 3 and are followed by the
+ * operand stack elements. In summary frame[0] = offset, frame[1] = numLocal, frame[2] = numStack.
+ * Local variables and operand stack entries contain abstract types, as defined in {@link Frame},
+ * but restricted to {@link Frame#CONSTANT_KIND}, {@link Frame#REFERENCE_KIND} or {@link
+ * Frame#UNINITIALIZED_KIND} abstract types. Long and double types use only one array entry.
+ */
+ private int[] currentFrame;
- /**
- * Number of entries in the LocalVariableTypeTable attribute.
- */
- private int localVarTypeCount;
+ /** Whether this method contains subroutines. */
+ private boolean hasSubroutines;
- /**
- * The LocalVariableTypeTable attribute.
- */
- private ByteVector localVarType;
+ // -----------------------------------------------------------------------------------------------
+ // Other miscellaneous status fields
+ // -----------------------------------------------------------------------------------------------
- /**
- * Number of entries in the LineNumberTable attribute.
- */
- private int lineNumberCount;
+ /** Whether the bytecode of this method contains ASM specific instructions. */
+ private boolean hasAsmInstructions;
- /**
- * The LineNumberTable attribute.
- */
- private ByteVector lineNumber;
+ /**
+ * The start offset of the last visited instruction. Used to set the offset field of type
+ * annotations of type 'offset_target' (see <a
+ * href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20.1">JVMS
+ * 4.7.20.1</a>).
+ */
+ private int lastBytecodeOffset;
- /**
- * The start offset of the last visited instruction.
- */
- private int lastCodeOffset;
+ /**
+ * The offset in bytes in {@link SymbolTable#getSource} from which the method_info for this method
+ * (excluding its first 6 bytes) must be copied, or 0.
+ */
+ private int sourceOffset;
- /**
- * The runtime visible type annotations of the code. May be <tt>null</tt>.
- */
- private AnnotationWriter ctanns;
+ /**
+ * The length in bytes in {@link SymbolTable#getSource} which must be copied to get the
+ * method_info for this method (excluding its first 6 bytes for access_flags, name_index and
+ * descriptor_index).
+ */
+ private int sourceLength;
- /**
- * The runtime invisible type annotations of the code. May be <tt>null</tt>.
- */
- private AnnotationWriter ictanns;
+ // -----------------------------------------------------------------------------------------------
+ // Constructor and accessors
+ // -----------------------------------------------------------------------------------------------
- /**
- * The non standard attributes of the method's code.
- */
- private Attribute cattrs;
+ /**
+ * Constructs a new {@link MethodWriter}.
+ *
+ * @param symbolTable where the constants used in this AnnotationWriter must be stored.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param descriptor the method's descriptor (see {@link Type}).
+ * @param signature the method's signature. May be {@literal null}.
+ * @param exceptions the internal names of the method's exceptions. May be {@literal null}.
+ * @param compute indicates what must be computed (see #compute).
+ */
+ MethodWriter(
+ final SymbolTable symbolTable,
+ final int access,
+ final String name,
+ final String descriptor,
+ final String signature,
+ final String[] exceptions,
+ final int compute) {
+ super(Opcodes.ASM7);
+ this.symbolTable = symbolTable;
+ this.accessFlags = "<init>".equals(name) ? access | Constants.ACC_CONSTRUCTOR : access;
+ this.nameIndex = symbolTable.addConstantUtf8(name);
+ this.name = name;
+ this.descriptorIndex = symbolTable.addConstantUtf8(descriptor);
+ this.descriptor = descriptor;
+ this.signatureIndex = signature == null ? 0 : symbolTable.addConstantUtf8(signature);
+ if (exceptions != null && exceptions.length > 0) {
+ numberOfExceptions = exceptions.length;
+ this.exceptionIndexTable = new int[numberOfExceptions];
+ for (int i = 0; i < numberOfExceptions; ++i) {
+ this.exceptionIndexTable[i] = symbolTable.addConstantClass(exceptions[i]).index;
+ }
+ } else {
+ numberOfExceptions = 0;
+ this.exceptionIndexTable = null;
+ }
+ this.compute = compute;
+ if (compute != COMPUTE_NOTHING) {
+ // Update maxLocals and currentLocals.
+ int argumentsSize = Type.getArgumentsAndReturnSizes(descriptor) >> 2;
+ if ((access & Opcodes.ACC_STATIC) != 0) {
+ --argumentsSize;
+ }
+ maxLocals = argumentsSize;
+ currentLocals = argumentsSize;
+ // Create and visit the label for the first basic block.
+ firstBasicBlock = new Label();
+ visitLabel(firstBasicBlock);
+ }
+ }
- /**
- * Indicates if some jump instructions are too small and need to be resized.
- */
- private boolean resize;
+ boolean hasFrames() {
+ return stackMapTableNumberOfEntries > 0;
+ }
- /**
- * The number of subroutines in this method.
- */
- private int subroutines;
+ boolean hasAsmInstructions() {
+ return hasAsmInstructions;
+ }
- // ------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------
+ // Implementation of the MethodVisitor abstract class
+ // -----------------------------------------------------------------------------------------------
- /*
- * Fields for the control flow graph analysis algorithm (used to compute the
- * maximum stack size). A control flow graph contains one node per "basic
- * block", and one edge per "jump" from one basic block to another. Each
- * node (i.e., each basic block) is represented by the Label object that
- * corresponds to the first instruction of this basic block. Each node also
- * stores the list of its successors in the graph, as a linked list of Edge
- * objects.
- */
+ @Override
+ public void visitParameter(final String name, final int access) {
+ if (parameters == null) {
+ parameters = new ByteVector();
+ }
+ ++parametersCount;
+ parameters.putShort((name == null) ? 0 : symbolTable.addConstantUtf8(name)).putShort(access);
+ }
- /**
- * Indicates what must be automatically computed.
- *
- * @see #FRAMES
- * @see #MAXS
- * @see #NOTHING
- */
- private final int compute;
+ @Override
+ public AnnotationVisitor visitAnnotationDefault() {
+ defaultValue = new ByteVector();
+ return new AnnotationWriter(symbolTable, /* useNamedValues = */ false, defaultValue, null);
+ }
- /**
- * A list of labels. This list is the list of basic blocks in the method,
- * i.e. a list of Label objects linked to each other by their
- * {@link Label#successor} field, in the order they are visited by
- * {@link MethodVisitor#visitLabel}, and starting with the first basic
- * block.
- */
- private Label labels;
+ @Override
+ public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) {
+ if (visible) {
+ return lastRuntimeVisibleAnnotation =
+ AnnotationWriter.create(symbolTable, descriptor, lastRuntimeVisibleAnnotation);
+ } else {
+ return lastRuntimeInvisibleAnnotation =
+ AnnotationWriter.create(symbolTable, descriptor, lastRuntimeInvisibleAnnotation);
+ }
+ }
- /**
- * The previous basic block.
- */
- private Label previousBlock;
+ @Override
+ public AnnotationVisitor visitTypeAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (visible) {
+ return lastRuntimeVisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable, typeRef, typePath, descriptor, lastRuntimeVisibleTypeAnnotation);
+ } else {
+ return lastRuntimeInvisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable, typeRef, typePath, descriptor, lastRuntimeInvisibleTypeAnnotation);
+ }
+ }
- /**
- * The current basic block.
- */
- private Label currentBlock;
+ @Override
+ public void visitAnnotableParameterCount(final int parameterCount, final boolean visible) {
+ if (visible) {
+ visibleAnnotableParameterCount = parameterCount;
+ } else {
+ invisibleAnnotableParameterCount = parameterCount;
+ }
+ }
- /**
- * The (relative) stack size after the last visited instruction. This size
- * is relative to the beginning of the current basic block, i.e., the true
- * stack size after the last visited instruction is equal to the
- * {@link Label#inputStackTop beginStackSize} of the current basic block
- * plus <tt>stackSize</tt>.
- */
- private int stackSize;
+ @Override
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter, final String annotationDescriptor, final boolean visible) {
+ if (visible) {
+ if (lastRuntimeVisibleParameterAnnotations == null) {
+ lastRuntimeVisibleParameterAnnotations =
+ new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
+ }
+ return lastRuntimeVisibleParameterAnnotations[parameter] =
+ AnnotationWriter.create(
+ symbolTable, annotationDescriptor, lastRuntimeVisibleParameterAnnotations[parameter]);
+ } else {
+ if (lastRuntimeInvisibleParameterAnnotations == null) {
+ lastRuntimeInvisibleParameterAnnotations =
+ new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
+ }
+ return lastRuntimeInvisibleParameterAnnotations[parameter] =
+ AnnotationWriter.create(
+ symbolTable,
+ annotationDescriptor,
+ lastRuntimeInvisibleParameterAnnotations[parameter]);
+ }
+ }
- /**
- * The (relative) maximum stack size after the last visited instruction.
- * This size is relative to the beginning of the current basic block, i.e.,
- * the true maximum stack size after the last visited instruction is equal
- * to the {@link Label#inputStackTop beginStackSize} of the current basic
- * block plus <tt>stackSize</tt>.
- */
- private int maxStackSize;
+ @Override
+ public void visitAttribute(final Attribute attribute) {
+ // Store the attributes in the <i>reverse</i> order of their visit by this method.
+ if (attribute.isCodeAttribute()) {
+ attribute.nextAttribute = firstCodeAttribute;
+ firstCodeAttribute = attribute;
+ } else {
+ attribute.nextAttribute = firstAttribute;
+ firstAttribute = attribute;
+ }
+ }
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
+ @Override
+ public void visitCode() {
+ // Nothing to do.
+ }
- /**
- * Constructs a new {@link MethodWriter}.
- *
- * @param cw
- * the class writer in which the method must be added.
- * @param access
- * the method's access flags (see {@link Opcodes}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type}).
- * @param signature
- * the method's signature. May be <tt>null</tt>.
- * @param exceptions
- * the internal names of the method's exceptions. May be
- * <tt>null</tt>.
- * @param computeMaxs
- * <tt>true</tt> if the maximum stack size and number of local
- * variables must be automatically computed.
- * @param computeFrames
- * <tt>true</tt> if the stack map tables must be recomputed from
- * scratch.
- */
- MethodWriter(final ClassWriter cw, final int access, final String name,
- final String desc, final String signature,
- final String[] exceptions, final boolean computeMaxs,
- final boolean computeFrames) {
- super(Opcodes.ASM5);
- if (cw.firstMethod == null) {
- cw.firstMethod = this;
- } else {
- cw.lastMethod.mv = this;
- }
- cw.lastMethod = this;
- this.cw = cw;
- this.access = access;
- if ("<init>".equals(name)) {
- this.access |= ACC_CONSTRUCTOR;
- }
- this.name = cw.newUTF8(name);
- this.desc = cw.newUTF8(desc);
- this.descriptor = desc;
- if (ClassReader.SIGNATURES) {
- this.signature = signature;
- }
- if (exceptions != null && exceptions.length > 0) {
- exceptionCount = exceptions.length;
- this.exceptions = new int[exceptionCount];
- for (int i = 0; i < exceptionCount; ++i) {
- this.exceptions[i] = cw.newClass(exceptions[i]);
- }
- }
- this.compute = computeFrames ? FRAMES : (computeMaxs ? MAXS : NOTHING);
- if (computeMaxs || computeFrames) {
- // updates maxLocals
- int size = Type.getArgumentsAndReturnSizes(descriptor) >> 2;
- if ((access & Opcodes.ACC_STATIC) != 0) {
- --size;
- }
- maxLocals = size;
- currentLocals = size;
- // creates and visits the label for the first basic block
- labels = new Label();
- labels.status |= Label.PUSHED;
- visitLabel(labels);
- }
+ @Override
+ public void visitFrame(
+ final int type,
+ final int numLocal,
+ final Object[] local,
+ final int numStack,
+ final Object[] stack) {
+ if (compute == COMPUTE_ALL_FRAMES) {
+ return;
}
- // ------------------------------------------------------------------------
- // Implementation of the MethodVisitor abstract class
- // ------------------------------------------------------------------------
-
- @Override
- public void visitParameter(String name, int access) {
- if (methodParameters == null) {
- methodParameters = new ByteVector();
- }
- ++methodParametersCount;
- methodParameters.putShort((name == null) ? 0 : cw.newUTF8(name))
- .putShort(access);
- }
-
- @Override
- public AnnotationVisitor visitAnnotationDefault() {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- annd = new ByteVector();
- return new AnnotationWriter(cw, false, annd, null, 0);
- }
-
- @Override
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- // write type, and reserve space for values count
- bv.putShort(cw.newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
- if (visible) {
- aw.next = anns;
- anns = aw;
- } else {
- aw.next = ianns;
- ianns = aw;
- }
- return aw;
- }
-
- @Override
- public AnnotationVisitor visitTypeAnnotation(final int typeRef,
- final TypePath typePath, final String desc, final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- // write target_type and target_info
- AnnotationWriter.putTarget(typeRef, typePath, bv);
- // write type, and reserve space for values count
- bv.putShort(cw.newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv,
- bv.length - 2);
- if (visible) {
- aw.next = tanns;
- tanns = aw;
- } else {
- aw.next = itanns;
- itanns = aw;
- }
- return aw;
- }
-
- @Override
- public AnnotationVisitor visitParameterAnnotation(final int parameter,
- final String desc, final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- if ("Ljava/lang/Synthetic;".equals(desc)) {
- // workaround for a bug in javac with synthetic parameters
- // see ClassReader.readParameterAnnotations
- synthetics = Math.max(synthetics, parameter + 1);
- return new AnnotationWriter(cw, false, bv, null, 0);
- }
- // write type, and reserve space for values count
- bv.putShort(cw.newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
- if (visible) {
- if (panns == null) {
- panns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
- }
- aw.next = panns[parameter];
- panns[parameter] = aw;
- } else {
- if (ipanns == null) {
- ipanns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
- }
- aw.next = ipanns[parameter];
- ipanns[parameter] = aw;
- }
- return aw;
- }
-
- @Override
- public void visitAttribute(final Attribute attr) {
- if (attr.isCodeAttribute()) {
- attr.next = cattrs;
- cattrs = attr;
- } else {
- attr.next = attrs;
- attrs = attr;
- }
- }
-
- @Override
- public void visitCode() {
- }
-
- @Override
- public void visitFrame(final int type, final int nLocal,
- final Object[] local, final int nStack, final Object[] stack) {
- if (!ClassReader.FRAMES || compute == FRAMES) {
- return;
- }
-
+ if (compute == COMPUTE_INSERTED_FRAMES) {
+ if (currentBasicBlock.frame == null) {
+ // This should happen only once, for the implicit first frame (which is explicitly visited
+ // in ClassReader if the EXPAND_ASM_INSNS option is used - and COMPUTE_INSERTED_FRAMES
+ // can't be set if EXPAND_ASM_INSNS is not used).
+ currentBasicBlock.frame = new CurrentFrame(currentBasicBlock);
+ currentBasicBlock.frame.setInputFrameFromDescriptor(
+ symbolTable, accessFlags, descriptor, numLocal);
+ currentBasicBlock.frame.accept(this);
+ } else {
if (type == Opcodes.F_NEW) {
- if (previousFrame == null) {
- visitImplicitFirstFrame();
- }
- currentLocals = nLocal;
- int frameIndex = startFrame(code.length, nLocal, nStack);
- for (int i = 0; i < nLocal; ++i) {
- if (local[i] instanceof String) {
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType((String) local[i]);
- } else if (local[i] instanceof Integer) {
- frame[frameIndex++] = ((Integer) local[i]).intValue();
- } else {
- frame[frameIndex++] = Frame.UNINITIALIZED
- | cw.addUninitializedType("",
- ((Label) local[i]).position);
- }
- }
- for (int i = 0; i < nStack; ++i) {
- if (stack[i] instanceof String) {
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType((String) stack[i]);
- } else if (stack[i] instanceof Integer) {
- frame[frameIndex++] = ((Integer) stack[i]).intValue();
- } else {
- frame[frameIndex++] = Frame.UNINITIALIZED
- | cw.addUninitializedType("",
- ((Label) stack[i]).position);
- }
- }
- endFrame();
- } else {
- int delta;
- if (stackMap == null) {
- stackMap = new ByteVector();
- delta = code.length;
- } else {
- delta = code.length - previousFrameOffset - 1;
- if (delta < 0) {
- if (type == Opcodes.F_SAME) {
- return;
- } else {
- throw new IllegalStateException();
- }
- }
- }
-
- switch (type) {
- case Opcodes.F_FULL:
- currentLocals = nLocal;
- stackMap.putByte(FULL_FRAME).putShort(delta).putShort(nLocal);
- for (int i = 0; i < nLocal; ++i) {
- writeFrameType(local[i]);
- }
- stackMap.putShort(nStack);
- for (int i = 0; i < nStack; ++i) {
- writeFrameType(stack[i]);
- }
- break;
- case Opcodes.F_APPEND:
- currentLocals += nLocal;
- stackMap.putByte(SAME_FRAME_EXTENDED + nLocal).putShort(delta);
- for (int i = 0; i < nLocal; ++i) {
- writeFrameType(local[i]);
- }
- break;
- case Opcodes.F_CHOP:
- currentLocals -= nLocal;
- stackMap.putByte(SAME_FRAME_EXTENDED - nLocal).putShort(delta);
- break;
- case Opcodes.F_SAME:
- if (delta < 64) {
- stackMap.putByte(delta);
- } else {
- stackMap.putByte(SAME_FRAME_EXTENDED).putShort(delta);
- }
- break;
- case Opcodes.F_SAME1:
- if (delta < 64) {
- stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
- } else {
- stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
- .putShort(delta);
- }
- writeFrameType(stack[0]);
- break;
- }
-
- previousFrameOffset = code.length;
- ++frameCount;
+ currentBasicBlock.frame.setInputFrameFromApiFormat(
+ symbolTable, numLocal, local, numStack, stack);
}
-
- maxStack = Math.max(maxStack, nStack);
- maxLocals = Math.max(maxLocals, currentLocals);
- }
-
- @Override
- public void visitInsn(final int opcode) {
- lastCodeOffset = code.length;
- // adds the instruction to the bytecode of the method
- code.putByte(opcode);
- // update currentBlock
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(opcode, 0, null, null);
- } else {
- // updates current and max stack sizes
- int size = stackSize + Frame.SIZE[opcode];
- if (size > maxStackSize) {
- maxStackSize = size;
- }
- stackSize = size;
- }
- // if opcode == ATHROW or xRETURN, ends current block (no successor)
- if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN)
- || opcode == Opcodes.ATHROW) {
- noSuccessor();
- }
- }
- }
-
- @Override
- public void visitIntInsn(final int opcode, final int operand) {
- lastCodeOffset = code.length;
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(opcode, operand, null, null);
- } else if (opcode != Opcodes.NEWARRAY) {
- // updates current and max stack sizes only for NEWARRAY
- // (stack size variation = 0 for BIPUSH or SIPUSH)
- int size = stackSize + 1;
- if (size > maxStackSize) {
- maxStackSize = size;
- }
- stackSize = size;
- }
- }
- // adds the instruction to the bytecode of the method
- if (opcode == Opcodes.SIPUSH) {
- code.put12(opcode, operand);
- } else { // BIPUSH or NEWARRAY
- code.put11(opcode, operand);
- }
- }
-
- @Override
- public void visitVarInsn(final int opcode, final int var) {
- lastCodeOffset = code.length;
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(opcode, var, null, null);
- } else {
- // updates current and max stack sizes
- if (opcode == Opcodes.RET) {
- // no stack change, but end of current block (no successor)
- currentBlock.status |= Label.RET;
- // save 'stackSize' here for future use
- // (see {@link #findSubroutineSuccessors})
- currentBlock.inputStackTop = stackSize;
- noSuccessor();
- } else { // xLOAD or xSTORE
- int size = stackSize + Frame.SIZE[opcode];
- if (size > maxStackSize) {
- maxStackSize = size;
- }
- stackSize = size;
- }
- }
- }
- if (compute != NOTHING) {
- // updates max locals
- int n;
- if (opcode == Opcodes.LLOAD || opcode == Opcodes.DLOAD
- || opcode == Opcodes.LSTORE || opcode == Opcodes.DSTORE) {
- n = var + 2;
- } else {
- n = var + 1;
- }
- if (n > maxLocals) {
- maxLocals = n;
- }
- }
- // adds the instruction to the bytecode of the method
- if (var < 4 && opcode != Opcodes.RET) {
- int opt;
- if (opcode < Opcodes.ISTORE) {
- /* ILOAD_0 */
- opt = 26 + ((opcode - Opcodes.ILOAD) << 2) + var;
- } else {
- /* ISTORE_0 */
- opt = 59 + ((opcode - Opcodes.ISTORE) << 2) + var;
- }
- code.putByte(opt);
- } else if (var >= 256) {
- code.putByte(196 /* WIDE */).put12(opcode, var);
- } else {
- code.put11(opcode, var);
- }
- if (opcode >= Opcodes.ISTORE && compute == FRAMES && handlerCount > 0) {
- visitLabel(new Label());
- }
- }
-
- @Override
- public void visitTypeInsn(final int opcode, final String type) {
- lastCodeOffset = code.length;
- Item i = cw.newClassItem(type);
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(opcode, code.length, cw, i);
- } else if (opcode == Opcodes.NEW) {
- // updates current and max stack sizes only if opcode == NEW
- // (no stack change for ANEWARRAY, CHECKCAST, INSTANCEOF)
- int size = stackSize + 1;
- if (size > maxStackSize) {
- maxStackSize = size;
- }
- stackSize = size;
- }
- }
- // adds the instruction to the bytecode of the method
- code.put12(opcode, i.index);
- }
-
- @Override
- public void visitFieldInsn(final int opcode, final String owner,
- final String name, final String desc) {
- lastCodeOffset = code.length;
- Item i = cw.newFieldItem(owner, name, desc);
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(opcode, 0, cw, i);
- } else {
- int size;
- // computes the stack size variation
- char c = desc.charAt(0);
- switch (opcode) {
- case Opcodes.GETSTATIC:
- size = stackSize + (c == 'D' || c == 'J' ? 2 : 1);
- break;
- case Opcodes.PUTSTATIC:
- size = stackSize + (c == 'D' || c == 'J' ? -2 : -1);
- break;
- case Opcodes.GETFIELD:
- size = stackSize + (c == 'D' || c == 'J' ? 1 : 0);
- break;
- // case Constants.PUTFIELD:
- default:
- size = stackSize + (c == 'D' || c == 'J' ? -3 : -2);
- break;
- }
- // updates current and max stack sizes
- if (size > maxStackSize) {
- maxStackSize = size;
- }
- stackSize = size;
- }
- }
- // adds the instruction to the bytecode of the method
- code.put12(opcode, i.index);
- }
-
- @Override
- public void visitMethodInsn(final int opcode, final String owner,
- final String name, final String desc, final boolean itf) {
- lastCodeOffset = code.length;
- Item i = cw.newMethodItem(owner, name, desc, itf);
- int argSize = i.intVal;
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(opcode, 0, cw, i);
- } else {
- /*
- * computes the stack size variation. In order not to recompute
- * several times this variation for the same Item, we use the
- * intVal field of this item to store this variation, once it
- * has been computed. More precisely this intVal field stores
- * the sizes of the arguments and of the return value
- * corresponding to desc.
- */
- if (argSize == 0) {
- // the above sizes have not been computed yet,
- // so we compute them...
- argSize = Type.getArgumentsAndReturnSizes(desc);
- // ... and we save them in order
- // not to recompute them in the future
- i.intVal = argSize;
- }
- int size;
- if (opcode == Opcodes.INVOKESTATIC) {
- size = stackSize - (argSize >> 2) + (argSize & 0x03) + 1;
- } else {
- size = stackSize - (argSize >> 2) + (argSize & 0x03);
- }
- // updates current and max stack sizes
- if (size > maxStackSize) {
- maxStackSize = size;
- }
- stackSize = size;
- }
- }
- // adds the instruction to the bytecode of the method
- if (opcode == Opcodes.INVOKEINTERFACE) {
- if (argSize == 0) {
- argSize = Type.getArgumentsAndReturnSizes(desc);
- i.intVal = argSize;
- }
- code.put12(Opcodes.INVOKEINTERFACE, i.index).put11(argSize >> 2, 0);
- } else {
- code.put12(opcode, i.index);
- }
- }
-
- @Override
- public void visitInvokeDynamicInsn(final String name, final String desc,
- final Handle bsm, final Object... bsmArgs) {
- lastCodeOffset = code.length;
- Item i = cw.newInvokeDynamicItem(name, desc, bsm, bsmArgs);
- int argSize = i.intVal;
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(Opcodes.INVOKEDYNAMIC, 0, cw, i);
- } else {
- /*
- * computes the stack size variation. In order not to recompute
- * several times this variation for the same Item, we use the
- * intVal field of this item to store this variation, once it
- * has been computed. More precisely this intVal field stores
- * the sizes of the arguments and of the return value
- * corresponding to desc.
- */
- if (argSize == 0) {
- // the above sizes have not been computed yet,
- // so we compute them...
- argSize = Type.getArgumentsAndReturnSizes(desc);
- // ... and we save them in order
- // not to recompute them in the future
- i.intVal = argSize;
- }
- int size = stackSize - (argSize >> 2) + (argSize & 0x03) + 1;
-
- // updates current and max stack sizes
- if (size > maxStackSize) {
- maxStackSize = size;
- }
- stackSize = size;
- }
- }
- // adds the instruction to the bytecode of the method
- code.put12(Opcodes.INVOKEDYNAMIC, i.index);
- code.putShort(0);
- }
-
- @Override
- public void visitJumpInsn(final int opcode, final Label label) {
- lastCodeOffset = code.length;
- Label nextInsn = null;
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(opcode, 0, null, null);
- // 'label' is the target of a jump instruction
- label.getFirst().status |= Label.TARGET;
- // adds 'label' as a successor of this basic block
- addSuccessor(Edge.NORMAL, label);
- if (opcode != Opcodes.GOTO) {
- // creates a Label for the next basic block
- nextInsn = new Label();
- }
- } else {
- if (opcode == Opcodes.JSR) {
- if ((label.status & Label.SUBROUTINE) == 0) {
- label.status |= Label.SUBROUTINE;
- ++subroutines;
- }
- currentBlock.status |= Label.JSR;
- addSuccessor(stackSize + 1, label);
- // creates a Label for the next basic block
- nextInsn = new Label();
- /*
- * note that, by construction in this method, a JSR block
- * has at least two successors in the control flow graph:
- * the first one leads the next instruction after the JSR,
- * while the second one leads to the JSR target.
- */
- } else {
- // updates current stack size (max stack size unchanged
- // because stack size variation always negative in this
- // case)
- stackSize += Frame.SIZE[opcode];
- addSuccessor(stackSize, label);
- }
- }
- }
- // adds the instruction to the bytecode of the method
- if ((label.status & Label.RESOLVED) != 0
- && label.position - code.length < Short.MIN_VALUE) {
- /*
- * case of a backward jump with an offset < -32768. In this case we
- * automatically replace GOTO with GOTO_W, JSR with JSR_W and IFxxx
- * <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is the
- * "opposite" opcode of IFxxx (i.e., IFNE for IFEQ) and where <l'>
- * designates the instruction just after the GOTO_W.
- */
- if (opcode == Opcodes.GOTO) {
- code.putByte(200); // GOTO_W
- } else if (opcode == Opcodes.JSR) {
- code.putByte(201); // JSR_W
- } else {
- // if the IF instruction is transformed into IFNOT GOTO_W the
- // next instruction becomes the target of the IFNOT instruction
- if (nextInsn != null) {
- nextInsn.status |= Label.TARGET;
- }
- code.putByte(opcode <= 166 ? ((opcode + 1) ^ 1) - 1
- : opcode ^ 1);
- code.putShort(8); // jump offset
- code.putByte(200); // GOTO_W
- }
- label.put(this, code, code.length - 1, true);
- } else {
- /*
- * case of a backward jump with an offset >= -32768, or of a forward
- * jump with, of course, an unknown offset. In these cases we store
- * the offset in 2 bytes (which will be increased in
- * resizeInstructions, if needed).
- */
- code.putByte(opcode);
- label.put(this, code, code.length - 1, false);
- }
- if (currentBlock != null) {
- if (nextInsn != null) {
- // if the jump instruction is not a GOTO, the next instruction
- // is also a successor of this instruction. Calling visitLabel
- // adds the label of this next instruction as a successor of the
- // current block, and starts a new basic block
- visitLabel(nextInsn);
- }
- if (opcode == Opcodes.GOTO) {
- noSuccessor();
- }
- }
- }
-
- @Override
- public void visitLabel(final Label label) {
- // resolves previous forward references to label, if any
- resize |= label.resolve(this, code.length, code.data);
- // updates currentBlock
- if ((label.status & Label.DEBUG) != 0) {
+ // If type is not F_NEW then it is F_INSERT by hypothesis, and currentBlock.frame contains
+ // the stack map frame at the current instruction, computed from the last F_NEW frame and
+ // the bytecode instructions in between (via calls to CurrentFrame#execute).
+ currentBasicBlock.frame.accept(this);
+ }
+ } else if (type == Opcodes.F_NEW) {
+ if (previousFrame == null) {
+ int argumentsSize = Type.getArgumentsAndReturnSizes(descriptor) >> 2;
+ Frame implicitFirstFrame = new Frame(new Label());
+ implicitFirstFrame.setInputFrameFromDescriptor(
+ symbolTable, accessFlags, descriptor, argumentsSize);
+ implicitFirstFrame.accept(this);
+ }
+ currentLocals = numLocal;
+ int frameIndex = visitFrameStart(code.length, numLocal, numStack);
+ for (int i = 0; i < numLocal; ++i) {
+ currentFrame[frameIndex++] = Frame.getAbstractTypeFromApiFormat(symbolTable, local[i]);
+ }
+ for (int i = 0; i < numStack; ++i) {
+ currentFrame[frameIndex++] = Frame.getAbstractTypeFromApiFormat(symbolTable, stack[i]);
+ }
+ visitFrameEnd();
+ } else {
+ int offsetDelta;
+ if (stackMapTableEntries == null) {
+ stackMapTableEntries = new ByteVector();
+ offsetDelta = code.length;
+ } else {
+ offsetDelta = code.length - previousFrameOffset - 1;
+ if (offsetDelta < 0) {
+ if (type == Opcodes.F_SAME) {
return;
+ } else {
+ throw new IllegalStateException();
+ }
}
- if (compute == FRAMES) {
- if (currentBlock != null) {
- if (label.position == currentBlock.position) {
- // successive labels, do not start a new basic block
- currentBlock.status |= (label.status & Label.TARGET);
- label.frame = currentBlock.frame;
- return;
- }
- // ends current block (with one new successor)
- addSuccessor(Edge.NORMAL, label);
- }
- // begins a new current block
- currentBlock = label;
- if (label.frame == null) {
- label.frame = new Frame();
- label.frame.owner = label;
- }
- // updates the basic block list
- if (previousBlock != null) {
- if (label.position == previousBlock.position) {
- previousBlock.status |= (label.status & Label.TARGET);
- label.frame = previousBlock.frame;
- currentBlock = previousBlock;
- return;
- }
- previousBlock.successor = label;
- }
- previousBlock = label;
- } else if (compute == MAXS) {
- if (currentBlock != null) {
- // ends current block (with one new successor)
- currentBlock.outputStackMax = maxStackSize;
- addSuccessor(stackSize, label);
- }
- // begins a new current block
- currentBlock = label;
- // resets the relative current and max stack sizes
- stackSize = 0;
- maxStackSize = 0;
- // updates the basic block list
- if (previousBlock != null) {
- previousBlock.successor = label;
- }
- previousBlock = label;
- }
+ }
+
+ switch (type) {
+ case Opcodes.F_FULL:
+ currentLocals = numLocal;
+ stackMapTableEntries.putByte(Frame.FULL_FRAME).putShort(offsetDelta).putShort(numLocal);
+ for (int i = 0; i < numLocal; ++i) {
+ putFrameType(local[i]);
+ }
+ stackMapTableEntries.putShort(numStack);
+ for (int i = 0; i < numStack; ++i) {
+ putFrameType(stack[i]);
+ }
+ break;
+ case Opcodes.F_APPEND:
+ currentLocals += numLocal;
+ stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED + numLocal).putShort(offsetDelta);
+ for (int i = 0; i < numLocal; ++i) {
+ putFrameType(local[i]);
+ }
+ break;
+ case Opcodes.F_CHOP:
+ currentLocals -= numLocal;
+ stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED - numLocal).putShort(offsetDelta);
+ break;
+ case Opcodes.F_SAME:
+ if (offsetDelta < 64) {
+ stackMapTableEntries.putByte(offsetDelta);
+ } else {
+ stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED).putShort(offsetDelta);
+ }
+ break;
+ case Opcodes.F_SAME1:
+ if (offsetDelta < 64) {
+ stackMapTableEntries.putByte(Frame.SAME_LOCALS_1_STACK_ITEM_FRAME + offsetDelta);
+ } else {
+ stackMapTableEntries
+ .putByte(Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
+ .putShort(offsetDelta);
+ }
+ putFrameType(stack[0]);
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+
+ previousFrameOffset = code.length;
+ ++stackMapTableNumberOfEntries;
}
- @Override
- public void visitLdcInsn(final Object cst) {
- lastCodeOffset = code.length;
- Item i = cw.newConstItem(cst);
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(Opcodes.LDC, 0, cw, i);
- } else {
- int size;
- // computes the stack size variation
- if (i.type == ClassWriter.LONG || i.type == ClassWriter.DOUBLE) {
- size = stackSize + 2;
- } else {
- size = stackSize + 1;
- }
- // updates current and max stack sizes
- if (size > maxStackSize) {
- maxStackSize = size;
- }
- stackSize = size;
- }
+ if (compute == COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES) {
+ relativeStackSize = numStack;
+ for (int i = 0; i < numStack; ++i) {
+ if (stack[i] == Opcodes.LONG || stack[i] == Opcodes.DOUBLE) {
+ relativeStackSize++;
}
- // adds the instruction to the bytecode of the method
- int index = i.index;
- if (i.type == ClassWriter.LONG || i.type == ClassWriter.DOUBLE) {
- code.put12(20 /* LDC2_W */, index);
- } else if (index >= 256) {
- code.put12(19 /* LDC_W */, index);
+ }
+ if (relativeStackSize > maxRelativeStackSize) {
+ maxRelativeStackSize = relativeStackSize;
+ }
+ }
+
+ maxStack = Math.max(maxStack, numStack);
+ maxLocals = Math.max(maxLocals, currentLocals);
+ }
+
+ @Override
+ public void visitInsn(final int opcode) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ code.putByte(opcode);
+ // 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, 0, null, null);
+ } else {
+ int size = relativeStackSize + STACK_SIZE_DELTA[opcode];
+ if (size > maxRelativeStackSize) {
+ maxRelativeStackSize = size;
+ }
+ relativeStackSize = size;
+ }
+ if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN) || opcode == Opcodes.ATHROW) {
+ endCurrentBasicBlockWithNoSuccessor();
+ }
+ }
+ }
+
+ @Override
+ public void visitIntInsn(final int opcode, final int operand) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ if (opcode == Opcodes.SIPUSH) {
+ code.put12(opcode, operand);
+ } else { // BIPUSH or NEWARRAY
+ code.put11(opcode, operand);
+ }
+ // 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, operand, null, null);
+ } else if (opcode != Opcodes.NEWARRAY) {
+ // The stack size delta is 1 for BIPUSH or SIPUSH, and 0 for NEWARRAY.
+ int size = relativeStackSize + 1;
+ if (size > maxRelativeStackSize) {
+ maxRelativeStackSize = size;
+ }
+ relativeStackSize = size;
+ }
+ }
+ }
+
+ @Override
+ public void visitVarInsn(final int opcode, final int var) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ if (var < 4 && opcode != Opcodes.RET) {
+ int optimizedOpcode;
+ if (opcode < Opcodes.ISTORE) {
+ optimizedOpcode = Constants.ILOAD_0 + ((opcode - Opcodes.ILOAD) << 2) + var;
+ } else {
+ optimizedOpcode = Constants.ISTORE_0 + ((opcode - Opcodes.ISTORE) << 2) + var;
+ }
+ code.putByte(optimizedOpcode);
+ } else if (var >= 256) {
+ code.putByte(Constants.WIDE).put12(opcode, var);
+ } else {
+ code.put11(opcode, var);
+ }
+ // 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);
+ } else {
+ if (opcode == Opcodes.RET) {
+ // No stack size delta.
+ currentBasicBlock.flags |= Label.FLAG_SUBROUTINE_END;
+ currentBasicBlock.outputStackSize = (short) relativeStackSize;
+ endCurrentBasicBlockWithNoSuccessor();
+ } else { // xLOAD or xSTORE
+ int size = relativeStackSize + STACK_SIZE_DELTA[opcode];
+ if (size > maxRelativeStackSize) {
+ maxRelativeStackSize = size;
+ }
+ relativeStackSize = size;
+ }
+ }
+ }
+ if (compute != COMPUTE_NOTHING) {
+ int currentMaxLocals;
+ if (opcode == Opcodes.LLOAD
+ || opcode == Opcodes.DLOAD
+ || opcode == Opcodes.LSTORE
+ || opcode == Opcodes.DSTORE) {
+ currentMaxLocals = var + 2;
+ } else {
+ currentMaxLocals = var + 1;
+ }
+ if (currentMaxLocals > maxLocals) {
+ maxLocals = currentMaxLocals;
+ }
+ }
+ if (opcode >= Opcodes.ISTORE && compute == COMPUTE_ALL_FRAMES && firstHandler != null) {
+ // If there are exception handler blocks, each instruction within a handler range is, in
+ // theory, a basic block (since execution can jump from this instruction to the exception
+ // handler). As a consequence, the local variable types at the beginning of the handler
+ // block should be the merge of the local variable types at all the instructions within the
+ // handler range. However, instead of creating a basic block for each instruction, we can
+ // get the same result in a more efficient way. Namely, by starting a new basic block after
+ // each xSTORE instruction, which is what we do here.
+ visitLabel(new Label());
+ }
+ }
+
+ @Override
+ public void visitTypeInsn(final int opcode, final String type) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ Symbol typeSymbol = symbolTable.addConstantClass(type);
+ code.put12(opcode, typeSymbol.index);
+ // 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, lastBytecodeOffset, typeSymbol, symbolTable);
+ } else if (opcode == Opcodes.NEW) {
+ // The stack size delta is 1 for NEW, and 0 for ANEWARRAY, CHECKCAST, or INSTANCEOF.
+ int size = relativeStackSize + 1;
+ if (size > maxRelativeStackSize) {
+ maxRelativeStackSize = size;
+ }
+ relativeStackSize = size;
+ }
+ }
+ }
+
+ @Override
+ public void visitFieldInsn(
+ final int opcode, final String owner, final String name, final String descriptor) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ Symbol fieldrefSymbol = symbolTable.addConstantFieldref(owner, name, descriptor);
+ code.put12(opcode, fieldrefSymbol.index);
+ // 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, 0, fieldrefSymbol, symbolTable);
+ } else {
+ int size;
+ char firstDescChar = descriptor.charAt(0);
+ switch (opcode) {
+ case Opcodes.GETSTATIC:
+ size = relativeStackSize + (firstDescChar == 'D' || firstDescChar == 'J' ? 2 : 1);
+ break;
+ case Opcodes.PUTSTATIC:
+ size = relativeStackSize + (firstDescChar == 'D' || firstDescChar == 'J' ? -2 : -1);
+ break;
+ case Opcodes.GETFIELD:
+ size = relativeStackSize + (firstDescChar == 'D' || firstDescChar == 'J' ? 1 : 0);
+ break;
+ case Opcodes.PUTFIELD:
+ default:
+ size = relativeStackSize + (firstDescChar == 'D' || firstDescChar == 'J' ? -3 : -2);
+ break;
+ }
+ if (size > maxRelativeStackSize) {
+ maxRelativeStackSize = size;
+ }
+ relativeStackSize = size;
+ }
+ }
+ }
+
+ @Override
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String descriptor,
+ final boolean isInterface) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ Symbol methodrefSymbol = symbolTable.addConstantMethodref(owner, name, descriptor, isInterface);
+ if (opcode == Opcodes.INVOKEINTERFACE) {
+ code.put12(Opcodes.INVOKEINTERFACE, methodrefSymbol.index)
+ .put11(methodrefSymbol.getArgumentsAndReturnSizes() >> 2, 0);
+ } else {
+ code.put12(opcode, methodrefSymbol.index);
+ }
+ // 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, 0, methodrefSymbol, symbolTable);
+ } else {
+ int argumentsAndReturnSize = methodrefSymbol.getArgumentsAndReturnSizes();
+ int stackSizeDelta = (argumentsAndReturnSize & 3) - (argumentsAndReturnSize >> 2);
+ int size;
+ if (opcode == Opcodes.INVOKESTATIC) {
+ size = relativeStackSize + stackSizeDelta + 1;
} else {
- code.put11(Opcodes.LDC, index);
+ size = relativeStackSize + stackSizeDelta;
}
+ if (size > maxRelativeStackSize) {
+ maxRelativeStackSize = size;
+ }
+ relativeStackSize = size;
+ }
+ }
+ }
+
+ @Override
+ public void visitInvokeDynamicInsn(
+ final String name,
+ final String descriptor,
+ final Handle bootstrapMethodHandle,
+ final Object... bootstrapMethodArguments) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ Symbol invokeDynamicSymbol =
+ symbolTable.addConstantInvokeDynamic(
+ name, descriptor, bootstrapMethodHandle, bootstrapMethodArguments);
+ code.put12(Opcodes.INVOKEDYNAMIC, invokeDynamicSymbol.index);
+ code.putShort(0);
+ // 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(Opcodes.INVOKEDYNAMIC, 0, invokeDynamicSymbol, symbolTable);
+ } else {
+ int argumentsAndReturnSize = invokeDynamicSymbol.getArgumentsAndReturnSizes();
+ int stackSizeDelta = (argumentsAndReturnSize & 3) - (argumentsAndReturnSize >> 2) + 1;
+ int size = relativeStackSize + stackSizeDelta;
+ if (size > maxRelativeStackSize) {
+ maxRelativeStackSize = size;
+ }
+ relativeStackSize = size;
+ }
+ }
+ }
+
+ @Override
+ public void visitJumpInsn(final int opcode, final Label label) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ // Compute the 'base' opcode, i.e. GOTO or JSR if opcode is GOTO_W or JSR_W, otherwise opcode.
+ int baseOpcode =
+ opcode >= Constants.GOTO_W ? opcode - Constants.WIDE_JUMP_OPCODE_DELTA : opcode;
+ boolean nextInsnIsJumpTarget = false;
+ if ((label.flags & Label.FLAG_RESOLVED) != 0
+ && label.bytecodeOffset - code.length < Short.MIN_VALUE) {
+ // Case of a backward jump with an offset < -32768. In this case we automatically replace GOTO
+ // with GOTO_W, JSR with JSR_W and IFxxx <l> with IFNOTxxx <L> GOTO_W <l> L:..., where
+ // IFNOTxxx is the "opposite" opcode of IFxxx (e.g. IFNE for IFEQ) and where <L> designates
+ // the instruction just after the GOTO_W.
+ if (baseOpcode == Opcodes.GOTO) {
+ code.putByte(Constants.GOTO_W);
+ } else if (baseOpcode == Opcodes.JSR) {
+ code.putByte(Constants.JSR_W);
+ } else {
+ // Put the "opposite" opcode of baseOpcode. This can be done by flipping the least
+ // significant bit for IFNULL and IFNONNULL, and similarly for IFEQ ... IF_ACMPEQ (with a
+ // pre and post offset by 1). The jump offset is 8 bytes (3 for IFNOTxxx, 5 for GOTO_W).
+ code.putByte(baseOpcode >= Opcodes.IFNULL ? baseOpcode ^ 1 : ((baseOpcode + 1) ^ 1) - 1);
+ code.putShort(8);
+ // Here we could put a GOTO_W in theory, but if ASM specific instructions are used in this
+ // method or another one, and if the class has frames, we will need to insert a frame after
+ // this GOTO_W during the additional ClassReader -> ClassWriter round trip to remove the ASM
+ // specific instructions. To not miss this additional frame, we need to use an ASM_GOTO_W
+ // here, which has the unfortunate effect of forcing this additional round trip (which in
+ // some case would not have been really necessary, but we can't know this at this point).
+ code.putByte(Constants.ASM_GOTO_W);
+ hasAsmInstructions = true;
+ // The instruction after the GOTO_W becomes the target of the IFNOT instruction.
+ nextInsnIsJumpTarget = true;
+ }
+ label.put(code, code.length - 1, true);
+ } else if (baseOpcode != opcode) {
+ // Case of a GOTO_W or JSR_W specified by the user (normally ClassReader when used to remove
+ // ASM specific instructions). In this case we keep the original instruction.
+ code.putByte(opcode);
+ label.put(code, code.length - 1, true);
+ } else {
+ // Case of a jump with an offset >= -32768, or of a jump with an unknown offset. In these
+ // cases we store the offset in 2 bytes (which will be increased via a ClassReader ->
+ // ClassWriter round trip if it turns out that 2 bytes are not sufficient).
+ code.putByte(baseOpcode);
+ label.put(code, code.length - 1, false);
}
- @Override
- public void visitIincInsn(final int var, final int increment) {
- lastCodeOffset = code.length;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(Opcodes.IINC, var, null, null);
- }
+ // If needed, update the maximum stack size and number of locals, and stack map frames.
+ if (currentBasicBlock != null) {
+ Label nextBasicBlock = null;
+ if (compute == COMPUTE_ALL_FRAMES) {
+ currentBasicBlock.frame.execute(baseOpcode, 0, null, null);
+ // Record the fact that 'label' is the target of a jump instruction.
+ label.getCanonicalInstance().flags |= Label.FLAG_JUMP_TARGET;
+ // Add 'label' as a successor of the current basic block.
+ addSuccessorToCurrentBasicBlock(Edge.JUMP, label);
+ if (baseOpcode != Opcodes.GOTO) {
+ // The next instruction starts a new basic block (except for GOTO: by default the code
+ // following a goto is unreachable - unless there is an explicit label for it - and we
+ // should not compute stack frame types for its instructions).
+ nextBasicBlock = new Label();
}
- if (compute != NOTHING) {
- // updates max locals
- int n = var + 1;
- if (n > maxLocals) {
- maxLocals = n;
- }
- }
- // adds the instruction to the bytecode of the method
- if ((var > 255) || (increment > 127) || (increment < -128)) {
- code.putByte(196 /* WIDE */).put12(Opcodes.IINC, var)
- .putShort(increment);
+ } else if (compute == COMPUTE_INSERTED_FRAMES) {
+ currentBasicBlock.frame.execute(baseOpcode, 0, null, null);
+ } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES) {
+ // No need to update maxRelativeStackSize (the stack size delta is always negative).
+ relativeStackSize += STACK_SIZE_DELTA[baseOpcode];
+ } else {
+ if (baseOpcode == Opcodes.JSR) {
+ // Record the fact that 'label' designates a subroutine, if not already done.
+ if ((label.flags & Label.FLAG_SUBROUTINE_START) == 0) {
+ label.flags |= Label.FLAG_SUBROUTINE_START;
+ hasSubroutines = true;
+ }
+ currentBasicBlock.flags |= Label.FLAG_SUBROUTINE_CALLER;
+ // Note that, by construction in this method, a block which calls a subroutine has at
+ // least two successors in the control flow graph: the first one (added below) leads to
+ // the instruction after the JSR, while the second one (added here) leads to the JSR
+ // target. Note that the first successor is virtual (it does not correspond to a possible
+ // execution path): it is only used to compute the successors of the basic blocks ending
+ // with a ret, in {@link Label#addSubroutineRetSuccessors}.
+ addSuccessorToCurrentBasicBlock(relativeStackSize + 1, label);
+ // The instruction after the JSR starts a new basic block.
+ nextBasicBlock = new Label();
} else {
- code.putByte(Opcodes.IINC).put11(var, increment);
+ // No need to update maxRelativeStackSize (the stack size delta is always negative).
+ relativeStackSize += STACK_SIZE_DELTA[baseOpcode];
+ addSuccessorToCurrentBasicBlock(relativeStackSize, label);
}
+ }
+ // If the next instruction starts a new basic block, call visitLabel to add the label of this
+ // instruction as a successor of the current block, and to start a new basic block.
+ if (nextBasicBlock != null) {
+ if (nextInsnIsJumpTarget) {
+ nextBasicBlock.flags |= Label.FLAG_JUMP_TARGET;
+ }
+ visitLabel(nextBasicBlock);
+ }
+ if (baseOpcode == Opcodes.GOTO) {
+ endCurrentBasicBlockWithNoSuccessor();
+ }
+ }
+ }
+
+ @Override
+ public void visitLabel(final Label label) {
+ // Resolve the forward references to this label, if any.
+ hasAsmInstructions |= label.resolve(code.data, code.length);
+ // visitLabel starts a new basic block (except for debug only labels), so we need to update the
+ // previous and current block references and list of successors.
+ if ((label.flags & Label.FLAG_DEBUG_ONLY) != 0) {
+ return;
+ }
+ if (compute == COMPUTE_ALL_FRAMES) {
+ if (currentBasicBlock != null) {
+ if (label.bytecodeOffset == currentBasicBlock.bytecodeOffset) {
+ // We use {@link Label#getCanonicalInstance} to store the state of a basic block in only
+ // one place, but this does not work for labels which have not been visited yet.
+ // Therefore, when we detect here two labels having the same bytecode offset, we need to
+ // - consolidate the state scattered in these two instances into the canonical instance:
+ currentBasicBlock.flags |= (label.flags & Label.FLAG_JUMP_TARGET);
+ // - make sure the two instances share the same Frame instance (the implementation of
+ // {@link Label#getCanonicalInstance} relies on this property; here label.frame should be
+ // null):
+ label.frame = currentBasicBlock.frame;
+ // - and make sure to NOT assign 'label' into 'currentBasicBlock' or 'lastBasicBlock', so
+ // that they still refer to the canonical instance for this bytecode offset.
+ return;
+ }
+ // End the current basic block (with one new successor).
+ addSuccessorToCurrentBasicBlock(Edge.JUMP, label);
+ }
+ // Append 'label' at the end of the basic block list.
+ if (lastBasicBlock != null) {
+ if (label.bytecodeOffset == lastBasicBlock.bytecodeOffset) {
+ // Same comment as above.
+ lastBasicBlock.flags |= (label.flags & Label.FLAG_JUMP_TARGET);
+ // Here label.frame should be null.
+ label.frame = lastBasicBlock.frame;
+ currentBasicBlock = lastBasicBlock;
+ return;
+ }
+ lastBasicBlock.nextBasicBlock = label;
+ }
+ lastBasicBlock = label;
+ // Make it the new current basic block.
+ currentBasicBlock = label;
+ // Here label.frame should be null.
+ label.frame = new Frame(label);
+ } else if (compute == COMPUTE_INSERTED_FRAMES) {
+ if (currentBasicBlock == null) {
+ // This case should happen only once, for the visitLabel call in the constructor. Indeed, if
+ // compute is equal to COMPUTE_INSERTED_FRAMES, currentBasicBlock stays unchanged.
+ currentBasicBlock = label;
+ } else {
+ // Update the frame owner so that a correct frame offset is computed in Frame.accept().
+ currentBasicBlock.frame.owner = label;
+ }
+ } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL) {
+ if (currentBasicBlock != null) {
+ // End the current basic block (with one new successor).
+ currentBasicBlock.outputStackMax = (short) maxRelativeStackSize;
+ addSuccessorToCurrentBasicBlock(relativeStackSize, label);
+ }
+ // Start a new current basic block, and reset the current and maximum relative stack sizes.
+ currentBasicBlock = label;
+ relativeStackSize = 0;
+ maxRelativeStackSize = 0;
+ // Append the new basic block at the end of the basic block list.
+ if (lastBasicBlock != null) {
+ lastBasicBlock.nextBasicBlock = label;
+ }
+ lastBasicBlock = label;
+ } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES && currentBasicBlock == null) {
+ // This case should happen only once, for the visitLabel call in the constructor. Indeed, if
+ // compute is equal to COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES, currentBasicBlock stays
+ // unchanged.
+ currentBasicBlock = label;
+ }
+ }
+
+ @Override
+ public void visitLdcInsn(final Object value) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ Symbol constantSymbol = symbolTable.addConstant(value);
+ int constantIndex = constantSymbol.index;
+ char firstDescriptorChar;
+ boolean isLongOrDouble =
+ constantSymbol.tag == Symbol.CONSTANT_LONG_TAG
+ || constantSymbol.tag == Symbol.CONSTANT_DOUBLE_TAG
+ || (constantSymbol.tag == Symbol.CONSTANT_DYNAMIC_TAG
+ && ((firstDescriptorChar = constantSymbol.value.charAt(0)) == 'J'
+ || firstDescriptorChar == 'D'));
+ if (isLongOrDouble) {
+ code.put12(Constants.LDC2_W, constantIndex);
+ } else if (constantIndex >= 256) {
+ code.put12(Constants.LDC_W, constantIndex);
+ } else {
+ code.put11(Opcodes.LDC, constantIndex);
+ }
+ // 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(Opcodes.LDC, 0, constantSymbol, symbolTable);
+ } else {
+ int size = relativeStackSize + (isLongOrDouble ? 2 : 1);
+ if (size > maxRelativeStackSize) {
+ maxRelativeStackSize = size;
+ }
+ relativeStackSize = size;
+ }
+ }
+ }
+
+ @Override
+ public void visitIincInsn(final int var, 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);
+ } else {
+ code.putByte(Opcodes.IINC).put11(var, 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);
+ }
+ if (compute != COMPUTE_NOTHING) {
+ int currentMaxLocals = var + 1;
+ if (currentMaxLocals > maxLocals) {
+ maxLocals = currentMaxLocals;
+ }
+ }
+ }
+
+ @Override
+ public void visitTableSwitchInsn(
+ final int min, final int max, final Label dflt, final Label... labels) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ code.putByte(Opcodes.TABLESWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
+ dflt.put(code, lastBytecodeOffset, true);
+ code.putInt(min).putInt(max);
+ for (Label label : labels) {
+ label.put(code, lastBytecodeOffset, true);
+ }
+ // If needed, update the maximum stack size and number of locals, and stack map frames.
+ visitSwitchInsn(dflt, labels);
+ }
+
+ @Override
+ public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ code.putByte(Opcodes.LOOKUPSWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
+ dflt.put(code, lastBytecodeOffset, true);
+ code.putInt(labels.length);
+ for (int i = 0; i < labels.length; ++i) {
+ code.putInt(keys[i]);
+ labels[i].put(code, lastBytecodeOffset, true);
+ }
+ // If needed, update the maximum stack size and number of locals, and stack map frames.
+ visitSwitchInsn(dflt, labels);
+ }
+
+ private void visitSwitchInsn(final Label dflt, final Label[] labels) {
+ if (currentBasicBlock != null) {
+ if (compute == COMPUTE_ALL_FRAMES) {
+ currentBasicBlock.frame.execute(Opcodes.LOOKUPSWITCH, 0, null, null);
+ // Add all the labels as successors of the current basic block.
+ addSuccessorToCurrentBasicBlock(Edge.JUMP, dflt);
+ dflt.getCanonicalInstance().flags |= Label.FLAG_JUMP_TARGET;
+ for (Label label : labels) {
+ addSuccessorToCurrentBasicBlock(Edge.JUMP, label);
+ label.getCanonicalInstance().flags |= Label.FLAG_JUMP_TARGET;
+ }
+ } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL) {
+ // No need to update maxRelativeStackSize (the stack size delta is always negative).
+ --relativeStackSize;
+ // Add all the labels as successors of the current basic block.
+ addSuccessorToCurrentBasicBlock(relativeStackSize, dflt);
+ for (Label label : labels) {
+ addSuccessorToCurrentBasicBlock(relativeStackSize, label);
+ }
+ }
+ // End the current basic block.
+ endCurrentBasicBlockWithNoSuccessor();
+ }
+ }
+
+ @Override
+ public void visitMultiANewArrayInsn(final String descriptor, final int numDimensions) {
+ lastBytecodeOffset = code.length;
+ // Add the instruction to the bytecode of the method.
+ Symbol descSymbol = symbolTable.addConstantClass(descriptor);
+ code.put12(Opcodes.MULTIANEWARRAY, descSymbol.index).putByte(numDimensions);
+ // 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(
+ Opcodes.MULTIANEWARRAY, numDimensions, descSymbol, symbolTable);
+ } else {
+ // No need to update maxRelativeStackSize (the stack size delta is always negative).
+ relativeStackSize += 1 - numDimensions;
+ }
+ }
+ }
+
+ @Override
+ public AnnotationVisitor visitInsnAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (visible) {
+ return lastCodeRuntimeVisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable,
+ (typeRef & 0xFF0000FF) | (lastBytecodeOffset << 8),
+ typePath,
+ descriptor,
+ lastCodeRuntimeVisibleTypeAnnotation);
+ } else {
+ return lastCodeRuntimeInvisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable,
+ (typeRef & 0xFF0000FF) | (lastBytecodeOffset << 8),
+ typePath,
+ descriptor,
+ lastCodeRuntimeInvisibleTypeAnnotation);
+ }
+ }
+
+ @Override
+ public void visitTryCatchBlock(
+ final Label start, final Label end, final Label handler, final String type) {
+ Handler newHandler =
+ new Handler(
+ start, end, handler, type != null ? symbolTable.addConstantClass(type).index : 0, type);
+ if (firstHandler == null) {
+ firstHandler = newHandler;
+ } else {
+ lastHandler.nextHandler = newHandler;
+ }
+ lastHandler = newHandler;
+ }
+
+ @Override
+ public AnnotationVisitor visitTryCatchAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ if (visible) {
+ return lastCodeRuntimeVisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable, typeRef, typePath, descriptor, lastCodeRuntimeVisibleTypeAnnotation);
+ } else {
+ return lastCodeRuntimeInvisibleTypeAnnotation =
+ AnnotationWriter.create(
+ symbolTable, typeRef, typePath, descriptor, lastCodeRuntimeInvisibleTypeAnnotation);
+ }
+ }
+
+ @Override
+ public void visitLocalVariable(
+ final String name,
+ final String descriptor,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index) {
+ if (signature != null) {
+ if (localVariableTypeTable == null) {
+ localVariableTypeTable = new ByteVector();
+ }
+ ++localVariableTypeTableLength;
+ localVariableTypeTable
+ .putShort(start.bytecodeOffset)
+ .putShort(end.bytecodeOffset - start.bytecodeOffset)
+ .putShort(symbolTable.addConstantUtf8(name))
+ .putShort(symbolTable.addConstantUtf8(signature))
+ .putShort(index);
+ }
+ if (localVariableTable == null) {
+ localVariableTable = new ByteVector();
+ }
+ ++localVariableTableLength;
+ localVariableTable
+ .putShort(start.bytecodeOffset)
+ .putShort(end.bytecodeOffset - start.bytecodeOffset)
+ .putShort(symbolTable.addConstantUtf8(name))
+ .putShort(symbolTable.addConstantUtf8(descriptor))
+ .putShort(index);
+ if (compute != COMPUTE_NOTHING) {
+ char firstDescChar = descriptor.charAt(0);
+ int currentMaxLocals = index + (firstDescChar == 'J' || firstDescChar == 'D' ? 2 : 1);
+ if (currentMaxLocals > maxLocals) {
+ maxLocals = currentMaxLocals;
+ }
+ }
+ }
+
+ @Override
+ public AnnotationVisitor visitLocalVariableAnnotation(
+ final int typeRef,
+ final TypePath typePath,
+ final Label[] start,
+ final Label[] end,
+ final int[] index,
+ final String descriptor,
+ final boolean visible) {
+ // Create a ByteVector to hold a 'type_annotation' JVMS structure.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20.
+ ByteVector typeAnnotation = new ByteVector();
+ // Write target_type, target_info, and target_path.
+ typeAnnotation.putByte(typeRef >>> 24).putShort(start.length);
+ for (int i = 0; i < start.length; ++i) {
+ typeAnnotation
+ .putShort(start[i].bytecodeOffset)
+ .putShort(end[i].bytecodeOffset - start[i].bytecodeOffset)
+ .putShort(index[i]);
+ }
+ TypePath.put(typePath, typeAnnotation);
+ // Write type_index and reserve space for num_element_value_pairs.
+ typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0);
+ if (visible) {
+ return lastCodeRuntimeVisibleTypeAnnotation =
+ new AnnotationWriter(
+ symbolTable,
+ /* useNamedValues = */ true,
+ typeAnnotation,
+ lastCodeRuntimeVisibleTypeAnnotation);
+ } else {
+ return lastCodeRuntimeInvisibleTypeAnnotation =
+ new AnnotationWriter(
+ symbolTable,
+ /* useNamedValues = */ true,
+ typeAnnotation,
+ lastCodeRuntimeInvisibleTypeAnnotation);
+ }
+ }
+
+ @Override
+ public void visitLineNumber(final int line, final Label start) {
+ if (lineNumberTable == null) {
+ lineNumberTable = new ByteVector();
+ }
+ ++lineNumberTableLength;
+ lineNumberTable.putShort(start.bytecodeOffset);
+ lineNumberTable.putShort(line);
+ }
+
+ @Override
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ if (compute == COMPUTE_ALL_FRAMES) {
+ computeAllFrames();
+ } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL) {
+ computeMaxStackAndLocal();
+ } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES) {
+ this.maxStack = maxRelativeStackSize;
+ } else {
+ this.maxStack = maxStack;
+ this.maxLocals = maxLocals;
+ }
+ }
+
+ /** Computes all the stack map frames of the method, from scratch. */
+ private void computeAllFrames() {
+ // Complete the control flow graph with exception handler blocks.
+ Handler handler = firstHandler;
+ while (handler != null) {
+ String catchTypeDescriptor =
+ handler.catchTypeDescriptor == null ? "java/lang/Throwable" : handler.catchTypeDescriptor;
+ int catchType = Frame.getAbstractTypeFromInternalName(symbolTable, catchTypeDescriptor);
+ // Mark handlerBlock as an exception handler.
+ Label handlerBlock = handler.handlerPc.getCanonicalInstance();
+ handlerBlock.flags |= Label.FLAG_JUMP_TARGET;
+ // Add handlerBlock as a successor of all the basic blocks in the exception handler range.
+ Label handlerRangeBlock = handler.startPc.getCanonicalInstance();
+ Label handlerRangeEnd = handler.endPc.getCanonicalInstance();
+ while (handlerRangeBlock != handlerRangeEnd) {
+ handlerRangeBlock.outgoingEdges =
+ new Edge(catchType, handlerBlock, handlerRangeBlock.outgoingEdges);
+ handlerRangeBlock = handlerRangeBlock.nextBasicBlock;
+ }
+ handler = handler.nextHandler;
}
- @Override
- public void visitTableSwitchInsn(final int min, final int max,
- final Label dflt, final Label... labels) {
- lastCodeOffset = code.length;
- // adds the instruction to the bytecode of the method
- int source = code.length;
- code.putByte(Opcodes.TABLESWITCH);
- code.putByteArray(null, 0, (4 - code.length % 4) % 4);
- dflt.put(this, code, source, true);
- code.putInt(min).putInt(max);
- for (int i = 0; i < labels.length; ++i) {
- labels[i].put(this, code, source, true);
+ // Create and visit the first (implicit) frame.
+ Frame firstFrame = firstBasicBlock.frame;
+ firstFrame.setInputFrameFromDescriptor(symbolTable, accessFlags, descriptor, this.maxLocals);
+ firstFrame.accept(this);
+
+ // Fix point algorithm: add the first basic block to a list of blocks to process (i.e. blocks
+ // whose stack map frame has changed) and, while there are blocks to process, remove one from
+ // the list and update the stack map frames of its successor blocks in the control flow graph
+ // (which might change them, in which case these blocks must be processed too, and are thus
+ // added to the list of blocks to process). Also compute the maximum stack size of the method,
+ // as a by-product.
+ Label listOfBlocksToProcess = firstBasicBlock;
+ listOfBlocksToProcess.nextListElement = Label.EMPTY_LIST;
+ int maxStackSize = 0;
+ while (listOfBlocksToProcess != Label.EMPTY_LIST) {
+ // Remove a basic block from the list of blocks to process.
+ Label basicBlock = listOfBlocksToProcess;
+ listOfBlocksToProcess = listOfBlocksToProcess.nextListElement;
+ basicBlock.nextListElement = null;
+ // By definition, basicBlock is reachable.
+ basicBlock.flags |= Label.FLAG_REACHABLE;
+ // Update the (absolute) maximum stack size.
+ int maxBlockStackSize = basicBlock.frame.getInputStackSize() + basicBlock.outputStackMax;
+ if (maxBlockStackSize > maxStackSize) {
+ maxStackSize = maxBlockStackSize;
+ }
+ // Update the successor blocks of basicBlock in the control flow graph.
+ Edge outgoingEdge = basicBlock.outgoingEdges;
+ while (outgoingEdge != null) {
+ Label successorBlock = outgoingEdge.successor.getCanonicalInstance();
+ boolean successorBlockChanged =
+ basicBlock.frame.merge(symbolTable, successorBlock.frame, outgoingEdge.info);
+ if (successorBlockChanged && successorBlock.nextListElement == null) {
+ // If successorBlock has changed it must be processed. Thus, if it is not already in the
+ // list of blocks to process, add it to this list.
+ successorBlock.nextListElement = listOfBlocksToProcess;
+ listOfBlocksToProcess = successorBlock;
}
- // updates currentBlock
- visitSwitchInsn(dflt, labels);
+ outgoingEdge = outgoingEdge.nextEdge;
+ }
}
- @Override
- public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
- final Label[] labels) {
- lastCodeOffset = code.length;
- // adds the instruction to the bytecode of the method
- int source = code.length;
- code.putByte(Opcodes.LOOKUPSWITCH);
- code.putByteArray(null, 0, (4 - code.length % 4) % 4);
- dflt.put(this, code, source, true);
- code.putInt(labels.length);
- for (int i = 0; i < labels.length; ++i) {
- code.putInt(keys[i]);
- labels[i].put(this, code, source, true);
+ // Loop over all the basic blocks and visit the stack map frames that must be stored in the
+ // StackMapTable attribute. Also replace unreachable code with NOP* ATHROW, and remove it from
+ // exception handler ranges.
+ Label basicBlock = firstBasicBlock;
+ while (basicBlock != null) {
+ if ((basicBlock.flags & (Label.FLAG_JUMP_TARGET | Label.FLAG_REACHABLE))
+ == (Label.FLAG_JUMP_TARGET | Label.FLAG_REACHABLE)) {
+ basicBlock.frame.accept(this);
+ }
+ if ((basicBlock.flags & Label.FLAG_REACHABLE) == 0) {
+ // Find the start and end bytecode offsets of this unreachable block.
+ Label nextBasicBlock = basicBlock.nextBasicBlock;
+ int startOffset = basicBlock.bytecodeOffset;
+ int endOffset = (nextBasicBlock == null ? code.length : nextBasicBlock.bytecodeOffset) - 1;
+ if (endOffset >= startOffset) {
+ // Replace its instructions with NOP ... NOP ATHROW.
+ for (int i = startOffset; i < endOffset; ++i) {
+ code.data[i] = Opcodes.NOP;
+ }
+ code.data[endOffset] = (byte) Opcodes.ATHROW;
+ // Emit a frame for this unreachable block, with no local and a Throwable on the stack
+ // (so that the ATHROW could consume this Throwable if it were reachable).
+ int frameIndex = visitFrameStart(startOffset, /* numLocal = */ 0, /* numStack = */ 1);
+ currentFrame[frameIndex] =
+ Frame.getAbstractTypeFromInternalName(symbolTable, "java/lang/Throwable");
+ visitFrameEnd();
+ // Remove this unreachable basic block from the exception handler ranges.
+ firstHandler = Handler.removeRange(firstHandler, basicBlock, nextBasicBlock);
+ // The maximum stack size is now at least one, because of the Throwable declared above.
+ maxStackSize = Math.max(maxStackSize, 1);
}
- // updates currentBlock
- visitSwitchInsn(dflt, labels);
+ }
+ basicBlock = basicBlock.nextBasicBlock;
}
- private void visitSwitchInsn(final Label dflt, final Label[] labels) {
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(Opcodes.LOOKUPSWITCH, 0, null, null);
- // adds current block successors
- addSuccessor(Edge.NORMAL, dflt);
- dflt.getFirst().status |= Label.TARGET;
- for (int i = 0; i < labels.length; ++i) {
- addSuccessor(Edge.NORMAL, labels[i]);
- labels[i].getFirst().status |= Label.TARGET;
- }
- } else {
- // updates current stack size (max stack size unchanged)
- --stackSize;
- // adds current block successors
- addSuccessor(stackSize, dflt);
- for (int i = 0; i < labels.length; ++i) {
- addSuccessor(stackSize, labels[i]);
- }
- }
- // ends current block
- noSuccessor();
- }
- }
+ this.maxStack = maxStackSize;
+ }
- @Override
- public void visitMultiANewArrayInsn(final String desc, final int dims) {
- lastCodeOffset = code.length;
- Item i = cw.newClassItem(desc);
- // Label currentBlock = this.currentBlock;
- if (currentBlock != null) {
- if (compute == FRAMES) {
- currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
- } else {
- // updates current stack size (max stack size unchanged because
- // stack size variation always negative or null)
- stackSize += 1 - dims;
- }
- }
- // adds the instruction to the bytecode of the method
- code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
- }
-
- @Override
- public AnnotationVisitor visitInsnAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- // write target_type and target_info
- typeRef = (typeRef & 0xFF0000FF) | (lastCodeOffset << 8);
- AnnotationWriter.putTarget(typeRef, typePath, bv);
- // write type, and reserve space for values count
- bv.putShort(cw.newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv,
- bv.length - 2);
- if (visible) {
- aw.next = ctanns;
- ctanns = aw;
+ /** Computes the maximum stack size of the method. */
+ private void computeMaxStackAndLocal() {
+ // Complete the control flow graph with exception handler blocks.
+ Handler handler = firstHandler;
+ while (handler != null) {
+ Label handlerBlock = handler.handlerPc;
+ Label handlerRangeBlock = handler.startPc;
+ Label handlerRangeEnd = handler.endPc;
+ // Add handlerBlock as a successor of all the basic blocks in the exception handler range.
+ while (handlerRangeBlock != handlerRangeEnd) {
+ if ((handlerRangeBlock.flags & Label.FLAG_SUBROUTINE_CALLER) == 0) {
+ handlerRangeBlock.outgoingEdges =
+ new Edge(Edge.EXCEPTION, handlerBlock, handlerRangeBlock.outgoingEdges);
} else {
- aw.next = ictanns;
- ictanns = aw;
+ // If handlerRangeBlock is a JSR block, add handlerBlock after the first two outgoing
+ // edges to preserve the hypothesis about JSR block successors order (see
+ // {@link #visitJumpInsn}).
+ handlerRangeBlock.outgoingEdges.nextEdge.nextEdge =
+ new Edge(
+ Edge.EXCEPTION, handlerBlock, handlerRangeBlock.outgoingEdges.nextEdge.nextEdge);
}
- return aw;
+ handlerRangeBlock = handlerRangeBlock.nextBasicBlock;
+ }
+ handler = handler.nextHandler;
}
- @Override
- public void visitTryCatchBlock(final Label start, final Label end,
- final Label handler, final String type) {
- ++handlerCount;
- Handler h = new Handler();
- h.start = start;
- h.end = end;
- h.handler = handler;
- h.desc = type;
- h.type = type != null ? cw.newClass(type) : 0;
- if (lastHandler == null) {
- firstHandler = h;
- } else {
- lastHandler.next = h;
+ // Complete the control flow graph with the successor blocks of subroutines, if needed.
+ if (hasSubroutines) {
+ // First step: find the subroutines. This step determines, for each basic block, to which
+ // subroutine(s) it belongs. Start with the main "subroutine":
+ short numSubroutines = 1;
+ firstBasicBlock.markSubroutine(numSubroutines);
+ // Then, mark the subroutines called by the main subroutine, then the subroutines called by
+ // those called by the main subroutine, etc.
+ for (short currentSubroutine = 1; currentSubroutine <= numSubroutines; ++currentSubroutine) {
+ Label basicBlock = firstBasicBlock;
+ while (basicBlock != null) {
+ if ((basicBlock.flags & Label.FLAG_SUBROUTINE_CALLER) != 0
+ && basicBlock.subroutineId == currentSubroutine) {
+ Label jsrTarget = basicBlock.outgoingEdges.nextEdge.successor;
+ if (jsrTarget.subroutineId == 0) {
+ // If this subroutine has not been marked yet, find its basic blocks.
+ jsrTarget.markSubroutine(++numSubroutines);
+ }
+ }
+ basicBlock = basicBlock.nextBasicBlock;
}
- lastHandler = h;
+ }
+ // Second step: find the successors in the control flow graph of each subroutine basic block
+ // 'r' ending with a RET instruction. These successors are the virtual successors of the basic
+ // blocks ending with JSR instructions (see {@link #visitJumpInsn)} that can reach 'r'.
+ Label basicBlock = firstBasicBlock;
+ while (basicBlock != null) {
+ if ((basicBlock.flags & Label.FLAG_SUBROUTINE_CALLER) != 0) {
+ // By construction, jsr targets are stored in the second outgoing edge of basic blocks
+ // that ends with a jsr instruction (see {@link #FLAG_SUBROUTINE_CALLER}).
+ Label subroutine = basicBlock.outgoingEdges.nextEdge.successor;
+ subroutine.addSubroutineRetSuccessors(basicBlock);
+ }
+ basicBlock = basicBlock.nextBasicBlock;
+ }
}
- @Override
- public AnnotationVisitor visitTryCatchAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
+ // Data flow algorithm: put the first basic block in a list of blocks to process (i.e. blocks
+ // whose input stack size has changed) and, while there are blocks to process, remove one
+ // from the list, update the input stack size of its successor blocks in the control flow
+ // graph, and add these blocks to the list of blocks to process (if not already done).
+ Label listOfBlocksToProcess = firstBasicBlock;
+ listOfBlocksToProcess.nextListElement = Label.EMPTY_LIST;
+ int maxStackSize = maxStack;
+ while (listOfBlocksToProcess != Label.EMPTY_LIST) {
+ // Remove a basic block from the list of blocks to process. Note that we don't reset
+ // basicBlock.nextListElement to null on purpose, to make sure we don't reprocess already
+ // processed basic blocks.
+ Label basicBlock = listOfBlocksToProcess;
+ listOfBlocksToProcess = listOfBlocksToProcess.nextListElement;
+ // Compute the (absolute) input stack size and maximum stack size of this block.
+ int inputStackTop = basicBlock.inputStackSize;
+ int maxBlockStackSize = inputStackTop + basicBlock.outputStackMax;
+ // Update the absolute maximum stack size of the method.
+ if (maxBlockStackSize > maxStackSize) {
+ maxStackSize = maxBlockStackSize;
+ }
+ // Update the input stack size of the successor blocks of basicBlock in the control flow
+ // graph, and add these blocks to the list of blocks to process, if not already done.
+ Edge outgoingEdge = basicBlock.outgoingEdges;
+ if ((basicBlock.flags & Label.FLAG_SUBROUTINE_CALLER) != 0) {
+ // Ignore the first outgoing edge of the basic blocks ending with a jsr: these are virtual
+ // edges which lead to the instruction just after the jsr, and do not correspond to a
+ // possible execution path (see {@link #visitJumpInsn} and
+ // {@link Label#FLAG_SUBROUTINE_CALLER}).
+ outgoingEdge = outgoingEdge.nextEdge;
+ }
+ while (outgoingEdge != null) {
+ Label successorBlock = outgoingEdge.successor;
+ if (successorBlock.nextListElement == null) {
+ successorBlock.inputStackSize =
+ (short) (outgoingEdge.info == Edge.EXCEPTION ? 1 : inputStackTop + outgoingEdge.info);
+ successorBlock.nextListElement = listOfBlocksToProcess;
+ listOfBlocksToProcess = successorBlock;
}
- ByteVector bv = new ByteVector();
- // write target_type and target_info
- AnnotationWriter.putTarget(typeRef, typePath, bv);
- // write type, and reserve space for values count
- bv.putShort(cw.newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv,
- bv.length - 2);
- if (visible) {
- aw.next = ctanns;
- ctanns = aw;
- } else {
- aw.next = ictanns;
- ictanns = aw;
- }
- return aw;
+ outgoingEdge = outgoingEdge.nextEdge;
+ }
}
+ this.maxStack = maxStackSize;
+ }
- @Override
- public void visitLocalVariable(final String name, final String desc,
- final String signature, final Label start, final Label end,
- final int index) {
- if (signature != null) {
- if (localVarType == null) {
- localVarType = new ByteVector();
- }
- ++localVarTypeCount;
- localVarType.putShort(start.position)
- .putShort(end.position - start.position)
- .putShort(cw.newUTF8(name)).putShort(cw.newUTF8(signature))
- .putShort(index);
- }
- if (localVar == null) {
- localVar = new ByteVector();
- }
- ++localVarCount;
- localVar.putShort(start.position)
- .putShort(end.position - start.position)
- .putShort(cw.newUTF8(name)).putShort(cw.newUTF8(desc))
- .putShort(index);
- if (compute != NOTHING) {
- // updates max locals
- char c = desc.charAt(0);
- int n = index + (c == 'J' || c == 'D' ? 2 : 1);
- if (n > maxLocals) {
- maxLocals = n;
- }
- }
+ @Override
+ public void visitEnd() {
+ // Nothing to do.
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Utility methods: control flow analysis algorithm
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Adds a successor to {@link #currentBasicBlock} in the control flow graph.
+ *
+ * @param info information about the control flow edge to be added.
+ * @param successor the successor block to be added to the current basic block.
+ */
+ private void addSuccessorToCurrentBasicBlock(final int info, final Label successor) {
+ currentBasicBlock.outgoingEdges = new Edge(info, successor, currentBasicBlock.outgoingEdges);
+ }
+
+ /**
+ * Ends the current basic block. This method must be used in the case where the current basic
+ * block does not have any successor.
+ *
+ * <p>WARNING: this method must be called after the currently visited instruction has been put in
+ * {@link #code} (if frames are computed, this method inserts a new Label to start a new basic
+ * block after the current instruction).
+ */
+ private void endCurrentBasicBlockWithNoSuccessor() {
+ if (compute == COMPUTE_ALL_FRAMES) {
+ Label nextBasicBlock = new Label();
+ nextBasicBlock.frame = new Frame(nextBasicBlock);
+ nextBasicBlock.resolve(code.data, code.length);
+ lastBasicBlock.nextBasicBlock = nextBasicBlock;
+ lastBasicBlock = nextBasicBlock;
+ currentBasicBlock = null;
+ } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL) {
+ currentBasicBlock.outputStackMax = (short) maxRelativeStackSize;
+ currentBasicBlock = null;
}
+ }
- @Override
- public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
- TypePath typePath, Label[] start, Label[] end, int[] index,
- String desc, boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
- ByteVector bv = new ByteVector();
- // write target_type and target_info
- bv.putByte(typeRef >>> 24).putShort(start.length);
- for (int i = 0; i < start.length; ++i) {
- bv.putShort(start[i].position)
- .putShort(end[i].position - start[i].position)
- .putShort(index[i]);
- }
- if (typePath == null) {
- bv.putByte(0);
- } else {
- int length = typePath.b[typePath.offset] * 2 + 1;
- bv.putByteArray(typePath.b, typePath.offset, length);
- }
- // write type, and reserve space for values count
- bv.putShort(cw.newUTF8(desc)).putShort(0);
- AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv,
- bv.length - 2);
- if (visible) {
- aw.next = ctanns;
- ctanns = aw;
- } else {
- aw.next = ictanns;
- ictanns = aw;
- }
- return aw;
+ // -----------------------------------------------------------------------------------------------
+ // Utility methods: stack map frames
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Starts the visit of a new stack map frame, stored in {@link #currentFrame}.
+ *
+ * @param offset the bytecode offset of the instruction to which the frame corresponds.
+ * @param numLocal the number of local variables in the frame.
+ * @param numStack the number of stack elements in the frame.
+ * @return the index of the next element to be written in this frame.
+ */
+ int visitFrameStart(final int offset, final int numLocal, final int numStack) {
+ int frameLength = 3 + numLocal + numStack;
+ if (currentFrame == null || currentFrame.length < frameLength) {
+ currentFrame = new int[frameLength];
}
+ currentFrame[0] = offset;
+ currentFrame[1] = numLocal;
+ currentFrame[2] = numStack;
+ return 3;
+ }
- @Override
- public void visitLineNumber(final int line, final Label start) {
- if (lineNumber == null) {
- lineNumber = new ByteVector();
- }
- ++lineNumberCount;
- lineNumber.putShort(start.position);
- lineNumber.putShort(line);
+ /**
+ * Sets an abstract type in {@link #currentFrame}.
+ *
+ * @param frameIndex the index of the element to be set in {@link #currentFrame}.
+ * @param abstractType an abstract type.
+ */
+ void visitAbstractType(final int frameIndex, final int abstractType) {
+ currentFrame[frameIndex] = abstractType;
+ }
+
+ /**
+ * Ends the visit of {@link #currentFrame} by writing it in the StackMapTable entries and by
+ * updating the StackMapTable number_of_entries (except if the current frame is the first one,
+ * which is implicit in StackMapTable). Then resets {@link #currentFrame} to {@literal null}.
+ */
+ void visitFrameEnd() {
+ if (previousFrame != null) {
+ if (stackMapTableEntries == null) {
+ stackMapTableEntries = new ByteVector();
+ }
+ putFrame();
+ ++stackMapTableNumberOfEntries;
}
+ previousFrame = currentFrame;
+ currentFrame = null;
+ }
- @Override
- public void visitMaxs(final int maxStack, final int maxLocals) {
- if (resize) {
- // replaces the temporary jump opcodes introduced by Label.resolve.
- if (ClassReader.RESIZE) {
- resizeInstructions();
- } else {
- throw new RuntimeException("Method code too large!");
- }
- }
- if (ClassReader.FRAMES && compute == FRAMES) {
- // completes the control flow graph with exception handler blocks
- Handler handler = firstHandler;
- while (handler != null) {
- Label l = handler.start.getFirst();
- Label h = handler.handler.getFirst();
- Label e = handler.end.getFirst();
- // computes the kind of the edges to 'h'
- String t = handler.desc == null ? "java/lang/Throwable"
- : handler.desc;
- int kind = Frame.OBJECT | cw.addType(t);
- // h is an exception handler
- h.status |= Label.TARGET;
- // adds 'h' as a successor of labels between 'start' and 'end'
- while (l != e) {
- // creates an edge to 'h'
- Edge b = new Edge();
- b.info = kind;
- b.successor = h;
- // adds it to the successors of 'l'
- b.next = l.successors;
- l.successors = b;
- // goes to the next label
- l = l.successor;
- }
- handler = handler.next;
- }
-
- // creates and visits the first (implicit) frame
- Frame f = labels.frame;
- Type[] args = Type.getArgumentTypes(descriptor);
- f.initInputFrame(cw, access, args, this.maxLocals);
- visitFrame(f);
-
- /*
- * fix point algorithm: mark the first basic block as 'changed'
- * (i.e. put it in the 'changed' list) and, while there are changed
- * basic blocks, choose one, mark it as unchanged, and update its
- * successors (which can be changed in the process).
- */
- int max = 0;
- Label changed = labels;
- while (changed != null) {
- // removes a basic block from the list of changed basic blocks
- Label l = changed;
- changed = changed.next;
- l.next = null;
- f = l.frame;
- // a reachable jump target must be stored in the stack map
- if ((l.status & Label.TARGET) != 0) {
- l.status |= Label.STORE;
- }
- // all visited labels are reachable, by definition
- l.status |= Label.REACHABLE;
- // updates the (absolute) maximum stack size
- int blockMax = f.inputStack.length + l.outputStackMax;
- if (blockMax > max) {
- max = blockMax;
- }
- // updates the successors of the current basic block
- Edge e = l.successors;
- while (e != null) {
- Label n = e.successor.getFirst();
- boolean change = f.merge(cw, n.frame, e.info);
- if (change && n.next == null) {
- // if n has changed and is not already in the 'changed'
- // list, adds it to this list
- n.next = changed;
- changed = n;
- }
- e = e.next;
- }
- }
-
- // visits all the frames that must be stored in the stack map
- Label l = labels;
- while (l != null) {
- f = l.frame;
- if ((l.status & Label.STORE) != 0) {
- visitFrame(f);
- }
- if ((l.status & Label.REACHABLE) == 0) {
- // finds start and end of dead basic block
- Label k = l.successor;
- int start = l.position;
- int end = (k == null ? code.length : k.position) - 1;
- // if non empty basic block
- if (end >= start) {
- max = Math.max(max, 1);
- // replaces instructions with NOP ... NOP ATHROW
- for (int i = start; i < end; ++i) {
- code.data[i] = Opcodes.NOP;
- }
- code.data[end] = (byte) Opcodes.ATHROW;
- // emits a frame for this unreachable block
- int frameIndex = startFrame(start, 0, 1);
- frame[frameIndex] = Frame.OBJECT
- | cw.addType("java/lang/Throwable");
- endFrame();
- // removes the start-end range from the exception
- // handlers
- firstHandler = Handler.remove(firstHandler, l, k);
- }
- }
- l = l.successor;
- }
-
- handler = firstHandler;
- handlerCount = 0;
- while (handler != null) {
- handlerCount += 1;
- handler = handler.next;
- }
-
- this.maxStack = max;
- } else if (compute == MAXS) {
- // completes the control flow graph with exception handler blocks
- Handler handler = firstHandler;
- while (handler != null) {
- Label l = handler.start;
- Label h = handler.handler;
- Label e = handler.end;
- // adds 'h' as a successor of labels between 'start' and 'end'
- while (l != e) {
- // creates an edge to 'h'
- Edge b = new Edge();
- b.info = Edge.EXCEPTION;
- b.successor = h;
- // adds it to the successors of 'l'
- if ((l.status & Label.JSR) == 0) {
- b.next = l.successors;
- l.successors = b;
- } else {
- // if l is a JSR block, adds b after the first two edges
- // to preserve the hypothesis about JSR block successors
- // order (see {@link #visitJumpInsn})
- b.next = l.successors.next.next;
- l.successors.next.next = b;
- }
- // goes to the next label
- l = l.successor;
- }
- handler = handler.next;
- }
-
- if (subroutines > 0) {
- // completes the control flow graph with the RET successors
- /*
- * first step: finds the subroutines. This step determines, for
- * each basic block, to which subroutine(s) it belongs.
- */
- // finds the basic blocks that belong to the "main" subroutine
- int id = 0;
- labels.visitSubroutine(null, 1, subroutines);
- // finds the basic blocks that belong to the real subroutines
- Label l = labels;
- while (l != null) {
- if ((l.status & Label.JSR) != 0) {
- // the subroutine is defined by l's TARGET, not by l
- Label subroutine = l.successors.next.successor;
- // if this subroutine has not been visited yet...
- if ((subroutine.status & Label.VISITED) == 0) {
- // ...assigns it a new id and finds its basic blocks
- id += 1;
- subroutine.visitSubroutine(null, (id / 32L) << 32
- | (1L << (id % 32)), subroutines);
- }
- }
- l = l.successor;
- }
- // second step: finds the successors of RET blocks
- l = labels;
- while (l != null) {
- if ((l.status & Label.JSR) != 0) {
- Label L = labels;
- while (L != null) {
- L.status &= ~Label.VISITED2;
- L = L.successor;
- }
- // the subroutine is defined by l's TARGET, not by l
- Label subroutine = l.successors.next.successor;
- subroutine.visitSubroutine(l, 0, subroutines);
- }
- l = l.successor;
- }
- }
-
- /*
- * control flow analysis algorithm: while the block stack is not
- * empty, pop a block from this stack, update the max stack size,
- * compute the true (non relative) begin stack size of the
- * successors of this block, and push these successors onto the
- * stack (unless they have already been pushed onto the stack).
- * Note: by hypothesis, the {@link Label#inputStackTop} of the
- * blocks in the block stack are the true (non relative) beginning
- * stack sizes of these blocks.
- */
- int max = 0;
- Label stack = labels;
- while (stack != null) {
- // pops a block from the stack
- Label l = stack;
- stack = stack.next;
- // computes the true (non relative) max stack size of this block
- int start = l.inputStackTop;
- int blockMax = start + l.outputStackMax;
- // updates the global max stack size
- if (blockMax > max) {
- max = blockMax;
- }
- // analyzes the successors of the block
- Edge b = l.successors;
- if ((l.status & Label.JSR) != 0) {
- // ignores the first edge of JSR blocks (virtual successor)
- b = b.next;
- }
- while (b != null) {
- l = b.successor;
- // if this successor has not already been pushed...
- if ((l.status & Label.PUSHED) == 0) {
- // computes its true beginning stack size...
- l.inputStackTop = b.info == Edge.EXCEPTION ? 1 : start
- + b.info;
- // ...and pushes it onto the stack
- l.status |= Label.PUSHED;
- l.next = stack;
- stack = l;
- }
- b = b.next;
- }
- }
- this.maxStack = Math.max(maxStack, max);
- } else {
- this.maxStack = maxStack;
- this.maxLocals = maxLocals;
- }
+ /** Compresses and writes {@link #currentFrame} in a new StackMapTable entry. */
+ private void putFrame() {
+ final int numLocal = currentFrame[1];
+ final int numStack = currentFrame[2];
+ if (symbolTable.getMajorVersion() < Opcodes.V1_6) {
+ // Generate a StackMap attribute entry, which are always uncompressed.
+ stackMapTableEntries.putShort(currentFrame[0]).putShort(numLocal);
+ putAbstractTypes(3, 3 + numLocal);
+ stackMapTableEntries.putShort(numStack);
+ putAbstractTypes(3 + numLocal, 3 + numLocal + numStack);
+ return;
}
-
- @Override
- public void visitEnd() {
+ final int offsetDelta =
+ stackMapTableNumberOfEntries == 0
+ ? currentFrame[0]
+ : currentFrame[0] - previousFrame[0] - 1;
+ final int previousNumlocal = previousFrame[1];
+ final int numLocalDelta = numLocal - previousNumlocal;
+ int type = Frame.FULL_FRAME;
+ if (numStack == 0) {
+ switch (numLocalDelta) {
+ case -3:
+ case -2:
+ case -1:
+ type = Frame.CHOP_FRAME;
+ break;
+ case 0:
+ type = offsetDelta < 64 ? Frame.SAME_FRAME : Frame.SAME_FRAME_EXTENDED;
+ break;
+ case 1:
+ case 2:
+ case 3:
+ type = Frame.APPEND_FRAME;
+ break;
+ default:
+ // Keep the FULL_FRAME type.
+ break;
+ }
+ } else if (numLocalDelta == 0 && numStack == 1) {
+ type =
+ offsetDelta < 63
+ ? Frame.SAME_LOCALS_1_STACK_ITEM_FRAME
+ : Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED;
}
-
- // ------------------------------------------------------------------------
- // Utility methods: control flow analysis algorithm
- // ------------------------------------------------------------------------
-
- /**
- * Adds a successor to the {@link #currentBlock currentBlock} block.
- *
- * @param info
- * information about the control flow edge to be added.
- * @param successor
- * the successor block to be added to the current block.
- */
- private void addSuccessor(final int info, final Label successor) {
- // creates and initializes an Edge object...
- Edge b = new Edge();
- b.info = info;
- b.successor = successor;
- // ...and adds it to the successor list of the currentBlock block
- b.next = currentBlock.successors;
- currentBlock.successors = b;
+ if (type != Frame.FULL_FRAME) {
+ // Verify if locals are the same as in the previous frame.
+ int frameIndex = 3;
+ for (int i = 0; i < previousNumlocal && i < numLocal; i++) {
+ if (currentFrame[frameIndex] != previousFrame[frameIndex]) {
+ type = Frame.FULL_FRAME;
+ break;
+ }
+ frameIndex++;
+ }
}
-
- /**
- * Ends the current basic block. This method must be used in the case where
- * the current basic block does not have any successor.
- */
- private void noSuccessor() {
- if (compute == FRAMES) {
- Label l = new Label();
- l.frame = new Frame();
- l.frame.owner = l;
- l.resolve(this, code.length, code.data);
- previousBlock.successor = l;
- previousBlock = l;
- } else {
- currentBlock.outputStackMax = maxStackSize;
- }
- currentBlock = null;
+ switch (type) {
+ case Frame.SAME_FRAME:
+ stackMapTableEntries.putByte(offsetDelta);
+ break;
+ case Frame.SAME_LOCALS_1_STACK_ITEM_FRAME:
+ stackMapTableEntries.putByte(Frame.SAME_LOCALS_1_STACK_ITEM_FRAME + offsetDelta);
+ putAbstractTypes(3 + numLocal, 4 + numLocal);
+ break;
+ case Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
+ stackMapTableEntries
+ .putByte(Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
+ .putShort(offsetDelta);
+ putAbstractTypes(3 + numLocal, 4 + numLocal);
+ break;
+ case Frame.SAME_FRAME_EXTENDED:
+ stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED).putShort(offsetDelta);
+ break;
+ case Frame.CHOP_FRAME:
+ stackMapTableEntries
+ .putByte(Frame.SAME_FRAME_EXTENDED + numLocalDelta)
+ .putShort(offsetDelta);
+ break;
+ case Frame.APPEND_FRAME:
+ stackMapTableEntries
+ .putByte(Frame.SAME_FRAME_EXTENDED + numLocalDelta)
+ .putShort(offsetDelta);
+ putAbstractTypes(3 + previousNumlocal, 3 + numLocal);
+ break;
+ case Frame.FULL_FRAME:
+ default:
+ stackMapTableEntries.putByte(Frame.FULL_FRAME).putShort(offsetDelta).putShort(numLocal);
+ putAbstractTypes(3, 3 + numLocal);
+ stackMapTableEntries.putShort(numStack);
+ putAbstractTypes(3 + numLocal, 3 + numLocal + numStack);
+ break;
}
+ }
- // ------------------------------------------------------------------------
- // Utility methods: stack map frames
- // ------------------------------------------------------------------------
-
- /**
- * Visits a frame that has been computed from scratch.
- *
- * @param f
- * the frame that must be visited.
- */
- private void visitFrame(final Frame f) {
- int i, t;
- int nTop = 0;
- int nLocal = 0;
- int nStack = 0;
- int[] locals = f.inputLocals;
- int[] stacks = f.inputStack;
- // computes the number of locals (ignores TOP types that are just after
- // a LONG or a DOUBLE, and all trailing TOP types)
- for (i = 0; i < locals.length; ++i) {
- t = locals[i];
- if (t == Frame.TOP) {
- ++nTop;
- } else {
- nLocal += nTop + 1;
- nTop = 0;
- }
- if (t == Frame.LONG || t == Frame.DOUBLE) {
- ++i;
- }
- }
- // computes the stack size (ignores TOP types that are just after
- // a LONG or a DOUBLE)
- for (i = 0; i < stacks.length; ++i) {
- t = stacks[i];
- ++nStack;
- if (t == Frame.LONG || t == Frame.DOUBLE) {
- ++i;
- }
- }
- // visits the frame and its content
- int frameIndex = startFrame(f.owner.position, nLocal, nStack);
- for (i = 0; nLocal > 0; ++i, --nLocal) {
- t = locals[i];
- frame[frameIndex++] = t;
- if (t == Frame.LONG || t == Frame.DOUBLE) {
- ++i;
- }
- }
- for (i = 0; i < stacks.length; ++i) {
- t = stacks[i];
- frame[frameIndex++] = t;
- if (t == Frame.LONG || t == Frame.DOUBLE) {
- ++i;
- }
- }
- endFrame();
+ /**
+ * Puts some abstract types of {@link #currentFrame} in {@link #stackMapTableEntries} , using the
+ * JVMS verification_type_info format used in StackMapTable attributes.
+ *
+ * @param start index of the first type in {@link #currentFrame} to write.
+ * @param end index of last type in {@link #currentFrame} to write (exclusive).
+ */
+ private void putAbstractTypes(final int start, final int end) {
+ for (int i = start; i < end; ++i) {
+ Frame.putAbstractType(symbolTable, currentFrame[i], stackMapTableEntries);
}
+ }
- /**
- * Visit the implicit first frame of this method.
- */
- private void visitImplicitFirstFrame() {
- // There can be at most descriptor.length() + 1 locals
- int frameIndex = startFrame(0, descriptor.length() + 1, 0);
- if ((access & Opcodes.ACC_STATIC) == 0) {
- if ((access & ACC_CONSTRUCTOR) == 0) {
- frame[frameIndex++] = Frame.OBJECT | cw.addType(cw.thisName);
- } else {
- frame[frameIndex++] = 6; // Opcodes.UNINITIALIZED_THIS;
- }
- }
- int i = 1;
- loop: while (true) {
- int j = i;
- switch (descriptor.charAt(i++)) {
- case 'Z':
- case 'C':
- case 'B':
- case 'S':
- case 'I':
- frame[frameIndex++] = 1; // Opcodes.INTEGER;
- break;
- case 'F':
- frame[frameIndex++] = 2; // Opcodes.FLOAT;
- break;
- case 'J':
- frame[frameIndex++] = 4; // Opcodes.LONG;
- break;
- case 'D':
- frame[frameIndex++] = 3; // Opcodes.DOUBLE;
- break;
- case '[':
- while (descriptor.charAt(i) == '[') {
- ++i;
- }
- if (descriptor.charAt(i) == 'L') {
- ++i;
- while (descriptor.charAt(i) != ';') {
- ++i;
- }
- }
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType(descriptor.substring(j, ++i));
- break;
- case 'L':
- while (descriptor.charAt(i) != ';') {
- ++i;
- }
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType(descriptor.substring(j + 1, i++));
- break;
- default:
- break loop;
- }
- }
- frame[1] = frameIndex - 3;
- endFrame();
+ /**
+ * Puts the given public API frame element type in {@link #stackMapTableEntries} , using the JVMS
+ * verification_type_info format used in StackMapTable attributes.
+ *
+ * @param type a frame element type described using the same format as in {@link
+ * MethodVisitor#visitFrame}, i.e. either {@link Opcodes#TOP}, {@link Opcodes#INTEGER}, {@link
+ * Opcodes#FLOAT}, {@link Opcodes#LONG}, {@link Opcodes#DOUBLE}, {@link Opcodes#NULL}, or
+ * {@link Opcodes#UNINITIALIZED_THIS}, or the internal name of a class, or a Label designating
+ * a NEW instruction (for uninitialized types).
+ */
+ private void putFrameType(final Object type) {
+ if (type instanceof Integer) {
+ stackMapTableEntries.putByte(((Integer) type).intValue());
+ } else if (type instanceof String) {
+ stackMapTableEntries
+ .putByte(Frame.ITEM_OBJECT)
+ .putShort(symbolTable.addConstantClass((String) type).index);
+ } else {
+ stackMapTableEntries
+ .putByte(Frame.ITEM_UNINITIALIZED)
+ .putShort(((Label) type).bytecodeOffset);
}
+ }
- /**
- * Starts the visit of a stack map frame.
- *
- * @param offset
- * the offset of the instruction to which the frame corresponds.
- * @param nLocal
- * the number of local variables in the frame.
- * @param nStack
- * the number of stack elements in the frame.
- * @return the index of the next element to be written in this frame.
- */
- private int startFrame(final int offset, final int nLocal, final int nStack) {
- int n = 3 + nLocal + nStack;
- if (frame == null || frame.length < n) {
- frame = new int[n];
- }
- frame[0] = offset;
- frame[1] = nLocal;
- frame[2] = nStack;
- return 3;
+ // -----------------------------------------------------------------------------------------------
+ // Utility methods
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns whether the attributes of this method can be copied from the attributes of the given
+ * method (assuming there is no method visitor between the given ClassReader and this
+ * MethodWriter). This method should only be called just after this MethodWriter has been created,
+ * and before any content is visited. It returns true if the attributes corresponding to the
+ * constructor arguments (at most a Signature, an Exception, a Deprecated and a Synthetic
+ * attribute) are the same as the corresponding attributes in the given method.
+ *
+ * @param source the source ClassReader from which the attributes of this method might be copied.
+ * @param hasSyntheticAttribute whether the method_info JVMS structure from which the attributes
+ * of this method might be copied contains a Synthetic attribute.
+ * @param hasDeprecatedAttribute whether the method_info JVMS structure from which the attributes
+ * of this method might be copied contains a Deprecated attribute.
+ * @param descriptorIndex the descriptor_index field of the method_info JVMS structure from which
+ * the attributes of this method might be copied.
+ * @param signatureIndex the constant pool index contained in the Signature attribute of the
+ * method_info JVMS structure from which the attributes of this method might be copied, or 0.
+ * @param exceptionsOffset the offset in 'source.b' of the Exceptions attribute of the method_info
+ * JVMS structure from which the attributes of this method might be copied, or 0.
+ * @return whether the attributes of this method can be copied from the attributes of the
+ * method_info JVMS structure in 'source.b', between 'methodInfoOffset' and 'methodInfoOffset'
+ * + 'methodInfoLength'.
+ */
+ boolean canCopyMethodAttributes(
+ final ClassReader source,
+ final boolean hasSyntheticAttribute,
+ final boolean hasDeprecatedAttribute,
+ final int descriptorIndex,
+ final int signatureIndex,
+ final int exceptionsOffset) {
+ // If the method descriptor has changed, with more locals than the max_locals field of the
+ // original Code attribute, if any, then the original method attributes can't be copied. A
+ // conservative check on the descriptor changes alone ensures this (being more precise is not
+ // worth the additional complexity, because these cases should be rare -- if a transform changes
+ // a method descriptor, most of the time it needs to change the method's code too).
+ if (source != symbolTable.getSource()
+ || descriptorIndex != this.descriptorIndex
+ || signatureIndex != this.signatureIndex
+ || hasDeprecatedAttribute != ((accessFlags & Opcodes.ACC_DEPRECATED) != 0)) {
+ return false;
}
-
- /**
- * Checks if the visit of the current frame {@link #frame} is finished, and
- * if yes, write it in the StackMapTable attribute.
- */
- private void endFrame() {
- if (previousFrame != null) { // do not write the first frame
- if (stackMap == null) {
- stackMap = new ByteVector();
- }
- writeFrame();
- ++frameCount;
- }
- previousFrame = frame;
- frame = null;
+ boolean needSyntheticAttribute =
+ symbolTable.getMajorVersion() < Opcodes.V1_5 && (accessFlags & Opcodes.ACC_SYNTHETIC) != 0;
+ if (hasSyntheticAttribute != needSyntheticAttribute) {
+ return false;
}
-
- /**
- * Compress and writes the current frame {@link #frame} in the StackMapTable
- * attribute.
- */
- private void writeFrame() {
- int clocalsSize = frame[1];
- int cstackSize = frame[2];
- if ((cw.version & 0xFFFF) < Opcodes.V1_6) {
- stackMap.putShort(frame[0]).putShort(clocalsSize);
- writeFrameTypes(3, 3 + clocalsSize);
- stackMap.putShort(cstackSize);
- writeFrameTypes(3 + clocalsSize, 3 + clocalsSize + cstackSize);
- return;
+ if (exceptionsOffset == 0) {
+ if (numberOfExceptions != 0) {
+ return false;
+ }
+ } else if (source.readUnsignedShort(exceptionsOffset) == numberOfExceptions) {
+ int currentExceptionOffset = exceptionsOffset + 2;
+ for (int i = 0; i < numberOfExceptions; ++i) {
+ if (source.readUnsignedShort(currentExceptionOffset) != exceptionIndexTable[i]) {
+ return false;
}
- int localsSize = previousFrame[1];
- int type = FULL_FRAME;
- int k = 0;
- int delta;
- if (frameCount == 0) {
- delta = frame[0];
- } else {
- delta = frame[0] - previousFrame[0] - 1;
- }
- if (cstackSize == 0) {
- k = clocalsSize - localsSize;
- switch (k) {
- case -3:
- case -2:
- case -1:
- type = CHOP_FRAME;
- localsSize = clocalsSize;
- break;
- case 0:
- type = delta < 64 ? SAME_FRAME : SAME_FRAME_EXTENDED;
- break;
- case 1:
- case 2:
- case 3:
- type = APPEND_FRAME;
- break;
- }
- } else if (clocalsSize == localsSize && cstackSize == 1) {
- type = delta < 63 ? SAME_LOCALS_1_STACK_ITEM_FRAME
- : SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED;
- }
- if (type != FULL_FRAME) {
- // verify if locals are the same
- int l = 3;
- for (int j = 0; j < localsSize; j++) {
- if (frame[l] != previousFrame[l]) {
- type = FULL_FRAME;
- break;
- }
- l++;
- }
- }
- switch (type) {
- case SAME_FRAME:
- stackMap.putByte(delta);
- break;
- case SAME_LOCALS_1_STACK_ITEM_FRAME:
- stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
- writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
- break;
- case SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
- stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED).putShort(
- delta);
- writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
- break;
- case SAME_FRAME_EXTENDED:
- stackMap.putByte(SAME_FRAME_EXTENDED).putShort(delta);
- break;
- case CHOP_FRAME:
- stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
- break;
- case APPEND_FRAME:
- stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
- writeFrameTypes(3 + localsSize, 3 + clocalsSize);
- break;
- // case FULL_FRAME:
- default:
- stackMap.putByte(FULL_FRAME).putShort(delta).putShort(clocalsSize);
- writeFrameTypes(3, 3 + clocalsSize);
- stackMap.putShort(cstackSize);
- writeFrameTypes(3 + clocalsSize, 3 + clocalsSize + cstackSize);
- }
+ currentExceptionOffset += 2;
+ }
}
+ return true;
+ }
- /**
- * Writes some types of the current frame {@link #frame} into the
- * StackMapTableAttribute. This method converts types from the format used
- * in {@link Label} to the format used in StackMapTable attributes. In
- * particular, it converts type table indexes to constant pool indexes.
- *
- * @param start
- * index of the first type in {@link #frame} to write.
- * @param end
- * index of last type in {@link #frame} to write (exclusive).
- */
- private void writeFrameTypes(final int start, final int end) {
- for (int i = start; i < end; ++i) {
- int t = frame[i];
- int d = t & Frame.DIM;
- if (d == 0) {
- int v = t & Frame.BASE_VALUE;
- switch (t & Frame.BASE_KIND) {
- case Frame.OBJECT:
- stackMap.putByte(7).putShort(
- cw.newClass(cw.typeTable[v].strVal1));
- break;
- case Frame.UNINITIALIZED:
- stackMap.putByte(8).putShort(cw.typeTable[v].intVal);
- break;
- default:
- stackMap.putByte(v);
- }
- } else {
- StringBuilder sb = new StringBuilder();
- d >>= 28;
- while (d-- > 0) {
- sb.append('[');
- }
- if ((t & Frame.BASE_KIND) == Frame.OBJECT) {
- sb.append('L');
- sb.append(cw.typeTable[t & Frame.BASE_VALUE].strVal1);
- sb.append(';');
- } else {
- switch (t & 0xF) {
- case 1:
- sb.append('I');
- break;
- case 2:
- sb.append('F');
- break;
- case 3:
- sb.append('D');
- break;
- case 9:
- sb.append('Z');
- break;
- case 10:
- sb.append('B');
- break;
- case 11:
- sb.append('C');
- break;
- case 12:
- sb.append('S');
- break;
- default:
- sb.append('J');
- }
- }
- stackMap.putByte(7).putShort(cw.newClass(sb.toString()));
- }
- }
+ /**
+ * Sets the source from which the attributes of this method will be copied.
+ *
+ * @param methodInfoOffset the offset in 'symbolTable.getSource()' of the method_info JVMS
+ * structure from which the attributes of this method will be copied.
+ * @param methodInfoLength the length in 'symbolTable.getSource()' of the method_info JVMS
+ * structure from which the attributes of this method will be copied.
+ */
+ void setMethodAttributesSource(final int methodInfoOffset, final int methodInfoLength) {
+ // Don't copy the attributes yet, instead store their location in the source class reader so
+ // they can be copied later, in {@link #putMethodInfo}. Note that we skip the 6 header bytes
+ // of the method_info JVMS structure.
+ this.sourceOffset = methodInfoOffset + 6;
+ this.sourceLength = methodInfoLength - 6;
+ }
+
+ /**
+ * Returns the size of the method_info JVMS structure generated by this MethodWriter. Also add the
+ * names of the attributes of this method in the constant pool.
+ *
+ * @return the size in bytes of the method_info JVMS structure.
+ */
+ int computeMethodInfoSize() {
+ // If this method_info must be copied from an existing one, the size computation is trivial.
+ if (sourceOffset != 0) {
+ // sourceLength excludes the first 6 bytes for access_flags, name_index and descriptor_index.
+ return 6 + sourceLength;
}
-
- private void writeFrameType(final Object type) {
- if (type instanceof String) {
- stackMap.putByte(7).putShort(cw.newClass((String) type));
- } else if (type instanceof Integer) {
- stackMap.putByte(((Integer) type).intValue());
- } else {
- stackMap.putByte(8).putShort(((Label) type).position);
- }
+ // 2 bytes each for access_flags, name_index, descriptor_index and attributes_count.
+ int size = 8;
+ // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
+ if (code.length > 0) {
+ if (code.length > 65535) {
+ throw new MethodTooLargeException(
+ symbolTable.getClassName(), name, descriptor, code.length);
+ }
+ symbolTable.addConstantUtf8(Constants.CODE);
+ // The Code attribute has 6 header bytes, plus 2, 2, 4 and 2 bytes respectively for max_stack,
+ // max_locals, code_length and attributes_count, plus the bytecode and the exception table.
+ size += 16 + code.length + Handler.getExceptionTableSize(firstHandler);
+ if (stackMapTableEntries != null) {
+ boolean useStackMapTable = symbolTable.getMajorVersion() >= Opcodes.V1_6;
+ symbolTable.addConstantUtf8(useStackMapTable ? Constants.STACK_MAP_TABLE : "StackMap");
+ // 6 header bytes and 2 bytes for number_of_entries.
+ size += 8 + stackMapTableEntries.length;
+ }
+ if (lineNumberTable != null) {
+ symbolTable.addConstantUtf8(Constants.LINE_NUMBER_TABLE);
+ // 6 header bytes and 2 bytes for line_number_table_length.
+ size += 8 + lineNumberTable.length;
+ }
+ if (localVariableTable != null) {
+ symbolTable.addConstantUtf8(Constants.LOCAL_VARIABLE_TABLE);
+ // 6 header bytes and 2 bytes for local_variable_table_length.
+ size += 8 + localVariableTable.length;
+ }
+ if (localVariableTypeTable != null) {
+ symbolTable.addConstantUtf8(Constants.LOCAL_VARIABLE_TYPE_TABLE);
+ // 6 header bytes and 2 bytes for local_variable_type_table_length.
+ size += 8 + localVariableTypeTable.length;
+ }
+ if (lastCodeRuntimeVisibleTypeAnnotation != null) {
+ size +=
+ lastCodeRuntimeVisibleTypeAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS);
+ }
+ if (lastCodeRuntimeInvisibleTypeAnnotation != null) {
+ size +=
+ lastCodeRuntimeInvisibleTypeAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS);
+ }
+ if (firstCodeAttribute != null) {
+ size +=
+ firstCodeAttribute.computeAttributesSize(
+ symbolTable, code.data, code.length, maxStack, maxLocals);
+ }
}
-
- // ------------------------------------------------------------------------
- // Utility methods: dump bytecode array
- // ------------------------------------------------------------------------
-
- /**
- * Returns the size of the bytecode of this method.
- *
- * @return the size of the bytecode of this method.
- */
- final int getSize() {
- if (classReaderOffset != 0) {
- return 6 + classReaderLength;
- }
- int size = 8;
- if (code.length > 0) {
- if (code.length > 65536) {
- throw new RuntimeException("Method code too large!");
- }
- cw.newUTF8("Code");
- size += 18 + code.length + 8 * handlerCount;
- if (localVar != null) {
- cw.newUTF8("LocalVariableTable");
- size += 8 + localVar.length;
- }
- if (localVarType != null) {
- cw.newUTF8("LocalVariableTypeTable");
- size += 8 + localVarType.length;
- }
- if (lineNumber != null) {
- cw.newUTF8("LineNumberTable");
- size += 8 + lineNumber.length;
- }
- if (stackMap != null) {
- boolean zip = (cw.version & 0xFFFF) >= Opcodes.V1_6;
- cw.newUTF8(zip ? "StackMapTable" : "StackMap");
- size += 8 + stackMap.length;
- }
- if (ClassReader.ANNOTATIONS && ctanns != null) {
- cw.newUTF8("RuntimeVisibleTypeAnnotations");
- size += 8 + ctanns.getSize();
- }
- if (ClassReader.ANNOTATIONS && ictanns != null) {
- cw.newUTF8("RuntimeInvisibleTypeAnnotations");
- size += 8 + ictanns.getSize();
- }
- if (cattrs != null) {
- size += cattrs.getSize(cw, code.data, code.length, maxStack,
- maxLocals);
- }
- }
- if (exceptionCount > 0) {
- cw.newUTF8("Exceptions");
- size += 8 + 2 * exceptionCount;
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- if ((cw.version & 0xFFFF) < Opcodes.V1_5
- || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
- cw.newUTF8("Synthetic");
- size += 6;
- }
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- cw.newUTF8("Deprecated");
- size += 6;
- }
- if (ClassReader.SIGNATURES && signature != null) {
- cw.newUTF8("Signature");
- cw.newUTF8(signature);
- size += 8;
- }
- if (methodParameters != null) {
- cw.newUTF8("MethodParameters");
- size += 7 + methodParameters.length;
- }
- if (ClassReader.ANNOTATIONS && annd != null) {
- cw.newUTF8("AnnotationDefault");
- size += 6 + annd.length;
- }
- if (ClassReader.ANNOTATIONS && anns != null) {
- cw.newUTF8("RuntimeVisibleAnnotations");
- size += 8 + anns.getSize();
- }
- if (ClassReader.ANNOTATIONS && ianns != null) {
- cw.newUTF8("RuntimeInvisibleAnnotations");
- size += 8 + ianns.getSize();
- }
- if (ClassReader.ANNOTATIONS && tanns != null) {
- cw.newUTF8("RuntimeVisibleTypeAnnotations");
- size += 8 + tanns.getSize();
- }
- if (ClassReader.ANNOTATIONS && itanns != null) {
- cw.newUTF8("RuntimeInvisibleTypeAnnotations");
- size += 8 + itanns.getSize();
- }
- if (ClassReader.ANNOTATIONS && panns != null) {
- cw.newUTF8("RuntimeVisibleParameterAnnotations");
- size += 7 + 2 * (panns.length - synthetics);
- for (int i = panns.length - 1; i >= synthetics; --i) {
- size += panns[i] == null ? 0 : panns[i].getSize();
- }
- }
- if (ClassReader.ANNOTATIONS && ipanns != null) {
- cw.newUTF8("RuntimeInvisibleParameterAnnotations");
- size += 7 + 2 * (ipanns.length - synthetics);
- for (int i = ipanns.length - 1; i >= synthetics; --i) {
- size += ipanns[i] == null ? 0 : ipanns[i].getSize();
- }
- }
- if (attrs != null) {
- size += attrs.getSize(cw, null, 0, -1, -1);
- }
- return size;
+ if (numberOfExceptions > 0) {
+ symbolTable.addConstantUtf8(Constants.EXCEPTIONS);
+ size += 8 + 2 * numberOfExceptions;
}
-
- /**
- * Puts the bytecode of this method in the given byte vector.
- *
- * @param out
- * the byte vector into which the bytecode of this method must be
- * copied.
- */
- final void put(final ByteVector out) {
- final int FACTOR = ClassWriter.TO_ACC_SYNTHETIC;
- int mask = ACC_CONSTRUCTOR | Opcodes.ACC_DEPRECATED
- | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
- | ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / FACTOR);
- out.putShort(access & ~mask).putShort(name).putShort(desc);
- if (classReaderOffset != 0) {
- out.putByteArray(cw.cr.b, classReaderOffset, classReaderLength);
- return;
- }
- int attributeCount = 0;
- if (code.length > 0) {
- ++attributeCount;
- }
- if (exceptionCount > 0) {
- ++attributeCount;
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- if ((cw.version & 0xFFFF) < Opcodes.V1_5
- || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
- ++attributeCount;
- }
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- ++attributeCount;
- }
- if (ClassReader.SIGNATURES && signature != null) {
- ++attributeCount;
- }
- if (methodParameters != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && annd != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && anns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && ianns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && tanns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && itanns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && panns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && ipanns != null) {
- ++attributeCount;
- }
- if (attrs != null) {
- attributeCount += attrs.getCount();
- }
- out.putShort(attributeCount);
- if (code.length > 0) {
- int size = 12 + code.length + 8 * handlerCount;
- if (localVar != null) {
- size += 8 + localVar.length;
- }
- if (localVarType != null) {
- size += 8 + localVarType.length;
- }
- if (lineNumber != null) {
- size += 8 + lineNumber.length;
- }
- if (stackMap != null) {
- size += 8 + stackMap.length;
- }
- if (ClassReader.ANNOTATIONS && ctanns != null) {
- size += 8 + ctanns.getSize();
- }
- if (ClassReader.ANNOTATIONS && ictanns != null) {
- size += 8 + ictanns.getSize();
- }
- if (cattrs != null) {
- size += cattrs.getSize(cw, code.data, code.length, maxStack,
- maxLocals);
- }
- out.putShort(cw.newUTF8("Code")).putInt(size);
- out.putShort(maxStack).putShort(maxLocals);
- out.putInt(code.length).putByteArray(code.data, 0, code.length);
- out.putShort(handlerCount);
- if (handlerCount > 0) {
- Handler h = firstHandler;
- while (h != null) {
- out.putShort(h.start.position).putShort(h.end.position)
- .putShort(h.handler.position).putShort(h.type);
- h = h.next;
- }
- }
- attributeCount = 0;
- if (localVar != null) {
- ++attributeCount;
- }
- if (localVarType != null) {
- ++attributeCount;
- }
- if (lineNumber != null) {
- ++attributeCount;
- }
- if (stackMap != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && ctanns != null) {
- ++attributeCount;
- }
- if (ClassReader.ANNOTATIONS && ictanns != null) {
- ++attributeCount;
- }
- if (cattrs != null) {
- attributeCount += cattrs.getCount();
- }
- out.putShort(attributeCount);
- if (localVar != null) {
- out.putShort(cw.newUTF8("LocalVariableTable"));
- out.putInt(localVar.length + 2).putShort(localVarCount);
- out.putByteArray(localVar.data, 0, localVar.length);
- }
- if (localVarType != null) {
- out.putShort(cw.newUTF8("LocalVariableTypeTable"));
- out.putInt(localVarType.length + 2).putShort(localVarTypeCount);
- out.putByteArray(localVarType.data, 0, localVarType.length);
- }
- if (lineNumber != null) {
- out.putShort(cw.newUTF8("LineNumberTable"));
- out.putInt(lineNumber.length + 2).putShort(lineNumberCount);
- out.putByteArray(lineNumber.data, 0, lineNumber.length);
- }
- if (stackMap != null) {
- boolean zip = (cw.version & 0xFFFF) >= Opcodes.V1_6;
- out.putShort(cw.newUTF8(zip ? "StackMapTable" : "StackMap"));
- out.putInt(stackMap.length + 2).putShort(frameCount);
- out.putByteArray(stackMap.data, 0, stackMap.length);
- }
- if (ClassReader.ANNOTATIONS && ctanns != null) {
- out.putShort(cw.newUTF8("RuntimeVisibleTypeAnnotations"));
- ctanns.put(out);
- }
- if (ClassReader.ANNOTATIONS && ictanns != null) {
- out.putShort(cw.newUTF8("RuntimeInvisibleTypeAnnotations"));
- ictanns.put(out);
- }
- if (cattrs != null) {
- cattrs.put(cw, code.data, code.length, maxLocals, maxStack, out);
- }
- }
- if (exceptionCount > 0) {
- out.putShort(cw.newUTF8("Exceptions")).putInt(
- 2 * exceptionCount + 2);
- out.putShort(exceptionCount);
- for (int i = 0; i < exceptionCount; ++i) {
- out.putShort(exceptions[i]);
- }
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- if ((cw.version & 0xFFFF) < Opcodes.V1_5
- || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
- out.putShort(cw.newUTF8("Synthetic")).putInt(0);
- }
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- out.putShort(cw.newUTF8("Deprecated")).putInt(0);
- }
- if (ClassReader.SIGNATURES && signature != null) {
- out.putShort(cw.newUTF8("Signature")).putInt(2)
- .putShort(cw.newUTF8(signature));
- }
- if (methodParameters != null) {
- out.putShort(cw.newUTF8("MethodParameters"));
- out.putInt(methodParameters.length + 1).putByte(
- methodParametersCount);
- out.putByteArray(methodParameters.data, 0, methodParameters.length);
- }
- if (ClassReader.ANNOTATIONS && annd != null) {
- out.putShort(cw.newUTF8("AnnotationDefault"));
- out.putInt(annd.length);
- out.putByteArray(annd.data, 0, annd.length);
- }
- if (ClassReader.ANNOTATIONS && anns != null) {
- out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
- anns.put(out);
- }
- if (ClassReader.ANNOTATIONS && ianns != null) {
- out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
- ianns.put(out);
- }
- if (ClassReader.ANNOTATIONS && tanns != null) {
- out.putShort(cw.newUTF8("RuntimeVisibleTypeAnnotations"));
- tanns.put(out);
- }
- if (ClassReader.ANNOTATIONS && itanns != null) {
- out.putShort(cw.newUTF8("RuntimeInvisibleTypeAnnotations"));
- itanns.put(out);
- }
- if (ClassReader.ANNOTATIONS && panns != null) {
- out.putShort(cw.newUTF8("RuntimeVisibleParameterAnnotations"));
- AnnotationWriter.put(panns, synthetics, out);
- }
- if (ClassReader.ANNOTATIONS && ipanns != null) {
- out.putShort(cw.newUTF8("RuntimeInvisibleParameterAnnotations"));
- AnnotationWriter.put(ipanns, synthetics, out);
- }
- if (attrs != null) {
- attrs.put(cw, null, 0, -1, -1, out);
- }
+ size += Attribute.computeAttributesSize(symbolTable, accessFlags, signatureIndex);
+ size +=
+ AnnotationWriter.computeAnnotationsSize(
+ lastRuntimeVisibleAnnotation,
+ lastRuntimeInvisibleAnnotation,
+ lastRuntimeVisibleTypeAnnotation,
+ lastRuntimeInvisibleTypeAnnotation);
+ if (lastRuntimeVisibleParameterAnnotations != null) {
+ size +=
+ AnnotationWriter.computeParameterAnnotationsSize(
+ Constants.RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS,
+ lastRuntimeVisibleParameterAnnotations,
+ visibleAnnotableParameterCount == 0
+ ? lastRuntimeVisibleParameterAnnotations.length
+ : visibleAnnotableParameterCount);
}
-
- // ------------------------------------------------------------------------
- // Utility methods: instruction resizing (used to handle GOTO_W and JSR_W)
- // ------------------------------------------------------------------------
-
- /**
- * Resizes and replaces the temporary instructions inserted by
- * {@link Label#resolve} for wide forward jumps, while keeping jump offsets
- * and instruction addresses consistent. This may require to resize other
- * existing instructions, or even to introduce new instructions: for
- * example, increasing the size of an instruction by 2 at the middle of a
- * method can increases the offset of an IFEQ instruction from 32766 to
- * 32768, in which case IFEQ 32766 must be replaced with IFNEQ 8 GOTO_W
- * 32765. This, in turn, may require to increase the size of another jump
- * instruction, and so on... All these operations are handled automatically
- * by this method.
- * <p>
- * <i>This method must be called after all the method that is being built
- * has been visited</i>. In particular, the {@link Label Label} objects used
- * to construct the method are no longer valid after this method has been
- * called.
- */
- private void resizeInstructions() {
- byte[] b = code.data; // bytecode of the method
- int u, v, label; // indexes in b
- int i, j; // loop indexes
- /*
- * 1st step: As explained above, resizing an instruction may require to
- * resize another one, which may require to resize yet another one, and
- * so on. The first step of the algorithm consists in finding all the
- * instructions that need to be resized, without modifying the code.
- * This is done by the following "fix point" algorithm:
- *
- * Parse the code to find the jump instructions whose offset will need
- * more than 2 bytes to be stored (the future offset is computed from
- * the current offset and from the number of bytes that will be inserted
- * or removed between the source and target instructions). For each such
- * instruction, adds an entry in (a copy of) the indexes and sizes
- * arrays (if this has not already been done in a previous iteration!).
- *
- * If at least one entry has been added during the previous step, go
- * back to the beginning, otherwise stop.
- *
- * In fact the real algorithm is complicated by the fact that the size
- * of TABLESWITCH and LOOKUPSWITCH instructions depends on their
- * position in the bytecode (because of padding). In order to ensure the
- * convergence of the algorithm, the number of bytes to be added or
- * removed from these instructions is over estimated during the previous
- * loop, and computed exactly only after the loop is finished (this
- * requires another pass to parse the bytecode of the method).
- */
- int[] allIndexes = new int[0]; // copy of indexes
- int[] allSizes = new int[0]; // copy of sizes
- boolean[] resize; // instructions to be resized
- int newOffset; // future offset of a jump instruction
-
- resize = new boolean[code.length];
-
- // 3 = loop again, 2 = loop ended, 1 = last pass, 0 = done
- int state = 3;
- do {
- if (state == 3) {
- state = 2;
- }
- u = 0;
- while (u < b.length) {
- int opcode = b[u] & 0xFF; // opcode of current instruction
- int insert = 0; // bytes to be added after this instruction
-
- switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- case ClassWriter.IMPLVAR_INSN:
- u += 1;
- break;
- case ClassWriter.LABEL_INSN:
- if (opcode > 201) {
- // converts temporary opcodes 202 to 217, 218 and
- // 219 to IFEQ ... JSR (inclusive), IFNULL and
- // IFNONNULL
- opcode = opcode < 218 ? opcode - 49 : opcode - 20;
- label = u + readUnsignedShort(b, u + 1);
- } else {
- label = u + readShort(b, u + 1);
- }
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- if (newOffset < Short.MIN_VALUE
- || newOffset > Short.MAX_VALUE) {
- if (!resize[u]) {
- if (opcode == Opcodes.GOTO || opcode == Opcodes.JSR) {
- // two additional bytes will be required to
- // replace this GOTO or JSR instruction with
- // a GOTO_W or a JSR_W
- insert = 2;
- } else {
- // five additional bytes will be required to
- // replace this IFxxx <l> instruction with
- // IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx
- // is the "opposite" opcode of IFxxx (i.e.,
- // IFNE for IFEQ) and where <l'> designates
- // the instruction just after the GOTO_W.
- insert = 5;
- }
- resize[u] = true;
- }
- }
- u += 3;
- break;
- case ClassWriter.LABELW_INSN:
- u += 5;
- break;
- case ClassWriter.TABL_INSN:
- if (state == 1) {
- // true number of bytes to be added (or removed)
- // from this instruction = (future number of padding
- // bytes - current number of padding byte) -
- // previously over estimated variation =
- // = ((3 - newOffset%4) - (3 - u%4)) - u%4
- // = (-newOffset%4 + u%4) - u%4
- // = -(newOffset & 3)
- newOffset = getNewOffset(allIndexes, allSizes, 0, u);
- insert = -(newOffset & 3);
- } else if (!resize[u]) {
- // over estimation of the number of bytes to be
- // added to this instruction = 3 - current number
- // of padding bytes = 3 - (3 - u%4) = u%4 = u & 3
- insert = u & 3;
- resize[u] = true;
- }
- // skips instruction
- u = u + 4 - (u & 3);
- u += 4 * (readInt(b, u + 8) - readInt(b, u + 4) + 1) + 12;
- break;
- case ClassWriter.LOOK_INSN:
- if (state == 1) {
- // like TABL_INSN
- newOffset = getNewOffset(allIndexes, allSizes, 0, u);
- insert = -(newOffset & 3);
- } else if (!resize[u]) {
- // like TABL_INSN
- insert = u & 3;
- resize[u] = true;
- }
- // skips instruction
- u = u + 4 - (u & 3);
- u += 8 * readInt(b, u + 4) + 8;
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[u + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- u += 6;
- } else {
- u += 4;
- }
- break;
- case ClassWriter.VAR_INSN:
- case ClassWriter.SBYTE_INSN:
- case ClassWriter.LDC_INSN:
- u += 2;
- break;
- case ClassWriter.SHORT_INSN:
- case ClassWriter.LDCW_INSN:
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.TYPE_INSN:
- case ClassWriter.IINC_INSN:
- u += 3;
- break;
- case ClassWriter.ITFMETH_INSN:
- case ClassWriter.INDYMETH_INSN:
- u += 5;
- break;
- // case ClassWriter.MANA_INSN:
- default:
- u += 4;
- break;
- }
- if (insert != 0) {
- // adds a new (u, insert) entry in the allIndexes and
- // allSizes arrays
- int[] newIndexes = new int[allIndexes.length + 1];
- int[] newSizes = new int[allSizes.length + 1];
- System.arraycopy(allIndexes, 0, newIndexes, 0,
- allIndexes.length);
- System.arraycopy(allSizes, 0, newSizes, 0, allSizes.length);
- newIndexes[allIndexes.length] = u;
- newSizes[allSizes.length] = insert;
- allIndexes = newIndexes;
- allSizes = newSizes;
- if (insert > 0) {
- state = 3;
- }
- }
- }
- if (state < 3) {
- --state;
- }
- } while (state != 0);
-
- // 2nd step:
- // copies the bytecode of the method into a new bytevector, updates the
- // offsets, and inserts (or removes) bytes as requested.
-
- ByteVector newCode = new ByteVector(code.length);
-
- u = 0;
- while (u < code.length) {
- int opcode = b[u] & 0xFF;
- switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- case ClassWriter.IMPLVAR_INSN:
- newCode.putByte(opcode);
- u += 1;
- break;
- case ClassWriter.LABEL_INSN:
- if (opcode > 201) {
- // changes temporary opcodes 202 to 217 (inclusive), 218
- // and 219 to IFEQ ... JSR (inclusive), IFNULL and
- // IFNONNULL
- opcode = opcode < 218 ? opcode - 49 : opcode - 20;
- label = u + readUnsignedShort(b, u + 1);
- } else {
- label = u + readShort(b, u + 1);
- }
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- if (resize[u]) {
- // replaces GOTO with GOTO_W, JSR with JSR_W and IFxxx
- // <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is
- // the "opposite" opcode of IFxxx (i.e., IFNE for IFEQ)
- // and where <l'> designates the instruction just after
- // the GOTO_W.
- if (opcode == Opcodes.GOTO) {
- newCode.putByte(200); // GOTO_W
- } else if (opcode == Opcodes.JSR) {
- newCode.putByte(201); // JSR_W
- } else {
- newCode.putByte(opcode <= 166 ? ((opcode + 1) ^ 1) - 1
- : opcode ^ 1);
- newCode.putShort(8); // jump offset
- newCode.putByte(200); // GOTO_W
- // newOffset now computed from start of GOTO_W
- newOffset -= 3;
- }
- newCode.putInt(newOffset);
- } else {
- newCode.putByte(opcode);
- newCode.putShort(newOffset);
- }
- u += 3;
- break;
- case ClassWriter.LABELW_INSN:
- label = u + readInt(b, u + 1);
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- newCode.putByte(opcode);
- newCode.putInt(newOffset);
- u += 5;
- break;
- case ClassWriter.TABL_INSN:
- // skips 0 to 3 padding bytes
- v = u;
- u = u + 4 - (v & 3);
- // reads and copies instruction
- newCode.putByte(Opcodes.TABLESWITCH);
- newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- j = readInt(b, u);
- u += 4;
- newCode.putInt(j);
- j = readInt(b, u) - j + 1;
- u += 4;
- newCode.putInt(readInt(b, u - 4));
- for (; j > 0; --j) {
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- }
- break;
- case ClassWriter.LOOK_INSN:
- // skips 0 to 3 padding bytes
- v = u;
- u = u + 4 - (v & 3);
- // reads and copies instruction
- newCode.putByte(Opcodes.LOOKUPSWITCH);
- newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- j = readInt(b, u);
- u += 4;
- newCode.putInt(j);
- for (; j > 0; --j) {
- newCode.putInt(readInt(b, u));
- u += 4;
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- }
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[u + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- newCode.putByteArray(b, u, 6);
- u += 6;
- } else {
- newCode.putByteArray(b, u, 4);
- u += 4;
- }
- break;
- case ClassWriter.VAR_INSN:
- case ClassWriter.SBYTE_INSN:
- case ClassWriter.LDC_INSN:
- newCode.putByteArray(b, u, 2);
- u += 2;
- break;
- case ClassWriter.SHORT_INSN:
- case ClassWriter.LDCW_INSN:
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.TYPE_INSN:
- case ClassWriter.IINC_INSN:
- newCode.putByteArray(b, u, 3);
- u += 3;
- break;
- case ClassWriter.ITFMETH_INSN:
- case ClassWriter.INDYMETH_INSN:
- newCode.putByteArray(b, u, 5);
- u += 5;
- break;
- // case MANA_INSN:
- default:
- newCode.putByteArray(b, u, 4);
- u += 4;
- break;
- }
- }
-
- // updates the stack map frame labels
- if (compute == FRAMES) {
- Label l = labels;
- while (l != null) {
- /*
- * Detects the labels that are just after an IF instruction that
- * has been resized with the IFNOT GOTO_W pattern. These labels
- * are now the target of a jump instruction (the IFNOT
- * instruction). Note that we need the original label position
- * here. getNewOffset must therefore never have been called for
- * this label.
- */
- u = l.position - 3;
- if (u >= 0 && resize[u]) {
- l.status |= Label.TARGET;
- }
- getNewOffset(allIndexes, allSizes, l);
- l = l.successor;
- }
- // Update the offsets in the uninitialized types
- if (cw.typeTable != null) {
- for (i = 0; i < cw.typeTable.length; ++i) {
- Item item = cw.typeTable[i];
- if (item != null && item.type == ClassWriter.TYPE_UNINIT) {
- item.intVal = getNewOffset(allIndexes, allSizes, 0,
- item.intVal);
- }
- }
- }
- // The stack map frames are not serialized yet, so we don't need
- // to update them. They will be serialized in visitMaxs.
- } else if (frameCount > 0) {
- /*
- * Resizing an existing stack map frame table is really hard. Not
- * only the table must be parsed to update the offets, but new
- * frames may be needed for jump instructions that were inserted by
- * this method. And updating the offsets or inserting frames can
- * change the format of the following frames, in case of packed
- * frames. In practice the whole table must be recomputed. For this
- * the frames are marked as potentially invalid. This will cause the
- * whole class to be reread and rewritten with the COMPUTE_FRAMES
- * option (see the ClassWriter.toByteArray method). This is not very
- * efficient but is much easier and requires much less code than any
- * other method I can think of.
- */
- cw.invalidFrames = true;
- }
- // updates the exception handler block labels
- Handler h = firstHandler;
- while (h != null) {
- getNewOffset(allIndexes, allSizes, h.start);
- getNewOffset(allIndexes, allSizes, h.end);
- getNewOffset(allIndexes, allSizes, h.handler);
- h = h.next;
- }
- // updates the instructions addresses in the
- // local var and line number tables
- for (i = 0; i < 2; ++i) {
- ByteVector bv = i == 0 ? localVar : localVarType;
- if (bv != null) {
- b = bv.data;
- u = 0;
- while (u < bv.length) {
- label = readUnsignedShort(b, u);
- newOffset = getNewOffset(allIndexes, allSizes, 0, label);
- writeShort(b, u, newOffset);
- label += readUnsignedShort(b, u + 2);
- newOffset = getNewOffset(allIndexes, allSizes, 0, label)
- - newOffset;
- writeShort(b, u + 2, newOffset);
- u += 10;
- }
- }
- }
- if (lineNumber != null) {
- b = lineNumber.data;
- u = 0;
- while (u < lineNumber.length) {
- writeShort(
- b,
- u,
- getNewOffset(allIndexes, allSizes, 0,
- readUnsignedShort(b, u)));
- u += 4;
- }
- }
- // updates the labels of the other attributes
- Attribute attr = cattrs;
- while (attr != null) {
- Label[] labels = attr.getLabels();
- if (labels != null) {
- for (i = labels.length - 1; i >= 0; --i) {
- getNewOffset(allIndexes, allSizes, labels[i]);
- }
- }
- attr = attr.next;
- }
-
- // replaces old bytecodes with new ones
- code = newCode;
+ if (lastRuntimeInvisibleParameterAnnotations != null) {
+ size +=
+ AnnotationWriter.computeParameterAnnotationsSize(
+ Constants.RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS,
+ lastRuntimeInvisibleParameterAnnotations,
+ invisibleAnnotableParameterCount == 0
+ ? lastRuntimeInvisibleParameterAnnotations.length
+ : invisibleAnnotableParameterCount);
}
-
- /**
- * Reads an unsigned short value in the given byte array.
- *
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
- * @return the read value.
- */
- static int readUnsignedShort(final byte[] b, final int index) {
- return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
+ if (defaultValue != null) {
+ symbolTable.addConstantUtf8(Constants.ANNOTATION_DEFAULT);
+ size += 6 + defaultValue.length;
}
-
- /**
- * Reads a signed short value in the given byte array.
- *
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
- * @return the read value.
- */
- static short readShort(final byte[] b, final int index) {
- return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
+ if (parameters != null) {
+ symbolTable.addConstantUtf8(Constants.METHOD_PARAMETERS);
+ // 6 header bytes and 1 byte for parameters_count.
+ size += 7 + parameters.length;
}
-
- /**
- * Reads a signed int value in the given byte array.
- *
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
- * @return the read value.
- */
- static int readInt(final byte[] b, final int index) {
- return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
- | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
+ if (firstAttribute != null) {
+ size += firstAttribute.computeAttributesSize(symbolTable);
}
+ return size;
+ }
- /**
- * Writes a short value in the given byte array.
- *
- * @param b
- * a byte array.
- * @param index
- * where the first byte of the short value must be written.
- * @param s
- * the value to be written in the given byte array.
- */
- static void writeShort(final byte[] b, final int index, final int s) {
- b[index] = (byte) (s >>> 8);
- b[index + 1] = (byte) s;
+ /**
+ * Puts the content of the method_info JVMS structure generated by this MethodWriter into the
+ * given ByteVector.
+ *
+ * @param output where the method_info structure must be put.
+ */
+ void putMethodInfo(final ByteVector output) {
+ boolean useSyntheticAttribute = symbolTable.getMajorVersion() < Opcodes.V1_5;
+ int mask = useSyntheticAttribute ? Opcodes.ACC_SYNTHETIC : 0;
+ output.putShort(accessFlags & ~mask).putShort(nameIndex).putShort(descriptorIndex);
+ // If this method_info must be copied from an existing one, copy it now and return early.
+ if (sourceOffset != 0) {
+ output.putByteArray(symbolTable.getSource().classFileBuffer, sourceOffset, sourceLength);
+ return;
}
+ // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
+ int attributeCount = 0;
+ if (code.length > 0) {
+ ++attributeCount;
+ }
+ if (numberOfExceptions > 0) {
+ ++attributeCount;
+ }
+ if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && useSyntheticAttribute) {
+ ++attributeCount;
+ }
+ if (signatureIndex != 0) {
+ ++attributeCount;
+ }
+ if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
+ ++attributeCount;
+ }
+ if (lastRuntimeVisibleAnnotation != null) {
+ ++attributeCount;
+ }
+ if (lastRuntimeInvisibleAnnotation != null) {
+ ++attributeCount;
+ }
+ if (lastRuntimeVisibleParameterAnnotations != null) {
+ ++attributeCount;
+ }
+ if (lastRuntimeInvisibleParameterAnnotations != null) {
+ ++attributeCount;
+ }
+ if (lastRuntimeVisibleTypeAnnotation != null) {
+ ++attributeCount;
+ }
+ if (lastRuntimeInvisibleTypeAnnotation != null) {
+ ++attributeCount;
+ }
+ if (defaultValue != null) {
+ ++attributeCount;
+ }
+ if (parameters != null) {
+ ++attributeCount;
+ }
+ if (firstAttribute != null) {
+ attributeCount += firstAttribute.getAttributeCount();
+ }
+ // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
+ output.putShort(attributeCount);
+ if (code.length > 0) {
+ // 2, 2, 4 and 2 bytes respectively for max_stack, max_locals, code_length and
+ // attributes_count, plus the bytecode and the exception table.
+ int size = 10 + code.length + Handler.getExceptionTableSize(firstHandler);
+ int codeAttributeCount = 0;
+ if (stackMapTableEntries != null) {
+ // 6 header bytes and 2 bytes for number_of_entries.
+ size += 8 + stackMapTableEntries.length;
+ ++codeAttributeCount;
+ }
+ if (lineNumberTable != null) {
+ // 6 header bytes and 2 bytes for line_number_table_length.
+ size += 8 + lineNumberTable.length;
+ ++codeAttributeCount;
+ }
+ if (localVariableTable != null) {
+ // 6 header bytes and 2 bytes for local_variable_table_length.
+ size += 8 + localVariableTable.length;
+ ++codeAttributeCount;
+ }
+ if (localVariableTypeTable != null) {
+ // 6 header bytes and 2 bytes for local_variable_type_table_length.
+ size += 8 + localVariableTypeTable.length;
+ ++codeAttributeCount;
+ }
+ if (lastCodeRuntimeVisibleTypeAnnotation != null) {
+ size +=
+ lastCodeRuntimeVisibleTypeAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS);
+ ++codeAttributeCount;
+ }
+ if (lastCodeRuntimeInvisibleTypeAnnotation != null) {
+ size +=
+ lastCodeRuntimeInvisibleTypeAnnotation.computeAnnotationsSize(
+ Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS);
+ ++codeAttributeCount;
+ }
+ if (firstCodeAttribute != null) {
+ size +=
+ firstCodeAttribute.computeAttributesSize(
+ symbolTable, code.data, code.length, maxStack, maxLocals);
+ codeAttributeCount += firstCodeAttribute.getAttributeCount();
+ }
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.CODE))
+ .putInt(size)
+ .putShort(maxStack)
+ .putShort(maxLocals)
+ .putInt(code.length)
+ .putByteArray(code.data, 0, code.length);
+ Handler.putExceptionTable(firstHandler, output);
+ output.putShort(codeAttributeCount);
+ if (stackMapTableEntries != null) {
+ boolean useStackMapTable = symbolTable.getMajorVersion() >= Opcodes.V1_6;
+ output
+ .putShort(
+ symbolTable.addConstantUtf8(
+ useStackMapTable ? Constants.STACK_MAP_TABLE : "StackMap"))
+ .putInt(2 + stackMapTableEntries.length)
+ .putShort(stackMapTableNumberOfEntries)
+ .putByteArray(stackMapTableEntries.data, 0, stackMapTableEntries.length);
+ }
+ if (lineNumberTable != null) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.LINE_NUMBER_TABLE))
+ .putInt(2 + lineNumberTable.length)
+ .putShort(lineNumberTableLength)
+ .putByteArray(lineNumberTable.data, 0, lineNumberTable.length);
+ }
+ if (localVariableTable != null) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.LOCAL_VARIABLE_TABLE))
+ .putInt(2 + localVariableTable.length)
+ .putShort(localVariableTableLength)
+ .putByteArray(localVariableTable.data, 0, localVariableTable.length);
+ }
+ if (localVariableTypeTable != null) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.LOCAL_VARIABLE_TYPE_TABLE))
+ .putInt(2 + localVariableTypeTable.length)
+ .putShort(localVariableTypeTableLength)
+ .putByteArray(localVariableTypeTable.data, 0, localVariableTypeTable.length);
+ }
+ if (lastCodeRuntimeVisibleTypeAnnotation != null) {
+ lastCodeRuntimeVisibleTypeAnnotation.putAnnotations(
+ symbolTable.addConstantUtf8(Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS), output);
+ }
+ if (lastCodeRuntimeInvisibleTypeAnnotation != null) {
+ lastCodeRuntimeInvisibleTypeAnnotation.putAnnotations(
+ symbolTable.addConstantUtf8(Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS), output);
+ }
+ if (firstCodeAttribute != null) {
+ firstCodeAttribute.putAttributes(
+ symbolTable, code.data, code.length, maxStack, maxLocals, output);
+ }
+ }
+ if (numberOfExceptions > 0) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.EXCEPTIONS))
+ .putInt(2 + 2 * numberOfExceptions)
+ .putShort(numberOfExceptions);
+ for (int exceptionIndex : exceptionIndexTable) {
+ output.putShort(exceptionIndex);
+ }
+ }
+ Attribute.putAttributes(symbolTable, accessFlags, signatureIndex, output);
+ AnnotationWriter.putAnnotations(
+ symbolTable,
+ lastRuntimeVisibleAnnotation,
+ lastRuntimeInvisibleAnnotation,
+ lastRuntimeVisibleTypeAnnotation,
+ lastRuntimeInvisibleTypeAnnotation,
+ output);
+ if (lastRuntimeVisibleParameterAnnotations != null) {
+ AnnotationWriter.putParameterAnnotations(
+ symbolTable.addConstantUtf8(Constants.RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS),
+ lastRuntimeVisibleParameterAnnotations,
+ visibleAnnotableParameterCount == 0
+ ? lastRuntimeVisibleParameterAnnotations.length
+ : visibleAnnotableParameterCount,
+ output);
+ }
+ if (lastRuntimeInvisibleParameterAnnotations != null) {
+ AnnotationWriter.putParameterAnnotations(
+ symbolTable.addConstantUtf8(Constants.RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS),
+ lastRuntimeInvisibleParameterAnnotations,
+ invisibleAnnotableParameterCount == 0
+ ? lastRuntimeInvisibleParameterAnnotations.length
+ : invisibleAnnotableParameterCount,
+ output);
+ }
+ if (defaultValue != null) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.ANNOTATION_DEFAULT))
+ .putInt(defaultValue.length)
+ .putByteArray(defaultValue.data, 0, defaultValue.length);
+ }
+ if (parameters != null) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.METHOD_PARAMETERS))
+ .putInt(1 + parameters.length)
+ .putByte(parametersCount)
+ .putByteArray(parameters.data, 0, parameters.length);
+ }
+ if (firstAttribute != null) {
+ firstAttribute.putAttributes(symbolTable, output);
+ }
+ }
- /**
- * Computes the future value of a bytecode offset.
- * <p>
- * Note: it is possible to have several entries for the same instruction in
- * the <tt>indexes</tt> and <tt>sizes</tt>: two entries (index=a,size=b) and
- * (index=a,size=b') are equivalent to a single entry (index=a,size=b+b').
- *
- * @param indexes
- * current positions of the instructions to be resized. Each
- * instruction must be designated by the index of its <i>last</i>
- * byte, plus one (or, in other words, by the index of the
- * <i>first</i> byte of the <i>next</i> instruction).
- * @param sizes
- * the number of bytes to be <i>added</i> to the above
- * instructions. More precisely, for each i < <tt>len</tt>,
- * <tt>sizes</tt>[i] bytes will be added at the end of the
- * instruction designated by <tt>indexes</tt>[i] or, if
- * <tt>sizes</tt>[i] is negative, the <i>last</i> |
- * <tt>sizes[i]</tt>| bytes of the instruction will be removed
- * (the instruction size <i>must not</i> become negative or
- * null).
- * @param begin
- * index of the first byte of the source instruction.
- * @param end
- * index of the first byte of the target instruction.
- * @return the future value of the given bytecode offset.
- */
- static int getNewOffset(final int[] indexes, final int[] sizes,
- final int begin, final int end) {
- int offset = end - begin;
- for (int i = 0; i < indexes.length; ++i) {
- if (begin < indexes[i] && indexes[i] <= end) {
- // forward jump
- offset += sizes[i];
- } else if (end < indexes[i] && indexes[i] <= begin) {
- // backward jump
- offset -= sizes[i];
- }
- }
- return offset;
- }
-
- /**
- * Updates the offset of the given label.
- *
- * @param indexes
- * current positions of the instructions to be resized. Each
- * instruction must be designated by the index of its <i>last</i>
- * byte, plus one (or, in other words, by the index of the
- * <i>first</i> byte of the <i>next</i> instruction).
- * @param sizes
- * the number of bytes to be <i>added</i> to the above
- * instructions. More precisely, for each i < <tt>len</tt>,
- * <tt>sizes</tt>[i] bytes will be added at the end of the
- * instruction designated by <tt>indexes</tt>[i] or, if
- * <tt>sizes</tt>[i] is negative, the <i>last</i> |
- * <tt>sizes[i]</tt>| bytes of the instruction will be removed
- * (the instruction size <i>must not</i> become negative or
- * null).
- * @param label
- * the label whose offset must be updated.
- */
- static void getNewOffset(final int[] indexes, final int[] sizes,
- final Label label) {
- if ((label.status & Label.RESIZED) == 0) {
- label.position = getNewOffset(indexes, sizes, 0, label.position);
- label.status |= Label.RESIZED;
- }
- }
+ /**
+ * Collects the attributes of this method into the given set of attribute prototypes.
+ *
+ * @param attributePrototypes a set of attribute prototypes.
+ */
+ final void collectAttributePrototypes(final Attribute.Set attributePrototypes) {
+ attributePrototypes.addAttributes(firstAttribute);
+ attributePrototypes.addAttributes(firstCodeAttribute);
+ }
}
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
new file mode 100644
index 0000000..4a7f8fa
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ModuleVisitor.java
@@ -0,0 +1,174 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java module. The methods of this class must be called in the following
+ * order: ( {@code visitMainClass} | ( {@code visitPackage} | {@code visitRequire} | {@code
+ * visitExport} | {@code visitOpen} | {@code visitUse} | {@code visitProvide} )* ) {@code visitEnd}.
+ *
+ * @author Remi Forax
+ * @author Eric Bruneton
+ */
+public abstract class ModuleVisitor {
+ /**
+ * The ASM API version implemented by this visitor. The value of this field must be one of {@link
+ * Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ */
+ protected final int api;
+
+ /** The module visitor to which this visitor must delegate method calls. May be null. */
+ protected ModuleVisitor mv;
+
+ /**
+ * Constructs a new {@link 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) {
+ this(api, null);
+ }
+
+ /**
+ * Constructs a new {@link ModuleVisitor}.
+ *
+ * @param api the ASM API version implemented by this visitor. Must be one of {@link Opcodes#ASM6}
+ * or {@link Opcodes#ASM7}.
+ * @param moduleVisitor the module visitor to which this visitor must delegate method calls. May
+ * be null.
+ */
+ public ModuleVisitor(final int api, final ModuleVisitor moduleVisitor) {
+ if (api != Opcodes.ASM7 && api != Opcodes.ASM6) {
+ throw new IllegalArgumentException("Unsupported api " + api);
+ }
+ this.api = api;
+ this.mv = moduleVisitor;
+ }
+
+ /**
+ * Visit the main class of the current module.
+ *
+ * @param mainClass the internal name of the main class of the current module.
+ */
+ public void visitMainClass(final String mainClass) {
+ if (mv != null) {
+ mv.visitMainClass(mainClass);
+ }
+ }
+
+ /**
+ * Visit a package of the current module.
+ *
+ * @param packaze the internal name of a package.
+ */
+ public void visitPackage(final String packaze) {
+ if (mv != null) {
+ mv.visitPackage(packaze);
+ }
+ }
+
+ /**
+ * Visits a dependence of the current module.
+ *
+ * @param module the fully qualified name (using dots) of the dependence.
+ * @param access the access flag of the dependence among {@code ACC_TRANSITIVE}, {@code
+ * ACC_STATIC_PHASE}, {@code ACC_SYNTHETIC} and {@code ACC_MANDATED}.
+ * @param version the module version at compile time, or {@literal null}.
+ */
+ public void visitRequire(final String module, final int access, final String version) {
+ if (mv != null) {
+ mv.visitRequire(module, access, version);
+ }
+ }
+
+ /**
+ * Visit an exported package of the current module.
+ *
+ * @param packaze the internal name of the exported package.
+ * @param access the access flag of the exported package, valid values are among {@code
+ * ACC_SYNTHETIC} and {@code ACC_MANDATED}.
+ * @param modules the fully qualified names (using dots) of the modules that can access the public
+ * classes of the exported package, or {@literal null}.
+ */
+ public void visitExport(final String packaze, final int access, final String... modules) {
+ if (mv != null) {
+ mv.visitExport(packaze, access, modules);
+ }
+ }
+
+ /**
+ * Visit an open package of the current module.
+ *
+ * @param packaze the internal name of the opened package.
+ * @param access the access flag of the opened package, valid values are among {@code
+ * ACC_SYNTHETIC} and {@code ACC_MANDATED}.
+ * @param modules the fully qualified names (using dots) of the modules that can use deep
+ * reflection to the classes of the open package, or {@literal null}.
+ */
+ public void visitOpen(final String packaze, final int access, final String... modules) {
+ if (mv != null) {
+ mv.visitOpen(packaze, access, modules);
+ }
+ }
+
+ /**
+ * Visit a service used by the current module. The name must be the internal name of an interface
+ * or a class.
+ *
+ * @param service the internal name of the service.
+ */
+ public void visitUse(final String service) {
+ if (mv != null) {
+ mv.visitUse(service);
+ }
+ }
+
+ /**
+ * Visit an implementation of a service.
+ *
+ * @param service the internal name of the service.
+ * @param providers the internal names of the implementations of the service (there is at least
+ * one provider).
+ */
+ public void visitProvide(final String service, final String... providers) {
+ if (mv != null) {
+ mv.visitProvide(service, providers);
+ }
+ }
+
+ /**
+ * Visits the end of the module. This method, which is the last one to be called, is used to
+ * inform the visitor that everything have been visited.
+ */
+ public void visitEnd() {
+ if (mv != null) {
+ mv.visitEnd();
+ }
+ }
+}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ModuleWriter.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ModuleWriter.java
new file mode 100644
index 0000000..9877ceb
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ModuleWriter.java
@@ -0,0 +1,253 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * A {@link ModuleVisitor} that generates the corresponding Module, ModulePackages and
+ * ModuleMainClass attributes, as defined in the Java Virtual Machine Specification (JVMS).
+ *
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.25">JVMS
+ * 4.7.25</a>
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.26">JVMS
+ * 4.7.26</a>
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.27">JVMS
+ * 4.7.27</a>
+ * @author Remi Forax
+ * @author Eric Bruneton
+ */
+final class ModuleWriter extends ModuleVisitor {
+
+ /** Where the constants used in this AnnotationWriter must be stored. */
+ private final SymbolTable symbolTable;
+
+ /** The module_name_index field of the JVMS Module attribute. */
+ private final int moduleNameIndex;
+
+ /** The module_flags field of the JVMS Module attribute. */
+ private final int moduleFlags;
+
+ /** The module_version_index field of the JVMS Module attribute. */
+ private final int moduleVersionIndex;
+
+ /** The requires_count field of the JVMS Module attribute. */
+ private int requiresCount;
+
+ /** The binary content of the 'requires' array of the JVMS Module attribute. */
+ private final ByteVector requires;
+
+ /** The exports_count field of the JVMS Module attribute. */
+ private int exportsCount;
+
+ /** The binary content of the 'exports' array of the JVMS Module attribute. */
+ private final ByteVector exports;
+
+ /** The opens_count field of the JVMS Module attribute. */
+ private int opensCount;
+
+ /** The binary content of the 'opens' array of the JVMS Module attribute. */
+ private final ByteVector opens;
+
+ /** The uses_count field of the JVMS Module attribute. */
+ private int usesCount;
+
+ /** The binary content of the 'uses_index' array of the JVMS Module attribute. */
+ private final ByteVector usesIndex;
+
+ /** The provides_count field of the JVMS Module attribute. */
+ private int providesCount;
+
+ /** The binary content of the 'provides' array of the JVMS Module attribute. */
+ private final ByteVector provides;
+
+ /** The provides_count field of the JVMS ModulePackages attribute. */
+ private int packageCount;
+
+ /** The binary content of the 'package_index' array of the JVMS ModulePackages attribute. */
+ private final ByteVector packageIndex;
+
+ /** The main_class_index field of the JVMS ModuleMainClass attribute, or 0. */
+ private int mainClassIndex;
+
+ ModuleWriter(final SymbolTable symbolTable, final int name, final int access, final int version) {
+ super(Opcodes.ASM7);
+ this.symbolTable = symbolTable;
+ this.moduleNameIndex = name;
+ this.moduleFlags = access;
+ this.moduleVersionIndex = version;
+ this.requires = new ByteVector();
+ this.exports = new ByteVector();
+ this.opens = new ByteVector();
+ this.usesIndex = new ByteVector();
+ this.provides = new ByteVector();
+ this.packageIndex = new ByteVector();
+ }
+
+ @Override
+ public void visitMainClass(final String mainClass) {
+ this.mainClassIndex = symbolTable.addConstantClass(mainClass).index;
+ }
+
+ @Override
+ public void visitPackage(final String packaze) {
+ packageIndex.putShort(symbolTable.addConstantPackage(packaze).index);
+ packageCount++;
+ }
+
+ @Override
+ public void visitRequire(final String module, final int access, final String version) {
+ requires
+ .putShort(symbolTable.addConstantModule(module).index)
+ .putShort(access)
+ .putShort(version == null ? 0 : symbolTable.addConstantUtf8(version));
+ requiresCount++;
+ }
+
+ @Override
+ public void visitExport(final String packaze, final int access, final String... modules) {
+ exports.putShort(symbolTable.addConstantPackage(packaze).index).putShort(access);
+ if (modules == null) {
+ exports.putShort(0);
+ } else {
+ exports.putShort(modules.length);
+ for (String module : modules) {
+ exports.putShort(symbolTable.addConstantModule(module).index);
+ }
+ }
+ exportsCount++;
+ }
+
+ @Override
+ public void visitOpen(final String packaze, final int access, final String... modules) {
+ opens.putShort(symbolTable.addConstantPackage(packaze).index).putShort(access);
+ if (modules == null) {
+ opens.putShort(0);
+ } else {
+ opens.putShort(modules.length);
+ for (String module : modules) {
+ opens.putShort(symbolTable.addConstantModule(module).index);
+ }
+ }
+ opensCount++;
+ }
+
+ @Override
+ public void visitUse(final String service) {
+ usesIndex.putShort(symbolTable.addConstantClass(service).index);
+ usesCount++;
+ }
+
+ @Override
+ public void visitProvide(final String service, final String... providers) {
+ provides.putShort(symbolTable.addConstantClass(service).index);
+ provides.putShort(providers.length);
+ for (String provider : providers) {
+ provides.putShort(symbolTable.addConstantClass(provider).index);
+ }
+ providesCount++;
+ }
+
+ @Override
+ public void visitEnd() {
+ // Nothing to do.
+ }
+
+ /**
+ * Returns the number of Module, ModulePackages and ModuleMainClass attributes generated by this
+ * ModuleWriter.
+ *
+ * @return the number of Module, ModulePackages and ModuleMainClass attributes (between 1 and 3).
+ */
+ int getAttributeCount() {
+ return 1 + (packageCount > 0 ? 1 : 0) + (mainClassIndex > 0 ? 1 : 0);
+ }
+
+ /**
+ * Returns the size of the Module, ModulePackages and ModuleMainClass attributes generated by this
+ * ModuleWriter. Also add the names of these attributes in the constant pool.
+ *
+ * @return the size in bytes of the Module, ModulePackages and ModuleMainClass attributes.
+ */
+ int computeAttributesSize() {
+ symbolTable.addConstantUtf8(Constants.MODULE);
+ // 6 attribute header bytes, 6 bytes for name, flags and version, and 5 * 2 bytes for counts.
+ int size =
+ 22 + requires.length + exports.length + opens.length + usesIndex.length + provides.length;
+ if (packageCount > 0) {
+ symbolTable.addConstantUtf8(Constants.MODULE_PACKAGES);
+ // 6 attribute header bytes, and 2 bytes for package_count.
+ size += 8 + packageIndex.length;
+ }
+ if (mainClassIndex > 0) {
+ symbolTable.addConstantUtf8(Constants.MODULE_MAIN_CLASS);
+ // 6 attribute header bytes, and 2 bytes for main_class_index.
+ size += 8;
+ }
+ return size;
+ }
+
+ /**
+ * Puts the Module, ModulePackages and ModuleMainClass attributes generated by this ModuleWriter
+ * in the given ByteVector.
+ *
+ * @param output where the attributes must be put.
+ */
+ void putAttributes(final ByteVector output) {
+ // 6 bytes for name, flags and version, and 5 * 2 bytes for counts.
+ int moduleAttributeLength =
+ 16 + requires.length + exports.length + opens.length + usesIndex.length + provides.length;
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.MODULE))
+ .putInt(moduleAttributeLength)
+ .putShort(moduleNameIndex)
+ .putShort(moduleFlags)
+ .putShort(moduleVersionIndex)
+ .putShort(requiresCount)
+ .putByteArray(requires.data, 0, requires.length)
+ .putShort(exportsCount)
+ .putByteArray(exports.data, 0, exports.length)
+ .putShort(opensCount)
+ .putByteArray(opens.data, 0, opens.length)
+ .putShort(usesCount)
+ .putByteArray(usesIndex.data, 0, usesIndex.length)
+ .putShort(providesCount)
+ .putByteArray(provides.data, 0, provides.length);
+ if (packageCount > 0) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.MODULE_PACKAGES))
+ .putInt(2 + packageIndex.length)
+ .putShort(packageCount)
+ .putByteArray(packageIndex.data, 0, packageIndex.length);
+ }
+ if (mainClassIndex > 0) {
+ output
+ .putShort(symbolTable.addConstantUtf8(Constants.MODULE_MAIN_CLASS))
+ .putInt(2)
+ .putShort(mainClassIndex);
+ }
+ }
+}
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 3532da6..41353c6 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
@@ -1,366 +1,546 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
/**
- * Defines the JVM opcodes, access flags and array type codes. This interface
- * does not define all the JVM opcodes because some opcodes are automatically
- * handled. For example, the xLOAD and xSTORE opcodes are automatically replaced
- * by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and xSTORE_n
- * opcodes are therefore not defined in this interface. Likewise for LDC,
- * automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and
- * JSR_W.
+ * The JVM opcodes, access flags and array type codes. This interface does not define all the JVM
+ * opcodes because some opcodes are automatically handled. For example, the xLOAD and xSTORE opcodes
+ * are automatically replaced by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and
+ * xSTORE_n opcodes are therefore not defined in this interface. Likewise for LDC, automatically
+ * replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and JSR_W.
*
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-6.html">JVMS 6</a>
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
+// DontCheck(InterfaceIsType): can't be fixed (for backward binary compatibility).
public interface Opcodes {
- // ASM API versions
+ // ASM API versions.
- int ASM4 = 4 << 16 | 0 << 8 | 0;
- int ASM5 = 5 << 16 | 0 << 8 | 0;
+ int ASM4 = 4 << 16 | 0 << 8;
+ int ASM5 = 5 << 16 | 0 << 8;
+ int ASM6 = 6 << 16 | 0 << 8;
+ int ASM7 = 7 << 16 | 0 << 8;
- // versions
+ /*
+ * Internal flags used to redirect calls to deprecated methods. For instance, if a visitOldStuff
+ * method in API_OLD is deprecated and replaced with visitNewStuff in API_NEW, then the
+ * redirection should be done as follows:
+ *
+ * <pre>
+ * public class StuffVisitor {
+ * ...
+ *
+ * @Deprecated public void visitOldStuff(int arg, ...) {
+ * // SOURCE_DEPRECATED means "a call from a deprecated method using the old 'api' value".
+ * visitNewStuf(arg | (api < API_NEW ? SOURCE_DEPRECATED : 0), ...);
+ * }
+ *
+ * public void visitNewStuff(int argAndSource, ...) {
+ * if (api < API_NEW && (argAndSource & SOURCE_DEPRECATED) == 0) {
+ * visitOldStuff(argAndSource, ...);
+ * } else {
+ * int arg = argAndSource & ~SOURCE_MASK;
+ * [ do stuff ]
+ * }
+ * }
+ * }
+ * </pre>
+ *
+ * <p>If 'api' is equal to API_NEW, there are two cases:
+ *
+ * <ul>
+ * <li>call visitNewStuff: the redirection test is skipped and 'do stuff' is executed directly.
+ * <li>call visitOldSuff: the source is not set to SOURCE_DEPRECATED before calling
+ * visitNewStuff, but the redirection test is skipped anyway in visitNewStuff, which
+ * directly executes 'do stuff'.
+ * </ul>
+ *
+ * <p>If 'api' is equal to API_OLD, there are two cases:
+ *
+ * <ul>
+ * <li>call visitOldSuff: the source is set to SOURCE_DEPRECATED before calling visitNewStuff.
+ * Because of this visitNewStuff does not redirect back to visitOldStuff, and instead
+ * executes 'do stuff'.
+ * <li>call visitNewStuff: the call is redirected to visitOldStuff because the source is 0.
+ * visitOldStuff now sets the source to SOURCE_DEPRECATED and calls visitNewStuff back. This
+ * time visitNewStuff does not redirect the call, and instead executes 'do stuff'.
+ * </ul>
+ *
+ * <h1>User subclasses</h1>
+ *
+ * <p>If a user subclass overrides one of these methods, there are only two cases: either 'api' is
+ * API_OLD and visitOldStuff is overridden (and visitNewStuff is not), or 'api' is API_NEW or
+ * more, and visitNewStuff is overridden (and visitOldStuff is not). Any other case is a user
+ * programming error.
+ *
+ * <p>If 'api' is equal to API_NEW, the class hierarchy is equivalent to
+ *
+ * <pre>
+ * public class StuffVisitor {
+ * @Deprecated public void visitOldStuff(int arg, ...) { visitNewStuf(arg, ...); }
+ * public void visitNewStuff(int arg, ...) { [ do stuff ] }
+ * }
+ * class UserStuffVisitor extends StuffVisitor {
+ * @Override public void visitNewStuff(int arg, ...) {
+ * super.visitNewStuff(int arg, ...); // optional
+ * [ do user stuff ]
+ * }
+ * }
+ * </pre>
+ *
+ * <p>It is then obvious that whether visitNewStuff or visitOldStuff is called, 'do stuff' and 'do
+ * user stuff' will be executed, in this order.
+ *
+ * <p>If 'api' is equal to API_OLD, the class hierarchy is equivalent to
+ *
+ * <pre>
+ * public class StuffVisitor {
+ * @Deprecated public void visitOldStuff(int arg, ...) {
+ * visitNewStuf(arg | SOURCE_DEPRECATED, ...);
+ * }
+ * public void visitNewStuff(int argAndSource...) {
+ * if ((argAndSource & SOURCE_DEPRECATED) == 0) {
+ * visitOldStuff(argAndSource, ...);
+ * } else {
+ * int arg = argAndSource & ~SOURCE_MASK;
+ * [ do stuff ]
+ * }
+ * }
+ * }
+ * class UserStuffVisitor extends StuffVisitor {
+ * @Override public void visitOldStuff(int arg, ...) {
+ * super.visitOldStuff(int arg, ...); // optional
+ * [ do user stuff ]
+ * }
+ * }
+ * </pre>
+ *
+ * <p>and there are two cases:
+ *
+ * <ul>
+ * <li>call visitOldSuff: in the call to super.visitOldStuff, the source is set to
+ * SOURCE_DEPRECATED and visitNewStuff is called. Here 'do stuff' is run because the source
+ * was previously set to SOURCE_DEPRECATED, and execution eventually returns to
+ * UserStuffVisitor.visitOldStuff, where 'do user stuff' is run.
+ * <li>call visitNewStuff: the call is redirected to UserStuffVisitor.visitOldStuff because the
+ * source is 0. Execution continues as in the previous case, resulting in 'do stuff' and 'do
+ * user stuff' being executed, in this order.
+ * </ul>
+ *
+ * <h1>ASM subclasses</h1>
+ *
+ * <p>In ASM packages, subclasses of StuffVisitor can typically be sub classed again by the user,
+ * and can be used with API_OLD or API_NEW. Because of this, if such a subclass must override
+ * visitNewStuff, it must do so in the following way (and must not override visitOldStuff):
+ *
+ * <pre>
+ * public class AsmStuffVisitor extends StuffVisitor {
+ * @Override public void visitNewStuff(int argAndSource, ...) {
+ * if (api < API_NEW && (argAndSource & SOURCE_DEPRECATED) == 0) {
+ * super.visitNewStuff(argAndSource, ...);
+ * return;
+ * }
+ * super.visitNewStuff(argAndSource, ...); // optional
+ * int arg = argAndSource & ~SOURCE_MASK;
+ * [ do other stuff ]
+ * }
+ * }
+ * </pre>
+ *
+ * <p>If a user class extends this with 'api' equal to API_NEW, the class hierarchy is equivalent
+ * to
+ *
+ * <pre>
+ * public class StuffVisitor {
+ * @Deprecated public void visitOldStuff(int arg, ...) { visitNewStuf(arg, ...); }
+ * public void visitNewStuff(int arg, ...) { [ do stuff ] }
+ * }
+ * public class AsmStuffVisitor extends StuffVisitor {
+ * @Override public void visitNewStuff(int arg, ...) {
+ * super.visitNewStuff(arg, ...);
+ * [ do other stuff ]
+ * }
+ * }
+ * class UserStuffVisitor extends StuffVisitor {
+ * @Override public void visitNewStuff(int arg, ...) {
+ * super.visitNewStuff(int arg, ...);
+ * [ do user stuff ]
+ * }
+ * }
+ * </pre>
+ *
+ * <p>It is then obvious that whether visitNewStuff or visitOldStuff is called, 'do stuff', 'do
+ * other stuff' and 'do user stuff' will be executed, in this order. If, on the other hand, a user
+ * class extends AsmStuffVisitor with 'api' equal to API_OLD, the class hierarchy is equivalent to
+ *
+ * <pre>
+ * public class StuffVisitor {
+ * @Deprecated public void visitOldStuff(int arg, ...) {
+ * visitNewStuf(arg | SOURCE_DEPRECATED, ...);
+ * }
+ * public void visitNewStuff(int argAndSource, ...) {
+ * if ((argAndSource & SOURCE_DEPRECATED) == 0) {
+ * visitOldStuff(argAndSource, ...);
+ * } else {
+ * int arg = argAndSource & ~SOURCE_MASK;
+ * [ do stuff ]
+ * }
+ * }
+ * }
+ * public class AsmStuffVisitor extends StuffVisitor {
+ * @Override public void visitNewStuff(int argAndSource, ...) {
+ * if ((argAndSource & SOURCE_DEPRECATED) == 0) {
+ * super.visitNewStuff(argAndSource, ...);
+ * return;
+ * }
+ * super.visitNewStuff(argAndSource, ...); // optional
+ * int arg = argAndSource & ~SOURCE_MASK;
+ * [ do other stuff ]
+ * }
+ * }
+ * class UserStuffVisitor extends StuffVisitor {
+ * @Override public void visitOldStuff(int arg, ...) {
+ * super.visitOldStuff(arg, ...);
+ * [ do user stuff ]
+ * }
+ * }
+ * </pre>
+ *
+ * <p>and, here again, whether visitNewStuff or visitOldStuff is called, 'do stuff', 'do other
+ * stuff' and 'do user stuff' will be executed, in this order (exercise left to the reader).
+ *
+ * <h1>Notes</h1>
+ *
+ * <ul>
+ * <li>the SOURCE_DEPRECATED flag is set only if 'api' is API_OLD, just before calling
+ * visitNewStuff. By hypothesis, this method is not overridden by the user. Therefore, user
+ * classes can never see this flag. Only ASM subclasses must take care of extracting the
+ * actual argument value by clearing the source flags.
+ * <li>because the SOURCE_DEPRECATED flag is immediately cleared in the caller, the caller can
+ * call visitOldStuff or visitNewStuff (in 'do stuff' and 'do user stuff') on a delegate
+ * visitor without any risks (breaking the redirection logic, "leaking" the flag, etc).
+ * <li>all the scenarios discussed above are unit tested in MethodVisitorTest.
+ * </ul>
+ */
- int V1_1 = 3 << 16 | 45;
- int V1_2 = 0 << 16 | 46;
- int V1_3 = 0 << 16 | 47;
- int V1_4 = 0 << 16 | 48;
- int V1_5 = 0 << 16 | 49;
- int V1_6 = 0 << 16 | 50;
- int V1_7 = 0 << 16 | 51;
- int V1_8 = 0 << 16 | 52;
- // added "support" for java 9, 10, 11, 12 compiled classes
- int V9 = 0 << 16 | 53;
- int V10 = 0 << 16 | 54;
- int V11 = 0 << 16 | 55;
- int V12 = 0 << 16 | 56;
+ int SOURCE_DEPRECATED = 0x100;
+ int SOURCE_MASK = SOURCE_DEPRECATED;
- // access flags
+ // Java ClassFile versions (the minor version is stored in the 16 most significant bits, and the
+ // major version in the 16 least significant bits).
- int ACC_PUBLIC = 0x0001; // class, field, method
- int ACC_PRIVATE = 0x0002; // class, field, method
- int ACC_PROTECTED = 0x0004; // class, field, method
- int ACC_STATIC = 0x0008; // field, method
- int ACC_FINAL = 0x0010; // class, field, method, parameter
- int ACC_SUPER = 0x0020; // class
- int ACC_SYNCHRONIZED = 0x0020; // method
- int ACC_VOLATILE = 0x0040; // field
- int ACC_BRIDGE = 0x0040; // method
- int ACC_VARARGS = 0x0080; // method
- int ACC_TRANSIENT = 0x0080; // field
- int ACC_NATIVE = 0x0100; // method
- int ACC_INTERFACE = 0x0200; // class
- int ACC_ABSTRACT = 0x0400; // class, method
- int ACC_STRICT = 0x0800; // method
- int ACC_SYNTHETIC = 0x1000; // class, field, method, parameter
- int ACC_ANNOTATION = 0x2000; // class
- int ACC_ENUM = 0x4000; // class(?) field inner
- int ACC_MANDATED = 0x8000; // parameter
+ int V1_1 = 3 << 16 | 45;
+ int V1_2 = 0 << 16 | 46;
+ int V1_3 = 0 << 16 | 47;
+ int V1_4 = 0 << 16 | 48;
+ int V1_5 = 0 << 16 | 49;
+ int V1_6 = 0 << 16 | 50;
+ int V1_7 = 0 << 16 | 51;
+ int V1_8 = 0 << 16 | 52;
+ int V9 = 0 << 16 | 53;
+ int V10 = 0 << 16 | 54;
+ int V11 = 0 << 16 | 55;
+ int V12 = 0 << 16 | 56;
+ int V13 = 0 << 16 | 57;
+ int V14 = 0 << 16 | 58;
- // ASM specific pseudo access flags
+ /**
+ * Version flag indicating that the class is using 'preview' features.
+ *
+ * <p>{@code version & V_PREVIEW == V_PREVIEW} tests if a version is flagged with {@code
+ * V_PREVIEW}.
+ */
+ int V_PREVIEW = 0xFFFF0000;
- int ACC_DEPRECATED = 0x20000; // class, field, method
+ // Access flags values, defined in
+ // - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.1-200-E.1
+ // - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.5-200-A.1
+ // - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.6-200-A.1
+ // - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.25
- // types for NEWARRAY
+ int ACC_PUBLIC = 0x0001; // class, field, method
+ int ACC_PRIVATE = 0x0002; // class, field, method
+ int ACC_PROTECTED = 0x0004; // class, field, method
+ int ACC_STATIC = 0x0008; // field, method
+ int ACC_FINAL = 0x0010; // class, field, method, parameter
+ int ACC_SUPER = 0x0020; // class
+ int ACC_SYNCHRONIZED = 0x0020; // method
+ int ACC_OPEN = 0x0020; // module
+ int ACC_TRANSITIVE = 0x0020; // module requires
+ int ACC_VOLATILE = 0x0040; // field
+ int ACC_BRIDGE = 0x0040; // method
+ int ACC_STATIC_PHASE = 0x0040; // module requires
+ int ACC_VARARGS = 0x0080; // method
+ int ACC_TRANSIENT = 0x0080; // field
+ int ACC_NATIVE = 0x0100; // method
+ int ACC_INTERFACE = 0x0200; // class
+ int ACC_ABSTRACT = 0x0400; // class, method
+ int ACC_STRICT = 0x0800; // method
+ int ACC_SYNTHETIC = 0x1000; // class, field, method, parameter, module *
+ int ACC_ANNOTATION = 0x2000; // class
+ int ACC_ENUM = 0x4000; // class(?) field inner
+ int ACC_MANDATED = 0x8000; // parameter, module, module *
+ int ACC_MODULE = 0x8000; // class
- int T_BOOLEAN = 4;
- int T_CHAR = 5;
- int T_FLOAT = 6;
- int T_DOUBLE = 7;
- int T_BYTE = 8;
- int T_SHORT = 9;
- int T_INT = 10;
- int T_LONG = 11;
+ // ASM specific access flags.
+ // WARNING: the 16 least significant bits must NOT be used, to avoid conflicts with standard
+ // access flags, and also to make sure that these flags are automatically filtered out when
+ // written in class files (because access flags are stored using 16 bits only).
- // tags for Handle
+ int ACC_DEPRECATED = 0x20000; // class, field, method
- int H_GETFIELD = 1;
- int H_GETSTATIC = 2;
- int H_PUTFIELD = 3;
- int H_PUTSTATIC = 4;
- int H_INVOKEVIRTUAL = 5;
- int H_INVOKESTATIC = 6;
- int H_INVOKESPECIAL = 7;
- int H_NEWINVOKESPECIAL = 8;
- int H_INVOKEINTERFACE = 9;
+ // Possible values for the type operand of the NEWARRAY instruction.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-6.html#jvms-6.5.newarray.
- // stack map frame types
+ int T_BOOLEAN = 4;
+ int T_CHAR = 5;
+ int T_FLOAT = 6;
+ int T_DOUBLE = 7;
+ int T_BYTE = 8;
+ int T_SHORT = 9;
+ int T_INT = 10;
+ int T_LONG = 11;
- /**
- * Represents an expanded frame. See {@link ClassReader#EXPAND_FRAMES}.
- */
- int F_NEW = -1;
+ // Possible values for the reference_kind field of CONSTANT_MethodHandle_info structures.
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4.8.
- /**
- * Represents a compressed frame with complete frame data.
- */
- int F_FULL = 0;
+ int H_GETFIELD = 1;
+ int H_GETSTATIC = 2;
+ int H_PUTFIELD = 3;
+ int H_PUTSTATIC = 4;
+ int H_INVOKEVIRTUAL = 5;
+ int H_INVOKESTATIC = 6;
+ int H_INVOKESPECIAL = 7;
+ int H_NEWINVOKESPECIAL = 8;
+ int H_INVOKEINTERFACE = 9;
- /**
- * Represents a compressed frame where locals are the same as the locals in
- * the previous frame, except that additional 1-3 locals are defined, and
- * with an empty stack.
- */
- int F_APPEND = 1;
+ // ASM specific stack map frame types, used in {@link ClassVisitor#visitFrame}.
- /**
- * Represents a compressed frame where locals are the same as the locals in
- * the previous frame, except that the last 1-3 locals are absent and with
- * an empty stack.
- */
- int F_CHOP = 2;
+ /** An expanded frame. See {@link ClassReader#EXPAND_FRAMES}. */
+ int F_NEW = -1;
- /**
- * Represents a compressed frame with exactly the same locals as the
- * previous frame and with an empty stack.
- */
- int F_SAME = 3;
+ /** A compressed frame with complete frame data. */
+ int F_FULL = 0;
- /**
- * Represents a compressed frame with exactly the same locals as the
- * previous frame and with a single value on the stack.
- */
- int F_SAME1 = 4;
+ /**
+ * A compressed frame where locals are the same as the locals in the previous frame, except that
+ * additional 1-3 locals are defined, and with an empty stack.
+ */
+ int F_APPEND = 1;
- Integer TOP = new Integer(0);
- Integer INTEGER = new Integer(1);
- Integer FLOAT = new Integer(2);
- Integer DOUBLE = new Integer(3);
- Integer LONG = new Integer(4);
- Integer NULL = new Integer(5);
- Integer UNINITIALIZED_THIS = new Integer(6);
+ /**
+ * A compressed frame where locals are the same as the locals in the previous frame, except that
+ * the last 1-3 locals are absent and with an empty stack.
+ */
+ int F_CHOP = 2;
- // opcodes // visit method (- = idem)
+ /**
+ * A compressed frame with exactly the same locals as the previous frame and with an empty stack.
+ */
+ int F_SAME = 3;
- int NOP = 0; // visitInsn
- int ACONST_NULL = 1; // -
- int ICONST_M1 = 2; // -
- int ICONST_0 = 3; // -
- int ICONST_1 = 4; // -
- int ICONST_2 = 5; // -
- int ICONST_3 = 6; // -
- int ICONST_4 = 7; // -
- int ICONST_5 = 8; // -
- int LCONST_0 = 9; // -
- int LCONST_1 = 10; // -
- int FCONST_0 = 11; // -
- int FCONST_1 = 12; // -
- int FCONST_2 = 13; // -
- int DCONST_0 = 14; // -
- int DCONST_1 = 15; // -
- int BIPUSH = 16; // visitIntInsn
- int SIPUSH = 17; // -
- int LDC = 18; // visitLdcInsn
- // int LDC_W = 19; // -
- // int LDC2_W = 20; // -
- int ILOAD = 21; // visitVarInsn
- int LLOAD = 22; // -
- int FLOAD = 23; // -
- int DLOAD = 24; // -
- int ALOAD = 25; // -
- // int ILOAD_0 = 26; // -
- // int ILOAD_1 = 27; // -
- // int ILOAD_2 = 28; // -
- // int ILOAD_3 = 29; // -
- // int LLOAD_0 = 30; // -
- // int LLOAD_1 = 31; // -
- // int LLOAD_2 = 32; // -
- // int LLOAD_3 = 33; // -
- // int FLOAD_0 = 34; // -
- // int FLOAD_1 = 35; // -
- // int FLOAD_2 = 36; // -
- // int FLOAD_3 = 37; // -
- // int DLOAD_0 = 38; // -
- // int DLOAD_1 = 39; // -
- // int DLOAD_2 = 40; // -
- // int DLOAD_3 = 41; // -
- // int ALOAD_0 = 42; // -
- // int ALOAD_1 = 43; // -
- // int ALOAD_2 = 44; // -
- // int ALOAD_3 = 45; // -
- int IALOAD = 46; // visitInsn
- int LALOAD = 47; // -
- int FALOAD = 48; // -
- int DALOAD = 49; // -
- int AALOAD = 50; // -
- int BALOAD = 51; // -
- int CALOAD = 52; // -
- int SALOAD = 53; // -
- int ISTORE = 54; // visitVarInsn
- int LSTORE = 55; // -
- int FSTORE = 56; // -
- int DSTORE = 57; // -
- int ASTORE = 58; // -
- // int ISTORE_0 = 59; // -
- // int ISTORE_1 = 60; // -
- // int ISTORE_2 = 61; // -
- // int ISTORE_3 = 62; // -
- // int LSTORE_0 = 63; // -
- // int LSTORE_1 = 64; // -
- // int LSTORE_2 = 65; // -
- // int LSTORE_3 = 66; // -
- // int FSTORE_0 = 67; // -
- // int FSTORE_1 = 68; // -
- // int FSTORE_2 = 69; // -
- // int FSTORE_3 = 70; // -
- // int DSTORE_0 = 71; // -
- // int DSTORE_1 = 72; // -
- // int DSTORE_2 = 73; // -
- // int DSTORE_3 = 74; // -
- // int ASTORE_0 = 75; // -
- // int ASTORE_1 = 76; // -
- // int ASTORE_2 = 77; // -
- // int ASTORE_3 = 78; // -
- int IASTORE = 79; // visitInsn
- int LASTORE = 80; // -
- int FASTORE = 81; // -
- int DASTORE = 82; // -
- int AASTORE = 83; // -
- int BASTORE = 84; // -
- int CASTORE = 85; // -
- int SASTORE = 86; // -
- int POP = 87; // -
- int POP2 = 88; // -
- int DUP = 89; // -
- int DUP_X1 = 90; // -
- int DUP_X2 = 91; // -
- int DUP2 = 92; // -
- int DUP2_X1 = 93; // -
- int DUP2_X2 = 94; // -
- int SWAP = 95; // -
- int IADD = 96; // -
- int LADD = 97; // -
- int FADD = 98; // -
- int DADD = 99; // -
- int ISUB = 100; // -
- int LSUB = 101; // -
- int FSUB = 102; // -
- int DSUB = 103; // -
- int IMUL = 104; // -
- int LMUL = 105; // -
- int FMUL = 106; // -
- int DMUL = 107; // -
- int IDIV = 108; // -
- int LDIV = 109; // -
- int FDIV = 110; // -
- int DDIV = 111; // -
- int IREM = 112; // -
- int LREM = 113; // -
- int FREM = 114; // -
- int DREM = 115; // -
- int INEG = 116; // -
- int LNEG = 117; // -
- int FNEG = 118; // -
- int DNEG = 119; // -
- int ISHL = 120; // -
- int LSHL = 121; // -
- int ISHR = 122; // -
- int LSHR = 123; // -
- int IUSHR = 124; // -
- int LUSHR = 125; // -
- int IAND = 126; // -
- int LAND = 127; // -
- int IOR = 128; // -
- int LOR = 129; // -
- int IXOR = 130; // -
- int LXOR = 131; // -
- int IINC = 132; // visitIincInsn
- int I2L = 133; // visitInsn
- int I2F = 134; // -
- int I2D = 135; // -
- int L2I = 136; // -
- int L2F = 137; // -
- int L2D = 138; // -
- int F2I = 139; // -
- int F2L = 140; // -
- int F2D = 141; // -
- int D2I = 142; // -
- int D2L = 143; // -
- int D2F = 144; // -
- int I2B = 145; // -
- int I2C = 146; // -
- int I2S = 147; // -
- int LCMP = 148; // -
- int FCMPL = 149; // -
- int FCMPG = 150; // -
- int DCMPL = 151; // -
- int DCMPG = 152; // -
- int IFEQ = 153; // visitJumpInsn
- int IFNE = 154; // -
- int IFLT = 155; // -
- int IFGE = 156; // -
- int IFGT = 157; // -
- int IFLE = 158; // -
- int IF_ICMPEQ = 159; // -
- int IF_ICMPNE = 160; // -
- int IF_ICMPLT = 161; // -
- int IF_ICMPGE = 162; // -
- int IF_ICMPGT = 163; // -
- int IF_ICMPLE = 164; // -
- int IF_ACMPEQ = 165; // -
- int IF_ACMPNE = 166; // -
- int GOTO = 167; // -
- int JSR = 168; // -
- int RET = 169; // visitVarInsn
- int TABLESWITCH = 170; // visiTableSwitchInsn
- int LOOKUPSWITCH = 171; // visitLookupSwitch
- int IRETURN = 172; // visitInsn
- int LRETURN = 173; // -
- int FRETURN = 174; // -
- int DRETURN = 175; // -
- int ARETURN = 176; // -
- int RETURN = 177; // -
- int GETSTATIC = 178; // visitFieldInsn
- int PUTSTATIC = 179; // -
- int GETFIELD = 180; // -
- int PUTFIELD = 181; // -
- int INVOKEVIRTUAL = 182; // visitMethodInsn
- int INVOKESPECIAL = 183; // -
- int INVOKESTATIC = 184; // -
- int INVOKEINTERFACE = 185; // -
- int INVOKEDYNAMIC = 186; // visitInvokeDynamicInsn
- int NEW = 187; // visitTypeInsn
- int NEWARRAY = 188; // visitIntInsn
- int ANEWARRAY = 189; // visitTypeInsn
- int ARRAYLENGTH = 190; // visitInsn
- int ATHROW = 191; // -
- int CHECKCAST = 192; // visitTypeInsn
- int INSTANCEOF = 193; // -
- int MONITORENTER = 194; // visitInsn
- int MONITOREXIT = 195; // -
- // int WIDE = 196; // NOT VISITED
- int MULTIANEWARRAY = 197; // visitMultiANewArrayInsn
- int IFNULL = 198; // visitJumpInsn
- int IFNONNULL = 199; // -
- // int GOTO_W = 200; // -
- // int JSR_W = 201; // -
+ /**
+ * A compressed frame with exactly the same locals as the previous frame and with a single value
+ * on the stack.
+ */
+ int F_SAME1 = 4;
+
+ // Standard stack map frame element types, used in {@link ClassVisitor#visitFrame}.
+
+ Integer TOP = Frame.ITEM_TOP;
+ Integer INTEGER = Frame.ITEM_INTEGER;
+ Integer FLOAT = Frame.ITEM_FLOAT;
+ Integer DOUBLE = Frame.ITEM_DOUBLE;
+ Integer LONG = Frame.ITEM_LONG;
+ Integer NULL = Frame.ITEM_NULL;
+ Integer UNINITIALIZED_THIS = Frame.ITEM_UNINITIALIZED_THIS;
+
+ // The JVM opcode values (with the MethodVisitor method name used to visit them in comment, and
+ // where '-' means 'same method name as on the previous line').
+ // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-6.html.
+
+ int NOP = 0; // visitInsn
+ int ACONST_NULL = 1; // -
+ int ICONST_M1 = 2; // -
+ int ICONST_0 = 3; // -
+ int ICONST_1 = 4; // -
+ int ICONST_2 = 5; // -
+ int ICONST_3 = 6; // -
+ int ICONST_4 = 7; // -
+ int ICONST_5 = 8; // -
+ int LCONST_0 = 9; // -
+ int LCONST_1 = 10; // -
+ int FCONST_0 = 11; // -
+ int FCONST_1 = 12; // -
+ int FCONST_2 = 13; // -
+ int DCONST_0 = 14; // -
+ int DCONST_1 = 15; // -
+ int BIPUSH = 16; // visitIntInsn
+ int SIPUSH = 17; // -
+ int LDC = 18; // visitLdcInsn
+ int ILOAD = 21; // visitVarInsn
+ int LLOAD = 22; // -
+ int FLOAD = 23; // -
+ int DLOAD = 24; // -
+ int ALOAD = 25; // -
+ int IALOAD = 46; // visitInsn
+ int LALOAD = 47; // -
+ int FALOAD = 48; // -
+ int DALOAD = 49; // -
+ int AALOAD = 50; // -
+ int BALOAD = 51; // -
+ int CALOAD = 52; // -
+ int SALOAD = 53; // -
+ int ISTORE = 54; // visitVarInsn
+ int LSTORE = 55; // -
+ int FSTORE = 56; // -
+ int DSTORE = 57; // -
+ int ASTORE = 58; // -
+ int IASTORE = 79; // visitInsn
+ int LASTORE = 80; // -
+ int FASTORE = 81; // -
+ int DASTORE = 82; // -
+ int AASTORE = 83; // -
+ int BASTORE = 84; // -
+ int CASTORE = 85; // -
+ int SASTORE = 86; // -
+ int POP = 87; // -
+ int POP2 = 88; // -
+ int DUP = 89; // -
+ int DUP_X1 = 90; // -
+ int DUP_X2 = 91; // -
+ int DUP2 = 92; // -
+ int DUP2_X1 = 93; // -
+ int DUP2_X2 = 94; // -
+ int SWAP = 95; // -
+ int IADD = 96; // -
+ int LADD = 97; // -
+ int FADD = 98; // -
+ int DADD = 99; // -
+ int ISUB = 100; // -
+ int LSUB = 101; // -
+ int FSUB = 102; // -
+ int DSUB = 103; // -
+ int IMUL = 104; // -
+ int LMUL = 105; // -
+ int FMUL = 106; // -
+ int DMUL = 107; // -
+ int IDIV = 108; // -
+ int LDIV = 109; // -
+ int FDIV = 110; // -
+ int DDIV = 111; // -
+ int IREM = 112; // -
+ int LREM = 113; // -
+ int FREM = 114; // -
+ int DREM = 115; // -
+ int INEG = 116; // -
+ int LNEG = 117; // -
+ int FNEG = 118; // -
+ int DNEG = 119; // -
+ int ISHL = 120; // -
+ int LSHL = 121; // -
+ int ISHR = 122; // -
+ int LSHR = 123; // -
+ int IUSHR = 124; // -
+ int LUSHR = 125; // -
+ int IAND = 126; // -
+ int LAND = 127; // -
+ int IOR = 128; // -
+ int LOR = 129; // -
+ int IXOR = 130; // -
+ int LXOR = 131; // -
+ int IINC = 132; // visitIincInsn
+ int I2L = 133; // visitInsn
+ int I2F = 134; // -
+ int I2D = 135; // -
+ int L2I = 136; // -
+ int L2F = 137; // -
+ int L2D = 138; // -
+ int F2I = 139; // -
+ int F2L = 140; // -
+ int F2D = 141; // -
+ int D2I = 142; // -
+ int D2L = 143; // -
+ int D2F = 144; // -
+ int I2B = 145; // -
+ int I2C = 146; // -
+ int I2S = 147; // -
+ int LCMP = 148; // -
+ int FCMPL = 149; // -
+ int FCMPG = 150; // -
+ int DCMPL = 151; // -
+ int DCMPG = 152; // -
+ int IFEQ = 153; // visitJumpInsn
+ int IFNE = 154; // -
+ int IFLT = 155; // -
+ int IFGE = 156; // -
+ int IFGT = 157; // -
+ int IFLE = 158; // -
+ int IF_ICMPEQ = 159; // -
+ int IF_ICMPNE = 160; // -
+ int IF_ICMPLT = 161; // -
+ int IF_ICMPGE = 162; // -
+ int IF_ICMPGT = 163; // -
+ int IF_ICMPLE = 164; // -
+ int IF_ACMPEQ = 165; // -
+ int IF_ACMPNE = 166; // -
+ int GOTO = 167; // -
+ int JSR = 168; // -
+ int RET = 169; // visitVarInsn
+ int TABLESWITCH = 170; // visiTableSwitchInsn
+ int LOOKUPSWITCH = 171; // visitLookupSwitch
+ int IRETURN = 172; // visitInsn
+ int LRETURN = 173; // -
+ int FRETURN = 174; // -
+ int DRETURN = 175; // -
+ int ARETURN = 176; // -
+ int RETURN = 177; // -
+ int GETSTATIC = 178; // visitFieldInsn
+ int PUTSTATIC = 179; // -
+ int GETFIELD = 180; // -
+ int PUTFIELD = 181; // -
+ int INVOKEVIRTUAL = 182; // visitMethodInsn
+ int INVOKESPECIAL = 183; // -
+ int INVOKESTATIC = 184; // -
+ int INVOKEINTERFACE = 185; // -
+ int INVOKEDYNAMIC = 186; // visitInvokeDynamicInsn
+ int NEW = 187; // visitTypeInsn
+ int NEWARRAY = 188; // visitIntInsn
+ int ANEWARRAY = 189; // visitTypeInsn
+ int ARRAYLENGTH = 190; // visitInsn
+ int ATHROW = 191; // -
+ int CHECKCAST = 192; // visitTypeInsn
+ int INSTANCEOF = 193; // -
+ int MONITORENTER = 194; // visitInsn
+ int MONITOREXIT = 195; // -
+ int MULTIANEWARRAY = 197; // visitMultiANewArrayInsn
+ int IFNULL = 198; // visitJumpInsn
+ int IFNONNULL = 199; // -
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Symbol.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Symbol.java
new file mode 100644
index 0000000..adc9391
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Symbol.java
@@ -0,0 +1,243 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * An entry of the constant pool, of the BootstrapMethods attribute, or of the (ASM specific) type
+ * table of a class.
+ *
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4">JVMS
+ * 4.4</a>
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.23">JVMS
+ * 4.7.23</a>
+ * @author Eric Bruneton
+ */
+abstract class Symbol {
+
+ // Tag values for the constant pool entries (using the same order as in the JVMS).
+
+ /** The tag value of CONSTANT_Class_info JVMS structures. */
+ static final int CONSTANT_CLASS_TAG = 7;
+
+ /** The tag value of CONSTANT_Fieldref_info JVMS structures. */
+ static final int CONSTANT_FIELDREF_TAG = 9;
+
+ /** The tag value of CONSTANT_Methodref_info JVMS structures. */
+ static final int CONSTANT_METHODREF_TAG = 10;
+
+ /** The tag value of CONSTANT_InterfaceMethodref_info JVMS structures. */
+ static final int CONSTANT_INTERFACE_METHODREF_TAG = 11;
+
+ /** The tag value of CONSTANT_String_info JVMS structures. */
+ static final int CONSTANT_STRING_TAG = 8;
+
+ /** The tag value of CONSTANT_Integer_info JVMS structures. */
+ static final int CONSTANT_INTEGER_TAG = 3;
+
+ /** The tag value of CONSTANT_Float_info JVMS structures. */
+ static final int CONSTANT_FLOAT_TAG = 4;
+
+ /** The tag value of CONSTANT_Long_info JVMS structures. */
+ static final int CONSTANT_LONG_TAG = 5;
+
+ /** The tag value of CONSTANT_Double_info JVMS structures. */
+ static final int CONSTANT_DOUBLE_TAG = 6;
+
+ /** The tag value of CONSTANT_NameAndType_info JVMS structures. */
+ static final int CONSTANT_NAME_AND_TYPE_TAG = 12;
+
+ /** The tag value of CONSTANT_Utf8_info JVMS structures. */
+ static final int CONSTANT_UTF8_TAG = 1;
+
+ /** The tag value of CONSTANT_MethodHandle_info JVMS structures. */
+ static final int CONSTANT_METHOD_HANDLE_TAG = 15;
+
+ /** The tag value of CONSTANT_MethodType_info JVMS structures. */
+ static final int CONSTANT_METHOD_TYPE_TAG = 16;
+
+ /** The tag value of CONSTANT_Dynamic_info JVMS structures. */
+ static final int CONSTANT_DYNAMIC_TAG = 17;
+
+ /** The tag value of CONSTANT_InvokeDynamic_info JVMS structures. */
+ static final int CONSTANT_INVOKE_DYNAMIC_TAG = 18;
+
+ /** The tag value of CONSTANT_Module_info JVMS structures. */
+ static final int CONSTANT_MODULE_TAG = 19;
+
+ /** The tag value of CONSTANT_Package_info JVMS structures. */
+ static final int CONSTANT_PACKAGE_TAG = 20;
+
+ // Tag values for the BootstrapMethods attribute entries (ASM specific tag).
+
+ /** The tag value of the BootstrapMethods attribute entries. */
+ static final int BOOTSTRAP_METHOD_TAG = 64;
+
+ // Tag values for the type table entries (ASM specific tags).
+
+ /** The tag value of a normal type entry in the (ASM specific) type table of a class. */
+ static final int TYPE_TAG = 128;
+
+ /**
+ * The tag value of an {@link Frame#ITEM_UNINITIALIZED} type entry in the type table of a class.
+ */
+ static final int UNINITIALIZED_TYPE_TAG = 129;
+
+ /** The tag value of a merged type entry in the (ASM specific) type table of a class. */
+ static final int MERGED_TYPE_TAG = 130;
+
+ // Instance fields.
+
+ /**
+ * The index of this symbol in the constant pool, in the BootstrapMethods attribute, or in the
+ * (ASM specific) type table of a class (depending on the {@link #tag} value).
+ */
+ final int index;
+
+ /**
+ * A tag indicating the type of this symbol. Must be one of the static tag values defined in this
+ * class.
+ */
+ final int tag;
+
+ /**
+ * The internal name of the owner class of this symbol. Only used for {@link
+ * #CONSTANT_FIELDREF_TAG}, {@link #CONSTANT_METHODREF_TAG}, {@link
+ * #CONSTANT_INTERFACE_METHODREF_TAG}, and {@link #CONSTANT_METHOD_HANDLE_TAG} symbols.
+ */
+ final String owner;
+
+ /**
+ * The name of the class field or method corresponding to this symbol. Only used for {@link
+ * #CONSTANT_FIELDREF_TAG}, {@link #CONSTANT_METHODREF_TAG}, {@link
+ * #CONSTANT_INTERFACE_METHODREF_TAG}, {@link #CONSTANT_NAME_AND_TYPE_TAG}, {@link
+ * #CONSTANT_METHOD_HANDLE_TAG}, {@link #CONSTANT_DYNAMIC_TAG} and {@link
+ * #CONSTANT_INVOKE_DYNAMIC_TAG} symbols.
+ */
+ final String name;
+
+ /**
+ * The string value of this symbol. This is:
+ *
+ * <ul>
+ * <li>a field or method descriptor for {@link #CONSTANT_FIELDREF_TAG}, {@link
+ * #CONSTANT_METHODREF_TAG}, {@link #CONSTANT_INTERFACE_METHODREF_TAG}, {@link
+ * #CONSTANT_NAME_AND_TYPE_TAG}, {@link #CONSTANT_METHOD_HANDLE_TAG}, {@link
+ * #CONSTANT_METHOD_TYPE_TAG}, {@link #CONSTANT_DYNAMIC_TAG} and {@link
+ * #CONSTANT_INVOKE_DYNAMIC_TAG} symbols,
+ * <li>an arbitrary string for {@link #CONSTANT_UTF8_TAG} and {@link #CONSTANT_STRING_TAG}
+ * symbols,
+ * <li>an internal class name for {@link #CONSTANT_CLASS_TAG}, {@link #TYPE_TAG} and {@link
+ * #UNINITIALIZED_TYPE_TAG} symbols,
+ * <li>{@literal null} for the other types of symbol.
+ * </ul>
+ */
+ final String value;
+
+ /**
+ * The numeric value of this symbol. This is:
+ *
+ * <ul>
+ * <li>the symbol's value for {@link #CONSTANT_INTEGER_TAG},{@link #CONSTANT_FLOAT_TAG}, {@link
+ * #CONSTANT_LONG_TAG}, {@link #CONSTANT_DOUBLE_TAG},
+ * <li>the CONSTANT_MethodHandle_info reference_kind field value for {@link
+ * #CONSTANT_METHOD_HANDLE_TAG} symbols,
+ * <li>the CONSTANT_InvokeDynamic_info bootstrap_method_attr_index field value for {@link
+ * #CONSTANT_INVOKE_DYNAMIC_TAG} symbols,
+ * <li>the offset of a bootstrap method in the BootstrapMethods boostrap_methods array, for
+ * {@link #CONSTANT_DYNAMIC_TAG} or {@link #BOOTSTRAP_METHOD_TAG} symbols,
+ * <li>the bytecode offset of the NEW instruction that created an {@link
+ * Frame#ITEM_UNINITIALIZED} type for {@link #UNINITIALIZED_TYPE_TAG} symbols,
+ * <li>the indices (in the class' type table) of two {@link #TYPE_TAG} source types for {@link
+ * #MERGED_TYPE_TAG} symbols,
+ * <li>0 for the other types of symbol.
+ * </ul>
+ */
+ final long data;
+
+ /**
+ * Additional information about this symbol, generally computed lazily. <i>Warning: the value of
+ * this field is ignored when comparing Symbol instances</i> (to avoid duplicate entries in a
+ * SymbolTable). Therefore, this field should only contain data that can be computed from the
+ * other fields of this class. It contains:
+ *
+ * <ul>
+ * <li>the {@link Type#getArgumentsAndReturnSizes} of the symbol's method descriptor for {@link
+ * #CONSTANT_METHODREF_TAG}, {@link #CONSTANT_INTERFACE_METHODREF_TAG} and {@link
+ * #CONSTANT_INVOKE_DYNAMIC_TAG} symbols,
+ * <li>the index in the InnerClasses_attribute 'classes' array (plus one) corresponding to this
+ * class, for {@link #CONSTANT_CLASS_TAG} symbols,
+ * <li>the index (in the class' type table) of the merged type of the two source types for
+ * {@link #MERGED_TYPE_TAG} symbols,
+ * <li>0 for the other types of symbol, or if this field has not been computed yet.
+ * </ul>
+ */
+ int info;
+
+ /**
+ * Constructs a new Symbol. This constructor can't be used directly because the Symbol class is
+ * abstract. Instead, use the factory methods of the {@link SymbolTable} class.
+ *
+ * @param index the symbol index in the constant pool, in the BootstrapMethods attribute, or in
+ * the (ASM specific) type table of a class (depending on 'tag').
+ * @param tag the symbol type. Must be one of the static tag values defined in this class.
+ * @param owner The internal name of the symbol's owner class. Maybe {@literal null}.
+ * @param name The name of the symbol's corresponding class field or method. Maybe {@literal
+ * null}.
+ * @param value The string value of this symbol. Maybe {@literal null}.
+ * @param data The numeric value of this symbol.
+ */
+ Symbol(
+ final int index,
+ final int tag,
+ final String owner,
+ final String name,
+ final String value,
+ final long data) {
+ this.index = index;
+ this.tag = tag;
+ this.owner = owner;
+ this.name = name;
+ this.value = value;
+ this.data = data;
+ }
+
+ /**
+ * Returns the result {@link Type#getArgumentsAndReturnSizes} on {@link #value}.
+ *
+ * @return the result {@link Type#getArgumentsAndReturnSizes} on {@link #value} (memoized in
+ * {@link #info} for efficiency). This should only be used for {@link
+ * #CONSTANT_METHODREF_TAG}, {@link #CONSTANT_INTERFACE_METHODREF_TAG} and {@link
+ * #CONSTANT_INVOKE_DYNAMIC_TAG} symbols.
+ */
+ int getArgumentsAndReturnSizes() {
+ if (info == 0) {
+ info = Type.getArgumentsAndReturnSizes(value);
+ }
+ return info;
+ }
+}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/SymbolTable.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/SymbolTable.java
new file mode 100644
index 0000000..31bf0bf
--- /dev/null
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/SymbolTable.java
@@ -0,0 +1,1320 @@
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * The constant pool entries, the BootstrapMethods attribute entries and the (ASM specific) type
+ * table entries of a class.
+ *
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4">JVMS
+ * 4.4</a>
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.23">JVMS
+ * 4.7.23</a>
+ * @author Eric Bruneton
+ */
+final class SymbolTable {
+
+ /**
+ * The ClassWriter to which this SymbolTable belongs. This is only used to get access to {@link
+ * ClassWriter#getCommonSuperClass} and to serialize custom attributes with {@link
+ * Attribute#write}.
+ */
+ final ClassWriter classWriter;
+
+ /**
+ * The ClassReader from which this SymbolTable was constructed, or {@literal null} if it was
+ * constructed from scratch.
+ */
+ private final ClassReader sourceClassReader;
+
+ /** The major version number of the class to which this symbol table belongs. */
+ private int majorVersion;
+
+ /** The internal name of the class to which this symbol table belongs. */
+ private String className;
+
+ /**
+ * The total number of {@link Entry} instances in {@link #entries}. This includes entries that are
+ * accessible (recursively) via {@link Entry#next}.
+ */
+ private int entryCount;
+
+ /**
+ * A hash set of all the entries in this SymbolTable (this includes the constant pool entries, the
+ * bootstrap method entries and the type table entries). Each {@link Entry} instance is stored at
+ * the array index given by its hash code modulo the array size. If several entries must be stored
+ * at the same array index, they are linked together via their {@link Entry#next} field. The
+ * factory methods of this class make sure that this table does not contain duplicated entries.
+ */
+ private Entry[] entries;
+
+ /**
+ * The number of constant pool items in {@link #constantPool}, plus 1. The first constant pool
+ * item has index 1, and long and double items count for two items.
+ */
+ private int constantPoolCount;
+
+ /**
+ * The content of the ClassFile's constant_pool JVMS structure corresponding to this SymbolTable.
+ * The ClassFile's constant_pool_count field is <i>not</i> included.
+ */
+ private ByteVector constantPool;
+
+ /**
+ * The number of bootstrap methods in {@link #bootstrapMethods}. Corresponds to the
+ * BootstrapMethods_attribute's num_bootstrap_methods field value.
+ */
+ private int bootstrapMethodCount;
+
+ /**
+ * The content of the BootstrapMethods attribute 'bootstrap_methods' array corresponding to this
+ * SymbolTable. Note that the first 6 bytes of the BootstrapMethods_attribute, and its
+ * num_bootstrap_methods field, are <i>not</i> included.
+ */
+ private ByteVector bootstrapMethods;
+
+ /**
+ * The actual number of elements in {@link #typeTable}. These elements are stored from index 0 to
+ * typeCount (excluded). The other array entries are empty.
+ */
+ private int typeCount;
+
+ /**
+ * An ASM specific type table used to temporarily store internal names that will not necessarily
+ * be stored in the constant pool. This type table is used by the control flow and data flow
+ * analysis algorithm used to compute stack map frames from scratch. This array stores {@link
+ * Symbol#TYPE_TAG} and {@link Symbol#UNINITIALIZED_TYPE_TAG}) Symbol. The type symbol at index
+ * {@code i} has its {@link Symbol#index} equal to {@code i} (and vice versa).
+ */
+ private Entry[] typeTable;
+
+ /**
+ * Constructs a new, empty SymbolTable for the given ClassWriter.
+ *
+ * @param classWriter a ClassWriter.
+ */
+ SymbolTable(final ClassWriter classWriter) {
+ this.classWriter = classWriter;
+ this.sourceClassReader = null;
+ this.entries = new Entry[256];
+ this.constantPoolCount = 1;
+ this.constantPool = new ByteVector();
+ }
+
+ /**
+ * Constructs a new SymbolTable for the given ClassWriter, initialized with the constant pool and
+ * bootstrap methods of the given ClassReader.
+ *
+ * @param classWriter a ClassWriter.
+ * @param classReader the ClassReader whose constant pool and bootstrap methods must be copied to
+ * initialize the SymbolTable.
+ */
+ SymbolTable(final ClassWriter classWriter, final ClassReader classReader) {
+ this.classWriter = classWriter;
+ this.sourceClassReader = classReader;
+
+ // Copy the constant pool binary content.
+ byte[] inputBytes = classReader.classFileBuffer;
+ int constantPoolOffset = classReader.getItem(1) - 1;
+ int constantPoolLength = classReader.header - constantPoolOffset;
+ constantPoolCount = classReader.getItemCount();
+ constantPool = new ByteVector(constantPoolLength);
+ constantPool.putByteArray(inputBytes, constantPoolOffset, constantPoolLength);
+
+ // Add the constant pool items in the symbol table entries. Reserve enough space in 'entries' to
+ // avoid too many hash set collisions (entries is not dynamically resized by the addConstant*
+ // method calls below), and to account for bootstrap method entries.
+ entries = new Entry[constantPoolCount * 2];
+ char[] charBuffer = new char[classReader.getMaxStringLength()];
+ boolean hasBootstrapMethods = false;
+ int itemIndex = 1;
+ while (itemIndex < constantPoolCount) {
+ int itemOffset = classReader.getItem(itemIndex);
+ int itemTag = inputBytes[itemOffset - 1];
+ int nameAndTypeItemOffset;
+ switch (itemTag) {
+ case Symbol.CONSTANT_FIELDREF_TAG:
+ case Symbol.CONSTANT_METHODREF_TAG:
+ case Symbol.CONSTANT_INTERFACE_METHODREF_TAG:
+ nameAndTypeItemOffset =
+ classReader.getItem(classReader.readUnsignedShort(itemOffset + 2));
+ addConstantMemberReference(
+ itemIndex,
+ itemTag,
+ classReader.readClass(itemOffset, charBuffer),
+ classReader.readUTF8(nameAndTypeItemOffset, charBuffer),
+ classReader.readUTF8(nameAndTypeItemOffset + 2, charBuffer));
+ break;
+ case Symbol.CONSTANT_INTEGER_TAG:
+ case Symbol.CONSTANT_FLOAT_TAG:
+ addConstantIntegerOrFloat(itemIndex, itemTag, classReader.readInt(itemOffset));
+ break;
+ case Symbol.CONSTANT_NAME_AND_TYPE_TAG:
+ addConstantNameAndType(
+ itemIndex,
+ classReader.readUTF8(itemOffset, charBuffer),
+ classReader.readUTF8(itemOffset + 2, charBuffer));
+ break;
+ case Symbol.CONSTANT_LONG_TAG:
+ case Symbol.CONSTANT_DOUBLE_TAG:
+ addConstantLongOrDouble(itemIndex, itemTag, classReader.readLong(itemOffset));
+ break;
+ case Symbol.CONSTANT_UTF8_TAG:
+ addConstantUtf8(itemIndex, classReader.readUtf(itemIndex, charBuffer));
+ break;
+ case Symbol.CONSTANT_METHOD_HANDLE_TAG:
+ int memberRefItemOffset =
+ classReader.getItem(classReader.readUnsignedShort(itemOffset + 1));
+ nameAndTypeItemOffset =
+ classReader.getItem(classReader.readUnsignedShort(memberRefItemOffset + 2));
+ addConstantMethodHandle(
+ itemIndex,
+ classReader.readByte(itemOffset),
+ classReader.readClass(memberRefItemOffset, charBuffer),
+ classReader.readUTF8(nameAndTypeItemOffset, charBuffer),
+ classReader.readUTF8(nameAndTypeItemOffset + 2, charBuffer));
+ break;
+ case Symbol.CONSTANT_DYNAMIC_TAG:
+ case Symbol.CONSTANT_INVOKE_DYNAMIC_TAG:
+ hasBootstrapMethods = true;
+ nameAndTypeItemOffset =
+ classReader.getItem(classReader.readUnsignedShort(itemOffset + 2));
+ addConstantDynamicOrInvokeDynamicReference(
+ itemTag,
+ itemIndex,
+ classReader.readUTF8(nameAndTypeItemOffset, charBuffer),
+ classReader.readUTF8(nameAndTypeItemOffset + 2, charBuffer),
+ classReader.readUnsignedShort(itemOffset));
+ break;
+ case Symbol.CONSTANT_STRING_TAG:
+ case Symbol.CONSTANT_CLASS_TAG:
+ case Symbol.CONSTANT_METHOD_TYPE_TAG:
+ case Symbol.CONSTANT_MODULE_TAG:
+ case Symbol.CONSTANT_PACKAGE_TAG:
+ addConstantUtf8Reference(
+ itemIndex, itemTag, classReader.readUTF8(itemOffset, charBuffer));
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ itemIndex +=
+ (itemTag == Symbol.CONSTANT_LONG_TAG || itemTag == Symbol.CONSTANT_DOUBLE_TAG) ? 2 : 1;
+ }
+
+ // Copy the BootstrapMethods, if any.
+ if (hasBootstrapMethods) {
+ copyBootstrapMethods(classReader, charBuffer);
+ }
+ }
+
+ /**
+ * Read the BootstrapMethods 'bootstrap_methods' array binary content and add them as entries of
+ * the SymbolTable.
+ *
+ * @param classReader the ClassReader whose bootstrap methods must be copied to initialize the
+ * SymbolTable.
+ * @param charBuffer a buffer used to read strings in the constant pool.
+ */
+ private void copyBootstrapMethods(final ClassReader classReader, final char[] charBuffer) {
+ // Find attributOffset of the 'bootstrap_methods' array.
+ byte[] inputBytes = classReader.classFileBuffer;
+ int currentAttributeOffset = classReader.getFirstAttributeOffset();
+ for (int i = classReader.readUnsignedShort(currentAttributeOffset - 2); i > 0; --i) {
+ String attributeName = classReader.readUTF8(currentAttributeOffset, charBuffer);
+ if (Constants.BOOTSTRAP_METHODS.equals(attributeName)) {
+ bootstrapMethodCount = classReader.readUnsignedShort(currentAttributeOffset + 6);
+ break;
+ }
+ currentAttributeOffset += 6 + classReader.readInt(currentAttributeOffset + 2);
+ }
+ if (bootstrapMethodCount > 0) {
+ // Compute the offset and the length of the BootstrapMethods 'bootstrap_methods' array.
+ int bootstrapMethodsOffset = currentAttributeOffset + 8;
+ int bootstrapMethodsLength = classReader.readInt(currentAttributeOffset + 2) - 2;
+ bootstrapMethods = new ByteVector(bootstrapMethodsLength);
+ bootstrapMethods.putByteArray(inputBytes, bootstrapMethodsOffset, bootstrapMethodsLength);
+
+ // Add each bootstrap method in the symbol table entries.
+ int currentOffset = bootstrapMethodsOffset;
+ for (int i = 0; i < bootstrapMethodCount; i++) {
+ int offset = currentOffset - bootstrapMethodsOffset;
+ int bootstrapMethodRef = classReader.readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ int numBootstrapArguments = classReader.readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ int hashCode = classReader.readConst(bootstrapMethodRef, charBuffer).hashCode();
+ while (numBootstrapArguments-- > 0) {
+ int bootstrapArgument = classReader.readUnsignedShort(currentOffset);
+ currentOffset += 2;
+ hashCode ^= classReader.readConst(bootstrapArgument, charBuffer).hashCode();
+ }
+ add(new Entry(i, Symbol.BOOTSTRAP_METHOD_TAG, offset, hashCode & 0x7FFFFFFF));
+ }
+ }
+ }
+
+ /**
+ * Returns the ClassReader from which this SymbolTable was constructed.
+ *
+ * @return the ClassReader from which this SymbolTable was constructed, or {@literal null} if it
+ * was constructed from scratch.
+ */
+ ClassReader getSource() {
+ return sourceClassReader;
+ }
+
+ /**
+ * Returns the major version of the class to which this symbol table belongs.
+ *
+ * @return the major version of the class to which this symbol table belongs.
+ */
+ int getMajorVersion() {
+ return majorVersion;
+ }
+
+ /**
+ * Returns the internal name of the class to which this symbol table belongs.
+ *
+ * @return the internal name of the class to which this symbol table belongs.
+ */
+ String getClassName() {
+ return className;
+ }
+
+ /**
+ * Sets the major version and the name of the class to which this symbol table belongs. Also adds
+ * the class name to the constant pool.
+ *
+ * @param majorVersion a major ClassFile version number.
+ * @param className an internal class name.
+ * @return the constant pool index of a new or already existing Symbol with the given class name.
+ */
+ int setMajorVersionAndClassName(final int majorVersion, final String className) {
+ this.majorVersion = majorVersion;
+ this.className = className;
+ return addConstantClass(className).index;
+ }
+
+ /**
+ * Returns the number of items in this symbol table's constant_pool array (plus 1).
+ *
+ * @return the number of items in this symbol table's constant_pool array (plus 1).
+ */
+ int getConstantPoolCount() {
+ return constantPoolCount;
+ }
+
+ /**
+ * Returns the length in bytes of this symbol table's constant_pool array.
+ *
+ * @return the length in bytes of this symbol table's constant_pool array.
+ */
+ int getConstantPoolLength() {
+ return constantPool.length;
+ }
+
+ /**
+ * Puts this symbol table's constant_pool array in the given ByteVector, preceded by the
+ * constant_pool_count value.
+ *
+ * @param output where the JVMS ClassFile's constant_pool array must be put.
+ */
+ void putConstantPool(final ByteVector output) {
+ output.putShort(constantPoolCount).putByteArray(constantPool.data, 0, constantPool.length);
+ }
+
+ /**
+ * Returns the size in bytes of this symbol table's BootstrapMethods attribute. Also adds the
+ * attribute name in the constant pool.
+ *
+ * @return the size in bytes of this symbol table's BootstrapMethods attribute.
+ */
+ int computeBootstrapMethodsSize() {
+ if (bootstrapMethods != null) {
+ addConstantUtf8(Constants.BOOTSTRAP_METHODS);
+ return 8 + bootstrapMethods.length;
+ } else {
+ return 0;
+ }
+ }
+
+ /**
+ * Puts this symbol table's BootstrapMethods attribute in the given ByteVector. This includes the
+ * 6 attribute header bytes and the num_bootstrap_methods value.
+ *
+ * @param output where the JVMS BootstrapMethods attribute must be put.
+ */
+ void putBootstrapMethods(final ByteVector output) {
+ if (bootstrapMethods != null) {
+ output
+ .putShort(addConstantUtf8(Constants.BOOTSTRAP_METHODS))
+ .putInt(bootstrapMethods.length + 2)
+ .putShort(bootstrapMethodCount)
+ .putByteArray(bootstrapMethods.data, 0, bootstrapMethods.length);
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Generic symbol table entries management.
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the list of entries which can potentially have the given hash code.
+ *
+ * @param hashCode a {@link Entry#hashCode} value.
+ * @return the list of entries which can potentially have the given hash code. The list is stored
+ * via the {@link Entry#next} field.
+ */
+ private Entry get(final int hashCode) {
+ return entries[hashCode % entries.length];
+ }
+
+ /**
+ * Puts the given entry in the {@link #entries} hash set. This method does <i>not</i> check
+ * whether {@link #entries} already contains a similar entry or not. {@link #entries} is resized
+ * if necessary to avoid hash collisions (multiple entries needing to be stored at the same {@link
+ * #entries} array index) as much as possible, with reasonable memory usage.
+ *
+ * @param entry an Entry (which must not already be contained in {@link #entries}).
+ * @return the given entry
+ */
+ private Entry put(final Entry entry) {
+ if (entryCount > (entries.length * 3) / 4) {
+ int currentCapacity = entries.length;
+ int newCapacity = currentCapacity * 2 + 1;
+ Entry[] newEntries = new Entry[newCapacity];
+ for (int i = currentCapacity - 1; i >= 0; --i) {
+ Entry currentEntry = entries[i];
+ while (currentEntry != null) {
+ int newCurrentEntryIndex = currentEntry.hashCode % newCapacity;
+ Entry nextEntry = currentEntry.next;
+ currentEntry.next = newEntries[newCurrentEntryIndex];
+ newEntries[newCurrentEntryIndex] = currentEntry;
+ currentEntry = nextEntry;
+ }
+ }
+ entries = newEntries;
+ }
+ entryCount++;
+ int index = entry.hashCode % entries.length;
+ entry.next = entries[index];
+ return entries[index] = entry;
+ }
+
+ /**
+ * Adds the given entry in the {@link #entries} hash set. This method does <i>not</i> check
+ * whether {@link #entries} already contains a similar entry or not, and does <i>not</i> resize
+ * {@link #entries} if necessary.
+ *
+ * @param entry an Entry (which must not already be contained in {@link #entries}).
+ */
+ private void add(final Entry entry) {
+ entryCount++;
+ int index = entry.hashCode % entries.length;
+ entry.next = entries[index];
+ entries[index] = entry;
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Constant pool entries management.
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Adds a number or string constant to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param value the value of the constant to be added to the constant pool. This parameter must be
+ * an {@link Integer}, {@link Byte}, {@link Character}, {@link Short}, {@link Boolean}, {@link
+ * Float}, {@link Long}, {@link Double}, {@link String}, {@link Type} or {@link Handle}.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstant(final Object value) {
+ if (value instanceof Integer) {
+ return addConstantInteger(((Integer) value).intValue());
+ } else if (value instanceof Byte) {
+ return addConstantInteger(((Byte) value).intValue());
+ } else if (value instanceof Character) {
+ return addConstantInteger(((Character) value).charValue());
+ } else if (value instanceof Short) {
+ return addConstantInteger(((Short) value).intValue());
+ } else if (value instanceof Boolean) {
+ return addConstantInteger(((Boolean) value).booleanValue() ? 1 : 0);
+ } else if (value instanceof Float) {
+ return addConstantFloat(((Float) value).floatValue());
+ } else if (value instanceof Long) {
+ return addConstantLong(((Long) value).longValue());
+ } else if (value instanceof Double) {
+ return addConstantDouble(((Double) value).doubleValue());
+ } else if (value instanceof String) {
+ return addConstantString((String) value);
+ } else if (value instanceof Type) {
+ Type type = (Type) value;
+ int typeSort = type.getSort();
+ if (typeSort == Type.OBJECT) {
+ return addConstantClass(type.getInternalName());
+ } else if (typeSort == Type.METHOD) {
+ return addConstantMethodType(type.getDescriptor());
+ } else { // type is a primitive or array type.
+ return addConstantClass(type.getDescriptor());
+ }
+ } else if (value instanceof Handle) {
+ Handle handle = (Handle) value;
+ return addConstantMethodHandle(
+ handle.getTag(),
+ handle.getOwner(),
+ handle.getName(),
+ handle.getDesc(),
+ handle.isInterface());
+ } else if (value instanceof ConstantDynamic) {
+ ConstantDynamic constantDynamic = (ConstantDynamic) value;
+ return addConstantDynamic(
+ constantDynamic.getName(),
+ constantDynamic.getDescriptor(),
+ constantDynamic.getBootstrapMethod(),
+ constantDynamic.getBootstrapMethodArgumentsUnsafe());
+ } else {
+ throw new IllegalArgumentException("value " + value);
+ }
+ }
+
+ /**
+ * Adds a CONSTANT_Class_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param value the internal name of a class.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantClass(final String value) {
+ return addConstantUtf8Reference(Symbol.CONSTANT_CLASS_TAG, value);
+ }
+
+ /**
+ * Adds a CONSTANT_Fieldref_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param owner the internal name of a class.
+ * @param name a field name.
+ * @param descriptor a field descriptor.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantFieldref(final String owner, final String name, final String descriptor) {
+ return addConstantMemberReference(Symbol.CONSTANT_FIELDREF_TAG, owner, name, descriptor);
+ }
+
+ /**
+ * Adds a CONSTANT_Methodref_info or CONSTANT_InterfaceMethodref_info to the constant pool of this
+ * symbol table. Does nothing if the constant pool already contains a similar item.
+ *
+ * @param owner the internal name of a class.
+ * @param name a method name.
+ * @param descriptor a method descriptor.
+ * @param isInterface whether owner is an interface or not.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantMethodref(
+ final String owner, final String name, final String descriptor, final boolean isInterface) {
+ int tag = isInterface ? Symbol.CONSTANT_INTERFACE_METHODREF_TAG : Symbol.CONSTANT_METHODREF_TAG;
+ return addConstantMemberReference(tag, owner, name, descriptor);
+ }
+
+ /**
+ * Adds a CONSTANT_Fieldref_info, CONSTANT_Methodref_info or CONSTANT_InterfaceMethodref_info to
+ * the constant pool of this symbol table. Does nothing if the constant pool already contains a
+ * similar item.
+ *
+ * @param tag one of {@link Symbol#CONSTANT_FIELDREF_TAG}, {@link Symbol#CONSTANT_METHODREF_TAG}
+ * or {@link Symbol#CONSTANT_INTERFACE_METHODREF_TAG}.
+ * @param owner the internal name of a class.
+ * @param name a field or method name.
+ * @param descriptor a field or method descriptor.
+ * @return a new or already existing Symbol with the given value.
+ */
+ private Entry addConstantMemberReference(
+ final int tag, final String owner, final String name, final String descriptor) {
+ int hashCode = hash(tag, owner, name, descriptor);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == tag
+ && entry.hashCode == hashCode
+ && entry.owner.equals(owner)
+ && entry.name.equals(name)
+ && entry.value.equals(descriptor)) {
+ return entry;
+ }
+ entry = entry.next;
+ }
+ constantPool.put122(
+ tag, addConstantClass(owner).index, addConstantNameAndType(name, descriptor));
+ return put(new Entry(constantPoolCount++, tag, owner, name, descriptor, 0, hashCode));
+ }
+
+ /**
+ * Adds a new CONSTANT_Fieldref_info, CONSTANT_Methodref_info or CONSTANT_InterfaceMethodref_info
+ * to the constant pool of this symbol table.
+ *
+ * @param index the constant pool index of the new Symbol.
+ * @param tag one of {@link Symbol#CONSTANT_FIELDREF_TAG}, {@link Symbol#CONSTANT_METHODREF_TAG}
+ * or {@link Symbol#CONSTANT_INTERFACE_METHODREF_TAG}.
+ * @param owner the internal name of a class.
+ * @param name a field or method name.
+ * @param descriptor a field or method descriptor.
+ */
+ private void addConstantMemberReference(
+ final int index,
+ final int tag,
+ final String owner,
+ final String name,
+ final String descriptor) {
+ add(new Entry(index, tag, owner, name, descriptor, 0, hash(tag, owner, name, descriptor)));
+ }
+
+ /**
+ * Adds a CONSTANT_String_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param value a string.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantString(final String value) {
+ return addConstantUtf8Reference(Symbol.CONSTANT_STRING_TAG, value);
+ }
+
+ /**
+ * Adds a CONSTANT_Integer_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param value an int.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantInteger(final int value) {
+ return addConstantIntegerOrFloat(Symbol.CONSTANT_INTEGER_TAG, value);
+ }
+
+ /**
+ * Adds a CONSTANT_Float_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param value a float.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantFloat(final float value) {
+ return addConstantIntegerOrFloat(Symbol.CONSTANT_FLOAT_TAG, Float.floatToRawIntBits(value));
+ }
+
+ /**
+ * Adds a CONSTANT_Integer_info or CONSTANT_Float_info to the constant pool of this symbol table.
+ * Does nothing if the constant pool already contains a similar item.
+ *
+ * @param tag one of {@link Symbol#CONSTANT_INTEGER_TAG} or {@link Symbol#CONSTANT_FLOAT_TAG}.
+ * @param value an int or float.
+ * @return a constant pool constant with the given tag and primitive values.
+ */
+ private Symbol addConstantIntegerOrFloat(final int tag, final int value) {
+ int hashCode = hash(tag, value);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == tag && entry.hashCode == hashCode && entry.data == value) {
+ return entry;
+ }
+ entry = entry.next;
+ }
+ constantPool.putByte(tag).putInt(value);
+ return put(new Entry(constantPoolCount++, tag, value, hashCode));
+ }
+
+ /**
+ * Adds a new CONSTANT_Integer_info or CONSTANT_Float_info to the constant pool of this symbol
+ * table.
+ *
+ * @param index the constant pool index of the new Symbol.
+ * @param tag one of {@link Symbol#CONSTANT_INTEGER_TAG} or {@link Symbol#CONSTANT_FLOAT_TAG}.
+ * @param value an int or float.
+ */
+ private void addConstantIntegerOrFloat(final int index, final int tag, final int value) {
+ add(new Entry(index, tag, value, hash(tag, value)));
+ }
+
+ /**
+ * Adds a CONSTANT_Long_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param value a long.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantLong(final long value) {
+ return addConstantLongOrDouble(Symbol.CONSTANT_LONG_TAG, value);
+ }
+
+ /**
+ * Adds a CONSTANT_Double_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param value a double.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantDouble(final double value) {
+ return addConstantLongOrDouble(Symbol.CONSTANT_DOUBLE_TAG, Double.doubleToRawLongBits(value));
+ }
+
+ /**
+ * Adds a CONSTANT_Long_info or CONSTANT_Double_info to the constant pool of this symbol table.
+ * Does nothing if the constant pool already contains a similar item.
+ *
+ * @param tag one of {@link Symbol#CONSTANT_LONG_TAG} or {@link Symbol#CONSTANT_DOUBLE_TAG}.
+ * @param value a long or double.
+ * @return a constant pool constant with the given tag and primitive values.
+ */
+ private Symbol addConstantLongOrDouble(final int tag, final long value) {
+ int hashCode = hash(tag, value);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == tag && entry.hashCode == hashCode && entry.data == value) {
+ return entry;
+ }
+ entry = entry.next;
+ }
+ int index = constantPoolCount;
+ constantPool.putByte(tag).putLong(value);
+ constantPoolCount += 2;
+ return put(new Entry(index, tag, value, hashCode));
+ }
+
+ /**
+ * Adds a new CONSTANT_Long_info or CONSTANT_Double_info to the constant pool of this symbol
+ * table.
+ *
+ * @param index the constant pool index of the new Symbol.
+ * @param tag one of {@link Symbol#CONSTANT_LONG_TAG} or {@link Symbol#CONSTANT_DOUBLE_TAG}.
+ * @param value a long or double.
+ */
+ private void addConstantLongOrDouble(final int index, final int tag, final long value) {
+ add(new Entry(index, tag, value, hash(tag, value)));
+ }
+
+ /**
+ * Adds a CONSTANT_NameAndType_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param name a field or method name.
+ * @param descriptor a field or method descriptor.
+ * @return a new or already existing Symbol with the given value.
+ */
+ int addConstantNameAndType(final String name, final String descriptor) {
+ final int tag = Symbol.CONSTANT_NAME_AND_TYPE_TAG;
+ int hashCode = hash(tag, name, descriptor);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == tag
+ && entry.hashCode == hashCode
+ && entry.name.equals(name)
+ && entry.value.equals(descriptor)) {
+ return entry.index;
+ }
+ entry = entry.next;
+ }
+ constantPool.put122(tag, addConstantUtf8(name), addConstantUtf8(descriptor));
+ return put(new Entry(constantPoolCount++, tag, name, descriptor, hashCode)).index;
+ }
+
+ /**
+ * Adds a new CONSTANT_NameAndType_info to the constant pool of this symbol table.
+ *
+ * @param index the constant pool index of the new Symbol.
+ * @param name a field or method name.
+ * @param descriptor a field or method descriptor.
+ */
+ private void addConstantNameAndType(final int index, final String name, final String descriptor) {
+ final int tag = Symbol.CONSTANT_NAME_AND_TYPE_TAG;
+ add(new Entry(index, tag, name, descriptor, hash(tag, name, descriptor)));
+ }
+
+ /**
+ * Adds a CONSTANT_Utf8_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param value a string.
+ * @return a new or already existing Symbol with the given value.
+ */
+ int addConstantUtf8(final String value) {
+ int hashCode = hash(Symbol.CONSTANT_UTF8_TAG, value);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == Symbol.CONSTANT_UTF8_TAG
+ && entry.hashCode == hashCode
+ && entry.value.equals(value)) {
+ return entry.index;
+ }
+ entry = entry.next;
+ }
+ constantPool.putByte(Symbol.CONSTANT_UTF8_TAG).putUTF8(value);
+ return put(new Entry(constantPoolCount++, Symbol.CONSTANT_UTF8_TAG, value, hashCode)).index;
+ }
+
+ /**
+ * Adds a new CONSTANT_String_info to the constant pool of this symbol table.
+ *
+ * @param index the constant pool index of the new Symbol.
+ * @param value a string.
+ */
+ private void addConstantUtf8(final int index, final String value) {
+ add(new Entry(index, Symbol.CONSTANT_UTF8_TAG, value, hash(Symbol.CONSTANT_UTF8_TAG, value)));
+ }
+
+ /**
+ * Adds a CONSTANT_MethodHandle_info to the constant pool of this symbol table. Does nothing if
+ * the constant pool already contains a similar item.
+ *
+ * @param referenceKind one of {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, {@link
+ * Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL}, {@link
+ * Opcodes#H_INVOKESTATIC}, {@link Opcodes#H_INVOKESPECIAL}, {@link
+ * Opcodes#H_NEWINVOKESPECIAL} or {@link Opcodes#H_INVOKEINTERFACE}.
+ * @param owner the internal name of a class of interface.
+ * @param name a field or method name.
+ * @param descriptor a field or method descriptor.
+ * @param isInterface whether owner is an interface or not.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantMethodHandle(
+ final int referenceKind,
+ final String owner,
+ final String name,
+ final String descriptor,
+ final boolean isInterface) {
+ final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
+ // Note that we don't need to include isInterface in the hash computation, because it is
+ // redundant with owner (we can't have the same owner with different isInterface values).
+ int hashCode = hash(tag, owner, name, descriptor, referenceKind);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == tag
+ && entry.hashCode == hashCode
+ && entry.data == referenceKind
+ && entry.owner.equals(owner)
+ && entry.name.equals(name)
+ && entry.value.equals(descriptor)) {
+ return entry;
+ }
+ entry = entry.next;
+ }
+ if (referenceKind <= Opcodes.H_PUTSTATIC) {
+ constantPool.put112(tag, referenceKind, addConstantFieldref(owner, name, descriptor).index);
+ } else {
+ constantPool.put112(
+ tag, referenceKind, addConstantMethodref(owner, name, descriptor, isInterface).index);
+ }
+ return put(
+ new Entry(constantPoolCount++, tag, owner, name, descriptor, referenceKind, hashCode));
+ }
+
+ /**
+ * Adds a new CONSTANT_MethodHandle_info to the constant pool of this symbol table.
+ *
+ * @param index the constant pool index of the new Symbol.
+ * @param referenceKind one of {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, {@link
+ * Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL}, {@link
+ * Opcodes#H_INVOKESTATIC}, {@link Opcodes#H_INVOKESPECIAL}, {@link
+ * Opcodes#H_NEWINVOKESPECIAL} or {@link Opcodes#H_INVOKEINTERFACE}.
+ * @param owner the internal name of a class of interface.
+ * @param name a field or method name.
+ * @param descriptor a field or method descriptor.
+ */
+ private void addConstantMethodHandle(
+ final int index,
+ final int referenceKind,
+ final String owner,
+ final String name,
+ final String descriptor) {
+ final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
+ int hashCode = hash(tag, owner, name, descriptor, referenceKind);
+ add(new Entry(index, tag, owner, name, descriptor, referenceKind, hashCode));
+ }
+
+ /**
+ * Adds a CONSTANT_MethodType_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param methodDescriptor a method descriptor.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantMethodType(final String methodDescriptor) {
+ return addConstantUtf8Reference(Symbol.CONSTANT_METHOD_TYPE_TAG, methodDescriptor);
+ }
+
+ /**
+ * Adds a CONSTANT_Dynamic_info to the constant pool of this symbol table. Also adds the related
+ * bootstrap method to the BootstrapMethods of this symbol table. Does nothing if the constant
+ * pool already contains a similar item.
+ *
+ * @param name a method name.
+ * @param descriptor a field descriptor.
+ * @param bootstrapMethodHandle a bootstrap method handle.
+ * @param bootstrapMethodArguments the bootstrap method arguments.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantDynamic(
+ final String name,
+ final String descriptor,
+ final Handle bootstrapMethodHandle,
+ final Object... bootstrapMethodArguments) {
+ Symbol bootstrapMethod = addBootstrapMethod(bootstrapMethodHandle, bootstrapMethodArguments);
+ return addConstantDynamicOrInvokeDynamicReference(
+ Symbol.CONSTANT_DYNAMIC_TAG, name, descriptor, bootstrapMethod.index);
+ }
+
+ /**
+ * Adds a CONSTANT_InvokeDynamic_info to the constant pool of this symbol table. Also adds the
+ * related bootstrap method to the BootstrapMethods of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param name a method name.
+ * @param descriptor a method descriptor.
+ * @param bootstrapMethodHandle a bootstrap method handle.
+ * @param bootstrapMethodArguments the bootstrap method arguments.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantInvokeDynamic(
+ final String name,
+ final String descriptor,
+ final Handle bootstrapMethodHandle,
+ final Object... bootstrapMethodArguments) {
+ Symbol bootstrapMethod = addBootstrapMethod(bootstrapMethodHandle, bootstrapMethodArguments);
+ return addConstantDynamicOrInvokeDynamicReference(
+ Symbol.CONSTANT_INVOKE_DYNAMIC_TAG, name, descriptor, bootstrapMethod.index);
+ }
+
+ /**
+ * Adds a CONSTANT_Dynamic or a CONSTANT_InvokeDynamic_info to the constant pool of this symbol
+ * table. Does nothing if the constant pool already contains a similar item.
+ *
+ * @param tag one of {@link Symbol#CONSTANT_DYNAMIC_TAG} or {@link
+ * Symbol#CONSTANT_INVOKE_DYNAMIC_TAG}.
+ * @param name a method name.
+ * @param descriptor a field descriptor for CONSTANT_DYNAMIC_TAG) or a method descriptor for
+ * CONSTANT_INVOKE_DYNAMIC_TAG.
+ * @param bootstrapMethodIndex the index of a bootstrap method in the BootstrapMethods attribute.
+ * @return a new or already existing Symbol with the given value.
+ */
+ private Symbol addConstantDynamicOrInvokeDynamicReference(
+ final int tag, final String name, final String descriptor, final int bootstrapMethodIndex) {
+ int hashCode = hash(tag, name, descriptor, bootstrapMethodIndex);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == tag
+ && entry.hashCode == hashCode
+ && entry.data == bootstrapMethodIndex
+ && entry.name.equals(name)
+ && entry.value.equals(descriptor)) {
+ return entry;
+ }
+ entry = entry.next;
+ }
+ constantPool.put122(tag, bootstrapMethodIndex, addConstantNameAndType(name, descriptor));
+ return put(
+ new Entry(
+ constantPoolCount++, tag, null, name, descriptor, bootstrapMethodIndex, hashCode));
+ }
+
+ /**
+ * Adds a new CONSTANT_Dynamic_info or CONSTANT_InvokeDynamic_info to the constant pool of this
+ * symbol table.
+ *
+ * @param tag one of {@link Symbol#CONSTANT_DYNAMIC_TAG} or {@link
+ * Symbol#CONSTANT_INVOKE_DYNAMIC_TAG}.
+ * @param index the constant pool index of the new Symbol.
+ * @param name a method name.
+ * @param descriptor a field descriptor for CONSTANT_DYNAMIC_TAG or a method descriptor for
+ * CONSTANT_INVOKE_DYNAMIC_TAG.
+ * @param bootstrapMethodIndex the index of a bootstrap method in the BootstrapMethods attribute.
+ */
+ private void addConstantDynamicOrInvokeDynamicReference(
+ final int tag,
+ final int index,
+ final String name,
+ final String descriptor,
+ final int bootstrapMethodIndex) {
+ int hashCode = hash(tag, name, descriptor, bootstrapMethodIndex);
+ add(new Entry(index, tag, null, name, descriptor, bootstrapMethodIndex, hashCode));
+ }
+
+ /**
+ * Adds a CONSTANT_Module_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param moduleName a fully qualified name (using dots) of a module.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantModule(final String moduleName) {
+ return addConstantUtf8Reference(Symbol.CONSTANT_MODULE_TAG, moduleName);
+ }
+
+ /**
+ * Adds a CONSTANT_Package_info to the constant pool of this symbol table. Does nothing if the
+ * constant pool already contains a similar item.
+ *
+ * @param packageName the internal name of a package.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addConstantPackage(final String packageName) {
+ return addConstantUtf8Reference(Symbol.CONSTANT_PACKAGE_TAG, packageName);
+ }
+
+ /**
+ * Adds a CONSTANT_Class_info, CONSTANT_String_info, CONSTANT_MethodType_info,
+ * CONSTANT_Module_info or CONSTANT_Package_info to the constant pool of this symbol table. Does
+ * nothing if the constant pool already contains a similar item.
+ *
+ * @param tag one of {@link Symbol#CONSTANT_CLASS_TAG}, {@link Symbol#CONSTANT_STRING_TAG}, {@link
+ * Symbol#CONSTANT_METHOD_TYPE_TAG}, {@link Symbol#CONSTANT_MODULE_TAG} or {@link
+ * Symbol#CONSTANT_PACKAGE_TAG}.
+ * @param value an internal class name, an arbitrary string, a method descriptor, a module or a
+ * package name, depending on tag.
+ * @return a new or already existing Symbol with the given value.
+ */
+ private Symbol addConstantUtf8Reference(final int tag, final String value) {
+ int hashCode = hash(tag, value);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == tag && entry.hashCode == hashCode && entry.value.equals(value)) {
+ return entry;
+ }
+ entry = entry.next;
+ }
+ constantPool.put12(tag, addConstantUtf8(value));
+ return put(new Entry(constantPoolCount++, tag, value, hashCode));
+ }
+
+ /**
+ * Adds a new CONSTANT_Class_info, CONSTANT_String_info, CONSTANT_MethodType_info,
+ * CONSTANT_Module_info or CONSTANT_Package_info to the constant pool of this symbol table.
+ *
+ * @param index the constant pool index of the new Symbol.
+ * @param tag one of {@link Symbol#CONSTANT_CLASS_TAG}, {@link Symbol#CONSTANT_STRING_TAG}, {@link
+ * Symbol#CONSTANT_METHOD_TYPE_TAG}, {@link Symbol#CONSTANT_MODULE_TAG} or {@link
+ * Symbol#CONSTANT_PACKAGE_TAG}.
+ * @param value an internal class name, an arbitrary string, a method descriptor, a module or a
+ * package name, depending on tag.
+ */
+ private void addConstantUtf8Reference(final int index, final int tag, final String value) {
+ add(new Entry(index, tag, value, hash(tag, value)));
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Bootstrap method entries management.
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Adds a bootstrap method to the BootstrapMethods attribute of this symbol table. Does nothing if
+ * the BootstrapMethods already contains a similar bootstrap method.
+ *
+ * @param bootstrapMethodHandle a bootstrap method handle.
+ * @param bootstrapMethodArguments the bootstrap method arguments.
+ * @return a new or already existing Symbol with the given value.
+ */
+ Symbol addBootstrapMethod(
+ final Handle bootstrapMethodHandle, final Object... bootstrapMethodArguments) {
+ ByteVector bootstrapMethodsAttribute = bootstrapMethods;
+ if (bootstrapMethodsAttribute == null) {
+ bootstrapMethodsAttribute = bootstrapMethods = new ByteVector();
+ }
+
+ // The bootstrap method arguments can be Constant_Dynamic values, which reference other
+ // bootstrap methods. We must therefore add the bootstrap method arguments to the constant pool
+ // and BootstrapMethods attribute first, so that the BootstrapMethods attribute is not modified
+ // while adding the given bootstrap method to it, in the rest of this method.
+ for (Object bootstrapMethodArgument : bootstrapMethodArguments) {
+ addConstant(bootstrapMethodArgument);
+ }
+
+ // Write the bootstrap method in the BootstrapMethods table. This is necessary to be able to
+ // compare it with existing ones, and will be reverted below if there is already a similar
+ // bootstrap method.
+ int bootstrapMethodOffset = bootstrapMethodsAttribute.length;
+ bootstrapMethodsAttribute.putShort(
+ addConstantMethodHandle(
+ bootstrapMethodHandle.getTag(),
+ bootstrapMethodHandle.getOwner(),
+ bootstrapMethodHandle.getName(),
+ bootstrapMethodHandle.getDesc(),
+ bootstrapMethodHandle.isInterface())
+ .index);
+ int numBootstrapArguments = bootstrapMethodArguments.length;
+ bootstrapMethodsAttribute.putShort(numBootstrapArguments);
+ for (Object bootstrapMethodArgument : bootstrapMethodArguments) {
+ bootstrapMethodsAttribute.putShort(addConstant(bootstrapMethodArgument).index);
+ }
+
+ // Compute the length and the hash code of the bootstrap method.
+ int bootstrapMethodlength = bootstrapMethodsAttribute.length - bootstrapMethodOffset;
+ int hashCode = bootstrapMethodHandle.hashCode();
+ for (Object bootstrapMethodArgument : bootstrapMethodArguments) {
+ hashCode ^= bootstrapMethodArgument.hashCode();
+ }
+ hashCode &= 0x7FFFFFFF;
+
+ // Add the bootstrap method to the symbol table or revert the above changes.
+ return addBootstrapMethod(bootstrapMethodOffset, bootstrapMethodlength, hashCode);
+ }
+
+ /**
+ * Adds a bootstrap method to the BootstrapMethods attribute of this symbol table. Does nothing if
+ * the BootstrapMethods already contains a similar bootstrap method (more precisely, reverts the
+ * content of {@link #bootstrapMethods} to remove the last, duplicate bootstrap method).
+ *
+ * @param offset the offset of the last bootstrap method in {@link #bootstrapMethods}, in bytes.
+ * @param length the length of this bootstrap method in {@link #bootstrapMethods}, in bytes.
+ * @param hashCode the hash code of this bootstrap method.
+ * @return a new or already existing Symbol with the given value.
+ */
+ private Symbol addBootstrapMethod(final int offset, final int length, final int hashCode) {
+ final byte[] bootstrapMethodsData = bootstrapMethods.data;
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == Symbol.BOOTSTRAP_METHOD_TAG && entry.hashCode == hashCode) {
+ int otherOffset = (int) entry.data;
+ boolean isSameBootstrapMethod = true;
+ for (int i = 0; i < length; ++i) {
+ if (bootstrapMethodsData[offset + i] != bootstrapMethodsData[otherOffset + i]) {
+ isSameBootstrapMethod = false;
+ break;
+ }
+ }
+ if (isSameBootstrapMethod) {
+ bootstrapMethods.length = offset; // Revert to old position.
+ return entry;
+ }
+ }
+ entry = entry.next;
+ }
+ return put(new Entry(bootstrapMethodCount++, Symbol.BOOTSTRAP_METHOD_TAG, offset, hashCode));
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Type table entries management.
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the type table element whose index is given.
+ *
+ * @param typeIndex a type table index.
+ * @return the type table element whose index is given.
+ */
+ Symbol getType(final int typeIndex) {
+ return typeTable[typeIndex];
+ }
+
+ /**
+ * Adds a type in the type table of this symbol table. Does nothing if the type table already
+ * contains a similar type.
+ *
+ * @param value an internal class name.
+ * @return the index of a new or already existing type Symbol with the given value.
+ */
+ int addType(final String value) {
+ int hashCode = hash(Symbol.TYPE_TAG, value);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == Symbol.TYPE_TAG && entry.hashCode == hashCode && entry.value.equals(value)) {
+ return entry.index;
+ }
+ entry = entry.next;
+ }
+ return addTypeInternal(new Entry(typeCount, Symbol.TYPE_TAG, value, hashCode));
+ }
+
+ /**
+ * Adds an {@link Frame#ITEM_UNINITIALIZED} type in the type table of this symbol table. Does
+ * nothing if the type table already contains a similar type.
+ *
+ * @param value an internal class name.
+ * @param bytecodeOffset the bytecode offset of the NEW instruction that created this {@link
+ * Frame#ITEM_UNINITIALIZED} type value.
+ * @return the index of a new or already existing type Symbol with the given value.
+ */
+ int addUninitializedType(final String value, final int bytecodeOffset) {
+ int hashCode = hash(Symbol.UNINITIALIZED_TYPE_TAG, value, bytecodeOffset);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == Symbol.UNINITIALIZED_TYPE_TAG
+ && entry.hashCode == hashCode
+ && entry.data == bytecodeOffset
+ && entry.value.equals(value)) {
+ return entry.index;
+ }
+ entry = entry.next;
+ }
+ return addTypeInternal(
+ new Entry(typeCount, Symbol.UNINITIALIZED_TYPE_TAG, value, bytecodeOffset, hashCode));
+ }
+
+ /**
+ * Adds a merged type in the type table of this symbol table. Does nothing if the type table
+ * already contains a similar type.
+ *
+ * @param typeTableIndex1 a {@link Symbol#TYPE_TAG} type, specified by its index in the type
+ * table.
+ * @param typeTableIndex2 another {@link Symbol#TYPE_TAG} type, specified by its index in the type
+ * table.
+ * @return the index of a new or already existing {@link Symbol#TYPE_TAG} type Symbol,
+ * corresponding to the common super class of the given types.
+ */
+ int addMergedType(final int typeTableIndex1, final int typeTableIndex2) {
+ long data =
+ typeTableIndex1 < typeTableIndex2
+ ? typeTableIndex1 | (((long) typeTableIndex2) << 32)
+ : typeTableIndex2 | (((long) typeTableIndex1) << 32);
+ int hashCode = hash(Symbol.MERGED_TYPE_TAG, typeTableIndex1 + typeTableIndex2);
+ Entry entry = get(hashCode);
+ while (entry != null) {
+ if (entry.tag == Symbol.MERGED_TYPE_TAG && entry.hashCode == hashCode && entry.data == data) {
+ return entry.info;
+ }
+ entry = entry.next;
+ }
+ String type1 = typeTable[typeTableIndex1].value;
+ String type2 = typeTable[typeTableIndex2].value;
+ int commonSuperTypeIndex = addType(classWriter.getCommonSuperClass(type1, type2));
+ put(new Entry(typeCount, Symbol.MERGED_TYPE_TAG, data, hashCode)).info = commonSuperTypeIndex;
+ return commonSuperTypeIndex;
+ }
+
+ /**
+ * Adds the given type Symbol to {@link #typeTable}.
+ *
+ * @param entry a {@link Symbol#TYPE_TAG} or {@link Symbol#UNINITIALIZED_TYPE_TAG} type symbol.
+ * The index of this Symbol must be equal to the current value of {@link #typeCount}.
+ * @return the index in {@link #typeTable} where the given type was added, which is also equal to
+ * entry's index by hypothesis.
+ */
+ private int addTypeInternal(final Entry entry) {
+ if (typeTable == null) {
+ typeTable = new Entry[16];
+ }
+ if (typeCount == typeTable.length) {
+ Entry[] newTypeTable = new Entry[2 * typeTable.length];
+ System.arraycopy(typeTable, 0, newTypeTable, 0, typeTable.length);
+ typeTable = newTypeTable;
+ }
+ typeTable[typeCount++] = entry;
+ return put(entry).index;
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Static helper methods to compute hash codes.
+ // -----------------------------------------------------------------------------------------------
+
+ private static int hash(final int tag, final int value) {
+ return 0x7FFFFFFF & (tag + value);
+ }
+
+ private static int hash(final int tag, final long value) {
+ return 0x7FFFFFFF & (tag + (int) value + (int) (value >>> 32));
+ }
+
+ private static int hash(final int tag, final String value) {
+ return 0x7FFFFFFF & (tag + value.hashCode());
+ }
+
+ private static int hash(final int tag, final String value1, final int value2) {
+ return 0x7FFFFFFF & (tag + value1.hashCode() + value2);
+ }
+
+ private static int hash(final int tag, final String value1, final String value2) {
+ return 0x7FFFFFFF & (tag + value1.hashCode() * value2.hashCode());
+ }
+
+ private static int hash(
+ final int tag, final String value1, final String value2, final int value3) {
+ return 0x7FFFFFFF & (tag + value1.hashCode() * value2.hashCode() * (value3 + 1));
+ }
+
+ private static int hash(
+ final int tag, final String value1, final String value2, final String value3) {
+ return 0x7FFFFFFF & (tag + value1.hashCode() * value2.hashCode() * value3.hashCode());
+ }
+
+ private static int hash(
+ final int tag,
+ final String value1,
+ final String value2,
+ final String value3,
+ final int value4) {
+ return 0x7FFFFFFF & (tag + value1.hashCode() * value2.hashCode() * value3.hashCode() * value4);
+ }
+
+ /**
+ * An entry of a SymbolTable. This concrete and private subclass of {@link Symbol} adds two fields
+ * which are only used inside SymbolTable, to implement hash sets of symbols (in order to avoid
+ * duplicate symbols). See {@link #entries}.
+ *
+ * @author Eric Bruneton
+ */
+ private static class Entry extends Symbol {
+
+ /** The hash code of this entry. */
+ final int hashCode;
+
+ /**
+ * Another entry (and so on recursively) having the same hash code (modulo the size of {@link
+ * #entries}) as this one.
+ */
+ Entry next;
+
+ Entry(
+ final int index,
+ final int tag,
+ final String owner,
+ final String name,
+ final String value,
+ final long data,
+ final int hashCode) {
+ super(index, tag, owner, name, value, data);
+ this.hashCode = hashCode;
+ }
+
+ Entry(final int index, final int tag, final String value, final int hashCode) {
+ super(index, tag, /* owner = */ null, /* name = */ null, value, /* data = */ 0);
+ this.hashCode = hashCode;
+ }
+
+ Entry(final int index, final int tag, final String value, final long data, final int hashCode) {
+ super(index, tag, /* owner = */ null, /* name = */ null, value, data);
+ this.hashCode = hashCode;
+ }
+
+ Entry(
+ final int index, final int tag, final String name, final String value, final int hashCode) {
+ super(index, tag, /* owner = */ null, name, value, /* data = */ 0);
+ this.hashCode = hashCode;
+ }
+
+ Entry(final int index, final int tag, final long data, final int hashCode) {
+ super(index, tag, /* owner = */ null, /* name = */ null, /* value = */ null, data);
+ this.hashCode = hashCode;
+ }
+ }
+}
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 3a277cb..f8006f5 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
@@ -1,896 +1,891 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
package jersey.repackaged.org.objectweb.asm;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
/**
- * A Java field or method type. This class can be used to make it easier to
- * manipulate type and method descriptors.
+ * A Java field or method type. This class can be used to make it easier to manipulate type and
+ * method descriptors.
*
* @author Eric Bruneton
* @author Chris Nokleberg
*/
-public class Type {
+public final class Type {
- /**
- * The sort of the <tt>void</tt> type. See {@link #getSort getSort}.
- */
- public static final int VOID = 0;
+ /** The sort of the {@code void} type. See {@link #getSort}. */
+ public static final int VOID = 0;
- /**
- * The sort of the <tt>boolean</tt> type. See {@link #getSort getSort}.
- */
- public static final int BOOLEAN = 1;
+ /** The sort of the {@code boolean} type. See {@link #getSort}. */
+ public static final int BOOLEAN = 1;
- /**
- * The sort of the <tt>char</tt> type. See {@link #getSort getSort}.
- */
- public static final int CHAR = 2;
+ /** The sort of the {@code char} type. See {@link #getSort}. */
+ public static final int CHAR = 2;
- /**
- * The sort of the <tt>byte</tt> type. See {@link #getSort getSort}.
- */
- public static final int BYTE = 3;
+ /** The sort of the {@code byte} type. See {@link #getSort}. */
+ public static final int BYTE = 3;
- /**
- * The sort of the <tt>short</tt> type. See {@link #getSort getSort}.
- */
- public static final int SHORT = 4;
+ /** The sort of the {@code short} type. See {@link #getSort}. */
+ public static final int SHORT = 4;
- /**
- * The sort of the <tt>int</tt> type. See {@link #getSort getSort}.
- */
- public static final int INT = 5;
+ /** The sort of the {@code int} type. See {@link #getSort}. */
+ public static final int INT = 5;
- /**
- * The sort of the <tt>float</tt> type. See {@link #getSort getSort}.
- */
- public static final int FLOAT = 6;
+ /** The sort of the {@code float} type. See {@link #getSort}. */
+ public static final int FLOAT = 6;
- /**
- * The sort of the <tt>long</tt> type. See {@link #getSort getSort}.
- */
- public static final int LONG = 7;
+ /** The sort of the {@code long} type. See {@link #getSort}. */
+ public static final int LONG = 7;
- /**
- * The sort of the <tt>double</tt> type. See {@link #getSort getSort}.
- */
- public static final int DOUBLE = 8;
+ /** The sort of the {@code double} type. See {@link #getSort}. */
+ public static final int DOUBLE = 8;
- /**
- * The sort of array reference types. See {@link #getSort getSort}.
- */
- public static final int ARRAY = 9;
+ /** The sort of array reference types. See {@link #getSort}. */
+ public static final int ARRAY = 9;
- /**
- * The sort of object reference types. See {@link #getSort getSort}.
- */
- public static final int OBJECT = 10;
+ /** The sort of object reference types. See {@link #getSort}. */
+ public static final int OBJECT = 10;
- /**
- * The sort of method types. See {@link #getSort getSort}.
- */
- public static final int METHOD = 11;
+ /** The sort of method types. See {@link #getSort}. */
+ public static final int METHOD = 11;
- /**
- * The <tt>void</tt> type.
- */
- public static final Type VOID_TYPE = new Type(VOID, null, ('V' << 24)
- | (5 << 16) | (0 << 8) | 0, 1);
+ /** The (private) sort of object reference types represented with an internal name. */
+ private static final int INTERNAL = 12;
- /**
- * The <tt>boolean</tt> type.
- */
- public static final Type BOOLEAN_TYPE = new Type(BOOLEAN, null, ('Z' << 24)
- | (0 << 16) | (5 << 8) | 1, 1);
+ /** The descriptors of the primitive types. */
+ private static final String PRIMITIVE_DESCRIPTORS = "VZCBSIFJD";
- /**
- * The <tt>char</tt> type.
- */
- public static final Type CHAR_TYPE = new Type(CHAR, null, ('C' << 24)
- | (0 << 16) | (6 << 8) | 1, 1);
+ /** The {@code void} type. */
+ public static final Type VOID_TYPE = new Type(VOID, PRIMITIVE_DESCRIPTORS, VOID, VOID + 1);
- /**
- * The <tt>byte</tt> type.
- */
- public static final Type BYTE_TYPE = new Type(BYTE, null, ('B' << 24)
- | (0 << 16) | (5 << 8) | 1, 1);
+ /** The {@code boolean} type. */
+ public static final Type BOOLEAN_TYPE =
+ new Type(BOOLEAN, PRIMITIVE_DESCRIPTORS, BOOLEAN, BOOLEAN + 1);
- /**
- * The <tt>short</tt> type.
- */
- public static final Type SHORT_TYPE = new Type(SHORT, null, ('S' << 24)
- | (0 << 16) | (7 << 8) | 1, 1);
+ /** The {@code char} type. */
+ public static final Type CHAR_TYPE = new Type(CHAR, PRIMITIVE_DESCRIPTORS, CHAR, CHAR + 1);
- /**
- * The <tt>int</tt> type.
- */
- public static final Type INT_TYPE = new Type(INT, null, ('I' << 24)
- | (0 << 16) | (0 << 8) | 1, 1);
+ /** The {@code byte} type. */
+ public static final Type BYTE_TYPE = new Type(BYTE, PRIMITIVE_DESCRIPTORS, BYTE, BYTE + 1);
- /**
- * The <tt>float</tt> type.
- */
- public static final Type FLOAT_TYPE = new Type(FLOAT, null, ('F' << 24)
- | (2 << 16) | (2 << 8) | 1, 1);
+ /** The {@code short} type. */
+ public static final Type SHORT_TYPE = new Type(SHORT, PRIMITIVE_DESCRIPTORS, SHORT, SHORT + 1);
- /**
- * The <tt>long</tt> type.
- */
- public static final Type LONG_TYPE = new Type(LONG, null, ('J' << 24)
- | (1 << 16) | (1 << 8) | 2, 1);
+ /** The {@code int} type. */
+ public static final Type INT_TYPE = new Type(INT, PRIMITIVE_DESCRIPTORS, INT, INT + 1);
- /**
- * The <tt>double</tt> type.
- */
- public static final Type DOUBLE_TYPE = new Type(DOUBLE, null, ('D' << 24)
- | (3 << 16) | (3 << 8) | 2, 1);
+ /** The {@code float} type. */
+ public static final Type FLOAT_TYPE = new Type(FLOAT, PRIMITIVE_DESCRIPTORS, FLOAT, FLOAT + 1);
- // ------------------------------------------------------------------------
- // Fields
- // ------------------------------------------------------------------------
+ /** The {@code long} type. */
+ public static final Type LONG_TYPE = new Type(LONG, PRIMITIVE_DESCRIPTORS, LONG, LONG + 1);
- /**
- * The sort of this Java type.
- */
- private final int sort;
+ /** The {@code double} type. */
+ public static final Type DOUBLE_TYPE =
+ new Type(DOUBLE, PRIMITIVE_DESCRIPTORS, DOUBLE, DOUBLE + 1);
- /**
- * A buffer containing the internal name of this Java type. This field is
- * only used for reference types.
- */
- private final char[] buf;
+ // -----------------------------------------------------------------------------------------------
+ // Fields
+ // -----------------------------------------------------------------------------------------------
- /**
- * The offset of the internal name of this Java type in {@link #buf buf} or,
- * for primitive types, the size, descriptor and getOpcode offsets for this
- * type (byte 0 contains the size, byte 1 the descriptor, byte 2 the offset
- * for IALOAD or IASTORE, byte 3 the offset for all other instructions).
- */
- private final int off;
+ /**
+ * The sort of this type. Either {@link #VOID}, {@link #BOOLEAN}, {@link #CHAR}, {@link #BYTE},
+ * {@link #SHORT}, {@link #INT}, {@link #FLOAT}, {@link #LONG}, {@link #DOUBLE}, {@link #ARRAY},
+ * {@link #OBJECT}, {@link #METHOD} or {@link #INTERNAL}.
+ */
+ private final int sort;
- /**
- * The length of the internal name of this Java type.
- */
- private final int len;
+ /**
+ * A buffer containing the value of this field or method type. This value is an internal name for
+ * {@link #OBJECT} and {@link #INTERNAL} types, and a field or method descriptor in the other
+ * cases.
+ *
+ * <p>For {@link #OBJECT} types, this field also contains the descriptor: the characters in
+ * [{@link #valueBegin},{@link #valueEnd}) contain the internal name, and those in [{@link
+ * #valueBegin} - 1, {@link #valueEnd} + 1) contain the descriptor.
+ */
+ private final String valueBuffer;
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
+ /**
+ * The beginning index, inclusive, of the value of this Java field or method type in {@link
+ * #valueBuffer}. This value is an internal name for {@link #OBJECT} and {@link #INTERNAL} types,
+ * and a field or method descriptor in the other cases.
+ */
+ private final int valueBegin;
- /**
- * Constructs a reference type.
- *
- * @param sort
- * the sort of the reference type to be constructed.
- * @param buf
- * a buffer containing the descriptor of the previous type.
- * @param off
- * the offset of this descriptor in the previous buffer.
- * @param len
- * the length of this descriptor.
- */
- private Type(final int sort, final char[] buf, final int off, final int len) {
- this.sort = sort;
- this.buf = buf;
- this.off = off;
- this.len = len;
+ /**
+ * The end index, exclusive, of the value of this Java field or method type in {@link
+ * #valueBuffer}. This value is an internal name for {@link #OBJECT} and {@link #INTERNAL} types,
+ * and a field or method descriptor in the other cases.
+ */
+ private final int valueEnd;
+
+ /**
+ * Constructs a reference type.
+ *
+ * @param sort the sort of this type, see {@link #sort}.
+ * @param valueBuffer a buffer containing the value of this field or method type.
+ * @param valueBegin the beginning index, inclusive, of the value of this field or method type in
+ * valueBuffer.
+ * @param valueEnd the end index, exclusive, of the value of this field or method type in
+ * valueBuffer.
+ */
+ private Type(final int sort, final String valueBuffer, final int valueBegin, final int valueEnd) {
+ this.sort = sort;
+ this.valueBuffer = valueBuffer;
+ this.valueBegin = valueBegin;
+ this.valueEnd = valueEnd;
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Methods to get Type(s) from a descriptor, a reflected Method or Constructor, other types, etc.
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the {@link Type} corresponding to the given type descriptor.
+ *
+ * @param typeDescriptor a field or method type descriptor.
+ * @return the {@link Type} corresponding to the given type descriptor.
+ */
+ public static Type getType(final String typeDescriptor) {
+ return getTypeInternal(typeDescriptor, 0, typeDescriptor.length());
+ }
+
+ /**
+ * Returns the {@link Type} corresponding to the given class.
+ *
+ * @param clazz a class.
+ * @return the {@link Type} corresponding to the given class.
+ */
+ public static Type getType(final Class<?> clazz) {
+ if (clazz.isPrimitive()) {
+ if (clazz == Integer.TYPE) {
+ return INT_TYPE;
+ } else if (clazz == Void.TYPE) {
+ return VOID_TYPE;
+ } else if (clazz == Boolean.TYPE) {
+ return BOOLEAN_TYPE;
+ } else if (clazz == Byte.TYPE) {
+ return BYTE_TYPE;
+ } else if (clazz == Character.TYPE) {
+ return CHAR_TYPE;
+ } else if (clazz == Short.TYPE) {
+ return SHORT_TYPE;
+ } else if (clazz == Double.TYPE) {
+ return DOUBLE_TYPE;
+ } else if (clazz == Float.TYPE) {
+ return FLOAT_TYPE;
+ } else if (clazz == Long.TYPE) {
+ return LONG_TYPE;
+ } else {
+ throw new AssertionError();
+ }
+ } else {
+ return getType(getDescriptor(clazz));
+ }
+ }
+
+ /**
+ * Returns the method {@link Type} corresponding to the given constructor.
+ *
+ * @param constructor a {@link Constructor} object.
+ * @return the method {@link Type} corresponding to the given constructor.
+ */
+ public static Type getType(final Constructor<?> constructor) {
+ return getType(getConstructorDescriptor(constructor));
+ }
+
+ /**
+ * Returns the method {@link Type} corresponding to the given method.
+ *
+ * @param method a {@link Method} object.
+ * @return the method {@link Type} corresponding to the given method.
+ */
+ public static Type getType(final Method method) {
+ return getType(getMethodDescriptor(method));
+ }
+
+ /**
+ * Returns the type of the elements of this array type. This method should only be used for an
+ * array type.
+ *
+ * @return Returns the type of the elements of this array type.
+ */
+ public Type getElementType() {
+ final int numDimensions = getDimensions();
+ return getTypeInternal(valueBuffer, valueBegin + numDimensions, valueEnd);
+ }
+
+ /**
+ * Returns the {@link Type} corresponding to the given internal name.
+ *
+ * @param internalName an internal name.
+ * @return the {@link Type} corresponding to the given internal name.
+ */
+ public static Type getObjectType(final String internalName) {
+ return new Type(
+ internalName.charAt(0) == '[' ? ARRAY : INTERNAL, internalName, 0, internalName.length());
+ }
+
+ /**
+ * Returns the {@link Type} corresponding to the given method descriptor. Equivalent to <code>
+ * Type.getType(methodDescriptor)</code>.
+ *
+ * @param methodDescriptor a method descriptor.
+ * @return the {@link Type} corresponding to the given method descriptor.
+ */
+ public static Type getMethodType(final String methodDescriptor) {
+ return new Type(METHOD, methodDescriptor, 0, methodDescriptor.length());
+ }
+
+ /**
+ * Returns the method {@link Type} corresponding to the given argument and return types.
+ *
+ * @param returnType the return type of the method.
+ * @param argumentTypes the argument types of the method.
+ * @return the method {@link Type} corresponding to the given argument and return types.
+ */
+ public static Type getMethodType(final Type returnType, final Type... argumentTypes) {
+ return getType(getMethodDescriptor(returnType, argumentTypes));
+ }
+
+ /**
+ * Returns the argument types of methods of this type. This method should only be used for method
+ * types.
+ *
+ * @return the argument types of methods of this type.
+ */
+ public Type[] getArgumentTypes() {
+ return getArgumentTypes(getDescriptor());
+ }
+
+ /**
+ * Returns the {@link Type} values corresponding to the argument types of the given method
+ * descriptor.
+ *
+ * @param methodDescriptor a method descriptor.
+ * @return the {@link Type} values corresponding to the argument types of the given method
+ * descriptor.
+ */
+ public static Type[] getArgumentTypes(final String methodDescriptor) {
+ // First step: compute the number of argument types in methodDescriptor.
+ int numArgumentTypes = 0;
+ // Skip the first character, which is always a '('.
+ int currentOffset = 1;
+ // Parse the argument types, one at a each loop iteration.
+ while (methodDescriptor.charAt(currentOffset) != ')') {
+ while (methodDescriptor.charAt(currentOffset) == '[') {
+ currentOffset++;
+ }
+ if (methodDescriptor.charAt(currentOffset++) == 'L') {
+ // Skip the argument descriptor content.
+ currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
+ }
+ ++numArgumentTypes;
}
- /**
- * Returns the Java type corresponding to the given type descriptor.
- *
- * @param typeDescriptor
- * a field or method type descriptor.
- * @return the Java type corresponding to the given type descriptor.
- */
- public static Type getType(final String typeDescriptor) {
- return getType(typeDescriptor.toCharArray(), 0);
+ // Second step: create a Type instance for each argument type.
+ Type[] argumentTypes = new Type[numArgumentTypes];
+ // Skip the first character, which is always a '('.
+ currentOffset = 1;
+ // Parse and create the argument types, one at each loop iteration.
+ int currentArgumentTypeIndex = 0;
+ while (methodDescriptor.charAt(currentOffset) != ')') {
+ final int currentArgumentTypeOffset = currentOffset;
+ while (methodDescriptor.charAt(currentOffset) == '[') {
+ currentOffset++;
+ }
+ if (methodDescriptor.charAt(currentOffset++) == 'L') {
+ // Skip the argument descriptor content.
+ currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
+ }
+ argumentTypes[currentArgumentTypeIndex++] =
+ getTypeInternal(methodDescriptor, currentArgumentTypeOffset, currentOffset);
}
+ return argumentTypes;
+ }
- /**
- * Returns the Java type corresponding to the given internal name.
- *
- * @param internalName
- * an internal name.
- * @return the Java type corresponding to the given internal name.
- */
- public static Type getObjectType(final String internalName) {
- char[] buf = internalName.toCharArray();
- return new Type(buf[0] == '[' ? ARRAY : OBJECT, buf, 0, buf.length);
+ /**
+ * Returns the {@link Type} values corresponding to the argument types of the given method.
+ *
+ * @param method a method.
+ * @return the {@link Type} values corresponding to the argument types of the given method.
+ */
+ public static Type[] getArgumentTypes(final Method method) {
+ Class<?>[] classes = method.getParameterTypes();
+ Type[] types = new Type[classes.length];
+ for (int i = classes.length - 1; i >= 0; --i) {
+ types[i] = getType(classes[i]);
}
+ return types;
+ }
- /**
- * Returns the Java type corresponding to the given method descriptor.
- * Equivalent to <code>Type.getType(methodDescriptor)</code>.
- *
- * @param methodDescriptor
- * a method descriptor.
- * @return the Java type corresponding to the given method descriptor.
- */
- public static Type getMethodType(final String methodDescriptor) {
- return getType(methodDescriptor.toCharArray(), 0);
+ /**
+ * Returns the return type of methods of this type. This method should only be used for method
+ * types.
+ *
+ * @return the return type of methods of this type.
+ */
+ public Type getReturnType() {
+ return getReturnType(getDescriptor());
+ }
+
+ /**
+ * Returns the {@link Type} corresponding to the return type of the given method descriptor.
+ *
+ * @param methodDescriptor a method descriptor.
+ * @return the {@link Type} corresponding to the return type of the given method descriptor.
+ */
+ public static Type getReturnType(final String methodDescriptor) {
+ return getTypeInternal(
+ methodDescriptor, getReturnTypeOffset(methodDescriptor), methodDescriptor.length());
+ }
+
+ /**
+ * Returns the {@link Type} corresponding to the return type of the given method.
+ *
+ * @param method a method.
+ * @return the {@link Type} corresponding to the return type of the given method.
+ */
+ public static Type getReturnType(final Method method) {
+ return getType(method.getReturnType());
+ }
+
+ /**
+ * Returns the start index of the return type of the given method descriptor.
+ *
+ * @param methodDescriptor a method descriptor.
+ * @return the start index of the return type of the given method descriptor.
+ */
+ static int getReturnTypeOffset(final String methodDescriptor) {
+ // Skip the first character, which is always a '('.
+ int currentOffset = 1;
+ // Skip the argument types, one at a each loop iteration.
+ while (methodDescriptor.charAt(currentOffset) != ')') {
+ while (methodDescriptor.charAt(currentOffset) == '[') {
+ currentOffset++;
+ }
+ if (methodDescriptor.charAt(currentOffset++) == 'L') {
+ // Skip the argument descriptor content.
+ currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
+ }
}
+ return currentOffset + 1;
+ }
- /**
- * Returns the Java method type corresponding to the given argument and
- * return types.
- *
- * @param returnType
- * the return type of the method.
- * @param argumentTypes
- * the argument types of the method.
- * @return the Java type corresponding to the given argument and return
- * types.
- */
- public static Type getMethodType(final Type returnType,
- final Type... argumentTypes) {
- return getType(getMethodDescriptor(returnType, argumentTypes));
+ /**
+ * Returns the {@link Type} corresponding to the given field or method descriptor.
+ *
+ * @param descriptorBuffer a buffer containing the field or method descriptor.
+ * @param descriptorBegin the beginning index, inclusive, of the field or method descriptor in
+ * descriptorBuffer.
+ * @param descriptorEnd the end index, exclusive, of the field or method descriptor in
+ * descriptorBuffer.
+ * @return the {@link Type} corresponding to the given type descriptor.
+ */
+ private static Type getTypeInternal(
+ final String descriptorBuffer, final int descriptorBegin, final int descriptorEnd) {
+ switch (descriptorBuffer.charAt(descriptorBegin)) {
+ case 'V':
+ return VOID_TYPE;
+ case 'Z':
+ return BOOLEAN_TYPE;
+ case 'C':
+ return CHAR_TYPE;
+ case 'B':
+ return BYTE_TYPE;
+ case 'S':
+ return SHORT_TYPE;
+ case 'I':
+ return INT_TYPE;
+ case 'F':
+ return FLOAT_TYPE;
+ case 'J':
+ return LONG_TYPE;
+ case 'D':
+ return DOUBLE_TYPE;
+ case '[':
+ return new Type(ARRAY, descriptorBuffer, descriptorBegin, descriptorEnd);
+ case 'L':
+ return new Type(OBJECT, descriptorBuffer, descriptorBegin + 1, descriptorEnd - 1);
+ case '(':
+ return new Type(METHOD, descriptorBuffer, descriptorBegin, descriptorEnd);
+ default:
+ throw new IllegalArgumentException();
}
+ }
- /**
- * Returns the Java type corresponding to the given class.
- *
- * @param c
- * a class.
- * @return the Java type corresponding to the given class.
- */
- public static Type getType(final Class<?> c) {
- if (c.isPrimitive()) {
- if (c == Integer.TYPE) {
- return INT_TYPE;
- } else if (c == Void.TYPE) {
- return VOID_TYPE;
- } else if (c == Boolean.TYPE) {
- return BOOLEAN_TYPE;
- } else if (c == Byte.TYPE) {
- return BYTE_TYPE;
- } else if (c == Character.TYPE) {
- return CHAR_TYPE;
- } else if (c == Short.TYPE) {
- return SHORT_TYPE;
- } else if (c == Double.TYPE) {
- return DOUBLE_TYPE;
- } else if (c == Float.TYPE) {
- return FLOAT_TYPE;
- } else /* if (c == Long.TYPE) */{
- return LONG_TYPE;
- }
- } else {
- return getType(getDescriptor(c));
+ // -----------------------------------------------------------------------------------------------
+ // Methods to get class names, internal names or descriptors.
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the binary name of the class corresponding to this type. This method must not be used
+ * on method types.
+ *
+ * @return the binary name of the class corresponding to this type.
+ */
+ public String getClassName() {
+ switch (sort) {
+ case VOID:
+ return "void";
+ case BOOLEAN:
+ return "boolean";
+ case CHAR:
+ return "char";
+ case BYTE:
+ return "byte";
+ case SHORT:
+ return "short";
+ case INT:
+ return "int";
+ case FLOAT:
+ return "float";
+ case LONG:
+ return "long";
+ case DOUBLE:
+ return "double";
+ case ARRAY:
+ StringBuilder stringBuilder = new StringBuilder(getElementType().getClassName());
+ for (int i = getDimensions(); i > 0; --i) {
+ stringBuilder.append("[]");
}
+ return stringBuilder.toString();
+ case OBJECT:
+ case INTERNAL:
+ return valueBuffer.substring(valueBegin, valueEnd).replace('/', '.');
+ default:
+ throw new AssertionError();
}
+ }
- /**
- * Returns the Java method type corresponding to the given constructor.
- *
- * @param c
- * a {@link Constructor Constructor} object.
- * @return the Java method type corresponding to the given constructor.
- */
- public static Type getType(final Constructor<?> c) {
- return getType(getConstructorDescriptor(c));
+ /**
+ * Returns the internal name of the class corresponding to this object or array type. The internal
+ * name of a class is its fully qualified name (as returned by Class.getName(), where '.' are
+ * replaced by '/'). This method should only be used for an object or array type.
+ *
+ * @return the internal name of the class corresponding to this object type.
+ */
+ public String getInternalName() {
+ return valueBuffer.substring(valueBegin, valueEnd);
+ }
+
+ /**
+ * Returns the internal name of the given class. The internal name of a class is its fully
+ * qualified name, as returned by Class.getName(), where '.' are replaced by '/'.
+ *
+ * @param clazz an object or array class.
+ * @return the internal name of the given class.
+ */
+ public static String getInternalName(final Class<?> clazz) {
+ return clazz.getName().replace('.', '/');
+ }
+
+ /**
+ * Returns the descriptor corresponding to this type.
+ *
+ * @return the descriptor corresponding to this type.
+ */
+ public String getDescriptor() {
+ if (sort == OBJECT) {
+ return valueBuffer.substring(valueBegin - 1, valueEnd + 1);
+ } else if (sort == INTERNAL) {
+ return 'L' + valueBuffer.substring(valueBegin, valueEnd) + ';';
+ } else {
+ return valueBuffer.substring(valueBegin, valueEnd);
}
+ }
- /**
- * Returns the Java method type corresponding to the given method.
- *
- * @param m
- * a {@link Method Method} object.
- * @return the Java method type corresponding to the given method.
- */
- public static Type getType(final Method m) {
- return getType(getMethodDescriptor(m));
+ /**
+ * Returns the descriptor corresponding to the given class.
+ *
+ * @param clazz an object class, a primitive class or an array class.
+ * @return the descriptor corresponding to the given class.
+ */
+ public static String getDescriptor(final Class<?> clazz) {
+ StringBuilder stringBuilder = new StringBuilder();
+ appendDescriptor(clazz, stringBuilder);
+ return stringBuilder.toString();
+ }
+
+ /**
+ * Returns the descriptor corresponding to the given constructor.
+ *
+ * @param constructor a {@link Constructor} object.
+ * @return the descriptor of the given constructor.
+ */
+ public static String getConstructorDescriptor(final Constructor<?> constructor) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append('(');
+ Class<?>[] parameters = constructor.getParameterTypes();
+ for (Class<?> parameter : parameters) {
+ appendDescriptor(parameter, stringBuilder);
}
+ return stringBuilder.append(")V").toString();
+ }
- /**
- * Returns the Java types corresponding to the argument types of the given
- * method descriptor.
- *
- * @param methodDescriptor
- * a method descriptor.
- * @return the Java types corresponding to the argument types of the given
- * method descriptor.
- */
- public static Type[] getArgumentTypes(final String methodDescriptor) {
- char[] buf = methodDescriptor.toCharArray();
- int off = 1;
- int size = 0;
- while (true) {
- char car = buf[off++];
- if (car == ')') {
- break;
- } else if (car == 'L') {
- while (buf[off++] != ';') {
- }
- ++size;
- } else if (car != '[') {
- ++size;
- }
+ /**
+ * Returns the descriptor corresponding to the given argument and return types.
+ *
+ * @param returnType the return type of the method.
+ * @param argumentTypes the argument types of the method.
+ * @return the descriptor corresponding to the given argument and return types.
+ */
+ public static String getMethodDescriptor(final Type returnType, final Type... argumentTypes) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append('(');
+ for (Type argumentType : argumentTypes) {
+ argumentType.appendDescriptor(stringBuilder);
+ }
+ stringBuilder.append(')');
+ returnType.appendDescriptor(stringBuilder);
+ return stringBuilder.toString();
+ }
+
+ /**
+ * Returns the descriptor corresponding to the given method.
+ *
+ * @param method a {@link Method} object.
+ * @return the descriptor of the given method.
+ */
+ public static String getMethodDescriptor(final Method method) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append('(');
+ Class<?>[] parameters = method.getParameterTypes();
+ for (Class<?> parameter : parameters) {
+ appendDescriptor(parameter, stringBuilder);
+ }
+ stringBuilder.append(')');
+ appendDescriptor(method.getReturnType(), stringBuilder);
+ return stringBuilder.toString();
+ }
+
+ /**
+ * Appends the descriptor corresponding to this type to the given string buffer.
+ *
+ * @param stringBuilder the string builder to which the descriptor must be appended.
+ */
+ private void appendDescriptor(final StringBuilder stringBuilder) {
+ if (sort == OBJECT) {
+ stringBuilder.append(valueBuffer, valueBegin - 1, valueEnd + 1);
+ } else if (sort == INTERNAL) {
+ stringBuilder.append('L').append(valueBuffer, valueBegin, valueEnd).append(';');
+ } else {
+ stringBuilder.append(valueBuffer, valueBegin, valueEnd);
+ }
+ }
+
+ /**
+ * Appends the descriptor of the given class to the given string builder.
+ *
+ * @param clazz the class whose descriptor must be computed.
+ * @param stringBuilder the string builder to which the descriptor must be appended.
+ */
+ private static void appendDescriptor(final Class<?> clazz, final StringBuilder stringBuilder) {
+ Class<?> currentClass = clazz;
+ while (currentClass.isArray()) {
+ stringBuilder.append('[');
+ currentClass = currentClass.getComponentType();
+ }
+ if (currentClass.isPrimitive()) {
+ char descriptor;
+ if (currentClass == Integer.TYPE) {
+ descriptor = 'I';
+ } else if (currentClass == Void.TYPE) {
+ descriptor = 'V';
+ } else if (currentClass == Boolean.TYPE) {
+ descriptor = 'Z';
+ } else if (currentClass == Byte.TYPE) {
+ descriptor = 'B';
+ } else if (currentClass == Character.TYPE) {
+ descriptor = 'C';
+ } else if (currentClass == Short.TYPE) {
+ descriptor = 'S';
+ } else if (currentClass == Double.TYPE) {
+ descriptor = 'D';
+ } else if (currentClass == Float.TYPE) {
+ descriptor = 'F';
+ } else if (currentClass == Long.TYPE) {
+ descriptor = 'J';
+ } else {
+ throw new AssertionError();
+ }
+ stringBuilder.append(descriptor);
+ } else {
+ stringBuilder.append('L').append(getInternalName(currentClass)).append(';');
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------
+ // Methods to get the sort, dimension, size, and opcodes corresponding to a Type or descriptor.
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Returns the sort of this type.
+ *
+ * @return {@link #VOID}, {@link #BOOLEAN}, {@link #CHAR}, {@link #BYTE}, {@link #SHORT}, {@link
+ * #INT}, {@link #FLOAT}, {@link #LONG}, {@link #DOUBLE}, {@link #ARRAY}, {@link #OBJECT} or
+ * {@link #METHOD}.
+ */
+ public int getSort() {
+ return sort == INTERNAL ? OBJECT : sort;
+ }
+
+ /**
+ * Returns the number of dimensions of this array type. This method should only be used for an
+ * array type.
+ *
+ * @return the number of dimensions of this array type.
+ */
+ public int getDimensions() {
+ int numDimensions = 1;
+ while (valueBuffer.charAt(valueBegin + numDimensions) == '[') {
+ numDimensions++;
+ }
+ return numDimensions;
+ }
+
+ /**
+ * Returns the size of values of this type. This method must not be used for method types.
+ *
+ * @return the size of values of this type, i.e., 2 for {@code long} and {@code double}, 0 for
+ * {@code void} and 1 otherwise.
+ */
+ public int getSize() {
+ switch (sort) {
+ case VOID:
+ return 0;
+ case BOOLEAN:
+ case CHAR:
+ case BYTE:
+ case SHORT:
+ case INT:
+ case FLOAT:
+ case ARRAY:
+ case OBJECT:
+ case INTERNAL:
+ return 1;
+ case LONG:
+ case DOUBLE:
+ return 2;
+ default:
+ throw new AssertionError();
+ }
+ }
+
+ /**
+ * Returns the size of the arguments and of the return value of methods of this type. This method
+ * should only be used for method types.
+ *
+ * @return the size of the arguments of the method (plus one for the implicit this argument),
+ * argumentsSize, and the size of its return value, returnSize, packed into a single int i =
+ * {@code (argumentsSize << 2) | returnSize} (argumentsSize is therefore equal to {@code
+ * i >> 2}, and returnSize to {@code i & 0x03}).
+ */
+ public int getArgumentsAndReturnSizes() {
+ return getArgumentsAndReturnSizes(getDescriptor());
+ }
+
+ /**
+ * Computes the size of the arguments and of the return value of a method.
+ *
+ * @param methodDescriptor a method descriptor.
+ * @return the size of the arguments of the method (plus one for the implicit this argument),
+ * argumentsSize, and the size of its return value, returnSize, packed into a single int i =
+ * {@code (argumentsSize << 2) | returnSize} (argumentsSize is therefore equal to {@code
+ * i >> 2}, and returnSize to {@code i & 0x03}).
+ */
+ public static int getArgumentsAndReturnSizes(final String methodDescriptor) {
+ int argumentsSize = 1;
+ // Skip the first character, which is always a '('.
+ int currentOffset = 1;
+ int currentChar = methodDescriptor.charAt(currentOffset);
+ // Parse the argument types and compute their size, one at a each loop iteration.
+ while (currentChar != ')') {
+ if (currentChar == 'J' || currentChar == 'D') {
+ currentOffset++;
+ argumentsSize += 2;
+ } else {
+ while (methodDescriptor.charAt(currentOffset) == '[') {
+ currentOffset++;
}
- Type[] args = new Type[size];
- off = 1;
- size = 0;
- while (buf[off] != ')') {
- args[size] = getType(buf, off);
- off += args[size].len + (args[size].sort == OBJECT ? 2 : 0);
- size += 1;
+ if (methodDescriptor.charAt(currentOffset++) == 'L') {
+ // Skip the argument descriptor content.
+ currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
}
- return args;
+ argumentsSize += 1;
+ }
+ currentChar = methodDescriptor.charAt(currentOffset);
}
-
- /**
- * Returns the Java types corresponding to the argument types of the given
- * method.
- *
- * @param method
- * a method.
- * @return the Java types corresponding to the argument types of the given
- * method.
- */
- public static Type[] getArgumentTypes(final Method method) {
- Class<?>[] classes = method.getParameterTypes();
- Type[] types = new Type[classes.length];
- for (int i = classes.length - 1; i >= 0; --i) {
- types[i] = getType(classes[i]);
- }
- return types;
+ currentChar = methodDescriptor.charAt(currentOffset + 1);
+ if (currentChar == 'V') {
+ return argumentsSize << 2;
+ } else {
+ int returnSize = (currentChar == 'J' || currentChar == 'D') ? 2 : 1;
+ return argumentsSize << 2 | returnSize;
}
+ }
- /**
- * Returns the Java type corresponding to the return type of the given
- * method descriptor.
- *
- * @param methodDescriptor
- * a method descriptor.
- * @return the Java type corresponding to the return type of the given
- * method descriptor.
- */
- public static Type getReturnType(final String methodDescriptor) {
- char[] buf = methodDescriptor.toCharArray();
- return getType(buf, methodDescriptor.indexOf(')') + 1);
+ /**
+ * Returns a JVM instruction opcode adapted to this {@link Type}. This method must not be used for
+ * method types.
+ *
+ * @param opcode a JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD,
+ * IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR, IXOR and
+ * IRETURN.
+ * @return an opcode that is similar to the given opcode, but adapted to this {@link Type}. For
+ * example, if this type is {@code float} and {@code opcode} is IRETURN, this method returns
+ * FRETURN.
+ */
+ public int getOpcode(final int opcode) {
+ if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
+ switch (sort) {
+ case BOOLEAN:
+ case BYTE:
+ return opcode + (Opcodes.BALOAD - Opcodes.IALOAD);
+ case CHAR:
+ return opcode + (Opcodes.CALOAD - Opcodes.IALOAD);
+ case SHORT:
+ return opcode + (Opcodes.SALOAD - Opcodes.IALOAD);
+ case INT:
+ return opcode;
+ case FLOAT:
+ return opcode + (Opcodes.FALOAD - Opcodes.IALOAD);
+ case LONG:
+ return opcode + (Opcodes.LALOAD - Opcodes.IALOAD);
+ case DOUBLE:
+ return opcode + (Opcodes.DALOAD - Opcodes.IALOAD);
+ case ARRAY:
+ case OBJECT:
+ case INTERNAL:
+ return opcode + (Opcodes.AALOAD - Opcodes.IALOAD);
+ case METHOD:
+ case VOID:
+ throw new UnsupportedOperationException();
+ default:
+ throw new AssertionError();
+ }
+ } else {
+ switch (sort) {
+ case VOID:
+ if (opcode != Opcodes.IRETURN) {
+ throw new UnsupportedOperationException();
+ }
+ return Opcodes.RETURN;
+ case BOOLEAN:
+ case BYTE:
+ case CHAR:
+ case SHORT:
+ case INT:
+ return opcode;
+ case FLOAT:
+ return opcode + (Opcodes.FRETURN - Opcodes.IRETURN);
+ case LONG:
+ return opcode + (Opcodes.LRETURN - Opcodes.IRETURN);
+ case DOUBLE:
+ return opcode + (Opcodes.DRETURN - Opcodes.IRETURN);
+ case ARRAY:
+ case OBJECT:
+ case INTERNAL:
+ if (opcode != Opcodes.ILOAD && opcode != Opcodes.ISTORE && opcode != Opcodes.IRETURN) {
+ throw new UnsupportedOperationException();
+ }
+ return opcode + (Opcodes.ARETURN - Opcodes.IRETURN);
+ case METHOD:
+ throw new UnsupportedOperationException();
+ default:
+ throw new AssertionError();
+ }
}
+ }
- /**
- * Returns the Java type corresponding to the return type of the given
- * method.
- *
- * @param method
- * a method.
- * @return the Java type corresponding to the return type of the given
- * method.
- */
- public static Type getReturnType(final Method method) {
- return getType(method.getReturnType());
+ // -----------------------------------------------------------------------------------------------
+ // Equals, hashCode and toString.
+ // -----------------------------------------------------------------------------------------------
+
+ /**
+ * Tests if the given object is equal to this type.
+ *
+ * @param object the object to be compared to this type.
+ * @return {@literal true} if the given object is equal to this type.
+ */
+ @Override
+ public boolean equals(final Object object) {
+ if (this == object) {
+ return true;
}
-
- /**
- * Computes the size of the arguments and of the return value of a method.
- *
- * @param desc
- * the descriptor of a method.
- * @return the size of the arguments of the method (plus one for the
- * implicit this argument), argSize, and the size of its return
- * value, retSize, packed into a single int i =
- * <tt>(argSize << 2) | retSize</tt> (argSize is therefore equal to
- * <tt>i >> 2</tt>, and retSize to <tt>i & 0x03</tt>).
- */
- public static int getArgumentsAndReturnSizes(final String desc) {
- int n = 1;
- int c = 1;
- while (true) {
- char car = desc.charAt(c++);
- if (car == ')') {
- car = desc.charAt(c);
- return n << 2
- | (car == 'V' ? 0 : (car == 'D' || car == 'J' ? 2 : 1));
- } else if (car == 'L') {
- while (desc.charAt(c++) != ';') {
- }
- n += 1;
- } else if (car == '[') {
- while ((car = desc.charAt(c)) == '[') {
- ++c;
- }
- if (car == 'D' || car == 'J') {
- n -= 1;
- }
- } else if (car == 'D' || car == 'J') {
- n += 2;
- } else {
- n += 1;
- }
- }
+ if (!(object instanceof Type)) {
+ return false;
}
-
- /**
- * Returns the Java type corresponding to the given type descriptor. For
- * method descriptors, buf is supposed to contain nothing more than the
- * descriptor itself.
- *
- * @param buf
- * a buffer containing a type descriptor.
- * @param off
- * the offset of this descriptor in the previous buffer.
- * @return the Java type corresponding to the given type descriptor.
- */
- private static Type getType(final char[] buf, final int off) {
- int len;
- switch (buf[off]) {
- case 'V':
- return VOID_TYPE;
- case 'Z':
- return BOOLEAN_TYPE;
- case 'C':
- return CHAR_TYPE;
- case 'B':
- return BYTE_TYPE;
- case 'S':
- return SHORT_TYPE;
- case 'I':
- return INT_TYPE;
- case 'F':
- return FLOAT_TYPE;
- case 'J':
- return LONG_TYPE;
- case 'D':
- return DOUBLE_TYPE;
- case '[':
- len = 1;
- while (buf[off + len] == '[') {
- ++len;
- }
- if (buf[off + len] == 'L') {
- ++len;
- while (buf[off + len] != ';') {
- ++len;
- }
- }
- return new Type(ARRAY, buf, off, len + 1);
- case 'L':
- len = 1;
- while (buf[off + len] != ';') {
- ++len;
- }
- return new Type(OBJECT, buf, off + 1, len - 1);
- // case '(':
- default:
- return new Type(METHOD, buf, off, buf.length - off);
- }
+ Type other = (Type) object;
+ if ((sort == INTERNAL ? OBJECT : sort) != (other.sort == INTERNAL ? OBJECT : other.sort)) {
+ return false;
}
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- /**
- * Returns the sort of this Java type.
- *
- * @return {@link #VOID VOID}, {@link #BOOLEAN BOOLEAN}, {@link #CHAR CHAR},
- * {@link #BYTE BYTE}, {@link #SHORT SHORT}, {@link #INT INT},
- * {@link #FLOAT FLOAT}, {@link #LONG LONG}, {@link #DOUBLE DOUBLE},
- * {@link #ARRAY ARRAY}, {@link #OBJECT OBJECT} or {@link #METHOD
- * METHOD}.
- */
- public int getSort() {
- return sort;
+ int begin = valueBegin;
+ int end = valueEnd;
+ int otherBegin = other.valueBegin;
+ int otherEnd = other.valueEnd;
+ // Compare the values.
+ if (end - begin != otherEnd - otherBegin) {
+ return false;
}
-
- /**
- * Returns the number of dimensions of this array type. This method should
- * only be used for an array type.
- *
- * @return the number of dimensions of this array type.
- */
- public int getDimensions() {
- int i = 1;
- while (buf[off + i] == '[') {
- ++i;
- }
- return i;
+ for (int i = begin, j = otherBegin; i < end; i++, j++) {
+ if (valueBuffer.charAt(i) != other.valueBuffer.charAt(j)) {
+ return false;
+ }
}
+ return true;
+ }
- /**
- * Returns the type of the elements of this array type. This method should
- * only be used for an array type.
- *
- * @return Returns the type of the elements of this array type.
- */
- public Type getElementType() {
- return getType(buf, off + getDimensions());
+ /**
+ * Returns a hash code value for this type.
+ *
+ * @return a hash code value for this type.
+ */
+ @Override
+ public int hashCode() {
+ int hashCode = 13 * (sort == INTERNAL ? OBJECT : sort);
+ if (sort >= ARRAY) {
+ for (int i = valueBegin, end = valueEnd; i < end; i++) {
+ hashCode = 17 * (hashCode + valueBuffer.charAt(i));
+ }
}
+ return hashCode;
+ }
- /**
- * Returns the binary name of the class corresponding to this type. This
- * method must not be used on method types.
- *
- * @return the binary name of the class corresponding to this type.
- */
- public String getClassName() {
- switch (sort) {
- case VOID:
- return "void";
- case BOOLEAN:
- return "boolean";
- case CHAR:
- return "char";
- case BYTE:
- return "byte";
- case SHORT:
- return "short";
- case INT:
- return "int";
- case FLOAT:
- return "float";
- case LONG:
- return "long";
- case DOUBLE:
- return "double";
- case ARRAY:
- StringBuilder sb = new StringBuilder(getElementType().getClassName());
- for (int i = getDimensions(); i > 0; --i) {
- sb.append("[]");
- }
- return sb.toString();
- case OBJECT:
- return new String(buf, off, len).replace('/', '.');
- default:
- return null;
- }
- }
-
- /**
- * Returns the internal name of the class corresponding to this object or
- * array type. The internal name of a class is its fully qualified name (as
- * returned by Class.getName(), where '.' are replaced by '/'. This method
- * should only be used for an object or array type.
- *
- * @return the internal name of the class corresponding to this object type.
- */
- public String getInternalName() {
- return new String(buf, off, len);
- }
-
- /**
- * Returns the argument types of methods of this type. This method should
- * only be used for method types.
- *
- * @return the argument types of methods of this type.
- */
- public Type[] getArgumentTypes() {
- return getArgumentTypes(getDescriptor());
- }
-
- /**
- * Returns the return type of methods of this type. This method should only
- * be used for method types.
- *
- * @return the return type of methods of this type.
- */
- public Type getReturnType() {
- return getReturnType(getDescriptor());
- }
-
- /**
- * Returns the size of the arguments and of the return value of methods of
- * this type. This method should only be used for method types.
- *
- * @return the size of the arguments (plus one for the implicit this
- * argument), argSize, and the size of the return value, retSize,
- * packed into a single
- * int i = <tt>(argSize << 2) | retSize</tt>
- * (argSize is therefore equal to <tt>i >> 2</tt>,
- * and retSize to <tt>i & 0x03</tt>).
- */
- public int getArgumentsAndReturnSizes() {
- return getArgumentsAndReturnSizes(getDescriptor());
- }
-
- // ------------------------------------------------------------------------
- // Conversion to type descriptors
- // ------------------------------------------------------------------------
-
- /**
- * Returns the descriptor corresponding to this Java type.
- *
- * @return the descriptor corresponding to this Java type.
- */
- public String getDescriptor() {
- StringBuffer buf = new StringBuffer();
- getDescriptor(buf);
- return buf.toString();
- }
-
- /**
- * Returns the descriptor corresponding to the given argument and return
- * types.
- *
- * @param returnType
- * the return type of the method.
- * @param argumentTypes
- * the argument types of the method.
- * @return the descriptor corresponding to the given argument and return
- * types.
- */
- public static String getMethodDescriptor(final Type returnType,
- final Type... argumentTypes) {
- StringBuffer buf = new StringBuffer();
- buf.append('(');
- for (int i = 0; i < argumentTypes.length; ++i) {
- argumentTypes[i].getDescriptor(buf);
- }
- buf.append(')');
- returnType.getDescriptor(buf);
- return buf.toString();
- }
-
- /**
- * Appends the descriptor corresponding to this Java type to the given
- * string buffer.
- *
- * @param buf
- * the string buffer to which the descriptor must be appended.
- */
- private void getDescriptor(final StringBuffer buf) {
- if (this.buf == null) {
- // descriptor is in byte 3 of 'off' for primitive types (buf ==
- // null)
- buf.append((char) ((off & 0xFF000000) >>> 24));
- } else if (sort == OBJECT) {
- buf.append('L');
- buf.append(this.buf, off, len);
- buf.append(';');
- } else { // sort == ARRAY || sort == METHOD
- buf.append(this.buf, off, len);
- }
- }
-
- // ------------------------------------------------------------------------
- // Direct conversion from classes to type descriptors,
- // without intermediate Type objects
- // ------------------------------------------------------------------------
-
- /**
- * Returns the internal name of the given class. The internal name of a
- * class is its fully qualified name, as returned by Class.getName(), where
- * '.' are replaced by '/'.
- *
- * @param c
- * an object or array class.
- * @return the internal name of the given class.
- */
- public static String getInternalName(final Class<?> c) {
- return c.getName().replace('.', '/');
- }
-
- /**
- * Returns the descriptor corresponding to the given Java type.
- *
- * @param c
- * an object class, a primitive class or an array class.
- * @return the descriptor corresponding to the given class.
- */
- public static String getDescriptor(final Class<?> c) {
- StringBuffer buf = new StringBuffer();
- getDescriptor(buf, c);
- return buf.toString();
- }
-
- /**
- * Returns the descriptor corresponding to the given constructor.
- *
- * @param c
- * a {@link Constructor Constructor} object.
- * @return the descriptor of the given constructor.
- */
- public static String getConstructorDescriptor(final Constructor<?> c) {
- Class<?>[] parameters = c.getParameterTypes();
- StringBuffer buf = new StringBuffer();
- buf.append('(');
- for (int i = 0; i < parameters.length; ++i) {
- getDescriptor(buf, parameters[i]);
- }
- return buf.append(")V").toString();
- }
-
- /**
- * Returns the descriptor corresponding to the given method.
- *
- * @param m
- * a {@link Method Method} object.
- * @return the descriptor of the given method.
- */
- public static String getMethodDescriptor(final Method m) {
- Class<?>[] parameters = m.getParameterTypes();
- StringBuffer buf = new StringBuffer();
- buf.append('(');
- for (int i = 0; i < parameters.length; ++i) {
- getDescriptor(buf, parameters[i]);
- }
- buf.append(')');
- getDescriptor(buf, m.getReturnType());
- return buf.toString();
- }
-
- /**
- * Appends the descriptor of the given class to the given string buffer.
- *
- * @param buf
- * the string buffer to which the descriptor must be appended.
- * @param c
- * the class whose descriptor must be computed.
- */
- private static void getDescriptor(final StringBuffer buf, final Class<?> c) {
- Class<?> d = c;
- while (true) {
- if (d.isPrimitive()) {
- char car;
- if (d == Integer.TYPE) {
- car = 'I';
- } else if (d == Void.TYPE) {
- car = 'V';
- } else if (d == Boolean.TYPE) {
- car = 'Z';
- } else if (d == Byte.TYPE) {
- car = 'B';
- } else if (d == Character.TYPE) {
- car = 'C';
- } else if (d == Short.TYPE) {
- car = 'S';
- } else if (d == Double.TYPE) {
- car = 'D';
- } else if (d == Float.TYPE) {
- car = 'F';
- } else /* if (d == Long.TYPE) */{
- car = 'J';
- }
- buf.append(car);
- return;
- } else if (d.isArray()) {
- buf.append('[');
- d = d.getComponentType();
- } else {
- buf.append('L');
- String name = d.getName();
- int len = name.length();
- for (int i = 0; i < len; ++i) {
- char car = name.charAt(i);
- buf.append(car == '.' ? '/' : car);
- }
- buf.append(';');
- return;
- }
- }
- }
-
- // ------------------------------------------------------------------------
- // Corresponding size and opcodes
- // ------------------------------------------------------------------------
-
- /**
- * Returns the size of values of this type. This method must not be used for
- * method types.
- *
- * @return the size of values of this type, i.e., 2 for <tt>long</tt> and
- * <tt>double</tt>, 0 for <tt>void</tt> and 1 otherwise.
- */
- public int getSize() {
- // the size is in byte 0 of 'off' for primitive types (buf == null)
- return buf == null ? (off & 0xFF) : 1;
- }
-
- /**
- * Returns a JVM instruction opcode adapted to this Java type. This method
- * must not be used for method types.
- *
- * @param opcode
- * a JVM instruction opcode. This opcode must be one of ILOAD,
- * ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG,
- * ISHL, ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
- * @return an opcode that is similar to the given opcode, but adapted to
- * this Java type. For example, if this type is <tt>float</tt> and
- * <tt>opcode</tt> is IRETURN, this method returns FRETURN.
- */
- public int getOpcode(final int opcode) {
- if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
- // the offset for IALOAD or IASTORE is in byte 1 of 'off' for
- // primitive types (buf == null)
- return opcode + (buf == null ? (off & 0xFF00) >> 8 : 4);
- } else {
- // the offset for other instructions is in byte 2 of 'off' for
- // primitive types (buf == null)
- return opcode + (buf == null ? (off & 0xFF0000) >> 16 : 4);
- }
- }
-
- // ------------------------------------------------------------------------
- // Equals, hashCode and toString
- // ------------------------------------------------------------------------
-
- /**
- * Tests if the given object is equal to this type.
- *
- * @param o
- * the object to be compared to this type.
- * @return <tt>true</tt> if the given object is equal to this type.
- */
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof Type)) {
- return false;
- }
- Type t = (Type) o;
- if (sort != t.sort) {
- return false;
- }
- if (sort >= ARRAY) {
- if (len != t.len) {
- return false;
- }
- for (int i = off, j = t.off, end = i + len; i < end; i++, j++) {
- if (buf[i] != t.buf[j]) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * Returns a hash code value for this type.
- *
- * @return a hash code value for this type.
- */
- @Override
- public int hashCode() {
- int hc = 13 * sort;
- if (sort >= ARRAY) {
- for (int i = off, end = i + len; i < end; i++) {
- hc = 17 * (hc + buf[i]);
- }
- }
- return hc;
- }
-
- /**
- * Returns a string representation of this type.
- *
- * @return the descriptor of this type.
- */
- @Override
- public String toString() {
- return getDescriptor();
- }
+ /**
+ * Returns a string representation of this type.
+ *
+ * @return the descriptor of this type.
+ */
+ @Override
+ public String toString() {
+ return getDescriptor();
+ }
}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/TypePath.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/TypePath.java
index 959400a..3e9e291 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/TypePath.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/TypePath.java
@@ -1,196 +1,201 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2013 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package jersey.repackaged.org.objectweb.asm;
-
-/**
- * The path to a type argument, wildcard bound, array element type, or static
- * inner type within an enclosing type.
- *
- * @author Eric Bruneton
- */
-public class TypePath {
-
- /**
- * A type path step that steps into the element type of an array type. See
- * {@link #getStep getStep}.
- */
- public final static int ARRAY_ELEMENT = 0;
-
- /**
- * A type path step that steps into the nested type of a class type. See
- * {@link #getStep getStep}.
- */
- public final static int INNER_TYPE = 1;
-
- /**
- * A type path step that steps into the bound of a wildcard type. See
- * {@link #getStep getStep}.
- */
- public final static int WILDCARD_BOUND = 2;
-
- /**
- * A type path step that steps into a type argument of a generic type. See
- * {@link #getStep getStep}.
- */
- public final static int TYPE_ARGUMENT = 3;
-
- /**
- * The byte array where the path is stored, in Java class file format.
- */
- byte[] b;
-
- /**
- * The offset of the first byte of the type path in 'b'.
- */
- int offset;
-
- /**
- * Creates a new type path.
- *
- * @param b
- * the byte array containing the type path in Java class file
- * format.
- * @param offset
- * the offset of the first byte of the type path in 'b'.
- */
- TypePath(byte[] b, int offset) {
- this.b = b;
- this.offset = offset;
- }
-
- /**
- * Returns the length of this path.
- *
- * @return the length of this path.
- */
- public int getLength() {
- return b[offset];
- }
-
- /**
- * Returns the value of the given step of this path.
- *
- * @param index
- * an index between 0 and {@link #getLength()}, exclusive.
- * @return {@link #ARRAY_ELEMENT ARRAY_ELEMENT}, {@link #INNER_TYPE
- * INNER_TYPE}, {@link #WILDCARD_BOUND WILDCARD_BOUND}, or
- * {@link #TYPE_ARGUMENT TYPE_ARGUMENT}.
- */
- public int getStep(int index) {
- return b[offset + 2 * index + 1];
- }
-
- /**
- * Returns the index of the type argument that the given step is stepping
- * into. This method should only be used for steps whose value is
- * {@link #TYPE_ARGUMENT TYPE_ARGUMENT}.
- *
- * @param index
- * an index between 0 and {@link #getLength()}, exclusive.
- * @return the index of the type argument that the given step is stepping
- * into.
- */
- public int getStepArgument(int index) {
- return b[offset + 2 * index + 2];
- }
-
- /**
- * Converts a type path in string form, in the format used by
- * {@link #toString()}, into a TypePath object.
- *
- * @param typePath
- * a type path in string form, in the format used by
- * {@link #toString()}. May be null or empty.
- * @return the corresponding TypePath object, or null if the path is empty.
- */
- public static TypePath fromString(final String typePath) {
- if (typePath == null || typePath.length() == 0) {
- return null;
- }
- int n = typePath.length();
- ByteVector out = new ByteVector(n);
- out.putByte(0);
- for (int i = 0; i < n;) {
- char c = typePath.charAt(i++);
- if (c == '[') {
- out.put11(ARRAY_ELEMENT, 0);
- } else if (c == '.') {
- out.put11(INNER_TYPE, 0);
- } else if (c == '*') {
- out.put11(WILDCARD_BOUND, 0);
- } else if (c >= '0' && c <= '9') {
- int typeArg = c - '0';
- while (i < n && (c = typePath.charAt(i)) >= '0' && c <= '9') {
- typeArg = typeArg * 10 + c - '0';
- i += 1;
- }
- if (i < n && typePath.charAt(i) == ';') {
- i += 1;
- }
- out.put11(TYPE_ARGUMENT, typeArg);
- }
- }
- out.data[0] = (byte) (out.length / 2);
- return new TypePath(out.data, 0);
- }
-
- /**
- * Returns a string representation of this type path. {@link #ARRAY_ELEMENT
- * ARRAY_ELEMENT} steps are represented with '[', {@link #INNER_TYPE
- * INNER_TYPE} steps with '.', {@link #WILDCARD_BOUND WILDCARD_BOUND} steps
- * with '*' and {@link #TYPE_ARGUMENT TYPE_ARGUMENT} steps with their type
- * argument index in decimal form followed by ';'.
- */
- @Override
- public String toString() {
- int length = getLength();
- StringBuilder result = new StringBuilder(length * 2);
- for (int i = 0; i < length; ++i) {
- switch (getStep(i)) {
- case ARRAY_ELEMENT:
- result.append('[');
- break;
- case INNER_TYPE:
- result.append('.');
- break;
- case WILDCARD_BOUND:
- result.append('*');
- break;
- case TYPE_ARGUMENT:
- result.append(getStepArgument(i)).append(';');
- break;
- default:
- result.append('_');
- }
- }
- return result.toString();
- }
-}
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * The path to a type argument, wildcard bound, array element type, or static inner type within an
+ * enclosing type.
+ *
+ * @author Eric Bruneton
+ */
+public final class TypePath {
+
+ /** A type path step that steps into the element type of an array type. See {@link #getStep}. */
+ public static final int ARRAY_ELEMENT = 0;
+
+ /** A type path step that steps into the nested type of a class type. See {@link #getStep}. */
+ public static final int INNER_TYPE = 1;
+
+ /** A type path step that steps into the bound of a wildcard type. See {@link #getStep}. */
+ public static final int WILDCARD_BOUND = 2;
+
+ /** A type path step that steps into a type argument of a generic type. See {@link #getStep}. */
+ public static final int TYPE_ARGUMENT = 3;
+
+ /**
+ * The byte array where the 'type_path' structure - as defined in the Java Virtual Machine
+ * Specification (JVMS) - corresponding to this TypePath is stored. The first byte of the
+ * structure in this array is given by {@link #typePathOffset}.
+ *
+ * @see <a
+ * href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20.2">JVMS
+ * 4.7.20.2</a>
+ */
+ private final byte[] typePathContainer;
+
+ /** The offset of the first byte of the type_path JVMS structure in {@link #typePathContainer}. */
+ private final int typePathOffset;
+
+ /**
+ * Constructs a new TypePath.
+ *
+ * @param typePathContainer a byte array containing a type_path JVMS structure.
+ * @param typePathOffset the offset of the first byte of the type_path structure in
+ * typePathContainer.
+ */
+ TypePath(final byte[] typePathContainer, final int typePathOffset) {
+ this.typePathContainer = typePathContainer;
+ this.typePathOffset = typePathOffset;
+ }
+
+ /**
+ * Returns the length of this path, i.e. its number of steps.
+ *
+ * @return the length of this path.
+ */
+ public int getLength() {
+ // path_length is stored in the first byte of a type_path.
+ return typePathContainer[typePathOffset];
+ }
+
+ /**
+ * Returns the value of the given step of this path.
+ *
+ * @param index an index between 0 and {@link #getLength()}, exclusive.
+ * @return one of {@link #ARRAY_ELEMENT}, {@link #INNER_TYPE}, {@link #WILDCARD_BOUND}, or {@link
+ * #TYPE_ARGUMENT}.
+ */
+ public int getStep(final int index) {
+ // Returns the type_path_kind of the path element of the given index.
+ return typePathContainer[typePathOffset + 2 * index + 1];
+ }
+
+ /**
+ * Returns the index of the type argument that the given step is stepping into. This method should
+ * only be used for steps whose value is {@link #TYPE_ARGUMENT}.
+ *
+ * @param index an index between 0 and {@link #getLength()}, exclusive.
+ * @return the index of the type argument that the given step is stepping into.
+ */
+ public int getStepArgument(final int index) {
+ // Returns the type_argument_index of the path element of the given index.
+ return typePathContainer[typePathOffset + 2 * index + 2];
+ }
+
+ /**
+ * Converts a type path in string form, in the format used by {@link #toString()}, into a TypePath
+ * object.
+ *
+ * @param typePath a type path in string form, in the format used by {@link #toString()}. May be
+ * {@literal null} or empty.
+ * @return the corresponding TypePath object, or {@literal null} if the path is empty.
+ */
+ public static TypePath fromString(final String typePath) {
+ if (typePath == null || typePath.length() == 0) {
+ return null;
+ }
+ int typePathLength = typePath.length();
+ ByteVector output = new ByteVector(typePathLength);
+ output.putByte(0);
+ int typePathIndex = 0;
+ while (typePathIndex < typePathLength) {
+ char c = typePath.charAt(typePathIndex++);
+ if (c == '[') {
+ output.put11(ARRAY_ELEMENT, 0);
+ } else if (c == '.') {
+ output.put11(INNER_TYPE, 0);
+ } else if (c == '*') {
+ output.put11(WILDCARD_BOUND, 0);
+ } else if (c >= '0' && c <= '9') {
+ int typeArg = c - '0';
+ while (typePathIndex < typePathLength) {
+ c = typePath.charAt(typePathIndex++);
+ if (c >= '0' && c <= '9') {
+ typeArg = typeArg * 10 + c - '0';
+ } else if (c == ';') {
+ break;
+ } else {
+ throw new IllegalArgumentException();
+ }
+ }
+ output.put11(TYPE_ARGUMENT, typeArg);
+ } else {
+ throw new IllegalArgumentException();
+ }
+ }
+ output.data[0] = (byte) (output.length / 2);
+ return new TypePath(output.data, 0);
+ }
+
+ /**
+ * Returns a string representation of this type path. {@link #ARRAY_ELEMENT} steps are represented
+ * with '[', {@link #INNER_TYPE} steps with '.', {@link #WILDCARD_BOUND} steps with '*' and {@link
+ * #TYPE_ARGUMENT} steps with their type argument index in decimal form followed by ';'.
+ */
+ @Override
+ public String toString() {
+ int length = getLength();
+ StringBuilder result = new StringBuilder(length * 2);
+ for (int i = 0; i < length; ++i) {
+ switch (getStep(i)) {
+ case ARRAY_ELEMENT:
+ result.append('[');
+ break;
+ case INNER_TYPE:
+ result.append('.');
+ break;
+ case WILDCARD_BOUND:
+ result.append('*');
+ break;
+ case TYPE_ARGUMENT:
+ result.append(getStepArgument(i)).append(';');
+ break;
+ default:
+ throw new AssertionError();
+ }
+ }
+ return result.toString();
+ }
+
+ /**
+ * Puts the type_path JVMS structure corresponding to the given TypePath into the given
+ * ByteVector.
+ *
+ * @param typePath a TypePath instance, or {@literal null} for empty paths.
+ * @param output where the type path must be put.
+ */
+ static void put(final TypePath typePath, final ByteVector output) {
+ if (typePath == null) {
+ output.putByte(0);
+ } else {
+ int length = typePath.typePathContainer[typePath.typePathOffset] * 2 + 1;
+ output.putByteArray(typePath.typePathContainer, typePath.typePathOffset, length);
+ }
+ }
+}
diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/TypeReference.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/TypeReference.java
index 12e74f8..f6224b2 100644
--- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/TypeReference.java
+++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/TypeReference.java
@@ -1,452 +1,436 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2013 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package jersey.repackaged.org.objectweb.asm;
-
-/**
- * A reference to a type appearing in a class, field or method declaration, or
- * on an instruction. Such a reference designates the part of the class where
- * the referenced type is appearing (e.g. an 'extends', 'implements' or 'throws'
- * clause, a 'new' instruction, a 'catch' clause, a type cast, a local variable
- * declaration, etc).
- *
- * @author Eric Bruneton
- */
-public class TypeReference {
-
- /**
- * The sort of type references that target a type parameter of a generic
- * class. See {@link #getSort getSort}.
- */
- public final static int CLASS_TYPE_PARAMETER = 0x00;
-
- /**
- * The sort of type references that target a type parameter of a generic
- * method. See {@link #getSort getSort}.
- */
- public final static int METHOD_TYPE_PARAMETER = 0x01;
-
- /**
- * The sort of type references that target the super class of a class or one
- * of the interfaces it implements. See {@link #getSort getSort}.
- */
- public final static int CLASS_EXTENDS = 0x10;
-
- /**
- * The sort of type references that target a bound of a type parameter of a
- * generic class. See {@link #getSort getSort}.
- */
- public final static int CLASS_TYPE_PARAMETER_BOUND = 0x11;
-
- /**
- * The sort of type references that target a bound of a type parameter of a
- * generic method. See {@link #getSort getSort}.
- */
- public final static int METHOD_TYPE_PARAMETER_BOUND = 0x12;
-
- /**
- * The sort of type references that target the type of a field. See
- * {@link #getSort getSort}.
- */
- public final static int FIELD = 0x13;
-
- /**
- * The sort of type references that target the return type of a method. See
- * {@link #getSort getSort}.
- */
- public final static int METHOD_RETURN = 0x14;
-
- /**
- * The sort of type references that target the receiver type of a method.
- * See {@link #getSort getSort}.
- */
- public final static int METHOD_RECEIVER = 0x15;
-
- /**
- * The sort of type references that target the type of a formal parameter of
- * a method. See {@link #getSort getSort}.
- */
- public final static int METHOD_FORMAL_PARAMETER = 0x16;
-
- /**
- * The sort of type references that target the type of an exception declared
- * in the throws clause of a method. See {@link #getSort getSort}.
- */
- public final static int THROWS = 0x17;
-
- /**
- * The sort of type references that target the type of a local variable in a
- * method. See {@link #getSort getSort}.
- */
- public final static int LOCAL_VARIABLE = 0x40;
-
- /**
- * The sort of type references that target the type of a resource variable
- * in a method. See {@link #getSort getSort}.
- */
- public final static int RESOURCE_VARIABLE = 0x41;
-
- /**
- * The sort of type references that target the type of the exception of a
- * 'catch' clause in a method. See {@link #getSort getSort}.
- */
- public final static int EXCEPTION_PARAMETER = 0x42;
-
- /**
- * The sort of type references that target the type declared in an
- * 'instanceof' instruction. See {@link #getSort getSort}.
- */
- public final static int INSTANCEOF = 0x43;
-
- /**
- * The sort of type references that target the type of the object created by
- * a 'new' instruction. See {@link #getSort getSort}.
- */
- public final static int NEW = 0x44;
-
- /**
- * The sort of type references that target the receiver type of a
- * constructor reference. See {@link #getSort getSort}.
- */
- public final static int CONSTRUCTOR_REFERENCE = 0x45;
-
- /**
- * The sort of type references that target the receiver type of a method
- * reference. See {@link #getSort getSort}.
- */
- public final static int METHOD_REFERENCE = 0x46;
-
- /**
- * The sort of type references that target the type declared in an explicit
- * or implicit cast instruction. See {@link #getSort getSort}.
- */
- public final static int CAST = 0x47;
-
- /**
- * The sort of type references that target a type parameter of a generic
- * constructor in a constructor call. See {@link #getSort getSort}.
- */
- public final static int CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48;
-
- /**
- * The sort of type references that target a type parameter of a generic
- * method in a method call. See {@link #getSort getSort}.
- */
- public final static int METHOD_INVOCATION_TYPE_ARGUMENT = 0x49;
-
- /**
- * The sort of type references that target a type parameter of a generic
- * constructor in a constructor reference. See {@link #getSort getSort}.
- */
- public final static int CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A;
-
- /**
- * The sort of type references that target a type parameter of a generic
- * method in a method reference. See {@link #getSort getSort}.
- */
- public final static int METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B;
-
- /**
- * The type reference value in Java class file format.
- */
- private int value;
-
- /**
- * Creates a new TypeReference.
- *
- * @param typeRef
- * the int encoded value of the type reference, as received in a
- * visit method related to type annotations, like
- * visitTypeAnnotation.
- */
- public TypeReference(int typeRef) {
- this.value = typeRef;
- }
-
- /**
- * Returns a type reference of the given sort.
- *
- * @param sort
- * {@link #FIELD FIELD}, {@link #METHOD_RETURN METHOD_RETURN},
- * {@link #METHOD_RECEIVER METHOD_RECEIVER},
- * {@link #LOCAL_VARIABLE LOCAL_VARIABLE},
- * {@link #RESOURCE_VARIABLE RESOURCE_VARIABLE},
- * {@link #INSTANCEOF INSTANCEOF}, {@link #NEW NEW},
- * {@link #CONSTRUCTOR_REFERENCE CONSTRUCTOR_REFERENCE}, or
- * {@link #METHOD_REFERENCE METHOD_REFERENCE}.
- * @return a type reference of the given sort.
- */
- public static TypeReference newTypeReference(int sort) {
- return new TypeReference(sort << 24);
- }
-
- /**
- * Returns a reference to a type parameter of a generic class or method.
- *
- * @param sort
- * {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER} or
- * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}.
- * @param paramIndex
- * the type parameter index.
- * @return a reference to the given generic class or method type parameter.
- */
- public static TypeReference newTypeParameterReference(int sort,
- int paramIndex) {
- return new TypeReference((sort << 24) | (paramIndex << 16));
- }
-
- /**
- * Returns a reference to a type parameter bound of a generic class or
- * method.
- *
- * @param sort
- * {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER} or
- * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}.
- * @param paramIndex
- * the type parameter index.
- * @param boundIndex
- * the type bound index within the above type parameters.
- * @return a reference to the given generic class or method type parameter
- * bound.
- */
- public static TypeReference newTypeParameterBoundReference(int sort,
- int paramIndex, int boundIndex) {
- return new TypeReference((sort << 24) | (paramIndex << 16)
- | (boundIndex << 8));
- }
-
- /**
- * Returns a reference to the super class or to an interface of the
- * 'implements' clause of a class.
- *
- * @param itfIndex
- * the index of an interface in the 'implements' clause of a
- * class, or -1 to reference the super class of the class.
- * @return a reference to the given super type of a class.
- */
- public static TypeReference newSuperTypeReference(int itfIndex) {
- itfIndex &= 0xFFFF;
- return new TypeReference((CLASS_EXTENDS << 24) | (itfIndex << 8));
- }
-
- /**
- * Returns a reference to the type of a formal parameter of a method.
- *
- * @param paramIndex
- * the formal parameter index.
- *
- * @return a reference to the type of the given method formal parameter.
- */
- public static TypeReference newFormalParameterReference(int paramIndex) {
- return new TypeReference((METHOD_FORMAL_PARAMETER << 24)
- | (paramIndex << 16));
- }
-
- /**
- * Returns a reference to the type of an exception, in a 'throws' clause of
- * a method.
- *
- * @param exceptionIndex
- * the index of an exception in a 'throws' clause of a method.
- *
- * @return a reference to the type of the given exception.
- */
- public static TypeReference newExceptionReference(int exceptionIndex) {
- return new TypeReference((THROWS << 24) | (exceptionIndex << 8));
- }
-
- /**
- * Returns a reference to the type of the exception declared in a 'catch'
- * clause of a method.
- *
- * @param tryCatchBlockIndex
- * the index of a try catch block (using the order in which they
- * are visited with visitTryCatchBlock).
- *
- * @return a reference to the type of the given exception.
- */
- public static TypeReference newTryCatchReference(int tryCatchBlockIndex) {
- return new TypeReference((EXCEPTION_PARAMETER << 24)
- | (tryCatchBlockIndex << 8));
- }
-
- /**
- * Returns a reference to the type of a type argument in a constructor or
- * method call or reference.
- *
- * @param sort
- * {@link #CAST CAST},
- * {@link #CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
- * CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT},
- * {@link #METHOD_INVOCATION_TYPE_ARGUMENT
- * METHOD_INVOCATION_TYPE_ARGUMENT},
- * {@link #CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
- * CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or
- * {@link #METHOD_REFERENCE_TYPE_ARGUMENT
- * METHOD_REFERENCE_TYPE_ARGUMENT}.
- * @param argIndex
- * the type argument index.
- *
- * @return a reference to the type of the given type argument.
- */
- public static TypeReference newTypeArgumentReference(int sort, int argIndex) {
- return new TypeReference((sort << 24) | argIndex);
- }
-
- /**
- * Returns the sort of this type reference.
- *
- * @return {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER},
- * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER},
- * {@link #CLASS_EXTENDS CLASS_EXTENDS},
- * {@link #CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND},
- * {@link #METHOD_TYPE_PARAMETER_BOUND METHOD_TYPE_PARAMETER_BOUND},
- * {@link #FIELD FIELD}, {@link #METHOD_RETURN METHOD_RETURN},
- * {@link #METHOD_RECEIVER METHOD_RECEIVER},
- * {@link #METHOD_FORMAL_PARAMETER METHOD_FORMAL_PARAMETER},
- * {@link #THROWS THROWS}, {@link #LOCAL_VARIABLE LOCAL_VARIABLE},
- * {@link #RESOURCE_VARIABLE RESOURCE_VARIABLE},
- * {@link #EXCEPTION_PARAMETER EXCEPTION_PARAMETER},
- * {@link #INSTANCEOF INSTANCEOF}, {@link #NEW NEW},
- * {@link #CONSTRUCTOR_REFERENCE CONSTRUCTOR_REFERENCE},
- * {@link #METHOD_REFERENCE METHOD_REFERENCE}, {@link #CAST CAST},
- * {@link #CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
- * CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT},
- * {@link #METHOD_INVOCATION_TYPE_ARGUMENT
- * METHOD_INVOCATION_TYPE_ARGUMENT},
- * {@link #CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
- * CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or
- * {@link #METHOD_REFERENCE_TYPE_ARGUMENT
- * METHOD_REFERENCE_TYPE_ARGUMENT}.
- */
- public int getSort() {
- return value >>> 24;
- }
-
- /**
- * Returns the index of the type parameter referenced by this type
- * reference. This method must only be used for type references whose sort
- * is {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER},
- * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER},
- * {@link #CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} or
- * {@link #METHOD_TYPE_PARAMETER_BOUND METHOD_TYPE_PARAMETER_BOUND}.
- *
- * @return a type parameter index.
- */
- public int getTypeParameterIndex() {
- return (value & 0x00FF0000) >> 16;
- }
-
- /**
- * Returns the index of the type parameter bound, within the type parameter
- * {@link #getTypeParameterIndex}, referenced by this type reference. This
- * method must only be used for type references whose sort is
- * {@link #CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} or
- * {@link #METHOD_TYPE_PARAMETER_BOUND METHOD_TYPE_PARAMETER_BOUND}.
- *
- * @return a type parameter bound index.
- */
- public int getTypeParameterBoundIndex() {
- return (value & 0x0000FF00) >> 8;
- }
-
- /**
- * Returns the index of the "super type" of a class that is referenced by
- * this type reference. This method must only be used for type references
- * whose sort is {@link #CLASS_EXTENDS CLASS_EXTENDS}.
- *
- * @return the index of an interface in the 'implements' clause of a class,
- * or -1 if this type reference references the type of the super
- * class.
- */
- public int getSuperTypeIndex() {
- return (short) ((value & 0x00FFFF00) >> 8);
- }
-
- /**
- * Returns the index of the formal parameter whose type is referenced by
- * this type reference. This method must only be used for type references
- * whose sort is {@link #METHOD_FORMAL_PARAMETER METHOD_FORMAL_PARAMETER}.
- *
- * @return a formal parameter index.
- */
- public int getFormalParameterIndex() {
- return (value & 0x00FF0000) >> 16;
- }
-
- /**
- * Returns the index of the exception, in a 'throws' clause of a method,
- * whose type is referenced by this type reference. This method must only be
- * used for type references whose sort is {@link #THROWS THROWS}.
- *
- * @return the index of an exception in the 'throws' clause of a method.
- */
- public int getExceptionIndex() {
- return (value & 0x00FFFF00) >> 8;
- }
-
- /**
- * Returns the index of the try catch block (using the order in which they
- * are visited with visitTryCatchBlock), whose 'catch' type is referenced by
- * this type reference. This method must only be used for type references
- * whose sort is {@link #EXCEPTION_PARAMETER EXCEPTION_PARAMETER} .
- *
- * @return the index of an exception in the 'throws' clause of a method.
- */
- public int getTryCatchBlockIndex() {
- return (value & 0x00FFFF00) >> 8;
- }
-
- /**
- * Returns the index of the type argument referenced by this type reference.
- * This method must only be used for type references whose sort is
- * {@link #CAST CAST}, {@link #CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
- * CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT},
- * {@link #METHOD_INVOCATION_TYPE_ARGUMENT METHOD_INVOCATION_TYPE_ARGUMENT},
- * {@link #CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
- * CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or
- * {@link #METHOD_REFERENCE_TYPE_ARGUMENT METHOD_REFERENCE_TYPE_ARGUMENT}.
- *
- * @return a type parameter index.
- */
- public int getTypeArgumentIndex() {
- return value & 0xFF;
- }
-
- /**
- * Returns the int encoded value of this type reference, suitable for use in
- * visit methods related to type annotations, like visitTypeAnnotation.
- *
- * @return the int encoded value of this type reference.
- */
- public int getValue() {
- return value;
- }
-}
+// ASM: a very small and fast Java bytecode manipulation framework
+// Copyright (c) 2000-2011 INRIA, France Telecom
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+
+package jersey.repackaged.org.objectweb.asm;
+
+/**
+ * A reference to a type appearing in a class, field or method declaration, or on an instruction.
+ * Such a reference designates the part of the class where the referenced type is appearing (e.g. an
+ * 'extends', 'implements' or 'throws' clause, a 'new' instruction, a 'catch' clause, a type cast, a
+ * local variable declaration, etc).
+ *
+ * @author Eric Bruneton
+ */
+public class TypeReference {
+
+ /**
+ * The sort of type references that target a type parameter of a generic class. See {@link
+ * #getSort}.
+ */
+ public static final int CLASS_TYPE_PARAMETER = 0x00;
+
+ /**
+ * The sort of type references that target a type parameter of a generic method. See {@link
+ * #getSort}.
+ */
+ public static final int METHOD_TYPE_PARAMETER = 0x01;
+
+ /**
+ * The sort of type references that target the super class of a class or one of the interfaces it
+ * implements. See {@link #getSort}.
+ */
+ public static final int CLASS_EXTENDS = 0x10;
+
+ /**
+ * The sort of type references that target a bound of a type parameter of a generic class. See
+ * {@link #getSort}.
+ */
+ public static final int CLASS_TYPE_PARAMETER_BOUND = 0x11;
+
+ /**
+ * The sort of type references that target a bound of a type parameter of a generic method. See
+ * {@link #getSort}.
+ */
+ public static final int METHOD_TYPE_PARAMETER_BOUND = 0x12;
+
+ /** The sort of type references that target the type of a field. See {@link #getSort}. */
+ public static final int FIELD = 0x13;
+
+ /** The sort of type references that target the return type of a method. See {@link #getSort}. */
+ public static final int METHOD_RETURN = 0x14;
+
+ /**
+ * The sort of type references that target the receiver type of a method. See {@link #getSort}.
+ */
+ public static final int METHOD_RECEIVER = 0x15;
+
+ /**
+ * The sort of type references that target the type of a formal parameter of a method. See {@link
+ * #getSort}.
+ */
+ public static final int METHOD_FORMAL_PARAMETER = 0x16;
+
+ /**
+ * The sort of type references that target the type of an exception declared in the throws clause
+ * of a method. See {@link #getSort}.
+ */
+ public static final int THROWS = 0x17;
+
+ /**
+ * The sort of type references that target the type of a local variable in a method. See {@link
+ * #getSort}.
+ */
+ public static final int LOCAL_VARIABLE = 0x40;
+
+ /**
+ * The sort of type references that target the type of a resource variable in a method. See {@link
+ * #getSort}.
+ */
+ public static final int RESOURCE_VARIABLE = 0x41;
+
+ /**
+ * The sort of type references that target the type of the exception of a 'catch' clause in a
+ * method. See {@link #getSort}.
+ */
+ public static final int EXCEPTION_PARAMETER = 0x42;
+
+ /**
+ * The sort of type references that target the type declared in an 'instanceof' instruction. See
+ * {@link #getSort}.
+ */
+ public static final int INSTANCEOF = 0x43;
+
+ /**
+ * The sort of type references that target the type of the object created by a 'new' instruction.
+ * See {@link #getSort}.
+ */
+ public static final int NEW = 0x44;
+
+ /**
+ * The sort of type references that target the receiver type of a constructor reference. See
+ * {@link #getSort}.
+ */
+ public static final int CONSTRUCTOR_REFERENCE = 0x45;
+
+ /**
+ * The sort of type references that target the receiver type of a method reference. See {@link
+ * #getSort}.
+ */
+ public static final int METHOD_REFERENCE = 0x46;
+
+ /**
+ * The sort of type references that target the type declared in an explicit or implicit cast
+ * instruction. See {@link #getSort}.
+ */
+ public static final int CAST = 0x47;
+
+ /**
+ * The sort of type references that target a type parameter of a generic constructor in a
+ * constructor call. See {@link #getSort}.
+ */
+ public static final int CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48;
+
+ /**
+ * The sort of type references that target a type parameter of a generic method in a method call.
+ * See {@link #getSort}.
+ */
+ public static final int METHOD_INVOCATION_TYPE_ARGUMENT = 0x49;
+
+ /**
+ * The sort of type references that target a type parameter of a generic constructor in a
+ * constructor reference. See {@link #getSort}.
+ */
+ public static final int CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A;
+
+ /**
+ * The sort of type references that target a type parameter of a generic method in a method
+ * reference. See {@link #getSort}.
+ */
+ public static final int METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B;
+
+ /**
+ * The target_type and target_info structures - as defined in the Java Virtual Machine
+ * Specification (JVMS) - corresponding to this type reference. target_type uses one byte, and all
+ * the target_info union fields use up to 3 bytes (except localvar_target, handled with the
+ * specific method {@link MethodVisitor#visitLocalVariableAnnotation}). Thus, both structures can
+ * be stored in an int.
+ *
+ * <p>This int field stores target_type (called the TypeReference 'sort' in the public API of this
+ * class) in its most significant byte, followed by the target_info fields. Depending on
+ * target_type, 1, 2 or even 3 least significant bytes of this field are unused. target_info
+ * fields which reference bytecode offsets are set to 0 (these offsets are ignored in ClassReader,
+ * and recomputed in MethodWriter).
+ *
+ * @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20">JVMS
+ * 4.7.20</a>
+ * @see <a
+ * href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20.1">JVMS
+ * 4.7.20.1</a>
+ */
+ private final int targetTypeAndInfo;
+
+ /**
+ * Constructs a new TypeReference.
+ *
+ * @param typeRef the int encoded value of the type reference, as received in a visit method
+ * related to type annotations, such as {@link ClassVisitor#visitTypeAnnotation}.
+ */
+ public TypeReference(final int typeRef) {
+ this.targetTypeAndInfo = typeRef;
+ }
+
+ /**
+ * Returns a type reference of the given sort.
+ *
+ * @param sort one of {@link #FIELD}, {@link #METHOD_RETURN}, {@link #METHOD_RECEIVER}, {@link
+ * #LOCAL_VARIABLE}, {@link #RESOURCE_VARIABLE}, {@link #INSTANCEOF}, {@link #NEW}, {@link
+ * #CONSTRUCTOR_REFERENCE}, or {@link #METHOD_REFERENCE}.
+ * @return a type reference of the given sort.
+ */
+ public static TypeReference newTypeReference(final int sort) {
+ return new TypeReference(sort << 24);
+ }
+
+ /**
+ * Returns a reference to a type parameter of a generic class or method.
+ *
+ * @param sort one of {@link #CLASS_TYPE_PARAMETER} or {@link #METHOD_TYPE_PARAMETER}.
+ * @param paramIndex the type parameter index.
+ * @return a reference to the given generic class or method type parameter.
+ */
+ public static TypeReference newTypeParameterReference(final int sort, final int paramIndex) {
+ return new TypeReference((sort << 24) | (paramIndex << 16));
+ }
+
+ /**
+ * Returns a reference to a type parameter bound of a generic class or method.
+ *
+ * @param sort one of {@link #CLASS_TYPE_PARAMETER} or {@link #METHOD_TYPE_PARAMETER}.
+ * @param paramIndex the type parameter index.
+ * @param boundIndex the type bound index within the above type parameters.
+ * @return a reference to the given generic class or method type parameter bound.
+ */
+ public static TypeReference newTypeParameterBoundReference(
+ final int sort, final int paramIndex, final int boundIndex) {
+ return new TypeReference((sort << 24) | (paramIndex << 16) | (boundIndex << 8));
+ }
+
+ /**
+ * Returns a reference to the super class or to an interface of the 'implements' clause of a
+ * class.
+ *
+ * @param itfIndex the index of an interface in the 'implements' clause of a class, or -1 to
+ * reference the super class of the class.
+ * @return a reference to the given super type of a class.
+ */
+ public static TypeReference newSuperTypeReference(final int itfIndex) {
+ return new TypeReference((CLASS_EXTENDS << 24) | ((itfIndex & 0xFFFF) << 8));
+ }
+
+ /**
+ * Returns a reference to the type of a formal parameter of a method.
+ *
+ * @param paramIndex the formal parameter index.
+ * @return a reference to the type of the given method formal parameter.
+ */
+ public static TypeReference newFormalParameterReference(final int paramIndex) {
+ return new TypeReference((METHOD_FORMAL_PARAMETER << 24) | (paramIndex << 16));
+ }
+
+ /**
+ * Returns a reference to the type of an exception, in a 'throws' clause of a method.
+ *
+ * @param exceptionIndex the index of an exception in a 'throws' clause of a method.
+ * @return a reference to the type of the given exception.
+ */
+ public static TypeReference newExceptionReference(final int exceptionIndex) {
+ return new TypeReference((THROWS << 24) | (exceptionIndex << 8));
+ }
+
+ /**
+ * Returns a reference to the type of the exception declared in a 'catch' clause of a method.
+ *
+ * @param tryCatchBlockIndex the index of a try catch block (using the order in which they are
+ * visited with visitTryCatchBlock).
+ * @return a reference to the type of the given exception.
+ */
+ public static TypeReference newTryCatchReference(final int tryCatchBlockIndex) {
+ return new TypeReference((EXCEPTION_PARAMETER << 24) | (tryCatchBlockIndex << 8));
+ }
+
+ /**
+ * Returns a reference to the type of a type argument in a constructor or method call or
+ * reference.
+ *
+ * @param sort one of {@link #CAST}, {@link #CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT}, {@link
+ * #METHOD_INVOCATION_TYPE_ARGUMENT}, {@link #CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or {@link
+ * #METHOD_REFERENCE_TYPE_ARGUMENT}.
+ * @param argIndex the type argument index.
+ * @return a reference to the type of the given type argument.
+ */
+ public static TypeReference newTypeArgumentReference(final int sort, final int argIndex) {
+ return new TypeReference((sort << 24) | argIndex);
+ }
+
+ /**
+ * Returns the sort of this type reference.
+ *
+ * @return one of {@link #CLASS_TYPE_PARAMETER}, {@link #METHOD_TYPE_PARAMETER}, {@link
+ * #CLASS_EXTENDS}, {@link #CLASS_TYPE_PARAMETER_BOUND}, {@link #METHOD_TYPE_PARAMETER_BOUND},
+ * {@link #FIELD}, {@link #METHOD_RETURN}, {@link #METHOD_RECEIVER}, {@link
+ * #METHOD_FORMAL_PARAMETER}, {@link #THROWS}, {@link #LOCAL_VARIABLE}, {@link
+ * #RESOURCE_VARIABLE}, {@link #EXCEPTION_PARAMETER}, {@link #INSTANCEOF}, {@link #NEW},
+ * {@link #CONSTRUCTOR_REFERENCE}, {@link #METHOD_REFERENCE}, {@link #CAST}, {@link
+ * #CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT}, {@link #METHOD_INVOCATION_TYPE_ARGUMENT}, {@link
+ * #CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or {@link #METHOD_REFERENCE_TYPE_ARGUMENT}.
+ */
+ public int getSort() {
+ return targetTypeAndInfo >>> 24;
+ }
+
+ /**
+ * Returns the index of the type parameter referenced by this type reference. This method must
+ * only be used for type references whose sort is {@link #CLASS_TYPE_PARAMETER}, {@link
+ * #METHOD_TYPE_PARAMETER}, {@link #CLASS_TYPE_PARAMETER_BOUND} or {@link
+ * #METHOD_TYPE_PARAMETER_BOUND}.
+ *
+ * @return a type parameter index.
+ */
+ public int getTypeParameterIndex() {
+ return (targetTypeAndInfo & 0x00FF0000) >> 16;
+ }
+
+ /**
+ * Returns the index of the type parameter bound, within the type parameter {@link
+ * #getTypeParameterIndex}, referenced by this type reference. This method must only be used for
+ * type references whose sort is {@link #CLASS_TYPE_PARAMETER_BOUND} or {@link
+ * #METHOD_TYPE_PARAMETER_BOUND}.
+ *
+ * @return a type parameter bound index.
+ */
+ public int getTypeParameterBoundIndex() {
+ return (targetTypeAndInfo & 0x0000FF00) >> 8;
+ }
+
+ /**
+ * Returns the index of the "super type" of a class that is referenced by this type reference.
+ * This method must only be used for type references whose sort is {@link #CLASS_EXTENDS}.
+ *
+ * @return the index of an interface in the 'implements' clause of a class, or -1 if this type
+ * reference references the type of the super class.
+ */
+ public int getSuperTypeIndex() {
+ return (short) ((targetTypeAndInfo & 0x00FFFF00) >> 8);
+ }
+
+ /**
+ * Returns the index of the formal parameter whose type is referenced by this type reference. This
+ * method must only be used for type references whose sort is {@link #METHOD_FORMAL_PARAMETER}.
+ *
+ * @return a formal parameter index.
+ */
+ public int getFormalParameterIndex() {
+ return (targetTypeAndInfo & 0x00FF0000) >> 16;
+ }
+
+ /**
+ * Returns the index of the exception, in a 'throws' clause of a method, whose type is referenced
+ * by this type reference. This method must only be used for type references whose sort is {@link
+ * #THROWS}.
+ *
+ * @return the index of an exception in the 'throws' clause of a method.
+ */
+ public int getExceptionIndex() {
+ return (targetTypeAndInfo & 0x00FFFF00) >> 8;
+ }
+
+ /**
+ * Returns the index of the try catch block (using the order in which they are visited with
+ * visitTryCatchBlock), whose 'catch' type is referenced by this type reference. This method must
+ * only be used for type references whose sort is {@link #EXCEPTION_PARAMETER} .
+ *
+ * @return the index of an exception in the 'throws' clause of a method.
+ */
+ public int getTryCatchBlockIndex() {
+ return (targetTypeAndInfo & 0x00FFFF00) >> 8;
+ }
+
+ /**
+ * Returns the index of the type argument referenced by this type reference. This method must only
+ * be used for type references whose sort is {@link #CAST}, {@link
+ * #CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT}, {@link #METHOD_INVOCATION_TYPE_ARGUMENT}, {@link
+ * #CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or {@link #METHOD_REFERENCE_TYPE_ARGUMENT}.
+ *
+ * @return a type parameter index.
+ */
+ public int getTypeArgumentIndex() {
+ return targetTypeAndInfo & 0xFF;
+ }
+
+ /**
+ * Returns the int encoded value of this type reference, suitable for use in visit methods related
+ * to type annotations, like visitTypeAnnotation.
+ *
+ * @return the int encoded value of this type reference.
+ */
+ public int getValue() {
+ return targetTypeAndInfo;
+ }
+
+ /**
+ * Puts the given target_type and target_info JVMS structures into the given ByteVector.
+ *
+ * @param targetTypeAndInfo a target_type and a target_info structures encoded as in {@link
+ * #targetTypeAndInfo}. LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported.
+ * @param output where the type reference must be put.
+ */
+ static void putTarget(final int targetTypeAndInfo, final ByteVector output) {
+ switch (targetTypeAndInfo >>> 24) {
+ case CLASS_TYPE_PARAMETER:
+ case METHOD_TYPE_PARAMETER:
+ case METHOD_FORMAL_PARAMETER:
+ output.putShort(targetTypeAndInfo >>> 16);
+ break;
+ case FIELD:
+ case METHOD_RETURN:
+ case METHOD_RECEIVER:
+ output.putByte(targetTypeAndInfo >>> 24);
+ break;
+ case CAST:
+ case CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT:
+ case METHOD_INVOCATION_TYPE_ARGUMENT:
+ case CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT:
+ case METHOD_REFERENCE_TYPE_ARGUMENT:
+ output.putInt(targetTypeAndInfo);
+ break;
+ case CLASS_EXTENDS:
+ case CLASS_TYPE_PARAMETER_BOUND:
+ case METHOD_TYPE_PARAMETER_BOUND:
+ case THROWS:
+ case EXCEPTION_PARAMETER:
+ case INSTANCEOF:
+ case NEW:
+ case CONSTRUCTOR_REFERENCE:
+ case METHOD_REFERENCE:
+ output.put12(targetTypeAndInfo >>> 24, (targetTypeAndInfo & 0xFFFF00) >> 8);
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ }
+}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java b/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java
index 6e9449a..4239402 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -75,7 +76,7 @@
import org.glassfish.jersey.server.internal.JerseyRequestTimeoutHandler;
import org.glassfish.jersey.server.internal.LocalizationMessages;
import org.glassfish.jersey.server.internal.ProcessingProviders;
-import org.glassfish.jersey.server.internal.inject.ParamConverterConfigurator;
+import org.glassfish.jersey.internal.inject.ParamConverterConfigurator;
import org.glassfish.jersey.server.internal.inject.ParamExtractorConfigurator;
import org.glassfish.jersey.server.internal.inject.ValueParamProviderConfigurator;
import org.glassfish.jersey.server.internal.monitoring.ApplicationEventImpl;
@@ -128,10 +129,10 @@
* application-specific {@link InjectionManager injection manager}.
* </p>
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Jakub Podlesak
+ * @author Marek Potociar
+ * @author Libor Kramolis
* @see ResourceConfig
* @see javax.ws.rs.core.Configuration
* @see org.glassfish.jersey.server.spi.ContainerProvider
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/AsyncContext.java b/core-server/src/main/java/org/glassfish/jersey/server/AsyncContext.java
index 99db452..664a384 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/AsyncContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/AsyncContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
* Injectable asynchronous processing context that can be used to control various aspects
* of asynchronous processing of a single request.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface AsyncContext extends AsyncResponse {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/BackgroundScheduler.java b/core-server/src/main/java/org/glassfish/jersey/server/BackgroundScheduler.java
index 6ddc2b9..95eed23 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/BackgroundScheduler.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/BackgroundScheduler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -41,7 +41,7 @@
* configured to support customizable runtime thread .
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see BackgroundSchedulerLiteral
* @since 2.18
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/BackgroundSchedulerLiteral.java b/core-server/src/main/java/org/glassfish/jersey/server/BackgroundSchedulerLiteral.java
index 5c2524e..f710711 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/BackgroundSchedulerLiteral.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/BackgroundSchedulerLiteral.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* in method calls that require use of annotation instances.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.18
*/
@SuppressWarnings("ClassExplicitlyAnnotation")
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/Broadcaster.java b/core-server/src/main/java/org/glassfish/jersey/server/Broadcaster.java
index f39244a..38d7c2c 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/Broadcaster.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/Broadcaster.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -29,7 +29,7 @@
* Used for broadcasting response chunks to multiple {@link ChunkedOutput} instances.
*
* @param <T> broadcast type.
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
*/
public class Broadcaster<T> implements BroadcasterListener<T> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ChunkedOutput.java b/core-server/src/main/java/org/glassfish/jersey/server/ChunkedOutput.java
index ca7e535..7564f0c 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ChunkedOutput.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ChunkedOutput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,9 +42,9 @@
* which needs to produce partial responses.
*
* @param <T> chunk type.
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
// TODO: something like prequel/sequel - usable for EventChannelWriter and XML related writers
public class ChunkedOutput<T> extends GenericType<T> implements Closeable {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ChunkedResponseWriter.java b/core-server/src/main/java/org/glassfish/jersey/server/ChunkedResponseWriter.java
index 2b9929a..201efc4 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ChunkedResponseWriter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ChunkedResponseWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -29,7 +29,7 @@
/**
* Used for writing {@link ChunkedOutput}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @see MessageBodyWriter
*/
public final class ChunkedResponseWriter implements MessageBodyWriter<ChunkedOutput<?>> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ClientBinding.java b/core-server/src/main/java/org/glassfish/jersey/server/ClientBinding.java
index 10e3159..7714517 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ClientBinding.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ClientBinding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -108,7 +108,7 @@
* to override the default property values defined programmatically in a custom configuration implementation class.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/CloseableService.java b/core-server/src/main/java/org/glassfish/jersey/server/CloseableService.java
index cb11d68..8c59ed7 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/CloseableService.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/CloseableService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
* of scope, more specifically after the request has been processed and the
* response has been returned.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Paul Sandoz
*/
public interface CloseableService {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ContainerException.java b/core-server/src/main/java/org/glassfish/jersey/server/ContainerException.java
index 1d90fac..d3d0709 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ContainerException.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ContainerException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
* Exception thrown by the container components in to notify Jersey runtime about
* any errors.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ContainerException extends ProcessingException {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ContainerFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/ContainerFactory.java
index a424131..d7c1ab3 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ContainerFactory.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,8 +25,8 @@
* Factory for creating specific HTTP-based containers.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public final class ContainerFactory {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ContainerFilteringStage.java b/core-server/src/main/java/org/glassfish/jersey/server/ContainerFilteringStage.java
index 92ded02..9782a09 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ContainerFilteringStage.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ContainerFilteringStage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Container filtering stage responsible for execution of request and response filters
* on each request-response message exchange.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
*/
class ContainerFilteringStage extends AbstractChainableStage<RequestProcessingContext> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ContainerMessageBodyWorkersInitializer.java b/core-server/src/main/java/org/glassfish/jersey/server/ContainerMessageBodyWorkersInitializer.java
index 2d4ec86..a24b9c5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ContainerMessageBodyWorkersInitializer.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ContainerMessageBodyWorkersInitializer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
* Function that can be put to an acceptor chain to properly initialize
* {@link org.glassfish.jersey.message.MessageBodyWorkers} instance on a current request and response.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ContainerMessageBodyWorkersInitializer
implements Function<RequestProcessingContext, RequestProcessingContext> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ContainerRequest.java b/core-server/src/main/java/org/glassfish/jersey/server/ContainerRequest.java
index 9308311..5b41bdd 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ContainerRequest.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ContainerRequest.java
@@ -76,7 +76,7 @@
* An instance of the request context is passed by the container to the
* {@link ApplicationHandler} for each incoming client request.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ContainerRequest extends InboundMessageContext
implements ContainerRequestContext, Request, HttpHeaders, PropertiesDelegate {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ContainerResponse.java b/core-server/src/main/java/org/glassfish/jersey/server/ContainerResponse.java
index 093772a..90b3bda 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ContainerResponse.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ContainerResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -45,7 +45,7 @@
/**
* Jersey container response context.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ContainerResponse implements ContainerResponseContext {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsync.java b/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsync.java
index 641789a..911dad6 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsync.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsync.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -27,7 +27,7 @@
* should be executed on a separate thread managed by an internal Jersey
* {@link java.util.concurrent.ExecutorService executor service}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsyncExecutor.java b/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsyncExecutor.java
index 8a1cf12..b0c0b18 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsyncExecutor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsyncExecutor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* with the {@code @ManagedAsyncExecutor} annotation.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see ManagedAsyncExecutorLiteral
* @since 2.18
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsyncExecutorLiteral.java b/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsyncExecutorLiteral.java
index ca73b75..d542116 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsyncExecutorLiteral.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ManagedAsyncExecutorLiteral.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* in method calls that require use of annotation instances.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.18
*/
@SuppressWarnings("ClassExplicitlyAnnotation")
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ParamException.java b/core-server/src/main/java/org/glassfish/jersey/server/ParamException.java
index b7cff50..d1df398 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ParamException.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ParamException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -46,7 +46,7 @@
* response with a 400 (Client error) status code.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class ParamException extends WebApplicationException {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ResourceBag.java b/core-server/src/main/java/org/glassfish/jersey/server/ResourceBag.java
index 6a35b02..dd4d3eb 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ResourceBag.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ResourceBag.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
* A container for application resource models used during the {@link ApplicationHandler}
* initialization.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class ResourceBag {
/**
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ResourceConfig.java b/core-server/src/main/java/org/glassfish/jersey/server/ResourceConfig.java
index b0f9832..ff056b5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ResourceConfig.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ResourceConfig.java
@@ -38,6 +38,7 @@
import javax.ws.rs.core.Feature;
import org.glassfish.jersey.internal.Errors;
+import org.glassfish.jersey.internal.config.ExternalPropertiesConfigurationFactory;
import org.glassfish.jersey.internal.inject.Binder;
import org.glassfish.jersey.internal.inject.InjectionManager;
import org.glassfish.jersey.internal.spi.AutoDiscoverable;
@@ -56,13 +57,14 @@
import org.glassfish.jersey.server.internal.scanning.PackageNamesScanner;
import org.glassfish.jersey.server.model.Resource;
+
/**
* The resource configuration for configuring a web application.
*
* @author Paul Sandoz
* @author Martin Matula
* @author Michal Gajdos
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ResourceConfig extends Application implements Configurable<ResourceConfig>, ServerConfig {
@@ -713,6 +715,7 @@
final State current = state;
if (!(current instanceof ImmutableState)) {
setupApplicationName();
+ ExternalPropertiesConfigurationFactory.configure(state);
state = new ImmutableState(current);
}
}
@@ -1302,4 +1305,5 @@
setApplicationName(appName);
}
}
+
}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ResourceFinder.java b/core-server/src/main/java/org/glassfish/jersey/server/ResourceFinder.java
index 2bbf702..d024b43 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ResourceFinder.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ResourceFinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -33,7 +33,7 @@
* allocated/opened resources (such as streams). When a resource finder is closed no other method should be
* invoked on it.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public interface ResourceFinder extends Iterator<String>, AutoCloseable {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ServerBinder.java b/core-server/src/main/java/org/glassfish/jersey/server/ServerBinder.java
index 99429b9..3e3be7b 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ServerBinder.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ServerBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,8 +29,8 @@
/**
* Server injection binder.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Marek Potociar
+ * @author Libor Kramolis
*/
class ServerBinder extends AbstractBinder {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ServerConfig.java b/core-server/src/main/java/org/glassfish/jersey/server/ServerConfig.java
index a9fa0b9..c5a7e27 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ServerConfig.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ServerConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +24,7 @@
/**
* Server-side application configuration.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface ServerConfig extends ExtendedConfig {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java b/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java
index 3696193..cd22a48 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,8 +30,8 @@
/**
* Jersey server-side configuration properties.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Marek Potociar
+ * @author Libor Kramolis
* @author Michal Gajdos
* @author Martin Matula
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java b/core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java
index 5c48b38..906b391 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -98,7 +98,7 @@
/**
* Server-side request processing runtime.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ServerRuntime {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/SubjectSecurityContext.java b/core-server/src/main/java/org/glassfish/jersey/server/SubjectSecurityContext.java
index 639ae13..c0601ec 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/SubjectSecurityContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/SubjectSecurityContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -31,8 +31,8 @@
* dispatch the request to a resource method (or to call a sub-resource locator).
*
* @author Martin Matula
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public interface SubjectSecurityContext extends SecurityContext {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/TracingConfig.java b/core-server/src/main/java/org/glassfish/jersey/server/TracingConfig.java
index 7053eaa..6e096ee 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/TracingConfig.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/TracingConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Enumeration of possible values of property {@link org.glassfish.jersey.server.ServerProperties#TRACING}.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.3
*/
public enum TracingConfig {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/TracingUtils.java b/core-server/src/main/java/org/glassfish/jersey/server/TracingUtils.java
index d89fad6..471a733 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/TracingUtils.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/TracingUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Utilities for tracing support.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.3
*/
public final class TracingUtils {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/filter/EncodingFilter.java b/core-server/src/main/java/org/glassfish/jersey/server/filter/EncodingFilter.java
index 4e392da..61f4a24 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/filter/EncodingFilter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/filter/EncodingFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -104,6 +104,9 @@
// convert encodings from String to Encoding objects
List<ContentEncoding> encodings = new ArrayList<>();
for (String input : acceptEncoding) {
+ if (input.isEmpty()) {
+ continue;
+ }
String[] tokens = input.split(",");
for (String token : tokens) {
try {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/AbstractResourceFinderAdapter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/AbstractResourceFinderAdapter.java
index 0e9d222..72655ed 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/AbstractResourceFinderAdapter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/AbstractResourceFinderAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
/**
* This class provides partial default implementation of {@link org.glassfish.jersey.server.ResourceFinder}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
* @since 2.18
*/
public abstract class AbstractResourceFinderAdapter implements ResourceFinder {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/ContainerUtils.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/ContainerUtils.java
index 782e1b8..0cca747 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/ContainerUtils.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/ContainerUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Utility methods used by container implementations.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class ContainerUtils {
private static final String[] TOKENS = {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/InternalServerProperties.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/InternalServerProperties.java
index b262e6e..7df5d27 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/InternalServerProperties.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/InternalServerProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
/**
* Jersey internal server-side configuration properties.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@PropertiesClass
public final class InternalServerProperties {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/JerseyRequestTimeoutHandler.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/JerseyRequestTimeoutHandler.java
index e348662..c4e6846 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/JerseyRequestTimeoutHandler.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/JerseyRequestTimeoutHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
* {@link ContainerResponseWriter} implementations instead of the underlying infrastructure.
*
* @author Michal Gajdos
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JerseyRequestTimeoutHandler {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/JerseyResourceContext.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/JerseyResourceContext.java
index 202be50..8cefbf2 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/JerseyResourceContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/JerseyResourceContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -45,7 +45,7 @@
/**
* Jersey implementation of JAX-RS {@link ResourceContext resource context}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JerseyResourceContext implements ExtendedResourceContext {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/RuntimeDelegateImpl.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/RuntimeDelegateImpl.java
index 7662a25..251f0c3 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/RuntimeDelegateImpl.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/RuntimeDelegateImpl.java
@@ -51,7 +51,7 @@
* method.
*
* @author Jakub Podlesak
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
*/
public class RuntimeDelegateImpl extends AbstractRuntimeDelegate {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/ServerTraceEvent.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/ServerTraceEvent.java
index 1d935a0..b3fcbab 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/ServerTraceEvent.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/ServerTraceEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,7 +27,7 @@
/**
* Server side tracing events.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @since 2.3
*/
public enum ServerTraceEvent implements TracingLogger.Event {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractParamValueExtractor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractParamValueExtractor.java
index 0f792e6..e638ca5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractParamValueExtractor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractParamValueExtractor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -28,7 +28,7 @@
* logic supplied using {@link ParamConverter parameter converters}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
abstract class AbstractParamValueExtractor<T> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java
index a5395ee..70dcaae 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AbstractValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* parameter map}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractValueParamProvider implements ValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java
index 4fb834d..cc583f5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/AsyncResponseValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
/**
* Value factory provider supporting the {@link javax.ws.rs.container.Suspended} injection annotation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class AsyncResponseValueParamProvider implements ValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CollectionExtractor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CollectionExtractor.java
index 5228b85..d759f23 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CollectionExtractor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CollectionExtractor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
*
* @param <T> parameter value type.
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
abstract class CollectionExtractor<T> extends AbstractParamValueExtractor<T>
implements MultivaluedParameterExtractor<Collection<T>> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java
index 24d5629..224f0ab 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/CookieParamValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,7 +36,7 @@
* Value factory provider supporting the {@link CookieParam} injection annotation.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
final class CookieParamValueParamProvider extends AbstractValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java
index 4b2001a..89842e0 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/DelegatedInjectionValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,14 +32,14 @@
import org.glassfish.jersey.process.internal.RequestScoped;
import org.glassfish.jersey.server.ContainerRequest;
import org.glassfish.jersey.server.model.Parameter;
-import org.glassfish.jersey.server.model.Parameter.Source;
+import org.glassfish.jersey.model.Parameter.Source;
import org.glassfish.jersey.server.spi.internal.ValueParamProvider;
/**
* Value factory provider that delegates the injection target lookup to the underlying injection provider.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Marek Potociar
+ * @author Jakub Podlesak
*/
@Singleton
class DelegatedInjectionValueParamProvider implements ValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java
index 55d379d..5e6aa84 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/EntityParamValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* Provides injection of {@link Request} entity value or {@link Request} instance
* itself.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
class EntityParamValueParamProvider extends AbstractValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java
index df47771..8896f89 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/FormParamValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -50,7 +50,7 @@
* Value factory provider supporting the {@link FormParam} injection annotation.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
final class FormParamValueParamProvider extends AbstractValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java
index fa92d1c..bbfe3e1 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/HeaderParamValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
* Value supplier provider supporting the {@link HeaderParam @HeaderParam} injection annotation.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
final class HeaderParamValueParamProvider extends AbstractValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java
index 1692256..d7a3046 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MatrixParamValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* Value supplier provider supporting the {@link MatrixParam @MatrixParam} injection annotation.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
final class MatrixParamValueParamProvider extends AbstractValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractor.java
index caa23fa..e070163 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +24,7 @@
* Java type.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface MultivaluedParameterExtractor<T> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java
index 4239036..aca45c6 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorFactory.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -30,11 +31,13 @@
import javax.inject.Singleton;
import org.glassfish.jersey.internal.inject.ExtractorException;
+import org.glassfish.jersey.internal.inject.ParamConverterFactory;
import org.glassfish.jersey.internal.util.ReflectionHelper;
import org.glassfish.jersey.internal.util.collection.ClassTypePair;
import org.glassfish.jersey.internal.util.collection.LazyValue;
import org.glassfish.jersey.server.internal.LocalizationMessages;
-import org.glassfish.jersey.server.model.Parameter;
+import org.glassfish.jersey.model.Parameter;
+import org.glassfish.jersey.internal.inject.PrimitiveMapper;
/**
* Implementation of {@link MultivaluedParameterExtractorProvider}. For each
@@ -43,7 +46,7 @@
* {@link MultivaluedParameterExtractor multivalued parameter extractor}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
final class MultivaluedParameterExtractorFactory implements MultivaluedParameterExtractorProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java
index cf8b7af..2aeb8db 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/MultivaluedParameterExtractorProvider.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,13 +17,13 @@
package org.glassfish.jersey.server.internal.inject;
-import org.glassfish.jersey.server.model.Parameter;
+import org.glassfish.jersey.model.Parameter;
/**
* Provider of multivalued parameter extractors.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface MultivaluedParameterExtractorProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java
index 7d56f88..ca674d0 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamExtractorConfigurator.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -22,6 +23,7 @@
import org.glassfish.jersey.internal.BootstrapConfigurator;
import org.glassfish.jersey.internal.inject.Bindings;
import org.glassfish.jersey.internal.inject.InjectionManager;
+import org.glassfish.jersey.internal.inject.ParamConverterFactory;
import org.glassfish.jersey.internal.inject.Providers;
import org.glassfish.jersey.internal.util.collection.LazyValue;
import org.glassfish.jersey.internal.util.collection.Value;
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java
index a4db088..7ff0dfd 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -39,7 +39,7 @@
* Abstract base class for resolving JAX-RS {@code @XxxParam} injection.
*
* @param <A> supported parameter injection annotation.
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ParamInjectionResolver<A extends Annotation> implements InjectionResolver<A> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveCharacterExtractor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveCharacterExtractor.java
index 6755881..1f26333 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveCharacterExtractor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveCharacterExtractor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Value extractor for {@link java.lang.Character} and {@code char} parameters.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class PrimitiveCharacterExtractor implements MultivaluedParameterExtractor<Object> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveValueOfExtractor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveValueOfExtractor.java
index 335e4c5..38bad67 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveValueOfExtractor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/PrimitiveValueOfExtractor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -31,7 +31,7 @@
* classes.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class PrimitiveValueOfExtractor implements MultivaluedParameterExtractor<Object> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java
index 1b3c7d6..99bdfe8 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/QueryParamValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
* Value supplier provider supporting the {@link QueryParam @QueryParam} injection annotation.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
final class QueryParamValueParamProvider extends AbstractValueParamProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/SingleStringValueExtractor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/SingleStringValueExtractor.java
index 3994c7b..93f1bb4 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/SingleStringValueExtractor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/SingleStringValueExtractor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
* This class can be seen as a special, optimized, case of {@link SingleValueExtractor}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class SingleStringValueExtractor implements MultivaluedParameterExtractor<String> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/SingleValueExtractor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/SingleValueExtractor.java
index 16be021..69431fb 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/SingleValueExtractor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/SingleValueExtractor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
*
* @param <T> extracted Java type.
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class SingleValueExtractor<T> extends AbstractParamValueExtractor<T> implements MultivaluedParameterExtractor<T> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/StringCollectionExtractor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/StringCollectionExtractor.java
index df4b985..ca313ae 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/StringCollectionExtractor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/StringCollectionExtractor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
* This class can be seen as a special, optimized, case of {@link CollectionExtractor}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
abstract class StringCollectionExtractor implements MultivaluedParameterExtractor<Collection<String>> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java
index 69aba9b..6257618 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/WebTargetValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -53,7 +53,7 @@
/**
* Value supplier provider supporting the {@link Uri} injection annotation.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
final class WebTargetValueParamProvider extends AbstractValueParamProvider {
@@ -287,7 +287,7 @@
for (Object o : source.getInstances()) {
Class<?> c = o.getClass();
if (!targetConfig.isRegistered(o)) {
- target.register(c, source.getContracts(c));
+ target.register(o, source.getContracts(c));
}
}
}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatedSlidingWindowTimeReservoir.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatedSlidingWindowTimeReservoir.java
index eb1a58a..bf95a08 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatedSlidingWindowTimeReservoir.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatedSlidingWindowTimeReservoir.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
* determines the granularity of the data the snapshot provides. In other words, the aggregated value object is either included in
* the resulting measurements or not depending whether it was trimmed or not.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
class AggregatedSlidingWindowTimeReservoir extends AbstractSlidingWindowTimeReservoir<AggregatedValueObject> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatedValueObject.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatedValueObject.java
index febd39b..43b64b5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatedValueObject.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatedValueObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
* Aggregated value object stores aggregated measurements for provided set of data. The purpose of aggregation is to avoid high
* memory and processor time requirements for the calculation of statistics.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
class AggregatedValueObject {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmer.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmer.java
index d799e60..9c0fd94 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmer.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -36,7 +36,7 @@
* An aggregating trimmer for sliding window measurements. This trimmer updates registered time reservoirs with the aggregated
* measurements for the values it trimmed.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
class AggregatingTrimmer implements SlidingWindowTrimmer<Long> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ApplicationInfoListener.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ApplicationInfoListener.java
index db823f2..030e133 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ApplicationInfoListener.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ApplicationInfoListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
*
* @see MonitoringEventListener
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Priority(ApplicationInfoListener.PRIORITY)
public final class ApplicationInfoListener implements ApplicationEventListener {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ExecutionStatisticsImpl.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ExecutionStatisticsImpl.java
index 88bba6c..c3d5b50 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ExecutionStatisticsImpl.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ExecutionStatisticsImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -32,7 +32,7 @@
* Immutable Execution statistics.
*
* @author Miroslav Fuksa
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
final class ExecutionStatisticsImpl implements ExecutionStatistics {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/MonitoringStatisticsProcessor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/MonitoringStatisticsProcessor.java
index f603171..8bc4ec8 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/MonitoringStatisticsProcessor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/MonitoringStatisticsProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -194,7 +194,7 @@
* The purpose of this flooding logger facility is to warn about disability to decrease the size of given collection which
* leads to never ending looping while trying to empty that collection in a loop.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
private static class FloodingLogger {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ResourceMethodStatisticsImpl.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ResourceMethodStatisticsImpl.java
index 18f8228..db556f5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ResourceMethodStatisticsImpl.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ResourceMethodStatisticsImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
* Immutable resource method statistics.
*
* @author Miroslav Fuksa
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
final class ResourceMethodStatisticsImpl implements ResourceMethodStatistics {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ResourceStatisticsImpl.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ResourceStatisticsImpl.java
index bd31a95..2bcc19d 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ResourceStatisticsImpl.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/ResourceStatisticsImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
* Immutable resource statistics implementation.
*
* @author Miroslav Fuksa
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
final class ResourceStatisticsImpl implements ResourceStatistics {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoir.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoir.java
index d305774..c55e45d 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoir.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoir.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* Sliding window time reservoir implementation that stores data of type {@link Long}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
class SlidingWindowTimeReservoir extends AbstractSlidingWindowTimeReservoir<Long> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/TimeWindowStatisticsImpl.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/TimeWindowStatisticsImpl.java
index f4b139d..262d496 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/TimeWindowStatisticsImpl.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/TimeWindowStatisticsImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
* {@code Builder} implementation.
*
* @author Miroslav Fuksa
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
final class TimeWindowStatisticsImpl implements TimeWindowStatistics {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/UniformTimeSimpleSnapshot.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/UniformTimeSimpleSnapshot.java
index fccf075..ce9c164 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/UniformTimeSimpleSnapshot.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/UniformTimeSimpleSnapshot.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
/**
* A statistical snapshot of a {@link UniformTimeSimpleSnapshot}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
* @author Dropwizard Team
* @see <a href="https://github.com/dropwizard/metrics">https://github.com/dropwizard/metrics</a>
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/AbstractSlidingWindowTimeReservoir.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/AbstractSlidingWindowTimeReservoir.java
index 9078b10..952d4c3 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/AbstractSlidingWindowTimeReservoir.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/AbstractSlidingWindowTimeReservoir.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright 2010, 2013 Coda Hale and Yammer, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -39,7 +39,7 @@
* particular nanosecond, if the collision buffer exceeds, newly added values are thrown away.
*
* @param <V> The type of values to store in this sliding window reservoir
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
* @see <pre><a href="https://github.com/dropwizard/metrics/blob/master/metrics-core/src/main/java/io/dropwizard/metrics
* /SlidingTimeWindowReservoir.java">Dropwizard's
* Metrics SlidingTimeWindowReservoir</a></pre>
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/AbstractTimeSnapshot.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/AbstractTimeSnapshot.java
index 165820a..d2699b6 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/AbstractTimeSnapshot.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/AbstractTimeSnapshot.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright 2010, 2013 Coda Hale and Yammer, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +22,7 @@
/**
* Base implementation of {@code UniformTimeSnapshot}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public abstract class AbstractTimeSnapshot implements UniformTimeSnapshot {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/ReservoirConstants.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/ReservoirConstants.java
index fb70501..a161fdc 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/ReservoirConstants.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/ReservoirConstants.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
/**
* The constants that determine the behaviour of sliding windows and their trimmers.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public final class ReservoirConstants {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/SlidingWindowTrimmer.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/SlidingWindowTrimmer.java
index feb6cf8..0eab416 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/SlidingWindowTrimmer.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/SlidingWindowTrimmer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright 2010, 2013 Coda Hale and Yammer, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +22,7 @@
/**
* The trimmer of an associated sliding window.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public interface SlidingWindowTrimmer<V> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/TimeReservoir.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/TimeReservoir.java
index 1dd0948..9a26f9f 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/TimeReservoir.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/TimeReservoir.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright 2010, 2013 Coda Hale and Yammer, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,7 @@
* Compared to Dropwizard Reservoir, this interface adds a possibility to work with data that is associated with a specific
* time. It may not be possible; however, to obtain a snapshot or size at some moment in past due to performance optimizations.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
* @see <a href="https://github.com/dropwizard/metrics">https://github.com/dropwizard/metrics</a>
*/
public interface TimeReservoir<V> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeReservoir.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeReservoir.java
index 747d30d..1833821 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeReservoir.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeReservoir.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright 2010, 2013 Coda Hale and Yammer, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,7 +28,7 @@
* A random sampling reservoir of a stream of {@code long}s. Uses Vitter's Algorithm R to produce a statistically representative
* sample.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
* @author Dropwizard Team
* @see <a href="http://www.cs.umd.edu/~samir/498/vitter.pdf">Random Sampling with a Reservoir</a>
* @see <a href="https://github.com/dropwizard/metrics">https://github.com/dropwizard/metrics</a>
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeSnapshot.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeSnapshot.java
index c4585f7..081bdcd 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeSnapshot.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeSnapshot.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright 2010, 2013 Coda Hale and Yammer, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +22,7 @@
/**
* A statistical snapshot of a {@link UniformTimeSnapshot}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
* @author Dropwizard Team
* @see <a href="https://github.com/dropwizard/metrics">https://github.com/dropwizard/metrics</a>
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeValuesSnapshot.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeValuesSnapshot.java
index 07ac539..36fdab2 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeValuesSnapshot.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/monitoring/core/UniformTimeValuesSnapshot.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright 2010, 2013 Coda Hale and Yammer, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,7 @@
/**
* A statistical snapshot of a {@link UniformTimeValuesSnapshot}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
* @author Dropwizard Team
* @see <a href="https://github.com/dropwizard/metrics">https://github.com/dropwizard/metrics</a>
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/DefaultCloseableService.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/DefaultCloseableService.java
index 611ff04..57819c4 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/DefaultCloseableService.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/DefaultCloseableService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,7 +33,7 @@
* This implementation stores instances of {@code Closeable} in an internal identity hash set and makes sure
* that the close method is invoked at most once.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class DefaultCloseableService implements CloseableService {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/DefaultRespondingContext.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/DefaultRespondingContext.java
index c7c4846..3a21b1d 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/DefaultRespondingContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/DefaultRespondingContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -27,7 +27,7 @@
* Default implementation of the request-scoped
* {@link org.glassfish.jersey.server.internal.process.RespondingContext responding context}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class DefaultRespondingContext implements RespondingContext {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/Endpoint.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/Endpoint.java
index dce1890..50760d9 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/Endpoint.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/Endpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
/**
* Server-side REST-ful endpoint.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Endpoint extends Inflector<RequestProcessingContext, ContainerResponse> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/MappableException.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/MappableException.java
index 6efa627..2105b94 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/MappableException.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/MappableException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -27,7 +27,7 @@
* provides an appropriate {@link javax.ws.rs.core.Response} instance.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class MappableException extends ProcessingException {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/ReferencesInitializer.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/ReferencesInitializer.java
index 1006652..26ead31 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/ReferencesInitializer.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/ReferencesInitializer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
/**
* Request/response scoped injection support initialization stage.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class ReferencesInitializer implements Function<RequestProcessingContext, RequestProcessingContext> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RequestProcessingConfigurator.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RequestProcessingConfigurator.java
index 87e6d02..d084621 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RequestProcessingConfigurator.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RequestProcessingConfigurator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -115,7 +115,7 @@
/**
* Defines server-side request processing injection bindings.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
private class ServerProcessingBinder extends AbstractBinder {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RequestProcessingContext.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RequestProcessingContext.java
index 0e0d1d9..5403aaf 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RequestProcessingContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RequestProcessingContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -40,7 +40,7 @@
*
* Serves as a hub for all request processing related information and is being passed between stages.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
// TODO replace also ContainerResponse in stages with this guy.
public final class RequestProcessingContext implements RespondingContext {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RespondingContext.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RespondingContext.java
index 1fa3015..45670db 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RespondingContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/RespondingContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -27,7 +27,7 @@
* processing stages and/or functions that will be invoked during the response processing
* to transform the response before it is written to the client.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface RespondingContext {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/SecurityContextInjectee.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/SecurityContextInjectee.java
index ba3ad7e..87ce07a 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/process/SecurityContextInjectee.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/process/SecurityContextInjectee.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -40,7 +40,7 @@
* object if the the object changes in the meantime.
* <p/>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
class SecurityContextInjectee implements SecurityContext {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MatchResultInitializerRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MatchResultInitializerRouter.java
index 49843f6..690204d 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MatchResultInitializerRouter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MatchResultInitializerRouter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -22,7 +22,7 @@
* Request matching bootstrapping stage that pushes the whole request path to the routing
* context as a right-hand path to be matched.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class MatchResultInitializerRouter implements Router {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MatchedEndpointExtractorStage.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MatchedEndpointExtractorStage.java
index b009be6..84dd3d3 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MatchedEndpointExtractorStage.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MatchedEndpointExtractorStage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
* This request pre-processing stage should be a final stage in the request
* processing chain.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see RoutingStage
*/
final class MatchedEndpointExtractorStage implements Stage<RequestProcessingContext> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodRouting.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodRouting.java
index ef05b06..44deca0 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodRouting.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodRouting.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +24,7 @@
/**
* A combination of a resource method model and the corresponding routers.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class MethodRouting {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java
index 0a7fa44..470f2a5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/MethodSelectingRouter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -43,6 +43,9 @@
import javax.ws.rs.core.Response.Status;
import org.glassfish.jersey.internal.guava.Primitives;
+import org.glassfish.jersey.internal.routing.ContentTypeDeterminer;
+import org.glassfish.jersey.internal.routing.CombinedMediaType;
+import org.glassfish.jersey.internal.routing.RequestSpecificConsumesProducesAcceptor;
import org.glassfish.jersey.message.MessageBodyWorkers;
import org.glassfish.jersey.message.ReaderModel;
import org.glassfish.jersey.message.WriterModel;
@@ -64,10 +67,10 @@
* method name, requested media type as well as defined resource method media type
* capabilities.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
-final class MethodSelectingRouter implements Router {
+final class MethodSelectingRouter extends ContentTypeDeterminer implements Router {
private static final Logger LOGGER = Logger.getLogger(MethodSelectingRouter.class.getName());
@@ -109,8 +112,6 @@
}
};
- private final MessageBodyWorkers workers;
-
private final Map<String, List<ConsumesProducesAcceptor>> consumesProducesAcceptors;
private final Router router;
@@ -124,7 +125,7 @@
* @param methodRoutings [method model, method methodAcceptorPair] pairs.
*/
MethodSelectingRouter(MessageBodyWorkers workers, List<MethodRouting> methodRoutings) {
- this.workers = workers;
+ super(workers);
this.consumesProducesAcceptors = new HashMap<>();
@@ -155,6 +156,10 @@
}
}
+ Set<String> getHttpMethods() {
+ return consumesProducesAcceptors.keySet();
+ }
+
/**
* Represents a 1-1-1 relation between input and output media type and an methodAcceptorPair.
* <p>E.g. for a single resource method
@@ -253,72 +258,25 @@
}
/**
- * The same as above ConsumesProducesAcceptor,
- * only concrete request content-type and accept header info is included in addition.
- *
- * @see CombinedMediaType
- */
- @SuppressWarnings("ComparableImplementedButEqualsNotOverridden")
- private static final class RequestSpecificConsumesProducesAcceptor implements Comparable {
-
- final CombinedMediaType consumes;
- final CombinedMediaType produces;
- final MethodRouting methodRouting;
-
- final boolean producesFromProviders;
-
- RequestSpecificConsumesProducesAcceptor(final CombinedMediaType consumes,
- final CombinedMediaType produces,
- final boolean producesFromProviders,
- final MethodRouting methodRouting) {
-
- this.methodRouting = methodRouting;
- this.consumes = consumes;
- this.produces = produces;
-
- this.producesFromProviders = producesFromProviders;
- }
-
- @Override
- public String toString() {
- return String.format("%s->%s:%s", consumes, produces, methodRouting);
- }
-
- @Override
- public int compareTo(Object o) {
- if (o == null) {
- return -1;
- }
- if (!(o instanceof RequestSpecificConsumesProducesAcceptor)) {
- return -1;
- }
- RequestSpecificConsumesProducesAcceptor other = (RequestSpecificConsumesProducesAcceptor) o;
- final int consumedComparison = CombinedMediaType.COMPARATOR.compare(consumes, other.consumes);
- return (consumedComparison != 0)
- ? consumedComparison : CombinedMediaType.COMPARATOR.compare(produces, other.produces);
- }
- }
-
- /**
* Helper class to select matching resource method to be invoked.
*/
private static class MethodSelector {
- RequestSpecificConsumesProducesAcceptor selected;
+ RequestSpecificConsumesProducesAcceptor<MethodRouting> selected;
List<RequestSpecificConsumesProducesAcceptor> sameFitnessAcceptors;
- MethodSelector(RequestSpecificConsumesProducesAcceptor i) {
+ MethodSelector(RequestSpecificConsumesProducesAcceptor<MethodRouting> i) {
selected = i;
sameFitnessAcceptors = null;
}
- void consider(RequestSpecificConsumesProducesAcceptor i) {
+ void consider(RequestSpecificConsumesProducesAcceptor<MethodRouting> i) {
final int theLessTheBetter = i.compareTo(selected);
if (theLessTheBetter < 0) {
selected = i;
sameFitnessAcceptors = null;
} else {
- if (theLessTheBetter == 0 && (selected.methodRouting != i.methodRouting)) {
+ if (theLessTheBetter == 0 && (selected.getMethodRouting() != i.getMethodRouting())) {
getSameFitnessList().add(i);
}
}
@@ -463,7 +421,7 @@
differentInvokableMethods.size() == 1);
if (methodSelector.selected != null) {
- final RequestSpecificConsumesProducesAcceptor selected = methodSelector.selected;
+ final RequestSpecificConsumesProducesAcceptor<MethodRouting> selected = methodSelector.selected;
if (methodSelector.sameFitnessAcceptors != null) {
reportMethodSelectionAmbiguity(acceptableMediaTypes, methodSelector.selected,
@@ -499,7 +457,7 @@
return responseContext;
}
});
- return selected.methodRouting.routers;
+ return selected.getMethodRouting().routers;
}
throw new NotAcceptableException();
@@ -518,15 +476,15 @@
private MediaType determineResponseMediaType(
final Class<?> entityClass,
final Type entityType,
- final RequestSpecificConsumesProducesAcceptor selectedMethod,
+ final RequestSpecificConsumesProducesAcceptor<MethodRouting> selectedMethod,
final List<AcceptableMediaType> acceptableMediaTypes) {
// Return pre-selected MediaType.
if (usePreSelectedMediaType(selectedMethod, acceptableMediaTypes)) {
- return selectedMethod.produces.combinedType;
+ return selectedMethod.getProduces().getCombinedType();
}
- final ResourceMethod resourceMethod = selectedMethod.methodRouting.method;
+ final ResourceMethod resourceMethod = selectedMethod.getMethodRouting().method;
final Invocable invocable = resourceMethod.getInvocable();
// Entity class can be null when considering HEAD method || empty entity.
@@ -536,65 +494,16 @@
// Media types producible by method.
final List<MediaType> methodProducesTypes = !resourceMethod.getProducedTypes().isEmpty()
? resourceMethod.getProducedTypes() : Collections.singletonList(MediaType.WILDCARD_TYPE);
- // Applicable entity providers
- final List<WriterModel> writersForEntityType = workers.getWritersModelsForType(responseEntityClass);
- CombinedMediaType selected = null;
- for (final MediaType acceptableMediaType : acceptableMediaTypes) {
- for (final MediaType methodProducesType : methodProducesTypes) {
- if (!acceptableMediaType.isCompatible(methodProducesType)) {
- // no need to go deeper if acceptable and method produces type are incompatible
- continue;
- }
-
- // Use writers suitable for entity class to determine the media type.
- for (final WriterModel model : writersForEntityType) {
- for (final MediaType writerProduces : model.declaredTypes()) {
- if (!writerProduces.isCompatible(acceptableMediaType)
- || !methodProducesType.isCompatible(writerProduces)) {
- continue;
- }
-
- final CombinedMediaType.EffectiveMediaType effectiveProduces =
- new CombinedMediaType.EffectiveMediaType(
- MediaTypes.mostSpecific(methodProducesType, writerProduces),
- false);
-
- final CombinedMediaType candidate =
- CombinedMediaType.create(acceptableMediaType, effectiveProduces);
-
- if (candidate != CombinedMediaType.NO_MATCH) {
- // Look for a better compatible worker.
- if (selected == null || CombinedMediaType.COMPARATOR.compare(candidate, selected) < 0) {
- if (model.isWriteable(
- responseEntityClass,
- entityType,
- handlingMethod.getDeclaredAnnotations(),
- candidate.combinedType)) {
- selected = candidate;
- }
- }
- }
- }
- }
- }
- }
-
- // Found media type for current writer.
- if (selected != null) {
- return selected.combinedType;
- }
-
- // If the media type couldn't be determined, choose pre-selected one and wait whether interceptors change the mediaType
- // so it can be written.
- return selectedMethod.produces.combinedType;
+ return super.determineResponseMediaType(responseEntityClass, entityType, selectedMethod, acceptableMediaTypes,
+ methodProducesTypes, handlingMethod.getDeclaredAnnotations());
}
- private static boolean usePreSelectedMediaType(final RequestSpecificConsumesProducesAcceptor selectedMethod,
+ private static boolean usePreSelectedMediaType(final RequestSpecificConsumesProducesAcceptor<MethodRouting> selectedMethod,
final List<AcceptableMediaType> acceptableMediaTypes) {
// Resource method is annotated with @Produces and this annotation contains only one MediaType.
- if (!selectedMethod.producesFromProviders
- && selectedMethod.methodRouting.method.getProducedTypes().size() == 1) {
+ if (!selectedMethod.producesFromProviders()
+ && selectedMethod.getMethodRouting().method.getProducedTypes().size() == 1) {
return true;
}
@@ -603,8 +512,8 @@
return acceptableMediaTypes.size() == 1 && !MediaTypes.isWildcard(acceptableMediaTypes.get(0));
}
- private boolean isWriteable(final RequestSpecificConsumesProducesAcceptor candidate) {
- final Invocable invocable = candidate.methodRouting.method.getInvocable();
+ private boolean isWriteable(final RequestSpecificConsumesProducesAcceptor<MethodRouting> candidate) {
+ final Invocable invocable = candidate.getMethodRouting().method.getInvocable();
final Class<?> responseType = Primitives.wrap(invocable.getRawRoutingResponseType());
if (Response.class.isAssignableFrom(responseType)
@@ -622,7 +531,7 @@
responseType,
genericReturnType,
invocable.getHandlingMethod().getDeclaredAnnotations(),
- candidate.produces.combinedType)) {
+ candidate.getProduces().getCombinedType())) {
return true;
}
}
@@ -630,8 +539,8 @@
return false;
}
- private boolean isReadable(final RequestSpecificConsumesProducesAcceptor candidate) {
- final Invocable invocable = candidate.methodRouting.method.getInvocable();
+ private boolean isReadable(final RequestSpecificConsumesProducesAcceptor<MethodRouting> candidate) {
+ final Invocable invocable = candidate.getMethodRouting().method.getInvocable();
final Method handlingMethod = invocable.getHandlingMethod();
final Parameter entityParam = getEntityParam(invocable);
@@ -645,7 +554,7 @@
entityType,
entityParam.getType(),
handlingMethod.getDeclaredAnnotations(),
- candidate.consumes.combinedType)) {
+ candidate.getConsumes().getCombinedType())) {
return true;
}
}
@@ -684,7 +593,8 @@
if (produces != CombinedMediaType.NO_MATCH) {
final CombinedMediaType consumes =
CombinedMediaType.create(effectiveContentType, satisfiable.consumes);
- final RequestSpecificConsumesProducesAcceptor candidate = new RequestSpecificConsumesProducesAcceptor(
+ final RequestSpecificConsumesProducesAcceptor<MethodRouting> candidate =
+ new RequestSpecificConsumesProducesAcceptor<>(
consumes,
produces,
satisfiable.produces.isDerived(),
@@ -696,7 +606,7 @@
} else if (candidate.compareTo(method.selected) < 0) {
// Candidate is better than the previous one.
if (method.selected == null
- || candidate.methodRouting.method != method.selected.methodRouting.method) {
+ || candidate.getMethodRouting().method != method.selected.getMethodRouting().method) {
// No candidate so far or better candidate.
if (isReadable(candidate) && isWriteable(candidate)) {
method.consider(candidate);
@@ -716,19 +626,19 @@
}
private void reportMethodSelectionAmbiguity(List<AcceptableMediaType> acceptableTypes,
- RequestSpecificConsumesProducesAcceptor selected,
+ RequestSpecificConsumesProducesAcceptor<MethodRouting> selected,
List<RequestSpecificConsumesProducesAcceptor> sameFitnessAcceptors) {
if (LOGGER.isLoggable(Level.WARNING)) {
StringBuilder msgBuilder =
new StringBuilder(LocalizationMessages.AMBIGUOUS_RESOURCE_METHOD(acceptableTypes)).append('\n');
- msgBuilder.append('\t').append(selected.methodRouting.method).append('\n');
+ msgBuilder.append('\t').append(selected.getMethodRouting().method).append('\n');
final Set<ResourceMethod> reportedMethods = new HashSet<>();
- reportedMethods.add(selected.methodRouting.method);
- for (RequestSpecificConsumesProducesAcceptor i : sameFitnessAcceptors) {
- if (!reportedMethods.contains(i.methodRouting.method)) {
- msgBuilder.append('\t').append(i.methodRouting.method).append('\n');
+ reportedMethods.add(selected.getMethodRouting().method);
+ for (RequestSpecificConsumesProducesAcceptor<MethodRouting> i : sameFitnessAcceptors) {
+ if (!reportedMethods.contains(i.getMethodRouting().method)) {
+ msgBuilder.append('\t').append(i.getMethodRouting().method).append('\n');
}
- reportedMethods.add(i.methodRouting.method);
+ reportedMethods.add(i.getMethodRouting().method);
}
LOGGER.log(Level.WARNING, msgBuilder.toString());
}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathMatchingRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathMatchingRouter.java
index feb1fe2..be56247 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathMatchingRouter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathMatchingRouter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
* Matches the un-matched right-hand request path to the configured collection of path pattern matching routes.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class PathMatchingRouter implements Router {
@@ -56,19 +56,31 @@
tracingLogger.log(ServerTraceEvent.MATCH_PATH_FIND, path);
Router.Continuation result = null;
+ MatchResult matchResultCandidate = null;
+ Route acceptedRouteCandidate = null;
+
final Iterator<Route> iterator = acceptedRoutes.iterator();
while (iterator.hasNext()) {
final Route acceptedRoute = iterator.next();
final PathPattern routePattern = acceptedRoute.routingPattern();
- final MatchResult m = routePattern.match(path);
- if (m != null) {
- // Push match result information and rest of path to match
- rc.pushMatchResult(m);
- result = Router.Continuation.of(context, acceptedRoute.next());
-
- //tracing
- tracingLogger.log(ServerTraceEvent.MATCH_PATH_SELECTED, routePattern.getRegex());
- break;
+ final MatchResult matchResult = routePattern.match(path);
+ if (matchResult != null) {
+ if (isLocator(acceptedRoute) && matchResultCandidate != null) {
+ // acceptedRoute matches the path but it is a locator
+ // sub-resource locator shall not be found by the Spec if sub-resource was found first
+ // need to use the sub-resource to return correct HTTP Status
+ // TODO configuration option not to fail and continue with acceptedRoute locator?
+ result = matchPathSelected(context, acceptedRouteCandidate, matchResultCandidate, tracingLogger);
+ break;
+ } else if (isLocator(acceptedRoute) || designatorMatch(acceptedRoute, context)) {
+ result = matchPathSelected(context, acceptedRoute, matchResult, tracingLogger);
+ break;
+ } else if (matchResultCandidate == null) {
+ // store the first matched candidate with unmatched method designator
+ // maybe there won't be a better sub-resource
+ matchResultCandidate = matchResult;
+ acceptedRouteCandidate = acceptedRoute;
+ }
} else {
tracingLogger.log(ServerTraceEvent.MATCH_PATH_NOT_MATCHED, routePattern.getRegex());
}
@@ -80,6 +92,11 @@
}
}
+ if (result == null && acceptedRouteCandidate != null) {
+ //method designator mismatched, but still go the route to get the proper status code
+ result = matchPathSelected(context, acceptedRouteCandidate, matchResultCandidate, tracingLogger);
+ }
+
if (result == null) {
// No match
return Router.Continuation.of(context);
@@ -87,4 +104,35 @@
return result;
}
+
+ private Router.Continuation matchPathSelected(final RequestProcessingContext context, final Route acceptedRoute,
+ final MatchResult matchResult, final TracingLogger tracingLogger) {
+ // Push match result information and rest of path to match
+ context.routingContext().pushMatchResult(matchResult);
+ final Router.Continuation result = Router.Continuation.of(context, acceptedRoute.next());
+
+ // tracing
+ tracingLogger.log(ServerTraceEvent.MATCH_PATH_SELECTED, acceptedRoute.routingPattern().getRegex());
+
+ return result;
+ }
+
+ /**
+ * Return {@code true} iff the sub-resource method designator does match the request http method designator
+ * @param route current route representing resource method / locator
+ * @param context Contains Request to check the http method
+ * @return false if method designator does not match
+ */
+ private static boolean designatorMatch(final Route route, final RequestProcessingContext context) {
+ final String httpMethod = context.request().getMethod();
+
+ if (route.getHttpMethods().contains(httpMethod)) {
+ return true;
+ }
+ return ("HEAD".equals(httpMethod) && route.getHttpMethods().contains("GET"));
+ }
+
+ private static boolean isLocator(final Route route) {
+ return route.getHttpMethods() == null;
+ }
}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathMatchingRouterBuilder.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathMatchingRouterBuilder.java
index f18e1c7..1eebab9 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathMatchingRouterBuilder.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathMatchingRouterBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,11 +22,10 @@
import org.glassfish.jersey.uri.PathPattern;
/**
- /**
* A request path pattern matching router hierarchy builder entry point.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class PathMatchingRouterBuilder implements PathToRouterBuilder {
@@ -66,13 +65,16 @@
@Override
public PathMatchingRouterBuilder to(final Router router) {
+ if (MethodSelectingRouter.class.isInstance(router)) {
+ acceptedRoutes.get(acceptedRoutes.size() - 1).setHttpMethods(((MethodSelectingRouter) router).getHttpMethods());
+ }
currentRouters.add(router);
return this;
}
/**
* Complete the currently built unfinished sub-route (if any) and start building a new one.
- *
+ * <p>
* The completed sub-route is added to the list of the routes accepted by the router that is being built.
*
* @param pattern routing pattern for the new sub-route.
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathToRouterBuilder.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathToRouterBuilder.java
index fda0382..1a2b060 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathToRouterBuilder.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PathToRouterBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +24,7 @@
* processing context will be serially routed to all the child routers attached to the routing pattern using this
* routing completion builder.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@SuppressWarnings("ClassReferencesSubclass")
interface PathToRouterBuilder {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PushMatchedUriRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PushMatchedUriRouter.java
index 6a4683e..ae66432 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PushMatchedUriRouter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PushMatchedUriRouter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
* Terminal router that pushes the URI matched so far to the stack returned
* by {@link javax.ws.rs.core.UriInfo#getMatchedURIs()} method.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class PushMatchedUriRouter implements Router {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PushMethodHandlerRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PushMethodHandlerRouter.java
index 8cd4f66..088f692 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PushMethodHandlerRouter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/PushMethodHandlerRouter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
* Terminal router that pushes the matched method's handler instance to the stack
* returned by {@link javax.ws.rs.core.UriInfo#getMatchedResources()} method.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class PushMethodHandlerRouter implements Router {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Route.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Route.java
index 2a89655..5ac7ae0 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Route.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Route.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -17,6 +17,7 @@
package org.glassfish.jersey.server.internal.routing;
import java.util.List;
+import java.util.Set;
import org.glassfish.jersey.uri.PathPattern;
@@ -25,12 +26,14 @@
* and a {@link #next() list of next-level stages} to be processed in case the
* routing pattern successfully matches the un-matched right-hand part of the request.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class Route {
private final PathPattern routingPattern;
private final List<Router> routers;
+ private Set<String> httpMethods;
+
/**
* Create a new request route.
*
@@ -68,4 +71,12 @@
public List<Router> next() {
return routers;
}
+
+ Set<String> getHttpMethods() {
+ return httpMethods;
+ }
+
+ void setHttpMethods(Set<String> httpMethods) {
+ this.httpMethods = httpMethods;
+ }
}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Router.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Router.java
index 18d5767..500aa91 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Router.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Router.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -25,7 +25,7 @@
* structures. Each routing tree can be executed using a dedicated
* {@link RoutingStage routing stage}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
interface Router {
/**
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Routers.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Routers.java
index 49940c1..0f29a55 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Routers.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Routers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
/**
* Routing tree assembly utilities.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class Routers {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Routing.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Routing.java
index 169d708..b5203cc 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Routing.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/Routing.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -35,7 +35,7 @@
/**
* Jersey routing entry point.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class Routing {
private Routing() {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RoutingContext.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RoutingContext.java
index fc5921e..73895a3 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RoutingContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RoutingContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
/**
* Jersey request matching and routing context.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
*/
public interface RoutingContext extends ResourceInfo, ExtendedUriInfo {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RoutingStage.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RoutingStage.java
index d0d610a..f8716b7 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RoutingStage.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RoutingStage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
* Once the routing is finished, an endpoint (if matched) is
* {@link RoutingContext#setEndpoint stored in the routing context}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see MatchedEndpointExtractorStage
*/
final class RoutingStage extends AbstractChainableStage<RequestProcessingContext> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RuntimeModelBuilder.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RuntimeModelBuilder.java
index 4a29b3f..3c2719e 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RuntimeModelBuilder.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/RuntimeModelBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -44,7 +44,7 @@
* This is a common base for root resource and sub-resource runtime model
* builder.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav Fuksa
*/
final class RuntimeModelBuilder {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/SingleMatchResult.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/SingleMatchResult.java
index 582d66e..bfb23db 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/SingleMatchResult.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/SingleMatchResult.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +24,7 @@
* matching group with group index 0 (the one containing the whole expression).
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
final class SingleMatchResult implements MatchResult {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/SubResourceLocatorRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/SubResourceLocatorRouter.java
index 290b173..c0c2e54 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/SubResourceLocatorRouter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/SubResourceLocatorRouter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -48,7 +48,7 @@
* Finally the generated methodAcceptorPair is invoked to return the request methodAcceptorPair chain.
* <p/>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
* @author Miroslav Fuksa
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/UriRoutingContext.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/UriRoutingContext.java
index a6214d3..fd29b34 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/UriRoutingContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/UriRoutingContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -49,7 +49,7 @@
/**
* Default implementation of the routing context as well as URI information provider.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UriRoutingContext implements RoutingContext {
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 56686b5..26b1f29 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, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,9 @@
import jersey.repackaged.org.objectweb.asm.ClassVisitor;
import jersey.repackaged.org.objectweb.asm.FieldVisitor;
import jersey.repackaged.org.objectweb.asm.MethodVisitor;
+import jersey.repackaged.org.objectweb.asm.ModuleVisitor;
import jersey.repackaged.org.objectweb.asm.Opcodes;
+import jersey.repackaged.org.objectweb.asm.TypePath;
/**
* A scanner listener that processes Java class files (resource names
@@ -164,7 +166,7 @@
private boolean isAnnotated;
private AnnotatedClassVisitor() {
- super(Opcodes.ASM5);
+ super(Opcodes.ASM7);
}
public void visit(final int version, final int access, final String name,
@@ -228,6 +230,25 @@
return null;
}
+ public ModuleVisitor visitModule(final String name, final int access, final String version) {
+ // Do nothing
+ return null;
+ }
+
+ public void visitNestHost(final String nestHost) {
+ // do nothing
+ }
+
+ public void visitNestMember(final String nestMember) {
+ // do nothing
+ }
+
+ public AnnotationVisitor visitTypeAnnotation(
+ final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
+ //do nothing
+ return null;
+ }
+
private Class getClassForName(final String className) {
try {
final OsgiRegistry osgiRegistry = ReflectionHelper.getOsgiRegistryInstance();
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/BundleSchemeResourceFinderFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/BundleSchemeResourceFinderFactory.java
index 6087f5b..0d12153 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/BundleSchemeResourceFinderFactory.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/BundleSchemeResourceFinderFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
/**
* Preparations for OSGi support.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
final class BundleSchemeResourceFinderFactory implements UriSchemeResourceFinderFactory {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/CompositeResourceFinder.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/CompositeResourceFinder.java
index 1707370..e914a7c 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/CompositeResourceFinder.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/CompositeResourceFinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -33,7 +33,7 @@
* <p/>
* Used to combine various finders into one instance.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public final class CompositeResourceFinder extends AbstractResourceFinderAdapter {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/PackageNamesScanner.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/PackageNamesScanner.java
index 59ad37e..825c0c6 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/PackageNamesScanner.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/PackageNamesScanner.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -60,7 +60,7 @@
* and package scanning deployment will fail.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class PackageNamesScanner extends AbstractResourceFinderAdapter {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/ResourceProcessor.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/ResourceProcessor.java
index f56fc2c..5f359e5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/ResourceProcessor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/ResourceProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
/**
* Processes resources found by {@link org.glassfish.jersey.server.ResourceFinder}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public interface ResourceProcessor {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/sonar/SonarJerseyServer.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/sonar/SonarJerseyServer.java
index fead277..a5adae5 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/sonar/SonarJerseyServer.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/sonar/SonarJerseyServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +20,7 @@
* The purpose of this class is to verify the reported test coverage shows correct results in various modes of test executions.
* For further details, see javadoc bellow.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class SonarJerseyServer {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/AnnotatedMethod.java b/core-server/src/main/java/org/glassfish/jersey/server/model/AnnotatedMethod.java
index db91b50..7ffc416 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/AnnotatedMethod.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/AnnotatedMethod.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -16,336 +16,15 @@
package org.glassfish.jersey.server.model;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.security.AccessController;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.Encoded;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.MatrixParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-
-import org.glassfish.jersey.internal.util.ReflectionHelper;
/**
* Annotated method representation.
*
* @author Paul Sandoz
*/
-public final class AnnotatedMethod implements AnnotatedElement {
-
- @SuppressWarnings("unchecked")
- private static final Set<Class<? extends Annotation>> METHOD_META_ANNOTATIONS = getSet(
- HttpMethod.class);
- @SuppressWarnings("unchecked")
- private static final Set<Class<? extends Annotation>> METHOD_ANNOTATIONS = getSet(
- Path.class,
- Produces.class,
- Consumes.class);
- @SuppressWarnings("unchecked")
- private static final Set<Class<? extends Annotation>> PARAMETER_ANNOTATIONS = getSet(
- Context.class,
- Encoded.class,
- DefaultValue.class,
- MatrixParam.class,
- QueryParam.class,
- CookieParam.class,
- HeaderParam.class,
- PathParam.class,
- FormParam.class);
-
- @SafeVarargs
- private static Set<Class<? extends Annotation>> getSet(final Class<? extends Annotation>... cs) {
- final Set<Class<? extends Annotation>> s = new HashSet<>();
- s.addAll(Arrays.asList(cs));
- return s;
- }
-
- private final Method m;
- private final Method am;
- private final Annotation[] methodAnnotations;
- private final Annotation[][] parameterAnnotations;
-
- /**
- * Create annotated method instance from the {@link Method Java method}.
- *
- * @param method Java method.
- */
- public AnnotatedMethod(final Method method) {
- this.m = method;
- this.am = findAnnotatedMethod(method);
-
- if (method.equals(am)) {
- methodAnnotations = method.getAnnotations();
- parameterAnnotations = method.getParameterAnnotations();
- } else {
- methodAnnotations = mergeMethodAnnotations(method, am);
- parameterAnnotations = mergeParameterAnnotations(method, am);
- }
- }
-
- /**
- * Get the underlying Java method.
- *
- * @return the underlying Java method.
- */
- public Method getMethod() {
- return am;
- }
-
- /**
- * Get the underlying declared Java method. This method overrides or is the same as the one retrieved by {@code getMethod}.
- *
- * @return the underlying declared Java method.
- */
- Method getDeclaredMethod() {
- return m;
- }
-
- /**
- * Get method parameter annotations.
- *
- * @return method parameter annotations.
- */
- public Annotation[][] getParameterAnnotations() {
- return parameterAnnotations.clone();
- }
-
- /**
- * Get method parameter types.
- *
- * See also {@link Method#getParameterTypes()}.
- *
- * @return method parameter types.
- */
- public Class<?>[] getParameterTypes() {
- return am.getParameterTypes();
- }
-
- /**
- * Get method type parameters.
- *
- * See also {@link Method#getTypeParameters()}.
- *
- * @return method type parameters.
- */
- @SuppressWarnings("UnusedDeclaration")
- public TypeVariable<Method>[] getTypeParameters() {
- return am.getTypeParameters();
- }
-
- /**
- * Get generic method parameter types.
- *
- * See also {@link Method#getGenericParameterTypes()}.
- *
- * @return generic method parameter types.
- */
- public Type[] getGenericParameterTypes() {
- return am.getGenericParameterTypes();
- }
-
- /**
- * Get all instances of the specified meta-annotation type found on the method
- * annotations.
- *
- * @param <T> meta-annotation type.
- * @param annotation meta-annotation class to be searched for.
- * @return meta-annotation instances of a given type annotating the method
- * annotations.
- */
- public <T extends Annotation> List<T> getMetaMethodAnnotations(
- final Class<T> annotation) {
- final List<T> ma = new ArrayList<>();
- for (final Annotation a : methodAnnotations) {
- final T metaAnnotation = a.annotationType().getAnnotation(annotation);
- if (metaAnnotation != null) {
- ma.add(metaAnnotation);
- }
- }
-
- return ma;
- }
-
- @Override
- public String toString() {
- return m.toString();
- }
-
- // AnnotatedElement
- @Override
- public boolean isAnnotationPresent(final Class<? extends Annotation> annotationType) {
- for (final Annotation ma : methodAnnotations) {
- if (ma.annotationType() == annotationType) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public <T extends Annotation> T getAnnotation(final Class<T> annotationType) {
- for (final Annotation ma : methodAnnotations) {
- if (ma.annotationType() == annotationType) {
- return annotationType.cast(ma);
- }
- }
- return am.getAnnotation(annotationType);
- }
-
- @Override
- public Annotation[] getAnnotations() {
- return methodAnnotations.clone();
- }
-
- @Override
- public Annotation[] getDeclaredAnnotations() {
- return getAnnotations();
- }
-
- private static Annotation[] mergeMethodAnnotations(final Method m, final Method am) {
- final List<Annotation> al = asList(m.getAnnotations());
- for (final Annotation a : am.getAnnotations()) {
- if (!m.isAnnotationPresent(a.getClass())) {
- al.add(a);
- }
- }
-
- return al.toArray(new Annotation[al.size()]);
- }
-
- private static Annotation[][] mergeParameterAnnotations(final Method m, final Method am) {
- final Annotation[][] methodParamAnnotations = m.getParameterAnnotations();
- final Annotation[][] annotatedMethodParamAnnotations = am.getParameterAnnotations();
-
- final List<List<Annotation>> methodParamAnnotationsList = new ArrayList<>();
- for (int i = 0; i < methodParamAnnotations.length; i++) {
- final List<Annotation> al = asList(methodParamAnnotations[i]);
- for (final Annotation a : annotatedMethodParamAnnotations[i]) {
- if (annotationNotInList(a.getClass(), al)) {
- al.add(a);
- }
- }
- methodParamAnnotationsList.add(al);
- }
-
- final Annotation[][] mergedAnnotations = new Annotation[methodParamAnnotations.length][];
- for (int i = 0; i < methodParamAnnotations.length; i++) {
- final List<Annotation> paramAnnotations = methodParamAnnotationsList.get(i);
- mergedAnnotations[i] = paramAnnotations.toArray(new Annotation[paramAnnotations.size()]);
- }
-
- return mergedAnnotations;
- }
-
- private static boolean annotationNotInList(final Class<? extends Annotation> ca, final List<Annotation> la) {
- for (final Annotation a : la) {
- if (ca == a.getClass()) {
- return false;
- }
- }
- return true;
- }
-
- private static Method findAnnotatedMethod(final Method m) {
- final Method am = findAnnotatedMethod(m.getDeclaringClass(), m);
- return (am != null) ? am : m;
- }
-
- private static Method findAnnotatedMethod(final Class<?> c, Method m) {
- if (c == Object.class) {
- return null;
- }
-
- m = AccessController.doPrivileged(ReflectionHelper.findMethodOnClassPA(c, m));
- if (m == null) {
- return null;
- }
-
- if (hasAnnotations(m)) {
- return m;
- }
-
- // Super classes take precedence over interfaces
- final Class<?> sc = c.getSuperclass();
- if (sc != null && sc != Object.class) {
- final Method sm = findAnnotatedMethod(sc, m);
- if (sm != null) {
- return sm;
- }
- }
-
- for (final Class<?> ic : c.getInterfaces()) {
- final Method im = findAnnotatedMethod(ic, m);
- if (im != null) {
- return im;
- }
- }
-
- return null;
- }
-
- private static boolean hasAnnotations(final Method m) {
- return hasMetaMethodAnnotations(m)
- || hasMethodAnnotations(m)
- || hasParameterAnnotations(m);
- }
-
- private static boolean hasMetaMethodAnnotations(final Method m) {
- for (final Class<? extends Annotation> ac : METHOD_META_ANNOTATIONS) {
- for (final Annotation a : m.getAnnotations()) {
- if (a.annotationType().getAnnotation(ac) != null) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- private static boolean hasMethodAnnotations(final Method m) {
- for (final Class<? extends Annotation> ac : METHOD_ANNOTATIONS) {
- if (m.isAnnotationPresent(ac)) {
- return true;
- }
- }
-
- return false;
- }
-
- private static boolean hasParameterAnnotations(final Method m) {
- for (final Annotation[] as : m.getParameterAnnotations()) {
- for (final Annotation a : as) {
- if (PARAMETER_ANNOTATIONS.contains(a.annotationType())) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- @SafeVarargs
- private static <T> List<T> asList(final T... ts) {
- final List<T> l = new ArrayList<>();
- l.addAll(Arrays.asList(ts));
- return l;
+public class AnnotatedMethod extends org.glassfish.jersey.model.AnnotatedMethod {
+ public AnnotatedMethod(Method method) {
+ super(method);
}
}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ComponentModelValidator.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ComponentModelValidator.java
index 20f1914..b93b172 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/ComponentModelValidator.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ComponentModelValidator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -49,8 +49,8 @@
* list, the {@link ComponentModelValidator#cleanIssueList()} method should be called.
* <p />
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public final class ComponentModelValidator {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Consuming.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Consuming.java
index 2cbc5c1..2968929 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Consuming.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Consuming.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,8 +26,8 @@
* A component implementing this interface provides additional information about
* the supported consumed {@link MediaType media types}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*
* @see javax.ws.rs.Consumes
* @see Producing
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java b/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java
index 094afa0..5fedb5c 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/HandlerConstructor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,8 +22,8 @@
/**
* Abstraction for a resource handler class constructor.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public final class HandlerConstructor implements Parameterized, ResourceModelComponent {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Inflecting.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Inflecting.java
index a60503a..9595a97 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Inflecting.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Inflecting.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
/**
* Inflector provider resource model component.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class Inflecting<T> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java b/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java
index 239ab9e..71e237c 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/IntrospectionModeller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -53,7 +53,7 @@
/**
* Utility class for constructing resource model from JAX-RS annotated POJO.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
final class IntrospectionModeller {
@@ -183,8 +183,10 @@
method.getGenericParameterTypes()[0],
method.getAnnotations());
if (null != p) {
- ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
+ if (!disableValidation) {
+ ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
InvocableValidator.isSingleton(handlerClass));
+ }
// we do not inject entity parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
@@ -208,8 +210,11 @@
field.getGenericType(),
field.getAnnotations());
if (null != p) {
- ResourceMethodValidator.validateParameter(p, field, field.toGenericString(), field.getName(),
+ if (!disableValidation) {
+ ResourceMethodValidator.validateParameter(p, field, field.toGenericString(), field.getName(),
isInSingleton);
+ }
+
// we do not inject entity and unknown parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
injectableParameters.add(p);
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java
index dca0322..af22f59 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Invocable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -50,7 +50,7 @@
* </p>
*
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see ResourceMethod
* @see org.glassfish.jersey.server.spi.internal.ResourceMethodDispatcher
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java
index f8aea1b..7915a8b 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
/**
* Resource method handler model.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class MethodHandler implements ResourceModelComponent {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java
index 6d8fc06..97853b2 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/MethodList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -33,7 +33,7 @@
* additional method information.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class MethodList implements Iterable<AnnotatedMethod> {
@@ -45,7 +45,7 @@
* The method list contains {@link Class#getMethods() all methods} available
* on the class.
*
- * The {@link Method#isBridge() bridge methods} and methods declared directly
+ * The {@link Method#isSynthetic() synthetic methods} and methods declared directly
* on the {@link Object} class are filtered out.
*
* @param c class from which the method list is created.
@@ -61,7 +61,7 @@
* on the class or {@link Class#getDeclaredMethods() declared methods} only,
* depending on the value of the {@code declaredMethods} parameter.
*
- * The {@link Method#isBridge() bridge methods} and methods declared directly
+ * The {@link Method#isSynthetic() synthetic methods} and methods declared directly
* on the {@link Object} class are filtered out.
*
* @param c class from which the method list is created.
@@ -89,7 +89,7 @@
/**
* Create new method list from the given collection of methods.
*
- * The {@link Method#isBridge() bridge methods} and methods declared directly
+ * The {@link Method#isSynthetic() synthetic methods} and methods declared directly
* on the {@link Object} class are filtered out.
*
* @param methods methods to be included in the method list.
@@ -97,7 +97,7 @@
public MethodList(Collection<Method> methods) {
List<AnnotatedMethod> l = new ArrayList<>(methods.size());
for (Method m : methods) {
- if (!m.isBridge() && m.getDeclaringClass() != Object.class) {
+ if (!m.isSynthetic() && m.getDeclaringClass() != Object.class) {
l.add(new AnnotatedMethod(m));
}
}
@@ -109,7 +109,7 @@
/**
* Create new method list from the given array of methods.
*
- * The {@link Method#isBridge() bridge methods} and methods declared directly
+ * The {@link Method#isSynthetic() synthetic methods} and methods declared directly
* on the {@link Object} class are filtered out.
*
* @param methods methods to be included in the method list.
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ModelValidationException.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ModelValidationException.java
index 90c2be3..572e0cf 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/ModelValidationException.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ModelValidationException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -23,8 +23,8 @@
*
* Indicates the issues with the model.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class ModelValidationException extends RuntimeException {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameter.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Parameter.java
index 9467ea8..9cfee23 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameter.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Parameter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,229 +24,25 @@
import java.lang.reflect.Type;
import java.security.AccessController;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
import javax.ws.rs.BeanParam;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.DefaultValue;
import javax.ws.rs.Encoded;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.MatrixParam;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
import org.glassfish.jersey.internal.util.ReflectionHelper;
-import org.glassfish.jersey.internal.util.collection.ClassTypePair;
+import org.glassfish.jersey.model.internal.spi.ParameterServiceProvider;
import org.glassfish.jersey.server.Uri;
/**
* Method parameter model.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
-public class Parameter implements AnnotatedElement {
-
- private static final Logger LOGGER = Logger.getLogger(Parameter.class.getName());
-
- /**
- * Parameter injection sources type.
- */
- public enum Source {
-
- /**
- * Context parameter injection source.
- */
- CONTEXT,
- /**
- * Cookie parameter injection source.
- */
- COOKIE,
- /**
- * Entity parameter injection source.
- */
- ENTITY,
- /**
- * Form parameter injection source.
- */
- FORM,
- /**
- * Header parameter injection source.
- */
- HEADER,
- /**
- * Uri parameter injection source.
- */
- URI,
- /**
- * Matrix parameter injection source.
- */
- MATRIX,
- /**
- * Path parameter injection source.
- */
- PATH,
- /**
- * Query parameter injection source.
- */
- QUERY,
- /**
- * Suspended async response injection source.
- */
- SUSPENDED,
- /**
- * Bean param parameter injection source.
- */
- BEAN_PARAM,
- /**
- * Unknown parameter injection source.
- */
- UNKNOWN
- }
-
- private interface ParamAnnotationHelper<T extends Annotation> {
-
- public String getValueOf(T a);
-
- public Parameter.Source getSource();
- }
-
- private static Map<Class, ParamAnnotationHelper> createParamAnnotationHelperMap() {
- Map<Class, ParamAnnotationHelper> m = new WeakHashMap<Class, ParamAnnotationHelper>();
- m.put(Context.class, new ParamAnnotationHelper<Context>() {
-
- @Override
- public String getValueOf(Context a) {
- return null;
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.CONTEXT;
- }
- });
- m.put(CookieParam.class, new ParamAnnotationHelper<CookieParam>() {
-
- @Override
- public String getValueOf(CookieParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.COOKIE;
- }
- });
- m.put(FormParam.class, new ParamAnnotationHelper<FormParam>() {
-
- @Override
- public String getValueOf(FormParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.FORM;
- }
- });
- m.put(HeaderParam.class, new ParamAnnotationHelper<HeaderParam>() {
-
- @Override
- public String getValueOf(HeaderParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.HEADER;
- }
- });
- m.put(MatrixParam.class, new ParamAnnotationHelper<MatrixParam>() {
-
- @Override
- public String getValueOf(MatrixParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.MATRIX;
- }
- });
- m.put(PathParam.class, new ParamAnnotationHelper<PathParam>() {
-
- @Override
- public String getValueOf(PathParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.PATH;
- }
- });
- m.put(QueryParam.class, new ParamAnnotationHelper<QueryParam>() {
-
- @Override
- public String getValueOf(QueryParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.QUERY;
- }
- });
- m.put(Suspended.class, new ParamAnnotationHelper<Suspended>() {
-
- @Override
- public String getValueOf(Suspended a) {
- return Suspended.class.getName();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.SUSPENDED;
- }
- });
- m.put(Uri.class, new ParamAnnotationHelper<Uri>() {
-
- @Override
- public String getValueOf(Uri a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.URI;
- }
- });
- m.put(BeanParam.class, new ParamAnnotationHelper<BeanParam>() {
-
- @Override
- public String getValueOf(BeanParam a) {
- return null;
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.BEAN_PARAM;
- }
- });
- return Collections.unmodifiableMap(m);
- }
-
- private static final Map<Class, ParamAnnotationHelper> ANNOTATION_HELPER_MAP = createParamAnnotationHelperMap();
+public class Parameter extends org.glassfish.jersey.model.Parameter implements AnnotatedElement {
/**
* Create a parameter model.
@@ -262,91 +58,29 @@
* @return new parameter model.
*/
@SuppressWarnings("unchecked")
- public static Parameter create(
+ public static <PARAMETER extends org.glassfish.jersey.model.Parameter> PARAMETER create(
Class concreteClass,
Class declaringClass,
boolean encodeByDefault,
Class<?> rawType,
Type type,
Annotation[] annotations) {
-
- if (null == annotations) {
- return null;
- }
-
- Annotation paramAnnotation = null;
- Parameter.Source paramSource = null;
- String paramName = null;
- boolean paramEncoded = encodeByDefault;
- String paramDefault = null;
-
- /**
- * Create a parameter from the list of annotations. Unknown annotated
- * parameters are also supported, and in such a cases the last
- * unrecognized annotation is taken to be that associated with the
- * parameter.
- */
- for (Annotation annotation : annotations) {
- if (ANNOTATION_HELPER_MAP.containsKey(annotation.annotationType())) {
- ParamAnnotationHelper helper = ANNOTATION_HELPER_MAP.get(annotation.annotationType());
- paramAnnotation = annotation;
- paramSource = helper.getSource();
- paramName = helper.getValueOf(annotation);
- } else if (Encoded.class == annotation.annotationType()) {
- paramEncoded = true;
- } else if (DefaultValue.class == annotation.annotationType()) {
- paramDefault = ((DefaultValue) annotation).value();
- } else {
- // Take latest unknown annotation, but don't override known annotation
- if ((paramAnnotation == null) || (paramSource == Source.UNKNOWN)) {
- paramAnnotation = annotation;
- paramSource = Source.UNKNOWN;
- paramName = getValue(annotation);
- }
- }
- }
-
- if (paramAnnotation == null) {
- paramSource = Parameter.Source.ENTITY;
- }
-
- ClassTypePair ct = ReflectionHelper.resolveGenericType(
- concreteClass, declaringClass, rawType, type);
-
- if (paramSource == Source.BEAN_PARAM) {
- return new BeanParameter(
- annotations,
- paramAnnotation,
- paramName,
- ct.rawClass(),
- ct.type(),
- paramEncoded,
- paramDefault);
- } else {
- return new Parameter(
- annotations,
- paramAnnotation,
- paramSource,
- paramName,
- ct.rawClass(),
- ct.type(),
- paramEncoded,
- paramDefault);
- }
+ return (PARAMETER) create(concreteClass, declaringClass, encodeByDefault, rawType, type, annotations, Parameter.class);
}
- private static List<Parameter> create(
+ protected static <PARAMETER extends org.glassfish.jersey.model.Parameter> List<PARAMETER> createList(
Class concreteClass,
Class declaringClass,
boolean keepEncoded,
Class[] parameterTypes,
Type[] genericParameterTypes,
- Annotation[][] parameterAnnotations) {
+ Annotation[][] parameterAnnotations,
+ Class<?> parameterClass) {
- final List<Parameter> parameters = new ArrayList<>(parameterTypes.length);
+ final List<PARAMETER> parameters = new ArrayList<>(parameterTypes.length);
for (int i = 0; i < parameterTypes.length; i++) {
- final Parameter parameter = Parameter.create(
+ final PARAMETER parameter = Parameter.create(
concreteClass,
declaringClass,
keepEncoded,
@@ -375,28 +109,12 @@
* of all the constructor parameters. (See {@link Encoded}.
* @return a list of constructor parameter models.
*/
- public static List<Parameter> create(
+ public static <PARAMETER extends org.glassfish.jersey.model.Parameter> List<PARAMETER> create(
Class concreteClass,
Class declaringClass,
Constructor<?> ctor,
boolean keepEncoded) {
-
- Class[] parameterTypes = ctor.getParameterTypes();
- Type[] genericParameterTypes = ctor.getGenericParameterTypes();
- // Workaround bug http://bugs.sun.com/view_bug.do?bug_id=5087240
- if (parameterTypes.length != genericParameterTypes.length) {
- Type[] _genericParameterTypes = new Type[parameterTypes.length];
- _genericParameterTypes[0] = parameterTypes[0];
- System.arraycopy(genericParameterTypes, 0, _genericParameterTypes, 1, genericParameterTypes.length);
- genericParameterTypes = _genericParameterTypes;
- }
-
- return create(
- concreteClass, declaringClass,
- ((null != ctor.getAnnotation(Encoded.class)) || keepEncoded),
- parameterTypes,
- genericParameterTypes,
- ctor.getParameterAnnotations());
+ return createList(concreteClass, declaringClass, ctor, keepEncoded, Parameter.class);
}
/**
@@ -411,20 +129,12 @@
* of all the method parameters. (See {@link Encoded}.
* @return a list of handling method parameter models.
*/
- public static List<Parameter> create(
+ public static <PARAMETER extends org.glassfish.jersey.model.Parameter> List<PARAMETER> create(
Class concreteClass,
Class declaringClass,
Method javaMethod,
boolean keepEncoded) {
-
- AnnotatedMethod method = new AnnotatedMethod(javaMethod);
-
- return create(
- concreteClass, declaringClass,
- ((null != method.getAnnotation(Encoded.class)) || keepEncoded),
- method.getParameterTypes(),
- method.getGenericParameterTypes(),
- method.getParameterAnnotations());
+ return createList(concreteClass, declaringClass, javaMethod, keepEncoded, Parameter.class);
}
/**
@@ -438,43 +148,18 @@
public static Parameter overrideSource(Parameter original, Parameter.Source source) {
return new Parameter(
- original.annotations,
- original.sourceAnnotation,
+ original.getAnnotations(),
+ original.getSourceAnnotation(),
source,
source.name(),
- original.rawType,
- original.type,
- original.encoded,
- original.defaultValue);
+ original.getRawType(),
+ original.getType(),
+ original.isEncoded(),
+ original.getDefaultValue());
}
- private static String getValue(Annotation a) {
- try {
- Method m = a.annotationType().getMethod("value");
- if (m.getReturnType() != String.class) {
- return null;
- }
- return (String) m.invoke(a);
- } catch (Exception ex) {
- if (LOGGER.isLoggable(Level.FINER)) {
- LOGGER.log(Level.FINER,
- String.format("Unable to get the %s annotation value property", a.getClass().getName()), ex);
- }
- }
- return null;
- }
- // Instance
- private final Annotation[] annotations;
- private final Annotation sourceAnnotation;
- private final Parameter.Source source;
- private final String sourceName;
- private final boolean encoded;
- private final String defaultValue;
- private final Class<?> rawType;
- private final Type type;
-
- private Parameter(
+ protected Parameter(
Annotation[] markers,
Annotation marker,
Source source,
@@ -483,14 +168,7 @@
Type type,
boolean encoded,
String defaultValue) {
- this.annotations = markers;
- this.sourceAnnotation = marker;
- this.source = source;
- this.sourceName = sourceName;
- this.rawType = rawType;
- this.type = type;
- this.encoded = encoded;
- this.defaultValue = defaultValue;
+ super(markers, marker, source, sourceName, rawType, type, encoded, defaultValue);
}
/**
@@ -524,8 +202,8 @@
}
for (Constructor constructor : AccessController
.doPrivileged(ReflectionHelper.getDeclaredConstructorsPA(rawType))) {
- for (Parameter parameter : Parameter.create(rawType, rawType, constructor, false)) {
- parameters.add(parameter);
+ for (org.glassfish.jersey.model.Parameter parameter : Parameter.create(rawType, rawType, constructor, false)) {
+ parameters.add((Parameter) parameter);
}
}
@@ -541,81 +219,6 @@
}
/**
- * Get the parameter source annotation.
- *
- * @return parameter source annotation.
- */
- public Annotation getSourceAnnotation() {
- return sourceAnnotation;
- }
-
- /**
- * Get the parameter value source type.
- *
- * @return parameter value source type.
- */
- public Parameter.Source getSource() {
- return source;
- }
-
- /**
- * Get the parameter source name, i.e. value of the parameter source annotation.
- *
- * @return parameter source name.
- */
- public String getSourceName() {
- return sourceName;
- }
-
- /**
- * If {@code true}, the injected parameter value should remain encoded.
- *
- * @return {@code true} if the parameter value should remain encoded,
- * {@code false} otherwise.
- */
- public boolean isEncoded() {
- return encoded;
- }
-
- /**
- * Check if the parameter has a default value set.
- *
- * @return {@code true} if the default parameter value has been set,
- * {@code false} otherwise.
- */
- public boolean hasDefaultValue() {
- return defaultValue != null;
- }
-
- /**
- * Get the default parameter value.
- *
- * @return default parameter value or {@code null} if no default value has
- * been set for the parameter.
- */
- public String getDefaultValue() {
- return defaultValue;
- }
-
- /**
- * Get raw type information for the parameter.
- *
- * @return raw parameter type information.
- */
- public Class<?> getRawType() {
- return rawType;
- }
-
- /**
- * Get generic type information for the parameter.
- *
- * @return generic parameter type information.
- */
- public Type getType() {
- return type;
- }
-
- /**
* Check if the parameter is {@link ParamQualifier qualified}.
*
* @return {@code true} if the parameter is qualified, {@code false} otherwise.
@@ -629,90 +232,45 @@
return false;
}
- @Override
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
- return getAnnotation(annotationClass) != null;
- }
+ public static class ServerParameterService implements ParameterServiceProvider {
+ @Override
+ public Map<Class, ParamAnnotationHelper> getParameterAnnotationHelperMap() {
+ Map<Class, ParamAnnotationHelper> m = new WeakHashMap<Class, ParamAnnotationHelper>();
+ m.put(Uri.class, new ParamAnnotationHelper<Uri>() {
- @Override
- public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
- if (annotationClass == null) {
- return null;
- }
- for (Annotation a : annotations) {
- if (a.annotationType() == annotationClass) {
- return annotationClass.cast(a);
- }
- }
- return null;
- }
+ @Override
+ public String getValueOf(Uri a) {
+ return a.value();
+ }
- @Override
- public Annotation[] getAnnotations() {
- return annotations.clone();
- }
-
- @Override
- public Annotation[] getDeclaredAnnotations() {
- return annotations.clone();
- }
-
- @Override
- public String toString() {
- return String.format("Parameter [type=%s, source=%s, defaultValue=%s]",
- getRawType(), getSourceName(), getDefaultValue());
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
+ @Override
+ public Parameter.Source getSource() {
+ return Parameter.Source.URI;
+ }
+ });
+ return m;
}
- Parameter parameter = (Parameter) o;
+ @Override
+ public ParamCreationFactory<Parameter> getParameterCreationFactory() {
+ return new ParamCreationFactory<Parameter>() {
+ @Override
+ public boolean isFor(Class<?> clazz) {
+ return clazz == Parameter.class;
+ }
- if (encoded != parameter.encoded) {
- return false;
- }
- if (!Arrays.equals(annotations, parameter.annotations)) {
- return false;
- }
- if (defaultValue != null ? !defaultValue.equals(parameter.defaultValue) : parameter.defaultValue != null) {
- return false;
- }
- if (rawType != null ? !rawType.equals(parameter.rawType) : parameter.rawType != null) {
- return false;
- }
- if (source != parameter.source) {
- return false;
- }
- if (sourceAnnotation != null ? !sourceAnnotation.equals(parameter.sourceAnnotation) : parameter.sourceAnnotation
- != null) {
- return false;
- }
- if (sourceName != null ? !sourceName.equals(parameter.sourceName) : parameter.sourceName != null) {
- return false;
- }
- if (type != null ? !type.equals(parameter.type) : parameter.type != null) {
- return false;
- }
+ @Override
+ public Parameter createParameter(Annotation[] markers, Annotation marker, Source source, String sourceName,
+ Class<?> rawType, Type type, boolean encoded, String defaultValue) {
+ return new Parameter(markers, marker, source, sourceName, rawType, type, encoded, defaultValue);
+ }
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = annotations != null ? Arrays.hashCode(annotations) : 0;
- result = 31 * result + (sourceAnnotation != null ? sourceAnnotation.hashCode() : 0);
- result = 31 * result + (source != null ? source.hashCode() : 0);
- result = 31 * result + (sourceName != null ? sourceName.hashCode() : 0);
- result = 31 * result + (encoded ? 1 : 0);
- result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0);
- result = 31 * result + (rawType != null ? rawType.hashCode() : 0);
- result = 31 * result + (type != null ? type.hashCode() : 0);
- return result;
+ @Override
+ public Parameter createBeanParameter(Annotation[] markers, Annotation marker, Source source, String sourceName,
+ Class<?> rawType, Type type, boolean encoded, String defaultValue) {
+ return new BeanParameter(markers, marker, sourceName, rawType, type, encoded, defaultValue);
+ }
+ };
+ }
}
}
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java
index 62896a7..7e7d375 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Parameterized.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +24,7 @@
* @see Parameter
*
* @author Marc Hadley
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface Parameterized {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Producing.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Producing.java
index 67554a9..6fb6074 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Producing.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Producing.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,8 +26,8 @@
* A component implementing this interface provides additional information about
* the supported produced {@link MediaType media types}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*
* @see javax.ws.rs.Produces
* @see Consuming
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Resource.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Resource.java
index 7c23f70..aa58b28 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Resource.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -102,7 +102,7 @@
* </table>
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav Fuksa
*/
public final class Resource implements Routed, ResourceModelComponent {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java
index ebf8f75..a57fd26 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethod.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -45,7 +45,7 @@
* Model of a method available on a resource. Covers resource method, sub-resource
* method and sub-resource locator.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class ResourceMethod implements ResourceModelComponent, Producing, Consuming, Suspendable, NameBound {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java
index 92d4389..9090196 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -74,7 +74,7 @@
* Server-side request-response {@link Inflector inflector} for invoking methods
* of annotation-based resource classes.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
*/
public class ResourceMethodInvoker implements Endpoint, ResourceInfo {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelComponent.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelComponent.java
index 157d591..f37a3e7 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelComponent.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +24,7 @@
*
* @see ResourceModelVisitor
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface ResourceModelComponent {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelIssue.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelIssue.java
index 25b6f4f..eec9bdf 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelIssue.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelIssue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -28,8 +28,8 @@
* While the non-fatal issues are merely reported as warnings in the log, the
* fatal issues prevent the successful application deployment.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public final class ResourceModelIssue {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelVisitor.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelVisitor.java
index ace6d63..7e44eea 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelVisitor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceModelVisitor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,8 +22,8 @@
*
* @see ResourceModelComponent
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public interface ResourceModelVisitor {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Routed.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Routed.java
index 1e57f85..5c15274 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Routed.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Routed.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
* usable for routing.
*
* @author Marc Hadley
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Routed {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResource.java b/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResource.java
index 8b46ace..1001c25 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResource.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/RuntimeResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -128,11 +128,20 @@
public static final Comparator<RuntimeResource> COMPARATOR = new Comparator<RuntimeResource>() {
@Override
public int compare(RuntimeResource o1, RuntimeResource o2) {
- return PathPattern.COMPARATOR.compare(o1.getPathPattern(), o2.getPathPattern());
+ final int cmp = PathPattern.COMPARATOR.compare(o1.getPathPattern(), o2.getPathPattern());
+ if (cmp == 0) {
+ // quaternary key sorting those derived from
+ // sub-resource methods ahead of those derived from sub-resource locators
+ final int locatorCmp = o1.resourceLocators.size() - o2.resourceLocators.size();
+
+ // compare the regexes if still equal
+ return (locatorCmp == 0) ? o2.regex.compareTo(o1.regex) : locatorCmp;
+ } else {
+ return cmp;
+ }
}
};
-
private final String regex;
private final List<ResourceMethod> resourceMethods;
private final List<ResourceMethod> resourceLocators;
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/Suspendable.java b/core-server/src/main/java/org/glassfish/jersey/server/model/Suspendable.java
index 1c45141..056b671 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/Suspendable.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/Suspendable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
* Jersey model component that is suspendable and may hold suspend-related
* information.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface Suspendable {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/AbstractJavaResourceMethodDispatcher.java b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/AbstractJavaResourceMethodDispatcher.java
index d6ef75a..5f8154d 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/AbstractJavaResourceMethodDispatcher.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/AbstractJavaResourceMethodDispatcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -47,7 +47,7 @@
* dispatching requests to a particular {@link Method Java method} using supplied
* {@link InvocationHandler Java method invocation handler}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
abstract class AbstractJavaResourceMethodDispatcher implements ResourceMethodDispatcher {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/JavaResourceMethodDispatcherProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/JavaResourceMethodDispatcherProvider.java
index fe8ff6a..5c16fcb 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/JavaResourceMethodDispatcherProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/JavaResourceMethodDispatcherProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
* creates instances of {@link ResourceMethodDispatcher}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class JavaResourceMethodDispatcherProvider implements ResourceMethodDispatcher.Provider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/ResourceMethodDispatcherFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/ResourceMethodDispatcherFactory.java
index 64cf204..30b9616 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/ResourceMethodDispatcherFactory.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/ResourceMethodDispatcherFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -47,7 +47,7 @@
* </p>
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public final class ResourceMethodDispatcherFactory implements ResourceMethodDispatcher.Provider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/ResourceMethodInvocationHandlerFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/ResourceMethodInvocationHandlerFactory.java
index 22e093a..b98eee8 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/ResourceMethodInvocationHandlerFactory.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/ResourceMethodInvocationHandlerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,7 +44,7 @@
* are available, or if none of the providers returns a non-null invocation handler,
* in such case a default invocation handler provided by the factory is returned.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
public final class ResourceMethodInvocationHandlerFactory implements ResourceMethodInvocationHandlerProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/VoidVoidDispatcherProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/VoidVoidDispatcherProvider.java
index 5654685..c78689a 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/model/internal/VoidVoidDispatcherProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/model/internal/VoidVoidDispatcherProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,8 +34,8 @@
* {@link java.lang.reflect.Method Java method} with no input arguments
* using a supplied {@link InvocationHandler Java method invocation handler}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Marek Potociar
+ * @author Jakub Podlesak
*/
@Singleton
final class VoidVoidDispatcherProvider implements ResourceMethodDispatcher.Provider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/monitoring/ApplicationInfo.java b/core-server/src/main/java/org/glassfish/jersey/server/monitoring/ApplicationInfo.java
index 07ac7bc..2ca6599 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/monitoring/ApplicationInfo.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/monitoring/ApplicationInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -49,7 +49,7 @@
* data the method {@link #snapshot()} should be used.
*
* @author Miroslav Fuksa
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
* @see ApplicationEvent
* @see ApplicationEventListener
* @see MonitoringStatistics See MonitoringStatistics class for general details about statistics.
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/monitoring/DestroyListener.java b/core-server/src/main/java/org/glassfish/jersey/server/monitoring/DestroyListener.java
index 02e058d..f69726f 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/monitoring/DestroyListener.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/monitoring/DestroyListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* </p>
*
* @author Miroslav Fuksa
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @see MonitoringStatisticsListener
* @since 2.12
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/AbstractContainerLifecycleListener.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/AbstractContainerLifecycleListener.java
index 71e82a4..f2485d7 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/AbstractContainerLifecycleListener.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/AbstractContainerLifecycleListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
* {@link ContainerLifecycleListener container liefecycle listener}
* callback method(s).
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public abstract class AbstractContainerLifecycleListener implements ContainerLifecycleListener {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/ComponentProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/ComponentProvider.java
index 107e558..05dcbe1 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/ComponentProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/ComponentProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
* Jersey will not even try to inject component provider instances with Jersey artifacts.
* The SPI providers should be designed so that no dependency injection is needed at the bind time phase.
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface ComponentProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/Container.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/Container.java
index ced9114..b865a74 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/Container.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/Container.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -29,7 +29,7 @@
* The purpose of the container is to configure and host a single Jersey
* application.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*
* @see org.glassfish.jersey.server.ApplicationHandler
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/ContainerLifecycleListener.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/ContainerLifecycleListener.java
index 7225313..c6add33 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/ContainerLifecycleListener.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/ContainerLifecycleListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
* Classes implementing this contract receive container life-cycle notification
* events.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Contract
@ConstrainedTo(RuntimeType.SERVER)
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/ContainerProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/ContainerProvider.java
index eeb4b8d..cf12216 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/ContainerProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/ContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -52,8 +52,8 @@
* </p>
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
@Contract
@ConstrainedTo(RuntimeType.SERVER)
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/ExternalRequestContext.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/ExternalRequestContext.java
index e01e1bb..7d90e97 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/ExternalRequestContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/ExternalRequestContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -23,7 +23,7 @@
*
* @see ExternalRequestScope
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ExternalRequestContext<T> {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/ExternalRequestScope.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/ExternalRequestScope.java
index 828c925..395d308 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/ExternalRequestScope.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/ExternalRequestScope.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
* </p>
*
* @param <T> external request context type
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @since 2.15
*/
public interface ExternalRequestScope<T> extends AutoCloseable {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/RequestScopedInitializer.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/RequestScopedInitializer.java
index 212b97f..df18599 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/RequestScopedInitializer.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/RequestScopedInitializer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
* Container implementations may use this extension point to provide initialization
* of custom request-scoped data.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface RequestScopedInitializer {
/**
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/ValidationInterceptor.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/ValidationInterceptor.java
index 50d0058..f5c6ce2 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/ValidationInterceptor.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/ValidationInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -40,7 +40,7 @@
* method on provided interceptor context as part of interception processing.
* </p>
*
- * @author Jakub Podlesak (jakub.podleak at oracle.com)
+ * @author Jakub Podlesak
* @since 2.18
*/
@Contract
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/ValidationInterceptorContext.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/ValidationInterceptorContext.java
index 22da388..bc5d88f 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/ValidationInterceptorContext.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/ValidationInterceptorContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* The context gives access to key validation data.
* It also allows interceptor implementation to tweak resource and/or parameters that are going to be validated.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @see ValidationInterceptor
* @since 2.18
*/
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java
index b752a54..03d0c40 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Utility methods for retrieving values or value providers for the
* {@link Parameterized parameterized} resource model components.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class ParameterValueHelper {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ResourceMethodDispatcher.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ResourceMethodDispatcher.java
index b46adf5..7a86550 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ResourceMethodDispatcher.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ResourceMethodDispatcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,8 +34,8 @@
* resource instance and returning the method invocation result in a form of a
* JAX-RS {@link Response response}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Marek Potociar
+ * @author Jakub Podlesak
*/
public interface ResourceMethodDispatcher {
@@ -58,7 +58,7 @@
* </p>
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public static interface Provider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ResourceMethodInvocationHandlerProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ResourceMethodInvocationHandlerProvider.java
index a0a1b59..9e27aac 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ResourceMethodInvocationHandlerProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ResourceMethodInvocationHandlerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +24,7 @@
* Provides the {@link InvocationHandler invocation handler} instances designated
* to handle invocations of the supplied {@link Invocable invocable resource methods}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface ResourceMethodInvocationHandlerProvider {
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java
index c69e674..23e1461 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/spi/internal/ValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
/**
* Parameter value factory SPI.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Michal Gajdos
*/
@Contract
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/ApplicationDescription.java b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/ApplicationDescription.java
index b5be4e8..a7a9deb 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/ApplicationDescription.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/wadl/internal/ApplicationDescription.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,12 +35,12 @@
public class ApplicationDescription {
private Application _application;
- private WadlGenerator.ExternalGrammarDefinition _externalGrammarDefiniton;
+ private WadlGenerator.ExternalGrammarDefinition _externalGrammarDefinition;
- ApplicationDescription(Application application, WadlGenerator.ExternalGrammarDefinition externalGrammarDefiniton) {
+ ApplicationDescription(Application application, WadlGenerator.ExternalGrammarDefinition externalGrammarDefinition) {
super();
this._application = application;
- this._externalGrammarDefiniton = externalGrammarDefiniton;
+ this._externalGrammarDefinition = externalGrammarDefinition;
}
/**
@@ -55,7 +55,7 @@
* @return the QName for the given Class in the grammar.
*/
public QName resolve(Class type) {
- return _externalGrammarDefiniton.resolve(type);
+ return _externalGrammarDefinition.resolve(type);
}
/**
@@ -64,14 +64,14 @@
* or the root application.wadl.
*/
public ExternalGrammar getExternalGrammar(String path) {
- return _externalGrammarDefiniton.map.get(path);
+ return _externalGrammarDefinition.map.get(path);
}
/**
* @return A set of all the external metadata keys
*/
public Set<String> getExternalMetadataKeys() {
- return _externalGrammarDefiniton.map.keySet();
+ return _externalGrammarDefinition.map.keySet();
}
/**
diff --git a/core-server/src/main/resources/META-INF/services/org.glassfish.jersey.model.internal.spi.ParameterServiceProvider b/core-server/src/main/resources/META-INF/services/org.glassfish.jersey.model.internal.spi.ParameterServiceProvider
new file mode 100644
index 0000000..b3fba5d
--- /dev/null
+++ b/core-server/src/main/resources/META-INF/services/org.glassfish.jersey.model.internal.spi.ParameterServiceProvider
@@ -0,0 +1 @@
+org.glassfish.jersey.server.model.Parameter$ServerParameterService
\ No newline at end of file
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/ApplicationHandlerTest.java b/core-server/src/test/java/org/glassfish/jersey/server/ApplicationHandlerTest.java
index ca297d0..6c267cb 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/ApplicationHandlerTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/ApplicationHandlerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -70,8 +70,8 @@
/**
* Test basic application behavior.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
* @author Michal Gajdos
*/
public class ApplicationHandlerTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/ApplicationTest.java b/core-server/src/test/java/org/glassfish/jersey/server/ApplicationTest.java
index 989e361..9765e0e 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/ApplicationTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/ApplicationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
import org.junit.Test;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ApplicationTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/AsyncApplicationBuildingTest.java b/core-server/src/test/java/org/glassfish/jersey/server/AsyncApplicationBuildingTest.java
index 19d8f50..069996e 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/AsyncApplicationBuildingTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/AsyncApplicationBuildingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -54,7 +54,7 @@
* Unit test for creating an application with asynchronously handled request processing
* via {@link Resource}'s programmatic API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncApplicationBuildingTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/ContainerRequestTest.java b/core-server/src/test/java/org/glassfish/jersey/server/ContainerRequestTest.java
index 9ede153..f2cb244 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/ContainerRequestTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/ContainerRequestTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
/**
* Jersey container request context test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ContainerRequestTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/ResourceConfigBuilderTest.java b/core-server/src/test/java/org/glassfish/jersey/server/ResourceConfigBuilderTest.java
index 1f14099..41e83e9 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/ResourceConfigBuilderTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/ResourceConfigBuilderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ResourceConfigBuilderTest {
@Test
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/ResourceConfigTest.java b/core-server/src/test/java/org/glassfish/jersey/server/ResourceConfigTest.java
index 4f4ee99..197e5fb 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/ResourceConfigTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/ResourceConfigTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -33,7 +33,6 @@
import org.glassfish.jersey.server.config.innerstatic.InnerStaticClass;
import org.glassfish.jersey.server.config.toplevel.PublicRootResourceClass;
import org.glassfish.jersey.server.config.toplevelinnerstatic.PublicRootResourceInnerStaticClass;
-import org.glassfish.jersey.server.internal.scanning.PackageNamesScanner;
import org.junit.Test;
import static org.glassfish.jersey.server.JarUtils.createJarFile;
@@ -45,11 +44,8 @@
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-import mockit.Mocked;
-import mockit.Verifications;
-
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ResourceConfigTest {
@@ -350,53 +346,6 @@
assertThat(classes, hasItem(InnerStaticClass.PublicClass.class));
}
- /**
- * Reproducer for OWLS-19790: Invalidate resource finders in resource config only when needed.
- */
- @Test
- public void testInvalidateResourceFinders(@Mocked final PackageNamesScanner scanner) throws Exception {
- final ResourceConfig resourceConfig = new ResourceConfig()
- .packages(false, PublicRootResourceClass.class.getPackage().getName());
-
- // Scan packages.
- resourceConfig.getClasses();
-
- // No reset.
- new Verifications() {{
- scanner.reset();
- times = 0;
- }};
-
- resourceConfig.register(InnerStaticClass.PublicClass.class);
-
- // Reset - we called getClasses() on ResourceConfig.
- new Verifications() {{
- scanner.reset();
- times = 1;
- }};
-
- // No reset.
- resourceConfig.register(PublicRootResourceClass.class);
- resourceConfig.register(PublicRootResourceInnerStaticClass.PublicClass.class);
-
- // No reset - simple registering does not invoke cache invalidation and reset of resource finders.
- new Verifications() {{
- scanner.reset();
- times = 1;
- }};
-
- // Scan packages.
- resourceConfig.getClasses();
-
- resourceConfig.registerFinder(new PackageNamesScanner(new String[] {"javax.ws.rs"}, false));
-
- // Reset - we called getClasses() on ResourceConfig.
- new Verifications() {{
- scanner.reset();
- times = 2;
- }};
- }
-
@Test
public void testResourceFinderStreamsClosed() throws IOException {
System.out.println(new ResourceConfig().packages("javax.ws.rs").getClasses());
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/SecurityManagerConfiguredTest.java b/core-server/src/test/java/org/glassfish/jersey/server/SecurityManagerConfiguredTest.java
index 09c5f18..f30e6fb 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/SecurityManagerConfiguredTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/SecurityManagerConfiguredTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
/**
* Test that verifies that security manager is setup to run the Jersey core server unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class SecurityManagerConfiguredTest {
/**
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java b/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java
index fed2888..f982a16 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/TestInjectionManagerFactory.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -33,7 +34,7 @@
import org.glassfish.jersey.message.internal.MessagingBinders;
import org.glassfish.jersey.model.internal.ManagedObjectsFinalizer;
import org.glassfish.jersey.process.internal.RequestScope;
-import org.glassfish.jersey.server.internal.inject.ParamConverterConfigurator;
+import org.glassfish.jersey.internal.inject.ParamConverterConfigurator;
import org.glassfish.jersey.server.internal.inject.ParamExtractorConfigurator;
import org.glassfish.jersey.server.internal.inject.ValueParamProviderConfigurator;
import org.glassfish.jersey.server.internal.process.RequestProcessingConfigurator;
@@ -42,7 +43,7 @@
/**
* Utility class to create initialized server-side injection manager.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class TestInjectionManagerFactory {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/UriInfoMatchedResourcesTest.java b/core-server/src/test/java/org/glassfish/jersey/server/UriInfoMatchedResourcesTest.java
index a4e1109..0f8838b 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/UriInfoMatchedResourcesTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/UriInfoMatchedResourcesTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
/**
* Test UriInfo content.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UriInfoMatchedResourcesTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/UriInfoMatchedUrisTest.java b/core-server/src/test/java/org/glassfish/jersey/server/UriInfoMatchedUrisTest.java
index 8d90680..8460cf4 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/UriInfoMatchedUrisTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/UriInfoMatchedUrisTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
/**
* Test UriInfo content.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UriInfoMatchedUrisTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/filter/ApplicationFilterTest.java b/core-server/src/test/java/org/glassfish/jersey/server/filter/ApplicationFilterTest.java
index 4c94fd5..92f3bf7 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/filter/ApplicationFilterTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/filter/ApplicationFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -47,8 +47,8 @@
/**
* Test for JAX-RS filters.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class ApplicationFilterTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/filter/ContainerResponseFilterOrderingTest.java b/core-server/src/test/java/org/glassfish/jersey/server/filter/ContainerResponseFilterOrderingTest.java
index 476031f..a255467 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/filter/ContainerResponseFilterOrderingTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/filter/ContainerResponseFilterOrderingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,7 +40,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ContainerResponseFilterOrderingTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/filter/EncodingFilterTest.java b/core-server/src/test/java/org/glassfish/jersey/server/filter/EncodingFilterTest.java
index 4cc4b98..66980ee 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/filter/EncodingFilterTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/filter/EncodingFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -16,15 +16,6 @@
package org.glassfish.jersey.server.filter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.container.ContainerResponseFilter;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
-
import org.glassfish.jersey.message.GZipEncoder;
import org.glassfish.jersey.server.ApplicationHandler;
import org.glassfish.jersey.server.ContainerRequest;
@@ -32,8 +23,16 @@
import org.glassfish.jersey.server.RequestContextBuilder;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.spi.ContentEncoder;
-
import org.junit.Test;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -83,6 +82,11 @@
}
@Test
+ public void testEmptyEncodingHeader() throws IOException {
+ testEncoding(null, "", "", "", "");
+ }
+
+ @Test
public void testAcceptEncodingHeaderNotSupported() throws IOException {
testEncoding(null, "not-gzip");
}
@@ -119,7 +123,7 @@
@Test
public void testAnyAcceptableExceptGZipAndIdentity() throws IOException {
- testEncoding("foo", "*", "gzip; q=0", "identity; q=0");
+ testEncoding("foo", "", "", "", "*", "gzip; q=0", "identity; q=0");
}
@Test
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/filter/LayeredFiltersTest.java b/core-server/src/test/java/org/glassfish/jersey/server/filter/LayeredFiltersTest.java
index bc12fe6..7117c15 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/filter/LayeredFiltersTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/filter/LayeredFiltersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -55,7 +55,7 @@
* Please un-ignore tests whenever JERSEY-2414 fixed.
*
* @author Paul Sandoz
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class LayeredFiltersTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/filter/UriModificationFilterTest.java b/core-server/src/test/java/org/glassfish/jersey/server/filter/UriModificationFilterTest.java
index 861a6e0..b5cacef 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/filter/UriModificationFilterTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/filter/UriModificationFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -43,7 +43,7 @@
* Tests capability of URI modification during pre-matching filtering.
*
* @author Paul Sandoz
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class UriModificationFilterTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/BackgroundSchedulerProviderTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/BackgroundSchedulerProviderTest.java
index 87d5477..ad7f5ce 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/BackgroundSchedulerProviderTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/BackgroundSchedulerProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -40,8 +40,8 @@
/**
* Test basic application behavior.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
* @author Michal Gajdos
*/
public class BackgroundSchedulerProviderTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/ResourceContextTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/ResourceContextTest.java
index f7e21fb..312db7c 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/ResourceContextTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/ResourceContextTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,8 +32,8 @@
/**
* Test basic application behavior.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class ResourceContextTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/RuntimeDelegateImplTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/RuntimeDelegateImplTest.java
index 36f60a2..3ece1fc 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/RuntimeDelegateImplTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/RuntimeDelegateImplTest.java
@@ -16,54 +16,19 @@
package org.glassfish.jersey.server.internal;
-import static java.lang.Boolean.FALSE;
-import static java.lang.Boolean.TRUE;
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.CoreMatchers.theInstance;
import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
-import java.security.NoSuchAlgorithmException;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Optional;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionStage;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-import java.util.function.BiFunction;
-
-import javax.net.ssl.SSLContext;
-import javax.ws.rs.JAXRS;
-import javax.ws.rs.JAXRS.Configuration;
import javax.ws.rs.core.Application;
import javax.ws.rs.ext.RuntimeDelegate;
-import org.hamcrest.FeatureMatcher;
-import org.hamcrest.Matcher;
-import org.glassfish.jersey.internal.ServiceFinder;
-import org.glassfish.jersey.internal.ServiceFinder.ServiceIteratorProvider;
-import org.glassfish.jersey.server.ServerProperties;
-import org.glassfish.jersey.server.spi.Container;
-import org.glassfish.jersey.server.spi.Server;
-import org.glassfish.jersey.server.spi.ServerProvider;
-import org.junit.After;
import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import mockit.Mocked;
-import mockit.integration.junit4.JMockit;
/**
* Unit tests for {@link RuntimeDelegate}.
*
* @author Martin Matula
- * @author Markus KARG (markus@headcrashing.eu)
*/
-@RunWith(JMockit.class)
public class RuntimeDelegateImplTest {
@Test
@@ -86,304 +51,4 @@
public void testRuntimeDelegateInstance() {
assertSame(RuntimeDelegateImpl.class, RuntimeDelegate.getInstance().getClass());
}
-
- @Test
- public final void shouldCreateConfigurationBuilder() {
- // given
- final RuntimeDelegate runtimeDelegate = new RuntimeDelegateImpl();
-
- // when
- final JAXRS.Configuration.Builder configurationBuilder = runtimeDelegate.createConfigurationBuilder();
-
- // then
- assertThat(configurationBuilder, is(notNullValue()));
- }
-
- @Test
- public final void shouldBuildDefaultConfiguration() throws NoSuchAlgorithmException {
- // given
- final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
-
- // when
- final JAXRS.Configuration configuration = configurationBuilder.build();
-
- // then
- assertThat(configuration, is(notNullValue()));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
- assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
- assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
- assertThat(configuration.property(JAXRS.Configuration.PROTOCOL), is("HTTP"));
- assertThat(configuration.property(JAXRS.Configuration.HOST), is("localhost"));
- assertThat(configuration.property(JAXRS.Configuration.PORT), is(JAXRS.Configuration.DEFAULT_PORT));
- assertThat(configuration.property(JAXRS.Configuration.ROOT_PATH), is("/"));
- assertThat(configuration.property(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION),
- is(JAXRS.Configuration.SSLClientAuthentication.NONE));
- assertThat(configuration.property(JAXRS.Configuration.SSL_CONTEXT), is(theInstance(SSLContext.getDefault())));
- assertThat(configuration.protocol(), is("HTTP"));
- assertThat(configuration.host(), is("localhost"));
- assertThat(configuration.port(), is(JAXRS.Configuration.DEFAULT_PORT));
- assertThat(configuration.rootPath(), is("/"));
- assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.NONE));
- assertThat(configuration.sslContext(), is(theInstance(SSLContext.getDefault())));
- }
-
- @Test
- public final void shouldBuildConfigurationContainingCustomProperties() {
- // given
- final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
-
- // when
- final JAXRS.Configuration configuration = configurationBuilder.property("property", "value").build();
-
- // then
- assertThat(configuration, is(notNullValue()));
- assertThat(configuration, hasProperty("property"));
- assertThat(configuration.property("property"), is("value"));
- }
-
- @Test
- public final void shouldBuildCustomConfigurationUsingNamedStandardProperties(@Mocked final SSLContext mockSslContext)
- throws NoSuchAlgorithmException {
- // given
- final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
-
- // when
- final JAXRS.Configuration configuration = configurationBuilder.property(JAXRS.Configuration.PROTOCOL, "HTTPS")
- .property(JAXRS.Configuration.HOST, "hostname").property(JAXRS.Configuration.PORT, 8080)
- .property(JAXRS.Configuration.ROOT_PATH, "path")
- .property(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION,
- JAXRS.Configuration.SSLClientAuthentication.OPTIONAL)
- .property(JAXRS.Configuration.SSL_CONTEXT, mockSslContext).build();
-
- // then
- assertThat(configuration, is(notNullValue()));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
- assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
- assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
- assertThat(configuration.protocol(), is("HTTPS"));
- assertThat(configuration.host(), is("hostname"));
- assertThat(configuration.port(), is(8080));
- assertThat(configuration.rootPath(), is("path"));
- assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL));
- assertThat(configuration.sslContext(), is(theInstance(mockSslContext)));
- }
-
- @Test
- public final void shouldBuildCustomConfigurationUsingConvenienceMethods(@Mocked final SSLContext mockSslContext)
- throws NoSuchAlgorithmException {
- // given
- final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
-
- // when
- final JAXRS.Configuration configuration = configurationBuilder.protocol("HTTPS").host("hostname").port(8080)
- .rootPath("path").sslClientAuthentication(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL)
- .sslContext(mockSslContext).build();
-
- // then
- assertThat(configuration, is(notNullValue()));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
- assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
- assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
- assertThat(configuration.protocol(), is("HTTPS"));
- assertThat(configuration.host(), is("hostname"));
- assertThat(configuration.port(), is(8080));
- assertThat(configuration.rootPath(), is("path"));
- assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL));
- assertThat(configuration.sslContext(), is(theInstance(mockSslContext)));
- }
-
- @Test
- public final void shouldBuildCustomConfigurationFromPropertiesProvider(@Mocked final SSLContext mockSslContext) {
- // given
- final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
- final Class<Server> mockServerClass = Server.class;
- final BiFunction<String, Class<Object>, Optional<Object>> propertiesProvider = (propertyName, propertyType) -> {
- if (JAXRS.Configuration.PROTOCOL.equals(propertyName) && String.class.equals(propertyType)) {
- return Optional.of("HTTPS");
- }
- if (JAXRS.Configuration.HOST.equals(propertyName) && String.class.equals(propertyType)) {
- return Optional.of("hostname");
- }
- if (JAXRS.Configuration.PORT.equals(propertyName) && Integer.class.equals(propertyType)) {
- return Optional.of(8080);
- }
- if (JAXRS.Configuration.ROOT_PATH.equals(propertyName) && String.class.equals(propertyType)) {
- return Optional.of("path");
- }
- if (JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION.equals(propertyName)
- && JAXRS.Configuration.SSLClientAuthentication.class.equals(propertyType)) {
- return Optional.of(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL);
- }
- if (JAXRS.Configuration.SSL_CONTEXT.equals(propertyName) && SSLContext.class.equals(propertyType)) {
- return Optional.of(mockSslContext);
- }
- if (ServerProperties.HTTP_SERVER_CLASS.equals(propertyName) && Class.class.equals(propertyType)) {
- return Optional.of(mockServerClass);
- }
- if (ServerProperties.AUTO_START.equals(propertyName) && Boolean.class.equals(propertyType)) {
- return Optional.of(FALSE);
- }
- return Optional.empty();
- };
-
- // when
- final JAXRS.Configuration configuration = configurationBuilder.from(propertiesProvider).build();
-
- // then
- assertThat(configuration, is(notNullValue()));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
- assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
- assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
- assertThat(configuration, hasProperty(ServerProperties.HTTP_SERVER_CLASS));
- assertThat(configuration, hasProperty(ServerProperties.AUTO_START));
- assertThat(configuration.protocol(), is("HTTPS"));
- assertThat(configuration.host(), is("hostname"));
- assertThat(configuration.port(), is(8080));
- assertThat(configuration.rootPath(), is("path"));
- assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL));
- assertThat(configuration.sslContext(), is(theInstance(mockSslContext)));
- assertThat(configuration.property(ServerProperties.HTTP_SERVER_CLASS), is(theInstance(mockServerClass)));
- assertThat(configuration.property(ServerProperties.AUTO_START), is(FALSE));
- }
-
- @Test
- public final void shouldBootstrapApplication(@Mocked final Container mockContainer,
- @Mocked final Application mockApplication, @Mocked final SSLContext mockSslContext) throws InterruptedException,
- ExecutionException, TimeoutException {
- // given
- final Server mockServer = new Server() {
- @Override
- public final Container container() {
- return mockContainer;
- }
-
- @Override
- public final int port() {
- return 8888;
- }
-
- @Override
- public final CompletionStage<?> start() {
- return CompletableFuture.completedFuture(null);
- }
-
- @Override
- public final CompletionStage<?> stop() {
- return CompletableFuture.completedFuture(null);
- }
-
- @Override
- public final <T> T unwrap(final Class<T> nativeClass) {
- return null;
- }
- };
- final RuntimeDelegate runtimeDelegate = new RuntimeDelegateImpl();
- final JAXRS.Configuration mockConfiguration = name -> {
- switch (name) {
- case JAXRS.Configuration.PROTOCOL:
- return "HTTPS";
- case JAXRS.Configuration.HOST:
- return "hostname";
- case JAXRS.Configuration.PORT:
- return JAXRS.Configuration.DEFAULT_PORT;
- case JAXRS.Configuration.ROOT_PATH:
- return "path";
- case JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION:
- return JAXRS.Configuration.SSLClientAuthentication.OPTIONAL;
- case JAXRS.Configuration.SSL_CONTEXT:
- return mockSslContext;
- case ServerProperties.HTTP_SERVER_CLASS:
- return Server.class;
- default:
- return null;
- }
- };
- ServiceFinder.setIteratorProvider(new ServiceIteratorProvider() {
- @Override
- public final <T> Iterator<T> createIterator(final Class<T> service, final String serviceName,
- final ClassLoader loader, final boolean ignoreOnClassNotFound) {
- return Collections.singleton(service.cast(new ServerProvider() {
- @Override
- public final <U extends Server> U createServer(final Class<U> type, final Application application,
- final Configuration configuration) {
- return application == mockApplication && configuration == mockConfiguration
- ? type.cast(mockServer)
- : null;
- }
- })).iterator();
- }
-
- @Override
- public final <T> Iterator<Class<T>> createClassIterator(final Class<T> service, final String serviceName,
- final ClassLoader loader, final boolean ignoreOnClassNotFound) {
- return null;
- }
- });
-
- // when
- final CompletionStage<JAXRS.Instance> bootstrapStage = runtimeDelegate.bootstrap(mockApplication,
- mockConfiguration);
- final JAXRS.Instance instance = bootstrapStage.toCompletableFuture().get(15, SECONDS);
- final Configuration configuration = instance.configuration();
- final Server server = instance.unwrap(Server.class);
- final Container container = server.container();
- final CompletionStage<JAXRS.Instance.StopResult> stopStage = instance.stop();
- final Object stopResult = stopStage.toCompletableFuture().get(15, SECONDS);
-
- // then
- assertThat(instance, is(notNullValue()));
- assertThat(configuration, is(notNullValue()));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
- assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
- assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
- assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
- assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
- assertThat(configuration, hasProperty(ServerProperties.HTTP_SERVER_CLASS));
- assertThat(configuration.protocol(), is("HTTPS"));
- assertThat(configuration.host(), is("hostname"));
- assertThat(configuration.port(), is(8888));
- assertThat(configuration.rootPath(), is("path"));
- assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL));
- assertThat(configuration.sslContext(), is(theInstance(mockSslContext)));
- assertThat(configuration.property(ServerProperties.HTTP_SERVER_CLASS), is(theInstance(mockServer.getClass())));
- assertThat(server, is(theInstance(mockServer)));
- assertThat(container, is(theInstance(mockContainer)));
- assertThat(stopResult, is(notNullValue()));
- }
-
- @After
- public final void resetServiceFinder() {
- ServiceFinder.setIteratorProvider(null);
- }
-
- /**
- * Creates a matcher that matches any examined object whose <code>hasProperty</code> method
- * returns {@code true} for the provided property name.
- * For example:
- * <pre>assertThat(configuration, hasProperty("HOST"))</pre>
- *
- * @param propertyName
- * the property name to check
- */
- private static final Matcher<Configuration> hasProperty(final String propertyName) {
- return new FeatureMatcher<Configuration, Boolean>(is(TRUE), "hasProperty", "hasProperty") {
- @Override
- protected final Boolean featureValueOf(final Configuration actual) {
- return actual.hasProperty(propertyName);
- }
- };
- }
}
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/AbstractTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/AbstractTest.java
index aac3aac..d26743a 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/AbstractTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/AbstractTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -16,23 +16,23 @@
package org.glassfish.jersey.server.internal.inject;
-import java.util.concurrent.ExecutionException;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.Request;
-
+import org.glassfish.jersey.internal.inject.Binder;
import org.glassfish.jersey.server.ApplicationHandler;
import org.glassfish.jersey.server.ContainerRequest;
import org.glassfish.jersey.server.ContainerResponse;
import org.glassfish.jersey.server.RequestContextBuilder;
import org.glassfish.jersey.server.ResourceConfig;
+import javax.ws.rs.core.Cookie;
+import javax.ws.rs.core.Request;
+import java.util.concurrent.ExecutionException;
+
import static org.junit.Assert.assertEquals;
/**
* Class used for {@link ApplicationHandler} initialization and for executing {@link Request}s.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public abstract class AbstractTest {
@@ -42,6 +42,10 @@
app = new ApplicationHandler(new ResourceConfig(classes));
}
+ protected void initiateWebApplication(Binder binder, Class<?>... classes) {
+ app = new ApplicationHandler(new ResourceConfig(classes), binder);
+ }
+
protected void initiateWebApplication(ResourceConfig resourceConfig) {
app = new ApplicationHandler(resourceConfig);
}
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ActiveBindingBindingTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ActiveBindingBindingTest.java
index e7a5794..faf0bc4 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ActiveBindingBindingTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ActiveBindingBindingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -60,7 +60,7 @@
*
* This is an implementation sketch for complex use cases like the one from JERSEY-2855.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ActiveBindingBindingTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/BeanParamMemoryLeakTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/BeanParamMemoryLeakTest.java
index 4f9febb..b56bde3 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/BeanParamMemoryLeakTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/BeanParamMemoryLeakTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -41,7 +41,7 @@
* number of descriptors in HK2 for {@link BeanParam} injected
* parameter does not grow up in time.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class BeanParamMemoryLeakTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ContextBasedInjectionTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ContextBasedInjectionTest.java
index 44059d2..5dbddfb 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ContextBasedInjectionTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ContextBasedInjectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -48,7 +48,7 @@
* Unit test for creating an application with asynchronously handled request processing
* via {@link Resource}'s programmatic API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@RunWith(Parameterized.class)
public class ContextBasedInjectionTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsCookieTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsCookieTest.java
index 7834b82..4c35475 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsCookieTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsCookieTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CookieParamAsCookieTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsPrimitiveTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsPrimitiveTest.java
index acea6b8..b3519d3 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsPrimitiveTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsPrimitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CookieParamAsPrimitiveTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsStringTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsStringTest.java
index 43c82a8..20b8267 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsStringTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamAsStringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,7 +36,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class CookieParamAsStringTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamStringConstructorTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamStringConstructorTest.java
index c61dfbc..0d7e588 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamStringConstructorTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/CookieParamStringConstructorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,7 +37,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CookieParamStringConstructorTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/EncodedParamsTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/EncodedParamsTest.java
index f778777..1e39b13 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/EncodedParamsTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/EncodedParamsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -40,7 +40,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/FormParamTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/FormParamTest.java
index 658e661..56cf89f 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/FormParamTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/FormParamTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -45,7 +45,7 @@
/**
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class FormParamTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamAsPrimitiveTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamAsPrimitiveTest.java
index ddf00a2..ae54b47 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamAsPrimitiveTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamAsPrimitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HeaderParamAsPrimitiveTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamAsStringTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamAsStringTest.java
index b82da8d..f4b1e3d 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamAsStringTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamAsStringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class HeaderParamAsStringTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamStringConstructorTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamStringConstructorTest.java
index 4dbd3f6..7589fd3 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamStringConstructorTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/HeaderParamStringConstructorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,7 +36,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HeaderParamStringConstructorTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/InvalidParamsTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/InvalidParamsTest.java
index 1fabe8e..c5acca7 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/InvalidParamsTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/InvalidParamsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class InvalidParamsTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/JaxRsInjectablesTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/JaxRsInjectablesTest.java
index 53560fd..805c03a 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/JaxRsInjectablesTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/JaxRsInjectablesTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -54,7 +54,7 @@
* proxy support for these.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsInjectablesTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamAsPrimitiveTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamAsPrimitiveTest.java
index 75571f9..6d8d501 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamAsPrimitiveTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamAsPrimitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class MatrixParamAsPrimitiveTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamAsStringTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamAsStringTest.java
index b5987e6..190720c 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamAsStringTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamAsStringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class MatrixParamAsStringTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamStringConstructorTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamStringConstructorTest.java
index 512c62e..b6f4fec 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamStringConstructorTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/MatrixParamStringConstructorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class MatrixParamStringConstructorTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterDateTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterDateTest.java
new file mode 100644
index 0000000..b00bd64
--- /dev/null
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterDateTest.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2012, 2019 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.server.internal.inject;
+
+import org.glassfish.jersey.internal.inject.AbstractBinder;
+import org.glassfish.jersey.internal.inject.Binder;
+import org.glassfish.jersey.internal.inject.ExtractorException;
+import org.glassfish.jersey.server.ContainerResponse;
+import org.glassfish.jersey.server.internal.LocalizationMessages;
+import org.junit.Test;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.ext.ParamConverter;
+import javax.ws.rs.ext.ParamConverterProvider;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+import java.util.concurrent.ExecutionException;
+
+import static org.junit.Assert.assertEquals;
+
+public class ParamConverterDateTest extends AbstractTest {
+
+ @Path("/")
+ public static class DateResource {
+
+ @GET
+ public String doGet(@QueryParam("d") final Date d) {
+ return "DATE";
+ }
+
+ }
+
+ @Test
+ public void testDateResource() throws ExecutionException, InterruptedException {
+ initiateWebApplication(getBinder(), ParamConverterDateTest.DateResource.class);
+ final ContainerResponse responseContext = getResponseContext(UriBuilder.fromPath("/")
+ .queryParam("d", new Date()).build().toString());
+
+ assertEquals(200, responseContext.getStatus());
+ }
+
+ private Binder getBinder() {
+ return new AbstractBinder() {
+ @Override
+ protected void configure() {
+ bind(new ParamConverterProvider() {
+
+ @Override
+ public <T> ParamConverter<T> getConverter(final Class<T> rawType,
+ final Type genericType,
+ final Annotation[] annotations) {
+ return (rawType != Date.class) ? null : new ParamConverter<T>() {
+
+ @Override
+ public T fromString(final String value) {
+ if (value == null) {
+ throw new IllegalArgumentException(
+ LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
+ );
+ }
+ try {
+ final String format = "EEE MMM dd HH:mm:ss Z yyyy";
+ final SimpleDateFormat formatter = new SimpleDateFormat(format, new Locale("US"));
+ return rawType.cast(formatter.parse(value));
+ } catch (final ParseException ex) {
+ throw new ExtractorException(ex);
+ }
+ }
+
+ @Override
+ public String toString(final T value) throws IllegalArgumentException {
+ if (value == null) {
+ throw new IllegalArgumentException(
+ LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
+ );
+ }
+ return value.toString();
+ }
+ };
+ }
+ }).to(ParamConverterProvider.class);
+ }
+ };
+ }
+}
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java
index 9b4c393..cf69fb7 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterInternalTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -39,6 +40,7 @@
import javax.ws.rs.ext.ParamConverterProvider;
import org.glassfish.jersey.internal.inject.ExtractorException;
+import org.glassfish.jersey.internal.inject.ParamConverters;
import org.glassfish.jersey.internal.util.ReflectionHelper;
import org.glassfish.jersey.internal.util.collection.ClassTypePair;
import org.glassfish.jersey.server.ApplicationHandler;
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamExceptionMappingTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamExceptionMappingTest.java
index 4df6de4..bdd148f 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamExceptionMappingTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamExceptionMappingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -49,7 +49,7 @@
* Not sure whether this is relevant anymore.
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class ParamExceptionMappingTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/PathParamAsStringTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/PathParamAsStringTest.java
index aa0a9fb..0f8a700 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/PathParamAsStringTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/PathParamAsStringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -33,7 +33,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class PathParamAsStringTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/PathParamStringConstructorTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/PathParamStringConstructorTest.java
index 313892f..1550146 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/PathParamStringConstructorTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/PathParamStringConstructorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class PathParamStringConstructorTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsPrimitiveTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsPrimitiveTest.java
index e5fbbbf..d209c17 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsPrimitiveTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsPrimitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class QueryParamAsPrimitiveTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSetPrimitiveTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSetPrimitiveTest.java
index f877741..6be3925 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSetPrimitiveTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSetPrimitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class QueryParamAsSetPrimitiveTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSetStringTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSetStringTest.java
index e11c76f..bba6993 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSetStringTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSetStringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class QueryParamAsSetStringTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSortedSetPrimitiveTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSortedSetPrimitiveTest.java
index 602a56a..3fb41d3 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSortedSetPrimitiveTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSortedSetPrimitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class QueryParamAsSortedSetPrimitiveTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSortedSetStringTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSortedSetStringTest.java
index 9ac2341..d563d19 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSortedSetStringTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsSortedSetStringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class QueryParamAsSortedSetStringTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsStringTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsStringTest.java
index 2910fca..0e4fa64 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsStringTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamAsStringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("unchecked")
public class QueryParamAsStringTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamEnumTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamEnumTest.java
index bdec8e5..e442336 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamEnumTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamEnumTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -27,7 +27,7 @@
/**
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class QueryParamEnumTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamFromStringTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamFromStringTest.java
index 952d0e5..6c9f20f 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamFromStringTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamFromStringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class QueryParamFromStringTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamSetStringConstructorTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamSetStringConstructorTest.java
index 13eb71a..f13d264 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamSetStringConstructorTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamSetStringConstructorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class QueryParamSetStringConstructorTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamSortedSetStringConstructorTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamSortedSetStringConstructorTest.java
index ab32412..00d6d11 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamSortedSetStringConstructorTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamSortedSetStringConstructorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class QueryParamSortedSetStringConstructorTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamStringConstructorTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamStringConstructorTest.java
index 85f3da4..7865463 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamStringConstructorTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/QueryParamStringConstructorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
/**
*
* @author Paul Sandoz
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class QueryParamStringConstructorTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java
index 9690d86..3877f87 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/inject/UriTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -39,7 +39,7 @@
import static org.junit.Assert.assertThat;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class UriTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AbstractNanosReservoirTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AbstractNanosReservoirTest.java
index bc65226..8feaf59 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AbstractNanosReservoirTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AbstractNanosReservoirTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class AbstractNanosReservoirTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmerTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmerTest.java
index f6008e7..3dd917e 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmerTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
import org.junit.Test;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class AggregatingTrimmerTest extends AbstractNanosReservoirTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmerZeroTimeTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmerZeroTimeTest.java
index d11e156..5a78762 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmerZeroTimeTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/AggregatingTrimmerZeroTimeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.server.internal.monitoring;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class AggregatingTrimmerZeroTimeTest extends AggregatingTrimmerTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/ResponseStatisticsImplTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/ResponseStatisticsImplTest.java
index 1482d0b..f983204 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/ResponseStatisticsImplTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/ResponseStatisticsImplTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Response statistics tests.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class ResponseStatisticsImplTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoirAggregatingTrimmerTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoirAggregatingTrimmerTest.java
index 92b9906..ebec4db 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoirAggregatingTrimmerTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoirAggregatingTrimmerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
/**
* Tests of {@link SlidingWindowTimeReservoir}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class SlidingWindowTimeReservoirAggregatingTrimmerTest extends SlidingWindowTimeReservoirTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoirTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoirTest.java
index dd7acf1..fc02ae7 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoirTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/SlidingWindowTimeReservoirTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* Tests of {@link SlidingWindowTimeReservoir}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class SlidingWindowTimeReservoirTest extends AbstractNanosReservoirTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/TimeWindowStatisticsImplTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/TimeWindowStatisticsImplTest.java
index e55970a..b6ca7c4 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/TimeWindowStatisticsImplTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/monitoring/TimeWindowStatisticsImplTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
* Tests of {@link TimeWindowStatisticsImpl}.
*
* @author Miroslav Fuksa
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class TimeWindowStatisticsImplTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/process/ProxyInjectablesTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/process/ProxyInjectablesTest.java
index b33ecb9..e4675ba 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/process/ProxyInjectablesTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/process/ProxyInjectablesTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -47,7 +47,7 @@
* Test if request scoped injection points are injected without using
* dynamic proxies.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ProxyInjectablesTest extends AbstractTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/routing/UriRoutingContextTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/routing/UriRoutingContextTest.java
index 390c608..598b03f 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/routing/UriRoutingContextTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/routing/UriRoutingContextTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -36,7 +36,7 @@
import static org.junit.Assert.fail;
/**
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class UriRoutingContextTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/BundleSchemeScannerTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/BundleSchemeScannerTest.java
index d667533..5315f69 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/BundleSchemeScannerTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/BundleSchemeScannerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
import org.junit.Test;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class BundleSchemeScannerTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/CompositeResourceFinderTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/CompositeResourceFinderTest.java
index 7bbcf52..ef817be 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/CompositeResourceFinderTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/CompositeResourceFinderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -27,7 +27,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CompositeResourceFinderTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/sonar/SonarJerseyServerTest.java b/core-server/src/test/java/org/glassfish/jersey/server/internal/sonar/SonarJerseyServerTest.java
index a7b22a0..0c0090d 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/sonar/SonarJerseyServerTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/internal/sonar/SonarJerseyServerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +20,7 @@
import org.junit.Test;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class SonarJerseyServerTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/AcceptAnnotatedReaderWriterTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/AcceptAnnotatedReaderWriterTest.java
index 050dad7..7ac59fb 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/AcceptAnnotatedReaderWriterTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/AcceptAnnotatedReaderWriterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -51,7 +51,7 @@
import static org.junit.Assert.assertThat;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class AcceptAnnotatedReaderWriterTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/AsyncContentAndEntityTypeTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/AsyncContentAndEntityTypeTest.java
index 352852e..cdb11f8 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/AsyncContentAndEntityTypeTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/AsyncContentAndEntityTypeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,7 +44,7 @@
/**
* Test of fix for issues JERSEY-1088 and JERSEY-1089.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncContentAndEntityTypeTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/ConsumeProduceSimpleTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/ConsumeProduceSimpleTest.java
index 1099392..a67be6c 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/ConsumeProduceSimpleTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/ConsumeProduceSimpleTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Taken from Jersey 1: jersey-tests:com.sun.jersey.impl.resource.ConsumeProduceSimpleTest.java
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ConsumeProduceSimpleTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/HeadSubResourceMethodTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/HeadSubResourceMethodTest.java
index 72877d8..f619b1f 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/HeadSubResourceMethodTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/HeadSubResourceMethodTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class HeadSubResourceMethodTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/HeadTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/HeadTest.java
index 8f6c765..c91ba14 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/HeadTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/HeadTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -46,7 +46,7 @@
/**
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class HeadTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java
index c78d435..5934f4a 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/MethodListTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,8 +18,10 @@
import org.junit.Test;
+import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.Assert.assertTrue;
@@ -54,6 +56,33 @@
private void c() {}
}
+ public class CSynthetic {
+ class CWithField {
+ private int x;
+ }
+
+ public int a() {
+ return new CWithField().x;
+ }
+
+ public void b(int x) {
+ new CWithField().x = x;
+ }
+ }
+
+ public class CBridgeClass implements Comparator<Integer> {
+
+ @Override
+ public int compare(Integer o1, Integer o2) {
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return false;
+ }
+ }
+
@Test
public void testClassPublicMethods() {
test(CPublic.class);
@@ -74,12 +103,30 @@
test(CPrivate.class, true);
}
+ @Test
+ public void testSyntheticMethods() {
+ assertTrue(CSynthetic.CWithField.class.getDeclaredMethods().length == 2);
+
+ MethodList ml = new MethodList(CSynthetic.CWithField.class, true);
+ assertTrue(!ml.iterator().hasNext());
+ }
+
+ @Test
+ public void testBridgeMethods() {
+ assertTrue(CBridgeClass.class.getDeclaredMethods().length == 3);
+
+ MethodList ml = new MethodList(CBridgeClass.class, true);
+ AtomicInteger count = new AtomicInteger(0);
+ ml.forEach(x -> count.addAndGet(1));
+ assertTrue(count.get() == 2);
+ }
+
private void test(Class c) {
test(c, false);
}
private void test(Class c, boolean privateMethods) {
- MethodList ml = new MethodList(CPublic.class, privateMethods);
+ MethodList ml = new MethodList(c, privateMethods);
Set<String> s = new HashSet<String>();
for (AnnotatedMethod am : ml) {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/MixedResourceConfigurationTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/MixedResourceConfigurationTest.java
index 431a6e5..db385d2 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/MixedResourceConfigurationTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/MixedResourceConfigurationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -36,7 +36,7 @@
/**
* Test of mixed (programmatic and annotation-based) resource configuration.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class MixedResourceConfigurationTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/OptionsSubResourceMethodTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/OptionsSubResourceMethodTest.java
index 4cedbe5..8bd12d8 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/OptionsSubResourceMethodTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/OptionsSubResourceMethodTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -43,7 +43,7 @@
/**
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class OptionsSubResourceMethodTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/OptionsTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/OptionsTest.java
index aa4dae9..1fca50b 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/OptionsTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/OptionsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -56,7 +56,7 @@
/**
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Miroslav Fuksa
*/
public class OptionsTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/ParameterTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/ParameterTest.java
index 00e51ad..bf895fe 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/ParameterTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/ParameterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
/**
* Parameter model creation test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ParameterTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/ProgrammaticResourceMethodsTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/ProgrammaticResourceMethodsTest.java
index 66d60e6..f8a539d 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/ProgrammaticResourceMethodsTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/ProgrammaticResourceMethodsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -37,8 +37,8 @@
/**
* Test of programmatic resource method additions.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class ProgrammaticResourceMethodsTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/ResourcePathOverrideTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/ResourcePathOverrideTest.java
index 36de62d..ee3ccc7 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/ResourcePathOverrideTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/ResourcePathOverrideTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* Test of resource path overriding via programmatic API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ResourcePathOverrideTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/SubResourceHttpMethodsTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/SubResourceHttpMethodsTest.java
index 299c53a..53910bc 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/SubResourceHttpMethodsTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/SubResourceHttpMethodsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -33,7 +33,7 @@
* Taken from Jersey-1: jersey-tests:com.sun.jersey.impl.subresources.SubResourceHttpMethodsTest
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class SubResourceHttpMethodsTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/SubResourceNullTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/SubResourceNullTest.java
index c1938df..724511c 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/SubResourceNullTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/SubResourceNullTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -31,7 +31,7 @@
* Taken from Jersey-1: jersey-tests:com.sun.jersey.impl.subresources.SubResourceNullTest
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class SubResourceNullTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/model/ValidatorTest.java b/core-server/src/test/java/org/glassfish/jersey/server/model/ValidatorTest.java
index a9f6fca..5b7a801 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/model/ValidatorTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/model/ValidatorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -78,7 +78,7 @@
/**
* Taken from Jersey 1: jersey-server:com.sun.jersey.server.impl.modelapi.validation.ResourceModelValidatorTest.java
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ValidatorTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java b/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java
index a74ec77..bd929dc 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/modelapi/annotation/IntrospectionModellerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -43,7 +43,7 @@
import static org.junit.Assert.assertThat;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class IntrospectionModellerTest {
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/monitoring/MonitoringFeatureTest.java b/core-server/src/test/java/org/glassfish/jersey/server/monitoring/MonitoringFeatureTest.java
index ba1d58b..e882ce8 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/monitoring/MonitoringFeatureTest.java
+++ b/core-server/src/test/java/org/glassfish/jersey/server/monitoring/MonitoringFeatureTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Test of registration of {@link MonitoringFeature}.
* @author Miroslav Fuksa
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class MonitoringFeatureTest {
diff --git a/core-server/src/test/resources/server.policy b/core-server/src/test/resources/server.policy
index 6c9bd5b..e37eeda 100644
--- a/core-server/src/test/resources/server.policy
+++ b/core-server/src/test/resources/server.policy
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -58,6 +58,8 @@
permission org.jboss.vfs.VirtualFilePermission "<<ALL FILES>>", "read";
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc.*";
+ permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
+ permission java.lang.RuntimePermission "reflectionFactoryAccess";
};
grant codebase "file:${project.build.directory}/classes/-" {
diff --git a/docs/pom.xml b/docs/pom.xml
index 8b08277..dea61b7 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-documentation</artifactId>
<packaging>pom</packaging>
@@ -94,7 +94,7 @@
<calloutsExtension>true</calloutsExtension>
<highlightDefaultLanguage />
<highlightSource>true</highlightSource>
- <htmlStylesheet>/documentation.css</htmlStylesheet>
+ <htmlStylesheet>/jersey.github.io/documentation.css</htmlStylesheet>
<!--<htmlStylesheet>https://jersey.java.net/documentation.css</htmlStylesheet>-->
<linenumberingExtension>true</linenumberingExtension>
<linenumberingEveryNth>1</linenumberingEveryNth>
diff --git a/etc/epl.svg b/etc/epl.svg
new file mode 100644
index 0000000..ae31efb
--- /dev/null
+++ b/etc/epl.svg
@@ -0,0 +1,18 @@
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="100" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h47v20H0z"/><path fill="#97ca00" d="M47 0h53v20H47z"/><path fill="url(#b)" d="M0 0h100v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">license</text><text x="245" y="140" transform="scale(.1)" textLength="370">license</text><text x="725" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">EPL-2.0</text><text x="725" y="140" transform="scale(.1)" textLength="430">EPL-2.0</text></g> </svg>
\ No newline at end of file
diff --git a/etc/gpl.svg b/etc/gpl.svg
new file mode 100644
index 0000000..73f820b
--- /dev/null
+++ b/etc/gpl.svg
@@ -0,0 +1,18 @@
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="132" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="132" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h47v20H0z"/><path fill="#97ca00" d="M47 0h85v20H47z"/><path fill="url(#b)" d="M0 0h132v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">license</text><text x="245" y="140" transform="scale(.1)" textLength="370">license</text><text x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="750">GPL-2.0+CPE</text><text x="885" y="140" transform="scale(.1)" textLength="750">GPL-2.0+CPE</text></g> </svg>
\ No newline at end of file
diff --git a/etc/jenkins/documentation/build_documentation.sh b/etc/jenkins/documentation/build_documentation.sh
new file mode 100755
index 0000000..691a2d1
--- /dev/null
+++ b/etc/jenkins/documentation/build_documentation.sh
@@ -0,0 +1,37 @@
+#!/bin/bash -lex
+
+#
+# Copyright (c) 2019 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
+#
+
+#Environment paths for Jenkins
+
+#TOOLS_PREFIX=/opt/tools
+#JAVA_PREFIX=/opt/tools/java/oracle
+#MVN_HOME=/opt/tools/apache-maven/latest
+#JAVA_HOME=/opt/tools/java/oracle/jdk-8/latest
+#PATH=/opt/tools/apache-maven/latest/bin:/opt/tools/java/oracle/jdk-8/latest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+# script shall be run before documentation generation to build jersey, site for jersey and docbook. Ideally it shall be run from Jenkins but
+# if Jenkins does not provide required tools - java, maven, python, perl - to generate documentation the script can be run from local host.
+
+# IMPORTANT - modify environmen.sh before running the script.
+source environment.sh
+
+mvn clean install -V -q -PtestsSkip,checkstyleSkip -Dtests.excluded '-Dmaven.test.skip=true'
+
+mvn clean site -V -q -PtestsSkip,checkstyleSkip -Dtests.excluded -Dtests.excluded -Djavadoc.stylesheet=etc/config/javadoc-stylesheet.css -Dmaven.test.skip=true -Ddependency.locations.enabled=false -Dbundles.excluded -Djersey.version=${RELEASE_VERSION}
+
+mvn clean install -V -q -e -U -B -f docs/pom.xml -Djersey.version=$RELEASE_VERSION
\ No newline at end of file
diff --git a/etc/jenkins/documentation/environment.sh b/etc/jenkins/documentation/environment.sh
new file mode 100644
index 0000000..51f8eec
--- /dev/null
+++ b/etc/jenkins/documentation/environment.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#
+# Copyright (c) 2019 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
+#
+
+#ALL main input parameters are collected here. Ideally these shall be set as input parameters for
+#Jenkins job but if for some reason the script is being run from local host this file shall be used
+#and mdified accordingly to provide correct intput data for the main script
+
+export RELEASE_VERSION='2.29.1'
+export WEBSITE_URL='https://github.com/eclipse-ee4j/jersey.github.io'
+export BRANCH_SPECIFIER='master'
+export UPDATE_LATEST=true
+export WEBSITE_SOURCE_REPO='https://github.com/eclipse-ee4j/jersey-web'
+export WORKSPACE=`pwd`
+export DRY_RUN=false
+
+export USER_NAME='' #ideally shall be taken from job's credentials but for local run it's user name
+export USER_TOKEN='' #ideally shall be taken from job's credentials but for local run it's user password or token
diff --git a/etc/jenkins/documentation/generate_documentation_after_build.sh b/etc/jenkins/documentation/generate_documentation_after_build.sh
new file mode 100755
index 0000000..fff1e89
--- /dev/null
+++ b/etc/jenkins/documentation/generate_documentation_after_build.sh
@@ -0,0 +1,165 @@
+#!/bin/bash -lex
+
+#
+# Copyright (c) 2019 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
+#
+
+#Environment paths for Jenkins
+
+#TOOLS_PREFIX=/opt/tools
+#JAVA_PREFIX=/opt/tools/java/oracle
+#MVN_HOME=/opt/tools/apache-maven/latest
+#JAVA_HOME=/opt/tools/java/oracle/jdk-8/latest
+#PATH=/opt/tools/apache-maven/latest/bin:/opt/tools/java/oracle/jdk-8/latest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+# IMPORTANT - modify environmen.sh before running the script.
+source environment.sh
+
+#Script REQUIRES Curl, Perl, Python, Git and Maven (3.6.0) to be installed on running host.
+#Configures and moves documentation to proper locations,
+#Generates release notes by milestone (same as version number)
+#Moves release notes to proper location
+#Sends release notes to GitHub (rest api)
+#Commits all modifications to proper repositories (web and src-web)
+
+
+DIRS="$RELEASE_VERSION"
+if $UPDATE_LATEST;
+then
+ DIRS="latest $DIRS"
+fi
+
+#export PATH=/opt/csw/bin:$PATH
+WEB_DIR=$WORKSPACE/target/jersey-web
+WEB_SRC_DIR=$WORKSPACE/target/jersey-web-src
+
+
+function copyDocs {
+ APIDOCS_DIR=$WEB_DIR/apidocs/$1
+ DOCS_DIR=$WEB_DIR/documentation/$1
+
+ #
+ # API docs
+ #
+ if test ! -e $APIDOCS_DIR ; then
+ mkdir -p $APIDOCS_DIR
+ fi
+ cd $APIDOCS_DIR
+
+ rm -rf jersey || true
+ cp -R $WORKSPACE/target/site/apidocs ./jersey
+
+ #
+ # user guide
+ #
+ rm -rf $DOCS_DIR || true
+ mkdir -p $DOCS_DIR
+ cp -r $WORKSPACE/docs/target/docbook/index/* $DOCS_DIR
+ rm $DOCS_DIR/*.fo || true
+}
+
+if test -e $WEB_DIR ; then
+ rm -rf $WEB_DIR
+fi
+
+# would couse shallow reject: git clone --depth 1 $WEBSITE_URL $WEB_DIR
+git clone $WEBSITE_URL $WEB_DIR
+git clone $WEBSITE_SOURCE_REPO $WEB_SRC_DIR
+
+cd $WEB_DIR
+
+for dir in $DIRS; do
+ copyDocs $dir
+done
+
+cd $WEB_DIR
+
+git config --local user.email "jersey-bot@eclipse.org"
+git config --local user.name "jersey-bot"
+git add -A .
+git diff --cached --exit-code || git commit -m "[jenkins] automatic javadoc and documentation update [$RELEASE_VERSION @ $BRANCH_SPECIFIER]"
+
+# [1] update site
+mvn versions:set -DnewVersion=$RELEASE_VERSION -DgenerateBackupPoms=false -f $WEB_SRC_DIR/pom.xml
+
+# [2] update scm.md
+perl -0777 -i' ' -pe 's@(<td>master</td>.*?</tr>)@$1\n'\
+' <tr>\n'\
+' <td>'$RELEASE_VERSION'</td>\n'\
+' <td>This is the Jersey '$RELEASE_VERSION' release tag. A sustaining branch for Jersey '$RELEASE_VERSION'\n'\
+' release will be created from the tag if necessary.</td>\n'\
+' </tr>@igs' \
+$WEB_SRC_DIR/src/site/markdown/scm.md
+
+### [] run post-site
+##mvn clean post-site -f $WEB_SRC_DIR/pom.xml
+
+mvn clean site -f $WEB_SRC_DIR/pom.xml
+cp -r $WEB_SRC_DIR/target/site/* .
+cp -a $WEB_SRC_DIR/src/main/templates/release-note.html release-notes/${RELEASE_VERSION}.html
+
+# [] add pull requests to the release notes
+MILESTONE_ID=$(curl 'https://api.github.com/repos/eclipse-ee4j/jersey/milestones' | python -c "
+import json,sys,os
+obj=json.load(sys.stdin)
+[sys.stdout.write(str(a['number']) + os.linesep if a['title']=='"$RELEASE_VERSION"' else '') for a in obj]
+")
+
+PULL_REQUESTS=""
+[ "$MILESTONE_ID" -eq "$MILESTONE_ID" ] && PULL_REQUESTS=$(curl 'https://api.github.com/repos/eclipse-ee4j/jersey/issues?state=closed&milestone='$MILESTONE_ID | python -c "
+import json,sys,os;
+obj=json.load(sys.stdin);
+output = ''
+for a in obj:
+ if 'pull_request' in a:
+ output += ' <li>[<a href=\'{0}\'>Pull {1}</a>] - {2}</li>\n'.format(str(a['pull_request']['html_url']), str(a['number']), str(a['title']))
+ else:
+ output += ' <li>[<a href=\'{0}\'>Issue {1}</a>] - {2}</li>\n'.format(str(a['html_url']), str(a['number']), str(a['title']))
+if output != '':
+ print '<h2>Issues and Pull Requests</h2>\n<ul>\n{}</ul>'.format(output)
+")
+
+if [ "$PULL_REQUESTS" != "" ]; then
+ perl -0777 -i' ' -pe 's|<!-- PULL_REQUESTS_PLACEHOLDER -->|'"$(printf '%s' "$PULL_REQUESTS" | sed -e 's/[\|$@&]/\\&/g')"'|igs' release-notes/$RELEASE_VERSION.html
+fi
+
+# [] update the template with the current release
+perl -0777 -i' ' -pe 's@(<h2>Previous releases</h2>.*?<ul>)@$1\n'\
+' <li><a href="'$RELEASE_VERSION'.html">Jersey '$RELEASE_VERSION' Release Notes</a></li>@igs' \
+$WEB_SRC_DIR/src/main/templates/release-note.html
+
+git add -A .
+git diff --cached --exit-code || git commit -m "[jenkins] automatic project-info and release notes update [$RELEASE_VERSION @ $BRANCH_SPECIFIER]"
+
+GITHUB_RELEASE_NOTES='{
+ "tag_name": "'"$RELEASE_VERSION"'",
+ "name": "'"$RELEASE_VERSION"'",
+ "body": "'"$(printf '%s' "$PULL_REQUESTS" | sed -e 's/["]/\\&/g' | perl -pe 's/\n/\\n/')"'"
+ }'
+
+echo "Github release notes: $GITHUB_RELEASE_NOTES"
+
+if [ "$DRY_RUN" = "false" ]; then
+
+ echo "Publishing release on Github"
+ curl -u "${USER_NAME}:${USER_TOKEN}" -X POST -vvv --data "$GITHUB_RELEASE_NOTES" \
+ -H "Content-type: application/json" https://api.github.com/repos/eclipse-ee4j/jersey/releases
+
+ echo "Pushing Web sources to $WEBSITE_URL"
+ #git push origin master
+else
+ echo "Dry run .. not pushing to the master"
+ #git push origin master --dry-run
+fi
diff --git a/etc/jenkins/documentation/release_notes.sh b/etc/jenkins/documentation/release_notes.sh
new file mode 100755
index 0000000..901bb0a
--- /dev/null
+++ b/etc/jenkins/documentation/release_notes.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Copyright (c) 2019 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
+#
+
+# IMPORTANT - modify environmen.sh before running the script.
+source environment.sh
+
+#Script REQUIRES Curl, Perl and Python to be present in environment
+
+#Generates and sends release notes to GitHub. Release notes are generated by milestone which corresponds to version name.
+#if it is required to generate release notes by label, script shall be modified accordingly
+
+WEB_DIR=$WORKSPACE/target/jersey-web
+WEB_SRC_DIR=$WORKSPACE/target/jersey-web-src
+
+cd $WEB_DIR
+
+# [] add pull requests to the release notes
+MILESTONE_ID=$(curl 'https://api.github.com/repos/eclipse-ee4j/jersey/milestones' | python -c "
+import json,sys,os
+obj=json.load(sys.stdin)
+[sys.stdout.write(str(a['number']) + os.linesep if a['title']=='"$RELEASE_VERSION"' else '') for a in obj]
+")
+
+PULL_REQUESTS=""
+[ "$MILESTONE_ID" -eq "$MILESTONE_ID" ] && PULL_REQUESTS=$(curl 'https://api.github.com/repos/eclipse-ee4j/jersey/issues?state=closed&milestone='$MILESTONE_ID | python -c "
+import json,sys,os;
+obj=json.load(sys.stdin);
+output = ''
+for a in obj:
+ if 'pull_request' in a:
+ output += ' <li>[<a href=\'{0}\'>Pull {1}</a>] - {2}</li>\n'.format(str(a['pull_request']['html_url']), str(a['number']), str(a['title']))
+ else:
+ output += ' <li>[<a href=\'{0}\'>Issue {1}</a>] - {2}</li>\n'.format(str(a['html_url']), str(a['number']), str(a['title']))
+if output != '':
+ print '<h2>Issues and Pull Requests</h2>\n<ul>\n{}</ul>'.format(output)
+")
+
+GITHUB_RELEASE_NOTES='{
+ "tag_name": "'"$RELEASE_VERSION"'",
+ "name": "'"$RELEASE_VERSION"'",
+ "body": "'"$(printf '%s' "$PULL_REQUESTS" | sed -e 's/["]/\\&/g' | perl -pe 's/\n/\\n/')"'"
+ }'
+
+echo "Github release notes: $GITHUB_RELEASE_NOTES"
+
+ echo "Publishing release on Github"
+ curl -u "${USER_NAME}:${USER_TOKEN}" -X POST -vvv --data "$GITHUB_RELEASE_NOTES" \
+ -H "Content-type: application/json" https://api.github.com/repos/eclipse-ee4j/jersey/releases
+
+ echo "Pushing Web sources to $WEBSITE_URL"
diff --git a/examples/assemblies/pom.xml b/examples/assemblies/pom.xml
index b1c7512..230f5d3 100644
--- a/examples/assemblies/pom.xml
+++ b/examples/assemblies/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>assemblies</artifactId>
diff --git a/examples/bookmark-em/pom.xml b/examples/bookmark-em/pom.xml
index 8720578..73c2a91 100644
--- a/examples/bookmark-em/pom.xml
+++ b/examples/bookmark-em/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>bookmark-em</artifactId>
diff --git a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntity.java b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntity.java
index e4d4d77..8092a01 100644
--- a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntity.java
+++ b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -28,7 +28,7 @@
/**
* Entity class BookmarkEntity.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Entity
@Table(name = "BOOKMARKS")
diff --git a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntityPK.java b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntityPK.java
index ff2c36c..07ebe52 100644
--- a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntityPK.java
+++ b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntityPK.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* Primary Key class BookmarkEntityPK for entity class BookmarkEntity.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("UnusedDeclaration")
@Embeddable
diff --git a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/UserEntity.java b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/UserEntity.java
index 06a2e69..1a91d2b 100644
--- a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/UserEntity.java
+++ b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/UserEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
/**
* Entity class UserEntity.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Entity
@Table(name = "USERS")
diff --git a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/BookmarkResource.java b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/BookmarkResource.java
index 3f1bc40..ab10166 100644
--- a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/BookmarkResource.java
+++ b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/BookmarkResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -33,7 +33,7 @@
import org.codehaus.jettison.json.JSONObject;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Paul Sandoz
* @author Michal Gajdos
*/
diff --git a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/BookmarksResource.java b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/BookmarksResource.java
index 7b566e3..8bc7ed4 100644
--- a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/BookmarksResource.java
+++ b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/BookmarksResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -36,7 +36,7 @@
import org.codehaus.jettison.json.JSONObject;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Paul Sandoz
* @author Michal Gajdos
*/
diff --git a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/UserResource.java b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/UserResource.java
index 3ffb842..d551f11 100644
--- a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/UserResource.java
+++ b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/UserResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -31,7 +31,7 @@
import org.codehaus.jettison.json.JSONObject;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Paul Sandoz
* @author Michal Gajdos
*/
diff --git a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/UsersResource.java b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/UsersResource.java
index 5c7025a..e2f3060 100644
--- a/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/UsersResource.java
+++ b/examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/resource/UsersResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -32,7 +32,7 @@
import org.codehaus.jettison.json.JSONArray;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/users/")
@ManagedBean
diff --git a/examples/bookmark-em/src/test/java/org/glassfish/jersey/examples/bookmark_em/BookmarkTest.java b/examples/bookmark-em/src/test/java/org/glassfish/jersey/examples/bookmark_em/BookmarkTest.java
index 0dab7fa..5bdba8a 100644
--- a/examples/bookmark-em/src/test/java/org/glassfish/jersey/examples/bookmark_em/BookmarkTest.java
+++ b/examples/bookmark-em/src/test/java/org/glassfish/jersey/examples/bookmark_em/BookmarkTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -36,7 +36,7 @@
/**
* TODO un-ignore once Jersey supports @ManagedBean
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
*/
@Ignore("un-ignore once Jersey supports @ManagedBean")
diff --git a/examples/bookmark/pom.xml b/examples/bookmark/pom.xml
index 6a66f19..769f6be 100644
--- a/examples/bookmark/pom.xml
+++ b/examples/bookmark/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>bookmark</artifactId>
diff --git a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntity.java b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntity.java
index 2c692bf..190644a 100644
--- a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntity.java
+++ b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
/**
* Entity class BookmarkEntity.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Entity
@Table(name = "BOOKMARKS")
diff --git a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntityPK.java b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntityPK.java
index 144bc8a..67be556 100644
--- a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntityPK.java
+++ b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntityPK.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* Primary Key class BookmarkEntityPK for entity class BookmarkEntity.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("UnusedDeclaration")
@Embeddable
diff --git a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/UserEntity.java b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/UserEntity.java
index 425abe2..2389e3a 100644
--- a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/UserEntity.java
+++ b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/UserEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
/**
* Entity class UserEntity.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("UnusedDeclaration")
@Entity
diff --git a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/BookmarkResource.java b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/BookmarkResource.java
index 6ed3f0d..0640805 100644
--- a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/BookmarkResource.java
+++ b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/BookmarkResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -33,7 +33,7 @@
import org.codehaus.jettison.json.JSONObject;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Paul Sandoz
* @author Michal Gajdos
*/
diff --git a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/BookmarksResource.java b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/BookmarksResource.java
index c03aaa5..5791d5d 100644
--- a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/BookmarksResource.java
+++ b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/BookmarksResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -36,7 +36,7 @@
import org.codehaus.jettison.json.JSONObject;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Paul Sandoz
* @author Michal Gajdos
*/
diff --git a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/UserResource.java b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/UserResource.java
index 1de92f8..7cbe531 100644
--- a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/UserResource.java
+++ b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/UserResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -30,7 +30,7 @@
import org.codehaus.jettison.json.JSONObject;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Paul Sandoz
* @author Michal Gajdos
*/
diff --git a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/UsersResource.java b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/UsersResource.java
index 69b4b0c..7ca5739 100644
--- a/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/UsersResource.java
+++ b/examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/resource/UsersResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -29,7 +29,7 @@
import org.codehaus.jettison.json.JSONArray;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/users/")
public class UsersResource {
diff --git a/examples/bookmark/src/test/java/org/glassfish/jersey/examples/bookmark/BookmarkTest.java b/examples/bookmark/src/test/java/org/glassfish/jersey/examples/bookmark/BookmarkTest.java
index 80e8637..2ecbfef 100644
--- a/examples/bookmark/src/test/java/org/glassfish/jersey/examples/bookmark/BookmarkTest.java
+++ b/examples/bookmark/src/test/java/org/glassfish/jersey/examples/bookmark/BookmarkTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -34,7 +34,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
diff --git a/examples/bookstore-webapp/pom.xml b/examples/bookstore-webapp/pom.xml
index d8ac509..8cd4961 100644
--- a/examples/bookstore-webapp/pom.xml
+++ b/examples/bookstore-webapp/pom.xml
@@ -35,7 +35,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>bookstore-webapp</artifactId>
diff --git a/examples/cdi-webapp/pom.xml b/examples/cdi-webapp/pom.xml
index b418871..d2d26a5 100644
--- a/examples/cdi-webapp/pom.xml
+++ b/examples/cdi-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-webapp</artifactId>
diff --git a/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/EchoParamFieldResource.java b/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/EchoParamFieldResource.java
index 0526731..90b26e2 100644
--- a/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/EchoParamFieldResource.java
+++ b/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/EchoParamFieldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
* Shows injection of path and query parameter into a managed bean.
*
* @author Roberto Chinnici
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ManagedBean
@Path("echofield/{b}")
diff --git a/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MyApplication.java b/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MyApplication.java
index 608799b..35f1464 100644
--- a/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MyApplication.java
+++ b/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -19,7 +19,7 @@
/**
* JAX-RS application.
*
- * @author Jonathan Benoit (jonathan.benoit at oracle.com)
+ * @author Jonathan Benoit
*/
@ApplicationPath("/*")
public class MyApplication extends Application {
diff --git a/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MyOtherResource.java b/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MyOtherResource.java
index 1bbb829..00ab878 100644
--- a/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MyOtherResource.java
+++ b/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MyOtherResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -30,7 +30,7 @@
* Shows injection of context objects and path parameters into the fields of a managed bean.
*
* @author Roberto Chinnici
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ManagedBean
@RequestScoped
diff --git a/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MySingletonResource.java b/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MySingletonResource.java
index eb6c410..d8408df 100644
--- a/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MySingletonResource.java
+++ b/examples/cdi-webapp/src/main/java/org/glassfish/jersey/examples/cdi/resources/MySingletonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -28,7 +28,7 @@
* Shows injection of context objects into the fields of a managed bean.
*
* @author Roberto Chinnici
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ManagedBean
@ApplicationScoped
diff --git a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/CdiTest.java b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/CdiTest.java
index e85295e..bfc6096 100644
--- a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/CdiTest.java
+++ b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/CdiTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -30,7 +30,7 @@
* $AS_HOME/bin/asadmin deploy target/cdi-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiTest extends JerseyTest {
diff --git a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/EchoParamBeanTest.java b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/EchoParamBeanTest.java
index 619671a..195dbc2 100644
--- a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/EchoParamBeanTest.java
+++ b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/EchoParamBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* Test for the echo with injected param managed bean resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class EchoParamBeanTest extends CdiTest {
diff --git a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/EchoResourceTest.java b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/EchoResourceTest.java
index 90664a7..fd76151 100644
--- a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/EchoResourceTest.java
+++ b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/EchoResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* Test for the echo resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class EchoResourceTest extends CdiTest {
diff --git a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/HelloworldTest.java b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/HelloworldTest.java
index 4db5323..006634c 100644
--- a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/HelloworldTest.java
+++ b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/HelloworldTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* Test for the helloworld resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class HelloworldTest extends CdiTest {
diff --git a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/PerApplicationBeanTest.java b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/PerApplicationBeanTest.java
index f3ec4d2..45c4087 100644
--- a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/PerApplicationBeanTest.java
+++ b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/PerApplicationBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Test for the application scoped managed bean resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class PerApplicationBeanTest extends CdiTest {
diff --git a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/PerRequestBeanTest.java b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/PerRequestBeanTest.java
index 1532cc6..a758d15 100644
--- a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/PerRequestBeanTest.java
+++ b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/PerRequestBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
/**
* Test for the request scoped managed bean resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class PerRequestBeanTest extends CdiTest {
diff --git a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/ProxyScopeAlignmentTest.java b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/ProxyScopeAlignmentTest.java
index b963e3d..0787114 100644
--- a/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/ProxyScopeAlignmentTest.java
+++ b/examples/cdi-webapp/src/test/java/org/glassfish/jersey/examples/cdi/resources/ProxyScopeAlignmentTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -26,7 +26,7 @@
* Ensure CDI and JAX-RS scopes are well aligned, so that dynamic proxies
* are only created when needed.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class ProxyScopeAlignmentTest extends CdiTest {
diff --git a/examples/clipboard-programmatic/pom.xml b/examples/clipboard-programmatic/pom.xml
index eab8bf4..9ff784d 100644
--- a/examples/clipboard-programmatic/pom.xml
+++ b/examples/clipboard-programmatic/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>clipboard-programmatic</artifactId>
diff --git a/examples/clipboard-programmatic/src/main/java/org/glassfish/jersey/examples/clipboard/App.java b/examples/clipboard-programmatic/src/main/java/org/glassfish/jersey/examples/clipboard/App.java
index e96397f..d4976ce 100644
--- a/examples/clipboard-programmatic/src/main/java/org/glassfish/jersey/examples/clipboard/App.java
+++ b/examples/clipboard-programmatic/src/main/java/org/glassfish/jersey/examples/clipboard/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -30,7 +30,7 @@
* This is the example entry point, where Jersey application for the example
* gets populated and published using the Grizzly 2 HTTP container.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/clipboard-programmatic/src/main/java/org/glassfish/jersey/examples/clipboard/Clipboard.java b/examples/clipboard-programmatic/src/main/java/org/glassfish/jersey/examples/clipboard/Clipboard.java
index 2788c72..a7e8638 100644
--- a/examples/clipboard-programmatic/src/main/java/org/glassfish/jersey/examples/clipboard/Clipboard.java
+++ b/examples/clipboard-programmatic/src/main/java/org/glassfish/jersey/examples/clipboard/Clipboard.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
/**
* Simple clipboard implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class Clipboard {
private final StringBuffer content = new StringBuffer();
diff --git a/examples/clipboard/pom.xml b/examples/clipboard/pom.xml
index 14449b8..2f524bf 100644
--- a/examples/clipboard/pom.xml
+++ b/examples/clipboard/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>clipboard</artifactId>
diff --git a/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/App.java b/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/App.java
index 49aed24..12998e9 100644
--- a/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/App.java
+++ b/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -32,8 +32,8 @@
* This is the example entry point, where Jersey application for the example
* gets populated and published using the Grizzly 2 HTTP container.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardData.java b/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardData.java
index 6b5b4d5..7693a37 100644
--- a/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardData.java
+++ b/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -14,7 +14,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ClipboardData {
diff --git a/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardDataProvider.java b/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardDataProvider.java
index d24eb25..9f49c89 100644
--- a/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardDataProvider.java
+++ b/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardDataProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -33,7 +33,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public abstract class ClipboardDataProvider implements MessageBodyWriter, MessageBodyReader {
diff --git a/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardResource.java b/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardResource.java
index f167d5c..ca09ce5 100644
--- a/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardResource.java
+++ b/examples/clipboard/src/main/java/org/glassfish/jersey/examples/clipboard/ClipboardResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -32,8 +32,8 @@
* A simple clipboard is simulated which is capable of handling
* text data only.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Marek Potociar
+ * @author Jakub Podlesak
*/
@Path("clipboard")
public class ClipboardResource {
diff --git a/examples/declarative-linking/pom.xml b/examples/declarative-linking/pom.xml
index eb1315d..90056c7 100644
--- a/examples/declarative-linking/pom.xml
+++ b/examples/declarative-linking/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>declarative-linking</artifactId>
@@ -87,6 +87,18 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/declarative-linking/src/test/java/org/glassfish/jersey/examples/linking/LinkWebAppTest.java b/examples/declarative-linking/src/test/java/org/glassfish/jersey/examples/linking/LinkWebAppTest.java
index f5fb724..1ff3435 100644
--- a/examples/declarative-linking/src/test/java/org/glassfish/jersey/examples/linking/LinkWebAppTest.java
+++ b/examples/declarative-linking/src/test/java/org/glassfish/jersey/examples/linking/LinkWebAppTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Naresh (Srinivas.Bhimisetty@Sun.Com)
+ * @author Naresh (Srinivas Bhimisetty)
* @author Gerard Davison (gerard.davison at oracle.com)
*/
public class LinkWebAppTest extends JerseyTest {
diff --git a/examples/entity-filtering-security/pom.xml b/examples/entity-filtering-security/pom.xml
index d755fd0..773e8c1 100644
--- a/examples/entity-filtering-security/pom.xml
+++ b/examples/entity-filtering-security/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>entity-filtering-security</artifactId>
diff --git a/examples/entity-filtering-selectable/pom.xml b/examples/entity-filtering-selectable/pom.xml
index da88745..100fcbc 100644
--- a/examples/entity-filtering-selectable/pom.xml
+++ b/examples/entity-filtering-selectable/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>entity-filtering-selectable</artifactId>
diff --git a/examples/entity-filtering-selectable/src/main/java/org/glassfish/jersey/examples/entityfiltering/selectable/App.java b/examples/entity-filtering-selectable/src/main/java/org/glassfish/jersey/examples/entityfiltering/selectable/App.java
index 67c0082..e8df6e7 100644
--- a/examples/entity-filtering-selectable/src/main/java/org/glassfish/jersey/examples/entityfiltering/selectable/App.java
+++ b/examples/entity-filtering-selectable/src/main/java/org/glassfish/jersey/examples/entityfiltering/selectable/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Java application class starting Grizzly2 server with Entity Data Filtering with query parameters.
*
- * @author Andy Pemberton (pembertona at oracle.com)
+ * @author Andy Pemberton
*/
public final class App {
diff --git a/examples/entity-filtering/pom.xml b/examples/entity-filtering/pom.xml
index d4eda8d..3f9f3be 100644
--- a/examples/entity-filtering/pom.xml
+++ b/examples/entity-filtering/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>entity-filtering</artifactId>
diff --git a/examples/exception-mapping/pom.xml b/examples/exception-mapping/pom.xml
index 119d2cd..2e0e6e0 100644
--- a/examples/exception-mapping/pom.xml
+++ b/examples/exception-mapping/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>exception-mapping</artifactId>
diff --git a/examples/extended-wadl-webapp/pom.xml b/examples/extended-wadl-webapp/pom.xml
index 33941b6..d25b5f1 100644
--- a/examples/extended-wadl-webapp/pom.xml
+++ b/examples/extended-wadl-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>extended-wadl-webapp</artifactId>
@@ -43,8 +43,8 @@
<artifactId>jersey-hk2</artifactId>
</dependency>
<dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
@@ -131,7 +131,6 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
- <scope>test</scope>
</dependency>
</dependencies>
@@ -141,7 +140,7 @@
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
- <version>0.8.0</version>
+ <version>0.14.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
@@ -236,6 +235,26 @@
<profiles>
<profile>
+ <id>testsSkipJdk11</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- Exclude unit tests on jdk 11 for now -->
+ <excludes>
+ <exclude>**/ExtendedWadlWebappOsgiTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/freemarker-webapp/pom.xml b/examples/freemarker-webapp/pom.xml
index 80605ba..cc598f1 100644
--- a/examples/freemarker-webapp/pom.xml
+++ b/examples/freemarker-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>freemarker-webapp</artifactId>
diff --git a/examples/freemarker-webapp/src/main/java/org/glassfish/jersey/examples/freemarker/resources/FreemarkerResource.java b/examples/freemarker-webapp/src/main/java/org/glassfish/jersey/examples/freemarker/resources/FreemarkerResource.java
index 61b71e3..c71b22d 100644
--- a/examples/freemarker-webapp/src/main/java/org/glassfish/jersey/examples/freemarker/resources/FreemarkerResource.java
+++ b/examples/freemarker-webapp/src/main/java/org/glassfish/jersey/examples/freemarker/resources/FreemarkerResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
import org.glassfish.jersey.server.mvc.Viewable;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("/")
public class FreemarkerResource {
diff --git a/examples/freemarker-webapp/src/test/java/org/glassfish/jersey/examples/freemarker/FreemarkerTest.java b/examples/freemarker-webapp/src/test/java/org/glassfish/jersey/examples/freemarker/FreemarkerTest.java
index 0701654..7c8abda 100644
--- a/examples/freemarker-webapp/src/test/java/org/glassfish/jersey/examples/freemarker/FreemarkerTest.java
+++ b/examples/freemarker-webapp/src/test/java/org/glassfish/jersey/examples/freemarker/FreemarkerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class FreemarkerTest extends JerseyTest {
diff --git a/examples/groovy/pom.xml b/examples/groovy/pom.xml
index 358b499..3f681e7 100644
--- a/examples/groovy/pom.xml
+++ b/examples/groovy/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>groovy</artifactId>
<packaging>jar</packaging>
diff --git a/examples/helloworld-benchmark/pom.xml b/examples/helloworld-benchmark/pom.xml
index 8a350e0..ebb2604 100644
--- a/examples/helloworld-benchmark/pom.xml
+++ b/examples/helloworld-benchmark/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld-benchmark</artifactId>
diff --git a/examples/helloworld-cdi2-se/README.MD b/examples/helloworld-cdi2-se/README.MD
index 6e4026f..839b069 100644
--- a/examples/helloworld-cdi2-se/README.MD
+++ b/examples/helloworld-cdi2-se/README.MD
@@ -1,4 +1,4 @@
-[//]: # " Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. "
+[//]: # " Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved. "
[//]: # " "
[//]: # " This program and the accompanying materials are made available under the "
[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at "
@@ -31,4 +31,4 @@
This deploys the example using [Grizzly](http://grizzly.java.net/) container.
-- <http://localhost:8080/helloworld>
+- <http://localhost:8080/helloworld/Some%20Name>
diff --git a/examples/helloworld-cdi2-se/pom.xml b/examples/helloworld-cdi2-se/pom.xml
index 27d7458..dbc3fc7 100644
--- a/examples/helloworld-cdi2-se/pom.xml
+++ b/examples/helloworld-cdi2-se/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld-cdi2-se</artifactId>
@@ -63,7 +63,7 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
- <mainClass>java.org.glassfish.jersey.examples.helloworld.cdi2se.App</mainClass>
+ <mainClass>org.glassfish.jersey.examples.helloworld.cdi2se.App</mainClass>
</configuration>
</plugin>
</plugins>
diff --git a/examples/helloworld-cdi2-se/src/main/java/org/glassfish/jersey/examples/helloworld/cdi2se/App.java b/examples/helloworld-cdi2-se/src/main/java/org/glassfish/jersey/examples/helloworld/cdi2se/App.java
index d35233f..5608a6d 100644
--- a/examples/helloworld-cdi2-se/src/main/java/org/glassfish/jersey/examples/helloworld/cdi2se/App.java
+++ b/examples/helloworld-cdi2-se/src/main/java/org/glassfish/jersey/examples/helloworld/cdi2se/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
*/
public class App {
- private static final URI BASE_URI = URI.create("http://localhost:8080/base/");
+ private static final URI BASE_URI = URI.create("http://localhost:8080/");
public static final String ROOT_HELLO_PATH = "helloworld";
public static final String ROOT_COUNTER_PATH = "counter";
@@ -40,7 +40,7 @@
server.start();
System.out.println("Application started.\nTry out");
- System.out.println(String.format("%s%s", BASE_URI, ROOT_HELLO_PATH));
+ System.out.println(String.format("%s%s%s", BASE_URI, ROOT_HELLO_PATH, "/Some%Name"));
System.out.println(String.format("%s%s%s", BASE_URI, ROOT_COUNTER_PATH, "/request"));
System.out.println(String.format("%s%s%s", BASE_URI, ROOT_COUNTER_PATH, "/application"));
System.out.println("Stop the application using CTRL+C");
diff --git a/examples/helloworld-cdi2-se/src/main/java/org/glassfish/jersey/examples/helloworld/cdi2se/HelloWorldResource.java b/examples/helloworld-cdi2-se/src/main/java/org/glassfish/jersey/examples/helloworld/cdi2se/HelloWorldResource.java
index 7799da3..ce9cba1 100644
--- a/examples/helloworld-cdi2-se/src/main/java/org/glassfish/jersey/examples/helloworld/cdi2se/HelloWorldResource.java
+++ b/examples/helloworld-cdi2-se/src/main/java/org/glassfish/jersey/examples/helloworld/cdi2se/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -10,13 +10,19 @@
package org.glassfish.jersey.examples.helloworld.cdi2se;
+import java.security.Principal;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.SecurityContext;
-import javax.inject.Inject;
-import javax.inject.Singleton;
+import static java.util.Optional.ofNullable;
/**
* Singleton-scoped resource.
@@ -33,7 +39,17 @@
@GET
@Path("{name}")
@Produces("text/plain")
- public String getHello(@PathParam("name") String name) {
- return helloBean.hello(name);
+ public String getHello(@PathParam("name") String name, @Context SecurityContext sc) {
+ final StringBuilder sb = new StringBuilder(this.helloBean.hello(name));
+
+ ofNullable(sc.getUserPrincipal())
+ .map(Principal::getName)
+ .ifPresent(p -> {
+ sb.append("(");
+ sb.append(p);
+ sb.append(")");
+ });
+
+ return sb.toString();
}
}
diff --git a/examples/helloworld-netty/pom.xml b/examples/helloworld-netty/pom.xml
index 7b1b108..0c2de9c 100644
--- a/examples/helloworld-netty/pom.xml
+++ b/examples/helloworld-netty/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld-netty</artifactId>
diff --git a/examples/helloworld-netty/src/main/java/org/glassfish/jersey/examples/helloworld/netty/HelloWorldResource.java b/examples/helloworld-netty/src/main/java/org/glassfish/jersey/examples/helloworld/netty/HelloWorldResource.java
index baf1be7..8f2c4e1 100644
--- a/examples/helloworld-netty/src/main/java/org/glassfish/jersey/examples/helloworld/netty/HelloWorldResource.java
+++ b/examples/helloworld-netty/src/main/java/org/glassfish/jersey/examples/helloworld/netty/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/examples/helloworld-programmatic/pom.xml b/examples/helloworld-programmatic/pom.xml
index c9f437b..0a611aa 100644
--- a/examples/helloworld-programmatic/pom.xml
+++ b/examples/helloworld-programmatic/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld-programmatic</artifactId>
diff --git a/examples/helloworld-programmatic/src/main/java/org/glassfish/jersey/examples/helloworld/App.java b/examples/helloworld-programmatic/src/main/java/org/glassfish/jersey/examples/helloworld/App.java
index 5969cc5..e5b5f3c 100644
--- a/examples/helloworld-programmatic/src/main/java/org/glassfish/jersey/examples/helloworld/App.java
+++ b/examples/helloworld-programmatic/src/main/java/org/glassfish/jersey/examples/helloworld/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -29,7 +29,7 @@
* This is the example entry point, where Jersey application for the example
* gets populated and published using the Grizzly 2 HTTP container.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/helloworld-pure-jax-rs/pom.xml b/examples/helloworld-pure-jax-rs/pom.xml
index 54545b6..31b785c 100644
--- a/examples/helloworld-pure-jax-rs/pom.xml
+++ b/examples/helloworld-pure-jax-rs/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld-pure-jax-rs</artifactId>
diff --git a/examples/helloworld-pure-jax-rs/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldResource.java b/examples/helloworld-pure-jax-rs/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldResource.java
index 856f233..2f34446 100644
--- a/examples/helloworld-pure-jax-rs/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldResource.java
+++ b/examples/helloworld-pure-jax-rs/src/main/java/org/glassfish/jersey/examples/helloworld/jaxrs/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/examples/helloworld-spring-annotations/pom.xml b/examples/helloworld-spring-annotations/pom.xml
index e6944da..707d79b 100644
--- a/examples/helloworld-spring-annotations/pom.xml
+++ b/examples/helloworld-spring-annotations/pom.xml
@@ -15,7 +15,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.examples</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>helloworld-spring-annotations</artifactId>
diff --git a/examples/helloworld-spring-webapp/pom.xml b/examples/helloworld-spring-webapp/pom.xml
index f396e7a..28520d5 100644
--- a/examples/helloworld-spring-webapp/pom.xml
+++ b/examples/helloworld-spring-webapp/pom.xml
@@ -25,7 +25,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld-spring-webapp</artifactId>
diff --git a/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/GreetingService.java b/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/GreetingService.java
index ca9f719..ab31e65 100644
--- a/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/GreetingService.java
+++ b/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/GreetingService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
/**
* Simple greeting service.
*
- * @author Marko Asplund (marko.asplund at oracle.com)
+ * @author Marko Asplund
*/
public interface GreetingService {
diff --git a/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/GreetingServiceImpl.java b/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/GreetingServiceImpl.java
index af54d2a..d0b5c70 100644
--- a/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/GreetingServiceImpl.java
+++ b/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/GreetingServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
* Simple {@link GreetingService} implementation to just say hello.
*
* @author Marko Asplund (marko.asplund at yahoo.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class GreetingServiceImpl implements GreetingService {
diff --git a/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/MyApplication.java b/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/MyApplication.java
index f07b225..99a8045 100644
--- a/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/MyApplication.java
+++ b/examples/helloworld-spring-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/spring/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
* Spring HelloWorld Web Application configuration.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class MyApplication extends ResourceConfig {
diff --git a/examples/helloworld-webapp/pom.xml b/examples/helloworld-webapp/pom.xml
index 3eee3b5..e29a9d7 100644
--- a/examples/helloworld-webapp/pom.xml
+++ b/examples/helloworld-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld-webapp</artifactId>
diff --git a/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/App.java b/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/App.java
index 85618ce..6c541a3 100644
--- a/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/App.java
+++ b/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
import org.glassfish.grizzly.http.server.HttpServer;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class App {
diff --git a/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/HelloWorldResource.java b/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/HelloWorldResource.java
index 3669b69..57526ef 100644
--- a/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/HelloWorldResource.java
+++ b/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -15,7 +15,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/MyApplication.java b/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/MyApplication.java
index 5e929e5..70351d9 100644
--- a/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/MyApplication.java
+++ b/examples/helloworld-webapp/src/main/java/org/glassfish/jersey/examples/helloworld/webapp/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
import java.util.Set;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@ApplicationPath("/")
public class MyApplication extends Application {
diff --git a/examples/helloworld-webapp/src/test/java/org/glassfish/jersey/examples/helloworld/webapp/HelloWorldTest.java b/examples/helloworld-webapp/src/test/java/org/glassfish/jersey/examples/helloworld/webapp/HelloWorldTest.java
index 4da4a9f..9228165 100644
--- a/examples/helloworld-webapp/src/test/java/org/glassfish/jersey/examples/helloworld/webapp/HelloWorldTest.java
+++ b/examples/helloworld-webapp/src/test/java/org/glassfish/jersey/examples/helloworld/webapp/HelloWorldTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
/**
* Simple test to check "Hello World!" is being returned from the helloworld resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class HelloWorldTest extends JerseyTest {
diff --git a/examples/helloworld-weld/pom.xml b/examples/helloworld-weld/pom.xml
index b9e04d3..b8e6b8a 100644
--- a/examples/helloworld-weld/pom.xml
+++ b/examples/helloworld-weld/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld-weld</artifactId>
diff --git a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/AppScopedResource.java b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/AppScopedResource.java
index fa231fc..c301e09 100644
--- a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/AppScopedResource.java
+++ b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/AppScopedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -20,7 +20,7 @@
/**
* Application scoped CDI based resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("app")
@ApplicationScoped
diff --git a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/CustomInterceptor.java b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/CustomInterceptor.java
index 342a7c7..5701b5e 100644
--- a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/CustomInterceptor.java
+++ b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/CustomInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
* CDI based JAX-RS interceptor that re-writes the original output
* with request ID obtained from another CDI bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ResponseBodyFromCdiBean
@ApplicationScoped
diff --git a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/HelloWorldResource.java b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/HelloWorldResource.java
index aa76f50..984e80c 100644
--- a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/HelloWorldResource.java
+++ b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -20,7 +20,7 @@
/**
* Hello-world JAX-RS resource implemented as CDI bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("helloworld")
@RequestScoped
diff --git a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/RequestScopedBean.java b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/RequestScopedBean.java
index 8cac041..84371c8 100644
--- a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/RequestScopedBean.java
+++ b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/RequestScopedBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
* JAX-RS interceptor, {@link CustomInterceptor}, could
* use CDI means to obtain JAX-RS request data.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
public class RequestScopedBean {
diff --git a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/RequestScopedResource.java b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/RequestScopedResource.java
index 135b110..b522ffb 100644
--- a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/RequestScopedResource.java
+++ b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/RequestScopedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -29,7 +29,7 @@
/**
* JAX-RS resource class backed by a request scoped CDI bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("req")
diff --git a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/ResponseBodyFromCdiBean.java b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/ResponseBodyFromCdiBean.java
index f403648..aedf846 100644
--- a/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/ResponseBodyFromCdiBean.java
+++ b/examples/helloworld-weld/src/main/java/org/glassfish/jersey/examples/helloworld/ResponseBodyFromCdiBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
* Binds {@link org.glassfish.jersey.examples.helloworld.CustomInterceptor} with resource methods that should return modified
* entity than the one returned from the method.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Retention(RUNTIME)
@Target({METHOD, TYPE})
diff --git a/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/AppScopedResourceTest.java b/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/AppScopedResourceTest.java
index 33dc579..4b32463 100644
--- a/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/AppScopedResourceTest.java
+++ b/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/AppScopedResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
/**
* Test for the {@link AppScopedResource} JAX-RS resource class.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class AppScopedResourceTest extends JerseyTest {
diff --git a/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/HelloWorldTest.java b/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/HelloWorldTest.java
index df6a311..9343440 100644
--- a/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/HelloWorldTest.java
+++ b/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/HelloWorldTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
/**
* Test for the {@link HelloWorldResource} JAX-RS resource class.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class HelloWorldTest extends JerseyTest {
diff --git a/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/RequestScopeAlignmentTest.java b/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/RequestScopeAlignmentTest.java
index b6be123..e3dfea8 100644
--- a/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/RequestScopeAlignmentTest.java
+++ b/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/RequestScopeAlignmentTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -32,7 +32,7 @@
/**
* Test for the request scoped managed bean resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class RequestScopeAlignmentTest extends JerseyTest {
diff --git a/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/RequestScopedResourceTest.java b/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/RequestScopedResourceTest.java
index f6a4fa9..17213f1 100644
--- a/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/RequestScopedResourceTest.java
+++ b/examples/helloworld-weld/src/test/java/org/glassfish/jersey/examples/helloworld/RequestScopedResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -34,7 +34,7 @@
* against a single Grizzly instance. This is to ensure server side external request scope
* binding does not mix different request data.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(ConcurrentParameterizedRunner.class)
public class RequestScopedResourceTest extends JerseyTest {
diff --git a/examples/helloworld/pom.xml b/examples/helloworld/pom.xml
index 1962efc..65f95f1 100644
--- a/examples/helloworld/pom.xml
+++ b/examples/helloworld/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>helloworld</artifactId>
diff --git a/examples/helloworld/src/main/java/org/glassfish/jersey/examples/helloworld/HelloWorldResource.java b/examples/helloworld/src/main/java/org/glassfish/jersey/examples/helloworld/HelloWorldResource.java
index f1326e5..18dd945 100644
--- a/examples/helloworld/src/main/java/org/glassfish/jersey/examples/helloworld/HelloWorldResource.java
+++ b/examples/helloworld/src/main/java/org/glassfish/jersey/examples/helloworld/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/examples/http-patch/pom.xml b/examples/http-patch/pom.xml
index adcd4d8..836a1eb 100644
--- a/examples/http-patch/pom.xml
+++ b/examples/http-patch/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>http-patch</artifactId>
diff --git a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/App.java b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/App.java
index 3efc9e6..fe1ee5a 100644
--- a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/App.java
+++ b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
/**
* HTTP PATCH Demo Application.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class App {
/**
diff --git a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/OptionsAcceptPatchHeaderFilter.java b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/OptionsAcceptPatchHeaderFilter.java
index 2715ce0..11417c5 100644
--- a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/OptionsAcceptPatchHeaderFilter.java
+++ b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/OptionsAcceptPatchHeaderFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
* to any response to an {@code OPTIONS} request.
*
* @author Gerard Davison (gerard.davison at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class OptionsAcceptPatchHeaderFilter implements ContainerResponseFilter {
diff --git a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/PatchableResource.java b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/PatchableResource.java
index 06e6440..ccd1ae9 100644
--- a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/PatchableResource.java
+++ b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/PatchableResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
* Patchable resource.
*
* @author Gerard Davison (gerard.davison at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path(App.ROOT_PATH)
@Produces(MediaType.APPLICATION_JSON)
diff --git a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/PatchingInterceptor.java b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/PatchingInterceptor.java
index 05451b4..ab0e5f8 100644
--- a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/PatchingInterceptor.java
+++ b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/PatchingInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -38,7 +38,7 @@
* JAX-RS reader interceptor that implements server-side PATCH support.
*
* @author Gerard Davison (gerard.davison at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class PatchingInterceptor implements ReaderInterceptor {
diff --git a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/State.java b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/State.java
index c00ea15..ebaf707 100644
--- a/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/State.java
+++ b/examples/http-patch/src/main/java/org/glassfish/jersey/examples/httppatch/State.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
* A resource state modelled as Java bean (that can be patched).
*
* @author Gerard Davison (gerard.davison at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class State {
diff --git a/examples/http-patch/src/test/java/org/glassfish/jersey/examples/httppatch/HttpPatchTest.java b/examples/http-patch/src/test/java/org/glassfish/jersey/examples/httppatch/HttpPatchTest.java
index 02bbacd..7c4d81f 100644
--- a/examples/http-patch/src/test/java/org/glassfish/jersey/examples/httppatch/HttpPatchTest.java
+++ b/examples/http-patch/src/test/java/org/glassfish/jersey/examples/httppatch/HttpPatchTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -28,7 +28,7 @@
/**
* HTTP PATCH Example unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class HttpPatchTest extends JerseyTest {
diff --git a/examples/http-trace/pom.xml b/examples/http-trace/pom.xml
index 3c40fca..b30b131 100644
--- a/examples/http-trace/pom.xml
+++ b/examples/http-trace/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>http-trace</artifactId>
diff --git a/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/App.java b/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/App.java
index f2d05af..39b0d64 100644
--- a/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/App.java
+++ b/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -31,8 +31,8 @@
* This is the example entry point, where Jersey application gets populated and published
* using the Grizzly 2 HTTP container.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/Stringifier.java b/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/Stringifier.java
index 1839f1b..5ef8dbc 100644
--- a/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/Stringifier.java
+++ b/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/Stringifier.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Request stringifier.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class Stringifier {
diff --git a/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/TRACE.java b/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/TRACE.java
index e37d522..eebb080 100644
--- a/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/TRACE.java
+++ b/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/TRACE.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -19,7 +19,7 @@
/**
* HTTP TRACE method annotation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@HttpMethod(TRACE.NAME)
@Target(ElementType.METHOD)
diff --git a/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/TracingResource.java b/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/TracingResource.java
index d6fd371..ba4ced3 100644
--- a/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/TracingResource.java
+++ b/examples/http-trace/src/main/java/org/glassfish/jersey/examples/httptrace/TracingResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -20,7 +20,7 @@
* This very basic resource showcases support of a HTTP TRACE method,
* not directly supported by JAX-RS API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path(App.ROOT_PATH_ANNOTATED)
public class TracingResource {
diff --git a/examples/https-clientserver-grizzly/pom.xml b/examples/https-clientserver-grizzly/pom.xml
index a5c6af8..9890277 100644
--- a/examples/https-clientserver-grizzly/pom.xml
+++ b/examples/https-clientserver-grizzly/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>https-clientserver-grizzly</artifactId>
@@ -70,6 +70,16 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <properties>
+ <!-- https://bugs.openjdk.java.net/browse/JDK-8211426 -->
+ <surefire.security.argline>-Djdk.tls.server.protocols=TLSv1.2</surefire.security.argline>
+ </properties>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/AuthenticationException.java b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/AuthenticationException.java
index 73eeedf..7ab1573 100644
--- a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/AuthenticationException.java
+++ b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/AuthenticationException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
/**
* A runtime exception representing a failure to provide correct authentication credentials.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class AuthenticationException extends RuntimeException {
diff --git a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/AuthenticationExceptionMapper.java b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/AuthenticationExceptionMapper.java
index 78d12f7..8515b64 100644
--- a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/AuthenticationExceptionMapper.java
+++ b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/AuthenticationExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* Map an authentication exception to an HTTP 401 response, optionally including the realm for a credentials challenge at the client.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Provider
public class AuthenticationExceptionMapper implements ExceptionMapper<AuthenticationException> {
diff --git a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/RootResource.java b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/RootResource.java
index 1385d2f..781b6e6 100644
--- a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/RootResource.java
+++ b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/RootResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
*
* Better way would be injecting {@link javax.ws.rs.core.SecurityContext}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("/")
public class RootResource {
diff --git a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/SecurityFilter.java b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/SecurityFilter.java
index 5918712..1e4944d 100644
--- a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/SecurityFilter.java
+++ b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/SecurityFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -32,7 +32,7 @@
*
* Returns response with http status 401 when proper authentication is not provided in incoming request.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @see ContainerRequestFilter
*/
@Provider
diff --git a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/Server.java b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/Server.java
index b4c91e4..a4e0c79 100644
--- a/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/Server.java
+++ b/examples/https-clientserver-grizzly/src/main/java/org/glassfish/jersey/examples/httpsclientservergrizzly/Server.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -28,7 +28,7 @@
/**
* A simple SSL-secured HTTP server.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class Server {
diff --git a/examples/https-clientserver-grizzly/src/test/java/org/glassfish/jersey/examples/httpsclientservergrizzly/MainTest.java b/examples/https-clientserver-grizzly/src/test/java/org/glassfish/jersey/examples/httpsclientservergrizzly/MainTest.java
index 97fefa8..ce21918 100644
--- a/examples/https-clientserver-grizzly/src/test/java/org/glassfish/jersey/examples/httpsclientservergrizzly/MainTest.java
+++ b/examples/https-clientserver-grizzly/src/test/java/org/glassfish/jersey/examples/httpsclientservergrizzly/MainTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -36,7 +36,7 @@
* configuration, etc.). Server is a Grizzly server configured for SSL support and client
* uses both, {@link HttpUrlConnectorProvider} and {@link GrizzlyConnectorProvider}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class MainTest {
diff --git a/examples/https-server-glassfish/pom.xml b/examples/https-server-glassfish/pom.xml
index f0b7ef8..bde68e4 100644
--- a/examples/https-server-glassfish/pom.xml
+++ b/examples/https-server-glassfish/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>https-server-glassfish</artifactId>
diff --git a/examples/https-server-glassfish/src/main/java/org/glassfish/jersey/examples/https/glassfish/resources/HelloWorldResource.java b/examples/https-server-glassfish/src/main/java/org/glassfish/jersey/examples/https/glassfish/resources/HelloWorldResource.java
index 8d4dc98..b413546 100644
--- a/examples/https-server-glassfish/src/main/java/org/glassfish/jersey/examples/https/glassfish/resources/HelloWorldResource.java
+++ b/examples/https-server-glassfish/src/main/java/org/glassfish/jersey/examples/https/glassfish/resources/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
* The JAX-RS resource class will be hosted at the URI path {@code "/helloworld"}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("/helloworld")
@RolesAllowed("myRole")
diff --git a/examples/java8-webapp/pom.xml b/examples/java8-webapp/pom.xml
index b75062c..0dc6661 100644
--- a/examples/java8-webapp/pom.xml
+++ b/examples/java8-webapp/pom.xml
@@ -18,7 +18,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>java8-webapp</artifactId>
diff --git a/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/DefaultMethodInterface.java b/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/DefaultMethodInterface.java
index 4a67e9f..6060d8f 100644
--- a/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/DefaultMethodInterface.java
+++ b/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/DefaultMethodInterface.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
* Example interface containing resource methods in form of Java8's default methods.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public interface DefaultMethodInterface {
diff --git a/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/DefaultMethodResource.java b/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/DefaultMethodResource.java
index 79e347d..0d40a30 100644
--- a/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/DefaultMethodResource.java
+++ b/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/DefaultMethodResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* JAX-RS resource inheriting some resource method implementations from the implemented interface.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("default-method")
@Produces("text/plain")
diff --git a/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/LambdaResource.java b/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/LambdaResource.java
index 2448ea8..df833d2 100644
--- a/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/LambdaResource.java
+++ b/examples/java8-webapp/src/main/java/org/glassfish/jersey/examples/java8/resources/LambdaResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -20,7 +20,7 @@
/**
* JAX-RS resource using Java SE 8 lambdas.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("lambdas/{p}")
public class LambdaResource {
diff --git a/examples/java8-webapp/src/test/java/org/glassfish/jersey/examples/java8/DefaultMethodResourceTest.java b/examples/java8-webapp/src/test/java/org/glassfish/jersey/examples/java8/DefaultMethodResourceTest.java
index bd187ef..3515b51 100644
--- a/examples/java8-webapp/src/test/java/org/glassfish/jersey/examples/java8/DefaultMethodResourceTest.java
+++ b/examples/java8-webapp/src/test/java/org/glassfish/jersey/examples/java8/DefaultMethodResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Test usage of Java8's interface default methods as resource methods.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class DefaultMethodResourceTest extends JerseyTest {
diff --git a/examples/java8-webapp/src/test/java/org/glassfish/jersey/examples/java8/LambdaResourceTest.java b/examples/java8-webapp/src/test/java/org/glassfish/jersey/examples/java8/LambdaResourceTest.java
index 937b1c7..ce52d78 100644
--- a/examples/java8-webapp/src/test/java/org/glassfish/jersey/examples/java8/LambdaResourceTest.java
+++ b/examples/java8-webapp/src/test/java/org/glassfish/jersey/examples/java8/LambdaResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -22,7 +22,7 @@
/**
* Test usage of Java SE 8 lambdas in JAX-RS resource methods.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class LambdaResourceTest extends JerseyTest {
diff --git a/examples/jaxb/pom.xml b/examples/jaxb/pom.xml
index e17e21d..b6546b9 100644
--- a/examples/jaxb/pom.xml
+++ b/examples/jaxb/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jaxb</artifactId>
@@ -62,6 +62,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/jaxb/src/main/java/org/glassfish/jersey/examples/jaxb/App.java b/examples/jaxb/src/main/java/org/glassfish/jersey/examples/jaxb/App.java
index c07a92b..73dc223 100644
--- a/examples/jaxb/src/main/java/org/glassfish/jersey/examples/jaxb/App.java
+++ b/examples/jaxb/src/main/java/org/glassfish/jersey/examples/jaxb/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
/**
* Jersey JAXB example application.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/jaxb/src/test/java/org/glassfish/jersey/examples/jaxb/JaxbTest.java b/examples/jaxb/src/test/java/org/glassfish/jersey/examples/jaxb/JaxbTest.java
index e6f3a8c..c887ae3 100644
--- a/examples/jaxb/src/test/java/org/glassfish/jersey/examples/jaxb/JaxbTest.java
+++ b/examples/jaxb/src/test/java/org/glassfish/jersey/examples/jaxb/JaxbTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -31,7 +31,7 @@
* Jersey JAXB example test.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JaxbTest extends JerseyTest {
diff --git a/examples/jaxrs-types-injection/pom.xml b/examples/jaxrs-types-injection/pom.xml
index eddfcda..7c64d66 100644
--- a/examples/jaxrs-types-injection/pom.xml
+++ b/examples/jaxrs-types-injection/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jaxrs-types-injection</artifactId>
diff --git a/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/App.java b/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/App.java
index d2b2ab6..b846ea9 100644
--- a/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/App.java
+++ b/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* Jersey application that demonstrates injection of JAX-RS components into resources.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/JaxrsInjectionReportingInflector.java b/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/JaxrsInjectionReportingInflector.java
index a77ab8f..1b3cc61 100644
--- a/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/JaxrsInjectionReportingInflector.java
+++ b/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/JaxrsInjectionReportingInflector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
/**
* Programmatic resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class JaxrsInjectionReportingInflector implements Inflector<Request, Response> {
diff --git a/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/JaxrsInjectionReportingResource.java b/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/JaxrsInjectionReportingResource.java
index 87f03d9..730781a 100644
--- a/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/JaxrsInjectionReportingResource.java
+++ b/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/JaxrsInjectionReportingResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* Annotated resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("annotated")
public class JaxrsInjectionReportingResource {
diff --git a/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/ReportBuilder.java b/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/ReportBuilder.java
index fcafa26..153b4a0 100644
--- a/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/ReportBuilder.java
+++ b/examples/jaxrs-types-injection/src/main/java/org/glassfish/jersey/examples/jaxrstypeinjection/ReportBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -22,7 +22,7 @@
* Provides functionality for appending values of JAX-RS types to a string-based
* report.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class ReportBuilder {
diff --git a/examples/jersey-ejb/pom.xml b/examples/jersey-ejb/pom.xml
index 8d01ffd..a908ce8 100644
--- a/examples/jersey-ejb/pom.xml
+++ b/examples/jersey-ejb/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-ejb</artifactId>
diff --git a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/Message.java b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/Message.java
index 6bea954..4ac3db3 100644
--- a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/Message.java
+++ b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/Message.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -15,7 +15,7 @@
/**
* Message bean representing a single message.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class Message {
diff --git a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/MessageListWriter.java b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/MessageListWriter.java
index f4eef68..58db75b 100644
--- a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/MessageListWriter.java
+++ b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/MessageListWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -33,7 +33,7 @@
/**
* A simple HTML message body writer to serialize list of message beans.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Stateless
@Provider
diff --git a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/MessageWriter.java b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/MessageWriter.java
index 5d7d2cd..dc8b618 100644
--- a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/MessageWriter.java
+++ b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/entities/MessageWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
/**
* A simple message body writer to serialize a single message bean.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Singleton
@Provider
diff --git a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/exceptions/CustomNotFoundException.java b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/exceptions/CustomNotFoundException.java
index 966a47e..105bd49 100644
--- a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/exceptions/CustomNotFoundException.java
+++ b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/exceptions/CustomNotFoundException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -14,7 +14,7 @@
* This exceptions will get mapped to a 404 response with the application exception mapper
* implemented by {@link NotFoundExceptionMapper} class.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CustomNotFoundException extends Exception {
diff --git a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/exceptions/NotFoundExceptionMapper.java b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/exceptions/NotFoundExceptionMapper.java
index d36593a..08c14db 100644
--- a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/exceptions/NotFoundExceptionMapper.java
+++ b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/exceptions/NotFoundExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* An exception mapper to return 404 responses when a {@link CustomNotFoundException} is thrown.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Provider
public class NotFoundExceptionMapper implements ExceptionMapper<CustomNotFoundException> {
diff --git a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageBoardResourceBean.java b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageBoardResourceBean.java
index a55219e..544df3f 100644
--- a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageBoardResourceBean.java
+++ b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageBoardResourceBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -34,7 +34,7 @@
* A stateless EJB bean to handle REST requests to the messages resource.
* Messages are stored in the injected EJB singleton instance.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Stateless
public class MessageBoardResourceBean {
diff --git a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageBoardRootResource.java b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageBoardRootResource.java
index 6fd665a..53016c1 100644
--- a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageBoardRootResource.java
+++ b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageBoardRootResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -19,7 +19,7 @@
* gets injected as an EJB stateless bean
* and provided via a sub-resource locator for further processing.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Stateless
@Path("/")
diff --git a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageHolderSingletonBean.java b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageHolderSingletonBean.java
index 8a700d6..1798bbc 100644
--- a/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageHolderSingletonBean.java
+++ b/examples/jersey-ejb/src/main/java/org/glassfish/jersey/examples/jersey_ejb/resources/MessageHolderSingletonBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -22,7 +22,7 @@
/**
* An EJB singleton to maintain all processed message beans.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Singleton
public class MessageHolderSingletonBean {
diff --git a/examples/jersey-ejb/src/test/java/org/glassfish/jersey/examples/jersey_ejb/test/MessageBoardTest.java b/examples/jersey-ejb/src/test/java/org/glassfish/jersey/examples/jersey_ejb/test/MessageBoardTest.java
index d5503a1..5d5b455 100644
--- a/examples/jersey-ejb/src/test/java/org/glassfish/jersey/examples/jersey_ejb/test/MessageBoardTest.java
+++ b/examples/jersey-ejb/src/test/java/org/glassfish/jersey/examples/jersey_ejb/test/MessageBoardTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -35,7 +35,7 @@
* and then run the tests using extenrnal test container factory:
* mvn -Prun-external-tests test
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class MessageBoardTest extends JerseyTest {
diff --git a/examples/json-binding-webapp/pom.xml b/examples/json-binding-webapp/pom.xml
index 9a61c17..1f17b4b 100644
--- a/examples/json-binding-webapp/pom.xml
+++ b/examples/json-binding-webapp/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-binding-webapp</artifactId>
diff --git a/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/App.java b/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/App.java
index 39d18e7..6c34fcc 100644
--- a/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/App.java
+++ b/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -22,7 +22,7 @@
/**
* Jersey JSON-B example standalone application.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class App {
diff --git a/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/Cat.java b/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/Cat.java
index 720a63e..f4786db 100644
--- a/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/Cat.java
+++ b/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/Cat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
* Example cat POJO for JSONB (un)marshalling.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@JsonbPropertyOrder({"color", "sort", "name", "domesticated"})
public class Cat {
diff --git a/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/JsonbApplication.java b/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/JsonbApplication.java
index c89b53d..3eca130 100644
--- a/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/JsonbApplication.java
+++ b/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/JsonbApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* Jersey JSON-B example application.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@ApplicationPath("/")
public class JsonbApplication extends ResourceConfig {
diff --git a/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/JsonbResource.java b/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/JsonbResource.java
index 74d6d9f..bbdafbc 100644
--- a/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/JsonbResource.java
+++ b/examples/json-binding-webapp/src/main/java/org/glassfish/jersey/examples/jsonb/JsonbResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
/**
* An example resource utilizing JSONB.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("cats")
@Consumes("application/json")
diff --git a/examples/json-jackson/pom.xml b/examples/json-jackson/pom.xml
index 93c79d5..53cb8d4 100644
--- a/examples/json-jackson/pom.xml
+++ b/examples/json-jackson/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-jackson</artifactId>
@@ -68,6 +68,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/App.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/App.java
index 11bb1c0..d72e1e9 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/App.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
* Utility class which creates {@link MyApplication} instances and provides support
* for running this sample from command line.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class App {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/CombinedAnnotationBean.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/CombinedAnnotationBean.java
index 1852773..05e3e17 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/CombinedAnnotationBean.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/CombinedAnnotationBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement(name = "account")
public class CombinedAnnotationBean {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/CombinedAnnotationResource.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/CombinedAnnotationResource.java
index 4bdead6..21e1268 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/CombinedAnnotationResource.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/CombinedAnnotationResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("combinedAnnotations")
public class CombinedAnnotationResource {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/EmptyArrayBean.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/EmptyArrayBean.java
index 332ae84..e3e620f 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/EmptyArrayBean.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/EmptyArrayBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -15,7 +15,7 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement
public class EmptyArrayBean {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/EmptyArrayResource.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/EmptyArrayResource.java
index 0f4abf5..0c69bfd 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/EmptyArrayResource.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/EmptyArrayResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/emptyArrayResource")
public class EmptyArrayResource {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/ExceptionMappingTestResource.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/ExceptionMappingTestResource.java
index 4afef0e..a76ca9c 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/ExceptionMappingTestResource.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/ExceptionMappingTestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* Testing bean that accepts JSON for the PUT method.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("parseExceptionTest")
public class ExceptionMappingTestResource {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/MyApplication.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/MyApplication.java
index aa4c966..8181b97 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/MyApplication.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
*
* Used to set resource and providers classes.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class MyApplication extends ResourceConfig {
public MyApplication() {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/MyObjectMapperProvider.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/MyObjectMapperProvider.java
index df9658b..4233ad0 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/MyObjectMapperProvider.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/MyObjectMapperProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
public class MyObjectMapperProvider implements ContextResolver<ObjectMapper> {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/NonJaxbBean.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/NonJaxbBean.java
index 8446f3b..d0b2662 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/NonJaxbBean.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/NonJaxbBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class NonJaxbBean {
diff --git a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/NonJaxbBeanResource.java b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/NonJaxbBeanResource.java
index 88e01e7..7dae7cb 100644
--- a/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/NonJaxbBeanResource.java
+++ b/examples/json-jackson/src/main/java/org/glassfish/jersey/examples/jackson/NonJaxbBeanResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
import org.glassfish.jersey.server.JSONP;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/nonJaxbResource")
public class NonJaxbBeanResource {
diff --git a/examples/json-jackson/src/test/java/org/glassfish/jersey/examples/jackson/JacksonTest.java b/examples/json-jackson/src/test/java/org/glassfish/jersey/examples/jackson/JacksonTest.java
index 64e662e..9bef3a6 100644
--- a/examples/json-jackson/src/test/java/org/glassfish/jersey/examples/jackson/JacksonTest.java
+++ b/examples/json-jackson/src/test/java/org/glassfish/jersey/examples/jackson/JacksonTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -32,7 +32,7 @@
import org.junit.runner.RunWith;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(ConcurrentRunner.class)
public class JacksonTest extends JerseyTest {
diff --git a/examples/json-jackson1/pom.xml b/examples/json-jackson1/pom.xml
index d901464..c3397bc 100644
--- a/examples/json-jackson1/pom.xml
+++ b/examples/json-jackson1/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-jackson1</artifactId>
@@ -62,6 +62,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/App.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/App.java
index 0cd8dfb..178df0a 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/App.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
* Utility class which creates {@link MyApplication} instances and provides support
* for running this sample from command line.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class App {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/CombinedAnnotationBean.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/CombinedAnnotationBean.java
index 68ad3b2..5470a2c 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/CombinedAnnotationBean.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/CombinedAnnotationBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -14,7 +14,7 @@
import org.codehaus.jackson.annotate.JsonProperty;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement(name = "account")
public class CombinedAnnotationBean {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/CombinedAnnotationResource.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/CombinedAnnotationResource.java
index 841d930..27e7b3a 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/CombinedAnnotationResource.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/CombinedAnnotationResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
import javax.ws.rs.core.MediaType;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("combinedAnnotations")
public class CombinedAnnotationResource {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/DummyBean.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/DummyBean.java
index c3e66e1..2b42ea0 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/DummyBean.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/DummyBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
/**
* Testing bean for ExceptionMappingTestResource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class DummyBean {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/EmptyArrayBean.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/EmptyArrayBean.java
index f6c1164..e22c38e 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/EmptyArrayBean.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/EmptyArrayBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement
public class EmptyArrayBean {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/EmptyArrayResource.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/EmptyArrayResource.java
index 53ac9f0..a639aa1 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/EmptyArrayResource.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/EmptyArrayResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
import javax.ws.rs.core.MediaType;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/emptyArrayResource")
public class EmptyArrayResource {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/ExceptionMappingTestResource.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/ExceptionMappingTestResource.java
index 542b70c..4b24831 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/ExceptionMappingTestResource.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/ExceptionMappingTestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* Testing bean that accepts JSON for the PUT method.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("parseExceptionTest")
public class ExceptionMappingTestResource {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/MyApplication.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/MyApplication.java
index 1967697..1d92c3f 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/MyApplication.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
*
* Used to set resource and providers classes.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class MyApplication extends ResourceConfig {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/MyObjectMapperProvider.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/MyObjectMapperProvider.java
index 7e6996f..0ac0c77 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/MyObjectMapperProvider.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/MyObjectMapperProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
import org.codehaus.jackson.xc.JaxbAnnotationIntrospector;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
public class MyObjectMapperProvider implements ContextResolver<ObjectMapper> {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/NonJaxbBean.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/NonJaxbBean.java
index 3568f39..0b1f33f 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/NonJaxbBean.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/NonJaxbBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -11,7 +11,7 @@
package org.glassfish.jersey.examples.jackson1;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class NonJaxbBean {
diff --git a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/NonJaxbBeanResource.java b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/NonJaxbBeanResource.java
index 09abd34..51e61e3 100644
--- a/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/NonJaxbBeanResource.java
+++ b/examples/json-jackson1/src/main/java/org/glassfish/jersey/examples/jackson1/NonJaxbBeanResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
import org.glassfish.jersey.server.JSONP;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/nonJaxbResource")
public class NonJaxbBeanResource {
diff --git a/examples/json-jackson1/src/test/java/org/glassfish/jersey/examples/jackson1/Jackson1Test.java b/examples/json-jackson1/src/test/java/org/glassfish/jersey/examples/jackson1/Jackson1Test.java
index 4d78f26..d2c9be0 100644
--- a/examples/json-jackson1/src/test/java/org/glassfish/jersey/examples/jackson1/Jackson1Test.java
+++ b/examples/json-jackson1/src/test/java/org/glassfish/jersey/examples/jackson1/Jackson1Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -29,7 +29,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Jackson1Test extends JerseyTest {
diff --git a/examples/json-jettison/pom.xml b/examples/json-jettison/pom.xml
index 9fcff83..d5af4c3 100644
--- a/examples/json-jettison/pom.xml
+++ b/examples/json-jettison/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-jettison</artifactId>
@@ -62,6 +62,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/AircraftType.java b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/AircraftType.java
index 36893fa..f56fe45 100644
--- a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/AircraftType.java
+++ b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/AircraftType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -15,8 +15,8 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
@XmlRootElement
public class AircraftType {
diff --git a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/AircraftTypeList.java b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/AircraftTypeList.java
index b091f52..17c3920 100644
--- a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/AircraftTypeList.java
+++ b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/AircraftTypeList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -20,8 +20,8 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
@Path("/aircrafts")
public class AircraftTypeList {
diff --git a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/App.java b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/App.java
index 752e2e5..93d4917 100644
--- a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/App.java
+++ b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,8 +25,8 @@
* Utility class which can create {@link org.glassfish.jersey.server.ApplicationHandler} instance and provides support
* for running this sample from command line.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/FlightList.java b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/FlightList.java
index 9c39717..b565bda 100644
--- a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/FlightList.java
+++ b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/FlightList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -20,8 +20,8 @@
/**
* TODO javadoc.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
@Path(value = "/flights")
public class FlightList {
diff --git a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/FlightsDataStore.java b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/FlightsDataStore.java
index 4cbe12d..3a5152f 100644
--- a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/FlightsDataStore.java
+++ b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/FlightsDataStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
/**
* TODO javadoc.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class FlightsDataStore {
diff --git a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/JaxbContextResolver.java b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/JaxbContextResolver.java
index 342d61e..76de8d0 100644
--- a/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/JaxbContextResolver.java
+++ b/examples/json-jettison/src/main/java/org/glassfish/jersey/examples/jettison/JaxbContextResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,8 +25,8 @@
/**
* {@link ContextResolver Context resolver} for {@link JAXBContext}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
@Provider
public final class JaxbContextResolver implements ContextResolver<JAXBContext> {
diff --git a/examples/json-jettison/src/test/java/org/glassfish/jersey/examples/jettison/JsonJettisonTest.java b/examples/json-jettison/src/test/java/org/glassfish/jersey/examples/jettison/JsonJettisonTest.java
index a72e521..0f36b6b 100644
--- a/examples/json-jettison/src/test/java/org/glassfish/jersey/examples/jettison/JsonJettisonTest.java
+++ b/examples/json-jettison/src/test/java/org/glassfish/jersey/examples/jettison/JsonJettisonTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,8 +27,8 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class JsonJettisonTest extends JerseyTest {
diff --git a/examples/json-moxy/pom.xml b/examples/json-moxy/pom.xml
index 5d67f06..ae5ed13 100644
--- a/examples/json-moxy/pom.xml
+++ b/examples/json-moxy/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-moxy</artifactId>
diff --git a/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/App.java b/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/App.java
index 3715d11..31b7972 100644
--- a/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/App.java
+++ b/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -26,7 +26,7 @@
import org.glassfish.grizzly.http.server.HttpServer;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
*/
public class App {
diff --git a/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/JsonResource.java b/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/JsonResource.java
index a26e430..d6563c1 100644
--- a/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/JsonResource.java
+++ b/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/JsonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
import javax.ws.rs.core.MediaType;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("test")
public class JsonResource {
diff --git a/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/TestBean.java b/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/TestBean.java
index 74f1e38..079d524 100644
--- a/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/TestBean.java
+++ b/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy/TestBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@XmlRootElement
public class TestBean {
diff --git a/examples/json-moxy/src/test/java/org/glassfish/jersey/examples/jsonmoxy/JsonResourceTest.java b/examples/json-moxy/src/test/java/org/glassfish/jersey/examples/jsonmoxy/JsonResourceTest.java
index 3f6000a..8ea7611 100644
--- a/examples/json-moxy/src/test/java/org/glassfish/jersey/examples/jsonmoxy/JsonResourceTest.java
+++ b/examples/json-moxy/src/test/java/org/glassfish/jersey/examples/jsonmoxy/JsonResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,7 +23,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
*/
public class JsonResourceTest extends JerseyTest {
diff --git a/examples/json-processing-webapp/pom.xml b/examples/json-processing-webapp/pom.xml
index f53def4..6b9e95b 100644
--- a/examples/json-processing-webapp/pom.xml
+++ b/examples/json-processing-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-processing-webapp</artifactId>
diff --git a/examples/json-with-padding/pom.xml b/examples/json-with-padding/pom.xml
index 0a37bd8..fbe2a68 100644
--- a/examples/json-with-padding/pom.xml
+++ b/examples/json-with-padding/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-with-padding</artifactId>
diff --git a/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/App.java b/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/App.java
index 7dbcc51..6416d7a 100644
--- a/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/App.java
+++ b/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,8 +24,8 @@
* Utility class which can create {@link org.glassfish.jersey.server.ApplicationHandler} instance and provides support
* for running this sample from command line.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/ChangeListResource.java b/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/ChangeListResource.java
index e0b24a6..e48dbb5 100644
--- a/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/ChangeListResource.java
+++ b/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/ChangeListResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
import org.glassfish.jersey.server.JSONP;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path(App.ROOT_PATH)
@Produces({"application/x-javascript", "application/json", "application/xml"})
diff --git a/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/ChangeRecordBean.java b/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/ChangeRecordBean.java
index cef2479..5475ffb 100644
--- a/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/ChangeRecordBean.java
+++ b/examples/json-with-padding/src/main/java/org/glassfish/jersey/examples/jsonp/ChangeRecordBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -14,7 +14,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement(name = "change")
public class ChangeRecordBean {
diff --git a/examples/json-with-padding/src/test/java/org/glassfish/jersey/examples/jsonp/JsonWithPaddingTest.java b/examples/json-with-padding/src/test/java/org/glassfish/jersey/examples/jsonp/JsonWithPaddingTest.java
index d589dc1..c674923 100644
--- a/examples/json-with-padding/src/test/java/org/glassfish/jersey/examples/jsonp/JsonWithPaddingTest.java
+++ b/examples/json-with-padding/src/test/java/org/glassfish/jersey/examples/jsonp/JsonWithPaddingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JsonWithPaddingTest extends JerseyTest {
diff --git a/examples/managed-beans-webapp/pom.xml b/examples/managed-beans-webapp/pom.xml
index 3cbcfbf..95d45c1 100644
--- a/examples/managed-beans-webapp/pom.xml
+++ b/examples/managed-beans-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>managed-beans-webapp</artifactId>
diff --git a/examples/managed-beans-webapp/src/main/java/org/glassfish/jersey/examples/managedbeans/resources/ManagedBeanSingletonResource.java b/examples/managed-beans-webapp/src/main/java/org/glassfish/jersey/examples/managedbeans/resources/ManagedBeanSingletonResource.java
index 3b79391..70f6688 100644
--- a/examples/managed-beans-webapp/src/main/java/org/glassfish/jersey/examples/managedbeans/resources/ManagedBeanSingletonResource.java
+++ b/examples/managed-beans-webapp/src/main/java/org/glassfish/jersey/examples/managedbeans/resources/ManagedBeanSingletonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -32,7 +32,7 @@
* JAX-RS root resource treated as Java EE managed bean in singleton scope.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/managedbean/singleton")
@Singleton
diff --git a/examples/managed-beans-webapp/src/main/java/org/glassfish/jersey/examples/managedbeans/resources/Widget.java b/examples/managed-beans-webapp/src/main/java/org/glassfish/jersey/examples/managedbeans/resources/Widget.java
index fff3dcd..1b49394 100644
--- a/examples/managed-beans-webapp/src/main/java/org/glassfish/jersey/examples/managedbeans/resources/Widget.java
+++ b/examples/managed-beans-webapp/src/main/java/org/glassfish/jersey/examples/managedbeans/resources/Widget.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* Simple JPA entity made accessible via {@link ManagedBeanSingletonResource}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Entity
public class Widget implements Serializable {
diff --git a/examples/managed-beans-webapp/src/test/java/org/glassfish/jersey/examples/managedbeans/ManagedBeanWebAppTest.java b/examples/managed-beans-webapp/src/test/java/org/glassfish/jersey/examples/managedbeans/ManagedBeanWebAppTest.java
index a7e86b6..662685c 100644
--- a/examples/managed-beans-webapp/src/test/java/org/glassfish/jersey/examples/managedbeans/ManagedBeanWebAppTest.java
+++ b/examples/managed-beans-webapp/src/test/java/org/glassfish/jersey/examples/managedbeans/ManagedBeanWebAppTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -37,7 +37,7 @@
* mvn -DskipTests=false test</pre>
*
* @author Naresh Srinivas Bhimisetty
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ManagedBeanWebAppTest extends JerseyTest {
diff --git a/examples/managed-client-simple-webapp/pom.xml b/examples/managed-client-simple-webapp/pom.xml
index 0c17c39..df41bdb 100644
--- a/examples/managed-client-simple-webapp/pom.xml
+++ b/examples/managed-client-simple-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>managed-client-simple-webapp</artifactId>
diff --git a/examples/managed-client-webapp/pom.xml b/examples/managed-client-webapp/pom.xml
index 5373401..7b52280 100644
--- a/examples/managed-client-webapp/pom.xml
+++ b/examples/managed-client-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>managed-client-webapp</artifactId>
diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/ClientA.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/ClientA.java
index 48fda2b..21f8a28 100644
--- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/ClientA.java
+++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/ClientA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Managed client configuration for client A.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ClientBinding(configClass = MyApplication.MyClientAConfig.class)
@Documented
diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/ClientB.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/ClientB.java
index f78229f..c978848 100644
--- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/ClientB.java
+++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/ClientB.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Managed client configuration for client B.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ClientBinding(configClass = MyApplication.MyClientBConfig.class)
@Documented
diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFeature.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFeature.java
index 1b73af6..f4fe305 100644
--- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFeature.java
+++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
* to every method that is annotated with {@link org.glassfish.jersey.examples.managedclient.CustomHeaderFeature.Require @Require} internal feature
* annotation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CustomHeaderFeature implements DynamicFeature {
diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFilter.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFilter.java
index a10414b..123f1eb 100644
--- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFilter.java
+++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -29,7 +29,7 @@
* If the validation fails a HTTP 403 response is returned.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CustomHeaderFilter implements ContainerRequestFilter, ClientRequestFilter {
private final String headerName;
diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/InternalResource.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/InternalResource.java
index f715129..f83b2c6 100644
--- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/InternalResource.java
+++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/InternalResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
* Internal resource accessed from the managed client resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("internal")
public class InternalResource {
diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/MyApplication.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/MyApplication.java
index 1c8ccc6..74084ef 100644
--- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/MyApplication.java
+++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
* Jersey managed client example application.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class MyApplication extends ResourceConfig {
diff --git a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java
index 17454bc..0749233 100644
--- a/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java
+++ b/examples/managed-client-webapp/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -29,7 +29,7 @@
* with a proper value into the outgoing client requests.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("public")
public class PublicResource {
diff --git a/examples/managed-client-webapp/src/test/java/org/glassfish/jersey/examples/managedclient/ManagedClientTest.java b/examples/managed-client-webapp/src/test/java/org/glassfish/jersey/examples/managedclient/ManagedClientTest.java
index adc3acd..bc5a38e 100644
--- a/examples/managed-client-webapp/src/test/java/org/glassfish/jersey/examples/managedclient/ManagedClientTest.java
+++ b/examples/managed-client-webapp/src/test/java/org/glassfish/jersey/examples/managedclient/ManagedClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
/**
* Jersey managed client example tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ManagedClientTest extends JerseyTest {
diff --git a/examples/managed-client/pom.xml b/examples/managed-client/pom.xml
index fc52ba6..1a102af 100644
--- a/examples/managed-client/pom.xml
+++ b/examples/managed-client/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>managed-client</artifactId>
diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/App.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/App.java
index dc23e6d..3ed7a5f 100644
--- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/App.java
+++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* Jersey programmatic managed client example application.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/ClientA.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/ClientA.java
index c67dd1e..947e811 100644
--- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/ClientA.java
+++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/ClientA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Managed client configuration for client A.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ClientBinding(configClass = App.MyClientAConfig.class)
@Documented
diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/ClientB.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/ClientB.java
index 3813df9..1743896 100644
--- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/ClientB.java
+++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/ClientB.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Managed client configuration for client B.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ClientBinding(configClass = App.MyClientBConfig.class)
@Documented
diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFeature.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFeature.java
index 7c249a1..b1779d7 100644
--- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFeature.java
+++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
* to every method that is annotated with {@link Require @Require} internal feature
* annotation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CustomHeaderFeature implements DynamicFeature {
diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFilter.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFilter.java
index a10414b..123f1eb 100644
--- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFilter.java
+++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/CustomHeaderFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -29,7 +29,7 @@
* If the validation fails a HTTP 403 response is returned.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class CustomHeaderFilter implements ContainerRequestFilter, ClientRequestFilter {
private final String headerName;
diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/InternalResource.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/InternalResource.java
index f715129..f83b2c6 100644
--- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/InternalResource.java
+++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/InternalResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
* Internal resource accessed from the managed client resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("internal")
public class InternalResource {
diff --git a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java
index 3340c16..3054d46 100644
--- a/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java
+++ b/examples/managed-client/src/main/java/org/glassfish/jersey/examples/managedclient/PublicResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -29,7 +29,7 @@
* with a proper value into the outgoing client requests.
* </p>
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("public")
public class PublicResource {
diff --git a/examples/managed-client/src/test/java/org/glassfish/jersey/examples/managedclient/ManagedClientTest.java b/examples/managed-client/src/test/java/org/glassfish/jersey/examples/managedclient/ManagedClientTest.java
index 566aedd..dc6a1be 100644
--- a/examples/managed-client/src/test/java/org/glassfish/jersey/examples/managedclient/ManagedClientTest.java
+++ b/examples/managed-client/src/test/java/org/glassfish/jersey/examples/managedclient/ManagedClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* Jersey managed client example tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ManagedClientTest extends JerseyTest {
diff --git a/examples/multipart-webapp/pom.xml b/examples/multipart-webapp/pom.xml
index cf045db..f18136e 100644
--- a/examples/multipart-webapp/pom.xml
+++ b/examples/multipart-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>multipart-webapp</artifactId>
@@ -50,6 +50,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/multipart-webapp/src/main/java/org/glassfish/jersey/examples/multipart/webapp/MultiPartFieldInjectedResource.java b/examples/multipart-webapp/src/main/java/org/glassfish/jersey/examples/multipart/webapp/MultiPartFieldInjectedResource.java
index cddba3f..d99d3b6 100644
--- a/examples/multipart-webapp/src/main/java/org/glassfish/jersey/examples/multipart/webapp/MultiPartFieldInjectedResource.java
+++ b/examples/multipart-webapp/src/main/java/org/glassfish/jersey/examples/multipart/webapp/MultiPartFieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Field-injected version of the {@link FormDataParam} injection testing resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("/form-field-injected")
public class MultiPartFieldInjectedResource {
diff --git a/examples/multipart-webapp/src/test/java/org/glassfish/jersey/examples/multipart/webapp/MultiPartWebAppTest.java b/examples/multipart-webapp/src/test/java/org/glassfish/jersey/examples/multipart/webapp/MultiPartWebAppTest.java
index 8407396..ad1a346 100644
--- a/examples/multipart-webapp/src/test/java/org/glassfish/jersey/examples/multipart/webapp/MultiPartWebAppTest.java
+++ b/examples/multipart-webapp/src/test/java/org/glassfish/jersey/examples/multipart/webapp/MultiPartWebAppTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -42,7 +42,7 @@
/**
* Tests for {@code MultipartResource} class.
*
- * @author Naresh (srinivas.bhimisetty at oracle.com)
+ * @author Naresh (Srinivas Bhimisetty)
* @author Michal Gajdos
*/
public class MultiPartWebAppTest extends JerseyTest {
diff --git a/examples/oauth-client-twitter/pom.xml b/examples/oauth-client-twitter/pom.xml
index 27cc972..9c3bee3 100644
--- a/examples/oauth-client-twitter/pom.xml
+++ b/examples/oauth-client-twitter/pom.xml
@@ -15,7 +15,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.examples</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -67,6 +67,18 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/open-tracing/pom.xml b/examples/open-tracing/pom.xml
index 308c21b..a5836bf 100644
--- a/examples/open-tracing/pom.xml
+++ b/examples/open-tracing/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>open-tracing</artifactId>
diff --git a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/App.java b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/App.java
index b7c48e5..1de9406 100644
--- a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/App.java
+++ b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -46,7 +46,7 @@
* </pre>
* and go to {@code localhost:16686}.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
public class App {
diff --git a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java
index ce8e83b..e0f9901 100644
--- a/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java
+++ b/examples/open-tracing/src/main/java/org/glassfish/jersey/examples/opentracing/TracedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -50,7 +50,7 @@
* <p>
* All the ad-hoc created spans MUST be {@link Span#finish() finished} explicitly.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path(value = "/resource")
public class TracedResource {
diff --git a/examples/osgi-helloworld-webapp/additional-bundle/pom.xml b/examples/osgi-helloworld-webapp/additional-bundle/pom.xml
index 560a9d8..d05c3ef 100644
--- a/examples/osgi-helloworld-webapp/additional-bundle/pom.xml
+++ b/examples/osgi-helloworld-webapp/additional-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>osgi-helloworld-webapp</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
diff --git a/examples/osgi-helloworld-webapp/additional-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/AdditionalResource.java b/examples/osgi-helloworld-webapp/additional-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/AdditionalResource.java
index c18d5c4..72f3f6c 100644
--- a/examples/osgi-helloworld-webapp/additional-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/AdditionalResource.java
+++ b/examples/osgi-helloworld-webapp/additional-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/AdditionalResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
* There is also an alternate version of the resource with the same class name within the same package which
* should not be visible to Jersey via OSGi.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("/additional")
public class AdditionalResource {
diff --git a/examples/osgi-helloworld-webapp/additional-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/subpackage/AdditionalSubPackagedResource.java b/examples/osgi-helloworld-webapp/additional-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/subpackage/AdditionalSubPackagedResource.java
index 35318cc..95a005d 100644
--- a/examples/osgi-helloworld-webapp/additional-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/subpackage/AdditionalSubPackagedResource.java
+++ b/examples/osgi-helloworld-webapp/additional-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/subpackage/AdditionalSubPackagedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* This resource is located in a sub-package and will be detected by OSGI framework only if recursive scanning is turned on.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/subadditional")
public class AdditionalSubPackagedResource {
diff --git a/examples/osgi-helloworld-webapp/alternate-version-bundle/pom.xml b/examples/osgi-helloworld-webapp/alternate-version-bundle/pom.xml
index 10071e2..f90972e 100644
--- a/examples/osgi-helloworld-webapp/alternate-version-bundle/pom.xml
+++ b/examples/osgi-helloworld-webapp/alternate-version-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>osgi-helloworld-webapp</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
diff --git a/examples/osgi-helloworld-webapp/alternate-version-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/AdditionalResource.java b/examples/osgi-helloworld-webapp/alternate-version-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/AdditionalResource.java
index 214b37f..973fb1c 100644
--- a/examples/osgi-helloworld-webapp/alternate-version-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/AdditionalResource.java
+++ b/examples/osgi-helloworld-webapp/alternate-version-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/additional/resource/AdditionalResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -26,7 +26,7 @@
*
* If this version of the resource is used, the test will fail.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("/additional")
public class AdditionalResource {
diff --git a/examples/osgi-helloworld-webapp/functional-test/pom.xml b/examples/osgi-helloworld-webapp/functional-test/pom.xml
index 4bae4a5..858ae11 100644
--- a/examples/osgi-helloworld-webapp/functional-test/pom.xml
+++ b/examples/osgi-helloworld-webapp/functional-test/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>osgi-helloworld-webapp</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
@@ -225,6 +225,26 @@
<profiles>
<profile>
+ <id>testsSkipJdk11</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- Exclude unit tests on jdk 11 for now -->
+ <excludes>
+ <exclude>**/WebAppFelixTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>release</id>
<!-- do not create source zip bundles -->
<build>
diff --git a/examples/osgi-helloworld-webapp/functional-test/src/test/java/org/glassfish/jersey/examples/helloworld/test/AbstractWebAppTest.java b/examples/osgi-helloworld-webapp/functional-test/src/test/java/org/glassfish/jersey/examples/helloworld/test/AbstractWebAppTest.java
index dd89740..597f4f8 100644
--- a/examples/osgi-helloworld-webapp/functional-test/src/test/java/org/glassfish/jersey/examples/helloworld/test/AbstractWebAppTest.java
+++ b/examples/osgi-helloworld-webapp/functional-test/src/test/java/org/glassfish/jersey/examples/helloworld/test/AbstractWebAppTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -56,8 +56,8 @@
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Jakub Podlesak
+ * @author Adam Lindenthal
*/
public abstract class AbstractWebAppTest {
@@ -151,7 +151,7 @@
systemPackage("com.sun.source.util"),
// validation - required by jersey-container-servlet-core
- mavenBundle().groupId("javax.validation").artifactId("validation-api").versionAsInProject(),
+ mavenBundle().groupId("jakarta.validation").artifactId("jakarta.validation-api").versionAsInProject(),
// Jersey bundles
mavenBundle().groupId("org.glassfish.jersey.core").artifactId("jersey-common").versionAsInProject(),
mavenBundle().groupId("org.glassfish.jersey.core").artifactId("jersey-server").versionAsInProject(),
diff --git a/examples/osgi-helloworld-webapp/lib-bundle/pom.xml b/examples/osgi-helloworld-webapp/lib-bundle/pom.xml
index 46d94fe..2eac2c9 100644
--- a/examples/osgi-helloworld-webapp/lib-bundle/pom.xml
+++ b/examples/osgi-helloworld-webapp/lib-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>osgi-helloworld-webapp</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
diff --git a/examples/osgi-helloworld-webapp/pom.xml b/examples/osgi-helloworld-webapp/pom.xml
index 067299a..57bcefd 100644
--- a/examples/osgi-helloworld-webapp/pom.xml
+++ b/examples/osgi-helloworld-webapp/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>osgi-helloworld-webapp</artifactId>
diff --git a/examples/osgi-helloworld-webapp/war-bundle/pom.xml b/examples/osgi-helloworld-webapp/war-bundle/pom.xml
index bd9eb80..d57ed75 100644
--- a/examples/osgi-helloworld-webapp/war-bundle/pom.xml
+++ b/examples/osgi-helloworld-webapp/war-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>osgi-helloworld-webapp</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
diff --git a/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/WebAppContextListener.java b/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/WebAppContextListener.java
index a7da75b..5ad3311 100644
--- a/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/WebAppContextListener.java
+++ b/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/WebAppContextListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
* This is to make sure we signal the application has been deployed/un-deployed
* via the OSGi EventAdmin service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class WebAppContextListener implements BundleActivator, ServletContextListener {
diff --git a/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/resource/WebInfClassesResource.java b/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/resource/WebInfClassesResource.java
index fd096c3..65aa4b9 100644
--- a/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/resource/WebInfClassesResource.java
+++ b/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/resource/WebInfClassesResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* This resource is physically located in WEB-INF/classes of a OSGI bundle.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/webinf")
public class WebInfClassesResource {
diff --git a/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/resource/subpackage/WebInfClassesSubPackagedResource.java b/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/resource/subpackage/WebInfClassesSubPackagedResource.java
index cf5a9a6..116c37b 100644
--- a/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/resource/subpackage/WebInfClassesSubPackagedResource.java
+++ b/examples/osgi-helloworld-webapp/war-bundle/src/main/java/org/glassfish/jersey/examples/osgi/helloworld/resource/subpackage/WebInfClassesSubPackagedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
* This resource is located in a sub-package and will be detected by OSGI framework only if recursive scanning is turned on.<br/>
* As a matter of fact, this resource is physically located in WEB-INF/classes which needs to be tested as well.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/subwebinf")
public class WebInfClassesSubPackagedResource {
diff --git a/examples/osgi-http-service/bundle/pom.xml b/examples/osgi-http-service/bundle/pom.xml
index 834cd65..da438f3 100644
--- a/examples/osgi-http-service/bundle/pom.xml
+++ b/examples/osgi-http-service/bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>osgi-http-service</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.examples.osgi-http-service</groupId>
diff --git a/examples/osgi-http-service/bundle/src/main/java/org/glassfish/jersey/examples/osgihttpservice/StatusResource.java b/examples/osgi-http-service/bundle/src/main/java/org/glassfish/jersey/examples/osgihttpservice/StatusResource.java
index 4ea3361..e0bbdc5 100644
--- a/examples/osgi-http-service/bundle/src/main/java/org/glassfish/jersey/examples/osgihttpservice/StatusResource.java
+++ b/examples/osgi-http-service/bundle/src/main/java/org/glassfish/jersey/examples/osgihttpservice/StatusResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -15,7 +15,7 @@
import javax.ws.rs.Produces;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("status")
public class StatusResource {
diff --git a/examples/osgi-http-service/functional-test/pom.xml b/examples/osgi-http-service/functional-test/pom.xml
index 91a0e2d..b4a754e 100644
--- a/examples/osgi-http-service/functional-test/pom.xml
+++ b/examples/osgi-http-service/functional-test/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>osgi-http-service</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.examples.osgi-http-service</groupId>
@@ -202,6 +202,27 @@
<profiles>
<profile>
+ <id>testsSkipJdk11</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- Exclude unit tests on jdk 11 for now -->
+ <excludes>
+ <exclude>**/GrizzlyHttpServiceFelixTest.java</exclude>
+ <exclude>**/JettyHttpServiceFelixTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>release</id>
<!-- do not create source zip bundles -->
<build>
diff --git a/examples/osgi-http-service/pom.xml b/examples/osgi-http-service/pom.xml
index e1ffacb..05d1005 100644
--- a/examples/osgi-http-service/pom.xml
+++ b/examples/osgi-http-service/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>osgi-http-service</artifactId>
diff --git a/examples/pom.xml b/examples/pom.xml
index d876543..b93deed 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<licenses>
diff --git a/examples/reload/pom.xml b/examples/reload/pom.xml
index d847d57..ac14266 100644
--- a/examples/reload/pom.xml
+++ b/examples/reload/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>reload</artifactId>
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/App.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/App.java
index 30244f6..5d527b6 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/App.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -52,7 +52,7 @@
* a new {@link ResourceConfig resource configuration} including all
* resource classes listed in that file.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class App {
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/ArrivalsResource.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/ArrivalsResource.java
index b849f5a..a3e4c68 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/ArrivalsResource.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/ArrivalsResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("arrivals")
public class ArrivalsResource {
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/DeparturesResource.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/DeparturesResource.java
index 80f9098..680d30e 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/DeparturesResource.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/DeparturesResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("departures")
public class DeparturesResource {
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/FlightsDB.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/FlightsDB.java
index 5de93db..7e8b858 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/FlightsDB.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/FlightsDB.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -14,7 +14,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class FlightsDB {
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/StatsResource.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/StatsResource.java
index b10fca6..f71288c 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/StatsResource.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/StatsResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("stats")
@Produces("text/plain")
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/AppClassLoader.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/AppClassLoader.java
index f9a8828..7d767a4 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/AppClassLoader.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/AppClassLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
* In order to load re-compiled classes we need
* to have a separate class-loader for each reload.
*
- * Jakub Podlesak (jakub.podlesak at oracle.com)
+ * Jakub Podlesak
*/
public class AppClassLoader extends ClassLoader {
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/ClassFile.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/ClassFile.java
index b4511cf..8e1dd05 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/ClassFile.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/ClassFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Class file representation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ClassFile extends SimpleJavaFileObject {
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/Compiler.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/Compiler.java
index 33602e3..87cc870 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/Compiler.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/Compiler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* Java compiler utility.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Compiler {
diff --git a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/JavaFile.java b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/JavaFile.java
index a7458ef..2a789ff 100644
--- a/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/JavaFile.java
+++ b/examples/reload/src/main/java/org/glassfish/jersey/examples/reload/compiler/JavaFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* Java source file representation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JavaFile extends SimpleJavaFileObject {
diff --git a/examples/reload/src/test/java/org/glassfish/jersey/examples/reload/ReloadTest.java b/examples/reload/src/test/java/org/glassfish/jersey/examples/reload/ReloadTest.java
index a9fd079..81079e4 100644
--- a/examples/reload/src/test/java/org/glassfish/jersey/examples/reload/ReloadTest.java
+++ b/examples/reload/src/test/java/org/glassfish/jersey/examples/reload/ReloadTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -26,7 +26,7 @@
/**
* This is to test the reload feature without updating the resources text file.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ReloadTest extends JerseyTest {
diff --git a/examples/rx-client-webapp/pom.xml b/examples/rx-client-webapp/pom.xml
index c1864fe..baef179 100644
--- a/examples/rx-client-webapp/pom.xml
+++ b/examples/rx-client-webapp/pom.xml
@@ -18,7 +18,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>rx-client-webapp</artifactId>
diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java
index d5ffaef..a9e9af6 100644
--- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java
+++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/FlowableAgentResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -42,7 +42,7 @@
* user. Uses RxJava2 Flowable and Jersey Client to obtain the data.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Singleton
@Path("agent/flowable")
diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java
index 9dc3d5f..5cfbc45 100644
--- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java
+++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ListenableFutureAgentResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -42,7 +42,7 @@
* Guava ListenableFuture and Jersey Client to obtain the data.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("agent/listenable")
@Produces("application/json")
diff --git a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java
index f23aa66..547b21e 100644
--- a/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java
+++ b/examples/rx-client-webapp/src/main/java/org/glassfish/jersey/examples/rx/agent/ObservableAgentResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -42,7 +42,7 @@
* RxJava Observable and Jersey Client to obtain the data.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Singleton
@Path("agent/observable")
diff --git a/examples/rx-client-webapp/src/test/java/org/glassfish/jersey/examples/rx/RxClientsTest.java b/examples/rx-client-webapp/src/test/java/org/glassfish/jersey/examples/rx/RxClientsTest.java
index 0d6ae12..271d91f 100644
--- a/examples/rx-client-webapp/src/test/java/org/glassfish/jersey/examples/rx/RxClientsTest.java
+++ b/examples/rx-client-webapp/src/test/java/org/glassfish/jersey/examples/rx/RxClientsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
* Invoke clients in Agent part of the application.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class RxClientsTest extends JerseyTest {
diff --git a/examples/server-async-managed/pom.xml b/examples/server-async-managed/pom.xml
index ea465a1..782d23b 100644
--- a/examples/server-async-managed/pom.xml
+++ b/examples/server-async-managed/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>server-async-managed</artifactId>
diff --git a/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/App.java b/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/App.java
index 3171046..1241199 100644
--- a/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/App.java
+++ b/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
/**
* Jersey example application for custom executors managed async resources.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/ChatResource.java b/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/ChatResource.java
index 5c86ad7..8d97c44 100644
--- a/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/ChatResource.java
+++ b/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/ChatResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
*
* This version of the messaging resource does not block when POSTing a new message.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("chat")
@Produces("application/json")
diff --git a/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/Message.java b/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/Message.java
index 7f526d7..a84771e 100644
--- a/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/Message.java
+++ b/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/Message.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -16,7 +16,7 @@
/**
* Chat message JAXB POJO.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@XmlRootElement
public class Message {
diff --git a/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/SimpleJerseyExecutorManagedLongRunningResource.java b/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/SimpleJerseyExecutorManagedLongRunningResource.java
index 79f2851..bbf16d5 100644
--- a/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/SimpleJerseyExecutorManagedLongRunningResource.java
+++ b/examples/server-async-managed/src/main/java/org/glassfish/jersey/examples/server/async/managed/SimpleJerseyExecutorManagedLongRunningResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -26,7 +26,7 @@
* Example of a simple resource with a long-running operation executed in a
* custom Jersey container request processing thread.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path(App.ASYNC_LONG_RUNNING_MANAGED_OP_PATH)
@Produces("text/plain")
diff --git a/examples/server-async-managed/src/test/java/org/glassfish/jersey/examples/server/async/managed/ManagedAsyncResourceTest.java b/examples/server-async-managed/src/test/java/org/glassfish/jersey/examples/server/async/managed/ManagedAsyncResourceTest.java
index 3eb6234..c8f54eb 100644
--- a/examples/server-async-managed/src/test/java/org/glassfish/jersey/examples/server/async/managed/ManagedAsyncResourceTest.java
+++ b/examples/server-async-managed/src/test/java/org/glassfish/jersey/examples/server/async/managed/ManagedAsyncResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -42,7 +42,7 @@
/**
* Test for the asynchronous managed resources example.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ManagedAsyncResourceTest extends JerseyTest {
diff --git a/examples/server-async-standalone/client/pom.xml b/examples/server-async-standalone/client/pom.xml
index c629324..6c84c49 100644
--- a/examples/server-async-standalone/client/pom.xml
+++ b/examples/server-async-standalone/client/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>server-async-standalone</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>server-async-standalone-client</artifactId>
diff --git a/examples/server-async-standalone/client/src/main/java/org/glassfish/jersey/examples/server/async/Main.java b/examples/server-async-standalone/client/src/main/java/org/glassfish/jersey/examples/server/async/Main.java
index 8f7c291..d64a5b1 100644
--- a/examples/server-async-standalone/client/src/main/java/org/glassfish/jersey/examples/server/async/Main.java
+++ b/examples/server-async-standalone/client/src/main/java/org/glassfish/jersey/examples/server/async/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
/**
* Long-running asynchronous service client.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class Main {
diff --git a/examples/server-async-standalone/client/src/main/java/org/glassfish/jersey/examples/server/async/MainWindow.java b/examples/server-async-standalone/client/src/main/java/org/glassfish/jersey/examples/server/async/MainWindow.java
index de9df4b..1758208 100644
--- a/examples/server-async-standalone/client/src/main/java/org/glassfish/jersey/examples/server/async/MainWindow.java
+++ b/examples/server-async-standalone/client/src/main/java/org/glassfish/jersey/examples/server/async/MainWindow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
import javax.swing.JLabel;
/**
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class MainWindow extends javax.swing.JFrame {
diff --git a/examples/server-async-standalone/pom.xml b/examples/server-async-standalone/pom.xml
index b5df260..612e748 100644
--- a/examples/server-async-standalone/pom.xml
+++ b/examples/server-async-standalone/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>server-async-standalone</artifactId>
diff --git a/examples/server-async-standalone/webapp/pom.xml b/examples/server-async-standalone/webapp/pom.xml
index e1a2046..f69a6b1 100644
--- a/examples/server-async-standalone/webapp/pom.xml
+++ b/examples/server-async-standalone/webapp/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>server-async-standalone</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>server-async-standalone-webapp</artifactId>
diff --git a/examples/server-async-standalone/webapp/src/main/java/org/glassfish/jersey/examples/server/async/AsyncJaxrsApplication.java b/examples/server-async-standalone/webapp/src/main/java/org/glassfish/jersey/examples/server/async/AsyncJaxrsApplication.java
index 505f327..7ffe8d6 100644
--- a/examples/server-async-standalone/webapp/src/main/java/org/glassfish/jersey/examples/server/async/AsyncJaxrsApplication.java
+++ b/examples/server-async-standalone/webapp/src/main/java/org/glassfish/jersey/examples/server/async/AsyncJaxrsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -22,7 +22,7 @@
/**
* Jersey Async Webapp application class.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ApplicationPath("/")
public class AsyncJaxrsApplication extends Application {
diff --git a/examples/server-async-standalone/webapp/src/main/java/org/glassfish/jersey/examples/server/async/LongRunningEchoResource.java b/examples/server-async-standalone/webapp/src/main/java/org/glassfish/jersey/examples/server/async/LongRunningEchoResource.java
index f6d016b..fe607cf 100644
--- a/examples/server-async-standalone/webapp/src/main/java/org/glassfish/jersey/examples/server/async/LongRunningEchoResource.java
+++ b/examples/server-async-standalone/webapp/src/main/java/org/glassfish/jersey/examples/server/async/LongRunningEchoResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
* Example of a simple resource with a long-running operation executed in a
* custom application thread.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("long-running")
@Produces("text/plain")
diff --git a/examples/server-async/pom.xml b/examples/server-async/pom.xml
index b5fbd71..44d8b00 100644
--- a/examples/server-async/pom.xml
+++ b/examples/server-async/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>server-async</artifactId>
diff --git a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/App.java b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/App.java
index 12063f2..00a36e8 100644
--- a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/App.java
+++ b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -25,7 +25,7 @@
/**
* Jersey example application for custom executors managed async resources.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class App {
diff --git a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/BlockingPostChatResource.java b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/BlockingPostChatResource.java
index 84b8348..ffea706 100644
--- a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/BlockingPostChatResource.java
+++ b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/BlockingPostChatResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -36,7 +36,7 @@
* This version of the messaging resource blocks when POSTing a new message until
* the message is retrieved.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path(App.ASYNC_MESSAGING_BLOCKING_PATH)
@Produces(MediaType.TEXT_PLAIN)
diff --git a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/FireAndForgetChatResource.java b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/FireAndForgetChatResource.java
index 7a32d39..fe4f2ba 100644
--- a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/FireAndForgetChatResource.java
+++ b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/FireAndForgetChatResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -35,7 +35,7 @@
*
* This version of the messaging resource does not block when POSTing a new message.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path(App.ASYNC_MESSAGING_FIRE_N_FORGET_PATH)
@Produces(MediaType.TEXT_PLAIN)
diff --git a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/LongRunningAsyncOperationResource.java b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/LongRunningAsyncOperationResource.java
index 15b3a08..9d2a178 100644
--- a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/LongRunningAsyncOperationResource.java
+++ b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/LongRunningAsyncOperationResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -28,7 +28,7 @@
/**
* Example resource for long running async operations.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
//TODO move the test to integration tests.
//@Path(App.LONG_RUNNING_ASYNC_OP_PATH)
diff --git a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/SimpleLongRunningResource.java b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/SimpleLongRunningResource.java
index 76cae73..9fbce9d 100644
--- a/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/SimpleLongRunningResource.java
+++ b/examples/server-async/src/main/java/org/glassfish/jersey/examples/server/async/SimpleLongRunningResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -28,7 +28,7 @@
* Example of a simple resource with a long-running operation executed in a
* custom application thread.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path(App.ASYNC_LONG_RUNNING_OP_PATH)
@Produces("text/plain")
diff --git a/examples/server-sent-events-jaxrs/pom.xml b/examples/server-sent-events-jaxrs/pom.xml
index 07b8031..fe9c688 100644
--- a/examples/server-sent-events-jaxrs/pom.xml
+++ b/examples/server-sent-events-jaxrs/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>server-sent-events-jaxrs</artifactId>
diff --git a/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/App.java b/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/App.java
index 29d44ff..0c40d6a 100644
--- a/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/App.java
+++ b/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -23,8 +23,8 @@
/**
* Server sent event example.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Pavel Bucek
+ * @author Adam Lindenthal
*/
public class App {
diff --git a/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/DomainResource.java b/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/DomainResource.java
index 98a03e0..32bc531 100644
--- a/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/DomainResource.java
+++ b/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/DomainResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -35,8 +35,8 @@
import javax.ws.rs.sse.SseEventSink;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Pavel Bucek
+ * @author Adam Lindenthal
*/
@Path("domain")
public class DomainResource {
diff --git a/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/JaxRsServerSentEventsResource.java b/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/JaxRsServerSentEventsResource.java
index 28ab750..aae2434 100644
--- a/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/JaxRsServerSentEventsResource.java
+++ b/examples/server-sent-events-jaxrs/src/main/java/org/glassfish/jersey/examples/sse/jaxrs/JaxRsServerSentEventsResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,8 +24,8 @@
import javax.ws.rs.sse.SseEventSink;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Pavel Bucek
+ * @author Adam Lindenthal
*/
@Path("server-sent-events")
public class JaxRsServerSentEventsResource {
diff --git a/examples/server-sent-events-jaxrs/src/test/java/org/glassfish/jersey/examples/sse/jaxrs/ServerSentEventsTest.java b/examples/server-sent-events-jaxrs/src/test/java/org/glassfish/jersey/examples/sse/jaxrs/ServerSentEventsTest.java
index b0e234a..68fad19 100644
--- a/examples/server-sent-events-jaxrs/src/test/java/org/glassfish/jersey/examples/sse/jaxrs/ServerSentEventsTest.java
+++ b/examples/server-sent-events-jaxrs/src/test/java/org/glassfish/jersey/examples/sse/jaxrs/ServerSentEventsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -40,9 +40,9 @@
/**
* SSE example resources test.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
+ * @author Adam Lindenthal
*/
public class ServerSentEventsTest extends JerseyTest {
diff --git a/examples/server-sent-events-jersey/pom.xml b/examples/server-sent-events-jersey/pom.xml
index 63af5de..98a1875 100644
--- a/examples/server-sent-events-jersey/pom.xml
+++ b/examples/server-sent-events-jersey/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>server-sent-events-jersey</artifactId>
diff --git a/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/App.java b/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/App.java
index c253d6c..ee4e723 100644
--- a/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/App.java
+++ b/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
/**
* Server sent event example.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class App {
diff --git a/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/DomainResource.java b/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/DomainResource.java
index d51e916..5856920 100644
--- a/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/DomainResource.java
+++ b/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/DomainResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -36,7 +36,7 @@
import org.glassfish.jersey.server.ChunkedOutput;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("domain")
public class DomainResource {
diff --git a/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/ServerSentEventsResource.java b/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/ServerSentEventsResource.java
index 1b8096d..320d9c4 100644
--- a/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/ServerSentEventsResource.java
+++ b/examples/server-sent-events-jersey/src/main/java/org/glassfish/jersey/examples/sse/jersey/ServerSentEventsResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -24,7 +24,7 @@
import org.glassfish.jersey.media.sse.SseFeature;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("server-sent-events")
public class ServerSentEventsResource {
diff --git a/examples/server-sent-events-jersey/src/test/java/org/glassfish/jersey/examples/sse/jersey/ServerSentEventsTest.java b/examples/server-sent-events-jersey/src/test/java/org/glassfish/jersey/examples/sse/jersey/ServerSentEventsTest.java
index 4782e7d..56ee494 100644
--- a/examples/server-sent-events-jersey/src/test/java/org/glassfish/jersey/examples/sse/jersey/ServerSentEventsTest.java
+++ b/examples/server-sent-events-jersey/src/test/java/org/glassfish/jersey/examples/sse/jersey/ServerSentEventsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -49,8 +49,8 @@
/**
* SSE example resources test.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class ServerSentEventsTest extends JerseyTest {
// TODO - due to JdkConnector migration this was radically reduced. It deadlocks with 25 clients, find out why!
diff --git a/examples/servlet3-webapp/pom.xml b/examples/servlet3-webapp/pom.xml
index 4d9a491..c75d2f4 100644
--- a/examples/servlet3-webapp/pom.xml
+++ b/examples/servlet3-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet3-webapp</artifactId>
diff --git a/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/App.java b/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/App.java
index 1e3f5d5..2ef3cc2 100644
--- a/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/App.java
+++ b/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* Test Application subclass for servlet3-webapp example.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class App extends Application {
diff --git a/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/CatResource.java b/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/CatResource.java
index d42071d..5893155 100644
--- a/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/CatResource.java
+++ b/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/CatResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* Test resource for the servlet3-webapp example.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("cat")
public class CatResource {
diff --git a/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/DogResource.java b/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/DogResource.java
index 352576e..711a9fe 100644
--- a/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/DogResource.java
+++ b/examples/servlet3-webapp/src/main/java/org/glassfish/jersey/examples/servlet3/webapp/DogResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* Test resource for the servlet3-webapp example.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("dog")
public class DogResource {
diff --git a/examples/servlet3-webapp/src/test/java/Servlet3WebappITCase.java b/examples/servlet3-webapp/src/test/java/Servlet3WebappITCase.java
index 0552dac..0bf859b 100644
--- a/examples/servlet3-webapp/src/test/java/Servlet3WebappITCase.java
+++ b/examples/servlet3-webapp/src/test/java/Servlet3WebappITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -27,7 +27,7 @@
* Tests the servlet3-webapp example.
* Integration test launched by maven-jetty-plugin
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class Servlet3WebappITCase extends JerseyTest {
diff --git a/examples/simple-console/pom.xml b/examples/simple-console/pom.xml
index a09ea3c..ea115ab 100644
--- a/examples/simple-console/pom.xml
+++ b/examples/simple-console/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>simple-console</artifactId>
@@ -62,6 +62,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>pre-release</id>
<build>
<plugins>
diff --git a/examples/simple-console/src/test/java/org/glassfish/jersey/examples/console/MainTest.java b/examples/simple-console/src/test/java/org/glassfish/jersey/examples/console/MainTest.java
index 14fe277..e79e600 100644
--- a/examples/simple-console/src/test/java/org/glassfish/jersey/examples/console/MainTest.java
+++ b/examples/simple-console/src/test/java/org/glassfish/jersey/examples/console/MainTest.java
@@ -34,7 +34,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Naresh (srinivas.bhimisetty at oracle.com)
+ * @author Naresh (Srinivas Bhimisetty)
*/
public class MainTest extends JerseyTest {
diff --git a/examples/sse-item-store-jaxrs-webapp/pom.xml b/examples/sse-item-store-jaxrs-webapp/pom.xml
index 252ee8b..620f24a 100644
--- a/examples/sse-item-store-jaxrs-webapp/pom.xml
+++ b/examples/sse-item-store-jaxrs-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>sse-item-store-jaxrs-webapp</artifactId>
diff --git a/examples/sse-item-store-jaxrs-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreApp.java b/examples/sse-item-store-jaxrs-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreApp.java
index ed76ecf..f1a22fd 100644
--- a/examples/sse-item-store-jaxrs-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreApp.java
+++ b/examples/sse-item-store-jaxrs-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* SSE item store JAX-RS application class.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@ApplicationPath("resources")
public class JaxrsItemStoreApp extends ResourceConfig {
diff --git a/examples/sse-item-store-jaxrs-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreResource.java b/examples/sse-item-store-jaxrs-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreResource.java
index a8c193d..a8dc84d 100644
--- a/examples/sse-item-store-jaxrs-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreResource.java
+++ b/examples/sse-item-store-jaxrs-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -39,7 +39,7 @@
/**
* A resource for storing named items.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("items")
public class JaxrsItemStoreResource {
diff --git a/examples/sse-item-store-jaxrs-webapp/src/test/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreResourceTest.java b/examples/sse-item-store-jaxrs-webapp/src/test/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreResourceTest.java
index 0f352a6..87c85c5 100644
--- a/examples/sse-item-store-jaxrs-webapp/src/test/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreResourceTest.java
+++ b/examples/sse-item-store-jaxrs-webapp/src/test/java/org/glassfish/jersey/examples/sseitemstore/jaxrs/JaxrsItemStoreResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -58,7 +58,7 @@
/**
* Item store test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JaxrsItemStoreResourceTest extends JerseyTest {
diff --git a/examples/sse-item-store-jersey-webapp/pom.xml b/examples/sse-item-store-jersey-webapp/pom.xml
index 9e93d1c..c1e7067 100644
--- a/examples/sse-item-store-jersey-webapp/pom.xml
+++ b/examples/sse-item-store-jersey-webapp/pom.xml
@@ -19,7 +19,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>webapp-example-parent</artifactId>
<relativePath>../webapp-example-parent/pom.xml</relativePath>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>sse-item-store-jersey-webapp</artifactId>
diff --git a/examples/sse-item-store-jersey-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jersey/ItemStoreApp.java b/examples/sse-item-store-jersey-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jersey/ItemStoreApp.java
index a8ca593..270e65d 100644
--- a/examples/sse-item-store-jersey-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jersey/ItemStoreApp.java
+++ b/examples/sse-item-store-jersey-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jersey/ItemStoreApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -18,7 +18,7 @@
/**
* SSE item store JAX-RS application class.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ApplicationPath("resources")
public class ItemStoreApp extends ResourceConfig {
diff --git a/examples/sse-item-store-jersey-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jersey/ItemStoreResource.java b/examples/sse-item-store-jersey-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jersey/ItemStoreResource.java
index a8d1dc7..5dd219d 100644
--- a/examples/sse-item-store-jersey-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jersey/ItemStoreResource.java
+++ b/examples/sse-item-store-jersey-webapp/src/main/java/org/glassfish/jersey/examples/sseitemstore/jersey/ItemStoreResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -39,7 +39,7 @@
/**
* A resource for storing named items.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("items")
public class ItemStoreResource {
diff --git a/examples/sse-item-store-jersey-webapp/src/test/java/org/glassfish/jersey/examples/sseitemstore/jersey/JerseyItemStoreResourceTest.java b/examples/sse-item-store-jersey-webapp/src/test/java/org/glassfish/jersey/examples/sseitemstore/jersey/JerseyItemStoreResourceTest.java
index 4122a3d..a561f71 100644
--- a/examples/sse-item-store-jersey-webapp/src/test/java/org/glassfish/jersey/examples/sseitemstore/jersey/JerseyItemStoreResourceTest.java
+++ b/examples/sse-item-store-jersey-webapp/src/test/java/org/glassfish/jersey/examples/sseitemstore/jersey/JerseyItemStoreResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -53,7 +53,7 @@
/**
* Item store test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JerseyItemStoreResourceTest extends JerseyTest {
diff --git a/examples/sse-twitter-aggregator/pom.xml b/examples/sse-twitter-aggregator/pom.xml
index fbcb54c..a108107 100644
--- a/examples/sse-twitter-aggregator/pom.xml
+++ b/examples/sse-twitter-aggregator/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>sse-twitter-aggregator</artifactId>
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/AbstractTestAggregator.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/AbstractTestAggregator.java
index 3c4f1e9..d8e501e 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/AbstractTestAggregator.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/AbstractTestAggregator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -26,8 +26,8 @@
/**
* Fake message aggregator used for testing purposes.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Marek Potociar
+ * @author Adam Lindenthal
*/
public abstract class AbstractTestAggregator implements DataAggregator {
private static final Logger LOGGER = Logger.getLogger(AbstractTestAggregator.class.getName());
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/DataAggregator.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/DataAggregator.java
index 6c677ae..dad7338 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/DataAggregator.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/DataAggregator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
/**
* Data aggregator for listening for events aggregated based on give keywords.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface DataAggregator {
void start(String keywords, DataListener msgListener);
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/DataListener.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/DataListener.java
index 5b513d7..9b1a019 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/DataListener.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/DataListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,7 +13,7 @@
/**
* Incoming data listener.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface DataListener {
/**
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MainWindow.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MainWindow.java
index 608c288..ce1e187 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MainWindow.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MainWindow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -28,7 +28,7 @@
/**
* Main data aggregator client application UI window.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class MainWindow extends javax.swing.JFrame {
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/Message.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/Message.java
index 46a93a8..2f324cc 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/Message.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/Message.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -17,7 +17,7 @@
/**
* Message bean.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class Message {
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MessageStreamResourceJaxRs.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MessageStreamResourceJaxRs.java
index 94a2466..4cf84ad 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MessageStreamResourceJaxRs.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MessageStreamResourceJaxRs.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -34,7 +34,7 @@
* Uses the JAX-RS 2.1 SSE API.
*
* @see MessageStreamResourceJersey
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("message/stream/jaxrs")
@Singleton
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MessageStreamResourceJersey.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MessageStreamResourceJersey.java
index 391776a..d38b14b 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MessageStreamResourceJersey.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/MessageStreamResourceJersey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -34,7 +34,7 @@
* Uses the Jersey-specific SSE API.
*
* @see MessageStreamResourceJaxRs
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("message/stream/jersey")
public final class MessageStreamResourceJersey {
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/RemoveSelectedListItemsAction.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/RemoveSelectedListItemsAction.java
index 34eb7d7..821a42a 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/RemoveSelectedListItemsAction.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/RemoveSelectedListItemsAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -21,7 +21,7 @@
/**
* TODO: javadoc.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class RemoveSelectedListItemsAction extends AbstractAction {
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TestAggregatorJaxRs.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TestAggregatorJaxRs.java
index bc151f1..01fc826 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TestAggregatorJaxRs.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TestAggregatorJaxRs.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,8 +13,8 @@
/**
* Fake message aggregator used for testing purposes pointing to SSE event stream implemented using Jersey-specific API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Marek Potociar
+ * @author Adam Lindenthal
*/
public class TestAggregatorJaxRs extends AbstractTestAggregator {
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TestAggregatorJersey.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TestAggregatorJersey.java
index c5ca5dc..677e654 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TestAggregatorJersey.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TestAggregatorJersey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -13,8 +13,8 @@
/**
* Fake message aggregator used for testing purposes pointing to SSE event stream implemented using Jersey-specific API.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Marek Potociar
+ * @author Adam Lindenthal
*/
public class TestAggregatorJersey extends AbstractTestAggregator {
diff --git a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TwitterAggregator.java b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TwitterAggregator.java
index a4a0aa2..6e20fac 100644
--- a/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TwitterAggregator.java
+++ b/examples/sse-twitter-aggregator/src/main/java/org/glassfish/jersey/examples/aggregator/TwitterAggregator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -35,7 +35,7 @@
/**
* Twitter message-based data aggregator implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class TwitterAggregator implements DataAggregator {
private static final Logger LOGGER = Logger.getLogger(TwitterAggregator.class.getName());
diff --git a/examples/system-properties-example/pom.xml b/examples/system-properties-example/pom.xml
index e1991e1..13fc60c 100644
--- a/examples/system-properties-example/pom.xml
+++ b/examples/system-properties-example/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>system-properties-example</artifactId>
diff --git a/examples/webapp-example-parent/pom.xml b/examples/webapp-example-parent/pom.xml
index 15391a8..0fac341 100644
--- a/examples/webapp-example-parent/pom.xml
+++ b/examples/webapp-example-parent/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>webapp-example-parent</artifactId>
diff --git a/examples/xml-moxy/pom.xml b/examples/xml-moxy/pom.xml
index 8171caf..f69ce6f 100644
--- a/examples/xml-moxy/pom.xml
+++ b/examples/xml-moxy/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>xml-moxy</artifactId>
diff --git a/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/App.java b/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/App.java
index d6cd52c..19b615a 100644
--- a/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/App.java
+++ b/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -22,7 +22,7 @@
import org.glassfish.grizzly.http.server.HttpServer;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class App {
diff --git a/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/Address.java b/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/Address.java
index 26238f1..15a8d8e 100644
--- a/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/Address.java
+++ b/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/Address.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -12,7 +12,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Address {
diff --git a/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/Customer.java b/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/Customer.java
index f1f6b33..cafcef4 100644
--- a/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/Customer.java
+++ b/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/Customer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -20,7 +20,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement
@XmlType(propOrder = {"name", "address", "phoneNumbers"})
diff --git a/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/PhoneNumber.java b/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/PhoneNumber.java
index 5df8b0e..14a0929 100644
--- a/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/PhoneNumber.java
+++ b/examples/xml-moxy/src/main/java/org/glassfish/jersey/examples/xmlmoxy/beans/PhoneNumber.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -15,7 +15,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class PhoneNumber {
diff --git a/examples/xml-moxy/src/test/java/org/glassfish/jersey/examples/xmlmoxy/MoxyAppTest.java b/examples/xml-moxy/src/test/java/org/glassfish/jersey/examples/xmlmoxy/MoxyAppTest.java
index 4d207a0..d154e1a 100644
--- a/examples/xml-moxy/src/test/java/org/glassfish/jersey/examples/xmlmoxy/MoxyAppTest.java
+++ b/examples/xml-moxy/src/test/java/org/glassfish/jersey/examples/xmlmoxy/MoxyAppTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -26,7 +26,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class MoxyAppTest extends JerseyTest {
diff --git a/ext/bean-validation/pom.xml b/ext/bean-validation/pom.xml
index 979c8dd..9fb1ab6 100644
--- a/ext/bean-validation/pom.xml
+++ b/ext/bean-validation/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-bean-validation</artifactId>
@@ -55,7 +55,7 @@
<!-- Note: When you're changing these properties change them also in bundles/jax-rs-ri/bundle/pom.xml. -->
<Export-Package>org.glassfish.jersey.server.validation.*;version=${project.version}</Export-Package>
<Import-Package>
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
javax.validation.*;resolution:=optional;version="${range;[==,3);${javax.validation.api.version}}",
*
</Import-Package>
@@ -83,8 +83,8 @@
</dependency>
<dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
diff --git a/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/DefaultConfiguredValidator.java b/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/DefaultConfiguredValidator.java
index 74e1845..3d2a746 100644
--- a/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/DefaultConfiguredValidator.java
+++ b/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/DefaultConfiguredValidator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
* Default {@link ConfiguredValidator} implementation - delegates calls to the underlying {@link Validator}.
*
* @author Michal Gajdos
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
class DefaultConfiguredValidator implements ConfiguredValidator, ValidationInterceptor {
diff --git a/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/ValidationErrorMessageBodyWriter.java b/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/ValidationErrorMessageBodyWriter.java
index 6383246..84e2a00 100644
--- a/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/ValidationErrorMessageBodyWriter.java
+++ b/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/ValidationErrorMessageBodyWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -48,19 +48,17 @@
return isSupportedMediaType(mediaType) && isSupportedType(type, genericType);
}
- private boolean isSupportedType(final Class<?> type, final Type genericType) {
+ private static boolean isSupportedType(final Class<?> type, final Type genericType) {
if (ValidationError.class.isAssignableFrom(type)) {
return true;
- } else if (Collection.class.isAssignableFrom(type)) {
- if (genericType instanceof ParameterizedType) {
- return ValidationError.class
- .isAssignableFrom((Class) ((ParameterizedType) genericType).getActualTypeArguments()[0]);
- }
+ } else if (Collection.class.isAssignableFrom(type) && (genericType instanceof ParameterizedType)) {
+ return ValidationError.class
+ .isAssignableFrom((Class) ((ParameterizedType) genericType).getActualTypeArguments()[0]);
}
return false;
}
- private boolean isSupportedMediaType(final MediaType mediaType) {
+ private static boolean isSupportedMediaType(final MediaType mediaType) {
return MediaType.TEXT_HTML_TYPE.equals(mediaType) || MediaType.TEXT_PLAIN_TYPE.equals(mediaType);
}
@@ -118,7 +116,9 @@
// Invalid value.
builder.append(isPlain ? "invalidValue = " : ("<span class=\"invalid-value\"><strong>invalidValue</strong> = "));
- builder.append(isPlain ? error.getInvalidValue() : (error.getInvalidValue() + "</span>"));
+ builder.append(isPlain ? error.getInvalidValue()
+ : escapeHtml(error.getInvalidValue()).concat("</span>")
+ );
builder.append(')');
@@ -137,4 +137,12 @@
entityStream.write(builder.toString().getBytes(MessageUtils.getCharset(mediaType)));
entityStream.flush();
}
-}
+
+ private static final String escapeHtml(String origin) {
+ return origin == null ? ""
+ : origin.replaceAll("&", "&")
+ .replaceAll("\"", """)
+ .replaceAll("<", "<")
+ .replaceAll(">", ">");
+ }
+}
\ No newline at end of file
diff --git a/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/ValidationInterceptorExecutor.java b/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/ValidationInterceptorExecutor.java
index 6f0f728..de4ec6d 100644
--- a/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/ValidationInterceptorExecutor.java
+++ b/ext/bean-validation/src/main/java/org/glassfish/jersey/server/validation/internal/ValidationInterceptorExecutor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019Oracle 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
@@ -28,7 +28,7 @@
* Validation executor for resource method validation processing. It is intended for a one-off usage
* when the executor instance serves also as a {@link org.glassfish.jersey.server.spi.ValidationInterceptorContext}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
final class ValidationInterceptorExecutor implements ValidationInterceptorContext {
diff --git a/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/pom.xml b/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/pom.xml
index 8cbe151..16cbbf5 100644
--- a/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/pom.xml
+++ b/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-cdi1x-ban-custom-hk2-binding</artifactId>
diff --git a/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/src/main/java/org/glassfish/jersey/ext/cdi1x/hk2ban/EmptyHk2CustomInjectionTypeProvider.java b/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/src/main/java/org/glassfish/jersey/ext/cdi1x/hk2ban/EmptyHk2CustomInjectionTypeProvider.java
index 2e408f0..d262a10 100644
--- a/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/src/main/java/org/glassfish/jersey/ext/cdi1x/hk2ban/EmptyHk2CustomInjectionTypeProvider.java
+++ b/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/src/main/java/org/glassfish/jersey/ext/cdi1x/hk2ban/EmptyHk2CustomInjectionTypeProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -26,7 +26,7 @@
* Utility class that effectively disables any attempts of Jersey/CDI integration layer
* to delegate injection from CDI to HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class EmptyHk2CustomInjectionTypeProvider implements Hk2CustomBoundTypesProvider {
diff --git a/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/src/test/java/org/glassfish/jersey/ext/cdi1x/hk2ban/EmptyHk2CustomInjectionTypeProviderTest.java b/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/src/test/java/org/glassfish/jersey/ext/cdi1x/hk2ban/EmptyHk2CustomInjectionTypeProviderTest.java
index 6bce650..4b6e83a 100644
--- a/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/src/test/java/org/glassfish/jersey/ext/cdi1x/hk2ban/EmptyHk2CustomInjectionTypeProviderTest.java
+++ b/ext/cdi/jersey-cdi1x-ban-custom-hk2-binding/src/test/java/org/glassfish/jersey/ext/cdi1x/hk2ban/EmptyHk2CustomInjectionTypeProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
* Test for {@link EmptyHk2CustomInjectionTypeProvider}.
* Make sure that the empty provider could be loaded and provides an empty type set.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class EmptyHk2CustomInjectionTypeProviderTest {
diff --git a/ext/cdi/jersey-cdi1x-servlet/pom.xml b/ext/cdi/jersey-cdi1x-servlet/pom.xml
index a2002fe..092567e 100644
--- a/ext/cdi/jersey-cdi1x-servlet/pom.xml
+++ b/ext/cdi/jersey-cdi1x-servlet/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-cdi1x-servlet</artifactId>
diff --git a/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/CdiExternalRequestScope.java b/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/CdiExternalRequestScope.java
index 94217f2..d8c899f 100644
--- a/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/CdiExternalRequestScope.java
+++ b/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/CdiExternalRequestScope.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -26,7 +26,7 @@
/**
* Weld specific request scope to align CDI request context with Jersey.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@JerseyVetoed
diff --git a/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/CdiExternalRequestScopeExtension.java b/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/CdiExternalRequestScopeExtension.java
index e191462..54b51e7 100644
--- a/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/CdiExternalRequestScopeExtension.java
+++ b/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/CdiExternalRequestScopeExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
@@ -40,7 +40,7 @@
/**
* CDI extension to register {@link CdiExternalRequestScope}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiExternalRequestScopeExtension implements Extension {
diff --git a/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/ServletInjectionManagerStore.java b/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/ServletInjectionManagerStore.java
index 2c6f154..7b14068 100644
--- a/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/ServletInjectionManagerStore.java
+++ b/ext/cdi/jersey-cdi1x-servlet/src/main/java/org/glassfish/jersey/ext/cdi1x/servlet/internal/ServletInjectionManagerStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* enables WAR and EAR to be deployed on a servlet container and be properly injected.
*
* @author Michal Gajdos
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @since 2.17
*/
public class ServletInjectionManagerStore extends GenericInjectionManagerStore {
diff --git a/ext/cdi/jersey-cdi1x-transaction/pom.xml b/ext/cdi/jersey-cdi1x-transaction/pom.xml
index 5b23ddc..b453df9 100644
--- a/ext/cdi/jersey-cdi1x-transaction/pom.xml
+++ b/ext/cdi/jersey-cdi1x-transaction/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-cdi1x-transaction</artifactId>
@@ -91,7 +91,7 @@
<configuration>
<instructions>
<Export-Package>org.glassfish.jersey.ext.cdi1x.transaction.internal</Export-Package>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>${javax.annotation.osgi.version},*</Import-Package>
</instructions>
</configuration>
</plugin>
diff --git a/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/TransactionalExceptionInterceptorProvider.java b/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/TransactionalExceptionInterceptorProvider.java
index d6b5320..6e8ea0d 100644
--- a/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/TransactionalExceptionInterceptorProvider.java
+++ b/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/TransactionalExceptionInterceptorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -53,7 +53,7 @@
* {@link TransactionalException}. Jersey will try to restore the original
* JAX-RS exception using {@link TransactionalExceptionMapper}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Priority(value = Interceptor.Priority.PLATFORM_BEFORE + 199)
public class TransactionalExceptionInterceptorProvider implements ComponentProvider, Extension {
diff --git a/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/TransactionalExceptionMapper.java b/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/TransactionalExceptionMapper.java
index 3d9b20e..634d9b4 100644
--- a/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/TransactionalExceptionMapper.java
+++ b/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/TransactionalExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -35,7 +35,7 @@
* registered, no {@link WebApplicationException} thrown from a transactional
* CDI bean would get properly mapped to corresponding response.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@JerseyVetoed
diff --git a/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/WebAppExceptionHolder.java b/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/WebAppExceptionHolder.java
index 9f052df..1617f3b 100644
--- a/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/WebAppExceptionHolder.java
+++ b/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/WebAppExceptionHolder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
* thrown in a {@link Transactional} CDI bean for later use
* in {@link TransactionalExceptionMapper}.
*
- * @author Jakub.Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub.Podlesak
*/
@RequestScoped
@JerseyVetoed
diff --git a/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/WebAppExceptionInterceptor.java b/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/WebAppExceptionInterceptor.java
index 4c68615..ac46efe 100644
--- a/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/WebAppExceptionInterceptor.java
+++ b/ext/cdi/jersey-cdi1x-transaction/src/main/java/org/glassfish/jersey/ext/cdi1x/transaction/internal/WebAppExceptionInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,7 +33,7 @@
* Transactional interceptor to help retain {@link WebApplicationException}
* thrown by transactional beans.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Priority(value = Interceptor.Priority.PLATFORM_BEFORE + 199)
@Interceptor
diff --git a/ext/cdi/jersey-cdi1x-validation/pom.xml b/ext/cdi/jersey-cdi1x-validation/pom.xml
index 6eefa02..5fe5733 100644
--- a/ext/cdi/jersey-cdi1x-validation/pom.xml
+++ b/ext/cdi/jersey-cdi1x-validation/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-cdi1x-validation</artifactId>
@@ -101,7 +101,7 @@
<configuration>
<instructions>
<Export-Package>org.glassfish.jersey.ext.cdi1x.validation.internal;version=${project.version}</Export-Package>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>${javax.annotation.osgi.version},*</Import-Package>
</instructions>
</configuration>
</plugin>
diff --git a/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java b/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java
index 5b808ce..1d3d9d9 100644
--- a/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java
+++ b/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -36,7 +36,7 @@
* Jersey registers this wrapper into CDI container so that JAX-RS
* components do not get validated twice.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@MethodValidated
@Interceptor
diff --git a/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java b/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java
index 73a0e3a..acd1b5c 100644
--- a/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java
+++ b/ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -48,7 +48,7 @@
/**
* CDI extension to register {@link CdiInterceptorWrapper}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Priority(value = Interceptor.Priority.PLATFORM_BEFORE + 199)
public class CdiInterceptorWrapperExtension implements Extension {
diff --git a/ext/cdi/jersey-cdi1x/pom.xml b/ext/cdi/jersey-cdi1x/pom.xml
index 99463ff..0829465 100644
--- a/ext/cdi/jersey-cdi1x/pom.xml
+++ b/ext/cdi/jersey-cdi1x/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-cdi1x</artifactId>
@@ -83,10 +83,27 @@
org.glassfish.jersey.ext.cdi1x.spi,org.glassfish.jersey.ext.cdi1x.internal,
org.glassfish.jersey.ext.cdi1x.internal.spi
</Export-Package>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>
+ ${javax.annotation.osgi.version},
+ ${hk2.osgi.version},
+ *
+ </Import-Package>
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- for convenience reasons, 'argLine' should not be overridden in child poms. if needed, a property should be declared and used here -->
+ <argLine>
+ -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
+ -Xmx${surefire.maxmem.argline}m -Dfile.encoding=UTF8 ${surefire.security.argline}
+ ${surefire.coverage.argline}
+ </argLine>
+ <skipTests>${skip.tests}</skipTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/AbstractCdiBeanSupplier.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/AbstractCdiBeanSupplier.java
index d62c6a5..bba8282 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/AbstractCdiBeanSupplier.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/AbstractCdiBeanSupplier.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -37,7 +37,7 @@
* should implement properly annotated {@link java.util.function.Supplier#get()} method that
* could just delegate to the existing {@link #_provide()} method.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public abstract class AbstractCdiBeanSupplier<T> implements DisposableSupplier<T> {
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java
index 7dd258d..01a2d8e 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation 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
@@ -74,6 +75,7 @@
import org.glassfish.jersey.internal.inject.AbstractBinder;
import org.glassfish.jersey.internal.inject.Binder;
import org.glassfish.jersey.internal.inject.Bindings;
+import org.glassfish.jersey.internal.inject.CustomAnnotationLiteral;
import org.glassfish.jersey.internal.inject.ForeignRequestScopeBridge;
import org.glassfish.jersey.internal.inject.InjectionManager;
import org.glassfish.jersey.internal.inject.InstanceBinding;
@@ -101,7 +103,7 @@
* To properly inject JAX-RS/Jersey managed beans into CDI, it also
* serves as a {@link Extension CDI Extension}, that intercepts CDI injection targets.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Priority(200)
public class CdiComponentProvider implements ComponentProvider, Extension {
@@ -144,7 +146,10 @@
}
});
- private final Cache<Class<?>, Boolean> jaxRsResourceCache = new Cache<>(clazz -> Resource.from(clazz) != null);
+ // Check first if a class is a JAX-RS resource, and only if so check with validation.
+ // This prevents unnecessary warnings being logged for pure CDI beans.
+ private final Cache<Class<?>, Boolean> jaxRsResourceCache = new Cache<>(
+ clazz -> Resource.from(clazz, true) != null && Resource.from(clazz) != null);
private final Hk2CustomBoundTypesProvider customHk2TypesProvider;
private final InjectionManagerStore injectionManagerStore;
@@ -292,6 +297,11 @@
final boolean isJaxRsResource = jaxRsResourceCache.apply(clazz);
+ if (isJaxRsResource && !Resource.isAcceptable(clazz)) {
+ LOGGER.warning(LocalizationMessages.CDI_NON_INSTANTIABLE_COMPONENT(clazz));
+ return false;
+ }
+
final Class<? extends Annotation> beanScopeAnnotation = CdiUtil.getBeanScope(clazz, beanManager);
final boolean isRequestScoped = beanScopeAnnotation == RequestScoped.class
|| (beanScopeAnnotation == Dependent.class && isJaxRsResource);
@@ -300,7 +310,8 @@
? new RequestScopedCdiBeanSupplier(clazz, injectionManager, beanManager, isCdiManaged)
: new GenericCdiBeanSupplier(clazz, injectionManager, beanManager, isCdiManaged);
- SupplierInstanceBinding<AbstractCdiBeanSupplier> builder = Bindings.supplier(beanFactory).to(clazz);
+ SupplierInstanceBinding<AbstractCdiBeanSupplier> builder = Bindings.supplier(beanFactory)
+ .to(clazz).qualifiedBy(CustomAnnotationLiteral.INSTANCE);
for (final Class contract : providerContracts) {
builder.to(contract);
}
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiUtil.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiUtil.java
index 7f13ba6..febbcf1 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiUtil.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -37,7 +37,7 @@
/**
* Common CDI utility methods.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
public final class CdiUtil {
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/GenericCdiBeanSupplier.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/GenericCdiBeanSupplier.java
index 1b3d374..aeaf62e 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/GenericCdiBeanSupplier.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/GenericCdiBeanSupplier.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* Supplier to provide CDI managed components where
* there is no clear mapping between the CDI and scopes.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Vetoed
public final class GenericCdiBeanSupplier extends AbstractCdiBeanSupplier {
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/GenericInjectionManagerStore.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/GenericInjectionManagerStore.java
index 3b75a6a..086884d 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/GenericInjectionManagerStore.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/GenericInjectionManagerStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
* method must be implemented that shall be utilized at runtime in the case that more than a single
* injection manager has been registered.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @since 2.20
*/
public abstract class GenericInjectionManagerStore implements InjectionManagerStore, InjectionTargetListener {
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/InjecteeSkippingAnalyzer.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/InjecteeSkippingAnalyzer.java
index 7df7446..591b458 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/InjecteeSkippingAnalyzer.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/InjecteeSkippingAnalyzer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* Class analyzer that ignores given injection points.
* Used for CDI integration, where we need to avoid HK2 replacing CDI injected entities.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class InjecteeSkippingAnalyzer implements ClassAnalyzer {
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/JerseyVetoed.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/JerseyVetoed.java
index f294155..a5e660a 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/JerseyVetoed.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/JerseyVetoed.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
* Use this to annotate types included in Jersey libraries
* that are to be CDI managed as defined by the {@link CdiComponentProvider}
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/RequestScopedCdiBeanSupplier.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/RequestScopedCdiBeanSupplier.java
index ffe0385..025d6fc 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/RequestScopedCdiBeanSupplier.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/RequestScopedCdiBeanSupplier.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
* For these components, Jersey will avoid
* injecting dynamic proxies for JAX-RS request scoped injectees.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Vetoed
public final class RequestScopedCdiBeanSupplier extends AbstractCdiBeanSupplier {
diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/spi/Hk2CustomBoundTypesProvider.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/spi/Hk2CustomBoundTypesProvider.java
index dcdad4b..0b779a7 100644
--- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/spi/Hk2CustomBoundTypesProvider.java
+++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/spi/Hk2CustomBoundTypesProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
*
* <p>If more than one implementation is found, only a single one is selected that has the highest priority.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface Hk2CustomBoundTypesProvider {
diff --git a/ext/cdi/jersey-cdi1x/src/main/resources/org/glassfish/jersey/ext/cdi1x/internal/localization.properties b/ext/cdi/jersey-cdi1x/src/main/resources/org/glassfish/jersey/ext/cdi1x/internal/localization.properties
index 82ac7de..ee1f8e7 100644
--- a/ext/cdi/jersey-cdi1x/src/main/resources/org/glassfish/jersey/ext/cdi1x/internal/localization.properties
+++ b/ext/cdi/jersey-cdi1x/src/main/resources/org/glassfish/jersey/ext/cdi1x/internal/localization.properties
@@ -1,5 +1,6 @@
#
# Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2018 Payara Foundation 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,3 +25,4 @@
cdi.provider.initialized=Jersey CDI component provider initialized.
cdi.request.scoped.components.recognized=The following CDI types were recognized as request scoped components in Jersey: {0}.
cdi.type.vetoed=The following types have been vetoed by Jersey as per {0} configuration: {1}
+cdi.non.instantiable.component=Component of class {0} cannot be instantiated and will be ignored.
\ No newline at end of file
diff --git a/ext/cdi/jersey-cdi1x/src/test/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProviderTest.java b/ext/cdi/jersey-cdi1x/src/test/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProviderTest.java
index 9242f82..479d349 100644
--- a/ext/cdi/jersey-cdi1x/src/test/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProviderTest.java
+++ b/ext/cdi/jersey-cdi1x/src/test/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -40,7 +40,7 @@
/**
* Test for {@link CdiComponentProvider}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiComponentProviderTest {
diff --git a/ext/cdi/jersey-weld2-se/pom.xml b/ext/cdi/jersey-weld2-se/pom.xml
index 5e42459..3f1afbd 100644
--- a/ext/cdi/jersey-weld2-se/pom.xml
+++ b/ext/cdi/jersey-weld2-se/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-weld2-se</artifactId>
diff --git a/ext/cdi/jersey-weld2-se/src/main/java/org/glassfish/jersey/weld/se/WeldInjectionManagerStore.java b/ext/cdi/jersey-weld2-se/src/main/java/org/glassfish/jersey/weld/se/WeldInjectionManagerStore.java
index 38f501d..49cc847 100644
--- a/ext/cdi/jersey-weld2-se/src/main/java/org/glassfish/jersey/weld/se/WeldInjectionManagerStore.java
+++ b/ext/cdi/jersey-weld2-se/src/main/java/org/glassfish/jersey/weld/se/WeldInjectionManagerStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
* {@link InjectionManagerStore Injection manager} for Weld SE container. The provider
* enables multiple Jersey applications to be deployed within a single HTTP container.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @since 2.20
*/
public class WeldInjectionManagerStore extends GenericInjectionManagerStore {
diff --git a/ext/cdi/jersey-weld2-se/src/main/java/org/glassfish/jersey/weld/se/WeldRequestScope.java b/ext/cdi/jersey-weld2-se/src/main/java/org/glassfish/jersey/weld/se/WeldRequestScope.java
index 24f8c52..de3e54d 100644
--- a/ext/cdi/jersey-weld2-se/src/main/java/org/glassfish/jersey/weld/se/WeldRequestScope.java
+++ b/ext/cdi/jersey-weld2-se/src/main/java/org/glassfish/jersey/weld/se/WeldRequestScope.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
/**
* Weld specific request scope to align CDI request context with Jersey.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@JerseyVetoed
diff --git a/ext/cdi/pom.xml b/ext/cdi/pom.xml
index afafecf..4e2b367 100644
--- a/ext/cdi/pom.xml
+++ b/ext/cdi/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
diff --git a/ext/entity-filtering/pom.xml b/ext/entity-filtering/pom.xml
index 2c79264..ab1c623 100644
--- a/ext/entity-filtering/pom.xml
+++ b/ext/entity-filtering/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-entity-filtering</artifactId>
@@ -76,7 +76,7 @@
<configuration>
<instructions>
<Export-Package>org.glassfish.jersey.message.filtering.*;version=${project.version}</Export-Package>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>${javax.annotation.osgi.version},*</Import-Package>
</instructions>
<unpackBundle>true</unpackBundle>
</configuration>
diff --git a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/EntityGraphProviderImpl.java b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/EntityGraphProviderImpl.java
index ec67e9e..f80a250 100644
--- a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/EntityGraphProviderImpl.java
+++ b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/EntityGraphProviderImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,9 @@
import java.util.Collections;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import org.glassfish.jersey.internal.util.collection.DataStructures;
import org.glassfish.jersey.message.filtering.spi.EntityGraph;
import org.glassfish.jersey.message.filtering.spi.EntityGraphProvider;
import org.glassfish.jersey.message.filtering.spi.ObjectGraph;
@@ -33,8 +33,8 @@
*/
final class EntityGraphProviderImpl implements EntityGraphProvider {
- private final ConcurrentMap<Class<?>, EntityGraph> writerClassToGraph = DataStructures.createConcurrentMap();
- private final ConcurrentMap<Class<?>, EntityGraph> readerClassToGraph = DataStructures.createConcurrentMap();
+ private final ConcurrentMap<Class<?>, EntityGraph> writerClassToGraph = new ConcurrentHashMap<>();
+ private final ConcurrentMap<Class<?>, EntityGraph> readerClassToGraph = new ConcurrentHashMap<>();
@Override
public EntityGraph getOrCreateEntityGraph(final Class<?> entityClass, final boolean forWriter) {
@@ -82,4 +82,10 @@
? new EmptyObjectGraph(entityClass)
: new ObjectGraphImpl(classToGraph, entityGraph, filteringScopes);
}
+
+ @Override
+ public EntityGraph putIfAbsent(Class<?> entityClass, EntityGraph entityGraph, boolean forWriter) {
+ final ConcurrentMap<Class<?>, EntityGraph> classToGraph = forWriter ? writerClassToGraph : readerClassToGraph;
+ return classToGraph.putIfAbsent(entityClass, entityGraph);
+ }
}
diff --git a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/EntityInspectorImpl.java b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/EntityInspectorImpl.java
index 76af833..0e353f4 100644
--- a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/EntityInspectorImpl.java
+++ b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/EntityInspectorImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -50,7 +50,6 @@
*/
@Singleton
final class EntityInspectorImpl implements EntityInspector {
-
private final List<EntityProcessor> entityProcessors;
@Inject
@@ -71,21 +70,26 @@
@Override
public void inspect(final Class<?> entityClass, final boolean forWriter) {
if (!graphProvider.containsEntityGraph(entityClass, forWriter)) {
- final EntityGraph graph = graphProvider.getOrCreateEntityGraph(entityClass, forWriter);
+ final EntityGraph graph = new EntityGraphImpl(entityClass);
final Set<Class<?>> inspect = new HashSet<>();
// Class.
if (!inspectEntityClass(entityClass, graph, forWriter)) {
// Properties.
- final Map<String, Method> unmatchedAccessors = inspectEntityProperties(entityClass, graph, inspect, forWriter);
+ final Map<String, Method> unmatchedAccessors =
+ inspectEntityProperties(entityClass, graph, inspect, forWriter);
// Setters/Getters without fields.
inspectStandaloneAccessors(unmatchedAccessors, graph, forWriter);
+ graphProvider.putIfAbsent(entityClass, graph, forWriter);
+
// Inspect new classes.
for (final Class<?> clazz : inspect) {
inspect(clazz, forWriter);
}
+ } else {
+ graphProvider.putIfAbsent(entityClass, graph, forWriter);
}
}
}
diff --git a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/ServerScopeProvider.java b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/ServerScopeProvider.java
index 872317b..753acb4 100644
--- a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/ServerScopeProvider.java
+++ b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/ServerScopeProvider.java
@@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import javax.ws.rs.ConstrainedTo;
@@ -34,7 +35,6 @@
import javax.inject.Singleton;
import org.glassfish.jersey.internal.inject.InjectionManager;
-import org.glassfish.jersey.internal.util.collection.DataStructures;
import org.glassfish.jersey.server.ExtendedUriInfo;
import org.glassfish.jersey.server.model.Invocable;
import org.glassfish.jersey.server.model.ResourceMethod;
@@ -64,7 +64,7 @@
@Inject
public ServerScopeProvider(final Configuration config, final InjectionManager injectionManager) {
super(config, injectionManager);
- this.uriToContexts = DataStructures.createConcurrentMap();
+ this.uriToContexts = new ConcurrentHashMap<>();
}
@Override
diff --git a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/spi/EntityGraphProvider.java b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/spi/EntityGraphProvider.java
index 1f67159..d13d359 100644
--- a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/spi/EntityGraphProvider.java
+++ b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/spi/EntityGraphProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -66,4 +66,15 @@
* @return an entity-filtering object graph instance.
*/
public ObjectGraph createObjectGraph(final Class<?> entityClass, final Set<String> filteringScopes, final boolean forWriter);
+
+ /**
+ * Store an {@code EntityGraph} for a given entity if not already stored
+ * @param entityClass entity class which the object graph should be created for.
+ * @param entityGraph an entity graph to be stored
+ * @param forWriter flag determining whether the graph should be created for writer/reader.
+ * @return the previous value associated with the {@code entityClass, forWriter} key,
+ * or {@code null} if there was no previous mapping for the key. This behavior is inherited from
+ * {@link java.util.Map#putIfAbsent(Object, Object)}.
+ */
+ public EntityGraph putIfAbsent(final Class<?> entityClass, EntityGraph entityGraph, final boolean forWriter);
}
diff --git a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/spi/FilteringHelper.java b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/spi/FilteringHelper.java
index a0f2fa1..6704754 100644
--- a/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/spi/FilteringHelper.java
+++ b/ext/entity-filtering/src/main/java/org/glassfish/jersey/message/filtering/spi/FilteringHelper.java
@@ -28,12 +28,12 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import javax.xml.bind.JAXBElement;
import org.glassfish.jersey.internal.util.ReflectionHelper;
-import org.glassfish.jersey.internal.util.collection.DataStructures;
/**
* SPI utility methods for entity filtering.
@@ -47,7 +47,7 @@
*/
public static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
- private static final ConcurrentMap<Type, Class<?>> ENTITY_CLASSES = DataStructures.createConcurrentMap();
+ private static final ConcurrentMap<Type, Class<?>> ENTITY_CLASSES = new ConcurrentHashMap<>();
/**
* Determine whether given class is filterable by entity-filtering. Filterable classes are all classes that are not primitives
diff --git a/ext/metainf-services/pom.xml b/ext/metainf-services/pom.xml
index 2bb89b7..2006a19 100644
--- a/ext/metainf-services/pom.xml
+++ b/ext/metainf-services/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2014, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-metainf-services</artifactId>
@@ -83,7 +83,7 @@
<configuration>
<instructions>
<Import-Package>
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
*
</Import-Package>
<unpackBundle>true</unpackBundle>
diff --git a/ext/microprofile/mp-config/pom.xml b/ext/microprofile/mp-config/pom.xml
new file mode 100644
index 0000000..cc361e8
--- /dev/null
+++ b/ext/microprofile/mp-config/pom.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>project</artifactId>
+ <groupId>org.glassfish.jersey.ext.microprofile</groupId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jersey-mp-config</artifactId>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.eclipse.microprofile.config</groupId>
+ <artifactId>microprofile-config-api</artifactId>
+ <version>${config.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-jetty</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-jetty</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>io.helidon.microprofile.config</groupId>
+ <artifactId>helidon-microprofile-config</artifactId>
+ <version>${helidon.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/ConfigurationModel.java b/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/ConfigurationModel.java
new file mode 100644
index 0000000..8de143e
--- /dev/null
+++ b/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/ConfigurationModel.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2019 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.microprofile.config;
+
+import org.eclipse.microprofile.config.Config;
+import org.glassfish.jersey.spi.ExternalConfigurationModel;
+
+import javax.ws.rs.RuntimeType;
+import javax.ws.rs.core.Feature;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+/**
+ * Generic class which implements default properties provider's logic and wraps not used methods from ExtConfig
+ *
+ * @param <CONFIG> type of MP configuration impl
+ */
+public class ConfigurationModel<CONFIG extends Config>
+ implements ExternalConfigurationModel<CONFIG> {
+
+ private final Map<String, Object> properties;
+ private final CONFIG config;
+
+ public ConfigurationModel(CONFIG config) {
+ this.properties = new HashMap<>();
+ this.config = config;
+ }
+
+ @Override
+ public <T> T as(String name, Class<T> clazz) {
+ return config.getValue(name, clazz);
+ }
+
+ @Override
+ public <T> Optional<T> getOptionalProperty(String name, Class<T> clazz) {
+ return config.getOptionalValue(name, clazz);
+ }
+
+ @Override
+ public CONFIG getConfig() {
+ return config;
+ }
+
+ @Override
+ public boolean isProperty(String name) {
+ return properties.isEmpty() ? getValueFromConfig(name) != null : properties.containsKey(name);
+ }
+
+ /**
+ * Allows ancestors to work with native configuration providers
+ *
+ * @param name property name
+ * @return property's value if any
+ */
+ public Object getValueFromConfig(String name){
+ return getConfig().getValue(name, Object.class);
+ }
+
+ @Override
+ public RuntimeType getRuntimeType() {
+
+ return null;
+ }
+
+ @Override
+ public Map<String, Object> getProperties() {
+ if (properties.isEmpty()) {
+ config.getPropertyNames().forEach(c -> properties.put(c, config.getValue(c, String.class)));
+ }
+
+ return properties;
+ }
+
+ @Override
+ public Object getProperty(String name) {
+ return properties.isEmpty() ? getValueFromConfig(name) : properties.get(name);
+ }
+
+ @Override
+ public Collection<String> getPropertyNames() {
+ final Set<String> names = new HashSet<>(properties.keySet());
+ if (names.isEmpty()) {
+ config.getPropertyNames().forEach(names::add);
+ }
+ return names;
+ }
+
+ public ExternalConfigurationModel mergeProperties(Map<String, Object> inputProperties) {
+ if (inputProperties == null || inputProperties.isEmpty()) {
+ return this;
+ }
+ if (properties.isEmpty()) {
+ getProperties();
+ }
+ properties.putAll(inputProperties);
+
+ return this;
+
+ }
+
+ @Override
+ public boolean isEnabled(Feature feature) {
+ return false;
+ }
+
+ @Override
+ public boolean isEnabled(Class<? extends Feature> featureClass) {
+ return false;
+ }
+
+ @Override
+ public boolean isRegistered(Object component) {
+ return false;
+ }
+
+ @Override
+ public boolean isRegistered(Class<?> componentClass) {
+ return false;
+ }
+
+ @Override
+ public Map<Class<?>, Integer> getContracts(Class<?> componentClass) {
+ return null;
+ }
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ return null;
+ }
+
+ @Override
+ public Set<Object> getInstances() {
+ return null;
+ }
+}
diff --git a/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/ConfigurationProvider.java b/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/ConfigurationProvider.java
new file mode 100644
index 0000000..df50eee
--- /dev/null
+++ b/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/ConfigurationProvider.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2019 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.microprofile.config;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.glassfish.jersey.spi.ExternalConfigurationModel;
+import org.glassfish.jersey.spi.ExternalConfigurationProvider;
+
+import java.util.Map;
+
+public class ConfigurationProvider implements ExternalConfigurationProvider {
+
+
+ private ConfigurationModel<Config> configModel;
+
+ public ConfigurationProvider() {
+
+ configModel = new ConfigurationModel(ConfigProvider.getConfig());
+ }
+
+ @Override
+ public Map<String, Object> getProperties() {
+ return configModel.getProperties();
+ }
+
+ @Override
+ public ExternalConfigurationModel getConfiguration() {
+ return configModel;
+ }
+
+ @Override
+ public ExternalConfigurationModel merge(ExternalConfigurationModel input) {
+ return input == null ? this.configModel : this.configModel.mergeProperties(input.getProperties());
+ }
+}
diff --git a/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/package-info.java b/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/package-info.java
new file mode 100644
index 0000000..da40c5a
--- /dev/null
+++ b/ext/microprofile/mp-config/src/main/java/org/glassfish/jersey/microprofile/config/package-info.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2019 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
+ */
+
+/**
+ * Support for microprofile external configurations in Jersey
+ *
+ * Configuration properties for Jersey (client/server/common) could be passed from different sources
+ * using this implementation
+ *
+ * @since 2.29
+ */
+package org.glassfish.jersey.microprofile.config;
\ No newline at end of file
diff --git a/ext/microprofile/mp-config/src/main/resources/META-INF/services/org.glassfish.jersey.spi.ExternalConfigurationProvider b/ext/microprofile/mp-config/src/main/resources/META-INF/services/org.glassfish.jersey.spi.ExternalConfigurationProvider
new file mode 100644
index 0000000..e7aa15a
--- /dev/null
+++ b/ext/microprofile/mp-config/src/main/resources/META-INF/services/org.glassfish.jersey.spi.ExternalConfigurationProvider
@@ -0,0 +1 @@
+org.glassfish.jersey.microprofile.config.ConfigurationProvider
\ No newline at end of file
diff --git a/ext/microprofile/mp-config/src/test/java/org/glassfish/jersey/microprofile/config/ExternalPropertiesConfigurationFactoryTest.java b/ext/microprofile/mp-config/src/test/java/org/glassfish/jersey/microprofile/config/ExternalPropertiesConfigurationFactoryTest.java
new file mode 100644
index 0000000..2c4e70b
--- /dev/null
+++ b/ext/microprofile/mp-config/src/test/java/org/glassfish/jersey/microprofile/config/ExternalPropertiesConfigurationFactoryTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2019 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.microprofile.config;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.jetty.JettyTestContainerFactory;
+import org.glassfish.jersey.test.spi.TestContainerException;
+import org.glassfish.jersey.test.spi.TestContainerFactory;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.inject.Singleton;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+public class ExternalPropertiesConfigurationFactoryTest extends JerseyTest {
+
+ private static final ApplicationPropertiesConfig applicationPropertiesConfig = new ApplicationPropertiesConfig();
+
+ private static class ApplicationPropertiesConfig extends ResourceConfig {
+
+ public ApplicationPropertiesConfig() {
+ register(MyResource.class);
+ }
+ }
+
+ @Path("/")
+ @Singleton
+ public static class MyResource {
+
+
+ @GET
+ @Path("readProperty/{key}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response readProperties(@PathParam("key") String key) {
+ return Response.ok(String.valueOf(applicationPropertiesConfig.getProperty(key))).build();
+ }
+
+ @GET
+ @Path("getPropertyValue/{key}")
+ @Produces(MediaType.WILDCARD)
+ public Boolean getPropertyValue(@PathParam("key") String key) {
+ final Object value = applicationPropertiesConfig.getProperty(key);
+ return value == null ? null : Boolean.valueOf(value.toString());
+ }
+
+ }
+
+
+ @Override
+ protected Application configure() {
+
+ return applicationPropertiesConfig;
+
+ }
+
+ @Override
+ protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
+ return new JettyTestContainerFactory();
+ }
+
+ @Test
+ public void readConfigTest() {
+
+ final Boolean responce = target("getPropertyValue/{key}")
+ .resolveTemplate("key", "jersey.config.disableMetainfServicesLookup").request().get(Boolean.class);
+ Assert.assertEquals(Boolean.TRUE, responce);
+ }
+
+ @Test
+ public void smallRyeConfigTest() {
+
+ final String responce = target("readProperty/{key}")
+ .resolveTemplate("key", "jersey.config.disableAutoDiscovery").request().get(String.class);
+ Assert.assertEquals("1", responce);
+ }
+
+ @Test
+ public void defaultHeaderValueTest() {
+ final String responce = target("readProperty/{key}")
+ .resolveTemplate("key", "jersey.config.disableJsonProcessing").request().get(String.class);
+ Assert.assertEquals("true", responce);
+ }
+}
\ No newline at end of file
diff --git a/ext/microprofile/mp-config/src/test/resources/META-INF/microprofile-config.properties b/ext/microprofile/mp-config/src/test/resources/META-INF/microprofile-config.properties
new file mode 100644
index 0000000..dbb4a93
--- /dev/null
+++ b/ext/microprofile/mp-config/src/test/resources/META-INF/microprofile-config.properties
@@ -0,0 +1,3 @@
+jersey.config.disableJsonProcessing = true
+jersey.config.disableAutoDiscovery=1
+jersey.config.disableMetainfServicesLookup=true
\ No newline at end of file
diff --git a/ext/microprofile/mp-rest-client/pom.xml b/ext/microprofile/mp-rest-client/pom.xml
new file mode 100644
index 0000000..0ef960d
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/pom.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>project</artifactId>
+ <groupId>org.glassfish.jersey.ext.microprofile</groupId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jersey-mp-rest-client</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.microprofile.rest.client</groupId>
+ <artifactId>microprofile-rest-client-api</artifactId>
+ <version>1.3.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.microprofile.config</groupId>
+ <artifactId>microprofile-config-api</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-server</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <artifactId>jersey-media-json-binding</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.cdi</groupId>
+ <artifactId>jersey-cdi1x</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.json</groupId>
+ <artifactId>jakarta.json-api</artifactId>
+ <version>${jsonp.ri.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish</groupId>
+ <artifactId>jsonp-jaxrs</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <inherited>true</inherited>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.glassfish.jersey.restclient.*;version=${project.version}
+ </Export-Package>
+ <Import-Package>
+ *
+ </Import-Package>
+ </instructions>
+ <unpackBundle>true</unpackBundle>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/BeanClassModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/BeanClassModel.java
new file mode 100644
index 0000000..a074469
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/BeanClassModel.java
@@ -0,0 +1,279 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.ws.rs.BeanParam;
+import javax.ws.rs.CookieParam;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Form;
+import javax.ws.rs.core.MultivaluedMap;
+
+import org.glassfish.jersey.model.Parameter;
+
+/**
+ * Model of method parameter annotated by {@link BeanParam} annotation.
+ *
+ * @author David Kral
+ */
+class BeanClassModel {
+
+ private final Class<?> beanClass;
+ private final List<ParamModel> parameterModels;
+
+ /**
+ * Create new instance of bean annotated parameter.
+ *
+ * @param interfaceModel rest client interface model
+ * @param beanClass bean annotated parameter class
+ * @return new instance
+ */
+ static BeanClassModel fromClass(InterfaceModel interfaceModel, Class<?> beanClass) {
+ return new Builder(interfaceModel, beanClass)
+ .build();
+ }
+
+ private BeanClassModel(Builder builder) {
+ this.beanClass = builder.beanClass;
+ this.parameterModels = builder.parameterModels;
+ }
+
+ /**
+ * List of all class fields annotated with supported parameter annotation
+ *
+ * @return parameter model list
+ */
+ List<ParamModel> getParameterModels() {
+ return parameterModels;
+ }
+
+ /**
+ * Resolves bean path parameters.
+ *
+ * @param webTarget web target path
+ * @param instance actual method parameter value
+ * @return updated web target path
+ */
+ @SuppressWarnings("unchecked")
+ WebTarget resolvePath(WebTarget webTarget, Object instance) {
+ AtomicReference<WebTarget> toReturn = new AtomicReference<>(webTarget);
+ parameterModels.stream()
+ .filter(paramModel -> paramModel.handles(PathParam.class))
+ .forEach(parameterModel -> {
+ Field field = (Field) parameterModel.getAnnotatedElement();
+ toReturn.set((WebTarget) parameterModel.handleParameter(webTarget,
+ PathParam.class,
+ resolveValueFromField(field, instance)));
+ });
+ return toReturn.get();
+ }
+
+ /**
+ * Resolves bean header parameters.
+ *
+ * @param headers headers
+ * @param instance actual method parameter value
+ * @return updated headers
+ */
+ @SuppressWarnings("unchecked")
+ MultivaluedMap<String, Object> resolveHeaders(MultivaluedMap<String, Object> headers,
+ Object instance) {
+ parameterModels.stream()
+ .filter(paramModel -> paramModel.handles(HeaderParam.class))
+ .forEach(parameterModel -> {
+ Field field = (Field) parameterModel.getAnnotatedElement();
+ parameterModel.handleParameter(headers,
+ HeaderParam.class,
+ resolveValueFromField(field, instance));
+ });
+ return headers;
+ }
+
+ /**
+ * Resolves bean cookie parameters.
+ *
+ * @param cookies cookies
+ * @param instance actual method parameter value
+ * @return updated cookies
+ */
+ @SuppressWarnings("unchecked")
+ Map<String, String> resolveCookies(Map<String, String> cookies,
+ Object instance) {
+ parameterModels.stream()
+ .filter(paramModel -> paramModel.handles(CookieParam.class))
+ .forEach(parameterModel -> {
+ Field field = (Field) parameterModel.getAnnotatedElement();
+ parameterModel.handleParameter(cookies,
+ CookieParam.class,
+ resolveValueFromField(field, instance));
+ });
+ return cookies;
+ }
+
+ /**
+ * Resolves bean query parameters.
+ *
+ * @param query queries
+ * @param instance actual method parameter value
+ * @return updated queries
+ */
+ @SuppressWarnings("unchecked")
+ Map<String, Object[]> resolveQuery(Map<String, Object[]> query,
+ Object instance) {
+ parameterModels.stream()
+ .filter(paramModel -> paramModel.handles(QueryParam.class))
+ .forEach(parameterModel -> {
+ Field field = (Field) parameterModel.getAnnotatedElement();
+ parameterModel.handleParameter(query,
+ QueryParam.class,
+ resolveValueFromField(field, instance));
+ });
+ return query;
+ }
+
+ /**
+ * Resolves bean matrix parameters.
+ *
+ * @param webTarget web target path
+ * @param instance actual method parameter value
+ * @return updated web target path
+ */
+ @SuppressWarnings("unchecked")
+ WebTarget resolveMatrix(WebTarget webTarget,
+ Object instance) {
+ AtomicReference<WebTarget> toReturn = new AtomicReference<>(webTarget);
+ parameterModels.stream()
+ .filter(paramModel -> paramModel.handles(MatrixParam.class))
+ .forEach(parameterModel -> {
+ Field field = (Field) parameterModel.getAnnotatedElement();
+ toReturn.set((WebTarget) parameterModel.handleParameter(webTarget,
+ MatrixParam.class,
+ resolveValueFromField(field, instance)));
+ });
+ return toReturn.get();
+ }
+
+ /**
+ * Resolves bean form parameters.
+ *
+ * @param form web form
+ * @param instance actual method parameter value
+ * @return updated web form
+ */
+ @SuppressWarnings("unchecked")
+ Form resolveForm(Form form,
+ Object instance) {
+ parameterModels.stream()
+ .filter(paramModel -> paramModel.handles(FormParam.class))
+ .forEach(parameterModel -> {
+ Field field = (Field) parameterModel.getAnnotatedElement();
+ parameterModel.handleParameter(form,
+ FormParam.class,
+ resolveValueFromField(field, instance));
+ });
+ return form;
+ }
+
+ private Object resolveValueFromField(Field field, Object instance) {
+ return AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
+ try {
+ Object toReturn;
+ if (field.isAccessible()) {
+ return field.get(instance);
+ }
+ field.setAccessible(true);
+ toReturn = field.get(instance);
+ field.setAccessible(false);
+ return toReturn;
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ });
+ }
+
+ private static class Builder {
+
+ private final InterfaceModel interfaceModel;
+ private final Class<?> beanClass;
+ private ArrayList<ParamModel> parameterModels = new ArrayList<>();
+
+ private Builder(InterfaceModel interfaceModel, Class<?> beanClass) {
+ this.interfaceModel = interfaceModel;
+ this.beanClass = beanClass;
+ }
+
+ private void processPathFields() {
+ processFieldsByParameterClass(PathParam.class);
+ }
+
+ private void processHeaderFields() {
+ processFieldsByParameterClass(HeaderParam.class);
+ }
+
+ private void processCookieFields() {
+ processFieldsByParameterClass(CookieParam.class);
+ }
+
+ private void processQueryFields() {
+ processFieldsByParameterClass(QueryParam.class);
+ }
+
+ private void processMatrixFields() {
+ processFieldsByParameterClass(MatrixParam.class);
+ }
+
+ private void processFieldsByParameterClass(Class<? extends Annotation> parameterClass) {
+ for (Field field : beanClass.getDeclaredFields()) {
+ if (field.isAnnotationPresent(parameterClass)) {
+ Parameter parameter = Parameter.create(parameterClass, parameterClass, false,
+ field.getType(), field.getGenericType(),
+ field.getDeclaredAnnotations());
+ parameterModels.add(ParamModel.from(interfaceModel, field.getType(), field,
+ parameter, -1));
+ }
+ }
+ }
+
+ /**
+ * Creates new BeanClassModel instance.
+ *
+ * @return new instance
+ */
+ BeanClassModel build() {
+ processPathFields();
+ processHeaderFields();
+ processCookieFields();
+ processQueryFields();
+ processMatrixFields();
+ return new BeanClassModel(this);
+ }
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/BeanParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/BeanParamModel.java
new file mode 100644
index 0000000..7d0c310
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/BeanParamModel.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.ws.rs.BeanParam;
+import javax.ws.rs.CookieParam;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Form;
+import javax.ws.rs.core.MultivaluedMap;
+
+/**
+ * Contains information about method parameter or class field which is annotated by {@link BeanParam}.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class BeanParamModel extends ParamModel<Object> {
+
+ private static final Map<Class<?>, ParamHandler> PARAM_HANDLERS = new IdentityHashMap<>();
+
+ static {
+ PARAM_HANDLERS.put(PathParam.class,
+ (model, requestPart, instance) -> model.resolvePath((WebTarget) requestPart, instance));
+ PARAM_HANDLERS.put(HeaderParam.class,
+ (model, requestPart, instance) -> model.resolveHeaders((MultivaluedMap<String, Object>) requestPart,
+ instance));
+ PARAM_HANDLERS.put(CookieParam.class,
+ (model, requestPart, instance) -> model.resolveCookies((Map<String, String>) requestPart, instance));
+ PARAM_HANDLERS.put(QueryParam.class,
+ (model, requestPart, instance) -> model.resolveQuery((Map<String, Object[]>) requestPart,
+ instance));
+ PARAM_HANDLERS.put(MatrixParam.class,
+ (model, requestPart, instance) -> model.resolveMatrix((WebTarget) requestPart, instance));
+ PARAM_HANDLERS.put(FormParam.class,
+ (model, requestPart, instance) -> model.resolveForm((Form) requestPart,
+ instance));
+ }
+
+ private BeanClassModel beanClassModel;
+
+ BeanParamModel(Builder builder) {
+ super(builder);
+ beanClassModel = BeanClassModel.fromClass(interfaceModel, (Class<?>) getType());
+ }
+
+ @Override
+ public Object handleParameter(Object requestPart, Class<? extends Annotation> annotationClass, Object instance) {
+ ParamHandler handler = PARAM_HANDLERS.get(annotationClass);
+
+ if (null == handler) {
+ throw new UnsupportedOperationException(annotationClass.getName() + " is not supported!");
+ }
+
+ return handler.handle(beanClassModel, requestPart, instance);
+ }
+
+ @Override
+ public boolean handles(Class<? extends Annotation> annotation) {
+ return PARAM_HANDLERS.containsKey(annotation);
+ }
+
+ /**
+ * Returns {@link List} of all parameters annotated by searched annotation.
+ *
+ * @param paramAnnotation searched annotation
+ * @return filtered list
+ */
+ List<ParamModel> getAllParamsWithType(Class<? extends Annotation> paramAnnotation) {
+ return beanClassModel.getParameterModels().stream()
+ .filter(paramModel -> paramModel.handles(paramAnnotation))
+ .collect(Collectors.toList());
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ClientHeaderParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ClientHeaderParamModel.java
new file mode 100644
index 0000000..fa5d3af
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ClientHeaderParamModel.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.reflect.Method;
+
+import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
+
+/**
+ * Contains information about method annotation {@link ClientHeaderParam}.
+ *
+ * @author David Kral
+ */
+class ClientHeaderParamModel {
+
+ private final String headerName;
+ private final String[] headerValue;
+ private final Method computeMethod;
+ private final boolean required;
+
+ ClientHeaderParamModel(Class<?> iClass, ClientHeaderParam clientHeaderParam) {
+ headerName = clientHeaderParam.name();
+ headerValue = clientHeaderParam.value();
+ computeMethod = InterfaceUtil.parseComputeMethod(iClass, headerValue);
+ required = clientHeaderParam.required();
+ }
+
+ /**
+ * Returns header name.
+ *
+ * @return header name
+ */
+ String getHeaderName() {
+ return headerName;
+ }
+
+ /**
+ * Returns header value.
+ *
+ * @return header value
+ */
+ String[] getHeaderValue() {
+ return headerValue;
+ }
+
+ /**
+ * Returns method which is used to compute header value.
+ *
+ * @return compute method
+ */
+ Method getComputeMethod() {
+ return computeMethod;
+ }
+
+ /**
+ * Returns true if header is required and false if not. It header is not required and exception
+ * is thrown during compute method invocation, this header will be ignored and not included to request.
+ *
+ * @return if header is required
+ */
+ boolean isRequired() {
+ return required;
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ConfigWrapper.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ConfigWrapper.java
new file mode 100644
index 0000000..fec7869
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ConfigWrapper.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ws.rs.RuntimeType;
+import javax.ws.rs.core.Configuration;
+import javax.ws.rs.core.Feature;
+
+/**
+ * Configuration wrapper for {@link Configuration}. This class is needed due to custom provider registrations.
+ *
+ * @author David Kral
+ */
+class ConfigWrapper implements Configuration {
+
+ private final Configuration jerseyBuilderConfig;
+ private final Map<Class<?>, Map<Class<?>, Integer>> customProviders;
+
+ ConfigWrapper(Configuration jerseyBuilderConfig) {
+ this.jerseyBuilderConfig = jerseyBuilderConfig;
+ this.customProviders = new HashMap<>();
+ }
+
+ void addCustomProvider(Class<?> provider, Map<Class<?>, Integer> contracts) {
+ if (customProviders.containsKey(provider)) {
+ customProviders.get(provider).putAll(contracts);
+ } else {
+ customProviders.put(provider, contracts);
+ }
+ }
+
+ @Override
+ public RuntimeType getRuntimeType() {
+ return jerseyBuilderConfig.getRuntimeType();
+ }
+
+ @Override
+ public Map<String, Object> getProperties() {
+ return jerseyBuilderConfig.getProperties();
+ }
+
+ @Override
+ public Object getProperty(String name) {
+ return jerseyBuilderConfig.getProperty(name);
+ }
+
+ @Override
+ public Collection<String> getPropertyNames() {
+ return jerseyBuilderConfig.getPropertyNames();
+ }
+
+ @Override
+ public boolean isEnabled(Feature feature) {
+ return jerseyBuilderConfig.isEnabled(feature);
+ }
+
+ @Override
+ public boolean isEnabled(Class<? extends Feature> featureClass) {
+ return jerseyBuilderConfig.isEnabled(featureClass);
+ }
+
+ @Override
+ public boolean isRegistered(Object component) {
+ return jerseyBuilderConfig.isRegistered(component);
+ }
+
+ @Override
+ public boolean isRegistered(Class<?> componentClass) {
+ return jerseyBuilderConfig.isRegistered(componentClass);
+ }
+
+ @Override
+ public Map<Class<?>, Integer> getContracts(Class<?> componentClass) {
+ Map<Class<?>, Integer> map = new HashMap<>(jerseyBuilderConfig.getContracts(componentClass));
+ if (customProviders.containsKey(componentClass)) {
+ map.putAll(customProviders.get(componentClass));
+ }
+ return map;
+ }
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ return jerseyBuilderConfig.getClasses();
+ }
+
+ @Override
+ public Set<Object> getInstances() {
+ return jerseyBuilderConfig.getInstances();
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/CookieParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/CookieParamModel.java
new file mode 100644
index 0000000..fe6d921
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/CookieParamModel.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.util.Map;
+
+import javax.ws.rs.CookieParam;
+
+/**
+ * Contains information about method parameter or class field which is annotated by {@link CookieParam}.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class CookieParamModel extends ParamModel<Map<String, String>> {
+
+ private final String cookieParamName;
+
+ CookieParamModel(Builder builder, CookieParam annotation) {
+ super(builder);
+ cookieParamName = annotation.value();
+}
+
+ @Override
+ Map<String, String> handleParameter(Map<String, String> requestPart,
+ Class<? extends Annotation> annotationClass,
+ Object instance) {
+ Object resolvedValue = interfaceModel.resolveParamValue(instance, parameter);
+ requestPart.put(cookieParamName, (String) resolvedValue);
+ return requestPart;
+ }
+
+ @Override
+ boolean handles(Class<? extends Annotation> annotation) {
+ return CookieParam.class.equals(annotation);
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/DefaultResponseExceptionMapper.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/DefaultResponseExceptionMapper.java
new file mode 100644
index 0000000..1099040
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/DefaultResponseExceptionMapper.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
+
+/**
+ * Default {@link ResponseExceptionMapper} implementation
+ *
+ * @author David Kral
+ */
+class DefaultResponseExceptionMapper implements ResponseExceptionMapper {
+ @Override
+ public Throwable toThrowable(Response response) {
+ return new WebApplicationException("Unknown error, status code " + response.getStatus(), response);
+ }
+
+ @Override
+ public int getPriority() {
+ return Integer.MAX_VALUE;
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ExecutorServiceWrapper.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ExecutorServiceWrapper.java
new file mode 100644
index 0000000..54599e8
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ExecutorServiceWrapper.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.stream.Collectors;
+
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+
+/**
+ * Invokes all {@link AsyncInvocationInterceptor} for every new thread.
+ *
+ * @author David Kral
+ */
+class ExecutorServiceWrapper implements ExecutorService {
+
+ private final ExecutorService wrapped;
+ private final List<AsyncInvocationInterceptor> asyncInterceptors;
+
+ ExecutorServiceWrapper(ExecutorService wrapped,
+ List<AsyncInvocationInterceptor> asyncInterceptors) {
+ this.wrapped = wrapped;
+ this.asyncInterceptors = asyncInterceptors;
+ }
+
+ @Override
+ public void shutdown() {
+ wrapped.shutdown();
+ }
+
+ @Override
+ public List<Runnable> shutdownNow() {
+ return wrapped.shutdownNow();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return wrapped.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return wrapped.isTerminated();
+ }
+
+ @Override
+ public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
+ return wrapped.awaitTermination(timeout, unit);
+ }
+
+ @Override
+ public <T> Future<T> submit(Callable<T> task) {
+ return wrapped.submit(wrap(task));
+ }
+
+ @Override
+ public <T> Future<T> submit(Runnable task, T result) {
+ return wrapped.submit(wrap(task), result);
+ }
+
+ @Override
+ public Future<?> submit(Runnable task) {
+ return wrapped.submit(wrap(task));
+ }
+
+ @Override
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException {
+ return wrapped.invokeAll(wrap(tasks));
+ }
+
+ @Override
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
+ throws InterruptedException {
+ return wrapped.invokeAll(wrap(tasks), timeout, unit);
+ }
+
+ @Override
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException {
+ return wrapped.invokeAny(wrap(tasks));
+ }
+
+ @Override
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ return wrapped.invokeAny(wrap(tasks), timeout, unit);
+ }
+
+ @Override
+ public void execute(Runnable command) {
+ wrapped.execute(wrap(command));
+ }
+
+ private <T> Callable<T> wrap(Callable<T> task) {
+ return () -> {
+ asyncInterceptors.forEach(AsyncInvocationInterceptor::applyContext);
+ return task.call();
+ };
+ }
+
+ private Runnable wrap(Runnable task) {
+ return () -> {
+ asyncInterceptors.forEach(AsyncInvocationInterceptor::applyContext);
+ task.run();
+ };
+ }
+
+
+ private <T> Collection<? extends Callable<T>> wrap(Collection<? extends Callable<T>> tasks) {
+ return tasks.stream()
+ .map(this::wrap)
+ .collect(Collectors.toList());
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/FormParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/FormParamModel.java
new file mode 100644
index 0000000..a8255b9
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/FormParamModel.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.util.Collection;
+
+import javax.ws.rs.FormParam;
+import javax.ws.rs.core.Form;
+
+/**
+ * Contains information about method parameter or class field which is annotated by {@link FormParam}.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class FormParamModel extends ParamModel<Form> {
+
+ private final String formParamName;
+
+ FormParamModel(Builder builder, FormParam annotation) {
+ super(builder);
+ formParamName = annotation.value();
+ }
+
+ @Override
+ Form handleParameter(Form form, Class<? extends Annotation> annotationClass, Object instance) {
+ Object resolvedValue = interfaceModel.resolveParamValue(instance, parameter);
+ if (resolvedValue instanceof Collection) {
+ for (final Object v : ((Collection) resolvedValue)) {
+ form.param(formParamName, v.toString());
+ }
+ } else {
+ form.param(formParamName, resolvedValue.toString());
+ }
+ return form;
+ }
+
+ @Override
+ boolean handles(Class<? extends Annotation> annotation) {
+ return FormParam.class.equals(annotation);
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeaderParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeaderParamModel.java
new file mode 100644
index 0000000..6668b4a
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeaderParamModel.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.util.Collections;
+
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.core.MultivaluedMap;
+
+/**
+ * Contains information about method parameter or class field which is annotated by {@link HeaderParam}.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class HeaderParamModel extends ParamModel<MultivaluedMap<String, Object>> {
+
+ private String headerParamName;
+
+ HeaderParamModel(Builder builder, HeaderParam annotation) {
+ super(builder);
+ this.headerParamName = annotation.value();
+ }
+
+ @Override
+ MultivaluedMap<String, Object> handleParameter(MultivaluedMap<String, Object> requestPart,
+ Class<? extends Annotation> annotationClass, Object instance) {
+ Object resolvedValue = interfaceModel.resolveParamValue(instance, parameter);
+ requestPart.put(headerParamName, Collections.singletonList(resolvedValue));
+ return requestPart;
+ }
+
+ @Override
+ boolean handles(Class<? extends Annotation> annotation) {
+ return HeaderParam.class.equals(annotation);
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeadersContext.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeadersContext.java
new file mode 100644
index 0000000..8de244e
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeadersContext.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.util.Optional;
+import java.util.function.Supplier;
+
+import javax.ws.rs.core.MultivaluedMap;
+
+/**
+ *
+ * @author David Kral
+ */
+final class HeadersContext {
+
+ /**
+ * Headers context thread local, used by internal implementations of header filters.
+ */
+ private static final ThreadLocal<HeadersContext> HEADERS_CONTEXT = new ThreadLocal<>();
+
+ private final MultivaluedMap<String, String> inboundHeaders;
+
+ /**
+ * The instance associated with the current thread.
+ * @return context for current thread or {@code empty} if none associated
+ */
+ static Optional<HeadersContext> get() {
+ return Optional.ofNullable(HEADERS_CONTEXT.get());
+ }
+
+ /**
+ * Computes the instance and associates it with current thread if none
+ * associated, or returns the instance already associated.
+ *
+ * @param contextSupplier supplier for header context to be associated with the thread if none is
+ * @return an instance associated with the current context, either from other provider, or from contextSupplier
+ */
+ static HeadersContext compute(Supplier<HeadersContext> contextSupplier) {
+ HeadersContext headersContext = HEADERS_CONTEXT.get();
+ if (null == headersContext) {
+ set(contextSupplier.get());
+ }
+
+ return get().orElseThrow(() -> new IllegalStateException("Computed result was null"));
+ }
+
+ /**
+ * Set the header context to be associated with current thread.
+ *
+ * @param context context to associate
+ */
+ static void set(HeadersContext context) {
+ HEADERS_CONTEXT.set(context);
+ }
+
+ /**
+ * Remove the header context associated with current thread.
+ */
+ static void remove() {
+ HEADERS_CONTEXT.remove();
+ }
+
+ /**
+ * Create a new header context with client tracing enabled.
+ *
+ * @param inboundHeaders inbound header to be used for context propagation
+ * @return a new header context (not associated with current thread)
+ * @see #set(HeadersContext)
+ */
+ static HeadersContext create(MultivaluedMap<String, String> inboundHeaders) {
+ return new HeadersContext(inboundHeaders);
+ }
+
+ private HeadersContext(MultivaluedMap<String, String> inboundHeaders) {
+ this.inboundHeaders = inboundHeaders;
+ }
+
+ /**
+ * Map of headers that were received by server for an inbound call,
+ * may be used to propagate additional headers fro outbound request.
+ *
+ * @return map of inbound headers
+ */
+ MultivaluedMap<String, String> inboundHeaders() {
+ return inboundHeaders;
+ }
+
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeadersRequestFilter.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeadersRequestFilter.java
new file mode 100644
index 0000000..28e284a
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/HeadersRequestFilter.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.io.IOException;
+
+import javax.ws.rs.ConstrainedTo;
+import javax.ws.rs.RuntimeType;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+
+/**
+ * Server side request filter used for propagation of request headers to server client request.
+ *
+ * @author David Kral
+ */
+@ConstrainedTo(RuntimeType.SERVER)
+public class HeadersRequestFilter implements ContainerRequestFilter, ContainerResponseFilter {
+
+ @Override
+ public void filter(ContainerRequestContext requestContext) {
+ HeadersContext.compute(() -> HeadersContext.create(requestContext.getHeaders()));
+ }
+
+ @Override
+ public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
+ HeadersContext.remove();
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterceptorInvocationContext.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterceptorInvocationContext.java
new file mode 100644
index 0000000..d559fb7
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterceptorInvocationContext.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.enterprise.inject.spi.InterceptionType;
+import javax.enterprise.inject.spi.Interceptor;
+import javax.interceptor.InvocationContext;
+import javax.ws.rs.client.WebTarget;
+
+/**
+ * Invokes all interceptors bound to the target.
+ *
+ * This approach needs to be used due to CDI does not handle properly interceptor invocation
+ * on proxy instances.
+ *
+ * @author David Kral
+ */
+class InterceptorInvocationContext implements InvocationContext {
+
+ private final MethodModel methodModel;
+ private final Method method;
+ private final Map<String, Object> contextData;
+ private final List<InvocationInterceptor> interceptors;
+ private final WebTarget classLevelWebTarget;
+ private Object[] args;
+ private int currentPosition;
+
+ /**
+ * Creates new instance of InterceptorInvocationContext.
+ *
+ * @param classLevelWebTarget class level web target
+ * @param methodModel method model
+ * @param method reflection method
+ * @param args actual method arguments
+ */
+ InterceptorInvocationContext(WebTarget classLevelWebTarget,
+ MethodModel methodModel,
+ Method method,
+ Object[] args) {
+ this.contextData = new HashMap<>();
+ this.currentPosition = 0;
+ this.methodModel = methodModel;
+ this.method = method;
+ this.args = args;
+ this.classLevelWebTarget = classLevelWebTarget;
+ this.interceptors = methodModel.getInvocationInterceptors();
+
+ }
+
+ @Override
+ public Object getTarget() {
+ return methodModel;
+ }
+
+ @Override
+ public Object getTimer() {
+ return null;
+ }
+
+ @Override
+ public Method getMethod() {
+ return method;
+ }
+
+ @Override
+ public Constructor<?> getConstructor() {
+ return null;
+ }
+
+ @Override
+ public Object[] getParameters() {
+ return args;
+ }
+
+ @Override
+ public void setParameters(Object[] params) {
+ this.args = params;
+ }
+
+ @Override
+ public Map<String, Object> getContextData() {
+ return contextData;
+ }
+
+ @Override
+ public Object proceed() {
+ if (currentPosition < interceptors.size()) {
+ return interceptors.get(currentPosition++).intercept(this);
+ } else {
+ return methodModel.invokeMethod(classLevelWebTarget, method, args);
+ }
+ }
+
+ /**
+ * Contains actual interceptor instance and interceptor itself.
+ */
+ static class InvocationInterceptor {
+
+ private final Object interceptorInstance;
+ private final Interceptor interceptor;
+
+ InvocationInterceptor(Object interceptorInstance, Interceptor interceptor) {
+ this.interceptorInstance = interceptorInstance;
+ this.interceptor = interceptor;
+ }
+
+ /**
+ * Invokes interceptor with interception type AROUND_INVOKE.
+ *
+ * @param ctx invocation context
+ * @return interception result
+ */
+ @SuppressWarnings("unchecked")
+ Object intercept(InvocationContext ctx) {
+ try {
+ return interceptor.intercept(InterceptionType.AROUND_INVOKE, interceptorInstance, ctx);
+ } catch (Exception e) {
+ if (e instanceof RuntimeException) {
+ throw (RuntimeException) e;
+ }
+ throw new RuntimeException(e);
+ }
+ }
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterfaceModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterfaceModel.java
new file mode 100644
index 0000000..1a045ee
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterfaceModel.java
@@ -0,0 +1,371 @@
+/*
+ * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019 Payara Foundation 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.ext.ParamConverterProvider;
+
+import org.eclipse.microprofile.rest.client.RestClientDefinitionException;
+import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
+import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+import org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory;
+import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
+import org.glassfish.jersey.client.inject.ParameterUpdater;
+import org.glassfish.jersey.client.inject.ParameterUpdaterProvider;
+import org.glassfish.jersey.internal.inject.InjectionManager;
+import org.glassfish.jersey.internal.inject.Providers;
+import org.glassfish.jersey.model.Parameter;
+
+/**
+ * Model of interface and its annotation.
+ *
+ * @author David Kral
+ * @author Patrik Dudits
+ * @author Tomas Langer
+ */
+class InterfaceModel {
+
+ private final InjectionManager injectionManager;
+ private final Class<?> restClientClass;
+ private final String[] produces;
+ private final String[] consumes;
+ private final String path;
+ private final ClientHeadersFactory clientHeadersFactory;
+ private final CreationalContext<?> creationalContext;
+
+ private final List<ClientHeaderParamModel> clientHeaders;
+ private final List<AsyncInvocationInterceptor> asyncInterceptors;
+ private final Set<ResponseExceptionMapper> responseExceptionMappers;
+ private final Set<ParamConverterProvider> paramConverterProviders;
+ private final Set<Annotation> interceptorAnnotations;
+ private final BeanManager beanManager;
+
+ /**
+ * Creates new model based on interface class. Interface is parsed according to specific annotations.
+ *
+ * @param restClientClass interface class
+ * @param responseExceptionMappers registered exception mappers
+ * @param paramConverterProviders registered parameter providers
+ * @param asyncInterceptors async interceptors
+ * @param injectionManager
+ * @return new model instance
+ */
+ static InterfaceModel from(Class<?> restClientClass,
+ Set<ResponseExceptionMapper> responseExceptionMappers,
+ Set<ParamConverterProvider> paramConverterProviders,
+ List<AsyncInvocationInterceptor> asyncInterceptors,
+ InjectionManager injectionManager,
+ BeanManager beanManager) {
+ return new Builder(restClientClass,
+ responseExceptionMappers,
+ paramConverterProviders,
+ asyncInterceptors,
+ injectionManager,
+ beanManager).build();
+ }
+
+ private InterfaceModel(Builder builder) {
+ this.injectionManager = builder.injectionManager;
+ this.restClientClass = builder.restClientClass;
+ this.path = builder.pathValue;
+ this.produces = builder.produces;
+ this.consumes = builder.consumes;
+ this.clientHeaders = builder.clientHeaders;
+ this.clientHeadersFactory = builder.clientHeadersFactory;
+ this.responseExceptionMappers = builder.responseExceptionMappers;
+ this.paramConverterProviders = builder.paramConverterProviders;
+ this.interceptorAnnotations = builder.interceptorAnnotations;
+ this.creationalContext = builder.creationalContext;
+ this.asyncInterceptors = builder.asyncInterceptors;
+ this.beanManager = builder.beanManager;
+ }
+
+ /**
+ * Returns rest client interface class.
+ *
+ * @return interface class
+ */
+ Class<?> getRestClientClass() {
+ return restClientClass;
+ }
+
+ /**
+ * Returns defined produces media types.
+ *
+ * @return produces
+ */
+ String[] getProduces() {
+ return produces;
+ }
+
+ /**
+ * Returns defined consumes media types.
+ *
+ * @return consumes
+ */
+ String[] getConsumes() {
+ return consumes;
+ }
+
+ /**
+ * Returns path value defined on interface level.
+ *
+ * @return path value
+ */
+ String getPath() {
+ return path;
+ }
+
+ /**
+ * Returns registered instance of {@link ClientHeadersFactory}.
+ *
+ * @return registered factory
+ */
+ Optional<ClientHeadersFactory> getClientHeadersFactory() {
+ return Optional.ofNullable(clientHeadersFactory);
+ }
+
+ /**
+ * Returns {@link List} of processed annotation {@link ClientHeaderParam} to {@link ClientHeaderParamModel}
+ *
+ * @return registered factories
+ */
+ List<ClientHeaderParamModel> getClientHeaders() {
+ return clientHeaders;
+ }
+
+ /**
+ * Returns {@link List} of registered {@link AsyncInvocationInterceptor}
+ *
+ * @return registered async interceptors
+ */
+ List<AsyncInvocationInterceptor> getAsyncInterceptors() {
+ return asyncInterceptors;
+ }
+
+ /**
+ * Returns {@link Set} of registered {@link ResponseExceptionMapper}
+ *
+ * @return registered exception mappers
+ */
+ Set<ResponseExceptionMapper> getResponseExceptionMappers() {
+ return responseExceptionMappers;
+ }
+
+ /**
+ * Returns {@link Set} of registered {@link ParamConverterProvider}
+ *
+ * @return registered param converter providers
+ */
+ Set<ParamConverterProvider> getParamConverterProviders() {
+ return paramConverterProviders;
+ }
+
+ /**
+ * Returns {@link Set} of interceptor annotations
+ *
+ * @return interceptor annotations
+ */
+ Set<Annotation> getInterceptorAnnotations() {
+ return interceptorAnnotations;
+ }
+
+ /**
+ * Context bound to this model.
+ *
+ * @return context
+ */
+ CreationalContext<?> getCreationalContext() {
+ return creationalContext;
+ }
+
+ /**
+ * @return
+ */
+ public InjectionManager getInjectionManager() {
+ return injectionManager;
+ }
+
+ /**
+ * Resolves value of the method argument.
+ *
+ * @param arg actual argument value
+ * @return converted value of argument
+ */
+ Object resolveParamValue(Object arg, Parameter parameter) {
+ final Iterable<ParameterUpdaterProvider> parameterUpdaterProviders
+ = Providers.getAllProviders(injectionManager, ParameterUpdaterProvider.class);
+ for (final ParameterUpdaterProvider parameterUpdaterProvider : parameterUpdaterProviders) {
+ if (parameterUpdaterProvider != null) {
+ ParameterUpdater<Object, Object> updater =
+ (ParameterUpdater<Object, Object>) parameterUpdaterProvider.get(parameter);
+ return updater.update(arg);
+ }
+ }
+ return arg;
+ }
+
+ BeanManager getBeanManager() {
+ return beanManager;
+ }
+
+ private static class Builder {
+
+ private final Class<?> restClientClass;
+
+ private final InjectionManager injectionManager;
+ private final BeanManager beanManager;
+ private String pathValue;
+ private String[] produces;
+ private String[] consumes;
+ private ClientHeadersFactory clientHeadersFactory;
+ private CreationalContext<?> creationalContext;
+ private List<ClientHeaderParamModel> clientHeaders;
+ private List<AsyncInvocationInterceptor> asyncInterceptors;
+ private Set<ResponseExceptionMapper> responseExceptionMappers;
+ private Set<ParamConverterProvider> paramConverterProviders;
+ private Set<Annotation> interceptorAnnotations;
+
+ private Builder(Class<?> restClientClass,
+ Set<ResponseExceptionMapper> responseExceptionMappers,
+ Set<ParamConverterProvider> paramConverterProviders,
+ List<AsyncInvocationInterceptor> asyncInterceptors,
+ InjectionManager injectionManager,
+ BeanManager beanManager) {
+ this.injectionManager = injectionManager;
+ this.restClientClass = restClientClass;
+ this.responseExceptionMappers = responseExceptionMappers;
+ this.paramConverterProviders = paramConverterProviders;
+ this.asyncInterceptors = asyncInterceptors;
+ this.beanManager = beanManager;
+ filterAllInterceptorAnnotations();
+ }
+
+ private void filterAllInterceptorAnnotations() {
+ creationalContext = null;
+ interceptorAnnotations = new HashSet<>();
+ if (beanManager != null) {
+ creationalContext = beanManager.createCreationalContext(null);
+ for (Annotation annotation : restClientClass.getAnnotations()) {
+ if (beanManager.isInterceptorBinding(annotation.annotationType())) {
+ interceptorAnnotations.add(annotation);
+ }
+ }
+ }
+ }
+
+ /**
+ * Path value from {@link Path} annotation. If annotation is null, empty String is set as path.
+ *
+ * @param path {@link Path} annotation
+ * @return updated Builder instance
+ */
+ Builder pathValue(Path path) {
+ this.pathValue = path != null ? path.value() : "";
+ //if only / is added to path like this "localhost:80/test" it makes invalid path "localhost:80/test/"
+ this.pathValue = pathValue.equals("/") ? "" : pathValue;
+ return this;
+ }
+
+ /**
+ * Extracts MediaTypes from {@link Produces} annotation.
+ * If annotation is null, new String array with {@link MediaType#APPLICATION_JSON} is set.
+ *
+ * @param produces {@link Produces} annotation
+ * @return updated Builder instance
+ */
+ Builder produces(Produces produces) {
+ this.produces = produces != null ? produces.value() : new String[] {MediaType.APPLICATION_JSON};
+ return this;
+ }
+
+ /**
+ * Extracts MediaTypes from {@link Consumes} annotation.
+ * If annotation is null, new String array with {@link MediaType#APPLICATION_JSON} is set.
+ *
+ * @param consumes {@link Consumes} annotation
+ * @return updated Builder instance
+ */
+ Builder consumes(Consumes consumes) {
+ this.consumes = consumes != null ? consumes.value() : new String[] {MediaType.APPLICATION_JSON};
+ return this;
+ }
+
+ /**
+ * Process data from {@link ClientHeaderParam} annotation to extract methods and values.
+ *
+ * @param clientHeaderParams {@link ClientHeaderParam} annotations
+ * @return updated Builder instance
+ */
+ Builder clientHeaders(ClientHeaderParam[] clientHeaderParams) {
+ clientHeaders = Arrays.stream(clientHeaderParams)
+ .map(clientHeaderParam -> new ClientHeaderParamModel(restClientClass, clientHeaderParam))
+ .collect(Collectors.toList());
+ return this;
+ }
+
+ Builder clientHeadersFactory(RegisterClientHeaders registerClientHeaders) {
+ clientHeadersFactory = registerClientHeaders != null
+ ? ReflectionUtil.createInstance(registerClientHeaders.value())
+ : null;
+ return this;
+ }
+
+ /**
+ * Creates new InterfaceModel instance.
+ *
+ * @return new instance
+ */
+ InterfaceModel build() {
+ pathValue(restClientClass.getAnnotation(Path.class));
+ produces(restClientClass.getAnnotation(Produces.class));
+ consumes(restClientClass.getAnnotation(Consumes.class));
+ clientHeaders(restClientClass.getAnnotationsByType(ClientHeaderParam.class));
+ clientHeadersFactory(restClientClass.getAnnotation(RegisterClientHeaders.class));
+ validateHeaderDuplicityNames();
+ return new InterfaceModel(this);
+ }
+
+ private void validateHeaderDuplicityNames() {
+ ArrayList<String> names = new ArrayList<>();
+ for (ClientHeaderParamModel clientHeaderParamModel : clientHeaders) {
+ String headerName = clientHeaderParamModel.getHeaderName();
+ if (names.contains(headerName)) {
+ throw new RestClientDefinitionException("Header name cannot be registered more then once on the same target."
+ + "See " + restClientClass.getName());
+ }
+ names.add(headerName);
+ }
+ }
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterfaceUtil.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterfaceUtil.java
new file mode 100644
index 0000000..83aa97a
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/InterfaceUtil.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.security.AccessController;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import javax.ws.rs.HttpMethod;
+
+import org.eclipse.microprofile.rest.client.RestClientDefinitionException;
+import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
+import org.glassfish.jersey.internal.util.ReflectionHelper;
+
+/**
+ * Utils for interface handling.
+ *
+ * @author David Kral
+ */
+class InterfaceUtil {
+
+ private static final String PARAMETER_PARSE_REGEXP = "(?<=\\{).+?(?=\\})";
+ private static final Pattern PATTERN = Pattern.compile(PARAMETER_PARSE_REGEXP);
+
+ /**
+ * Parses all required parameters from template string.
+ *
+ * @param template template string
+ * @return parsed parameters
+ */
+ static List<String> parseParameters(String template) {
+ List<String> allMatches = new ArrayList<>();
+ Matcher m = PATTERN.matcher(template);
+ while (m.find()) {
+ allMatches.add(m.group());
+ }
+ return allMatches;
+ }
+
+ /**
+ * Validates and returns proper compute method defined in {@link ClientHeaderParam}.
+ *
+ * @param iClass interface class
+ * @param headerValue value of the header
+ * @return parsed method
+ */
+ static Method parseComputeMethod(Class<?> iClass, String[] headerValue) {
+ List<String> computeMethodNames = InterfaceUtil.parseParameters(Arrays.toString(headerValue));
+ /*if more than one string is specified as the value attribute, and one of the strings is a
+ compute method (surrounded by curly braces), then the implementation will throw a
+ RestClientDefinitionException*/
+ if (headerValue.length > 1 && computeMethodNames.size() > 0) {
+ throw new RestClientDefinitionException("@ClientHeaderParam annotation should not contain compute method "
+ + "when multiple values are present in value attribute. "
+ + "See " + iClass.getName());
+ }
+ if (computeMethodNames.size() == 1) {
+ String methodName = computeMethodNames.get(0);
+ List<Method> computeMethods = getAnnotationComputeMethod(iClass, methodName);
+ if (computeMethods.size() != 1) {
+ throw new RestClientDefinitionException("No valid compute method found for name: " + methodName);
+ }
+ return computeMethods.get(0);
+ }
+ return null;
+ }
+
+ private static List<Method> getAnnotationComputeMethod(Class<?> iClass, String methodName) {
+ if (methodName.contains(".")) {
+ return getStaticComputeMethod(methodName);
+ }
+ return getComputeMethod(iClass, methodName);
+ }
+
+ private static List<Method> getStaticComputeMethod(String methodName) {
+ int lastIndex = methodName.lastIndexOf(".");
+ String className = methodName.substring(0, lastIndex);
+ String staticMethodName = methodName.substring(lastIndex + 1);
+ Class<?> classWithStaticMethod = AccessController.doPrivileged(ReflectionHelper.classForNamePA(className));
+ if (classWithStaticMethod == null) {
+ throw new IllegalStateException("No class with following name found: " + className);
+ }
+ return getComputeMethod(classWithStaticMethod, staticMethodName);
+ }
+
+ private static List<Method> getComputeMethod(Class<?> iClass, String methodName) {
+ return Arrays.stream(iClass.getMethods())
+ // filter out methods with specified name only
+ .filter(method -> method.getName().equals(methodName))
+ // filter out other methods than default and static
+ .filter(method -> method.isDefault() || Modifier.isStatic(method.getModifiers()))
+ // filter out methods without required return type
+ .filter(method -> method.getReturnType().equals(String.class)
+ || method.getReturnType().equals(String[].class))
+ // filter out methods without required parameter types
+ .filter(method -> method.getParameterTypes().length == 0 || (
+ method.getParameterTypes().length == 1
+ && method.getParameterTypes()[0].equals(String.class)))
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Returns {@link List} of annotations which are type of {@link HttpMethod}.
+ *
+ * @param annotatedElement element with annotations
+ * @return annotations of given type
+ */
+ static List<Class<?>> getHttpAnnotations(AnnotatedElement annotatedElement) {
+ return Arrays.stream(annotatedElement.getDeclaredAnnotations())
+ .filter(annotation -> annotation.annotationType().getAnnotation(HttpMethod.class) != null)
+ .map(Annotation::annotationType)
+ .collect(Collectors.toList());
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/JerseyRestClientBuilderResolver.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/JerseyRestClientBuilderResolver.java
new file mode 100644
index 0000000..db8e918
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/JerseyRestClientBuilderResolver.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import org.eclipse.microprofile.rest.client.RestClientBuilder;
+import org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver;
+
+/**
+ *
+ *
+ * @author David Kral
+ */
+public class JerseyRestClientBuilderResolver extends RestClientBuilderResolver {
+ @Override
+ public RestClientBuilder newBuilder() {
+ return new RestClientBuilderImpl();
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/MatrixParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/MatrixParamModel.java
new file mode 100644
index 0000000..feed773
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/MatrixParamModel.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.util.Collection;
+
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.client.WebTarget;
+
+/**
+ * Contains information to method parameter which is annotated by {@link MatrixParam}.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class MatrixParamModel extends ParamModel<WebTarget> {
+
+ private final String matrixParamName;
+
+ /**
+ * Creates new matrix model.
+ *
+ * @param builder
+ * @param annotation
+ */
+ MatrixParamModel(Builder builder, MatrixParam annotation) {
+ super(builder);
+ matrixParamName = annotation.value();
+ }
+
+ @Override
+ public WebTarget handleParameter(WebTarget requestPart, Class<? extends Annotation> annotationClass, Object instance) {
+ Object resolvedValue = interfaceModel.resolveParamValue(instance, parameter);
+ if (resolvedValue instanceof Collection) {
+ return requestPart.matrixParam(matrixParamName, ((Collection) resolvedValue).toArray());
+ } else {
+ return requestPart.matrixParam(matrixParamName, resolvedValue);
+ }
+ }
+
+ @Override
+ public boolean handles(Class<? extends Annotation> annotation) {
+ return MatrixParam.class.equals(annotation);
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/MethodModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/MethodModel.java
new file mode 100644
index 0000000..4e738a0
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/MethodModel.java
@@ -0,0 +1,696 @@
+/*
+ * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019 Payara Foundation 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Parameter;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Proxy;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionStage;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InterceptionType;
+import javax.enterprise.inject.spi.Interceptor;
+import javax.json.JsonValue;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.CookieParam;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Form;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
+
+import org.eclipse.microprofile.rest.client.RestClientDefinitionException;
+import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
+
+/**
+ * Method model contains all information about method defined in rest client interface.
+ *
+ * @author David Kral
+ * @author Patrik Dudits
+ * @author Tomas Langer
+ */
+class MethodModel {
+
+ private static final String INVOKED_METHOD = "org.eclipse.microprofile.rest.client.invokedMethod";
+
+ private final InterfaceModel interfaceModel;
+
+ private final Method method;
+ private final GenericType<?> returnType;
+ private final String httpMethod;
+ private final String path;
+ private final String[] produces;
+ private final String[] consumes;
+ private final List<ParamModel> parameterModels;
+ private final List<ClientHeaderParamModel> clientHeaders;
+ private final List<InterceptorInvocationContext.InvocationInterceptor> invocationInterceptors;
+ private final RestClientModel subResourceModel;
+
+ /**
+ * Processes interface method and creates new instance of the model.
+ *
+ * @param interfaceModel
+ * @param method
+ * @return
+ */
+ static MethodModel from(InterfaceModel interfaceModel, Method method) {
+ return new Builder(interfaceModel, method).build();
+ }
+
+ private MethodModel(Builder builder) {
+ this.method = builder.method;
+ this.interfaceModel = builder.interfaceModel;
+ this.returnType = builder.returnType;
+ this.httpMethod = builder.httpMethod;
+ this.path = builder.pathValue;
+ this.produces = builder.produces;
+ this.consumes = builder.consumes;
+ this.parameterModels = builder.parameterModels;
+ this.clientHeaders = builder.clientHeaders;
+ this.invocationInterceptors = builder.invocationInterceptors;
+ if (httpMethod.isEmpty()) {
+ subResourceModel = RestClientModel.from(returnType.getRawType(),
+ interfaceModel.getResponseExceptionMappers(),
+ interfaceModel.getParamConverterProviders(),
+ interfaceModel.getAsyncInterceptors(),
+ interfaceModel.getInjectionManager(),
+ interfaceModel.getBeanManager());
+ } else {
+ subResourceModel = null;
+ }
+ }
+
+ /**
+ * Returns all registered cdi interceptors to this method.
+ *
+ * @return registered interceptors
+ */
+ List<InterceptorInvocationContext.InvocationInterceptor> getInvocationInterceptors() {
+ return invocationInterceptors;
+ }
+
+ /**
+ * Invokes corresponding method according to
+ *
+ * @param classLevelTarget
+ * @param method
+ * @param args
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ //I am checking the type of parameter and I know it should handle instance I am sending
+ Object invokeMethod(WebTarget classLevelTarget, Method method, Object[] args) {
+ WebTarget methodLevelTarget = classLevelTarget.path(path);
+
+ AtomicReference<Object> entity = new AtomicReference<>();
+ AtomicReference<WebTarget> webTargetAtomicReference = new AtomicReference<>(methodLevelTarget);
+ parameterModels.stream()
+ .filter(parameterModel -> parameterModel.handles(PathParam.class))
+ .forEach(parameterModel ->
+ webTargetAtomicReference.set((WebTarget)
+ parameterModel
+ .handleParameter(webTargetAtomicReference.get(),
+ PathParam.class,
+ args[parameterModel
+ .getParamPosition()])));
+
+ parameterModels.stream()
+ .filter(ParamModel::isEntity)
+ .findFirst()
+ .ifPresent(parameterModel -> entity.set(args[parameterModel.getParamPosition()]));
+
+ Form form = handleForm(args);
+
+ WebTarget webTarget = webTargetAtomicReference.get();
+ if (httpMethod.isEmpty()) {
+ //sub resource method
+ return subResourceProxy(webTarget, returnType.getRawType());
+ }
+ webTarget = addQueryParams(webTarget, args);
+ webTarget = addMatrixParams(webTarget, args);
+
+ MultivaluedMap<String, Object> customHeaders = addCustomHeaders(args);
+
+ Object entityToUse = entity.get();
+ if (entityToUse == null && !form.asMap().isEmpty()) {
+ entityToUse = form;
+ }
+ if (entityToUse == null) {
+ customHeaders.remove(HttpHeaders.CONTENT_TYPE);
+ }
+
+ Invocation.Builder builder = webTarget
+ .request(produces)
+ .property(INVOKED_METHOD, method)
+ .headers(customHeaders);
+ builder = addCookies(builder, args);
+
+ Object response;
+
+ if (CompletionStage.class.isAssignableFrom(method.getReturnType())) {
+ response = asynchronousCall(builder, entityToUse, method, customHeaders);
+ } else {
+ response = synchronousCall(builder, entityToUse, method, customHeaders);
+ }
+ return response;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Form handleForm(Object[] args) {
+ final Form form = new Form();
+ parameterModels.stream()
+ .filter(parameterModel -> parameterModel.handles(FormParam.class))
+ .forEach(parameterModel -> parameterModel.handleParameter(form,
+ FormParam.class,
+ args[parameterModel.getParamPosition()]));
+ return form;
+ }
+
+ private Object synchronousCall(Invocation.Builder builder,
+ Object entity,
+ Method method,
+ MultivaluedMap<String, Object> customHeaders) {
+ Response response;
+
+ if (entity != null
+ && !httpMethod.equals(GET.class.getSimpleName())
+ && !httpMethod.equals(DELETE.class.getSimpleName())) {
+ response = builder.method(httpMethod, Entity.entity(entity, getContentType(customHeaders)));
+ } else {
+ response = builder.method(httpMethod);
+ }
+
+ evaluateResponse(response, method);
+
+ if (returnType.getType().equals(Void.class)) {
+ return null;
+ } else if (returnType.getType().equals(Response.class)) {
+ return response;
+ }
+ return response.readEntity(returnType);
+ }
+
+ private CompletableFuture asynchronousCall(Invocation.Builder builder,
+ Object entity,
+ Method method,
+ MultivaluedMap<String, Object> customHeaders) {
+ CompletableFuture<Object> result = new CompletableFuture<>();
+ Future<Response> theFuture;
+ if (entity != null
+ && !httpMethod.equals(GET.class.getSimpleName())
+ && !httpMethod.equals(DELETE.class.getSimpleName())) {
+ theFuture = builder.async().method(httpMethod, Entity.entity(entity, getContentType(customHeaders)));
+ } else {
+ theFuture = builder.async().method(httpMethod);
+ }
+
+ CompletableFuture<Response> completableFuture = (CompletableFuture<Response>) theFuture;
+ completableFuture.thenAccept(response -> {
+ interfaceModel.getAsyncInterceptors().forEach(AsyncInvocationInterceptor::removeContext);
+ try {
+ evaluateResponse(response, method);
+ if (returnType.getType().equals(Void.class)) {
+ result.complete(null);
+ } else if (returnType.getType().equals(Response.class)) {
+ result.complete(response);
+ } else {
+ result.complete(response.readEntity(returnType));
+ }
+ } catch (Exception e) {
+ result.completeExceptionally(e);
+ }
+ }).exceptionally(throwable -> {
+ interfaceModel.getAsyncInterceptors().forEach(AsyncInvocationInterceptor::removeContext);
+ result.completeExceptionally(throwable);
+ return null;
+ });
+
+ return result;
+ }
+
+ private String getContentType(MultivaluedMap<String, Object> customHeaders) {
+ return (String) customHeaders.getFirst(HttpHeaders.CONTENT_TYPE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private <T> T subResourceProxy(WebTarget webTarget, Class<T> subResourceType) {
+ return (T) Proxy.newProxyInstance(subResourceType.getClassLoader(),
+ new Class[] {subResourceType},
+ new ProxyInvocationHandler(webTarget, subResourceModel)
+ );
+ }
+
+ @SuppressWarnings("unchecked") //I am checking the type of parameter and I know it should handle instance I am sending
+ private WebTarget addQueryParams(WebTarget webTarget, Object[] args) {
+ Map<String, Object[]> queryParams = new HashMap<>();
+ WebTarget toReturn = webTarget;
+ parameterModels.stream()
+ .filter(parameterModel -> parameterModel.handles(QueryParam.class))
+ .forEach(parameterModel -> parameterModel.handleParameter(queryParams,
+ QueryParam.class,
+ args[parameterModel.getParamPosition()]));
+
+ for (Map.Entry<String, Object[]> entry : queryParams.entrySet()) {
+ toReturn = toReturn.queryParam(entry.getKey(), entry.getValue());
+ }
+ return toReturn;
+ }
+
+ @SuppressWarnings("unchecked") //I am checking the type of parameter and I know it should handle instance I am sending
+ private WebTarget addMatrixParams(WebTarget webTarget, Object[] args) {
+ AtomicReference<WebTarget> toReturn = new AtomicReference<>(webTarget);
+ parameterModels.stream()
+ .filter(parameterModel -> parameterModel.handles(MatrixParam.class))
+ .forEach(parameterModel -> toReturn
+ .set((WebTarget) parameterModel.handleParameter(toReturn.get(),
+ MatrixParam.class,
+ args[parameterModel.getParamPosition()])));
+ return toReturn.get();
+ }
+
+ @SuppressWarnings("unchecked") //I am checking the type of parameter and I know it should handle instance I am sending
+ private Invocation.Builder addCookies(Invocation.Builder builder, Object[] args) {
+ Map<String, String> cookies = new HashMap<>();
+ Invocation.Builder toReturn = builder;
+ parameterModels.stream()
+ .filter(parameterModel -> parameterModel.handles(CookieParam.class))
+ .forEach(parameterModel -> parameterModel.handleParameter(cookies,
+ CookieParam.class,
+ args[parameterModel.getParamPosition()]));
+
+ for (Map.Entry<String, String> entry : cookies.entrySet()) {
+ toReturn = toReturn.cookie(entry.getKey(), entry.getValue());
+ }
+ return toReturn;
+ }
+
+ private MultivaluedMap<String, Object> addCustomHeaders(Object[] args) {
+ MultivaluedMap<String, Object> result = new MultivaluedHashMap<>();
+ for (Map.Entry<String, List<String>> entry : resolveCustomHeaders(args).entrySet()) {
+ entry.getValue().forEach(val -> result.add(entry.getKey(), val));
+ }
+ for (String produce : produces) {
+ result.add(HttpHeaders.ACCEPT, produce);
+ }
+ result.putIfAbsent(HttpHeaders.CONTENT_TYPE, Collections.singletonList(consumes[0]));
+ return new MultivaluedHashMap<String, Object>(result);
+ }
+
+ @SuppressWarnings("unchecked") //I am checking the type of parameter and I know it should handle instance I am sending
+ private MultivaluedMap<String, String> resolveCustomHeaders(Object[] args) {
+ MultivaluedMap<String, String> customHeaders = new MultivaluedHashMap<>();
+ customHeaders.putAll(createMultivaluedHeadersMap(interfaceModel.getClientHeaders()));
+ customHeaders.putAll(createMultivaluedHeadersMap(clientHeaders));
+ parameterModels.stream()
+ .filter(parameterModel -> parameterModel.handles(HeaderParam.class))
+ .forEach(parameterModel -> parameterModel.handleParameter(customHeaders,
+ HeaderParam.class,
+ args[parameterModel.getParamPosition()]));
+
+ MultivaluedMap<String, String> inbound = new MultivaluedHashMap<>();
+ HeadersContext.get().ifPresent(headersContext -> inbound.putAll(headersContext.inboundHeaders()));
+
+ AtomicReference<MultivaluedMap<String, String>> toReturn = new AtomicReference<>(customHeaders);
+ interfaceModel.getClientHeadersFactory().ifPresent(clientHeadersFactory -> toReturn
+ .set(clientHeadersFactory.update(inbound, customHeaders)));
+ return toReturn.get();
+ }
+
+ private <T> MultivaluedMap<String, String> createMultivaluedHeadersMap(List<ClientHeaderParamModel> clientHeaders) {
+ MultivaluedMap<String, String> customHeaders = new MultivaluedHashMap<>();
+ for (ClientHeaderParamModel clientHeaderParamModel : clientHeaders) {
+ if (clientHeaderParamModel.getComputeMethod() == null) {
+ customHeaders
+ .put(clientHeaderParamModel.getHeaderName(), Arrays.asList(clientHeaderParamModel.getHeaderValue()));
+ } else {
+ try {
+ Method method = clientHeaderParamModel.getComputeMethod();
+ if (method.isDefault()) {
+ //method is interface default
+ //we need to create instance of the interface to be able to call default method
+ T instance = (T) ReflectionUtil.createProxyInstance(interfaceModel.getRestClientClass());
+ if (method.getParameterCount() > 0) {
+ customHeaders.put(clientHeaderParamModel.getHeaderName(),
+ createList(method.invoke(instance, clientHeaderParamModel.getHeaderName())));
+ } else {
+ customHeaders.put(clientHeaderParamModel.getHeaderName(),
+ createList(method.invoke(instance, null)));
+ }
+ } else {
+ //Method is static
+ if (method.getParameterCount() > 0) {
+ customHeaders.put(clientHeaderParamModel.getHeaderName(),
+ createList(method.invoke(null, clientHeaderParamModel.getHeaderName())));
+ } else {
+ customHeaders.put(clientHeaderParamModel.getHeaderName(),
+ createList(method.invoke(null, null)));
+ }
+ }
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ if (clientHeaderParamModel.isRequired()) {
+ if (e.getCause() instanceof RuntimeException) {
+ throw (RuntimeException) e.getCause();
+ }
+ throw new RuntimeException(e.getCause());
+ }
+ }
+ }
+ }
+ return customHeaders;
+ }
+
+ private static List<String> createList(Object value) {
+ if (value instanceof String[]) {
+ String[] array = (String[]) value;
+ return Arrays.asList(array);
+ }
+ String s = (String) value;
+ return Collections.singletonList(s);
+ }
+
+ /**
+ * Evaluation of {@link Response} if it is applicable for any of the registered {@link ResponseExceptionMapper} providers.
+ *
+ * @param response obtained response
+ * @param method called method
+ */
+ private void evaluateResponse(Response response, Method method) {
+ ResponseExceptionMapper lowestMapper = null;
+ Throwable throwable = null;
+ for (ResponseExceptionMapper responseExceptionMapper : interfaceModel.getResponseExceptionMappers()) {
+ if (responseExceptionMapper.handles(response.getStatus(), response.getHeaders())) {
+ if (lowestMapper == null
+ || throwable == null
+ || lowestMapper.getPriority() > responseExceptionMapper.getPriority()) {
+ lowestMapper = responseExceptionMapper;
+ Throwable tmp = lowestMapper.toThrowable(response);
+ if (tmp != null) {
+ throwable = tmp;
+ }
+ }
+ }
+ }
+ if (throwable != null) {
+ if (throwable instanceof RuntimeException) {
+ throw (RuntimeException) throwable;
+ } else if (throwable instanceof Error) {
+ throw (Error) throwable;
+ }
+ for (Class<?> exception : method.getExceptionTypes()) {
+ if (throwable.getClass().isAssignableFrom(exception)) {
+ throw new WebApplicationException(throwable);
+ }
+ }
+ }
+ }
+
+ private static String parseHttpMethod(InterfaceModel classModel, Method method) {
+ List<Class<?>> httpAnnotations = InterfaceUtil.getHttpAnnotations(method);
+ if (httpAnnotations.size() > 1) {
+ throw new RestClientDefinitionException("Method can't have more then one annotation of @HttpMethod type. "
+ + "See " + classModel.getRestClientClass().getName()
+ + "::" + method.getName());
+ }
+ if (httpAnnotations.isEmpty()) {
+ //Sub resource method
+ return "";
+ }
+ return httpAnnotations.get(0).getSimpleName();
+ }
+
+ private static List<ParamModel> parameterModels(InterfaceModel classModel, Method method) {
+ List<ParamModel> parameterModels = new ArrayList<>();
+ final List<org.glassfish.jersey.model.Parameter> jerseyParameters = org.glassfish.jersey.model.Parameter
+ .create(classModel.getRestClientClass(), classModel.getRestClientClass(),
+ method, false);
+ Parameter[] parameters = method.getParameters();
+ for (int i = 0; i < parameters.length; i++) {
+ parameterModels.add(ParamModel.from(classModel, parameters[i].getType(), parameters[i], jerseyParameters.get(i), i));
+ }
+ return parameterModels;
+ }
+
+ private static class Builder {
+
+ private final InterfaceModel interfaceModel;
+ private final Method method;
+
+ private GenericType<?> returnType;
+ private String httpMethod;
+ private String pathValue;
+ private String[] produces;
+ private String[] consumes;
+ private List<ParamModel> parameterModels;
+ private List<ClientHeaderParamModel> clientHeaders;
+ private List<InterceptorInvocationContext.InvocationInterceptor> invocationInterceptors;
+
+ private Builder(InterfaceModel interfaceModel, Method method) {
+ this.interfaceModel = interfaceModel;
+ this.method = method;
+ filterAllInterceptorAnnotations();
+ }
+
+ private void filterAllInterceptorAnnotations() {
+ invocationInterceptors = new ArrayList<>();
+ BeanManager beanManager = interfaceModel.getBeanManager();
+ if (beanManager != null) {
+ Set<Annotation> interceptorAnnotations = new HashSet<>();
+ for (Annotation annotation : method.getAnnotations()) {
+ if (beanManager.isInterceptorBinding(annotation.annotationType())) {
+ interceptorAnnotations.add(annotation);
+ }
+ }
+ interceptorAnnotations.addAll(interfaceModel.getInterceptorAnnotations());
+ Annotation[] allInterceptorAnnotations = interceptorAnnotations.toArray(new Annotation[0]);
+ if (allInterceptorAnnotations.length == 0) {
+ return;
+ }
+ List<Interceptor<?>> interceptors = beanManager.resolveInterceptors(InterceptionType.AROUND_INVOKE,
+ allInterceptorAnnotations);
+ if (!interceptors.isEmpty()) {
+ for (Interceptor<?> interceptor : interceptors) {
+ Object interceptorInstance = beanManager.getReference(interceptor,
+ interceptor.getBeanClass(),
+ interfaceModel.getCreationalContext());
+ invocationInterceptors.add(new InterceptorInvocationContext
+ .InvocationInterceptor(interceptorInstance,
+ interceptor));
+ }
+ }
+ }
+ }
+
+ /**
+ * Return type of the method.
+ *
+ * @param returnType Method return type
+ */
+ private void returnType(Type returnType) {
+ if (returnType instanceof ParameterizedType
+ && CompletionStage.class.isAssignableFrom((Class<?>) ((ParameterizedType) returnType).getRawType())) {
+ this.returnType = new GenericType<>(((ParameterizedType) returnType).getActualTypeArguments()[0]);
+ } else {
+ this.returnType = new GenericType<>(returnType);
+ }
+ }
+
+ /**
+ * HTTP method of the method.
+ *
+ * @param httpMethod HTTP method of the method
+ */
+ private void httpMethod(String httpMethod) {
+ this.httpMethod = httpMethod;
+ }
+
+ /**
+ * Path value from {@link Path} annotation. If annotation is null, empty String is set as path.
+ *
+ * @param path {@link Path} annotation
+ */
+ private void pathValue(Path path) {
+ this.pathValue = path != null ? path.value() : "";
+ //if only / is added to path like this "localhost:80/test" it makes invalid path "localhost:80/test/"
+ this.pathValue = pathValue.equals("/") ? "" : pathValue;
+ }
+
+ /**
+ * Extracts MediaTypes from {@link Produces} annotation.
+ * If annotation is null, value from {@link InterfaceModel} is set.
+ *
+ * @param produces {@link Produces} annotation
+ */
+ private void produces(Produces produces) {
+ this.produces = produces == null ? interfaceModel.getProduces() : produces.value();
+ }
+
+ /**
+ * Extracts MediaTypes from {@link Consumes} annotation.
+ * If annotation is null, value from {@link InterfaceModel} is set.
+ *
+ * @param consumes {@link Consumes} annotation
+ */
+ private void consumes(Consumes consumes) {
+ this.consumes = consumes == null ? interfaceModel.getConsumes() : consumes.value();
+ }
+
+ /**
+ * {@link List} of transformed method parameters.
+ *
+ * @param parameterModels {@link List} of parameters
+ */
+ private void parameters(List<ParamModel> parameterModels) {
+ this.parameterModels = parameterModels;
+ }
+
+ /**
+ * Process data from {@link ClientHeaderParam} annotation to extract methods and values.
+ *
+ * @param clientHeaderParams {@link ClientHeaderParam} annotations
+ */
+ private void clientHeaders(ClientHeaderParam[] clientHeaderParams) {
+ clientHeaders = Arrays.stream(clientHeaderParams)
+ .map(clientHeaderParam -> new ClientHeaderParamModel(interfaceModel.getRestClientClass(), clientHeaderParam))
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Creates new MethodModel instance.
+ *
+ * @return new instance
+ */
+ MethodModel build() {
+ returnType(method.getGenericReturnType());
+ httpMethod(parseHttpMethod(interfaceModel, method));
+ pathValue(method.getAnnotation(Path.class));
+ produces(method.getAnnotation(Produces.class));
+ consumes(method.getAnnotation(Consumes.class));
+ parameters(parameterModels(interfaceModel, method));
+ clientHeaders(method.getAnnotationsByType(ClientHeaderParam.class));
+
+ validateParameters();
+ validateHeaderDuplicityNames();
+
+ if (isJsonValue(returnType.getType())) {
+ this.produces = new String[] {MediaType.APPLICATION_JSON};
+ }
+
+ parameterModels.stream()
+ .filter(ParamModel::isEntity)
+ .map(ParamModel::getType)
+ .filter(this::isJsonValue)
+ .findFirst()
+ .ifPresent(paramModel -> this.consumes = new String[] {MediaType.APPLICATION_JSON});
+
+ return new MethodModel(this);
+ }
+
+ private void validateParameters() {
+ UriBuilder uriBuilder = UriBuilder.fromUri(interfaceModel.getPath()).path(pathValue);
+ List<String> parameters = InterfaceUtil.parseParameters(uriBuilder.toTemplate());
+ List<String> methodPathParameters = new ArrayList<>();
+ List<ParamModel> pathHandlingParams = parameterModels.stream()
+ .filter(parameterModel -> parameterModel.handles(PathParam.class))
+ .collect(Collectors.toList());
+ for (ParamModel paramModel : pathHandlingParams) {
+ if (paramModel instanceof PathParamModel) {
+ methodPathParameters.add(((PathParamModel) paramModel).getPathParamName());
+ } else if (paramModel instanceof BeanParamModel) {
+ for (ParamModel beanPathParams : ((BeanParamModel) paramModel).getAllParamsWithType(PathParam.class)) {
+ methodPathParameters.add(((PathParamModel) beanPathParams).getPathParamName());
+ }
+ }
+ }
+ for (String parameterName : methodPathParameters) {
+ if (!parameters.contains(parameterName)) {
+ throw new RestClientDefinitionException("Parameter name " + parameterName + " on "
+ + interfaceModel.getRestClientClass().getName()
+ + "::" + method.getName()
+ + " doesn't match any @Path variable name.");
+ }
+ parameters.remove(parameterName);
+ }
+ if (!parameters.isEmpty()) {
+ throw new RestClientDefinitionException("Some variable names does not have matching @PathParam "
+ + "defined on method " + interfaceModel.getRestClientClass()
+ .getName()
+ + "::" + method.getName());
+ }
+ List<ParamModel> entities = parameterModels.stream()
+ .filter(ParamModel::isEntity)
+ .collect(Collectors.toList());
+ if (entities.size() > 1) {
+ throw new RestClientDefinitionException("You cant have more than 1 entity method parameter! Check "
+ + interfaceModel.getRestClientClass().getName()
+ + "::" + method.getName());
+ }
+ }
+
+ private void validateHeaderDuplicityNames() {
+ ArrayList<String> names = new ArrayList<>();
+ for (ClientHeaderParamModel clientHeaderParamModel : clientHeaders) {
+ String headerName = clientHeaderParamModel.getHeaderName();
+ if (names.contains(headerName)) {
+ throw new RestClientDefinitionException("Header name cannot be registered more then once on the same target."
+ + "See " + interfaceModel.getRestClientClass().getName());
+ }
+ names.add(headerName);
+ }
+ }
+
+ private boolean isJsonValue(Type type) {
+ return type instanceof Class && JsonValue.class.isAssignableFrom((Class<?>) type);
+ }
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ParamHandler.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ParamHandler.java
new file mode 100644
index 0000000..c268918
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ParamHandler.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+/**
+ * Handles behavior for each JAX-RS annotated element.
+ *
+ * @author David Kral
+ */
+@FunctionalInterface
+interface ParamHandler {
+
+ /**
+ * Handles behavior for specific annotated element.
+ *
+ * @param beanClassModel bean class model
+ * @param requestPart part of the request
+ * @param instance actual value
+ * @return updated request part
+ */
+ Object handle(BeanClassModel beanClassModel, Object requestPart, Object instance);
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ParamModel.java
new file mode 100644
index 0000000..4ba7e40
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ParamModel.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
+import javax.ws.rs.BeanParam;
+import javax.ws.rs.CookieParam;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+
+import org.glassfish.jersey.model.Parameter;
+
+/**
+ * Abstract model for all elements with parameter annotation.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+abstract class ParamModel<T> {
+
+ public static final Map<Class<? extends Annotation>,
+ BiFunction<Builder, Annotation, ParamModel<?>>> PARAM_ANNOTATIONS = new HashMap<>();
+
+ static {
+ PARAM_ANNOTATIONS.put(PathParam.class,
+ (builder, annotation) -> new PathParamModel(builder, (PathParam) annotation));
+ PARAM_ANNOTATIONS.put(HeaderParam.class,
+ (builder, annotation) -> new HeaderParamModel(builder, (HeaderParam) annotation));
+ PARAM_ANNOTATIONS.put(CookieParam.class,
+ (builder, annotation) -> new CookieParamModel(builder, (CookieParam) annotation));
+ PARAM_ANNOTATIONS.put(QueryParam.class,
+ (builder, annotation) -> new QueryParamModel(builder, (QueryParam) annotation));
+ PARAM_ANNOTATIONS.put(MatrixParam.class,
+ (builder, annotation) -> new MatrixParamModel(builder, (MatrixParam) annotation));
+ PARAM_ANNOTATIONS.put(FormParam.class,
+ (builder, annotation) -> new FormParamModel(builder, (FormParam) annotation));
+ PARAM_ANNOTATIONS.put(BeanParam.class,
+ (builder, annotation) -> new BeanParamModel(builder));
+ }
+
+ protected final InterfaceModel interfaceModel;
+ protected final Parameter parameter;
+ private final Type type;
+ private final AnnotatedElement annotatedElement;
+ private final int paramPosition;
+ private final boolean entity;
+
+ /**
+ * Processes parameter annotations and creates new instance of the model corresponding model.
+ *
+ * @param interfaceModel model of the interface
+ * @param type annotated element type
+ * @param annotatedElement annotated element
+ * @param position position in method params
+ * @return new parameter instance
+ */
+ static ParamModel from(InterfaceModel interfaceModel, Type type, AnnotatedElement annotatedElement,
+ Parameter parameter, int position) {
+ return new Builder(interfaceModel, type, annotatedElement, parameter, position).build();
+ }
+
+ ParamModel(Builder builder) {
+ this.interfaceModel = builder.interfaceModel;
+ this.type = builder.type;
+ this.annotatedElement = builder.annotatedElement;
+ this.entity = builder.entity;
+ this.paramPosition = builder.paramPosition;
+ this.parameter = builder.parameter;
+ }
+
+ /**
+ * Returns {@link Type} of the parameter.
+ *
+ * @return parameter type
+ */
+ Type getType() {
+ return type;
+ }
+
+ /**
+ * Returns annotated element.
+ *
+ * @return annotated element
+ */
+ AnnotatedElement getAnnotatedElement() {
+ return annotatedElement;
+ }
+
+ int getParamPosition() {
+ return paramPosition;
+ }
+
+ /**
+ * Returns value if parameter is entity or not.
+ *
+ * @return if parameter is entity
+ */
+ boolean isEntity() {
+ return entity;
+ }
+
+ /**
+ * Transforms parameter to be part of the request.
+ *
+ * @param requestPart part of a request
+ * @param annotationClass annotation type
+ * @param instance actual method parameter value
+ * @return updated request part
+ */
+ abstract T handleParameter(T requestPart, Class<? extends Annotation> annotationClass, Object instance);
+
+ /**
+ * Evaluates if the annotation passed in parameter is supported by this parameter.
+ *
+ * @param annotation checked annotation
+ * @return if annotation is supported
+ */
+ abstract boolean handles(Class<? extends Annotation> annotation);
+
+ protected static class Builder {
+
+ private InterfaceModel interfaceModel;
+ private Type type;
+ private AnnotatedElement annotatedElement;
+ private Parameter parameter;
+ private boolean entity;
+ private int paramPosition;
+
+ private Builder(InterfaceModel interfaceModel,
+ Type type,
+ AnnotatedElement annotatedElement,
+ Parameter parameter,
+ int position) {
+ this.interfaceModel = interfaceModel;
+ this.type = type;
+ this.annotatedElement = annotatedElement;
+ this.parameter = parameter;
+ this.paramPosition = position;
+ }
+
+ /**
+ * Creates new ParamModel instance.
+ *
+ * @return new instance
+ */
+ ParamModel build() {
+ for (Class<? extends Annotation> paramAnnotation : PARAM_ANNOTATIONS.keySet()) {
+ Annotation annot = annotatedElement.getAnnotation(paramAnnotation);
+ if (annot != null) {
+ return PARAM_ANNOTATIONS.get(paramAnnotation).apply(this, annot);
+ }
+ }
+
+ entity = true;
+ return new ParamModel<Object>(this) {
+ @Override
+ public Object handleParameter(Object requestPart, Class<? extends Annotation> annotationClass, Object instance) {
+ return requestPart;
+ }
+
+ @Override
+ public boolean handles(Class<? extends Annotation> annotation) {
+ return false;
+ }
+ };
+ }
+
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/PathParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/PathParamModel.java
new file mode 100644
index 0000000..36700a9
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/PathParamModel.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+
+import javax.ws.rs.PathParam;
+import javax.ws.rs.client.WebTarget;
+
+/**
+ * Contains information about method parameter or class field which is annotated by {@link PathParam}.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class PathParamModel extends ParamModel<WebTarget> {
+
+ private final String pathParamName;
+
+ PathParamModel(Builder builder, PathParam annotation) {
+ super(builder);
+ pathParamName = annotation.value();
+ }
+
+ public String getPathParamName() {
+ return pathParamName;
+ }
+
+ @Override
+ public WebTarget handleParameter(WebTarget requestPart, Class<? extends Annotation> annotationClass, Object instance) {
+ Object resolvedValue = interfaceModel.resolveParamValue(instance, parameter);
+ return requestPart.resolveTemplate(pathParamName, resolvedValue);
+ }
+
+ @Override
+ public boolean handles(Class<? extends Annotation> annotation) {
+ return PathParam.class.equals(annotation);
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ProxyInvocationHandler.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ProxyInvocationHandler.java
new file mode 100644
index 0000000..9f317c7
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ProxyInvocationHandler.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.WebTarget;
+
+/**
+ * Invocation handler for interface proxy.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class ProxyInvocationHandler implements InvocationHandler {
+ private final Client client;
+ private final WebTarget target;
+ private final RestClientModel restClientModel;
+ private final AtomicBoolean closed = new AtomicBoolean(false);
+
+ // top level
+ ProxyInvocationHandler(Client client,
+ WebTarget target,
+ RestClientModel restClientModel) {
+
+ this.client = client;
+ this.target = target;
+ this.restClientModel = restClientModel;
+ }
+
+ // used for sub-resources
+ ProxyInvocationHandler(WebTarget target,
+ RestClientModel restClientModel) {
+ this(null, target, restClientModel);
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) {
+ if (method.getName().equals("toString") && (args == null || args.length == 0)) {
+ return restClientModel.toString();
+ }
+ if (method.getName().equals("close") && (args == null || args.length == 0)) {
+ closed.set(true);
+ if (null != client) {
+ client.close();
+ }
+ return null;
+ }
+
+ if (closed.get()) {
+ throw new IllegalStateException("Attempting to invoke a method on a closed client.");
+ }
+ return restClientModel.invokeMethod(target, method, args);
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/QueryParamModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/QueryParamModel.java
new file mode 100644
index 0000000..ff9c4d5
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/QueryParamModel.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Annotation;
+import java.util.Map;
+
+import javax.ws.rs.QueryParam;
+
+/**
+ * Model which contains information about query parameter
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class QueryParamModel extends ParamModel<Map<String, Object[]>> {
+
+ private final String queryParamName;
+
+ QueryParamModel(Builder builder, QueryParam annotation) {
+ super(builder);
+ queryParamName = annotation.value();
+ }
+
+ @Override
+ public Map<String, Object[]> handleParameter(Map<String, Object[]> requestPart,
+ Class<? extends Annotation> annotationClass,
+ Object instance) {
+ Object resolvedValue = interfaceModel.resolveParamValue(instance, parameter);
+ if (resolvedValue instanceof Object[]) {
+ requestPart.put(queryParamName, (Object[]) resolvedValue);
+ } else {
+ requestPart.put(queryParamName, new Object[] {resolvedValue});
+ }
+ return requestPart;
+ }
+
+ @Override
+ public boolean handles(Class<? extends Annotation> annotation) {
+ return QueryParam.class.equals(annotation);
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ReflectionUtil.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ReflectionUtil.java
new file mode 100644
index 0000000..b741e14
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/ReflectionUtil.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Proxy;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * @author David Kral
+ * @author Tomas Langer
+ */
+final class ReflectionUtil {
+
+ private ReflectionUtil() {
+ }
+
+ static <T> T createInstance(Class<T> tClass) {
+ return AccessController.doPrivileged((PrivilegedAction<T>) () -> {
+ try {
+ return tClass.getConstructor().newInstance();
+ } catch (Throwable t) {
+ throw new RuntimeException("No default constructor in class " + tClass + " present. Class cannot be created!", t);
+ }
+ });
+ }
+
+ @SuppressWarnings("unchecked")
+ static <T> T createProxyInstance(Class<T> restClientClass) {
+ return AccessController.doPrivileged((PrivilegedAction<T>) () -> (T) Proxy.newProxyInstance(
+ Thread.currentThread().getContextClassLoader(),
+ new Class[] {restClientClass},
+ (proxy, m, args) -> {
+ Constructor<MethodHandles.Lookup> constructor = MethodHandles.Lookup.class
+ .getDeclaredConstructor(Class.class);
+ constructor.setAccessible(true);
+ return constructor.newInstance(restClientClass)
+ .in(restClientClass)
+ .unreflectSpecial(m, restClientClass)
+ .bindTo(proxy)
+ .invokeWithArguments(args);
+ }));
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RequestHeaderAutoDiscoverable.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RequestHeaderAutoDiscoverable.java
new file mode 100644
index 0000000..05b2155
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RequestHeaderAutoDiscoverable.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import javax.ws.rs.ConstrainedTo;
+import javax.ws.rs.RuntimeType;
+import javax.ws.rs.core.FeatureContext;
+
+import org.glassfish.jersey.internal.spi.ForcedAutoDiscoverable;
+
+/**
+ * Auto discoverable feature to bind into jersey runtime.
+ */
+@ConstrainedTo(RuntimeType.SERVER)
+public class RequestHeaderAutoDiscoverable implements ForcedAutoDiscoverable {
+ @Override
+ public void configure(FeatureContext context) {
+ if (!context.getConfiguration().isRegistered(HeadersRequestFilter.class)) {
+ context.register(HeadersRequestFilter.class);
+ }
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientBuilderImpl.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientBuilderImpl.java
new file mode 100644
index 0000000..ded8ec5
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientBuilderImpl.java
@@ -0,0 +1,420 @@
+/*
+ * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019 Payara Foundation 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.microprofile.restclient;
+
+import java.io.Closeable;
+import java.lang.reflect.Proxy;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.KeyStore;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+
+import javax.annotation.Priority;
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.Priorities;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Configuration;
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
+import javax.ws.rs.ext.ParamConverterProvider;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.eclipse.microprofile.rest.client.RestClientBuilder;
+import org.eclipse.microprofile.rest.client.RestClientDefinitionException;
+import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory;
+import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
+import org.eclipse.microprofile.rest.client.spi.RestClientListener;
+import org.glassfish.jersey.client.Initializable;
+import org.glassfish.jersey.ext.cdi1x.internal.CdiUtil;
+import org.glassfish.jersey.internal.inject.InjectionManager;
+import org.glassfish.jersey.internal.inject.InjectionManagerSupplier;
+import org.glassfish.jersey.internal.util.ReflectionHelper;
+
+/**
+ * Rest client builder implementation. Creates proxy instance of requested interface.
+ *
+ * @author David Kral
+ * @author Patrik Dudits
+ * @author Tomas Langer
+ */
+class RestClientBuilderImpl implements RestClientBuilder {
+
+ private static final String CONFIG_DISABLE_DEFAULT_MAPPER = "microprofile.rest.client.disable.default.mapper";
+ private static final String CONFIG_PROVIDERS = "/mp-rest/providers";
+ private static final String CONFIG_PROVIDER_PRIORITY = "/priority";
+ private static final String PROVIDER_SEPARATOR = ",";
+
+ private final Set<ResponseExceptionMapper> responseExceptionMappers;
+ private final Set<ParamConverterProvider> paramConverterProviders;
+ private final List<AsyncInvocationInterceptorFactory> asyncInterceptorFactories;
+ private final Config config;
+ private final ConfigWrapper configWrapper;
+ private URI uri;
+ private ClientBuilder clientBuilder;
+ private Supplier<ExecutorService> executorService;
+ private HostnameVerifier sslHostnameVerifier;
+ private SSLContext sslContext;
+ private KeyStore sslTrustStore;
+ private KeyStore sslKeyStore;
+ private char[] sslKeyStorePassword;
+
+ RestClientBuilderImpl() {
+ clientBuilder = ClientBuilder.newBuilder();
+ responseExceptionMappers = new HashSet<>();
+ paramConverterProviders = new HashSet<>();
+ asyncInterceptorFactories = new ArrayList<>();
+ config = ConfigProvider.getConfig();
+ configWrapper = new ConfigWrapper(clientBuilder.getConfiguration());
+ executorService = Executors::newCachedThreadPool;
+ }
+
+ @Override
+ public RestClientBuilder baseUrl(URL url) {
+ try {
+ this.uri = url.toURI();
+ return this;
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e.getMessage());
+ }
+ }
+
+ @Override
+ public RestClientBuilder connectTimeout(long timeout, TimeUnit unit) {
+ clientBuilder.connectTimeout(timeout, unit);
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder readTimeout(long timeout, TimeUnit unit) {
+ clientBuilder.readTimeout(timeout, unit);
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder executorService(ExecutorService executor) {
+ if (executor == null) {
+ throw new IllegalArgumentException("ExecutorService cannot be null.");
+ }
+ executorService = () -> executor;
+ return this;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public <T> T build(Class<T> interfaceClass) throws IllegalStateException, RestClientDefinitionException {
+
+ if (uri == null) {
+ throw new IllegalStateException("Base uri/url cannot be null!");
+ }
+
+ //Provider registration part
+ processProviders(interfaceClass);
+ InjectionManagerExposer injectionManagerExposer = new InjectionManagerExposer();
+ register(injectionManagerExposer);
+
+ for (RestClientListener restClientListener : ServiceLoader.load(RestClientListener.class)) {
+ restClientListener.onNewClient(interfaceClass, this);
+ }
+
+ //We need to check first if default exception mapper was not disabled by property on builder.
+ registerExceptionMapper();
+
+ //AsyncInterceptors initialization
+ List<AsyncInvocationInterceptor> asyncInterceptors = asyncInterceptorFactories.stream()
+ .map(AsyncInvocationInterceptorFactory::newInterceptor)
+ .collect(Collectors.toList());
+ asyncInterceptors.forEach(AsyncInvocationInterceptor::prepareContext);
+
+ clientBuilder.executorService(new ExecutorServiceWrapper(executorService.get(), asyncInterceptors));
+
+ if (null != sslContext) {
+ clientBuilder.sslContext(sslContext);
+ }
+
+ if (null != sslHostnameVerifier) {
+ clientBuilder.hostnameVerifier(sslHostnameVerifier);
+ }
+
+ if (null != sslTrustStore) {
+ clientBuilder.trustStore(sslTrustStore);
+ }
+
+ if (null != sslKeyStore) {
+ clientBuilder.keyStore(sslKeyStore, sslKeyStorePassword);
+ }
+
+ Client client = clientBuilder.build();
+ if (client instanceof Initializable) {
+ ((Initializable) client).preInitialize();
+ }
+ WebTarget webTarget = client.target(this.uri);
+
+ RestClientModel restClientModel = RestClientModel.from(interfaceClass,
+ responseExceptionMappers,
+ paramConverterProviders,
+ asyncInterceptors,
+ injectionManagerExposer.injectionManager,
+ CdiUtil.getBeanManager());
+
+ return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(),
+ new Class[] {interfaceClass, AutoCloseable.class, Closeable.class},
+ new ProxyInvocationHandler(client, webTarget, restClientModel)
+ );
+ }
+
+ @Override
+ public RestClientBuilder sslContext(SSLContext sslContext) {
+ this.sslContext = sslContext;
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder trustStore(KeyStore keyStore) {
+ this.sslTrustStore = keyStore;
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder keyStore(KeyStore keyStore, String password) {
+ this.sslKeyStore = keyStore;
+ this.sslKeyStorePassword = ((null == password) ? new char[0] : password.toCharArray());
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder hostnameVerifier(HostnameVerifier hostnameVerifier) {
+ this.sslHostnameVerifier = hostnameVerifier;
+ return this;
+ }
+
+ private void registerExceptionMapper() {
+ Object disableDefaultMapperJersey = clientBuilder.getConfiguration().getProperty(CONFIG_DISABLE_DEFAULT_MAPPER);
+ if (disableDefaultMapperJersey != null && disableDefaultMapperJersey.equals(Boolean.FALSE)) {
+ register(new DefaultResponseExceptionMapper());
+ } else if (disableDefaultMapperJersey == null) {
+ //If property was not set on Jersey ClientBuilder, we need to check config.
+ Optional<Boolean> disableDefaultMapperConfig = config.getOptionalValue(CONFIG_DISABLE_DEFAULT_MAPPER, boolean.class);
+ if (!disableDefaultMapperConfig.isPresent() || !disableDefaultMapperConfig.get()) {
+ register(new DefaultResponseExceptionMapper());
+ }
+ }
+ }
+
+ private <T> void processProviders(Class<T> interfaceClass) {
+ Object providersFromJerseyConfig = clientBuilder.getConfiguration()
+ .getProperty(interfaceClass.getName() + CONFIG_PROVIDERS);
+ if (providersFromJerseyConfig instanceof String && !((String) providersFromJerseyConfig).isEmpty()) {
+ String[] providerArray = ((String) providersFromJerseyConfig).split(PROVIDER_SEPARATOR);
+ processConfigProviders(interfaceClass, providerArray);
+ }
+ Optional<String> providersFromConfig = config.getOptionalValue(interfaceClass.getName() + CONFIG_PROVIDERS, String.class);
+ providersFromConfig.ifPresent(providers -> {
+ if (!providers.isEmpty()) {
+ String[] providerArray = providersFromConfig.get().split(PROVIDER_SEPARATOR);
+ processConfigProviders(interfaceClass, providerArray);
+ }
+ });
+ RegisterProvider[] registerProviders = interfaceClass.getAnnotationsByType(RegisterProvider.class);
+ for (RegisterProvider registerProvider : registerProviders) {
+ register(registerProvider.value(), registerProvider.priority() < 0 ? Priorities.USER : registerProvider.priority());
+ }
+ }
+
+ private void processConfigProviders(Class<?> restClientInterface, String[] providerArray) {
+ for (String provider : providerArray) {
+ Class<?> providerClass = AccessController.doPrivileged(ReflectionHelper.classForNamePA(provider));
+ if (providerClass == null) {
+ throw new IllegalStateException("No provider class with following name found: " + provider);
+ }
+ int priority = getProviderPriority(restClientInterface, providerClass);
+ register(providerClass, priority);
+ }
+ }
+
+ private int getProviderPriority(Class<?> restClientInterface, Class<?> providerClass) {
+ String property = restClientInterface.getName() + CONFIG_PROVIDERS + "/"
+ + providerClass.getName() + CONFIG_PROVIDER_PRIORITY;
+ Object providerPriorityJersey = clientBuilder.getConfiguration().getProperty(property);
+ if (providerPriorityJersey == null) {
+ //If property was not set on Jersey ClientBuilder, we need to check MP config.
+ Optional<Integer> providerPriorityMP = config.getOptionalValue(property, int.class);
+ if (providerPriorityMP.isPresent()) {
+ return providerPriorityMP.get();
+ }
+ } else if (providerPriorityJersey instanceof Integer) {
+ return (int) providerPriorityJersey;
+ }
+ Priority priority = providerClass.getAnnotation(Priority.class);
+ return priority == null ? -1 : priority.value();
+ }
+
+ @Override
+ public Configuration getConfiguration() {
+ return configWrapper;
+ }
+
+ @Override
+ public RestClientBuilder property(String name, Object value) {
+ clientBuilder.property(name, value);
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder register(Class<?> componentClass) {
+ if (isSupportedCustomProvider(componentClass)) {
+ register(ReflectionUtil.createInstance(componentClass));
+ } else {
+ clientBuilder.register(componentClass);
+ }
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder register(Class<?> componentClass, int priority) {
+ if (isSupportedCustomProvider(componentClass)) {
+ register(ReflectionUtil.createInstance(componentClass), priority);
+ } else {
+ clientBuilder.register(componentClass, priority);
+ }
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder register(Class<?> componentClass, Class<?>... contracts) {
+ if (isSupportedCustomProvider(componentClass)) {
+ register(ReflectionUtil.createInstance(componentClass), contracts);
+ } else {
+ clientBuilder.register(componentClass, contracts);
+ }
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder register(Class<?> componentClass, Map<Class<?>, Integer> contracts) {
+ if (isSupportedCustomProvider(componentClass)) {
+ register(ReflectionUtil.createInstance(componentClass), contracts);
+ } else {
+ clientBuilder.register(componentClass, contracts);
+ }
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder register(Object component) {
+ if (component instanceof ResponseExceptionMapper) {
+ ResponseExceptionMapper mapper = (ResponseExceptionMapper) component;
+ registerCustomProvider(component, -1);
+ clientBuilder.register(mapper, mapper.getPriority());
+ } else {
+ clientBuilder.register(component);
+ registerCustomProvider(component, -1);
+ }
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder register(Object component, int priority) {
+ clientBuilder.register(component, priority);
+ registerCustomProvider(component, priority);
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder register(Object component, Class<?>... contracts) {
+ for (Class<?> contract : contracts) {
+ if (isSupportedCustomProvider(contract)) {
+ register(component);
+ }
+ }
+ clientBuilder.register(component, contracts);
+ return this;
+ }
+
+ @Override
+ public RestClientBuilder register(Object component, Map<Class<?>, Integer> contracts) {
+ if (isSupportedCustomProvider(component.getClass())) {
+ if (component instanceof ResponseExceptionMapper) {
+ registerCustomProvider(component, contracts.get(ResponseExceptionMapper.class));
+ } else if (component instanceof ParamConverterProvider) {
+ registerCustomProvider(component, contracts.get(ParamConverterProvider.class));
+ }
+ }
+ clientBuilder.register(component, contracts);
+ return this;
+ }
+
+ private boolean isSupportedCustomProvider(Class<?> providerClass) {
+ return ResponseExceptionMapper.class.isAssignableFrom(providerClass)
+ || ParamConverterProvider.class.isAssignableFrom(providerClass)
+ || AsyncInvocationInterceptorFactory.class.isAssignableFrom(providerClass);
+ }
+
+ private void registerCustomProvider(Object instance, int priority) {
+ if (!isSupportedCustomProvider(instance.getClass())) {
+ return;
+ }
+ if (instance instanceof ResponseExceptionMapper) {
+ responseExceptionMappers.add((ResponseExceptionMapper) instance);
+ //needs to be registered separately due to it is not possible to register custom provider in jersey
+ Map<Class<?>, Integer> contracts = new HashMap<>();
+ contracts.put(ResponseExceptionMapper.class, priority);
+ configWrapper.addCustomProvider(instance.getClass(), contracts);
+ }
+ if (instance instanceof ParamConverterProvider) {
+ paramConverterProviders.add((ParamConverterProvider) instance);
+ }
+ if (instance instanceof AsyncInvocationInterceptorFactory) {
+ asyncInterceptorFactories.add((AsyncInvocationInterceptorFactory) instance);
+ }
+ }
+
+ private static class InjectionManagerExposer implements Feature {
+ InjectionManager injectionManager;
+
+ @Override
+ public boolean configure(FeatureContext context) {
+ if (context instanceof InjectionManagerSupplier) {
+ this.injectionManager = ((InjectionManagerSupplier) context).getInjectionManager();
+ return true;
+ } else {
+ throw new IllegalArgumentException("The client needs Jersey runtime to work properly");
+ }
+ }
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientExtension.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientExtension.java
new file mode 100644
index 0000000..58fca82
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientExtension.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.DeploymentException;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.enterprise.inject.spi.ProcessInjectionPoint;
+import javax.enterprise.inject.spi.WithAnnotations;
+import javax.enterprise.util.AnnotationLiteral;
+import javax.inject.Qualifier;
+
+import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
+import org.eclipse.microprofile.rest.client.inject.RestClient;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Filters out all interfaces annotated with {@link RegisterRestClient}
+ * and creates new Producer from each of these selected interfaces.
+ *
+ * Also adds support for injection of rest client instances to fields
+ * without {@link RestClient} annotation.
+ *
+ * @author David Kral
+ */
+public class RestClientExtension implements Extension {
+
+ private Set<Class<?>> interfaces = new HashSet<>();
+
+ /**
+ * Filters out all interfaces annotated with {@link RegisterRestClient} annotation and
+ * adds them to the collection for further processing.
+ *
+ * @param processAnnotatedType filtered annotated types
+ */
+ public void collectClientRegistrations(@Observes
+ @WithAnnotations({RegisterRestClient.class})
+ ProcessAnnotatedType<?> processAnnotatedType) {
+ Class<?> typeDef = processAnnotatedType.getAnnotatedType().getJavaClass();
+ if (typeDef.isInterface()) {
+ interfaces.add(typeDef);
+ } else {
+ throw new DeploymentException("RegisterRestClient annotation has to be on interface! " + typeDef + " is not "
+ + "interface.");
+ }
+ }
+
+ /**
+ * Creates new producers based on collected interfaces.
+ *
+ * @param abd after bean discovery instance
+ * @param bm bean manager instance
+ */
+ public void restClientRegistration(@Observes AfterBeanDiscovery abd, BeanManager bm) {
+ interfaces.forEach(type -> abd.addBean(new RestClientProducer(type, bm)));
+ }
+
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientModel.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientModel.java
new file mode 100644
index 0000000..4e81ca3
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientModel.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019 Payara Foundation 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.microprofile.restclient;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.ext.ParamConverterProvider;
+
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
+import org.glassfish.jersey.internal.inject.InjectionManager;
+
+/**
+ * Model of the rest client interface.
+ *
+ * @author David Kral
+ * @author Patrik Dudits
+ */
+class RestClientModel {
+
+ private final InterfaceModel interfaceModel;
+ private final Map<Method, MethodModel> methodModels;
+
+ /**
+ * Creates new instance of the {@link RestClientModel} base on interface class.
+ *
+ * @param restClientClass rest client interface
+ * @param responseExceptionMappers registered exception mappers
+ * @param paramConverterProviders registered param converters
+ * @param asyncInterceptors registered async interceptor factories
+ * @param injectionManager
+ * @return new instance
+ */
+ static RestClientModel from(Class<?> restClientClass,
+ Set<ResponseExceptionMapper> responseExceptionMappers,
+ Set<ParamConverterProvider> paramConverterProviders,
+ List<AsyncInvocationInterceptor> asyncInterceptors,
+ InjectionManager injectionManager,
+ BeanManager beanManager) {
+ InterfaceModel interfaceModel = InterfaceModel.from(restClientClass,
+ responseExceptionMappers,
+ paramConverterProviders,
+ asyncInterceptors,
+ injectionManager,
+ beanManager);
+ return new Builder()
+ .interfaceModel(interfaceModel)
+ .methodModels(parseMethodModels(interfaceModel))
+ .build();
+ }
+
+ private RestClientModel(Builder builder) {
+ this.interfaceModel = builder.classModel;
+ this.methodModels = builder.methodModels;
+ }
+
+ /**
+ * Invokes desired rest client method.
+ *
+ * @param baseWebTarget path to endpoint
+ * @param method desired method
+ * @param args actual method parameters
+ * @return method return value
+ */
+ <T> Object invokeMethod(WebTarget baseWebTarget, Method method, Object[] args) {
+ WebTarget classLevelTarget = baseWebTarget.path(interfaceModel.getPath());
+ MethodModel methodModel = methodModels.get(method);
+ if (methodModel != null) {
+ return new InterceptorInvocationContext(classLevelTarget, methodModel, method, args).proceed();
+ }
+ try {
+ if (method.isDefault()) {
+ T instance = (T) ReflectionUtil.createProxyInstance(interfaceModel.getRestClientClass());
+ return method.invoke(instance, args);
+ } else {
+ throw new UnsupportedOperationException("This method is not supported!");
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static Map<Method, MethodModel> parseMethodModels(InterfaceModel classModel) {
+ Map<Method, MethodModel> methodMap = new HashMap<>();
+ for (Method method : classModel.getRestClientClass().getMethods()) {
+ if (method.isDefault() || Modifier.isStatic(method.getModifiers())) {
+ continue;
+ }
+ //Skip method processing if method does not have HTTP annotation
+ //and is not sub resource (does not have Path annotation)
+ methodMap.put(method, MethodModel.from(classModel, method));
+ }
+ return methodMap;
+ }
+
+ private static class Builder {
+
+ private InterfaceModel classModel;
+ private Map<Method, MethodModel> methodModels;
+
+ private Builder() {
+ }
+
+ /**
+ * Rest client class converted to {@link InterfaceModel}
+ *
+ * @param classModel {@link InterfaceModel} instance
+ * @return Updated Builder instance
+ */
+ Builder interfaceModel(InterfaceModel classModel) {
+ this.classModel = classModel;
+ return this;
+ }
+
+ /**
+ * Rest client class methods converted to {@link Map} of {@link MethodModel}
+ *
+ * @param methodModels Method models
+ * @return Updated Builder instance
+ */
+ Builder methodModels(Map<Method, MethodModel> methodModels) {
+ this.methodModels = methodModels;
+ return this;
+ }
+
+ /**
+ * Creates new RestClientModel instance.
+ *
+ * @return new instance
+ */
+ public RestClientModel build() {
+ return new RestClientModel(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return interfaceModel.getRestClientClass().getName();
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientProducer.java b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientProducer.java
new file mode 100644
index 0000000..8d5de4c
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientProducer.java
@@ -0,0 +1,408 @@
+/*
+ * Copyright (c) 2019 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.microprofile.restclient;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.AccessController;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Default;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.DeploymentException;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.PassivationCapable;
+import javax.enterprise.util.AnnotationLiteral;
+import javax.net.ssl.HostnameVerifier;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.eclipse.microprofile.rest.client.RestClientBuilder;
+import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
+import org.eclipse.microprofile.rest.client.inject.RestClient;
+import org.glassfish.jersey.internal.util.ReflectionHelper;
+
+/**
+ * Handles proper rest client injection.
+ *
+ * Contains information about the rest client interface and extracts additional parameters from
+ * config.
+ *
+ * @author David Kral
+ * @author Tomas Langer
+ */
+class RestClientProducer implements Bean<Object>, PassivationCapable {
+
+ private static final String CONFIG_URL = "/mp-rest/url";
+ private static final String CONFIG_URI = "/mp-rest/uri";
+ private static final String CONFIG_SCOPE = "/mp-rest/scope";
+ private static final String CONFIG_CONNECTION_TIMEOUT = "/mp-rest/connectTimeout";
+ private static final String CONFIG_READ_TIMEOUT = "/mp-rest/readTimeout";
+ private static final String CONFIG_SSL_TRUST_STORE_LOCATION = "/mp-rest/trustStore";
+ private static final String CONFIG_SSL_TRUST_STORE_TYPE = "/mp-rest/trustStoreType";
+ private static final String CONFIG_SSL_TRUST_STORE_PASSWORD = "/mp-rest/trustStorePassword";
+ private static final String CONFIG_SSL_KEY_STORE_LOCATION = "/mp-rest/keyStore";
+ private static final String CONFIG_SSL_KEY_STORE_TYPE = "/mp-rest/keyStoreType";
+ private static final String CONFIG_SSL_KEY_STORE_PASSWORD = "/mp-rest/keyStorePassword";
+ private static final String CONFIG_SSL_HOSTNAME_VERIFIER = "/mp-rest/hostnameVerifier";
+ private static final String CONFIG_PROVIDERS = "/mp-rest/providers";
+ private static final String DEFAULT_KEYSTORE_TYPE = "JKS";
+ private static final String CLASSPATH_LOCATION = "classpath:";
+ private static final String FILE_LOCATION = "file:";
+
+ private final Class<?> interfaceType;
+ private final Config config;
+ private final String fqcn;
+ private final Optional<RegisterRestClient> restClientAnnotation;
+ private final Optional<String> configKey;
+ private final Class<? extends Annotation> scope;
+
+ /**
+ * Creates new instance of RestClientProducer.
+ *
+ * @param interfaceType rest client interface
+ * @param beanManager bean manager
+ */
+ RestClientProducer(Class<?> interfaceType, BeanManager beanManager) {
+ this.interfaceType = interfaceType;
+ this.config = ConfigProvider.getConfig();
+ this.fqcn = interfaceType.getName();
+ this.restClientAnnotation = Optional.ofNullable(interfaceType.getAnnotation(RegisterRestClient.class));
+ this.configKey = restClientAnnotation.map(RegisterRestClient::configKey);
+ this.scope = resolveClientScope(interfaceType, beanManager, config, fqcn, configKey);
+ }
+
+ @Override
+ public Class<?> getBeanClass() {
+ return interfaceType;
+ }
+
+ @Override
+ public Set<InjectionPoint> getInjectionPoints() {
+ return Collections.emptySet();
+ }
+
+ @Override
+ public boolean isNullable() {
+ return false;
+ }
+
+ @Override
+ public Object create(CreationalContext<Object> creationalContext) {
+ // Base URL
+ RestClientBuilder restClientBuilder = RestClientBuilder.newBuilder().baseUrl(getBaseUrl());
+ // Connection timeout (if configured)
+ getConfigOption(Long.class, CONFIG_CONNECTION_TIMEOUT)
+ .ifPresent(aLong -> restClientBuilder.connectTimeout(aLong, TimeUnit.MILLISECONDS));
+ // Connection read timeout (if configured)
+ getConfigOption(Long.class, CONFIG_READ_TIMEOUT)
+ .ifPresent(aLong -> restClientBuilder.readTimeout(aLong, TimeUnit.MILLISECONDS));
+
+ // Providers from configuration
+ addConfiguredProviders(restClientBuilder);
+
+ // SSL configuration
+ getHostnameVerifier()
+ .ifPresent(restClientBuilder::hostnameVerifier);
+ getKeyStore(CONFIG_SSL_KEY_STORE_LOCATION, CONFIG_SSL_KEY_STORE_TYPE, CONFIG_SSL_KEY_STORE_PASSWORD)
+ .ifPresent(keyStore -> restClientBuilder.keyStore(keyStore.keyStore, keyStore.password));
+ getKeyStore(CONFIG_SSL_TRUST_STORE_LOCATION, CONFIG_SSL_TRUST_STORE_TYPE, CONFIG_SSL_TRUST_STORE_PASSWORD)
+ .ifPresent(keystore -> restClientBuilder.trustStore(keystore.keyStore));
+
+ return restClientBuilder.build(interfaceType);
+ }
+
+ @Override
+ public void destroy(Object instance, CreationalContext<Object> creationalContext) {
+ }
+
+ @Override
+ public Set<Type> getTypes() {
+ return Collections.singleton(interfaceType);
+ }
+
+ @Override
+ public Set<Annotation> getQualifiers() {
+ Set<Annotation> annotations = new HashSet<>();
+ annotations.add(new AnnotationLiteral<Default>() { });
+ annotations.add(new AnnotationLiteral<Any>() { });
+ annotations.add(RestClient.LITERAL);
+ return annotations;
+ }
+
+ @Override
+ public Class<? extends Annotation> getScope() {
+ return scope;
+ }
+
+ @Override
+ public String getName() {
+ return interfaceType.getName() + "RestClient";
+ }
+
+ @Override
+ public Set<Class<? extends Annotation>> getStereotypes() {
+ return Collections.emptySet();
+ }
+
+ @Override
+ public boolean isAlternative() {
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "RestClientProducer [ interfaceType: " + interfaceType.getSimpleName()
+ + " ] with Qualifiers [" + getQualifiers() + "]";
+ }
+
+ @Override
+ public String getId() {
+ return interfaceType.getName();
+ }
+
+ private void addConfiguredProviders(RestClientBuilder restClientBuilder) {
+ Optional<String[]> configOption = getConfigOption(String[].class, CONFIG_PROVIDERS);
+ if (!configOption.isPresent()) {
+ return;
+ }
+
+ String[] classNames = configOption.get();
+ for (String className : classNames) {
+ Class<?> providerClass = AccessController.doPrivileged(ReflectionHelper.classForNamePA(className));
+ Optional<Integer> priority = getConfigOption(Integer.class, CONFIG_PROVIDERS + "/"
+ + className
+ + "/priority");
+
+ if (priority.isPresent()) {
+ restClientBuilder.register(providerClass, priority.get());
+ } else {
+ restClientBuilder.register(providerClass);
+ }
+ }
+ }
+
+ private URL getBaseUrl() {
+ Supplier<String> baseUrlDefault = () -> {
+ throw new DeploymentException("This interface has to be annotated with @RegisterRestClient annotation.");
+ };
+
+ String baseUrl = getOption(config,
+ fqcn,
+ configKey,
+ restClientAnnotation.map(RegisterRestClient::baseUri),
+ baseUrlDefault,
+ String.class,
+ CONFIG_URI,
+ CONFIG_URL);
+
+ try {
+ return new URL(baseUrl);
+ } catch (MalformedURLException e) {
+ throw new IllegalStateException("URL is not in valid format for Rest interface " + interfaceType.getName()
+ + ": " + baseUrl, e);
+ }
+ }
+
+ // a helper to get a long option from configuration based on fully qualified class name or config key
+ private <T> Optional<T> getConfigOption(Class<T> optionType, String propertySuffix) {
+ return Optional.ofNullable(getOption(config,
+ fqcn,
+ configKey,
+ Optional.empty(),
+ () -> null,
+ optionType,
+ propertySuffix));
+ }
+
+ // a helper to find an option from configuration based on fully qualified class name or config key, from annotation,
+ // or using a default value
+ private static <T> T getOption(Config config,
+ String fqcn,
+ Optional<String> configKey,
+ Optional<T> valueFromAnnotation,
+ Supplier<T> defaultValue,
+ Class<T> propertyType,
+ String... propertySuffixes) {
+
+ /*
+ * Spec:
+ * 1. if explicit configuration for class exists, use it
+ * 2. if explicit configuration for config key exists, use it
+ * 3. if annotated and explicitly configured, use it
+ * 4. use default
+ */
+
+ // configuration for fully qualified class name
+ for (String propertySuffix : propertySuffixes) {
+ // 1.
+ Optional<T> value = config.getOptionalValue(fqcn + propertySuffix, propertyType);
+ if (value.isPresent()) {
+ return value.get();
+ }
+ }
+
+ // configuration for config key
+ if (configKey.isPresent()) {
+ String theKey = configKey.get();
+ if (!theKey.isEmpty()) {
+ for (String propertySuffix : propertySuffixes) {
+ // 2.
+ Optional<T> value = config.getOptionalValue(theKey + propertySuffix, propertyType);
+ if (value.isPresent()) {
+ return value.get();
+ }
+ }
+ }
+ }
+
+ // 3. and 4.
+ return valueFromAnnotation.orElseGet(defaultValue);
+ }
+
+ private Optional<KeyStoreConfig> getKeyStore(String configLocation, String configType, String configPassword) {
+ String keyStoreLocation = getConfigOption(String.class, configLocation).orElse(null);
+ if (keyStoreLocation == null) {
+ return Optional.empty();
+ }
+
+ String keyStoreType = getConfigOption(String.class, configType).orElse(DEFAULT_KEYSTORE_TYPE);
+ String password = getConfigOption(String.class, configPassword).orElse(null);
+
+ KeyStore keyStore;
+ try {
+ keyStore = KeyStore.getInstance(keyStoreType);
+ } catch (KeyStoreException e) {
+ throw new IllegalStateException("Failed to create keystore of type: " + keyStoreType + " for " + interfaceType, e);
+ }
+
+ try (InputStream storeStream = locationToStream(keyStoreLocation)) {
+ keyStore.load(storeStream, password.toCharArray());
+ } catch (IOException | NoSuchAlgorithmException | CertificateException e) {
+ throw new IllegalStateException("Failed to load keystore from " + keyStoreLocation, e);
+ }
+
+ return Optional.of(new KeyStoreConfig(keyStore, password));
+ }
+
+ private InputStream locationToStream(String location) throws IOException {
+ // location in config has two flavors:
+ // file:/home/user/some.jks
+ // classpath:/client-keystore.jks
+
+ if (location.startsWith(CLASSPATH_LOCATION)) {
+ String resource = location.substring(CLASSPATH_LOCATION.length());
+ // first try to read from teh same classloader as the rest client interface
+ InputStream result = interfaceType.getResourceAsStream(resource);
+ if (null == result) {
+ // and if not found, use the context classloader (for example in TCK, this is needed)
+ result = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
+ }
+ return result;
+ } else if (location.startsWith(FILE_LOCATION)) {
+ return Files.newInputStream(Paths.get(URI.create(location)));
+ } else {
+ throw new IllegalStateException("Location of keystore must start with either classpath: or file:, but is: "
+ + location
+ + " for "
+ + interfaceType);
+ }
+ }
+
+ private Optional<HostnameVerifier> getHostnameVerifier() {
+ Optional<String> verifier = getConfigOption(String.class, CONFIG_SSL_HOSTNAME_VERIFIER);
+
+ return verifier.map(className -> {
+ Class<? extends HostnameVerifier> theClass =
+ AccessController.doPrivileged(ReflectionHelper.classForNamePA(className));
+ if (theClass == null) {
+ throw new IllegalStateException("Invalid hostname verifier class: " + className);
+ }
+
+ return ReflectionUtil.createInstance(theClass);
+ });
+ }
+
+ private static Class<? extends Annotation> resolveClientScope(Class<?> interfaceType,
+ BeanManager beanManager,
+ Config config,
+ String fqcn,
+ Optional<String> configKey) {
+
+ String configuredScope = getOption(config,
+ fqcn,
+ configKey,
+ Optional.empty(),
+ () -> null,
+ String.class,
+ CONFIG_SCOPE);
+
+ if (configuredScope != null) {
+ Class<Annotation> scope = AccessController.doPrivileged(ReflectionHelper.classForNamePA(configuredScope));
+ if (scope == null) {
+ throw new IllegalStateException("Invalid scope from config: " + configuredScope);
+ }
+ return scope;
+ }
+
+ List<Annotation> possibleScopes = Arrays.stream(interfaceType.getDeclaredAnnotations())
+ .filter(annotation -> beanManager.isScope(annotation.annotationType()))
+ .collect(Collectors.toList());
+
+ if (possibleScopes.size() == 1) {
+ return possibleScopes.get(0).annotationType();
+ } else if (possibleScopes.isEmpty()) {
+ return Dependent.class;
+ } else {
+ throw new IllegalArgumentException("Client should have only one scope defined: "
+ + interfaceType + " has " + possibleScopes);
+ }
+ }
+
+ private static final class KeyStoreConfig {
+ private final KeyStore keyStore;
+ private final String password;
+
+ private KeyStoreConfig(KeyStore keyStore, String password) {
+ this.keyStore = keyStore;
+ this.password = password;
+ }
+ }
+}
diff --git a/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100644
index 0000000..bca39a9
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2019 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
+#
+
+org.glassfish.jersey.microprofile.restclient.RestClientExtension
\ No newline at end of file
diff --git a/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver b/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver
new file mode 100644
index 0000000..e23142f
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2019 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
+#
+
+org.glassfish.jersey.microprofile.restclient.JerseyRestClientBuilderResolver
\ No newline at end of file
diff --git a/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/org.glassfish.jersey.internal.spi.ForcedAutoDiscoverable b/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/org.glassfish.jersey.internal.spi.ForcedAutoDiscoverable
new file mode 100644
index 0000000..d9a1262
--- /dev/null
+++ b/ext/microprofile/mp-rest-client/src/main/resources/META-INF/services/org.glassfish.jersey.internal.spi.ForcedAutoDiscoverable
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2019 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
+#
+
+org.glassfish.jersey.microprofile.restclient.RequestHeaderAutoDiscoverable
\ No newline at end of file
diff --git a/ext/microprofile/pom.xml b/ext/microprofile/pom.xml
new file mode 100644
index 0000000..29e579d
--- /dev/null
+++ b/ext/microprofile/pom.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>project</artifactId>
+ <groupId>org.glassfish.jersey.ext</groupId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.glassfish.jersey.ext.microprofile</groupId>
+ <artifactId>project</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>mp-rest-client</module>
+ <module>mp-config</module>
+ </modules>
+
+
+</project>
diff --git a/ext/mvc-bean-validation/pom.xml b/ext/mvc-bean-validation/pom.xml
index 333214d..d704a3a 100644
--- a/ext/mvc-bean-validation/pom.xml
+++ b/ext/mvc-bean-validation/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-mvc-bean-validation</artifactId>
diff --git a/ext/mvc-freemarker/pom.xml b/ext/mvc-freemarker/pom.xml
index c40e070..bff85b4 100644
--- a/ext/mvc-freemarker/pom.xml
+++ b/ext/mvc-freemarker/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-mvc-freemarker</artifactId>
diff --git a/ext/mvc-freemarker/src/main/java/org/glassfish/jersey/server/mvc/freemarker/FreemarkerViewProcessor.java b/ext/mvc-freemarker/src/main/java/org/glassfish/jersey/server/mvc/freemarker/FreemarkerViewProcessor.java
index 164f4ab..37f2811 100644
--- a/ext/mvc-freemarker/src/main/java/org/glassfish/jersey/server/mvc/freemarker/FreemarkerViewProcessor.java
+++ b/ext/mvc-freemarker/src/main/java/org/glassfish/jersey/server/mvc/freemarker/FreemarkerViewProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -43,7 +43,7 @@
/**
* {@link org.glassfish.jersey.server.mvc.spi.TemplateProcessor Template processor} providing support for Freemarker templates.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
* @author Jeff Wilde (jeff.wilde at complicatedrobot.com)
*/
diff --git a/ext/mvc-jsp/pom.xml b/ext/mvc-jsp/pom.xml
index c122749..01f6823 100644
--- a/ext/mvc-jsp/pom.xml
+++ b/ext/mvc-jsp/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-mvc-jsp</artifactId>
diff --git a/ext/mvc-mustache/pom.xml b/ext/mvc-mustache/pom.xml
index ee5f5cf..6fbf34f 100644
--- a/ext/mvc-mustache/pom.xml
+++ b/ext/mvc-mustache/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-mvc-mustache</artifactId>
diff --git a/ext/mvc/pom.xml b/ext/mvc/pom.xml
index 8d84a6f..59a3a5e 100644
--- a/ext/mvc/pom.xml
+++ b/ext/mvc/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-mvc</artifactId>
@@ -67,7 +67,7 @@
<configuration>
<instructions>
<Export-Package>org.glassfish.jersey.server.mvc.*;version=${project.version}</Export-Package>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>${javax.annotation.osgi.version},*</Import-Package>
</instructions>
<unpackBundle>true</unpackBundle>
</configuration>
diff --git a/ext/mvc/src/main/java/org/glassfish/jersey/server/mvc/spi/AbstractTemplateProcessor.java b/ext/mvc/src/main/java/org/glassfish/jersey/server/mvc/spi/AbstractTemplateProcessor.java
index 049ea9a..55d67c2 100644
--- a/ext/mvc/src/main/java/org/glassfish/jersey/server/mvc/spi/AbstractTemplateProcessor.java
+++ b/ext/mvc/src/main/java/org/glassfish/jersey/server/mvc/spi/AbstractTemplateProcessor.java
@@ -30,6 +30,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;
import java.util.logging.Level;
@@ -45,7 +46,6 @@
import org.glassfish.jersey.internal.util.PropertiesHelper;
import org.glassfish.jersey.internal.util.ReflectionHelper;
-import org.glassfish.jersey.internal.util.collection.DataStructures;
import org.glassfish.jersey.internal.util.collection.Value;
import org.glassfish.jersey.server.mvc.MvcFeature;
import org.glassfish.jersey.server.mvc.internal.LocalizationMessages;
@@ -116,7 +116,7 @@
if (cacheEnabled == null) {
cacheEnabled = PropertiesHelper.getValue(properties, MvcFeature.CACHE_TEMPLATES, false, null);
}
- this.cache = cacheEnabled ? DataStructures.<String, T>createConcurrentMap() : null;
+ this.cache = cacheEnabled ? new ConcurrentHashMap<>() : null;
this.encoding = TemplateHelper.getTemplateOutputEncoding(config, suffix);
}
diff --git a/ext/pom.xml b/ext/pom.xml
index 0fe2582..2a2d965 100644
--- a/ext/pom.xml
+++ b/ext/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.ext</groupId>
@@ -53,7 +53,9 @@
<module>rx</module>
<module>servlet-portability</module>
<module>spring4</module>
+ <module>spring5</module>
<module>wadl-doclet</module>
+ <module>microprofile</module>
</modules>
<dependencies>
diff --git a/ext/proxy-client/pom.xml b/ext/proxy-client/pom.xml
index 91c3c01..7de33b7 100644
--- a/ext/proxy-client/pom.xml
+++ b/ext/proxy-client/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-proxy-client</artifactId>
@@ -68,4 +68,20 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
diff --git a/ext/rx/pom.xml b/ext/rx/pom.xml
index 5df6635..f7ad459 100644
--- a/ext/rx/pom.xml
+++ b/ext/rx/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.ext.rx</groupId>
diff --git a/ext/rx/rx-client-guava/pom.xml b/ext/rx/rx-client-guava/pom.xml
index fa89dc8..a1de10b 100644
--- a/ext/rx/rx-client-guava/pom.xml
+++ b/ext/rx/rx-client-guava/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.rx</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-rx-client-guava</artifactId>
diff --git a/ext/rx/rx-client-guava/src/main/java/org/glassfish/jersey/client/rx/guava/JerseyRxListenableFutureInvoker.java b/ext/rx/rx-client-guava/src/main/java/org/glassfish/jersey/client/rx/guava/JerseyRxListenableFutureInvoker.java
index bb7a98a..c103db6 100644
--- a/ext/rx/rx-client-guava/src/main/java/org/glassfish/jersey/client/rx/guava/JerseyRxListenableFutureInvoker.java
+++ b/ext/rx/rx-client-guava/src/main/java/org/glassfish/jersey/client/rx/guava/JerseyRxListenableFutureInvoker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -35,7 +35,7 @@
* Implementation of Reactive Invoker for {@code ListenableFuture}.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @since 2.13
*/
final class JerseyRxListenableFutureInvoker extends AbstractRxInvoker<ListenableFuture> implements RxListenableFutureInvoker {
diff --git a/ext/rx/rx-client-guava/src/main/java/org/glassfish/jersey/client/rx/guava/RxListenableFutureInvokerProvider.java b/ext/rx/rx-client-guava/src/main/java/org/glassfish/jersey/client/rx/guava/RxListenableFutureInvokerProvider.java
index ac97dd8..507c725 100644
--- a/ext/rx/rx-client-guava/src/main/java/org/glassfish/jersey/client/rx/guava/RxListenableFutureInvokerProvider.java
+++ b/ext/rx/rx-client-guava/src/main/java/org/glassfish/jersey/client/rx/guava/RxListenableFutureInvokerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
* Invoker provider for invokers based on Guava's {@code ListenableFuture}.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @since 2.13
*/
public final class RxListenableFutureInvokerProvider implements RxInvokerProvider<RxListenableFutureInvoker> {
diff --git a/ext/rx/rx-client-rxjava/pom.xml b/ext/rx/rx-client-rxjava/pom.xml
index 0dcb7c4..7cc84bf 100644
--- a/ext/rx/rx-client-rxjava/pom.xml
+++ b/ext/rx/rx-client-rxjava/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.rx</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-rx-client-rxjava</artifactId>
diff --git a/ext/rx/rx-client-rxjava/src/main/java/org/glassfish/jersey/client/rx/rxjava/RxObservableInvokerProvider.java b/ext/rx/rx-client-rxjava/src/main/java/org/glassfish/jersey/client/rx/rxjava/RxObservableInvokerProvider.java
index 05591ec..36dc299 100644
--- a/ext/rx/rx-client-rxjava/src/main/java/org/glassfish/jersey/client/rx/rxjava/RxObservableInvokerProvider.java
+++ b/ext/rx/rx-client-rxjava/src/main/java/org/glassfish/jersey/client/rx/rxjava/RxObservableInvokerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
* Invoker provider for invokers based on RxJava's {@code Observable}.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @since 2.13
*/
public final class RxObservableInvokerProvider implements RxInvokerProvider<RxObservableInvoker> {
diff --git a/ext/rx/rx-client-rxjava/src/test/java/org/glassfish/jersey/client/rx/rxjava/RxObservableTest.java b/ext/rx/rx-client-rxjava/src/test/java/org/glassfish/jersey/client/rx/rxjava/RxObservableTest.java
index 3ca121f..0a6644b 100644
--- a/ext/rx/rx-client-rxjava/src/test/java/org/glassfish/jersey/client/rx/rxjava/RxObservableTest.java
+++ b/ext/rx/rx-client-rxjava/src/test/java/org/glassfish/jersey/client/rx/rxjava/RxObservableTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -41,7 +41,7 @@
/**
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class RxObservableTest {
diff --git a/ext/rx/rx-client-rxjava2/pom.xml b/ext/rx/rx-client-rxjava2/pom.xml
index 56ab7f6..c489fb0 100644
--- a/ext/rx/rx-client-rxjava2/pom.xml
+++ b/ext/rx/rx-client-rxjava2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.ext.rx</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-rx-client-rxjava2</artifactId>
diff --git a/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/JerseyRxFlowableInvoker.java b/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/JerseyRxFlowableInvoker.java
index e357319..0b891a3 100644
--- a/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/JerseyRxFlowableInvoker.java
+++ b/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/JerseyRxFlowableInvoker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -37,7 +37,7 @@
* provided on from this service.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @since 2.16
*/
final class JerseyRxFlowableInvoker extends AbstractRxInvoker<Flowable> implements RxFlowableInvoker {
diff --git a/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableInvoker.java b/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableInvoker.java
index ac9026c..b8e9cab 100644
--- a/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableInvoker.java
+++ b/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableInvoker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -30,7 +30,7 @@
* Requests are by default invoked on a separate thread (as JAX-RS Async client requests). This behavior can be overridden by
* providing a {@link java.util.concurrent.ExecutorService executor service} when client extension is being created.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
* @since 2.26
*/
diff --git a/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableInvokerProvider.java b/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableInvokerProvider.java
index fca6e80..76634ee 100644
--- a/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableInvokerProvider.java
+++ b/ext/rx/rx-client-rxjava2/src/main/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableInvokerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -26,7 +26,7 @@
* Invoker provider for invokers based on RxJava's {@code Flowable}.
*
* @author Michal Gajdos
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @since 2.26
*/
public class RxFlowableInvokerProvider implements RxInvokerProvider<RxFlowableInvoker> {
diff --git a/ext/rx/rx-client-rxjava2/src/test/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableTest.java b/ext/rx/rx-client-rxjava2/src/test/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableTest.java
index b5a72b0..9151f0f 100644
--- a/ext/rx/rx-client-rxjava2/src/test/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableTest.java
+++ b/ext/rx/rx-client-rxjava2/src/test/java/org/glassfish/jersey/client/rx/rxjava2/RxFlowableTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -40,7 +40,7 @@
import static org.hamcrest.core.Is.is;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class RxFlowableTest {
diff --git a/ext/servlet-portability/pom.xml b/ext/servlet-portability/pom.xml
index eaaead1..ecbb40e 100644
--- a/ext/servlet-portability/pom.xml
+++ b/ext/servlet-portability/pom.xml
@@ -23,7 +23,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.ext</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-servlet-portability</artifactId>
diff --git a/ext/spring3/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java b/ext/spring3/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
index 6da105f..e4d939a 100644
--- a/ext/spring3/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
+++ b/ext/spring3/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS based Spring RequestAttributes implementation for Servlet-based applications.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class JaxrsServletRequestAttributes extends ServletRequestAttributes {
diff --git a/ext/spring4/pom.xml b/ext/spring4/pom.xml
index e3bf6ea..ba69854 100644
--- a/ext/spring4/pom.xml
+++ b/ext/spring4/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-spring4</artifactId>
@@ -150,10 +150,6 @@
</dependencies>
- <properties>
- <spring4.version>4.3.8.RELEASE</spring4.version>
- </properties>
-
<build>
<plugins>
<plugin>
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java
index 19f45b3..018de18 100644
--- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java
+++ b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java
@@ -34,6 +34,7 @@
import org.jvnet.hk2.spring.bridge.api.SpringIntoHK2Bridge;
import org.springframework.aop.framework.Advised;
+import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.annotation.AnnotationUtils;
@@ -102,7 +103,7 @@
}
if (AnnotationUtils.findAnnotation(component, Component.class) != null) {
- String[] beanNames = ctx.getBeanNamesForType(component);
+ String[] beanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ctx, component);
if (beanNames == null || beanNames.length != 1) {
LOGGER.severe(LocalizationMessages.NONE_OR_MULTIPLE_BEANS_AVAILABLE(component));
return false;
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java
index c1eb321..9b73eea 100644
--- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java
+++ b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
* JAX-RS based Spring RequestAttributes implementation.
*
* @author Marko Asplund (marko.asplund at yahoo.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class JaxrsRequestAttributes extends AbstractRequestAttributes {
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
index 6da105f..e4d939a 100644
--- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
+++ b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS based Spring RequestAttributes implementation for Servlet-based applications.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class JaxrsServletRequestAttributes extends ServletRequestAttributes {
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java
index 1cbcbd7..5ad00d6 100644
--- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java
+++ b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -40,8 +40,8 @@
* Spring filter to provide a bridge between JAX-RS and Spring request attributes.
*
* @author Marko Asplund (marko.asplund at yahoo.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
@Provider
@PreMatching
diff --git a/ext/spring5/pom.xml b/ext/spring5/pom.xml
new file mode 100644
index 0000000..29fec65
--- /dev/null
+++ b/ext/spring5/pom.xml
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2012, 2019 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
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.glassfish.jersey.ext</groupId>
+ <artifactId>project</artifactId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>jersey-spring5</artifactId>
+ <name>jersey-spring5</name>
+
+ <packaging>jar</packaging>
+
+ <description>
+ Jersey extension module providing support for Spring 5 integration.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-server</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-servlet-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.hk2</groupId>
+ <artifactId>hk2</artifactId>
+ <version>${hk2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.hk2</groupId>
+ <artifactId>spring-bridge</artifactId>
+ <version>${hk2.version}</version>
+ <exclusions>
+ <exclusion> <!-- already pulled in by jersey-server -->
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.glassfish.hk2</groupId>
+ <artifactId>hk2-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring5.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring5.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring5.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <version>${spring5.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
+ <version>${servlet4.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.6.11</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.sun.istack</groupId>
+ <artifactId>istack-commons-maven-plugin</artifactId>
+ <inherited>true</inherited>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <inherited>true</inherited>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>delayed-strategy-skip-test</id>
+ <activation>
+ <property>
+ <name>org.glassfish.jersey.injection.manager.strategy</name>
+ <value>delayed</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java
new file mode 100644
index 0000000..2fe45a2
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2013, 2019 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.server.spring;
+
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import javax.inject.Singleton;
+
+import org.glassfish.jersey.internal.inject.Injectee;
+import org.glassfish.jersey.internal.inject.InjectionResolver;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.config.DependencyDescriptor;
+import org.springframework.context.ApplicationContext;
+import org.springframework.core.MethodParameter;
+
+/**
+ * HK2 injection resolver for Spring framework {@link Autowired} annotation injection.
+ *
+ * @author Marko Asplund (marko.asplund at yahoo.com)
+ * @author Vetle Leinonen-Roeim (vetle at roeim.net)
+ */
+@Singleton
+public class AutowiredInjectResolver implements InjectionResolver<Autowired> {
+
+ private static final Logger LOGGER = Logger.getLogger(AutowiredInjectResolver.class.getName());
+
+ private volatile ApplicationContext ctx;
+
+ /**
+ * Create a new instance.
+ *
+ * @param ctx Spring application context.
+ */
+ public AutowiredInjectResolver(ApplicationContext ctx) {
+ this.ctx = ctx;
+ }
+
+ @Override
+ public Object resolve(Injectee injectee) {
+ AnnotatedElement parent = injectee.getParent();
+ String beanName = null;
+ if (parent != null) {
+ Qualifier an = parent.getAnnotation(Qualifier.class);
+ if (an != null) {
+ beanName = an.value();
+ }
+ }
+ boolean required = parent != null ? parent.getAnnotation(Autowired.class).required() : false;
+ return getBeanFromSpringContext(beanName, injectee, required);
+ }
+
+ private Object getBeanFromSpringContext(String beanName, Injectee injectee, final boolean required) {
+ try {
+ DependencyDescriptor dependencyDescriptor = createSpringDependencyDescriptor(injectee);
+ Set<String> autowiredBeanNames = new HashSet<>(1);
+ autowiredBeanNames.add(beanName);
+ return ctx.getAutowireCapableBeanFactory().resolveDependency(dependencyDescriptor, null,
+ autowiredBeanNames, null);
+ } catch (BeansException e) {
+ if (required) {
+ LOGGER.warning(e.getMessage());
+ throw e;
+ }
+ return null;
+ }
+ }
+
+ private DependencyDescriptor createSpringDependencyDescriptor(final Injectee injectee) {
+ AnnotatedElement annotatedElement = injectee.getParent();
+
+ if (annotatedElement.getClass().isAssignableFrom(Field.class)) {
+ return new DependencyDescriptor((Field) annotatedElement, !injectee.isOptional());
+ } else if (annotatedElement.getClass().isAssignableFrom(Method.class)) {
+ return new DependencyDescriptor(
+ new MethodParameter((Method) annotatedElement, injectee.getPosition()), !injectee.isOptional());
+ } else {
+ return new DependencyDescriptor(
+ new MethodParameter((Constructor) annotatedElement, injectee.getPosition()), !injectee.isOptional());
+ }
+ }
+
+ @Override
+ public boolean isConstructorParameterIndicator() {
+ return false;
+ }
+
+ @Override
+ public boolean isMethodParameterIndicator() {
+ return false;
+ }
+
+ @Override
+ public Class<Autowired> getAnnotation() {
+ return Autowired.class;
+ }
+}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java
new file mode 100644
index 0000000..d7f2f92
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2013, 2019 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.server.spring;
+
+import java.util.Set;
+import java.util.function.Supplier;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.ServletContext;
+
+import org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager;
+import org.glassfish.jersey.internal.inject.Binding;
+import org.glassfish.jersey.internal.inject.Bindings;
+import org.glassfish.jersey.internal.inject.InjectionManager;
+import org.glassfish.jersey.server.ApplicationHandler;
+import org.glassfish.jersey.server.spi.ComponentProvider;
+
+import org.jvnet.hk2.spring.bridge.api.SpringBridge;
+import org.jvnet.hk2.spring.bridge.api.SpringIntoHK2Bridge;
+
+import org.springframework.aop.framework.Advised;
+import org.springframework.beans.factory.BeanFactoryUtils;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.core.annotation.AnnotationUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Custom ComponentProvider class.
+ * Responsible for 1) bootstrapping Jersey 2 Spring integration and
+ * 2) making Jersey skip JAX-RS Spring component life-cycle management and leave it to us.
+ *
+ * @author Marko Asplund (marko.asplund at yahoo.com)
+ */
+public class SpringComponentProvider implements ComponentProvider {
+
+ private static final Logger LOGGER = Logger.getLogger(SpringComponentProvider.class.getName());
+ private static final String DEFAULT_CONTEXT_CONFIG_LOCATION = "applicationContext.xml";
+ private static final String PARAM_CONTEXT_CONFIG_LOCATION = "contextConfigLocation";
+ private static final String PARAM_SPRING_CONTEXT = "contextConfig";
+
+ private volatile InjectionManager injectionManager;
+ private volatile ApplicationContext ctx;
+
+ @Override
+ public void initialize(InjectionManager injectionManager) {
+ this.injectionManager = injectionManager;
+
+ if (LOGGER.isLoggable(Level.FINE)) {
+ LOGGER.fine(LocalizationMessages.CTX_LOOKUP_STARTED());
+ }
+
+ ServletContext sc = injectionManager.getInstance(ServletContext.class);
+
+ if (sc != null) {
+ // servlet container
+ ctx = WebApplicationContextUtils.getWebApplicationContext(sc);
+ } else {
+ // non-servlet container
+ ctx = createSpringContext();
+ }
+ if (ctx == null) {
+ LOGGER.severe(LocalizationMessages.CTX_LOOKUP_FAILED());
+ return;
+ }
+ LOGGER.config(LocalizationMessages.CTX_LOOKUP_SUCESSFUL());
+
+ // initialize HK2 spring-bridge
+
+ ImmediateHk2InjectionManager hk2InjectionManager = (ImmediateHk2InjectionManager) injectionManager;
+ SpringBridge.getSpringBridge().initializeSpringBridge(hk2InjectionManager.getServiceLocator());
+ SpringIntoHK2Bridge springBridge = injectionManager.getInstance(SpringIntoHK2Bridge.class);
+ springBridge.bridgeSpringBeanFactory(ctx);
+
+ injectionManager.register(Bindings.injectionResolver(new AutowiredInjectResolver(ctx)));
+ injectionManager.register(Bindings.service(ctx).to(ApplicationContext.class).named("SpringContext"));
+ LOGGER.config(LocalizationMessages.SPRING_COMPONENT_PROVIDER_INITIALIZED());
+ }
+
+ // detect JAX-RS classes that are also Spring @Components.
+ // register these with HK2 ServiceLocator to manage their lifecycle using Spring.
+ @Override
+ public boolean bind(Class<?> component, Set<Class<?>> providerContracts) {
+
+ if (ctx == null) {
+ return false;
+ }
+
+ if (AnnotationUtils.findAnnotation(component, Component.class) != null) {
+ String[] beanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ctx, component);
+ if (beanNames == null || beanNames.length != 1) {
+ LOGGER.severe(LocalizationMessages.NONE_OR_MULTIPLE_BEANS_AVAILABLE(component));
+ return false;
+ }
+ String beanName = beanNames[0];
+
+ Binding binding = Bindings.supplier(new SpringManagedBeanFactory(ctx, injectionManager, beanName))
+ .to(component)
+ .to(providerContracts);
+ injectionManager.register(binding);
+
+ LOGGER.config(LocalizationMessages.BEAN_REGISTERED(beanNames[0]));
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void done() {
+ }
+
+ private ApplicationContext createSpringContext() {
+ ApplicationHandler applicationHandler = injectionManager.getInstance(ApplicationHandler.class);
+ ApplicationContext springContext = (ApplicationContext) applicationHandler.getConfiguration()
+ .getProperty(PARAM_SPRING_CONTEXT);
+ if (springContext == null) {
+ String contextConfigLocation = (String) applicationHandler.getConfiguration()
+ .getProperty(PARAM_CONTEXT_CONFIG_LOCATION);
+ springContext = createXmlSpringConfiguration(contextConfigLocation);
+ }
+ return springContext;
+ }
+
+ private ApplicationContext createXmlSpringConfiguration(String contextConfigLocation) {
+ if (contextConfigLocation == null) {
+ contextConfigLocation = DEFAULT_CONTEXT_CONFIG_LOCATION;
+ }
+ return ctx = new ClassPathXmlApplicationContext(contextConfigLocation, "jersey-spring-applicationContext.xml");
+ }
+
+ private static class SpringManagedBeanFactory implements Supplier {
+
+ private final ApplicationContext ctx;
+ private final InjectionManager injectionManager;
+ private final String beanName;
+
+ private SpringManagedBeanFactory(ApplicationContext ctx, InjectionManager injectionManager, String beanName) {
+ this.ctx = ctx;
+ this.injectionManager = injectionManager;
+ this.beanName = beanName;
+ }
+
+ @Override
+ public Object get() {
+ Object bean = ctx.getBean(beanName);
+ if (bean instanceof Advised) {
+ try {
+ // Unwrap the bean and inject the values inside of it
+ Object localBean = ((Advised) bean).getTargetSource().getTarget();
+ injectionManager.inject(localBean);
+ } catch (Exception e) {
+ // Ignore and let the injection happen as it normally would.
+ injectionManager.inject(bean);
+ }
+ } else {
+ injectionManager.inject(bean);
+ }
+ return bean;
+ }
+ }
+}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java
new file mode 100644
index 0000000..39d3d37
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2013, 2019 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.server.spring;
+
+import javax.ws.rs.ext.Provider;
+
+import javax.inject.Inject;
+
+import org.glassfish.jersey.server.spi.Container;
+import org.glassfish.jersey.server.spi.ContainerLifecycleListener;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ConfigurableApplicationContext;
+
+/**
+ * JAX-RS Provider class for processing Jersey 2 Spring integration container life-cycle events.
+ *
+ * @author Marko Asplund (marko.asplund at yahoo.com)
+ */
+@Provider
+public class SpringLifecycleListener implements ContainerLifecycleListener {
+
+ @Inject
+ private ApplicationContext ctx;
+
+ @Override
+ public void onStartup(Container container) {
+ }
+
+ @Override
+ public void onReload(Container container) {
+ if (ctx instanceof ConfigurableApplicationContext) {
+ ((ConfigurableApplicationContext) ctx).refresh();
+ }
+ }
+
+ @Override
+ public void onShutdown(Container container) {
+ if (ctx instanceof ConfigurableApplicationContext) {
+ ((ConfigurableApplicationContext) ctx).close();
+ }
+ }
+}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java
new file mode 100644
index 0000000..1b18f84
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, 2019 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.server.spring;
+
+import java.util.logging.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import org.springframework.web.WebApplicationInitializer;
+
+/**
+ * Spring WebApplicationInitializer implementation initializes Spring context by
+ * adding a Spring ContextLoaderListener to the ServletContext.
+ *
+ * @author Marko Asplund (marko.asplund at yahoo.com)
+ */
+public class SpringWebApplicationInitializer implements WebApplicationInitializer {
+
+ private static final Logger LOGGER = Logger.getLogger(SpringWebApplicationInitializer.class.getName());
+
+ private static final String PAR_NAME_CTX_CONFIG_LOCATION = "contextConfigLocation";
+
+ @Override
+ public void onStartup(ServletContext sc) throws ServletException {
+ if (sc.getInitParameter(PAR_NAME_CTX_CONFIG_LOCATION) == null) {
+ LOGGER.config(LocalizationMessages.REGISTERING_CTX_LOADER_LISTENER());
+ sc.setInitParameter(PAR_NAME_CTX_CONFIG_LOCATION, "classpath:applicationContext.xml");
+ sc.addListener("org.springframework.web.context.ContextLoaderListener");
+ sc.addListener("org.springframework.web.context.request.RequestContextListener");
+ } else {
+ LOGGER.config(LocalizationMessages.SKIPPING_CTX_LODAER_LISTENER_REGISTRATION());
+ }
+ }
+}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/package-info.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/package-info.java
new file mode 100644
index 0000000..6e7b71a
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2013, 2019 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
+ */
+
+/**
+ * Jersey server-side Spring 5 integration classes.
+ * @since 2.29
+ */
+package org.glassfish.jersey.server.spring;
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java
new file mode 100644
index 0000000..9b73eea
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, 2019 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.server.spring.scope;
+
+import javax.ws.rs.container.ContainerRequestContext;
+
+import org.glassfish.jersey.server.spring.LocalizationMessages;
+import org.springframework.util.StringUtils;
+import org.springframework.web.context.request.AbstractRequestAttributes;
+
+/**
+ * JAX-RS based Spring RequestAttributes implementation.
+ *
+ * @author Marko Asplund (marko.asplund at yahoo.com)
+ * @author Marek Potociar
+ */
+class JaxrsRequestAttributes extends AbstractRequestAttributes {
+
+ private final ContainerRequestContext requestContext;
+
+ /**
+ * Create a new instance.
+ *
+ * @param requestContext JAX-RS container request context
+ */
+ public JaxrsRequestAttributes(ContainerRequestContext requestContext) {
+ this.requestContext = requestContext;
+ }
+
+ @Override
+ protected void updateAccessedSessionAttributes() {
+ // sessions not supported
+ }
+
+ @Override
+ public Object getAttribute(String name, int scope) {
+ return requestContext.getProperty(name);
+ }
+
+ @Override
+ public void setAttribute(String name, Object value, int scope) {
+ requestContext.setProperty(name, value);
+ }
+
+ @Override
+ public void removeAttribute(String name, int scope) {
+ requestContext.removeProperty(name);
+ }
+
+ @Override
+ public String[] getAttributeNames(int scope) {
+ if (!isRequestActive()) {
+ throw new IllegalStateException(LocalizationMessages.NOT_IN_REQUEST_SCOPE());
+ }
+ return StringUtils.toStringArray(requestContext.getPropertyNames());
+ }
+
+ @Override
+ public void registerDestructionCallback(String name, Runnable callback, int scope) {
+ registerRequestDestructionCallback(name, callback);
+ }
+
+ @Override
+ public Object resolveReference(String key) {
+ if (REFERENCE_REQUEST.equals(key)) {
+ return requestContext;
+ }
+ return null;
+ }
+
+ @Override
+ public String getSessionId() {
+ return null;
+ }
+
+ @Override
+ public Object getSessionMutex() {
+ return null;
+ }
+}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
new file mode 100644
index 0000000..066a276
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016, 2019 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.server.spring.scope;
+
+import javax.ws.rs.container.ContainerRequestContext;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+/**
+ * JAX-RS based Spring RequestAttributes implementation for Servlet-based applications.
+ *
+ * @author Marek Potociar
+ */
+class JaxrsServletRequestAttributes extends ServletRequestAttributes {
+
+ private final ContainerRequestContext requestContext;
+
+ /**
+ * Create a new JAX-RS ServletRequestAttributes instance for the given request.
+ *
+ * @param request current HTTP request
+ * @param requestContext JAX-RS request context
+ */
+ public JaxrsServletRequestAttributes(final HttpServletRequest request, final ContainerRequestContext requestContext) {
+ super(request);
+ this.requestContext = requestContext;
+ }
+
+ @Override
+ public Object resolveReference(String key) {
+ if (REFERENCE_REQUEST.equals(key)) {
+ return this.requestContext;
+ } else if (REFERENCE_SESSION.equals(key)) {
+ return super.getSession(true);
+ } else {
+ return null;
+ }
+ }
+}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java
new file mode 100644
index 0000000..5ad00d6
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2013, 2019 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.server.spring.scope;
+
+import java.io.IOException;
+
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.container.PreMatching;
+import javax.ws.rs.ext.Provider;
+
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+
+import org.glassfish.jersey.internal.inject.InjectionManager;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.request.AbstractRequestAttributes;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+
+/**
+ * Spring filter to provide a bridge between JAX-RS and Spring request attributes.
+ *
+ * @author Marko Asplund (marko.asplund at yahoo.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
+ */
+@Provider
+@PreMatching
+public final class RequestContextFilter implements ContainerRequestFilter, ContainerResponseFilter {
+
+ private static final String REQUEST_ATTRIBUTES_PROPERTY = RequestContextFilter.class.getName() + ".REQUEST_ATTRIBUTES";
+
+ private final SpringAttributeController attributeController;
+
+ private static final SpringAttributeController EMPTY_ATTRIBUTE_CONTROLLER = new SpringAttributeController() {
+ @Override
+ public void setAttributes(final ContainerRequestContext requestContext) {
+ }
+
+ @Override
+ public void resetAttributes(final ContainerRequestContext requestContext) {
+ }
+ };
+
+ private interface SpringAttributeController {
+
+ void setAttributes(final ContainerRequestContext requestContext);
+
+ void resetAttributes(final ContainerRequestContext requestContext);
+ }
+
+ /**
+ * Create a new request context filter instance.
+ *
+ * @param injectionManager injection manager.
+ */
+ @Inject
+ public RequestContextFilter(final InjectionManager injectionManager) {
+ final ApplicationContext appCtx = injectionManager.getInstance(ApplicationContext.class);
+ final boolean isWebApp = appCtx instanceof WebApplicationContext;
+
+ attributeController = appCtx != null ? new SpringAttributeController() {
+
+ @Override
+ public void setAttributes(final ContainerRequestContext requestContext) {
+ final RequestAttributes attributes;
+ if (isWebApp) {
+ final HttpServletRequest httpRequest = injectionManager.getInstance(HttpServletRequest.class);
+ attributes = new JaxrsServletRequestAttributes(httpRequest, requestContext);
+ } else {
+ attributes = new JaxrsRequestAttributes(requestContext);
+ }
+ requestContext.setProperty(REQUEST_ATTRIBUTES_PROPERTY, attributes);
+ RequestContextHolder.setRequestAttributes(attributes);
+ }
+
+ @Override
+ public void resetAttributes(final ContainerRequestContext requestContext) {
+ final AbstractRequestAttributes attributes =
+ (AbstractRequestAttributes) requestContext.getProperty(REQUEST_ATTRIBUTES_PROPERTY);
+ RequestContextHolder.resetRequestAttributes();
+ attributes.requestCompleted();
+ }
+ } : EMPTY_ATTRIBUTE_CONTROLLER;
+ }
+
+ @Override
+ public void filter(final ContainerRequestContext requestContext) throws IOException {
+ attributeController.setAttributes(requestContext);
+ }
+
+ @Override
+ public void filter(final ContainerRequestContext requestContext, final ContainerResponseContext responseContext)
+ throws IOException {
+ attributeController.resetAttributes(requestContext);
+ }
+}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java
new file mode 100644
index 0000000..49985aa
--- /dev/null
+++ b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2013, 2019 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
+ */
+
+/**
+ * Jersey server-side Spring 5 integration injection scopes related classes.
+ * @since 2.29
+ */
+package org.glassfish.jersey.server.spring.scope;
diff --git a/ext/spring5/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider b/ext/spring5/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider
new file mode 100644
index 0000000..5aec207
--- /dev/null
+++ b/ext/spring5/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider
@@ -0,0 +1 @@
+org.glassfish.jersey.server.spring.SpringComponentProvider
diff --git a/ext/spring5/src/main/resources/jersey-spring-applicationContext.xml b/ext/spring5/src/main/resources/jersey-spring-applicationContext.xml
new file mode 100644
index 0000000..fd6f528
--- /dev/null
+++ b/ext/spring5/src/main/resources/jersey-spring-applicationContext.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2013, 2019 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
+
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+ <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
+ <property name="scopes">
+ <map>
+ <entry key="request">
+ <bean class="org.springframework.web.context.request.RequestScope"/>
+ </entry>
+ </map>
+ </property>
+ </bean>
+</beans>
diff --git a/ext/spring5/src/main/resources/org/glassfish/jersey/server/spring/localization.properties b/ext/spring5/src/main/resources/org/glassfish/jersey/server/spring/localization.properties
new file mode 100644
index 0000000..83f9220
--- /dev/null
+++ b/ext/spring5/src/main/resources/org/glassfish/jersey/server/spring/localization.properties
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2013, 2019 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
+#
+
+no.beans.found.for.type=No beans found. Resolution failed for type {0}.
+ctx.lookup.started=Spring context lookup started.
+ctx.lookup.failed=Spring context lookup failed, skipping spring component provider initialization.
+ctx.lookup.sucessful=Spring context lookup done.
+spring.component.provider.initialized=Spring component provider initialized.
+none.or.multiple.beans.available=None or multiple beans found in Spring context for type {0}, skipping the type.
+bean.registered=Spring managed bean, {0}, registered with HK2.
+registering.ctx.loader.listener=Registering Spring ContextLoaderListener
+skipping.ctx.lodaer.listener.registration=Presuming Spring ContextLoaderListener was manually registered. Skipping context loader registration.
+not.in.request.scope=Cannot ask for request attributes - request is not active anymore!
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java
new file mode 100644
index 0000000..0afc246
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring;
+
+public class NoComponent {
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java
new file mode 100644
index 0000000..ec32676
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring;
+
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ComponentScan(basePackages = "org.glassfish.jersey.server.spring")
+public class SpringTestConfiguration {
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java
new file mode 100644
index 0000000..d8d29a3
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class TestComponent1 {
+
+ public String result() {
+ return "test ok";
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java
new file mode 100644
index 0000000..742f421
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring;
+
+public interface TestComponent2 {
+ String result();
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java
new file mode 100644
index 0000000..25078b6
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class TestComponent2Impl1 implements TestComponent2 {
+ @Override
+ public String result() {
+ return "test ok";
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java
new file mode 100644
index 0000000..a4f33f6
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class TestComponent2Impl2 implements TestComponent2 {
+ @Override
+ public String result() {
+ return "test ok";
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java
new file mode 100644
index 0000000..0831c1e
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.aspect4j;
+
+import javax.ws.rs.core.Application;
+
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import static org.junit.Assert.assertEquals;
+
+public class Aspect4JTest extends JerseyTest {
+
+ private ClassPathXmlApplicationContext applicationContext;
+
+ private TestAspect testAspect;
+
+ @Before
+ public void before() {
+ testAspect.reset();
+ }
+
+ @Override
+ protected Application configure() {
+ applicationContext = new ClassPathXmlApplicationContext("jersey-spring-aspect4j-applicationContext.xml");
+ testAspect = applicationContext.getBean(TestAspect.class);
+ return new Aspect4jJerseyConfig()
+ .property("contextConfig", applicationContext);
+ }
+
+ @Test
+ public void methodCallShouldNotBeIntercepted() {
+ target("test1").request().get(String.class);
+ assertEquals(0, testAspect.getInterceptions());
+ }
+
+ @Test
+ public void methodCallShouldBeIntercepted() {
+ target("test2").request().get(String.class);
+ assertEquals(1, applicationContext.getBean(TestAspect.class).getInterceptions());
+ }
+
+ @Test
+ public void JERSEY_3126() {
+ final String result = target("JERSEY-3126").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java
new file mode 100644
index 0000000..0f60e3b
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.aspect4j;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.spring.scope.RequestContextFilter;
+
+public class Aspect4jJerseyConfig extends ResourceConfig {
+
+ public Aspect4jJerseyConfig() {
+ register(RequestContextFilter.class);
+ register(NoComponentResource.class);
+ register(ComponentResource.class);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java
new file mode 100644
index 0000000..02d011a
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.aspect4j;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+import org.glassfish.jersey.server.spring.TestComponent1;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Path("/")
+@Component
+public class ComponentResource {
+
+ @Autowired
+ private TestComponent1 testComponent1;
+ @Context
+ private UriInfo uriInfo;
+
+ @Path("test2")
+ @GET
+ public String test2() {
+ return testComponent1.result();
+ }
+
+ @Path("JERSEY-3126")
+ @GET
+ public String JERSEY_3126() {
+ return uriInfo == null ? "test failed" : "test ok";
+ }
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java
new file mode 100644
index 0000000..16b74ae
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.aspect4j;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+import org.glassfish.jersey.server.spring.TestComponent1;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Path("/")
+public class NoComponentResource {
+
+ @Autowired
+ private TestComponent1 testComponent1;
+
+ @Path("test1")
+ @GET
+ public String test1() {
+ return testComponent1.result();
+ }
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java
new file mode 100644
index 0000000..0b12c3b
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.aspect4j;
+
+import javax.inject.Singleton;
+
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+
+@Aspect
+@Singleton
+public class TestAspect {
+
+ private int interceptions = 0;
+
+ @Before("execution(* org.glassfish.jersey.server.spring.aspect4j.*.*())")
+ public void intercept(JoinPoint joinPoint) {
+ interceptions++;
+ }
+
+ public int getInterceptions() {
+ return interceptions;
+ }
+
+ public void reset() {
+ interceptions = 0;
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java
new file mode 100644
index 0000000..0eb367b
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.fieldinjection;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.spring.scope.RequestContextFilter;
+
+public class SpringFieldInjectionJerseyTestConfig extends ResourceConfig {
+ public SpringFieldInjectionJerseyTestConfig() {
+ register(RequestContextFilter.class);
+ register(SpringFieldInjectionTestResource.class);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java
new file mode 100644
index 0000000..ccdd34b
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.fieldinjection;
+
+import javax.ws.rs.core.Application;
+
+import org.glassfish.jersey.server.spring.SpringTestConfiguration;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+
+import static org.junit.Assert.assertEquals;
+
+public class SpringFieldInjectionTest extends JerseyTest {
+
+ @Override
+ protected Application configure() {
+ ApplicationContext context = new AnnotationConfigApplicationContext(SpringTestConfiguration.class);
+ return new SpringFieldInjectionJerseyTestConfig()
+ .property("contextConfig", context);
+ }
+
+ @Test
+ public void testInjectionOfSingleBean() {
+ String result = target("test1").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+
+ @Test
+ public void testInjectionOfListOfBeans() {
+ String result = target("test2").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+
+ @Test
+ public void testInjectionOfSetOfBeans() {
+ String result = target("test3").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+
+ @Test
+ public void JERSEY_2643() {
+ String result = target("JERSEY-2643").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java
new file mode 100644
index 0000000..0bde187
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.fieldinjection;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+import org.glassfish.jersey.server.spring.NoComponent;
+import org.glassfish.jersey.server.spring.TestComponent1;
+import org.glassfish.jersey.server.spring.TestComponent2;
+import org.springframework.beans.factory.annotation.Autowired;
+
+@Path("/")
+public class SpringFieldInjectionTestResource {
+
+ @Autowired
+ private TestComponent1 testComponent1;
+
+ @Autowired
+ private List<TestComponent2> testComponent2List;
+
+ @Autowired
+ Set<TestComponent2> testComponent2Set;
+
+ @Autowired(required = false)
+ private NoComponent noComponent;
+
+ @Path("test1")
+ @GET
+ public String test1() {
+ return testComponent1.result();
+ }
+
+ @Path("test2")
+ @GET
+ public String test2() {
+ return (testComponent2List.size() == 2 && "test ok".equals(testComponent2List.get(0).result())
+ && "test ok".equals(testComponent2List.get(1).result())) ? "test ok" : "test failed";
+ }
+
+ @Path("test3")
+ @GET
+ public String test3() {
+ Iterator<TestComponent2> iterator = testComponent2Set.iterator();
+ return (testComponent2Set.size() == 2 && "test ok".equals(iterator.next().result())
+ && "test ok".equals(iterator.next().result())) ? "test ok" : "test failed";
+ }
+
+ @Path("JERSEY-2643")
+ @GET
+ public String JERSEY_2643() {
+ return noComponent == null ? "test ok" : "test failed";
+ }
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java
new file mode 100644
index 0000000..5c831bf
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2013, 2019 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.server.spring.filter;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class Counter {
+
+ private int count = 0;
+
+ public void inc() {
+ count++;
+ }
+
+ public int getCount() {
+ return count;
+ }
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java
new file mode 100644
index 0000000..026a0a6
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.filter;
+
+import javax.ws.rs.core.Application;
+
+import org.glassfish.jersey.server.spring.SpringTestConfiguration;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+
+import static org.junit.Assert.assertEquals;
+
+public class FilterTest extends JerseyTest {
+
+ private ApplicationContext context;
+
+ @Override
+ protected Application configure() {
+ context = new AnnotationConfigApplicationContext(SpringTestConfiguration.class);
+ return new JerseyTestConfig()
+ .property("contextConfig", context);
+ }
+
+ @Test
+ public void testInjectionOfSingleBean() {
+ target("test1").request().get(String.class);
+ assertEquals(1, context.getBean(Counter.class).getCount());
+ }
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java
new file mode 100644
index 0000000..c8df018
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2013, 2019 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.server.spring.filter;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.spring.scope.RequestContextFilter;
+
+public class JerseyTestConfig extends ResourceConfig {
+
+ public JerseyTestConfig() {
+ register(RequestContextFilter.class);
+ register(TestResource.class);
+ register(TestFilter.class);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java
new file mode 100644
index 0000000..32bfd16
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.filter;
+
+import java.io.IOException;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+
+import org.springframework.stereotype.Component;
+
+@Component
+@Singleton
+public class TestFilter implements ContainerRequestFilter {
+
+ @Inject
+ private Counter counter;
+
+ @Override
+ public void filter(final ContainerRequestContext requestContext) throws IOException {
+ counter.inc();
+ }
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java
new file mode 100644
index 0000000..5c11591
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.filter;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/")
+public class TestResource {
+
+ @Path("test1")
+ @GET
+ public String test1() {
+ return "Hello, Test!";
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java
new file mode 100644
index 0000000..7f26bce
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.methodinjection;
+
+import org.glassfish.jersey.server.spring.scope.RequestContextFilter;
+import org.glassfish.jersey.server.ResourceConfig;
+
+public class SpringMethodInjectionJerseyTestConfig extends ResourceConfig {
+ public SpringMethodInjectionJerseyTestConfig() {
+ register(RequestContextFilter.class);
+ register(SpringMethodInjectionTestResource.class);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java
new file mode 100644
index 0000000..cf79272
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.methodinjection;
+
+import static org.junit.Assert.assertEquals;
+
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+import org.glassfish.jersey.server.spring.SpringTestConfiguration;
+
+import javax.ws.rs.core.Application;
+
+public class SpringMethodInjectionTest extends JerseyTest {
+
+ @Override
+ protected Application configure() {
+ ApplicationContext context = new AnnotationConfigApplicationContext(SpringTestConfiguration.class);
+ return new SpringMethodInjectionJerseyTestConfig()
+ .property("contextConfig", context);
+ }
+
+ @Test
+ public void testInjectionOfSingleBean() {
+ String result = target("test1").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+
+ @Test
+ public void testInjectionOfListOfBeans() {
+ String result = target("test2").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+
+ @Test
+ public void testInjectionOfSetOfBeans() {
+ String result = target("test3").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java
new file mode 100644
index 0000000..9cd9973
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.methodinjection;
+
+import org.glassfish.jersey.server.spring.NoComponent;
+import org.glassfish.jersey.server.spring.TestComponent1;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+import java.util.Set;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/")
+public class SpringMethodInjectionTestResource {
+
+ private TestComponent1 testComponent1;
+ private List<org.glassfish.jersey.server.spring.TestComponent2> testComponent2List;
+ private Set<org.glassfish.jersey.server.spring.TestComponent2> testComponent2Set;
+ private NoComponent noComponent;
+
+ @Autowired
+ public void setTestComponent1(TestComponent1 testComponent1) {
+ this.testComponent1 = testComponent1;
+ }
+
+ @Autowired
+ public void setTestComponent2List(List<org.glassfish.jersey.server.spring.TestComponent2> testComponent2List) {
+ this.testComponent2List = testComponent2List;
+ }
+
+ @Autowired
+ public void setTestComponent2Set(Set<org.glassfish.jersey.server.spring.TestComponent2> testComponent2Set) {
+ this.testComponent2Set = testComponent2Set;
+ }
+
+ @Autowired(required = false)
+ public void setNoComponent(NoComponent noComponent) {
+ this.noComponent = noComponent;
+ }
+
+ @Path("test1")
+ @GET
+ public String test1() {
+ return testComponent1.result();
+ }
+
+ @Path("test2")
+ @GET
+ public String test2() {
+ return (testComponent2List.size() == 2 && "test ok".equals(testComponent2List.get(0).result())
+ && "test ok".equals(testComponent2List.get(1).result())) ? "test ok" : "test failed";
+ }
+
+ @Path("test3")
+ @GET
+ public String test3() {
+ java.util.Iterator<org.glassfish.jersey.server.spring.TestComponent2> iterator = testComponent2Set.iterator();
+ return (testComponent2Set.size() == 2 && "test ok".equals(iterator.next().result())
+ && "test ok".equals(iterator.next().result())) ? "test ok" : "test failed";
+ }
+
+ @Path("JERSEY-2643")
+ @GET
+ public String JERSEY_2643() {
+ return noComponent == null ? "test ok" : "test failed";
+ }
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java
new file mode 100644
index 0000000..598618f
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.parameterinjection;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.spring.scope.RequestContextFilter;
+
+public class SpringParameterInjectionJerseyTestConfig extends ResourceConfig {
+ public SpringParameterInjectionJerseyTestConfig() {
+ register(RequestContextFilter.class);
+ register(SpringParameterInjectionTestResource.class);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java
new file mode 100644
index 0000000..9af9049
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.parameterinjection;
+
+import org.glassfish.jersey.server.spring.SpringTestConfiguration;
+import org.glassfish.jersey.server.spring.fieldinjection.SpringFieldInjectionJerseyTestConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+
+import javax.ws.rs.core.Application;
+
+import static org.junit.Assert.assertEquals;
+
+public class SpringParameterInjectionTest extends JerseyTest {
+ @Override
+ protected Application configure() {
+ ApplicationContext context = new AnnotationConfigApplicationContext(SpringTestConfiguration.class);
+ return new SpringParameterInjectionJerseyTestConfig()
+ .property("contextConfig", context);
+ }
+
+ @Test
+ public void testInjectionOfSingleBean() {
+ String result = target("test1").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+
+ @Test
+ public void testInjectionOfListOfBeans() {
+ String result = target("test2").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+
+ @Test
+ public void testInjectionOfSetOfBeans() {
+ String result = target("test3").request().get(String.class);
+ assertEquals("test ok", result);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java
new file mode 100644
index 0000000..1af0145
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.parameterinjection;
+
+import org.glassfish.jersey.server.spring.TestComponent1;
+import org.glassfish.jersey.server.spring.TestComponent2;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+@Path("/")
+public class SpringParameterInjectionTestResource {
+
+ private final TestComponent1 testComponent1;
+ private final List<TestComponent2> testComponent2List;
+ private final Set<TestComponent2> testComponent2Set;
+
+ @Autowired
+ public SpringParameterInjectionTestResource(final TestComponent1 testComponent1,
+ final List<TestComponent2> testComponent2List,
+ final Set<TestComponent2> testComponent2Set) {
+ this.testComponent1 = testComponent1;
+ this.testComponent2List = testComponent2List;
+ this.testComponent2Set = testComponent2Set;
+ }
+
+ @Path("test1")
+ @GET
+ public String test1() {
+ return testComponent1.result();
+ }
+
+ @Path("test2")
+ @GET
+ public String test2() {
+ return (testComponent2List.size() == 2 && "test ok".equals(testComponent2List.get(0).result())
+ && "test ok".equals(testComponent2List.get(1).result())) ? "test ok" : "test failed";
+ }
+
+ @Path("test3")
+ @GET
+ public String test3() {
+ Iterator<TestComponent2> iterator = testComponent2Set.iterator();
+ return (testComponent2Set.size() == 2 && "test ok".equals(iterator.next().result())
+ && "test ok".equals(iterator.next().result())) ? "test ok" : "test failed";
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java
new file mode 100644
index 0000000..77b497c
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.profiles;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class DefaultTestService implements TestService {
+
+ @Override
+ public String test() {
+ return "default";
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java
new file mode 100644
index 0000000..34dcadf
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.profiles;
+
+import org.springframework.context.annotation.Primary;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Component;
+
+@Component
+@Primary
+@Profile("dev")
+public class DevTestService implements TestService {
+
+ @Override
+ public String test() {
+ return "dev";
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java
new file mode 100644
index 0000000..e95257f
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.profiles;
+
+import javax.ws.rs.core.Application;
+
+import org.glassfish.jersey.logging.LoggingFeature;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.spring.scope.RequestContextFilter;
+import org.glassfish.jersey.test.JerseyTest;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+
+public class SpringDefaultProfileResourceTest extends JerseyTest {
+
+ @Override
+ protected Application configure() {
+ System.setProperty("spring.profiles.active", "");
+ ApplicationContext context = new AnnotationConfigApplicationContext("org.glassfish.jersey.server.spring.profiles");
+ return new ResourceConfig()
+ .register(RequestContextFilter.class)
+ .register(LoggingFeature.class)
+ .packages("org.glassfish.jersey.server.spring.profiles")
+ .property("contextConfig", context);
+ }
+
+ @Test
+ public void shouldUseDefaultComponent() {
+ final String result = target("spring-resource").request().get(String.class);
+ Assert.assertEquals("default", result);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java
new file mode 100644
index 0000000..4ccb36a
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.profiles;
+
+import javax.ws.rs.core.Application;
+
+import org.glassfish.jersey.logging.LoggingFeature;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.spring.scope.RequestContextFilter;
+import org.glassfish.jersey.test.JerseyTest;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+
+public class SpringDevProfileResourceTest extends JerseyTest {
+
+ @Override
+ protected Application configure() {
+ System.setProperty("spring.profiles.active", "dev");
+ AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+ "org.glassfish.jersey.server.spring.profiles");
+ return new ResourceConfig()
+ .register(RequestContextFilter.class)
+ .register(LoggingFeature.class)
+ .packages("org.glassfish.jersey.server.spring.profiles")
+ .property("contextConfig", context);
+ }
+
+ @Test
+ public void shouldUseDevProfileBean() {
+ final String result = target("spring-resource").request().get(String.class);
+ Assert.assertEquals("dev", result);
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java
new file mode 100644
index 0000000..be0ac47
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.profiles;
+
+import org.junit.Test;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+import static org.junit.Assert.assertEquals;
+
+public class SpringProfilesTest {
+
+ @Test
+ public void shouldGetDefaultBean() {
+ System.setProperty("spring.profiles.active", "");
+ AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+ "org.glassfish.jersey.server.spring.profiles");
+ assertEquals("default", context.getBean(TestService.class).test());
+ }
+
+ @Test
+ public void shouldGetDevProfileBean() {
+ System.setProperty("spring.profiles.active", "dev");
+ AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+ "org.glassfish.jersey.server.spring.profiles");
+ assertEquals("dev", context.getBean(TestService.class).test());
+ }
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java
new file mode 100644
index 0000000..f66d9a4
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.profiles;
+
+import javax.inject.Singleton;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+@Singleton
+@Path("spring-resource")
+@Service
+public class SpringRequestResource {
+
+ @Autowired
+ private TestService testService;
+
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String getGoodbye() {
+ return testService.test();
+ }
+
+}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java
new file mode 100644
index 0000000..d5635b5
--- /dev/null
+++ b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2014, 2019 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.server.spring.profiles;
+
+public interface TestService {
+
+ String test();
+}
diff --git a/ext/spring5/src/test/resources/jersey-spring-aspect4j-applicationContext.xml b/ext/spring5/src/test/resources/jersey-spring-aspect4j-applicationContext.xml
new file mode 100644
index 0000000..7abafe3
--- /dev/null
+++ b/ext/spring5/src/test/resources/jersey-spring-aspect4j-applicationContext.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2013, 2019 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
+
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop
+ http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+
+ <aop:aspectj-autoproxy/>
+
+ <context:component-scan base-package="org.glassfish.jersey.server.spring"/>
+
+ <bean id="someAspect" class="org.glassfish.jersey.server.spring.aspect4j.TestAspect"/>
+</beans>
diff --git a/ext/wadl-doclet/pom.xml b/ext/wadl-doclet/pom.xml
index 94c27f5..c64f88b 100644
--- a/ext/wadl-doclet/pom.xml
+++ b/ext/wadl-doclet/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.ext</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jersey-wadl-doclet</artifactId>
diff --git a/incubator/declarative-linking/pom.xml b/incubator/declarative-linking/pom.xml
index cf9e9d9..1ceda83 100644
--- a/incubator/declarative-linking/pom.xml
+++ b/incubator/declarative-linking/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.incubator</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.ext</groupId>
diff --git a/incubator/gae-integration/pom.xml b/incubator/gae-integration/pom.xml
index 54c76bf..7666db3 100644
--- a/incubator/gae-integration/pom.xml
+++ b/incubator/gae-integration/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.incubator</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-gae-integration</artifactId>
diff --git a/incubator/gae-integration/src/main/java/org/glassfish/jersey/server/gae/GaeBackgroundExecutorProvider.java b/incubator/gae-integration/src/main/java/org/glassfish/jersey/server/gae/GaeBackgroundExecutorProvider.java
index 0338725..27fa9ff 100644
--- a/incubator/gae-integration/src/main/java/org/glassfish/jersey/server/gae/GaeBackgroundExecutorProvider.java
+++ b/incubator/gae-integration/src/main/java/org/glassfish/jersey/server/gae/GaeBackgroundExecutorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,8 +26,8 @@
* {@link java.util.concurrent.ScheduledExecutorService} instances with a GAE specific {@link ThreadFactory} provider
* - {@link com.google.appengine.api.ThreadManager}.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Libor Kramolis
+ * @author Marek Potociar
*/
@BackgroundScheduler
class GaeBackgroundExecutorProvider extends ScheduledThreadPoolExecutorProvider {
diff --git a/incubator/gae-integration/src/main/java/org/glassfish/jersey/server/gae/GaeFeature.java b/incubator/gae-integration/src/main/java/org/glassfish/jersey/server/gae/GaeFeature.java
index cc99f84..e6e2b7a 100644
--- a/incubator/gae-integration/src/main/java/org/glassfish/jersey/server/gae/GaeFeature.java
+++ b/incubator/gae-integration/src/main/java/org/glassfish/jersey/server/gae/GaeFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,8 +28,8 @@
* your Jersey application on Google App Engine.
* </p>
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Libor Kramolis
+ * @author Marek Potociar
*/
@ConstrainedTo(RuntimeType.SERVER)
public final class GaeFeature implements Feature {
diff --git a/incubator/html-json/pom.xml b/incubator/html-json/pom.xml
index c6ad5df..c660fd4 100644
--- a/incubator/html-json/pom.xml
+++ b/incubator/html-json/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.incubator</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.media</groupId>
@@ -42,14 +42,6 @@
<net.java.html.version>1.5.1</net.java.html.version>
</properties>
- <repositories>
- <repository>
- <id>netbeans</id>
- <name>NetBeans</name>
- <url>http://bits.netbeans.org/maven2/</url>
- </repository>
- </repositories>
-
<dependencies>
<dependency>
<groupId>jakarta.ws.rs</groupId>
@@ -63,7 +55,7 @@
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-lookup</artifactId>
- <version>RELEASE80</version>
+ <version>RELEASE110</version>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/incubator/html-json/src/test/java/org/glassfish/jersey/media/htmljson/AbstractTypeTester.java b/incubator/html-json/src/test/java/org/glassfish/jersey/media/htmljson/AbstractTypeTester.java
index 5213a80..4e5c771 100644
--- a/incubator/html-json/src/test/java/org/glassfish/jersey/media/htmljson/AbstractTypeTester.java
+++ b/incubator/html-json/src/test/java/org/glassfish/jersey/media/htmljson/AbstractTypeTester.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -48,7 +48,7 @@
*
* @author Paul Sandoz
* @author Martin Matula
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractTypeTester extends JerseyTest {
diff --git a/incubator/kryo/pom.xml b/incubator/kryo/pom.xml
index 402fcf9..b72a7f4 100644
--- a/incubator/kryo/pom.xml
+++ b/incubator/kryo/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.incubator</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.media</groupId>
diff --git a/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/KryoFeature.java b/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/KryoFeature.java
index 63545fa..963c263 100644
--- a/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/KryoFeature.java
+++ b/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/KryoFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Feature used to register Kryo providers.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Beta
public class KryoFeature implements Feature {
diff --git a/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/internal/KryoAutoDiscoverable.java b/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/internal/KryoAutoDiscoverable.java
index 73107ca..36f07a1 100644
--- a/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/internal/KryoAutoDiscoverable.java
+++ b/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/internal/KryoAutoDiscoverable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* {@link AutoDiscoverable} registering {@link KryoFeature} if the feature is not already registered.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Priority(AutoDiscoverable.DEFAULT_PRIORITY)
public class KryoAutoDiscoverable implements AutoDiscoverable {
diff --git a/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/internal/KryoMessageBodyProvider.java b/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/internal/KryoMessageBodyProvider.java
index 755c290..ccc3f06 100644
--- a/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/internal/KryoMessageBodyProvider.java
+++ b/incubator/kryo/src/main/java/org/glassfish/jersey/kryo/internal/KryoMessageBodyProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -39,7 +39,7 @@
import com.esotericsoftware.kryo.pool.KryoPool;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Consumes("application/x-kryo")
diff --git a/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/JaxRsApplication.java b/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/JaxRsApplication.java
index fae6a4c..cf0f35f 100644
--- a/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/JaxRsApplication.java
+++ b/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class JaxRsApplication extends Application {
diff --git a/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/Person.java b/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/Person.java
index ac17889..eebad14 100644
--- a/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/Person.java
+++ b/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/Person.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
/**
* Test data bean.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Person {
diff --git a/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/PersonResource.java b/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/PersonResource.java
index 58981a8..5326ab5 100644
--- a/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/PersonResource.java
+++ b/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/PersonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Test resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("/")
@Consumes("application/x-kryo")
diff --git a/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/PersonResourceTest.java b/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/PersonResourceTest.java
index 4d4eaea..ed28bd3 100644
--- a/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/PersonResourceTest.java
+++ b/incubator/kryo/src/test/java/org/glassfish/jersey/kryo/PersonResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for kryo resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class PersonResourceTest extends JerseyTest {
diff --git a/incubator/open-tracing/pom.xml b/incubator/open-tracing/pom.xml
index 3cbb999..a820a3a 100644
--- a/incubator/open-tracing/pom.xml
+++ b/incubator/open-tracing/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.incubator</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.incubator</groupId>
diff --git a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingApplicationEventListener.java b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingApplicationEventListener.java
index d155760..ae8d6ae 100644
--- a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingApplicationEventListener.java
+++ b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingApplicationEventListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -43,7 +43,7 @@
/**
* Application event listener responsible for creating and propagating server-side request {@link io.opentracing.Span}.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
class OpenTracingApplicationEventListener implements ApplicationEventListener {
diff --git a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingClientRequestFilter.java b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingClientRequestFilter.java
index 7934488..766984a 100644
--- a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingClientRequestFilter.java
+++ b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingClientRequestFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -39,7 +39,7 @@
* Stores request-related metadata into the {@code Span} as {@code Tags}
* and {@link GlobalTracer#inject(SpanContext, Format, Object) injects} it into http headers.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
class OpenTracingClientRequestFilter implements ClientRequestFilter {
diff --git a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingClientResponseFilter.java b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingClientResponseFilter.java
index 0dae48f..6409956 100644
--- a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingClientResponseFilter.java
+++ b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingClientResponseFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -28,7 +28,7 @@
/**
* Retrieves stored span from the {@link ClientRequestContext} and adds response details to the tracing info.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
public class OpenTracingClientResponseFilter implements ClientResponseFilter {
diff --git a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingFeature.java b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingFeature.java
index 6afb1f9..7eb9873 100644
--- a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingFeature.java
+++ b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -29,7 +29,7 @@
/**
* A feature that enables OpenTracing support on server and client.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
@Beta
diff --git a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingUtils.java b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingUtils.java
index 4bc3ad0..f8ded2c 100644
--- a/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingUtils.java
+++ b/incubator/open-tracing/src/main/java/org/glassfish/jersey/opentracing/OpenTracingUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -31,7 +31,7 @@
/**
* Utility methods for Jersey OpenTracing integration.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @since 2.26
*/
public class OpenTracingUtils {
diff --git a/incubator/pom.xml b/incubator/pom.xml
index d3bde86..807e319 100644
--- a/incubator/pom.xml
+++ b/incubator/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.incubator</groupId>
diff --git a/inject/cdi2-se/pom.xml b/inject/cdi2-se/pom.xml
index 43fc892..f417e76 100644
--- a/inject/cdi2-se/pom.xml
+++ b/inject/cdi2-se/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-cdi2-se</artifactId>
@@ -87,7 +87,7 @@
</Export-Package>
<Import-Package>
sun.misc.*;resolution:=optional,
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
*
</Import-Package>
</instructions>
diff --git a/inject/cdi2-se/src/main/java/org/glassfish/jersey/inject/cdi/se/CdiSeInjectionManager.java b/inject/cdi2-se/src/main/java/org/glassfish/jersey/inject/cdi/se/CdiSeInjectionManager.java
index a75f946..7d1e88d 100644
--- a/inject/cdi2-se/src/main/java/org/glassfish/jersey/inject/cdi/se/CdiSeInjectionManager.java
+++ b/inject/cdi2-se/src/main/java/org/glassfish/jersey/inject/cdi/se/CdiSeInjectionManager.java
@@ -21,6 +21,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Type;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -96,7 +97,7 @@
@Override
public <T> T createAndInitialize(Class<T> createMe) {
- if (container != null) {
+ if (isInitialized()) {
Unmanaged.UnmanagedInstance<T> unmanaged = new Unmanaged<>(createMe).newInstance();
return unmanaged.produce()
.inject()
@@ -149,7 +150,7 @@
@SuppressWarnings("unchecked")
private <T> T getInstanceInternal(Type contractOrImpl, Annotation... qualifiers) {
- Set<Bean<?>> beans = beanManager.getBeans(contractOrImpl, qualifiers);
+ Set<Bean<?>> beans = isInitialized() ? beanManager.getBeans(contractOrImpl, qualifiers) : Collections.emptySet();
if (beans.isEmpty()) {
return null;
}
@@ -159,6 +160,17 @@
return (T) beanManager.getReference(bean, contractOrImpl, ctx);
}
+ /**
+ * checks if being invoked before #completeRegistration
+ * there are 2 signs for that - container is null (not initialized)
+ * and beanManager is null (because it appears from initialized container)
+ *
+ * @return true if completeRegistration was already invoked. False if it's not yet initialized
+ */
+ private boolean isInitialized() {
+ return container != null && beanManager != null;
+ }
+
@Override
@SuppressWarnings("unchecked")
public Object getInstance(ForeignDescriptor foreignDescriptor) {
@@ -178,7 +190,7 @@
} else {
throw new RuntimeException(
org.glassfish.jersey.internal.LocalizationMessages
- .UNKNOWN_DESCRIPTOR_TYPE(binding.getClass().getSimpleName()));
+ .UNKNOWN_DESCRIPTOR_TYPE(binding.getClass().getSimpleName()));
}
Set<Bean<?>> beans = beanManager.getBeans(clazz);
@@ -206,7 +218,7 @@
@Override
@SuppressWarnings("unchecked")
public void inject(Object instance) {
- if (beanManager != null) {
+ if (isInitialized()) {
AnnotatedType annotatedType = beanManager.createAnnotatedType((Class) instance.getClass());
InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);
CreationalContext context = beanManager.createCreationalContext(null);
diff --git a/inject/cdi2-se/src/main/java/org/glassfish/jersey/inject/cdi/se/bean/SupplierBeanBridge.java b/inject/cdi2-se/src/main/java/org/glassfish/jersey/inject/cdi/se/bean/SupplierBeanBridge.java
index 3208478..281f489 100644
--- a/inject/cdi2-se/src/main/java/org/glassfish/jersey/inject/cdi/se/bean/SupplierBeanBridge.java
+++ b/inject/cdi2-se/src/main/java/org/glassfish/jersey/inject/cdi/se/bean/SupplierBeanBridge.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -143,4 +143,11 @@
public Class<? extends Annotation> getScope() {
return binding.getScope() == null ? Dependent.class : transformScope(binding.getScope());
}
+
+ @Override
+ public Class<?> getBeanClass() {
+ return this.binding.getContracts().isEmpty()
+ ? super.getBeanClass()
+ : (Class<?>) this.binding.getContracts().iterator().next();
+ }
}
diff --git a/inject/hk2/pom.xml b/inject/hk2/pom.xml
index b33a71c..7efefd0 100644
--- a/inject/hk2/pom.xml
+++ b/inject/hk2/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-hk2</artifactId>
@@ -87,7 +87,9 @@
</Export-Package>
<Import-Package>
sun.misc.*;resolution:=optional,
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
+ ${hk2.jvnet.osgi.version},
+ ${hk2.osgi.version},
*
</Import-Package>
</instructions>
diff --git a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl.java b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl.java
index 6f3b2bd..339532d 100644
--- a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl.java
+++ b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -53,8 +53,8 @@
/**
* Injection resolver for {@link Context @Context} injection annotation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Marek Potociar
+ * @author Jakub Podlesak
*/
@Singleton
public class ContextInjectionResolverImpl implements InjectionResolver<Context>, ContextInjectionResolver {
diff --git a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/HK2BinderConfigurationFactory.java b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/HK2BinderConfigurationFactory.java
new file mode 100644
index 0000000..d0b377d
--- /dev/null
+++ b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/HK2BinderConfigurationFactory.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2019 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.inject.hk2;
+
+import org.glassfish.hk2.api.DynamicConfiguration;
+import org.glassfish.hk2.api.DynamicConfigurationService;
+import org.glassfish.hk2.api.ServiceLocator;
+import org.glassfish.hk2.utilities.Binder;
+import org.glassfish.jersey.inject.spi.BinderConfigurationFactory;
+import org.glassfish.jersey.internal.inject.InjectionManager;
+import org.glassfish.jersey.model.ContractProvider;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.IdentityHashMap;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+/**
+ * Implementation of {@link BinderConfigurationFactory} that binds HK2 {@code AbstractBinder} as well as other
+ * HK2 {@code Binder} implementation
+ */
+public class HK2BinderConfigurationFactory implements BinderConfigurationFactory {
+ @Override
+ public BinderConfiguration createBinderConfiguration(Function<Predicate<ContractProvider>, Set<Object>> getInstances) {
+ return new HK2BinderConfiguration(getInstances);
+ }
+
+ private static class HK2BinderConfiguration implements BinderConfigurationFactory.BinderConfiguration {
+ private final Function<Predicate<ContractProvider>, Set<Object>> getInstances;
+
+ /**
+ * A filtering strategy that includes only models that contain HK2 Binder provider contract.
+ * <p>
+ * This filter predicate returns {@code true} for all {@link org.glassfish.jersey.model.ContractProvider contract provider models}
+ * that represent a provider registered to provide HK2 {@link org.glassfish.hk2.utilities.Binder} contract.
+ * </p>
+ */
+ private static final Predicate<ContractProvider> BINDERS_ONLY = new Predicate<ContractProvider>() {
+ @Override
+ public boolean test(ContractProvider model) {
+ return Binder.class.isAssignableFrom(model.getImplementationClass());
+ }
+ };
+
+ private static final Function<Object, Binder> CAST_TO_BINDER = new Function<Object, Binder>() {
+ @Override
+ public Binder apply(final Object input) {
+ return Binder.class.cast(input);
+ }
+ };
+
+
+ private Set<Binder> configuredBinders = Collections.emptySet();
+
+ public HK2BinderConfiguration(Function<Predicate<ContractProvider>, Set<Object>> getInstances) {
+ this.getInstances = getInstances;
+ }
+
+ @Override
+ public boolean configureBinders(InjectionManager injectionManager) {
+ final ServiceLocator serviceLocator = getServiceLocator(injectionManager);
+ if (serviceLocator != null) {
+ configuredBinders = configureBinders(serviceLocator, configuredBinders);
+ return !configuredBinders.isEmpty();
+ }
+ return false;
+ }
+
+ private Set<Binder> configureBinders(final ServiceLocator locator, final Set<Binder> configured) {
+ final Set<Binder> allConfigured = Collections.newSetFromMap(new IdentityHashMap<>());
+ allConfigured.addAll(configured);
+
+ final Collection<Binder> binders = getBinders(configured);
+ if (!binders.isEmpty()) {
+ final DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
+ final DynamicConfiguration dc = dcs.createDynamicConfiguration();
+
+ for (final Binder binder : binders) {
+ binder.bind(dc);
+ allConfigured.add(binder);
+ }
+ dc.commit();
+ }
+
+ return allConfigured;
+ }
+
+ private Collection<Binder> getBinders(final Set<Binder> configured) {
+ return getInstances
+ .apply(BINDERS_ONLY)
+ .stream()
+ .map(CAST_TO_BINDER)
+ .filter(binder -> !configured.contains(binder))
+ .collect(Collectors.toList());
+ }
+
+ private static ServiceLocator getServiceLocator(InjectionManager injectionManager) {
+ if (AbstractHk2InjectionManager.class.isInstance(injectionManager)) {
+ return ((AbstractHk2InjectionManager) injectionManager).getServiceLocator();
+ }
+ return null;
+ }
+ }
+}
diff --git a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/Hk2ReferencingFactory.java b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/Hk2ReferencingFactory.java
index c52ab3a..51a68c1 100644
--- a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/Hk2ReferencingFactory.java
+++ b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/Hk2ReferencingFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -27,7 +27,7 @@
* Factory that provides injection of the referenced instance.
*
* @param <T>
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class Hk2ReferencingFactory<T> implements Factory<T> {
diff --git a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/JerseyClassAnalyzer.java b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/JerseyClassAnalyzer.java
index 520e28c..92d8923 100644
--- a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/JerseyClassAnalyzer.java
+++ b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/JerseyClassAnalyzer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -50,7 +50,7 @@
* and required by JAX-RS specification.
*
* @author John Wells (john.wells at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Singleton
@Named(JerseyClassAnalyzer.NAME)
diff --git a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/JerseyErrorService.java b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/JerseyErrorService.java
index c2ada37..36ef4b5 100644
--- a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/JerseyErrorService.java
+++ b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/JerseyErrorService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -32,7 +32,7 @@
* Jersey implementation of HK2 Error Service to provide improved reporting
* of HK2 issues, that may be otherwise hidden (ignored).
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public final class JerseyErrorService implements ErrorService {
diff --git a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/SupplierFactoryBridge.java b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/SupplierFactoryBridge.java
index b1950b1..c038404 100644
--- a/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/SupplierFactoryBridge.java
+++ b/inject/hk2/src/main/java/org/glassfish/jersey/inject/hk2/SupplierFactoryBridge.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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,6 +18,7 @@
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.function.Supplier;
@@ -42,15 +43,15 @@
*/
public class SupplierFactoryBridge<T> implements Factory<T> {
- private ServiceLocator locator;
- private ParameterizedType beanType;
- private String beanName;
- private boolean disposable;
+ private final ServiceLocator locator;
+ private final ParameterizedType beanType;
+ private final String beanName;
+ private final boolean disposable;
// This bridge can create multiple instances using the method 'provide' therefore must map created suppliers because of
// 'dispose' invocation later on.
// TODO: Key as a WeakReference - prevent objects in scope which never dispose the objects such as PerLookup.
- private Map<Object, DisposableSupplier<T>> disposableSuppliers = new IdentityHashMap<>();
+ private Map<Object, DisposableSupplier<T>> disposableSuppliers = Collections.synchronizedMap(new IdentityHashMap<>());
/**
* Constructor for a new bridge.
@@ -85,9 +86,8 @@
@Override
public void dispose(T instance) {
if (disposable) {
- DisposableSupplier<T> disposableSupplier = disposableSuppliers.get(instance);
+ DisposableSupplier<T> disposableSupplier = disposableSuppliers.remove(instance);
disposableSupplier.dispose(instance);
- disposableSuppliers.remove(instance);
}
}
}
diff --git a/inject/hk2/src/main/resources/META-INF/services/org.glassfish.jersey.inject.spi.BinderConfigurationFactory b/inject/hk2/src/main/resources/META-INF/services/org.glassfish.jersey.inject.spi.BinderConfigurationFactory
new file mode 100644
index 0000000..30e9c77
--- /dev/null
+++ b/inject/hk2/src/main/resources/META-INF/services/org.glassfish.jersey.inject.spi.BinderConfigurationFactory
@@ -0,0 +1 @@
+org.glassfish.jersey.inject.hk2.HK2BinderConfigurationFactory
\ No newline at end of file
diff --git a/inject/hk2/src/test/java/org/glassfish/jersey/inject/hk2/HK2BinderConfigurationFactoryTest.java b/inject/hk2/src/test/java/org/glassfish/jersey/inject/hk2/HK2BinderConfigurationFactoryTest.java
new file mode 100644
index 0000000..add954d
--- /dev/null
+++ b/inject/hk2/src/test/java/org/glassfish/jersey/inject/hk2/HK2BinderConfigurationFactoryTest.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019 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.inject.hk2;
+
+import org.glassfish.jersey.inject.spi.BinderConfigurationFactory;
+import org.glassfish.jersey.internal.ServiceFinder;
+import org.junit.Test;
+
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+public class HK2BinderConfigurationFactoryTest {
+ @Test
+ public void testServiceFound() {
+ ServiceFinder<BinderConfigurationFactory> factoryFinder = ServiceFinder.find(BinderConfigurationFactory.class);
+ assertTrue(factoryFinder.iterator().hasNext());
+ assertSame(factoryFinder.iterator().next().getClass(), HK2BinderConfigurationFactory.class);
+ }
+}
diff --git a/inject/pom.xml b/inject/pom.xml
index c83adcc..1c26eed 100644
--- a/inject/pom.xml
+++ b/inject/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.inject</groupId>
diff --git a/media/jaxb/pom.xml b/media/jaxb/pom.xml
index 23f65a1..b2574e9 100644
--- a/media/jaxb/pom.xml
+++ b/media/jaxb/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-jaxb</artifactId>
@@ -141,4 +141,20 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractJaxbElementProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractJaxbElementProvider.java
index 8af4477..78cc2fd 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractJaxbElementProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractJaxbElementProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -58,7 +58,7 @@
* (Internal Server error).
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractJaxbElementProvider extends AbstractJaxbProvider<JAXBElement<?>> {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractJaxbProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractJaxbProvider.java
index 4061a6a..f512398 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractJaxbProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractJaxbProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -52,7 +52,7 @@
*
* @param <T> Java type supported by the provider.
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractJaxbProvider<T> extends AbstractMessageReaderWriterProvider<T> {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractRootElementJaxbProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractRootElementJaxbProvider.java
index 6b024ed..9d686e7 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractRootElementJaxbProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/AbstractRootElementJaxbProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -60,7 +60,7 @@
* (Internal Server error).
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractRootElementJaxbProvider extends AbstractJaxbProvider<Object> {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/DocumentBuilderFactoryInjectionProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/DocumentBuilderFactoryInjectionProvider.java
index 2a06308..1ebc21c 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/DocumentBuilderFactoryInjectionProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/DocumentBuilderFactoryInjectionProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,7 +26,7 @@
* builder factories}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class DocumentBuilderFactoryInjectionProvider extends AbstractXmlFactory<DocumentBuilderFactory> {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/DocumentProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/DocumentProvider.java
index 275665d..b175bc9 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/DocumentProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/DocumentProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -48,7 +48,7 @@
* Provider for marshalling/un-marshalling {@link Document XML document} instances.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Produces({"application/xml", "text/xml", "*/*"})
@Consumes({"application/xml", "text/xml", "*/*"})
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbAutoDiscoverable.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbAutoDiscoverable.java
index 1cd4b8b..7630753 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbAutoDiscoverable.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbAutoDiscoverable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
* JAXB {@link ForcedAutoDiscoverable} that registers all necessary JAXB features
* into the injection manager directly.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class JaxbAutoDiscoverable implements ForcedAutoDiscoverable {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbMessagingBinder.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbMessagingBinder.java
index c1e1052..78370de 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbMessagingBinder.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbMessagingBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -31,7 +31,7 @@
/**
* Binder for JAX-B message body workers.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxbMessagingBinder extends AbstractBinder {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbParamConverterBinder.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbParamConverterBinder.java
index f3b61d9..3947245 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbParamConverterBinder.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbParamConverterBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* Binder for JAXB parameter converter.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ConstrainedTo(RuntimeType.SERVER)
public class JaxbParamConverterBinder extends AbstractBinder {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbStringReaderProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbStringReaderProvider.java
index 7e664ba..ce5b83e 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbStringReaderProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/JaxbStringReaderProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -49,7 +49,7 @@
* support conversion of a string value into a JAXB instance.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JaxbStringReaderProvider {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/SaxParserFactoryInjectionProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/SaxParserFactoryInjectionProvider.java
index d0bc1f2..f004761 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/SaxParserFactoryInjectionProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/SaxParserFactoryInjectionProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
* Thread-scoped injection provider of {@link SAXParserFactory SAX parser factories}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
*/
public class SaxParserFactoryInjectionProvider extends AbstractXmlFactory<SAXParserFactory> {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/TransformerFactoryInjectionProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/TransformerFactoryInjectionProvider.java
index c6d1653..b7e06d6 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/TransformerFactoryInjectionProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/TransformerFactoryInjectionProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -30,7 +30,7 @@
* Thread-scoped injection provider of {@link TransformerFactory transformer factories}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TransformerFactoryInjectionProvider extends AbstractXmlFactory<TransformerFactory> {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlCollectionJaxbProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlCollectionJaxbProvider.java
index 520dea4..f5e8e1b 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlCollectionJaxbProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlCollectionJaxbProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -44,7 +44,7 @@
* Base XML-based message body provider for collections of JAXB beans.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class XmlCollectionJaxbProvider extends AbstractCollectionJaxbProvider {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlInputFactoryInjectionProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlInputFactoryInjectionProvider.java
index 825d9be..d064d8c 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlInputFactoryInjectionProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlInputFactoryInjectionProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
* Thread-scoped injection provider of {@link XMLInputFactory transformer factories}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class XmlInputFactoryInjectionProvider extends AbstractXmlFactory<XMLInputFactory> {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlJaxbElementProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlJaxbElementProvider.java
index 3613582..69e9d46 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlJaxbElementProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlJaxbElementProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Base XML-based message body provider for {@link JAXBElement JAXB element} instances.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class XmlJaxbElementProvider extends AbstractJaxbElementProvider {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlRootElementJaxbProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlRootElementJaxbProvider.java
index 67381c5..6a3f8e3 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlRootElementJaxbProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlRootElementJaxbProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* and {@link XmlType types}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class XmlRootElementJaxbProvider extends AbstractRootElementJaxbProvider {
diff --git a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlRootObjectJaxbProvider.java b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlRootObjectJaxbProvider.java
index a7cba72..fa0e3ce 100644
--- a/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlRootObjectJaxbProvider.java
+++ b/media/jaxb/src/main/java/org/glassfish/jersey/jaxb/internal/XmlRootObjectJaxbProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -47,7 +47,7 @@
* Base XML-based message body reader for JAXB beans.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class XmlRootObjectJaxbProvider extends AbstractJaxbProvider<Object> {
diff --git a/media/json-binding/pom.xml b/media/json-binding/pom.xml
index e7d4e8c..26037de 100644
--- a/media/json-binding/pom.xml
+++ b/media/json-binding/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-json-binding</artifactId>
@@ -54,7 +54,7 @@
<configuration>
<instructions>
<Export-Package>org.glassfish.jersey.jackson.*</Export-Package>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>${javax.annotation.osgi.version},*</Import-Package>
</instructions>
<unpackBundle>true</unpackBundle>
</configuration>
diff --git a/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/JsonBindingFeature.java b/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/JsonBindingFeature.java
index 36445eb..4a39b3c 100644
--- a/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/JsonBindingFeature.java
+++ b/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/JsonBindingFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -46,7 +46,7 @@
* }
* </pre>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class JsonBindingFeature implements Feature {
diff --git a/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/internal/JsonBindingAutoDiscoverable.java b/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/internal/JsonBindingAutoDiscoverable.java
index 60a7c0b..28471b6 100644
--- a/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/internal/JsonBindingAutoDiscoverable.java
+++ b/media/json-binding/src/main/java/org/glassfish/jersey/jsonb/internal/JsonBindingAutoDiscoverable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -28,7 +28,7 @@
* {@link ForcedAutoDiscoverable} registering {@link JsonBindingFeature} if the feature is not already registered.
* <p>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
* @see JsonBindingFeature
*/
@Priority(AutoDiscoverable.DEFAULT_PRIORITY - 200)
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 5adc9ba..3d4ad43 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, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -43,7 +43,7 @@
/**
* Entity provider (reader and writer) for JSONB.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Provider
@Produces({"application/json", "text/json", "*/*"})
diff --git a/media/json-jackson/pom.xml b/media/json-jackson/pom.xml
index e205763..38a8159 100644
--- a/media/json-jackson/pom.xml
+++ b/media/json-jackson/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-json-jackson</artifactId>
@@ -77,7 +77,7 @@
<configuration>
<instructions>
<Export-Package>org.glassfish.jersey.jackson.*</Export-Package>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>${javax.annotation.osgi.version},*</Import-Package>
</instructions>
<unpackBundle>true</unpackBundle>
</configuration>
diff --git a/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/JacksonFeature.java b/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/JacksonFeature.java
index d85cc0a..2ab2501 100644
--- a/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/JacksonFeature.java
+++ b/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/JacksonFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,6 +40,39 @@
*/
public class JacksonFeature implements Feature {
+ /**
+ * Define whether to use Jackson's exception mappers ore not
+ * Using them can provide a useful information to the user, but it can expose unnecessary information, too.
+ */
+ private final boolean registerExceptionMappers;
+
+ /**
+ * Default constructor enables registering Jackson's exception mappers
+ */
+ public JacksonFeature() {
+ this(true);
+ }
+
+ private JacksonFeature(boolean registerExceptionMappers) {
+ this.registerExceptionMappers = registerExceptionMappers;
+ }
+
+ /**
+ * Create JacksonFeature with working Jackson's exception mappers
+ * @return JacksonFeature with working Jackson's exception mappers
+ */
+ public static JacksonFeature withExceptionMappers() {
+ return new JacksonFeature();
+ }
+
+ /**
+ * Create JacksonFeature without registered Jackson's exception mappers
+ * @return JacksonFeature without registered Jackson's exception mappers
+ */
+ public static JacksonFeature withoutExceptionMappers() {
+ return new JacksonFeature(false);
+ }
+
private static final String JSON_FEATURE = JacksonFeature.class.getSimpleName();
@Override
@@ -59,9 +92,12 @@
// Register Jackson.
if (!config.isRegistered(JacksonJaxbJsonProvider.class)) {
- // add the default Jackson exception mappers
- context.register(JsonParseExceptionMapper.class);
- context.register(JsonMappingExceptionMapper.class);
+
+ if (registerExceptionMappers) {
+ // add the default Jackson exception mappers
+ context.register(JsonParseExceptionMapper.class);
+ context.register(JsonMappingExceptionMapper.class);
+ }
if (EntityFilteringFeature.enabled(config)) {
context.register(JacksonFilteringFeature.class);
diff --git a/media/json-jackson1/pom.xml b/media/json-jackson1/pom.xml
index 1e0de1a..bf3e860 100644
--- a/media/json-jackson1/pom.xml
+++ b/media/json-jackson1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-json-jackson1</artifactId>
diff --git a/media/json-jettison/pom.xml b/media/json-jettison/pom.xml
index d3079bb..e05075f 100644
--- a/media/json-jettison/pom.xml
+++ b/media/json-jettison/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-json-jettison</artifactId>
@@ -88,4 +88,19 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfig.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfig.java
index 7c6875c..d3b047a 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfig.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -27,7 +27,7 @@
* An immutable configuration of JSON notation and options. {@code JettisonConfig}
* instance can be used for configuring the JSON notation on {@link JettisonJaxbContext}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JettisonConfig {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfigured.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfigured.java
index 4adc8a6..7417674 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfigured.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfigured.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* An interface declaring a JSON configuration is available.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface JettisonConfigured {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonMarshaller.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonMarshaller.java
index 695d1f8..49392e1 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonMarshaller.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonMarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -27,7 +27,7 @@
* by JAXB, to JSON data.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface JettisonMarshaller {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonUnmarshaller.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonUnmarshaller.java
index fd6b5f7..a3be31a 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonUnmarshaller.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonUnmarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -27,7 +27,7 @@
* content tree, defined by JAXB.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface JettisonUnmarshaller {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/BaseJsonMarshaller.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/BaseJsonMarshaller.java
index 7f54d8e..bc2bf14 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/BaseJsonMarshaller.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/BaseJsonMarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
/**
* Base JSON marshaller implementation class.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
public class BaseJsonMarshaller implements JettisonMarshaller, JettisonConfigured {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/BaseJsonUnmarshaller.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/BaseJsonUnmarshaller.java
index 529b87e..c9c4867 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/BaseJsonUnmarshaller.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/BaseJsonUnmarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,7 +37,7 @@
/**
* Base JSON marshaller implementation class.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class BaseJsonUnmarshaller implements JettisonUnmarshaller, JettisonConfigured {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/JettisonJaxbMarshaller.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/JettisonJaxbMarshaller.java
index 03acbbe..3200cba 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/JettisonJaxbMarshaller.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/JettisonJaxbMarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -40,7 +40,7 @@
/**
* JSON JAXB marshaller.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public final class JettisonJaxbMarshaller extends BaseJsonMarshaller implements Marshaller {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/JettisonJaxbUnmarshaller.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/JettisonJaxbUnmarshaller.java
index 7764a0e..e6b7d05 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/JettisonJaxbUnmarshaller.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/JettisonJaxbUnmarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -43,7 +43,7 @@
/**
* JSON JAXB unmarshaller.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JettisonJaxbUnmarshaller extends BaseJsonUnmarshaller implements Unmarshaller {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/Stax2JettisonFactory.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/Stax2JettisonFactory.java
index ad245e9..cd1552f 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/Stax2JettisonFactory.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/Stax2JettisonFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -40,7 +40,7 @@
/**
* Factory for creating JSON-enabled StAX readers and writers.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
public class Stax2JettisonFactory {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonArrayProvider.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonArrayProvider.java
index 764f0e3..db4418d 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonArrayProvider.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonArrayProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Low-level JSON media type message entity provider (reader & writer) for
* {@link JSONArray}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JettisonArrayProvider extends JettisonLowLevelProvider<JSONArray> {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonJaxbElementProvider.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonJaxbElementProvider.java
index b268490..15feedf 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonJaxbElementProvider.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonJaxbElementProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -43,7 +43,7 @@
* JSON message entity media type provider (reader & writer) for {@link javax.xml.bind.JAXBElement}
* type.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JettisonJaxbElementProvider extends AbstractJaxbElementProvider {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonListElementProvider.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonListElementProvider.java
index c6aad94..777c000 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonListElementProvider.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonListElementProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -50,7 +50,7 @@
* JSON message entity media type provider (reader & writer) for collection
* types.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JettisonListElementProvider extends AbstractCollectionJaxbProvider {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonLowLevelProvider.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonLowLevelProvider.java
index cc44e24..a3d2280 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonLowLevelProvider.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonLowLevelProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -27,7 +27,7 @@
* Abstract, low-level JSON media type message entity provider (reader & writer).
*
* @param <T> supported Java type.
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public abstract class JettisonLowLevelProvider<T> extends AbstractMessageReaderWriterProvider<T> {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonObjectProvider.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonObjectProvider.java
index a30afc3..f0bb28a 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonObjectProvider.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonObjectProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Low-level JSON media type message entity provider (reader & writer) for
* {@link JSONObject}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JettisonObjectProvider extends JettisonLowLevelProvider<JSONObject> {
diff --git a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonRootElementProvider.java b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonRootElementProvider.java
index 47e9905..f8674d0 100644
--- a/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonRootElementProvider.java
+++ b/media/json-jettison/src/main/java/org/glassfish/jersey/jettison/internal/entity/JettisonRootElementProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -44,7 +44,7 @@
* or {@link javax.xml.bind.annotation.XmlType @XmlType}.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JettisonRootElementProvider extends AbstractRootElementJaxbProvider {
diff --git a/media/json-processing/pom.xml b/media/json-processing/pom.xml
index 696ad7b..7dfaa8f 100644
--- a/media/json-processing/pom.xml
+++ b/media/json-processing/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-json-processing</artifactId>
@@ -56,7 +56,7 @@
<Export-Package>org.glassfish.jersey.jsonp.*;version=${project.version}</Export-Package>
<!-- TODO: change to ${range;[==,+);${jsonp.api.version}} once the version is final-->
<Import-Package>
- javax.annotation.*;version="!",
+ ${javax.annotation.osgi.version},
javax.json.*;version="[0,2)",
org.glassfish.json.*;version="[0,2)",
*
diff --git a/media/moxy/pom.xml b/media/moxy/pom.xml
index 2f95e65..86e04f1 100644
--- a/media/moxy/pom.xml
+++ b/media/moxy/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-moxy</artifactId>
@@ -56,7 +56,7 @@
<configuration>
<instructions>
<Export-Package>org.glassfish.jersey.moxy.*</Export-Package>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>${javax.annotation.osgi.version},*</Import-Package>
</instructions>
<unpackBundle>true</unpackBundle>
</configuration>
@@ -135,4 +135,19 @@
</repository>
</repositories>
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
diff --git a/media/moxy/src/main/java/org/glassfish/jersey/moxy/json/MoxyJsonFeature.java b/media/moxy/src/main/java/org/glassfish/jersey/moxy/json/MoxyJsonFeature.java
index 773b725..f2eb43c 100644
--- a/media/moxy/src/main/java/org/glassfish/jersey/moxy/json/MoxyJsonFeature.java
+++ b/media/moxy/src/main/java/org/glassfish/jersey/moxy/json/MoxyJsonFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
/**
* Feature used to register MOXy JSON providers.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
*/
public class MoxyJsonFeature implements Feature {
diff --git a/media/moxy/src/main/java/org/glassfish/jersey/moxy/xml/MoxyContextResolver.java b/media/moxy/src/main/java/org/glassfish/jersey/moxy/xml/MoxyContextResolver.java
index 891d034..70ed248 100644
--- a/media/moxy/src/main/java/org/glassfish/jersey/moxy/xml/MoxyContextResolver.java
+++ b/media/moxy/src/main/java/org/glassfish/jersey/moxy/xml/MoxyContextResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -36,7 +36,7 @@
*
* TODO: deal with classes NOT annotated with @XmlRootElement/@XmlType
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
class MoxyContextResolver implements ContextResolver<JAXBContext> {
diff --git a/media/moxy/src/main/java/org/glassfish/jersey/moxy/xml/MoxyXmlFeature.java b/media/moxy/src/main/java/org/glassfish/jersey/moxy/xml/MoxyXmlFeature.java
index 7995630..607cc93 100644
--- a/media/moxy/src/main/java/org/glassfish/jersey/moxy/xml/MoxyXmlFeature.java
+++ b/media/moxy/src/main/java/org/glassfish/jersey/moxy/xml/MoxyXmlFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
/**
* Feature used to register MOXy XML providers.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class MoxyXmlFeature implements Feature {
diff --git a/media/multipart/pom.xml b/media/multipart/pom.xml
index befc434..9390b98 100644
--- a/media/multipart/pom.xml
+++ b/media/multipart/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-multipart</artifactId>
@@ -100,10 +100,6 @@
</dependency>
<dependency>
- <groupId>org.jmockit</groupId>
- <artifactId>jmockit</artifactId>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/ContentDisposition.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/ContentDisposition.java
index 7f2f2ac..ab9e145 100644
--- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/ContentDisposition.java
+++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/ContentDisposition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
*
* @author Paul Sandoz
* @author imran@smartitengineering.com
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ContentDisposition {
diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataContentDisposition.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataContentDisposition.java
index 0f0e59c..28c7d6e 100644
--- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataContentDisposition.java
+++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataContentDisposition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,7 +26,7 @@
*
* @author Paul Sandoz
* @author imran@smartitengineering.com
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class FormDataContentDisposition extends ContentDisposition {
diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataMultiPart.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataMultiPart.java
index 16c0765..bc000b2 100644
--- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataMultiPart.java
+++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataMultiPart.java
@@ -107,6 +107,7 @@
}
if (name.equals(((FormDataBodyPart) bodyPart).getName())) {
result = (FormDataBodyPart) bodyPart;
+ break; // Break to return first result found.
}
}
return result;
diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParamException.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParamException.java
index d10504c..0cf9f58 100644
--- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParamException.java
+++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/FormDataParamException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -23,7 +23,7 @@
/**
* A parameter-based exception for errors with {@link FormDataParam}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public final class FormDataParamException extends ParamException {
diff --git a/media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/FormDataMultiPartReaderWriterTest.java b/media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/FormDataMultiPartReaderWriterTest.java
index b0a851c..693007e 100644
--- a/media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/FormDataMultiPartReaderWriterTest.java
+++ b/media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/FormDataMultiPartReaderWriterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,10 +69,6 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import mockit.Expectations;
-import mockit.Mocked;
-import mockit.Verifications;
-
/**
* Tests for multipart {@code MessageBodyReader} and {@code MessageBodyWriter} as well as {@code FormDataMultiPart} and {@code
* FormDataParam} injections.
@@ -667,36 +663,6 @@
}
/**
- * JERSEY-2663 reproducer. Make sure that temporary file created by MIMEPull is not copied into new temporary file created
- * by Jersey.
- */
- @Test
- public void testInjectedFileNotCopied(@Mocked final BodyPartEntity entity) throws Exception {
- final FormDataMultiPart multipart = new FormDataMultiPart();
- final FormDataBodyPart bodypart = new FormDataBodyPart(FormDataContentDisposition.name("file").fileName("file").build(),
- "CONTENT");
- multipart.bodyPart(bodypart);
-
- final Response response = target().path("FileResource").path("InjectedFileNotCopied")
- .request()
- .post(Entity.entity(multipart, MediaType.MULTIPART_FORM_DATA));
-
- // Make sure that the Mimepull temp file has been moved to specific file.
- new Verifications() {{
- entity.moveTo(withInstanceOf(File.class));
- times = 1;
- }};
-
- // Make sure that the temp file has been removed.
- final String pathname = response.readEntity(String.class);
- // Wait a second to make sure the file doesn't exist.
- Thread.sleep(1000);
-
- assertThat("Temporary file, " + pathname + ", on the server has not been removed",
- new File(pathname).exists(), is(false));
- }
-
- /**
* JERSEY-2846 reproducer. Make sure that temporary file created by MIMEPull deleted after a successful request.
*/
@Test
@@ -772,59 +738,6 @@
}
}
- /**
- * Mocked JERSEY-2794 reproducer. Real test is under integration tests.
- */
- @Test
- public void mimeTempFileRemovedAfterAbortedUpload(@Mocked final MIMEMessage message) throws Exception {
- new Expectations() {{
- message.getAttachments();
- result = new MIMEParsingException();
- }};
-
- final URL url = new URL(getBaseUri().toString() + "MediaTypeWithBoundaryResource");
- final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-
- connection.setRequestMethod("PUT");
- connection.setRequestProperty("Accept", "text/plain");
- connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=XXXX_YYYY");
-
- connection.setDoOutput(true);
- connection.connect();
-
- final OutputStream outputStream = connection.getOutputStream();
- outputStream.write("--XXXX_YYYY".getBytes());
- outputStream.write('\n');
- outputStream.write("Content-Type: text/plain".getBytes());
- outputStream.write('\n');
- outputStream.write("Content-Disposition: form-data; name=\"big-part\"".getBytes());
- outputStream.write('\n');
- outputStream.write('\n');
-
- // Send big chunk of data.
- for (int i = 0; i < 16 * 4096; i++) {
- outputStream.write('E');
- if (i % 1024 == 0) {
- outputStream.flush();
- }
- }
-
- // Do NOT send end of the MultiPart message to simulate the issue.
-
- // Get Response ...
- final int response = connection.getResponseCode();
- // ... Disconnect.
- connection.disconnect();
-
- assertThat("Bad Request expected", response, is(400));
-
- // Make sure that the Mimepull message and it's parts have been closed and temporary files deleted.
- new Verifications() {{
- message.close();
- times = 1;
- }};
- }
-
private void checkEntity(final String expected, final BodyPartEntity entity) throws IOException {
// Convert the raw bytes into a String
final InputStreamReader sr = new InputStreamReader(entity.getInputStream());
diff --git a/media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/MultiPartHeaderModificationTest.java b/media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/MultiPartHeaderModificationTest.java
index 1e67049..e8cb04a 100644
--- a/media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/MultiPartHeaderModificationTest.java
+++ b/media/multipart/src/test/java/org/glassfish/jersey/media/multipart/internal/MultiPartHeaderModificationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -53,7 +53,7 @@
* <p/>
* Delete this test when JERSEY-2341 fixed.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@RunWith(Parameterized.class)
public class MultiPartHeaderModificationTest extends MultiPartJerseyTest {
diff --git a/media/pom.xml b/media/pom.xml
index c873b55..e46526e 100644
--- a/media/pom.xml
+++ b/media/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.media</groupId>
diff --git a/media/sse/pom.xml b/media/sse/pom.xml
index 13d7b66..af6c95a 100644
--- a/media/sse/pom.xml
+++ b/media/sse/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-media-sse</artifactId>
@@ -76,7 +76,7 @@
<inherited>true</inherited>
<configuration>
<instructions>
- <Import-Package>javax.annotation.*;version="!",*</Import-Package>
+ <Import-Package>${javax.annotation.osgi.version},*</Import-Package>
</instructions>
</configuration>
</plugin>
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventInput.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventInput.java
index 89d3f3c..1843ccf 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventInput.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
*
* The input channel lets you serially read & consume SSE events as they arrive.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class EventInput extends ChunkedInput<InboundEvent> {
/**
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventInputReader.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventInputReader.java
index c5fd31b..6fd71cb 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventInputReader.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventInputReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -37,7 +37,7 @@
/**
* SSE {@link EventInput event input} message body reader.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
class EventInputReader implements MessageBodyReader<EventInput> {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventListener.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventListener.java
index 0781153..39d0d32 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventListener.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +20,7 @@
* {@link EventSource} listener that can be registered to listen for
* newly received {@link InboundEvent} notifications.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public interface EventListener {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventOutput.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventOutput.java
index 60614af..4d63506 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventOutput.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventOutput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,8 +26,8 @@
* When returned from resource method, underlying connection is kept open and application
* is able to send events. One instance of this class corresponds with exactly one HTTP connection.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class EventOutput extends ChunkedOutput<OutboundEvent> {
// encoding does not matter for lower ASCII characters
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventSource.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventSource.java
index 3611fdd..a3ce711 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventSource.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/EventSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -105,8 +105,8 @@
* on an event source builder prior to creating a new event source instance.
* </p>
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class EventSource implements EventListener {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEvent.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEvent.java
index 18f004d..1d2d80c 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEvent.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -35,8 +35,8 @@
/**
* Inbound event.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class InboundEvent implements InboundSseEvent {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEventReader.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEventReader.java
index 81b2cec..3ac2ccb 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEventReader.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEventReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -41,7 +41,7 @@
/**
* Client-side single inbound Server-Sent Event reader.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ConstrainedTo(RuntimeType.CLIENT)
class InboundEventReader implements MessageBodyReader<InboundEvent> {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEvent.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEvent.java
index 8c37ee0..0d7c826 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEvent.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,8 +28,8 @@
/**
* Representation of a single outbound SSE event.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public final class OutboundEvent implements OutboundSseEvent {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEventWriter.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEventWriter.java
index ccadc42..2dd6b2e 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEventWriter.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEventWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -37,8 +37,8 @@
/**
* Writer for {@link OutboundSseEvent}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
class OutboundEventWriter implements MessageBodyWriter<OutboundSseEvent> {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/SseBroadcaster.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/SseBroadcaster.java
index 6e9490f..76f85f0 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/SseBroadcaster.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/SseBroadcaster.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Used for broadcasting SSE to multiple {@link EventOutput} instances.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
*/
public class SseBroadcaster extends Broadcaster<OutboundEvent> {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/SseFeature.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/SseFeature.java
index 30baf97..b91839a 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/SseFeature.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/SseFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
/**
* A JAX-RS {@link Feature feature} that enables Server-Sent Events support.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class SseFeature implements Feature {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseyEventSink.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseyEventSink.java
index 9cfeaaf..0206b0d 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseyEventSink.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseyEventSink.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -39,7 +39,7 @@
* <p>
* The reference should be obtained via injection into the resource method.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)]
+ * @author Adam Lindenthal]
*/
class JerseyEventSink extends ChunkedOutput<OutboundSseEvent>
implements SseEventSink, Flushable, Flow.Subscriber<OutboundSseEvent> {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseySse.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseySse.java
index 7cec16c..1e6747c 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseySse.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseySse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -29,7 +29,7 @@
/**
* Implementation of server-side injectable Server-Sent Event "context".
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
class JerseySse implements Sse {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseySseBroadcaster.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseySseBroadcaster.java
index 5c3a6e7..63befa8 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseySseBroadcaster.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/JerseySseBroadcaster.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -37,7 +37,7 @@
* <p>
* JAX-RS 2.1 {@link SseBroadcaster} implementation.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
class JerseySseBroadcaster extends JerseyPublisher<OutboundSseEvent> implements SseBroadcaster {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseAutoDiscoverable.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseAutoDiscoverable.java
index 2d847b3..c1c50d8 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseAutoDiscoverable.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseAutoDiscoverable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,8 +33,8 @@
* {@link org.glassfish.jersey.media.sse.SseFeature#DISABLE_SSE} is not set to {@code true}, the {@code SseFeature}
* will be automatically registered.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Libor Kramolis
+ * @author Marek Potociar
*/
@Priority(AutoDiscoverable.DEFAULT_PRIORITY)
public final class SseAutoDiscoverable implements ForcedAutoDiscoverable {
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseBinder.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseBinder.java
index fd3c542..7f8e85b 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseBinder.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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,7 +24,7 @@
/**
* Binds implementations to interfaces for injection of SSE-related injectables.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class SseBinder extends AbstractBinder {
@Override
diff --git a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java
index d6e68e5..fa04efa 100644
--- a/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java
+++ b/media/sse/src/main/java/org/glassfish/jersey/media/sse/internal/SseEventSinkValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* {@link ValueParamProvider} for binding {@link SseEventSink} to its implementation.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class SseEventSinkValueParamProvider extends AbstractValueParamProvider {
diff --git a/media/sse/src/main/resources/META-INF/services/javax.ws.rs.sse.SseEventSource.Builder b/media/sse/src/main/resources/META-INF/services/javax.ws.rs.sse.SseEventSource$Builder
similarity index 100%
rename from media/sse/src/main/resources/META-INF/services/javax.ws.rs.sse.SseEventSource.Builder
rename to media/sse/src/main/resources/META-INF/services/javax.ws.rs.sse.SseEventSource$Builder
diff --git a/media/sse/src/test/java/org/glassfish/jersey/media/sse/ClientCloseTest.java b/media/sse/src/test/java/org/glassfish/jersey/media/sse/ClientCloseTest.java
index 7fb22d2..996d32e 100644
--- a/media/sse/src/test/java/org/glassfish/jersey/media/sse/ClientCloseTest.java
+++ b/media/sse/src/test/java/org/glassfish/jersey/media/sse/ClientCloseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -39,7 +39,7 @@
import static junit.framework.TestCase.assertTrue;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class ClientCloseTest extends JerseyTest {
diff --git a/media/sse/src/test/java/org/glassfish/jersey/media/sse/EventSourceTest.java b/media/sse/src/test/java/org/glassfish/jersey/media/sse/EventSourceTest.java
index 75b6de5..842ae17 100644
--- a/media/sse/src/test/java/org/glassfish/jersey/media/sse/EventSourceTest.java
+++ b/media/sse/src/test/java/org/glassfish/jersey/media/sse/EventSourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -40,7 +40,7 @@
import static junit.framework.TestCase.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class EventSourceTest extends JerseyTest {
diff --git a/media/sse/src/test/java/org/glassfish/jersey/media/sse/OutboundEventTest.java b/media/sse/src/test/java/org/glassfish/jersey/media/sse/OutboundEventTest.java
index d38827b..c5af425 100644
--- a/media/sse/src/test/java/org/glassfish/jersey/media/sse/OutboundEventTest.java
+++ b/media/sse/src/test/java/org/glassfish/jersey/media/sse/OutboundEventTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
/**
* Basic set of unit tests for OutboundEvent creation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class OutboundEventTest {
@Test
diff --git a/media/sse/src/test/java/org/glassfish/jersey/media/sse/SseEventSinkCloseTest.java b/media/sse/src/test/java/org/glassfish/jersey/media/sse/SseEventSinkCloseTest.java
index 968699e..f6afa45 100644
--- a/media/sse/src/test/java/org/glassfish/jersey/media/sse/SseEventSinkCloseTest.java
+++ b/media/sse/src/test/java/org/glassfish/jersey/media/sse/SseEventSinkCloseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -46,7 +46,7 @@
/**
* Test, that {@code SseEventSink} and the connection is closed eventually after closing {@code SseEventSource} on client side.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class SseEventSinkCloseTest extends JerseyTest {
diff --git a/media/sse/src/test/java/org/glassfish/jersey/media/sse/SseEventSinkTest.java b/media/sse/src/test/java/org/glassfish/jersey/media/sse/SseEventSinkTest.java
index 2f00ac2..b6059ff 100644
--- a/media/sse/src/test/java/org/glassfish/jersey/media/sse/SseEventSinkTest.java
+++ b/media/sse/src/test/java/org/glassfish/jersey/media/sse/SseEventSinkTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class SseEventSinkTest extends JerseyTest {
diff --git a/media/sse/src/test/java/org/glassfish/jersey/media/sse/internal/JerseyEventSinkTest.java b/media/sse/src/test/java/org/glassfish/jersey/media/sse/internal/JerseyEventSinkTest.java
index 2bc839f..465227a 100644
--- a/media/sse/src/test/java/org/glassfish/jersey/media/sse/internal/JerseyEventSinkTest.java
+++ b/media/sse/src/test/java/org/glassfish/jersey/media/sse/internal/JerseyEventSinkTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -21,7 +21,7 @@
import org.junit.rules.ExpectedException;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class JerseyEventSinkTest {
diff --git a/media/sse/src/test/java/org/glassfish/jersey/media/sse/internal/JerseySseBroadcasterTest.java b/media/sse/src/test/java/org/glassfish/jersey/media/sse/internal/JerseySseBroadcasterTest.java
index f698fc8..0e5c635 100644
--- a/media/sse/src/test/java/org/glassfish/jersey/media/sse/internal/JerseySseBroadcasterTest.java
+++ b/media/sse/src/test/java/org/glassfish/jersey/media/sse/internal/JerseySseBroadcasterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -31,7 +31,7 @@
/**
* {@link javax.ws.rs.sse.SseBroadcaster} test.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class JerseySseBroadcasterTest {
diff --git a/pom.xml b/pom.xml
index 8810f3b..c678a46 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
<packaging>pom</packaging>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<name>jersey</name>
<description>
Eclipse Jersey is the open source (under dual EPL+GPL license) JAX-RS 2.1 (JSR 370)
@@ -302,7 +302,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
+ <version>3.8.0</version>
<inherited>true</inherited>
<configuration>
<source>${java.version}</source>
@@ -403,12 +403,29 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.18.1</version>
+ <version>${surefire.version}</version>
<configuration>
<!-- for convenience reasons, 'argLine' should not be overridden in child poms. if needed, a property should be declared and used here -->
- <argLine>-Xmx${surefire.maxmem.argline}m -Dfile.encoding=UTF8 ${surefire.security.argline} ${surefire.coverage.argline}</argLine>
+ <argLine>
+ -Xmx${surefire.maxmem.argline}m -Dfile.encoding=UTF8 ${surefire.security.argline} ${surefire.coverage.argline}
+ </argLine>
<skipTests>${skip.tests}</skipTests>
</configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-logger-api</artifactId>
+ <version>3.0.0-M3</version>
+ <!-- to get around bug https://github.com/junit-team/junit5/issues/1367 -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-api</artifactId>
+ <version>3.0.0-M3</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -504,7 +521,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.3</version>
+ <version>3.7.1</version>
<configuration>
<generateProjectInfo>false</generateProjectInfo>
<generateReports>true</generateReports>
@@ -590,7 +607,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
- <version>2.16</version>
+ <version>3.0.0-M3</version>
<configuration>
<skipTests>${skip.tests}</skipTests>
<skipITs>${skip.tests}</skipITs>
@@ -813,6 +830,86 @@
<profiles>
<profile>
+ <id>jdk8</id>
+ <activation>
+ <jdk>1.8</jdk>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ <excludes>
+ <exclude>module-info.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ <profile>
+ <id>jdk11+</id>
+ <!--
+ JDK 9 & 10 is unsupported (as well as <release>9</release>)
+ module-info for java.xml.bind is taken from JDK (lib/ct.sym/9-modules)
+ and it depends on java.activation which clashes with javax.activation
+ -->
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.activation</groupId>
+ <artifactId>jakarta.activation</artifactId>
+ <version>${jakarta.activation.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+<!-- when module.info
+ <execution>
+ <id>default-compile</id>
+ <configuration>
+ compile everything to ensure module-info contains right entries
+ <release>11</release>
+ </configuration>
+ </execution>
+-->
+ <execution>
+ <id>base-compile</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <!-- recompile everything for target VM except the module-info.java -->
+ <configuration>
+ <excludes>
+ <exclude>module-info.java</exclude>
+ </excludes>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ <profile>
<!-- Use it with release-perform goal to skip another test run. -->
<id>testsSkip</id>
<activation>
@@ -1053,6 +1150,7 @@
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <excludes>**/module-info.java</excludes>
</configuration>
</execution>
</executions>
@@ -1418,13 +1516,17 @@
<dependency>
<groupId>org.glassfish.hk2</groupId>
- <artifactId>hk2-bom</artifactId>
+ <artifactId>hk2-locator</artifactId>
<version>${hk2.version}</version>
- <scope>import</scope>
- <type>pom</type>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
+ <artifactId>hk2-utils</artifactId>
+ <version>${hk2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-api</artifactId>
<version>${hk2.version}</version>
<exclusions>
@@ -1437,7 +1539,12 @@
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>osgi-resource-locator</artifactId>
- <version>1.0.1</version>
+ <version>1.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.main.hk2</groupId>
+ <artifactId>hk2-config</artifactId>
+ <version>${hk2.config.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.hk2</groupId>
@@ -1673,7 +1780,7 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
- <version>${osgi.version}</version>
+ <version>${osgi.compendium.version}</version>
<scope>provided</scope>
</dependency>
@@ -1778,8 +1885,8 @@
</dependency>
<dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
<version>${javax.validation.api.version}</version>
</dependency>
@@ -1889,7 +1996,8 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
- <version>4.2.1</version>
+ <!--5.2.0+ does not work with moxy osgi functional tests-->
+ <version>5.0.1</version>
<scope>test</scope>
</dependency>
@@ -1966,10 +2074,11 @@
<jersey.version>${project.version}</jersey.version>
<!-- asm is now source integrated - keeping this property to see the version -->
<!-- see core-server/src/main/java/jersey/repackaged/asm/.. -->
- <asm.version>5.0.4</asm.version>
+ <asm.version>7.1</asm.version>
<bnd.plugin.version>2.3.6</bnd.plugin.version>
<cdi.api.version>1.1</cdi.api.version>
<commons-lang3.version>3.3.2</commons-lang3.version>
+ <config.version>1.2.1</config.version>
<checkstyle.mvn.plugin.version>2.16</checkstyle.mvn.plugin.version>
<checkstyle.version>6.8.1</checkstyle.version>
<easymock.version>3.3</easymock.version>
@@ -1977,53 +2086,61 @@
<gf.impl.version>5.1.0-RC2</gf.impl.version>
<fasterxml.classmate.version>1.3.3</fasterxml.classmate.version>
<findbugs.glassfish.version>1.7</findbugs.glassfish.version>
- <findbugs.version>3.0.3</findbugs.version>
+ <findbugs.version>3.0.4</findbugs.version>
<freemarker.version>2.3.27-incubating</freemarker.version>
<gae.version>1.9.59</gae.version>
<grizzly.client.version>1.16</grizzly.client.version>
<grizzly2.version>2.4.4</grizzly2.version>
<guava.version>18.0</guava.version>
<hamcrest.version>1.3</hamcrest.version>
+ <helidon.version>1.0.3</helidon.version>
<xmlunit.version>1.6</xmlunit.version>
- <hk2.version>2.5.0</hk2.version>
- <hk2.config.version>5.1.0-RC2</hk2.config.version>
- <httpclient.version>4.5</httpclient.version> <!-- TODO: 4.5.2 doesn't work; apache client connector tests -->
- <jackson.version>2.9.8</jackson.version>
+ <hk2.version>2.6.1</hk2.version>
+ <hk2.osgi.version>org.glassfish.hk2.*;version="[2.5,3)"</hk2.osgi.version>
+ <hk2.jvnet.osgi.version>org.jvnet.hk2.*;version="[2.5,3)"</hk2.jvnet.osgi.version>
+ <hk2.config.version>5.1.0</hk2.config.version>
+ <httpclient.version>4.5.9</httpclient.version>
+ <istack.commons.runtime.version>3.0.8</istack.commons.runtime.version>
+ <jackson.version>2.9.9</jackson.version>
<jackson1.version>1.9.13</jackson1.version>
- <javassist.version>3.22.0-GA</javassist.version>
- <javax.annotation.version>1.3.4</javax.annotation.version>
- <javax.el.version>3.0.2</javax.el.version>
+ <jakarta.activation.version>1.2.1</jakarta.activation.version>
+ <javassist.version>3.25.0-GA</javassist.version>
+ <javax.annotation.osgi.version>javax.annotation.*;version="[1.2,3)"</javax.annotation.osgi.version>
+ <javax.annotation.version>1.3.5</javax.annotation.version>
+ <javax.el.version>3.0.3</javax.el.version>
<javax.el.impl.version>3.0.2</javax.el.impl.version>
- <javax.interceptor.version>1.2.4</javax.interceptor.version>
- <javax.persistence.version>2.2.2</javax.persistence.version>
- <javax.validation.api.version>2.0.1.Final</javax.validation.api.version>
+ <javax.interceptor.version>1.2.5</javax.interceptor.version>
+ <javax.persistence.version>2.2.3</javax.persistence.version>
+ <javax.validation.api.version>2.0.2</javax.validation.api.version>
<jaxb.api.version>2.3.2</jaxb.api.version>
<jaxb.ri.version>2.3.2</jaxb.ri.version>
- <jsonb.api.version>1.0.1</jsonb.api.version>
- <jaxrs.api.spec.version>2.2-SNAPSHOT</jaxrs.api.spec.version>
- <jaxrs.api.impl.version>2.2-SNAPSHOT</jaxrs.api.impl.version>
+ <jsonb.api.version>1.0.2</jsonb.api.version>
+ <jaxrs.api.spec.version>2.2</jaxrs.api.spec.version>
+ <jaxrs.api.impl.version>2.2-20190531.094237-24</jaxrs.api.impl.version>
<jboss.logging.version>3.3.0.Final</jboss.logging.version>
<jersey1.version>1.19.3</jersey1.version>
<jersey1.last.final.version>${jersey1.version}</jersey1.last.final.version>
<jettison.version>1.3.7</jettison.version> <!-- TODO: 1.3.8 doesn't work; AbstractJsonTest complexBeanWithAttributes -->
<jetty.plugin.version>6.1.26</jetty.plugin.version>
- <jetty.version>9.4.12.v20180830</jetty.version>
+ <jetty.version>9.4.17.v20190418</jetty.version>
<jetty.servlet.api.25.version>6.1.14</jetty.servlet.api.25.version>
<jmh.version>1.10.2</jmh.version>
- <jmockit.version>1.41</jmockit.version>
+ <jmockit.version>1.44</jmockit.version>
<jsonp.ri.version>1.1.5</jsonp.ri.version>
<jsonp.jaxrs.version>1.1.5</jsonp.jaxrs.version>
- <jsp.version>2.3.5</jsp.version>
- <jstl.version>1.2.4</jstl.version>
- <jta.api.version>1.3.2</jta.api.version>
+ <jsp.version>2.3.6</jsp.version>
+ <jstl.version>1.2.7</jstl.version>
+ <jta.api.version>1.3.3</jta.api.version>
<kryo.version>4.0.1</kryo.version>
<mimepull.version>1.9.11</mimepull.version>
<mockito.version>1.10.19</mockito.version>
<moxy.version>2.7.4</moxy.version>
<mustache.version>0.8.17</mustache.version>
- <netty.version>4.1.5.Final</netty.version>
+ <netty.version>4.1.31.Final</netty.version>
+ <nexus-staging.mvn.plugin.version>1.6.7</nexus-staging.mvn.plugin.version>
<opentracing.version>0.30.0</opentracing.version>
- <osgi.version>4.2.0</osgi.version>
+ <osgi.version>6.0.0</osgi.version>
+ <osgi.compendium.version>5.0.0</osgi.compendium.version>
<pax.exam.version>4.9.1</pax.exam.version>
<pax.web.version>0.7.4</pax.web.version><!-- TODO: UPGRADE! -->
<paxexam.mvn.plugin.version>1.2.4</paxexam.mvn.plugin.version>
@@ -2031,15 +2148,17 @@
<rxjava2.version>2.0.4</rxjava2.version>
<servlet2.version>2.4</servlet2.version>
<servlet3.version>3.0.1</servlet3.version>
- <servlet4.version>4.0.2</servlet4.version>
+ <servlet4.version>4.0.3</servlet4.version>
<simple.version>6.0.1</simple.version>
+ <skip.e2e>false</skip.e2e>
<slf4j.version>1.7.21</slf4j.version>
<spring4.version>4.3.20.RELEASE</spring4.version>
- <validation.impl.version>6.0.11.Final</validation.impl.version>
+ <spring5.version>5.1.5.RELEASE</spring5.version>
+ <surefire.version>3.0.0-M3</surefire.version>
+ <validation.impl.version>6.0.17.Final</validation.impl.version>
<weld.version>2.2.14.Final</weld.version> <!-- 2.4.1 doesn't work - bv tests -->
<weld3.version>3.0.0.Final</weld3.version>
<xerces.version>2.11.0</xerces.version>
<yasson.version>1.0.3</yasson.version>
- <skip.e2e>false</skip.e2e>
</properties>
</project>
diff --git a/security/oauth1-client/pom.xml b/security/oauth1-client/pom.xml
index b0056d9..5c8aea6 100644
--- a/security/oauth1-client/pom.xml
+++ b/security/oauth1-client/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.security</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>oauth1-client</artifactId>
diff --git a/security/oauth1-server/pom.xml b/security/oauth1-server/pom.xml
index c4af812..ad59fd6 100644
--- a/security/oauth1-server/pom.xml
+++ b/security/oauth1-server/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.security</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>oauth1-server</artifactId>
diff --git a/security/oauth1-server/src/test/java/org/glassfish/jersey/server/oauth1/OAuth1ExceptionTest.java b/security/oauth1-server/src/test/java/org/glassfish/jersey/server/oauth1/OAuth1ExceptionTest.java
index 967f874..aee7db5 100644
--- a/security/oauth1-server/src/test/java/org/glassfish/jersey/server/oauth1/OAuth1ExceptionTest.java
+++ b/security/oauth1-server/src/test/java/org/glassfish/jersey/server/oauth1/OAuth1ExceptionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -26,7 +26,7 @@
/**
* {@link OAuth1Exception} unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class OAuth1ExceptionTest {
/**
diff --git a/security/oauth1-signature/pom.xml b/security/oauth1-signature/pom.xml
index 1871060..1d030cc 100644
--- a/security/oauth1-signature/pom.xml
+++ b/security/oauth1-signature/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.glassfish.jersey.security</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/security/oauth2-client/pom.xml b/security/oauth2-client/pom.xml
index 30c571f..3e545f3 100644
--- a/security/oauth2-client/pom.xml
+++ b/security/oauth2-client/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.glassfish.jersey.security</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/security/pom.xml b/security/pom.xml
index 6f36067..785812e 100644
--- a/security/pom.xml
+++ b/security/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.security</groupId>
diff --git a/test-framework/core/pom.xml b/test-framework/core/pom.xml
index d2860e0..7f563ae 100644
--- a/test-framework/core/pom.xml
+++ b/test-framework/core/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-test-framework-core</artifactId>
diff --git a/test-framework/core/src/main/java/org/glassfish/jersey/test/DeploymentContext.java b/test-framework/core/src/main/java/org/glassfish/jersey/test/DeploymentContext.java
index 90bae2b..8f3dbbd 100644
--- a/test-framework/core/src/main/java/org/glassfish/jersey/test/DeploymentContext.java
+++ b/test-framework/core/src/main/java/org/glassfish/jersey/test/DeploymentContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -44,7 +44,7 @@
* </p>
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.8
*/
public class DeploymentContext {
diff --git a/test-framework/core/src/main/java/org/glassfish/jersey/test/JerseyTest.java b/test-framework/core/src/main/java/org/glassfish/jersey/test/JerseyTest.java
index ab7954c..e6c0c74 100644
--- a/test-framework/core/src/main/java/org/glassfish/jersey/test/JerseyTest.java
+++ b/test-framework/core/src/main/java/org/glassfish/jersey/test/JerseyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -113,9 +113,9 @@
*
* @author Paul Sandoz
* @author Srinivas Bhimisetty
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@SuppressWarnings("UnusedDeclaration")
public abstract class JerseyTest {
@@ -182,6 +182,7 @@
// not be set soon enough
this.context = configureDeployment();
this.testContainerFactory = getTestContainerFactory();
+ registerLogHandlerIfEnabled();
}
/**
@@ -203,6 +204,7 @@
// not be set soon enough
this.context = configureDeployment();
this.testContainerFactory = testContainerFactory;
+ registerLogHandlerIfEnabled();
}
/**
@@ -227,6 +229,7 @@
public JerseyTest(final Application jaxrsApplication) {
this.context = DeploymentContext.newInstance(jaxrsApplication);
this.testContainerFactory = getTestContainerFactory();
+ registerLogHandlerIfEnabled();
}
/**
@@ -577,10 +580,6 @@
*/
@Before
public void setUp() throws Exception {
- if (isLogRecordingEnabled()) {
- registerLogHandler();
- }
-
final TestContainer testContainer = createTestContainer(context);
// Set current instance of test container and start it.
@@ -796,6 +795,16 @@
}
/**
+ * Register {@link Handler log handler} to the list of root loggers
+ * if log recording is enabled.
+ */
+ private void registerLogHandlerIfEnabled() {
+ if (isLogRecordingEnabled()) {
+ registerLogHandler();
+ }
+ }
+
+ /**
* Register {@link Handler log handler} to the list of root loggers.
*/
private void registerLogHandler() {
diff --git a/test-framework/core/src/main/java/org/glassfish/jersey/test/ServletDeploymentContext.java b/test-framework/core/src/main/java/org/glassfish/jersey/test/ServletDeploymentContext.java
index a000935..143ad1b 100644
--- a/test-framework/core/src/main/java/org/glassfish/jersey/test/ServletDeploymentContext.java
+++ b/test-framework/core/src/main/java/org/glassfish/jersey/test/ServletDeploymentContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -62,7 +62,7 @@
* </p>
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @since 2.8
*/
@SuppressWarnings("MethodOverridesStaticMethodOfSuperclass")
diff --git a/test-framework/core/src/main/java/org/glassfish/jersey/test/TestProperties.java b/test-framework/core/src/main/java/org/glassfish/jersey/test/TestProperties.java
index 7c1c6e4..affbb8c 100644
--- a/test-framework/core/src/main/java/org/glassfish/jersey/test/TestProperties.java
+++ b/test-framework/core/src/main/java/org/glassfish/jersey/test/TestProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
/**
* Jersey test framework configuration properties.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@PropertiesClass
public final class TestProperties {
diff --git a/test-framework/core/src/main/java/org/glassfish/jersey/test/spi/TestContainerFactory.java b/test-framework/core/src/main/java/org/glassfish/jersey/test/spi/TestContainerFactory.java
index 9b5fec8..3b538fd 100644
--- a/test-framework/core/src/main/java/org/glassfish/jersey/test/spi/TestContainerFactory.java
+++ b/test-framework/core/src/main/java/org/glassfish/jersey/test/spi/TestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +24,7 @@
* A test container factory responsible for creating test containers.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface TestContainerFactory {
diff --git a/test-framework/core/src/test/java/org/glassfish/jersey/test/JerseyTestTest.java b/test-framework/core/src/test/java/org/glassfish/jersey/test/JerseyTestTest.java
index 6a7139d..08e873e 100644
--- a/test-framework/core/src/test/java/org/glassfish/jersey/test/JerseyTestTest.java
+++ b/test-framework/core/src/test/java/org/glassfish/jersey/test/JerseyTestTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -36,8 +36,8 @@
/**
* {@link org.glassfish.jersey.test.JerseyTest} unit tests.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class JerseyTestTest {
diff --git a/test-framework/maven/container-runner-maven-plugin/pom.xml b/test-framework/maven/container-runner-maven-plugin/pom.xml
index 94d5419..8a15278 100644
--- a/test-framework/maven/container-runner-maven-plugin/pom.xml
+++ b/test-framework/maven/container-runner-maven-plugin/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework.maven</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>container-runner-maven-plugin</artifactId>
@@ -36,11 +36,11 @@
</description>
<properties>
- <groovy.version>2.4.3</groovy.version>
+ <groovy.version>2.4.9</groovy.version>
<groovy-eclipse-compiler.version>2.9.2-01</groovy-eclipse-compiler.version>
- <groovy-eclipse-batch.version>2.3.7-01</groovy-eclipse-batch.version>
- <maven.version>3.3.3</maven.version>
- <maven-plugin.version>3.5</maven-plugin.version>
+ <groovy-eclipse-batch.version>2.5.7-01</groovy-eclipse-batch.version>
+ <maven.version>3.6.0</maven.version>
+ <maven-plugin.version>3.6.0</maven-plugin.version>
</properties>
<dependencies>
@@ -98,7 +98,7 @@
<dependency>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
- <version>1.6</version>
+ <version>1.7.0</version>
</dependency>
<dependency>
@@ -118,6 +118,12 @@
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>27.0.1-jre</version>
+ </dependency>
+
</dependencies>
<build>
diff --git a/test-framework/maven/container-runner-maven-plugin/src/main/groovy/org/glassfish/jersey/test/maven/runner/ShellMojoExecutionException.java b/test-framework/maven/container-runner-maven-plugin/src/main/groovy/org/glassfish/jersey/test/maven/runner/ShellMojoExecutionException.java
index 551c89c..c571cae 100644
--- a/test-framework/maven/container-runner-maven-plugin/src/main/groovy/org/glassfish/jersey/test/maven/runner/ShellMojoExecutionException.java
+++ b/test-framework/maven/container-runner-maven-plugin/src/main/groovy/org/glassfish/jersey/test/maven/runner/ShellMojoExecutionException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
/**
* Mojo Execution exception that contains additional information regarding an error from an executed shell script.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class ShellMojoExecutionException extends MojoExecutionException {
diff --git a/test-framework/maven/custom-enforcer-rules/pom.xml b/test-framework/maven/custom-enforcer-rules/pom.xml
index cdac1d7..e820829 100644
--- a/test-framework/maven/custom-enforcer-rules/pom.xml
+++ b/test-framework/maven/custom-enforcer-rules/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework.maven</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>custom-enforcer-rules</artifactId>
diff --git a/test-framework/maven/custom-enforcer-rules/src/main/java/org/glassfish/jersey/test/maven/rule/FilePatternDoesNotExistRule.java b/test-framework/maven/custom-enforcer-rules/src/main/java/org/glassfish/jersey/test/maven/rule/FilePatternDoesNotExistRule.java
index cf00e71..604cfcf 100644
--- a/test-framework/maven/custom-enforcer-rules/src/main/java/org/glassfish/jersey/test/maven/rule/FilePatternDoesNotExistRule.java
+++ b/test-framework/maven/custom-enforcer-rules/src/main/java/org/glassfish/jersey/test/maven/rule/FilePatternDoesNotExistRule.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -31,7 +31,7 @@
* Maven enforcer rule to enforce that given set of files does not exist.<br/>
* This rule is similar to apache {@code requireFilesDontExist} with a support for wildcards.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class FilePatternDoesNotExistRule extends AbstractNonCacheableEnforcerRule {
diff --git a/test-framework/maven/custom-enforcer-rules/src/main/java/org/glassfish/jersey/test/maven/rule/PatternNotMatchedInFileRule.java b/test-framework/maven/custom-enforcer-rules/src/main/java/org/glassfish/jersey/test/maven/rule/PatternNotMatchedInFileRule.java
index 0377181..8872e15 100644
--- a/test-framework/maven/custom-enforcer-rules/src/main/java/org/glassfish/jersey/test/maven/rule/PatternNotMatchedInFileRule.java
+++ b/test-framework/maven/custom-enforcer-rules/src/main/java/org/glassfish/jersey/test/maven/rule/PatternNotMatchedInFileRule.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -37,7 +37,7 @@
* <p/>
* This is equivalent to shell pseudo-script: {code grep PATTERN FILE && 'raise error'}
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class PatternNotMatchedInFileRule extends AbstractNonCacheableEnforcerRule {
diff --git a/test-framework/maven/custom-enforcer-rules/src/test/java/org/glassfish/jersey/test/maven/rule/FilePatternDoesNotExistRuleTest.java b/test-framework/maven/custom-enforcer-rules/src/test/java/org/glassfish/jersey/test/maven/rule/FilePatternDoesNotExistRuleTest.java
index b5f4c5e..301369a 100644
--- a/test-framework/maven/custom-enforcer-rules/src/test/java/org/glassfish/jersey/test/maven/rule/FilePatternDoesNotExistRuleTest.java
+++ b/test-framework/maven/custom-enforcer-rules/src/test/java/org/glassfish/jersey/test/maven/rule/FilePatternDoesNotExistRuleTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Basic sanity test of {@link FilePatternDoesNotExistRule} enforcer rule.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class FilePatternDoesNotExistRuleTest {
diff --git a/test-framework/maven/custom-enforcer-rules/src/test/java/org/glassfish/jersey/test/maven/rule/PatternNotMatchedInFileRuleTest.java b/test-framework/maven/custom-enforcer-rules/src/test/java/org/glassfish/jersey/test/maven/rule/PatternNotMatchedInFileRuleTest.java
index 343a733..1897a2b 100644
--- a/test-framework/maven/custom-enforcer-rules/src/test/java/org/glassfish/jersey/test/maven/rule/PatternNotMatchedInFileRuleTest.java
+++ b/test-framework/maven/custom-enforcer-rules/src/test/java/org/glassfish/jersey/test/maven/rule/PatternNotMatchedInFileRuleTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
/**
* Basic sanity test of {@link PatternNotMatchedInFileRule} enforcer rule.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class PatternNotMatchedInFileRuleTest {
diff --git a/test-framework/maven/pom.xml b/test-framework/maven/pom.xml
index a59e4fa..b8c5149 100644
--- a/test-framework/maven/pom.xml
+++ b/test-framework/maven/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.test-framework.maven</groupId>
diff --git a/test-framework/memleak-test-common/pom.xml b/test-framework/memleak-test-common/pom.xml
index 4001cfc..5e8e66c 100644
--- a/test-framework/memleak-test-common/pom.xml
+++ b/test-framework/memleak-test-common/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>memleak-test-common</artifactId>
diff --git a/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/AbstractMemoryLeakSimpleTest.java b/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/AbstractMemoryLeakSimpleTest.java
index ba506ff..149405f 100644
--- a/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/AbstractMemoryLeakSimpleTest.java
+++ b/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/AbstractMemoryLeakSimpleTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* An abstract test class that adds support for dump heap at the beginning of the test execution.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class AbstractMemoryLeakSimpleTest {
diff --git a/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/AbstractMemoryLeakWebAppTest.java b/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/AbstractMemoryLeakWebAppTest.java
index 2c68480..faede81 100644
--- a/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/AbstractMemoryLeakWebAppTest.java
+++ b/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/AbstractMemoryLeakWebAppTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Adds support for web application testing and memory leak detection in target JVM.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class AbstractMemoryLeakWebAppTest extends JerseyTest {
diff --git a/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/MemoryLeakSucceedingTimeout.java b/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/MemoryLeakSucceedingTimeout.java
index 73655e5..200b10a 100644
--- a/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/MemoryLeakSucceedingTimeout.java
+++ b/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/MemoryLeakSucceedingTimeout.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
import org.junit.runners.model.Statement;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class MemoryLeakSucceedingTimeout extends Timeout {
diff --git a/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/MemoryLeakUtils.java b/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/MemoryLeakUtils.java
index eaebfc7..e19b2c9 100644
--- a/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/MemoryLeakUtils.java
+++ b/test-framework/memleak-test-common/src/main/java/org/glassfish/jersey/test/memleak/common/MemoryLeakUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -36,7 +36,7 @@
/**
* Utility class for memory leak test infrastructure.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class MemoryLeakUtils {
diff --git a/test-framework/pom.xml b/test-framework/pom.xml
index fb0ca88..2a669cd 100644
--- a/test-framework/pom.xml
+++ b/test-framework/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.test-framework</groupId>
diff --git a/test-framework/providers/bundle/pom.xml b/test-framework/providers/bundle/pom.xml
index 928c84c..de61fb6 100644
--- a/test-framework/providers/bundle/pom.xml
+++ b/test-framework/providers/bundle/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-test-framework-provider-bundle</artifactId>
diff --git a/test-framework/providers/external/pom.xml b/test-framework/providers/external/pom.xml
index cccc2d4..4497e59 100644
--- a/test-framework/providers/external/pom.xml
+++ b/test-framework/providers/external/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-test-framework-provider-external</artifactId>
diff --git a/test-framework/providers/external/src/main/java/org/glassfish/jersey/test/external/ExternalTestContainerFactory.java b/test-framework/providers/external/src/main/java/org/glassfish/jersey/test/external/ExternalTestContainerFactory.java
index 0b7a771..97f22ce 100644
--- a/test-framework/providers/external/src/main/java/org/glassfish/jersey/test/external/ExternalTestContainerFactory.java
+++ b/test-framework/providers/external/src/main/java/org/glassfish/jersey/test/external/ExternalTestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,7 +40,7 @@
* IP address or fully-qualified domain name to the System Property <I>jersey.test.host</I>.
*
* @author Srinivas Bhimisetty
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ExternalTestContainerFactory implements TestContainerFactory {
diff --git a/test-framework/providers/grizzly2/pom.xml b/test-framework/providers/grizzly2/pom.xml
index 5bd20df..858ca50 100644
--- a/test-framework/providers/grizzly2/pom.xml
+++ b/test-framework/providers/grizzly2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-test-framework-provider-grizzly2</artifactId>
diff --git a/test-framework/providers/grizzly2/src/main/java/org/glassfish/jersey/test/grizzly/GrizzlyTestContainerFactory.java b/test-framework/providers/grizzly2/src/main/java/org/glassfish/jersey/test/grizzly/GrizzlyTestContainerFactory.java
index c9f2da1..6dcaea0 100644
--- a/test-framework/providers/grizzly2/src/main/java/org/glassfish/jersey/test/grizzly/GrizzlyTestContainerFactory.java
+++ b/test-framework/providers/grizzly2/src/main/java/org/glassfish/jersey/test/grizzly/GrizzlyTestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,7 +36,7 @@
/**
* Jersey test framework container factory implementation based on Grizzly 2.x HTTP server.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class GrizzlyTestContainerFactory implements TestContainerFactory {
diff --git a/test-framework/providers/grizzly2/src/main/java/org/glassfish/jersey/test/grizzly/GrizzlyWebTestContainerFactory.java b/test-framework/providers/grizzly2/src/main/java/org/glassfish/jersey/test/grizzly/GrizzlyWebTestContainerFactory.java
index 13d654c..1403f4d 100644
--- a/test-framework/providers/grizzly2/src/main/java/org/glassfish/jersey/test/grizzly/GrizzlyWebTestContainerFactory.java
+++ b/test-framework/providers/grizzly2/src/main/java/org/glassfish/jersey/test/grizzly/GrizzlyWebTestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -51,8 +51,8 @@
* A Servlet-based test container factory for creating test container instances using Grizzly.
*
* @author Srinivas Bhimisetty
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class GrizzlyWebTestContainerFactory implements TestContainerFactory {
diff --git a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/BaseUriTest.java b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/BaseUriTest.java
index 77a2928..e08821d 100644
--- a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/BaseUriTest.java
+++ b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/BaseUriTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -32,7 +32,7 @@
/**
* Grizzly test container base URI tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class BaseUriTest extends JerseyTest {
diff --git a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/pckg/GrizzlyPackageTest.java b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/pckg/GrizzlyPackageTest.java
index fc57bc7..cd2e4c7 100644
--- a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/pckg/GrizzlyPackageTest.java
+++ b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/pckg/GrizzlyPackageTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
* Test picking up resources for Grizzly test container via packages.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class GrizzlyPackageTest extends JerseyTest {
@Override
diff --git a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyRequestDispatchFilterTest.java b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyRequestDispatchFilterTest.java
index 78ad568..603dccf 100644
--- a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyRequestDispatchFilterTest.java
+++ b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyRequestDispatchFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -52,8 +52,8 @@
* requests that are being forwarded/included within the server side
* using {@link javax.servlet.RequestDispatcher} mechanism.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class GrizzlyRequestDispatchFilterTest extends JerseyTest {
diff --git a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebFixedRequestSizeTest.java b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebFixedRequestSizeTest.java
index 0f4bb06..e786dce 100644
--- a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebFixedRequestSizeTest.java
+++ b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebFixedRequestSizeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -36,7 +36,7 @@
import static org.junit.Assert.assertThat;
/**
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class GrizzlyWebFixedRequestSizeTest extends JerseyTest {
diff --git a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebInjectionTest.java b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebInjectionTest.java
index cc6d050..74f18a4 100644
--- a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebInjectionTest.java
+++ b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebInjectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -41,8 +41,8 @@
/**
* Test injection support in the {@link org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class GrizzlyWebInjectionTest extends JerseyTest {
diff --git a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebServletAndFilterTest.java b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebServletAndFilterTest.java
index f425918..2bfca38 100644
--- a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebServletAndFilterTest.java
+++ b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebServletAndFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -47,7 +47,7 @@
* servlet + filter deployment scenarios.
*
* @author pavel.bucek@oracle.com
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class GrizzlyWebServletAndFilterTest extends JerseyTest {
diff --git a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebTest.java b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebTest.java
index 8285055..66199d8 100644
--- a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebTest.java
+++ b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/GrizzlyWebTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -35,7 +35,7 @@
* Basic GrizzlyWebTestContainerFactory unit tests.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class GrizzlyWebTest extends JerseyTest {
diff --git a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/context/GrizzlyWebContextPathTest.java b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/context/GrizzlyWebContextPathTest.java
index 73ffa08..3caf4a1 100644
--- a/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/context/GrizzlyWebContextPathTest.java
+++ b/test-framework/providers/grizzly2/src/test/java/org/glassfish/jersey/test/grizzly/web/context/GrizzlyWebContextPathTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
* Test support for context path in {@link org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory}.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class GrizzlyWebContextPathTest extends JerseyTest {
diff --git a/test-framework/providers/inmemory/pom.xml b/test-framework/providers/inmemory/pom.xml
index 070b313..3b79cdf 100644
--- a/test-framework/providers/inmemory/pom.xml
+++ b/test-framework/providers/inmemory/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-test-framework-provider-inmemory</artifactId>
diff --git a/test-framework/providers/inmemory/src/main/java/org/glassfish/jersey/test/inmemory/InMemoryConnector.java b/test-framework/providers/inmemory/src/main/java/org/glassfish/jersey/test/inmemory/InMemoryConnector.java
index 07608da..971790a 100644
--- a/test-framework/providers/inmemory/src/main/java/org/glassfish/jersey/test/inmemory/InMemoryConnector.java
+++ b/test-framework/providers/inmemory/src/main/java/org/glassfish/jersey/test/inmemory/InMemoryConnector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -55,8 +55,8 @@
/**
* In-memory client connector.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
class InMemoryConnector implements Connector {
diff --git a/test-framework/providers/inmemory/src/main/java/org/glassfish/jersey/test/inmemory/InMemoryTestContainerFactory.java b/test-framework/providers/inmemory/src/main/java/org/glassfish/jersey/test/inmemory/InMemoryTestContainerFactory.java
index f8d1344..a71142d 100644
--- a/test-framework/providers/inmemory/src/main/java/org/glassfish/jersey/test/inmemory/InMemoryTestContainerFactory.java
+++ b/test-framework/providers/inmemory/src/main/java/org/glassfish/jersey/test/inmemory/InMemoryTestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -32,8 +32,8 @@
/**
* In-memory test container factory.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class InMemoryTestContainerFactory implements TestContainerFactory {
diff --git a/test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/InMemoryContainerTest.java b/test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/InMemoryContainerTest.java
index e94d5f6..59ecfad 100644
--- a/test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/InMemoryContainerTest.java
+++ b/test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/InMemoryContainerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
/**
* Test class for {@link InMemoryConnector}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class InMemoryContainerTest extends JerseyTest {
diff --git a/test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/internal/FollowRedirectsTest.java b/test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/internal/FollowRedirectsTest.java
index 930c9b8..511cd42 100644
--- a/test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/internal/FollowRedirectsTest.java
+++ b/test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/internal/FollowRedirectsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,7 +40,7 @@
* In-memory connector follow redirect tests.
*
* @author Martin Matula
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class FollowRedirectsTest extends JerseyTest {
@Path("/followTest")
diff --git a/test-framework/providers/jdk-http/pom.xml b/test-framework/providers/jdk-http/pom.xml
index 2f6dc4d..b4a965f 100644
--- a/test-framework/providers/jdk-http/pom.xml
+++ b/test-framework/providers/jdk-http/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-test-framework-provider-jdk-http</artifactId>
diff --git a/test-framework/providers/jdk-http/src/main/java/org/glassfish/jersey/test/jdkhttp/JdkHttpServerTestContainerFactory.java b/test-framework/providers/jdk-http/src/main/java/org/glassfish/jersey/test/jdkhttp/JdkHttpServerTestContainerFactory.java
index 8922d2e..6cca44d 100644
--- a/test-framework/providers/jdk-http/src/main/java/org/glassfish/jersey/test/jdkhttp/JdkHttpServerTestContainerFactory.java
+++ b/test-framework/providers/jdk-http/src/main/java/org/glassfish/jersey/test/jdkhttp/JdkHttpServerTestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,7 +36,7 @@
* Factory for testing {@link org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer}.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JdkHttpServerTestContainerFactory implements TestContainerFactory {
diff --git a/test-framework/providers/jetty/pom.xml b/test-framework/providers/jetty/pom.xml
index 7b90878..502e108 100644
--- a/test-framework/providers/jetty/pom.xml
+++ b/test-framework/providers/jetty/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/test-framework/providers/jetty/src/main/java/org/glassfish/jersey/test/jetty/JettyTestContainerFactory.java b/test-framework/providers/jetty/src/main/java/org/glassfish/jersey/test/jetty/JettyTestContainerFactory.java
index c506736..6ea1f25 100644
--- a/test-framework/providers/jetty/src/main/java/org/glassfish/jersey/test/jetty/JettyTestContainerFactory.java
+++ b/test-framework/providers/jetty/src/main/java/org/glassfish/jersey/test/jetty/JettyTestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Factory for testing {@link org.glassfish.jersey.jetty.JettyHttpContainer}.
*
* @author Arul Dhesiaseelan (aruld@acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JettyTestContainerFactory implements TestContainerFactory {
diff --git a/test-framework/providers/netty/pom.xml b/test-framework/providers/netty/pom.xml
index f29401a..03563ce 100644
--- a/test-framework/providers/netty/pom.xml
+++ b/test-framework/providers/netty/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-test-framework-provider-netty</artifactId>
diff --git a/test-framework/providers/netty/src/main/java/org/glassfish/jersey/test/netty/NettyTestContainerFactory.java b/test-framework/providers/netty/src/main/java/org/glassfish/jersey/test/netty/NettyTestContainerFactory.java
index e77fe0b..a22886c 100644
--- a/test-framework/providers/netty/src/main/java/org/glassfish/jersey/test/netty/NettyTestContainerFactory.java
+++ b/test-framework/providers/netty/src/main/java/org/glassfish/jersey/test/netty/NettyTestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 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
@@ -30,7 +30,7 @@
/**
* Netty test container factory.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class NettyTestContainerFactory implements TestContainerFactory {
diff --git a/test-framework/providers/pom.xml b/test-framework/providers/pom.xml
index 5c06cf1..1c9772d 100644
--- a/test-framework/providers/pom.xml
+++ b/test-framework/providers/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
diff --git a/test-framework/providers/simple/pom.xml b/test-framework/providers/simple/pom.xml
index d0788a0..516c350 100644
--- a/test-framework/providers/simple/pom.xml
+++ b/test-framework/providers/simple/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/test-framework/providers/simple/src/main/java/org/glassfish/jersey/test/simple/SimpleTestContainerFactory.java b/test-framework/providers/simple/src/main/java/org/glassfish/jersey/test/simple/SimpleTestContainerFactory.java
index de2664b..ecb35bd 100644
--- a/test-framework/providers/simple/src/main/java/org/glassfish/jersey/test/simple/SimpleTestContainerFactory.java
+++ b/test-framework/providers/simple/src/main/java/org/glassfish/jersey/test/simple/SimpleTestContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,7 +37,7 @@
* Factory for testing {@link org.glassfish.jersey.simple.SimpleContainer}.
*
* @author Arul Dhesiaseelan (aruld@acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class SimpleTestContainerFactory implements TestContainerFactory {
diff --git a/test-framework/util/pom.xml b/test-framework/util/pom.xml
index 7e2c33c..eb4e0a8 100644
--- a/test-framework/util/pom.xml
+++ b/test-framework/util/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-test-framework-util</artifactId>
diff --git a/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/ConcurrentParameterizedRunner.java b/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/ConcurrentParameterizedRunner.java
index 228c09c..a62a586 100644
--- a/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/ConcurrentParameterizedRunner.java
+++ b/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/ConcurrentParameterizedRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -43,7 +43,7 @@
* tests to run in parallel. This runner will probably
* be merged into {@link ConcurrentRunner} in the future.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Beta
public class ConcurrentParameterizedRunner extends BlockJUnit4ClassRunner {
diff --git a/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/ConcurrentRunner.java b/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/ConcurrentRunner.java
index c4676d2..f4f4d5f 100644
--- a/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/ConcurrentRunner.java
+++ b/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/ConcurrentRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -54,7 +54,7 @@
* from parallel processing, and will be invoked
* as if no special concurrent runner was involved.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Beta
diff --git a/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/RunSeparately.java b/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/RunSeparately.java
index 64cd2c3..9dee038 100644
--- a/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/RunSeparately.java
+++ b/test-framework/util/src/main/java/org/glassfish/jersey/test/util/runner/RunSeparately.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
* fashion. This is only taken into account when the test class is being processed
* by any of Jersey provided parallel test runner {@link ConcurrentRunner}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
diff --git a/test-framework/util/src/test/java/org/glassfish/jersey/test/util/runner/ConcurrentRunnerTest.java b/test-framework/util/src/test/java/org/glassfish/jersey/test/util/runner/ConcurrentRunnerTest.java
index 3a0c052..41f0ac5 100644
--- a/test-framework/util/src/test/java/org/glassfish/jersey/test/util/runner/ConcurrentRunnerTest.java
+++ b/test-framework/util/src/test/java/org/glassfish/jersey/test/util/runner/ConcurrentRunnerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test concurrent runner invokes all test methods.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(ConcurrentRunner.class)
public class ConcurrentRunnerTest extends TestCase {
diff --git a/tests/e2e-client/pom.xml b/tests/e2e-client/pom.xml
index b6251ed..4f60dd0 100644
--- a/tests/e2e-client/pom.xml
+++ b/tests/e2e-client/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>e2e-client</artifactId>
@@ -197,6 +197,23 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <!-- https://bugs.openjdk.java.net/browse/JDK-8211426 -->
+ <surefire.security.argline>-Djdk.tls.server.protocols=TLSv1.2</surefire.security.argline>
+ </properties>
+ </profile>
+ <profile>
<id>xdk</id>
<properties>
<!-- do not use security manager for xdk -->
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/AbortResponseClientTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/AbortResponseClientTest.java
index d312a3c..b3e1863 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/AbortResponseClientTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/AbortResponseClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,6 +22,8 @@
import java.util.Date;
import java.util.Map;
+import javax.json.Json;
+import javax.json.JsonString;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.client.ClientRequestContext;
@@ -41,7 +43,10 @@
import org.glassfish.jersey.test.JerseyTest;
import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
/**
* Tests aborting the request on the client side.
@@ -107,6 +112,23 @@
assertEquals(99, r.getLength());
assertEquals(200, r.getStatus());
+ r.close();
+ }
+
+ @Test
+ public void testAbortWithJson() {
+ final JsonString jsonString = Json.createValue("{\"key\":\"value\"}");
+ ClientRequestFilter filter = new ClientRequestFilter() {
+ @Override
+ public void filter(ClientRequestContext requestContext) throws IOException {
+ requestContext.abortWith(Response.ok(jsonString).build());
+ }
+ };
+ WebTarget target = target().path("test").register(filter);
+ try (Response response = target.request().get()){
+ assertThat(response.getMediaType(), is(MediaType.APPLICATION_JSON_TYPE));
+ assertThat(response.readEntity(JsonString.class), is(jsonString));
+ };
}
private Date getDate() {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/BasicClientTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/BasicClientTest.java
index 996adb1..4726707 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/BasicClientTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/BasicClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -65,7 +65,7 @@
* Tests sync and async client invocations.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class BasicClientTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/CancelFutureClientTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/CancelFutureClientTest.java
index af0ade7..bd9990f 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/CancelFutureClientTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/CancelFutureClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -45,7 +45,7 @@
* {@link javax.ws.rs.client.InvocationCallback#failed(Throwable)} callback method.
* </p>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class CancelFutureClientTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ChunkedInputStreamClosedPrematurelyTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ChunkedInputStreamClosedPrematurelyTest.java
index 11f5c31..5c74b8d 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ChunkedInputStreamClosedPrematurelyTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ChunkedInputStreamClosedPrematurelyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -64,8 +64,8 @@
* in chunked mode should not lead to the same behavior on the server side,
* as if no exception occurred at all.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class ChunkedInputStreamClosedPrematurelyTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientBufferingDisabledTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientBufferingDisabledTest.java
index 4a21864..f9c6adf 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientBufferingDisabledTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientBufferingDisabledTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -48,7 +48,7 @@
* {@link org.glassfish.jersey.client.HttpUrlConnectorProvider}.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@RunWith(ConcurrentRunner.class)
public class ClientBufferingDisabledTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientExecutorCloseTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientExecutorCloseTest.java
index 76c2d3f..e6a09b6 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientExecutorCloseTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientExecutorCloseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -36,7 +36,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Petr Janouch (petr.janouch at oracle.com)
+ * @author Petr Janouch
*/
public class ClientExecutorCloseTest extends JerseyTest {
private static CountDownLatch cdl = new CountDownLatch(2);
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientExecutorTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientExecutorTest.java
index 617b2a0..81442ef 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientExecutorTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientExecutorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -50,7 +50,7 @@
import static org.junit.Assert.assertNotNull;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ClientExecutorTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientFilterTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientFilterTest.java
index af4290b..9918ad4 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientFilterTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ClientFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,7 +44,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ClientFilterTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpDigestAuthFilterTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpDigestAuthFilterTest.java
index 14aaee9..8e6bfd9 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpDigestAuthFilterTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpDigestAuthFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -43,7 +43,7 @@
/**
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Stefan Katerkamp <stefan at katerkamp.de>
*/
public class HttpDigestAuthFilterTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpHeadersInjectionTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpHeadersInjectionTest.java
new file mode 100644
index 0000000..b2ff0c7
--- /dev/null
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpHeadersInjectionTest.java
@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.client;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientRequestFilter;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.MessageBodyReader;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.ReaderInterceptor;
+import javax.ws.rs.ext.ReaderInterceptorContext;
+import javax.ws.rs.ext.WriterInterceptor;
+import javax.ws.rs.ext.WriterInterceptorContext;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+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 static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public class HttpHeadersInjectionTest extends JerseyTest {
+ public static final String HEADER_NAME = "UserHeader";
+
+ @Override
+ protected Application configure() {
+ return new ResourceConfig(Resource.class);
+ }
+
+ @Path("/")
+ public static class Resource {
+ @Context
+ HttpHeaders headers;
+
+ @POST
+ public Response get(int i) {
+ return Response.ok(i).header(HEADER_NAME, String.valueOf(i + 1)).build();
+ }
+ }
+
+ public static class HttpHeadersFilter implements ClientRequestFilter {
+
+ @Context
+ HttpHeaders headers;
+
+ @Override
+ public void filter(ClientRequestContext requestContext) throws IOException {
+ requestContext.abortWith(Response.ok(headers.getHeaderString(HEADER_NAME)).build());
+ }
+ }
+
+ public static class HttpHeadersResponseFilter implements ClientResponseFilter {
+
+ @Context
+ HttpHeaders headers;
+
+ private static int headerValue = 0;
+
+ public int getHeaderValue() {
+ return headerValue;
+ }
+
+ @Override
+ public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
+ headerValue = Integer.parseInt(headers.getHeaderString(HEADER_NAME));
+ }
+ }
+
+ @Produces(MediaType.TEXT_PLAIN)
+ public static class StringWriter implements MessageBodyWriter<String> {
+ @Context
+ HttpHeaders headers;
+
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return true;
+ }
+
+ @Override
+ public void writeTo(String s, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
+ MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException,
+ WebApplicationException {
+ entityStream.write(headers.getHeaderString(HEADER_NAME).getBytes());
+ entityStream.flush();
+ }
+ }
+
+ @Consumes({MediaType.TEXT_PLAIN})
+ public static class StringReader implements MessageBodyReader<String> {
+
+ @Context
+ HttpHeaders headers;
+
+ @Override
+ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return true;
+ }
+
+ @Override
+ public String readFrom(Class<String> type, Type genericType, Annotation[] annotations, MediaType mediaType,
+ MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException,
+ WebApplicationException {
+ return headers.getHeaderString(HEADER_NAME);
+ }
+ }
+
+ public static class HttpHeadersReaderInterceptor implements ReaderInterceptor {
+
+ @Context
+ HttpHeaders headers;
+
+ @Override
+ public Object aroundReadFrom(ReaderInterceptorContext context) throws IOException, WebApplicationException {
+ context.getInputStream().close();
+ context.setInputStream(new ByteArrayInputStream(headers.getHeaderString(HEADER_NAME).getBytes()));
+ return context.proceed();
+ }
+ }
+
+ public static class HttpHeadersWriterInterceptor implements WriterInterceptor {
+
+ @Context
+ HttpHeaders headers;
+
+ @Override
+ public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {
+ OutputStreamWriter osw = new OutputStreamWriter(context.getOutputStream());
+ osw.append(headers.getHeaderString(HEADER_NAME));
+ osw.flush();
+ context.proceed();
+ }
+ }
+
+ @Test
+ public void testHttpHeadersInjectionInRequestFilter() {
+ final String value = "headerValue";
+ final String response = target().register(HttpHeadersFilter.class).request().header(HEADER_NAME, value)
+ .buildGet().invoke(String.class);
+ assertThat("the HttpHeaders was not injected to RequestFilter", response, is(value));
+ }
+
+ @Test
+ public void testHttpHeadersInjectionInResponseFilter() {
+ final String value = "1";
+ final HttpHeadersResponseFilter filter = new HttpHeadersResponseFilter();
+ final String response = target().register(HttpHeadersResponseFilter.class).request().header(HEADER_NAME, value)
+ .buildPost(Entity.entity(value, MediaType.TEXT_PLAIN_TYPE)).invoke(String.class);
+ assertThat(response, is(value));
+ assertThat("the HttpHeaders was not injected to ResponseFilter", filter.getHeaderValue(), is(1));
+ }
+
+ @Test
+ public void testHttpHeadersInjectionInMBW() {
+ final String value = "1";
+ final String response = target().register(StringWriter.class).request().header(HEADER_NAME, value)
+ .buildPost(Entity.entity("something", MediaType.TEXT_PLAIN_TYPE)).invoke(String.class);
+ assertThat("the HttpHeaders was not injected to MessageBodyWriter", response, is(value));
+ }
+
+ @Test
+ public void testHttpHeadersInjectionInMBR() {
+ final String value = "1";
+ final String header = "100";
+ final String response = target().register(StringReader.class).request().header(HEADER_NAME, header)
+ .buildPost(Entity.entity(value, MediaType.TEXT_PLAIN_TYPE)).invoke(String.class);
+ assertThat("the HttpHeaders was not injected to MessageBodyReader", response, is(header));
+ }
+
+ @Test
+ public void testHttpHeadersInjectionInReaderInterceptor() {
+ final String header = "100";
+ final String response = target().register(HttpHeadersReaderInterceptor.class).request().header(HEADER_NAME, header)
+ .buildPost(Entity.entity("0", MediaType.TEXT_PLAIN_TYPE)).invoke(String.class);
+ assertThat("the HttpHeaders was not injected to Reader Interceptor", response, is(header));
+ }
+
+ @Test
+ public void testHttpHeadersInjectionInWriterInterceptor() {
+ final String header = "100";
+ final Response response = target().register(HttpHeadersWriterInterceptor.class).request().header(HEADER_NAME, header)
+ .buildPost(Entity.entity("0", MediaType.TEXT_PLAIN_TYPE)).invoke();
+ assertThat("the HttpHeaders was not injected to Reader Interceptor", response.readEntity(String.class),
+ is("1000"));
+ assertThat(response.getHeaderString(HEADER_NAME), is("1001")); //100 interceptor, 0 entity = 1000, +1 in resource
+ response.close();
+ }
+}
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpMethodEntityTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpMethodEntityTest.java
index 546fd54..175ad5f 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpMethodEntityTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/HttpMethodEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,7 +44,7 @@
* Tests HTTP methods and entity presence.
*
* @author Miroslav Fuksa
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class HttpMethodEntityTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/InjectedClientBodyWorker.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/InjectedClientBodyWorker.java
index 37e544c..d747cd8 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/InjectedClientBodyWorker.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/InjectedClientBodyWorker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -51,7 +51,7 @@
/**
* Test if JAX-RS injection points work in client side providers.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class InjectedClientBodyWorker extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/JaxRsTimeoutTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/JaxRsTimeoutTest.java
index 63df9a2..ebff0ea 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/JaxRsTimeoutTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/JaxRsTimeoutTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -36,7 +36,7 @@
import static org.junit.Assert.fail;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class JaxRsTimeoutTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/RequestScopedReadEntityTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/RequestScopedReadEntityTest.java
index b30880d..9f5c926 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/RequestScopedReadEntityTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/RequestScopedReadEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -46,7 +46,7 @@
/**
* TODO: javadoc.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class RequestScopedReadEntityTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseCloseTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseCloseTest.java
index 48ab839..69bdeda 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseCloseTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseCloseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
/**
* Test for Response.close() method.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ResponseCloseTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseReadAndBufferEntityTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseReadAndBufferEntityTest.java
index c9ddfae..b90b129 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseReadAndBufferEntityTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseReadAndBufferEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -51,7 +51,7 @@
* Buffered response entity tests.
*
* @author Michal Gajdos
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ResponseReadAndBufferEntityTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ShutdownHookMemoryLeakTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ShutdownHookMemoryLeakTest.java
index eff4b5d..14220dc 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ShutdownHookMemoryLeakTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ShutdownHookMemoryLeakTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -55,7 +55,7 @@
* On my laptop, 1000 iterations was sufficient to cause
* a memory leak until JERSEY-2688 got fixed.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class ShutdownHookMemoryLeakTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HttpPatchTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HttpPatchTest.java
index 3886ef1..235956d 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HttpPatchTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HttpPatchTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -49,7 +49,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@RunWith(Parameterized.class)
public class HttpPatchTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/RequestHeaderModificationsTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/RequestHeaderModificationsTest.java
index 2fab4dc..8636b28 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/RequestHeaderModificationsTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/RequestHeaderModificationsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -74,7 +74,7 @@
/**
* JERSEY-2206 reproducer
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@RunWith(Parameterized.class)
public class RequestHeaderModificationsTest extends JerseyTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AuthenticationException.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AuthenticationException.java
index f76cf85..7cc9dab 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AuthenticationException.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AuthenticationException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* A runtime exception representing a failure to provide correct authentication credentials.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class AuthenticationException extends RuntimeException {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AuthenticationExceptionMapper.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AuthenticationExceptionMapper.java
index 53912f8..8760002 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AuthenticationExceptionMapper.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AuthenticationExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
* Map an authentication exception to an HTTP 401 response,
* optionally including the realm for a credentials challenge at the client.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Provider
public class AuthenticationExceptionMapper implements ExceptionMapper<AuthenticationException> {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/RootResource.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/RootResource.java
index 23205f2..b3821fb 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/RootResource.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/RootResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -30,7 +30,7 @@
*
* A better way would be injecting {@link javax.ws.rs.core.SecurityContext}.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("/")
public class RootResource {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/SecurityFilter.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/SecurityFilter.java
index 986b64c..69d4dc0 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/SecurityFilter.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/SecurityFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -39,7 +39,7 @@
*
* Returns response with http status 401 when proper authentication is not provided in incoming request.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @see ContainerRequestFilter
*/
@Provider
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/Server.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/Server.java
index ca3cb39..45c289e 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/Server.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/Server.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,7 +36,7 @@
/**
* A simple SSL-secured HTTP server for testing purposes.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
final class Server {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/SslConnectorConfigurationTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/SslConnectorConfigurationTest.java
index 07edcb3..c45ad94 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/SslConnectorConfigurationTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/SslConnectorConfigurationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,9 +37,9 @@
/**
* SSL connector tests.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@RunWith(Parameterized.class)
public class SslConnectorConfigurationTest extends AbstractConnectorServerTest {
diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/httpurlconnector/AsyncTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/httpurlconnector/AsyncTest.java
index 202fe32..a67f409 100644
--- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/httpurlconnector/AsyncTest.java
+++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/httpurlconnector/AsyncTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -56,7 +56,7 @@
* Asynchronous connector test.
*
* @author Arul Dhesiaseelan (aruld at acm.org)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncTest extends JerseyTest {
diff --git a/tests/e2e-core-common/pom.xml b/tests/e2e-core-common/pom.xml
index aaf2b46..4202dcf 100644
--- a/tests/e2e-core-common/pom.xml
+++ b/tests/e2e-core-common/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>e2e-core-common</artifactId>
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/TestRuntimeDelegate.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/TestRuntimeDelegate.java
index 2a2c30c..aaa860c 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/TestRuntimeDelegate.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/TestRuntimeDelegate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -37,7 +37,7 @@
/**
* Test runtime delegate.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TestRuntimeDelegate extends AbstractRuntimeDelegate {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/ServiceFinderBinderTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/ServiceFinderBinderTest.java
index 1195233..15b031f 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/ServiceFinderBinderTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/ServiceFinderBinderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -37,7 +37,7 @@
/**
* Service finder injection binder unit test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ServiceFinderBinderTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestContract.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestContract.java
index 3aa1482..262220a 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestContract.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestContract.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Test contract for {@link org.glassfish.jersey.internal.ServiceFinderBinder} test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public interface TestContract {
/**
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceA.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceA.java
index 046d639..ec05ff5 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceA.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Test contract implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TestServiceA implements TestContract {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceB.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceB.java
index cd957b9..025a7e4 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceB.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceB.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Test contract implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TestServiceB implements TestContract {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceC.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceC.java
index 6409a38..7a8fc34 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceC.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceC.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Test contract implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TestServiceC implements TestContract {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceD.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceD.java
index 8a73c53..00feb2f 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceD.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/config/TestServiceD.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Test contract implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TestServiceD implements TestContract {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/ContextResolverFactoryTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/ContextResolverFactoryTest.java
index 7c00edd..d69b010 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/ContextResolverFactoryTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/ContextResolverFactoryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,7 +40,7 @@
/**
* Context resolvers factory unit test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ContextResolverFactoryTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/JaxrsProvidersTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/JaxrsProvidersTest.java
index beb6221..49f6cc4 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/JaxrsProvidersTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/JaxrsProvidersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -49,7 +49,7 @@
import static org.junit.Assert.assertSame;
/**®
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class JaxrsProvidersTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/ProviderBinderTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/ProviderBinderTest.java
index 8e60873..b17a6b2 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/ProviderBinderTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/ProviderBinderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -60,8 +60,8 @@
* ServiceProviders unit test.
*
* @author Santiago Pericas-Geertsen (santiago.pericasgeertsen at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Marek Potociar
+ * @author Libor Kramolis
*/
public class ProviderBinderTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/TestBinder.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/TestBinder.java
index b166748..798eeb1 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/TestBinder.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/TestBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -30,7 +30,7 @@
/**
* Binder for testing purposes.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class TestBinder extends AbstractBinder {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/inject/ReferencingFactoryTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/inject/ReferencingFactoryTest.java
index 6aaf923..76429b0 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/inject/ReferencingFactoryTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/internal/inject/ReferencingFactoryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
/**
* Referencing factory test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ReferencingFactoryTest extends AbstractBinder {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/AcceptableMediaTypeStringRepresentationTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/AcceptableMediaTypeStringRepresentationTest.java
index 6714257..2faf424 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/AcceptableMediaTypeStringRepresentationTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/AcceptableMediaTypeStringRepresentationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* Acceptable media type unit tests.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@RunWith(Parameterized.class)
public class AcceptableMediaTypeStringRepresentationTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/AcceptableMediaTypeTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/AcceptableMediaTypeTest.java
index 198a905..7821bfa 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/AcceptableMediaTypeTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/AcceptableMediaTypeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
/**
* Acceptable media type unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@RunWith(Parameterized.class)
public class AcceptableMediaTypeTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/HeaderUtilsTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/HeaderUtilsTest.java
index c212e1d..b64b311 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/HeaderUtilsTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/HeaderUtilsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -41,7 +41,7 @@
/**
* {@link HeaderUtils} unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class HeaderUtilsTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/InboundMessageContextTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/InboundMessageContextTest.java
index 3645513..f61b225 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/InboundMessageContextTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/InboundMessageContextTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,7 +44,7 @@
/**
* {@link org.glassfish.jersey.message.internal.InboundMessageContext} test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class InboundMessageContextTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/MatchingEntityTagTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/MatchingEntityTagTest.java
index 40d457b..19ad5e1 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/MatchingEntityTagTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/MatchingEntityTagTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -36,8 +36,8 @@
/**
* {@link MatchingEntityTag} unit tests ported from Jersey 1.x.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Jakub Podlesak
+ * @author Marek Potociar
*/
public class MatchingEntityTagTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/OutboundJaxrsResponseTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/OutboundJaxrsResponseTest.java
index 0fc241f..47086bd 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/OutboundJaxrsResponseTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/OutboundJaxrsResponseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -37,7 +37,7 @@
/**
* OutboundJaxrsResponse unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class OutboundJaxrsResponseTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/OutboundMessageContextTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/OutboundMessageContextTest.java
index cdf2a03..c4cd221 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/OutboundMessageContextTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/OutboundMessageContextTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -48,7 +48,7 @@
/**
* {@link OutboundMessageContext} test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class OutboundMessageContextTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/QualitySourceMediaTypeTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/QualitySourceMediaTypeTest.java
index 249bc6c..1841774 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/QualitySourceMediaTypeTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/message/internal/QualitySourceMediaTypeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
/**
* Quality source media type unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@RunWith(Parameterized.class)
public class QualitySourceMediaTypeTest {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/process/internal/ExecutorProvidersTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/process/internal/ExecutorProvidersTest.java
index 1cfd53e..ccbc53d 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/process/internal/ExecutorProvidersTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/process/internal/ExecutorProvidersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -48,7 +48,7 @@
/**
* ExecutorProviders unit tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ExecutorProvidersTest extends AbstractBinder {
diff --git a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/uri/internal/JerseyUriBuilderTest.java b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/uri/internal/JerseyUriBuilderTest.java
index 7583010..324acd5 100644
--- a/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/uri/internal/JerseyUriBuilderTest.java
+++ b/tests/e2e-core-common/src/test/java/org/glassfish/jersey/tests/e2e/common/uri/internal/JerseyUriBuilderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -45,7 +45,7 @@
/**
* Uri builder implementation test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Martin Matula
* @author Miroslav Fuksa
* @author Paul Sandoz
diff --git a/tests/e2e-entity/pom.xml b/tests/e2e-entity/pom.xml
index d1d64ce..d640cb3 100644
--- a/tests/e2e-entity/pom.xml
+++ b/tests/e2e-entity/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>e2e-entity</artifactId>
@@ -197,6 +197,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>xdk</id>
<properties>
<!-- do not use security manager for xdk -->
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/AbstractTypeTester.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/AbstractTypeTester.java
index 8f3c8a2..2ca9ddd 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/AbstractTypeTester.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/AbstractTypeTester.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -51,7 +51,7 @@
*
* @author Paul Sandoz
* @author Martin Matula
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public abstract class AbstractTypeTester extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/EmptyEntityTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/EmptyEntityTest.java
index 3624e43..dac06e6 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/EmptyEntityTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/EmptyEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -57,7 +57,7 @@
/**
* JERSEY-1540.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class EmptyEntityTest extends AbstractTypeTester {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/EmptyRequestToEntityParamTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/EmptyRequestToEntityParamTest.java
index 46258b6..4b7865d 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/EmptyRequestToEntityParamTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/EmptyRequestToEntityParamTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
/**
* Test for JERSEY-1579.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class EmptyRequestToEntityParamTest extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/InterceptedStreamCloseTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/InterceptedStreamCloseTest.java
index 62ac577..d11ed14 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/InterceptedStreamCloseTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/InterceptedStreamCloseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -41,7 +41,7 @@
/**
* Reproducer for JERSEY-1845.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class InterceptedStreamCloseTest extends JerseyTest {
@Path("resource")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/JsonMoxyTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/JsonMoxyTest.java
index 35a03a1..62a4dc2 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/JsonMoxyTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/JsonMoxyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -58,7 +58,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@RunWith(ConcurrentRunner.class)
public class JsonMoxyTest extends AbstractTypeTester {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/SubResourceDynamicProxyTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/SubResourceDynamicProxyTest.java
index eab22f4..abe6088 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/SubResourceDynamicProxyTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/SubResourceDynamicProxyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -51,7 +51,7 @@
* This test should cover also the EJB case, as the common cause
* is missing type parameter.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class SubResourceDynamicProxyTest extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/XmlMoxyTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/XmlMoxyTest.java
index 2e95ca1..82a9f53 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/XmlMoxyTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/XmlMoxyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -63,7 +63,7 @@
import org.junit.runner.RunWith;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@RunWith(ConcurrentRunner.class)
public class XmlMoxyTest extends AbstractTypeTester {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/AbstractJsonTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/AbstractJsonTest.java
index 48c5afa..f3bdcec 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/AbstractJsonTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/AbstractJsonTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -37,6 +37,7 @@
import javax.xml.bind.JAXBContext;
import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.internal.util.JdkVersion;
import org.glassfish.jersey.internal.util.PropertiesHelper;
import org.glassfish.jersey.jettison.JettisonConfig;
import org.glassfish.jersey.jettison.JettisonJaxbContext;
@@ -211,9 +212,8 @@
private static boolean runningOnJdk7AndLater() {
final String javaVersion = AccessController.doPrivileged(PropertiesHelper.getSystemProperty("java.version"));
- final int version = Integer.valueOf(javaVersion.split("\\.")[1]);
-
- return version >= 7;
+ final JdkVersion jdkVersion = JdkVersion.parseVersion(javaVersion);
+ return (jdkVersion.getMajor() == 1 && jdkVersion.getMinor() >= 7) || (jdkVersion.getMajor() > 8);
}
private static boolean moxyJaxbProvider() {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/Jersey1835Test.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/Jersey1835Test.java
index c472aa6..fa291d5 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/Jersey1835Test.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/Jersey1835Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Reproducible test case for JERSEY-1835.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class Jersey1835Test extends AbstractJsonTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonTestHelper.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonTestHelper.java
index 1706ceb..dbe13ed 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonTestHelper.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonTestHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
import java.util.Collection;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
public class JsonTestHelper {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonWithPaddingEncodingFilterTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonWithPaddingEncodingFilterTest.java
index 2d2e50c..4d681da 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonWithPaddingEncodingFilterTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonWithPaddingEncodingFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
*
* See https://java.net/jira/browse/JERSEY-2524 for the original issue description.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class JsonWithPaddingEncodingFilterTest extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonWithoutExceptionMapperTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonWithoutExceptionMapperTest.java
new file mode 100644
index 0000000..dfb07f7
--- /dev/null
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JsonWithoutExceptionMapperTest.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.json;
+
+import org.glassfish.jersey.jackson.JacksonFeature;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.annotation.Priority;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.Path;
+import javax.ws.rs.POST;
+import javax.ws.rs.Priorities;
+
+public class JsonWithoutExceptionMapperTest extends JerseyTest {
+
+ public static class BooleanEntity {
+ public boolean data;
+ }
+
+ @Priority(2 * Priorities.USER)
+ public static class LowPriorityExceptionMapper implements ExceptionMapper<Exception> {
+ @Override
+ public Response toResponse(Exception exception) {
+ return Response.accepted().entity(getClass().getSimpleName()).build();
+ }
+ }
+
+ @Path("/")
+ public static class Resource {
+ @POST
+ public Boolean value(BooleanEntity entity) {
+ return entity.data;
+ }
+ }
+
+ @Override
+ protected Application configure() {
+ return new ResourceConfig(Resource.class, LowPriorityExceptionMapper.class)
+ .register(JacksonFeature.withoutExceptionMappers());
+ }
+
+ @Test
+ public void testZullBooleanValue() {
+ String response = target().request(MediaType.APPLICATION_JSON)
+ .buildPost(Entity.entity("zull", MediaType.APPLICATION_JSON_TYPE)).invoke().readEntity(String.class);
+ Assert.assertFalse(response.contains("zull"));
+ Assert.assertTrue(response.equals(LowPriorityExceptionMapper.class.getSimpleName()));
+ }
+}
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Animal.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Animal.java
index 1073589..ab8afdc 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Animal.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Animal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
// Jackson 1
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnimalList.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnimalList.java
index 59d7fbe..f603939 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnimalList.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnimalList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
@SuppressWarnings("RedundantIfStatement")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnotherAnimal.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnotherAnimal.java
index a41bbfc..bdf1724 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnotherAnimal.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnotherAnimal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement(name = "animal")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnotherCat.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnotherCat.java
index 3d260ec..5c44ed3 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnotherCat.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AnotherCat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("UnusedDeclaration")
@XmlRootElement(name = "cat")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AttrAndCharDataBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AttrAndCharDataBean.java
index b39cbf4..a4d12b7 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AttrAndCharDataBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/AttrAndCharDataBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
import javax.xml.bind.annotation.XmlValue;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"StringEquality", "RedundantIfStatement"})
@XmlRootElement(name = "parent")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Cat.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Cat.java
index b962e8b..80156da 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Cat.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Cat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("UnusedDeclaration")
@XmlRootElement(name = "cat")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes.java
index bfbb41f..4ee88f1 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -28,7 +28,7 @@
import org.glassfish.jersey.tests.e2e.json.JsonTestHelper;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"StringEquality", "RedundantIfStatement"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes2.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes2.java
index d247ca7..ecdb2e5 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes2.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -27,7 +27,7 @@
import org.glassfish.jersey.tests.e2e.json.JsonTestHelper;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("StringEquality")
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes3.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes3.java
index a7b6774..015a905 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes3.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ComplexBeanWithAttributes3.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
import org.glassfish.jersey.tests.e2e.json.JsonTestHelper;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement
@JsonbVisibility(CustomJsonbVisibilityStrategy.class)
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Dog.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Dog.java
index 4de2631..57c7ddd 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Dog.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/Dog.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("UnusedDeclaration")
@XmlRootElement(name = "dog")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EmptyElementBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EmptyElementBean.java
index 88c21e7..8646e6c 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EmptyElementBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EmptyElementBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EmptyElementContainingBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EmptyElementContainingBean.java
index 490c280..2f62263 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EmptyElementContainingBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EmptyElementContainingBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EncodedContentBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EncodedContentBean.java
index b4feee6..4980286 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EncodedContentBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/EncodedContentBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"RedundantIfStatement", "StringEquality"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/FakeArrayBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/FakeArrayBean.java
index c42c9d0..a76ab5a 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/FakeArrayBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/FakeArrayBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -29,7 +29,7 @@
/**
* Test case for issue#310.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"RedundantIfStatement", "UnusedDeclaration"})
@XmlAccessorType(XmlAccessType.FIELD)
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/IntArray.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/IntArray.java
index 742865f..e56ebcd 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/IntArray.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/IntArray.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -21,7 +21,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement(name = "intArray")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ListAndNonListBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ListAndNonListBean.java
index 4b4fbc8..1d63367 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ListAndNonListBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ListAndNonListBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"RedundantIfStatement", "StringEquality"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ListWrapperBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ListWrapperBean.java
index 03bd242..fdb96fd 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ListWrapperBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/ListWrapperBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -23,7 +23,7 @@
import org.glassfish.jersey.tests.e2e.json.JsonTestHelper;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement(name = "item")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyError.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyError.java
index 46ab86a..88977cc 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyError.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,7 +40,7 @@
* </complexType>
* </pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlAccessorType(XmlAccessType.FIELD)
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyMessage.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyMessage.java
index 923b761..0716cad 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyMessage.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyMessage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,7 +40,7 @@
* </complexType>
* </pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlAccessorType(XmlAccessType.FIELD)
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyResponse.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyResponse.java
index 10f53d2..1e6d6b2 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyResponse.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/MyResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -44,7 +44,7 @@
* </complexType>
* </pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlAccessorType(XmlAccessType.FIELD)
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NamespaceBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NamespaceBean.java
index acbb2c6..703b58b 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NamespaceBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NamespaceBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +20,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"RedundantIfStatement", "UnusedDeclaration"})
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NamespaceBeanWithAttribute.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NamespaceBeanWithAttribute.java
index 74254f8..bc948a1 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NamespaceBeanWithAttribute.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NamespaceBeanWithAttribute.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -21,7 +21,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"UnusedDeclaration", "RedundantIfStatement"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NullStringBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NullStringBean.java
index ee855d3..78919b6 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NullStringBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/NullStringBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +20,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/PureCharDataBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/PureCharDataBean.java
index bc21834..15578a3 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/PureCharDataBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/PureCharDataBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +20,7 @@
import javax.xml.bind.annotation.XmlValue;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"RedundantIfStatement", "StringEquality"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBean.java
index 79251da..613f29b 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"RedundantIfStatement", "StringEquality"})
@XmlRootElement(name = "DummyOne")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithAttributes.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithAttributes.java
index e086739..2d31414 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithAttributes.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithAttributes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,7 +26,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"StringEquality", "RedundantIfStatement"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithJustOneAttribute.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithJustOneAttribute.java
index b3207ab..5f8e6df 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithJustOneAttribute.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithJustOneAttribute.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithJustOneAttributeAndValue.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithJustOneAttributeAndValue.java
index 45c794f..ac435a4 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithJustOneAttributeAndValue.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleBeanWithJustOneAttributeAndValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,7 +26,7 @@
import javax.xml.bind.annotation.XmlValue;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"RedundantIfStatement", "StringEquality"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleXmlTypeBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleXmlTypeBean.java
index 82cf9ac..0742e64 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleXmlTypeBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SimpleXmlTypeBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
import javax.xml.bind.annotation.XmlType;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"StringEquality", "RedundantIfStatement"})
@XmlType
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SingleItemListWrapperBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SingleItemListWrapperBean.java
index f7f14a0..40763a4 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SingleItemListWrapperBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/SingleItemListWrapperBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement(name = "singleItemListWrapper")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/TreeModel.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/TreeModel.java
index bc9dc0f..4c31866 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/TreeModel.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/TreeModel.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -26,7 +26,7 @@
import org.glassfish.jersey.tests.e2e.json.JsonTestHelper;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"UnusedDeclaration", "RedundantIfStatement"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/TwoListsWrapperBean.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/TwoListsWrapperBean.java
index 99b76f0..4dcb8c1 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/TwoListsWrapperBean.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/TwoListsWrapperBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings("RedundantIfStatement")
@XmlRootElement(name = "item2")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/User.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/User.java
index 94f0649..12fef69 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/User.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/User.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -22,7 +22,7 @@
import javax.xml.bind.annotation.XmlTransient;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@SuppressWarnings({"StringEquality", "RedundantIfStatement", "UnusedDeclaration"})
@XmlRootElement
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/UserTable.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/UserTable.java
index a37d11c..57d492f 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/UserTable.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/UserTable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* (field initializer) and assign the value to the list that should contain predefined values manually (in this case the value
* object is represented by {@code #DEFAULT_HEADERS}).
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
@SuppressWarnings("UnusedDeclaration")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoAnimal.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoAnimal.java
index e8bd11a..03d988e 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoAnimal.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoAnimal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.tests.e2e.json.entity.pojo;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
// Jackson 1
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoAnimalList.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoAnimalList.java
index 1f082f4..8bfabb2 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoAnimalList.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoAnimalList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +20,7 @@
import java.util.List;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
@SuppressWarnings("RedundantIfStatement")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoCat.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoCat.java
index 91c1ec4..0600be9 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoCat.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoCat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.tests.e2e.json.entity.pojo;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
@SuppressWarnings("UnusedDeclaration")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoDog.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoDog.java
index a4c4d59..2b4ef48 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoDog.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/entity/pojo/PojoDog.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.tests.e2e.json.entity.pojo;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
@SuppressWarnings("UnusedDeclaration")
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterCloseTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterCloseTest.java
index 47cf3d5..3edcf33 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterCloseTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterCloseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -51,7 +51,7 @@
*
* Proves, that broadcaster attempts to send the messages remaining in the buffer after it receives the close signal.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class BroadcasterCloseTest extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterExecutorTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterExecutorTest.java
index f272bf9..9d1249c 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterExecutorTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterExecutorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -50,7 +50,7 @@
/**
* Managed executor service injection and propagation into broadcaster test.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class BroadcasterExecutorTest extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterTest.java
index fc44b01..0fc1d28 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/BroadcasterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -43,7 +43,7 @@
/**
* JAX-RS {@link javax.ws.rs.sse.SseBroadcaster} test.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class BroadcasterTest extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/EventOutputTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/EventOutputTest.java
index 0f09d26..6f43bda 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/EventOutputTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/EventOutputTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -56,8 +56,8 @@
/**
* Event output tests.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class EventOutputTest extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/SseCustomEventImplTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/SseCustomEventImplTest.java
index ec58d06..61abaa5 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/SseCustomEventImplTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/SseCustomEventImplTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -51,7 +51,7 @@
* Test that {@link org.glassfish.jersey.media.sse.OutboundEventWriter} works with custom
* {@link javax.ws.rs.sse.OutboundSseEvent} implementation.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class SseCustomEventImplTest extends JerseyTest {
diff --git a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/SseEventSinkToEventSourceTest.java b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/SseEventSinkToEventSourceTest.java
index 4bc9af3..53a9f45 100644
--- a/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/SseEventSinkToEventSourceTest.java
+++ b/tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/sse/SseEventSinkToEventSourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -51,7 +51,7 @@
/**
* JAX-RS {@link SseEventSource} and {@link SseEventSink} test.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class SseEventSinkToEventSourceTest extends JerseyTest {
diff --git a/tests/e2e-inject/cdi2-se/pom.xml b/tests/e2e-inject/cdi2-se/pom.xml
index cd450c5..1ab5247 100644
--- a/tests/e2e-inject/cdi2-se/pom.xml
+++ b/tests/e2e-inject/cdi2-se/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>e2e-inject</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>e2e-inject-cdi2-se</artifactId>
diff --git a/tests/e2e-inject/hk2/pom.xml b/tests/e2e-inject/hk2/pom.xml
new file mode 100644
index 0000000..be04227
--- /dev/null
+++ b/tests/e2e-inject/hk2/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>e2e-inject</artifactId>
+ <groupId>org.glassfish.jersey.tests</groupId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>e2e-inject-hk2</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/AbstractBinderTestResource.java b/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/AbstractBinderTestResource.java
new file mode 100644
index 0000000..0ba4223
--- /dev/null
+++ b/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/AbstractBinderTestResource.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.inject.hk2;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+
+@Path("/")
+public class AbstractBinderTestResource {
+ @GET
+ public String resource(@Context HttpHeaders headers) {
+ return headers.getRequestHeader(InjectableTestFilter.class.getName()).get(0);
+ }
+}
diff --git a/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/Injectable.java b/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/Injectable.java
new file mode 100644
index 0000000..f0d222e
--- /dev/null
+++ b/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/Injectable.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.inject.hk2;
+
+public interface Injectable {
+}
diff --git a/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/InjectableImpl.java b/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/InjectableImpl.java
new file mode 100644
index 0000000..030a50a
--- /dev/null
+++ b/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/InjectableImpl.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.inject.hk2;
+
+public class InjectableImpl implements Injectable {
+ @Override
+ public String toString() {
+ return getClass().getName();
+ }
+}
diff --git a/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/InjectableTestFilter.java b/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/InjectableTestFilter.java
new file mode 100644
index 0000000..28fb2c6
--- /dev/null
+++ b/tests/e2e-inject/hk2/src/main/java/org/glassfish/jersey/tests/e2e/inject/hk2/InjectableTestFilter.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.inject.hk2;
+
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.Context;
+import java.io.IOException;
+
+public class InjectableTestFilter implements ContainerRequestFilter {
+ @Context
+ public Injectable injectable;
+
+ @Override
+ public void filter(ContainerRequestContext requestContext) throws IOException {
+ requestContext.getHeaders().add(
+ InjectableTestFilter.class.getName(), injectable == null ? "NULL" : injectable.toString()
+ );
+ }
+}
\ No newline at end of file
diff --git a/tests/e2e-inject/hk2/src/test/java/org/glassfish/jersey/tests/e2e/inject/hk2/HK2AbstractBinderTest.java b/tests/e2e-inject/hk2/src/test/java/org/glassfish/jersey/tests/e2e/inject/hk2/HK2AbstractBinderTest.java
new file mode 100644
index 0000000..7f67df6
--- /dev/null
+++ b/tests/e2e-inject/hk2/src/test/java/org/glassfish/jersey/tests/e2e/inject/hk2/HK2AbstractBinderTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.inject.hk2;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+
+import javax.inject.Singleton;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Test for older hk2 binders to be used
+ */
+public class HK2AbstractBinderTest extends JerseyTest {
+
+ public static class InjectableHK2Binder extends org.glassfish.hk2.utilities.binding.AbstractBinder {
+ @Override
+ protected void configure() {
+ bindAsContract(InjectableImpl.class).to(Injectable.class).in(Singleton.class);
+ }
+ }
+
+ public static class HK2BindingFeature implements Feature {
+ @Override
+ public boolean configure(FeatureContext context) {
+ context.register(new InjectableHK2Binder());
+ return true;
+ }
+ }
+
+ @Override
+ protected Application configure() {
+ return new ResourceConfig(HK2BindingFeature.class, AbstractBinderTestResource.class, InjectableTestFilter.class);
+ }
+
+ @Test
+ public void testInjectableInjection() {
+ String response = target().request().get(String.class);
+ assertThat(response, is(InjectableImpl.class.getName()));
+ }
+
+}
diff --git a/tests/e2e-inject/hk2/src/test/java/org/glassfish/jersey/tests/e2e/inject/hk2/JerseyAbstractBinderTest.java b/tests/e2e-inject/hk2/src/test/java/org/glassfish/jersey/tests/e2e/inject/hk2/JerseyAbstractBinderTest.java
new file mode 100644
index 0000000..36a969e
--- /dev/null
+++ b/tests/e2e-inject/hk2/src/test/java/org/glassfish/jersey/tests/e2e/inject/hk2/JerseyAbstractBinderTest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.inject.hk2;
+
+import org.glassfish.jersey.internal.inject.AbstractBinder;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+
+import javax.inject.Singleton;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Comparison test using new Jersey AbstractBinder for functionality that is to be working with HK2 AbstractBinder
+ */
+public class JerseyAbstractBinderTest extends JerseyTest {
+ public static class InjectableBinder extends AbstractBinder {
+ @Override
+ protected void configure() {
+ bindAsContract(InjectableImpl.class).to(Injectable.class).in(Singleton.class);
+ }
+ }
+
+ public static class BindingFeature implements Feature {
+ @Override
+ public boolean configure(FeatureContext context) {
+ context.register(new InjectableBinder());
+ return true;
+ }
+ }
+
+ @Override
+ protected Application configure() {
+ return new ResourceConfig(BindingFeature.class, AbstractBinderTestResource.class, InjectableTestFilter.class);
+ }
+
+ @Test
+ public void testInjectableInjection() {
+ String response = target().request().get(String.class);
+ assertThat(response, is(InjectableImpl.class.getName()));
+ }
+}
diff --git a/tests/e2e-inject/pom.xml b/tests/e2e-inject/pom.xml
index 62f875e..7b7e496 100644
--- a/tests/e2e-inject/pom.xml
+++ b/tests/e2e-inject/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>e2e-inject</artifactId>
@@ -34,5 +34,6 @@
<modules>
<module>cdi2-se</module>
+ <module>hk2</module>
</modules>
</project>
diff --git a/tests/e2e-server/pom.xml b/tests/e2e-server/pom.xml
index 1048bbb..3cd2f99 100644
--- a/tests/e2e-server/pom.xml
+++ b/tests/e2e-server/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>e2e-server</artifactId>
@@ -192,6 +192,19 @@
<profiles>
<profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>xdk</id>
<properties>
<!-- do not use security manager for xdk -->
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/AbstractDisableMetainfServicesLookupTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/AbstractDisableMetainfServicesLookupTest.java
index 3520675..60b1902 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/AbstractDisableMetainfServicesLookupTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/AbstractDisableMetainfServicesLookupTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -55,7 +55,7 @@
* This is base for tests testing enabling/disabling configuration property
* {@link org.glassfish.jersey.server.ServerProperties#METAINF_SERVICES_LOOKUP_DISABLE}.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public abstract class AbstractDisableMetainfServicesLookupTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/AsyncResponseTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/AsyncResponseTest.java
index beaff51..03d840e 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/AsyncResponseTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/AsyncResponseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -54,7 +54,7 @@
import static org.junit.Assert.fail;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class AsyncResponseTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ChunkedInputOutputTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ChunkedInputOutputTest.java
index 29aec13..5a35dd4 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ChunkedInputOutputTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ChunkedInputOutputTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -49,8 +49,8 @@
/**
* Chunked input/output tests.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Pavel Bucek
+ * @author Marek Potociar
*/
public class ChunkedInputOutputTest extends JerseyTest {
private static final Logger LOGGER = Logger.getLogger(ChunkedInputOutputTest.class.getName());
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java
index 2642876..e3b2f2b 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ClientResponseOnServerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* Test for support of client-side response in the server-side resource implementation.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ClientResponseOnServerTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CompletionStageTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CompletionStageTest.java
index c1ce740..22f6f89 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CompletionStageTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CompletionStageTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -40,7 +40,7 @@
import static org.junit.Assert.assertThat;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CompletionStageTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ContainerListenerRegistrationAsProvidersTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ContainerListenerRegistrationAsProvidersTest.java
index bc46bee..6543ed4 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ContainerListenerRegistrationAsProvidersTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ContainerListenerRegistrationAsProvidersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ContainerListenerRegistrationAsProvidersTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CustomInjectablesApplicationTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CustomInjectablesApplicationTest.java
index 494bff6..a9f1a9e 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CustomInjectablesApplicationTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CustomInjectablesApplicationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -56,7 +56,7 @@
import static org.junit.Assert.assertNotSame;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CustomInjectablesApplicationTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CustomInjectablesResourceConfigTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CustomInjectablesResourceConfigTest.java
index 836fb4d..01acb85 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CustomInjectablesResourceConfigTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/CustomInjectablesResourceConfigTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -39,7 +39,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CustomInjectablesResourceConfigTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/EncodedSlashInPathSegmentTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/EncodedSlashInPathSegmentTest.java
index 1d828f8..79d7ad7 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/EncodedSlashInPathSegmentTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/EncodedSlashInPathSegmentTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -31,7 +31,7 @@
/**
* Test for JERSEY-1167.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class EncodedSlashInPathSegmentTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ExceptionLoggingTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ExceptionLoggingTest.java
index 6d33ae7..8f1c138 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ExceptionLoggingTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ExceptionLoggingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -43,7 +43,7 @@
/**
* Make sure exceptions, that are not mapped to responses get logged.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ExceptionLoggingTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ExceptionMapperPriorityTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ExceptionMapperPriorityTest.java
index cf25234..1142e12 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ExceptionMapperPriorityTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ExceptionMapperPriorityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -33,7 +33,7 @@
import static org.junit.Assert.assertThat;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ExceptionMapperPriorityTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/GloballyNameBoundResourceFilterTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/GloballyNameBoundResourceFilterTest.java
index da48b79..3c9076b 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/GloballyNameBoundResourceFilterTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/GloballyNameBoundResourceFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -44,7 +44,7 @@
/**
* JAX-RS global name-bound filter tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @see ResourceFilterTest
*/
public class GloballyNameBoundResourceFilterTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InitializationLoggingTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InitializationLoggingTest.java
index 022ad21..aba5373 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InitializationLoggingTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InitializationLoggingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class InitializationLoggingTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InjectionTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InjectionTest.java
index da84650..5c38427 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InjectionTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InjectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -45,7 +45,7 @@
/**
* Injection E2E tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class InjectionTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InputStreamResponseTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InputStreamResponseTest.java
index feef6b4..593eba1 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InputStreamResponseTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InputStreamResponseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -35,7 +35,7 @@
* This is to make sure you can just pass an input stream to Jersey,
* where entity body data would be read from.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class InputStreamResponseTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InterceptorHttpHeadersInjectionTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InterceptorHttpHeadersInjectionTest.java
index 12be8fc..248c44c 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InterceptorHttpHeadersInjectionTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InterceptorHttpHeadersInjectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
/**
* Test for JERSEY-1545.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class InterceptorHttpHeadersInjectionTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InterceptorNameAndDynamicBindingTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InterceptorNameAndDynamicBindingTest.java
index d9942c7..88aee31 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InterceptorNameAndDynamicBindingTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/InterceptorNameAndDynamicBindingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -51,7 +51,7 @@
/**
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class InterceptorNameAndDynamicBindingTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java
index b043227..822cb08 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ManagedClientExecutorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -59,7 +59,7 @@
/**
* Test, that managed client uses the custom executor service.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class ManagedClientExecutorTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MessageBodyProvidersExceptionsTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MessageBodyProvidersExceptionsTest.java
index 5036151..799337d 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MessageBodyProvidersExceptionsTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MessageBodyProvidersExceptionsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -45,7 +45,7 @@
* - InternalServerErrorException for MBW (JSR339, chapter 4.2.2, step 7)
* - NotSupportedException for MBR (JSR339, chapter 4.2.1, step 6)
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class MessageBodyProvidersExceptionsTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MetainfServicesLookupDisabledTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MetainfServicesLookupDisabledTest.java
index 44c514a..989d872 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MetainfServicesLookupDisabledTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MetainfServicesLookupDisabledTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
/**
* Property {@link ServerProperties#METAINF_SERVICES_LOOKUP_DISABLE} IS set.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class MetainfServicesLookupDisabledTest extends AbstractDisableMetainfServicesLookupTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MetainfServicesLookupEnabledTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MetainfServicesLookupEnabledTest.java
index a558f11..2e30267 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MetainfServicesLookupEnabledTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/MetainfServicesLookupEnabledTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
/**
* Property {@link org.glassfish.jersey.server.ServerProperties#METAINF_SERVICES_LOOKUP_DISABLE} is NOT set.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class MetainfServicesLookupEnabledTest extends AbstractDisableMetainfServicesLookupTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ParamConverterPriorityTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ParamConverterPriorityTest.java
index 0105506..6a49917 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ParamConverterPriorityTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ParamConverterPriorityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -40,7 +40,7 @@
import static org.hamcrest.Matchers.typeCompatibleWith;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ParamConverterPriorityTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ReloadTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ReloadTest.java
index c8d4f6f..98bf872 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ReloadTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ReloadTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,7 +40,7 @@
* mvn -Dtest=ReloadTest -Djersey.config.test.container.factory=org.glassfish.jersey.test.simple.SimpleTestContainerFactory clean test
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ReloadTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/RequestScopedAndAsyncTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/RequestScopedAndAsyncTest.java
index 30e4372..09a312b 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/RequestScopedAndAsyncTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/RequestScopedAndAsyncTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -46,7 +46,7 @@
/**
* JERSEY-2677 reproducer - test, that {@code Factory.dispose()} is correctly called for both sync and async cases.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class RequestScopedAndAsyncTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ResourceFilterTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ResourceFilterTest.java
index 7cb4a45..26156cb 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ResourceFilterTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ResourceFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -56,7 +56,7 @@
* JAX-RS name-bound filter tests.
*
* @author Martin Matula
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav.Fuksa
* @see GloballyNameBoundResourceFilterTest
*/
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ServerDestroyTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ServerDestroyTest.java
index f2a76de..511ac31 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ServerDestroyTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/ServerDestroyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -58,7 +58,7 @@
/**
* Assert that pre destroy method on application, resources and providers is invoked.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
public class ServerDestroyTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/SubResourceTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/SubResourceTest.java
index 5ce4830..f9ece42 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/SubResourceTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/SubResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -39,7 +39,7 @@
/**
* Sub-resource access/processing E2E tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav Fuksa
*/
public class SubResourceTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/SubjectSecurityContextTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/SubjectSecurityContextTest.java
index 6d2d583..b96f53a 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/SubjectSecurityContextTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/SubjectSecurityContextTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019 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
@@ -45,7 +45,7 @@
* via {@link SubjectSecurityContext#doAsSubject(java.security.PrivilegedAction)} method.
*
* @author Martin Matula
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class SubjectSecurityContextTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/monitoring/ApplicationInfoTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/monitoring/ApplicationInfoTest.java
index 456b950..da6f409 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/monitoring/ApplicationInfoTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/monitoring/ApplicationInfoTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -51,7 +51,7 @@
* and it also implements {@link ForcedAutoDiscoverable} and tests if it is possible to inject
* {@link ApplicationInfo} in different circumstances.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@RunWith(Parameterized.class)
public class ApplicationInfoTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/monitoring/MonitoringStatisticsLocatorTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/monitoring/MonitoringStatisticsLocatorTest.java
index 2a4dc66..877dc57 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/monitoring/MonitoringStatisticsLocatorTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/monitoring/MonitoringStatisticsLocatorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -50,7 +50,7 @@
* {@link ResourceMethodStatistics}.
*
* @author Miroslav Fuksa
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class MonitoringStatisticsLocatorTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/routing/RegularExpressionsTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/routing/RegularExpressionsTest.java
new file mode 100644
index 0000000..e5f31dc
--- /dev/null
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/routing/RegularExpressionsTest.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2013, 2019 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.tests.e2e.server.routing;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public class RegularExpressionsTest extends JerseyTest {
+ private static final String GET_VALUE = "get value";
+ private static final String POST_VALUE = "post value";
+ private static final String PUT_VALUE = "put value";
+
+
+ @Path("one")
+ public static class ResourceOne {
+ @POST
+ public String post(String entity) {
+ return entity;
+ }
+
+ @GET
+ @Path("x")
+ public Response get() {
+ return Response.ok(GET_VALUE).build();
+
+ }
+
+ @POST
+ @Path("{name:[a-zA-Z][a-zA-Z_0-9]*}")
+ public Response post() {
+ return Response.ok(POST_VALUE).build();
+
+ }
+
+ @Path("{x:[a-z]}")
+ public SubGet doAnything4() {
+ return new SubGet();
+ }
+ }
+
+ @Path("two")
+ public static class ResourceTwo {
+ @GET
+ @Path("{Prefix}{p:/?}{id: ((\\d+)?)}/abc{p2:/?}{number: (([A-Za-z0-9]*)?)}")
+ public Response get() {
+ return Response.ok(GET_VALUE).build();
+
+ }
+
+ @POST
+ @Path("{Prefix}{p:/?}{id: ((\\d+)?)}/abc/{yeah}")
+ public Response post() {
+ return Response.ok(POST_VALUE).build();
+
+ }
+ }
+
+ public static class SubGet {
+ @PUT
+ public String get() {
+ return PUT_VALUE;
+ }
+ }
+
+ @Override
+ protected Application configure() {
+ return new ResourceConfig(ResourceOne.class, ResourceTwo.class);
+ }
+
+ @Test
+ public void testPostOne() {
+ String entity = target("one").path("x").request()
+ .buildPost(Entity.entity("AA", MediaType.TEXT_PLAIN_TYPE)).invoke().readEntity(String.class);
+ assertThat(entity, is(POST_VALUE));
+ }
+
+ @Test
+ public void testGetOne() {
+ String entity = target("one").path("x").request().buildGet().invoke().readEntity(String.class);
+ assertThat(entity, is(GET_VALUE));
+ }
+
+ @Test
+ public void testPostTwo() {
+ String entity = target("two").path("P/abc/MyNumber").request()
+ .buildPost(Entity.entity("AA", MediaType.TEXT_PLAIN_TYPE)).invoke().readEntity(String.class);
+ assertThat(entity, is(POST_VALUE));
+ }
+
+ @Test
+ public void testGetTwo() {
+ String entity = target("two").path("P/abc/MyNumber").request().buildGet().invoke().readEntity(String.class);
+ assertThat(entity, is(GET_VALUE));
+ }
+
+ @Test
+ /**
+ * By the Spec, sub-resource locator should not be found in this case
+ */
+ public void testPutOne() {
+ try (Response response = target("one").path("x").request()
+ .buildPut(Entity.entity("AA", MediaType.TEXT_PLAIN_TYPE)).invoke()) {
+ assertThat(response.getStatus(), is(405));
+ }
+ }
+}
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/validation/PropertyValidationTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/validation/PropertyValidationTest.java
index 101ff5a..e9d7c09 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/validation/PropertyValidationTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/validation/PropertyValidationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -40,7 +40,7 @@
* Test various combinations of enabling/disabling: auto-discovery, bean validation, validation feature.
*
* @author Michal Gajdos
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class PropertyValidationTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlBeanParamTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlBeanParamTest.java
index d2df87e..8486a72 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlBeanParamTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlBeanParamTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -73,7 +73,7 @@
* are aggregated in the class that is used as a bean param</li>
* </ul></pre>
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class WadlBeanParamTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlEmptyMediaTypeTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlEmptyMediaTypeTest.java
index 085c20c..0aa59ca 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlEmptyMediaTypeTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlEmptyMediaTypeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -43,7 +43,7 @@
/**
* Tests, that Jersey returns wildcard mediaType in case no response representation was specified.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class WadlEmptyMediaTypeTest extends JerseyTest {
diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlResourceTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlResourceTest.java
index be2115c..a2a739c 100644
--- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlResourceTest.java
+++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -126,8 +126,8 @@
* @author Marc Hadley
* @author Miroslav Fuksa
* @author Michal Gajdos
- * @author Libor Kramolis (libor.kramolis at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Libor Kramolis
+ * @author Marek Potociar
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
diff --git a/tests/e2e-testng/pom.xml b/tests/e2e-testng/pom.xml
index d59e65c..8da1f44 100644
--- a/tests/e2e-testng/pom.xml
+++ b/tests/e2e-testng/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>e2e-testng</artifactId>
diff --git a/tests/e2e/pom.xml b/tests/e2e/pom.xml
index 1f954c3..db07466 100644
--- a/tests/e2e/pom.xml
+++ b/tests/e2e/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>e2e</artifactId>
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/AbortingFilterTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/AbortingFilterTest.java
index f91c24e..0cffe14 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/AbortingFilterTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/AbortingFilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -53,7 +53,7 @@
* <p/>
* This cannot be "fixed" in Jersey.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class AbortingFilterTest extends JerseyTest {
private static Logger logger = Logger.getLogger(AbortingFilterTest.class.getName());
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/AnnotationInheritanceTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/AnnotationInheritanceTest.java
index 82bb86f..9f46348 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/AnnotationInheritanceTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/AnnotationInheritanceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -33,7 +33,7 @@
*
* The annotations on a super-class should take precedence over annotations on an interface.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class AnnotationInheritanceTest extends JerseyTest {
@Override
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ConstructorSelectionTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ConstructorSelectionTest.java
index eac4d1d..51bfaa2 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ConstructorSelectionTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ConstructorSelectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -49,7 +49,7 @@
/**
* Test to verify the proper constructor is selected.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ConstructorSelectionTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ExceptionTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ExceptionTest.java
index 2908b8f..fd53e85 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ExceptionTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ExceptionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -67,7 +67,7 @@
* proper exception throwing etc.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ExceptionTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderAsyncTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderAsyncTest.java
index b53f999..e8f71e9 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderAsyncTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderAsyncTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -54,7 +54,7 @@
/**
* Test if the location relativer URI is correctly resolved within asynchronous processing cases.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@RunWith(ConcurrentRunner.class)
public class LocationHeaderAsyncTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderBasicTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderBasicTest.java
index 767e2e0..338baef 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderBasicTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderBasicTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -51,7 +51,7 @@
/**
* Test if the location relative URI is correctly resolved within basic cases.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@RunWith(ConcurrentRunner.class)
public class LocationHeaderBasicTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderFiltersTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderFiltersTest.java
index d6975ac..8ee7f1f 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderFiltersTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderFiltersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -59,7 +59,7 @@
* Test if the location response header relative URI is correctly resolved within complex cases with interceptors, filters,
* exception mappers, etc.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class LocationHeaderFiltersTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderWithAbsolutizationDisabledTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderWithAbsolutizationDisabledTest.java
index 5fd809b..93ef150 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderWithAbsolutizationDisabledTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderWithAbsolutizationDisabledTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -39,7 +39,7 @@
* Test if the location response header is left intact in case the
* {@link ServerProperties#LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED} property is set to {@code true}.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class LocationHeaderWithAbsolutizationDisabledTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderWithIncompatibleFlagTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderWithIncompatibleFlagTest.java
index 89b6e5c..1e18d54 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderWithIncompatibleFlagTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/LocationHeaderWithIncompatibleFlagTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -40,7 +40,7 @@
* {@link ServerProperties#LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231} property is set to {@code true} and
* {@link ServerProperties#LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED} to {@code false}
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class LocationHeaderWithIncompatibleFlagTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/MediaTypeProviderTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/MediaTypeProviderTest.java
index 99147b2..782fe8e 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/MediaTypeProviderTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/MediaTypeProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
* Media type provider tests.
*
* @author Mark Hadley
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class MediaTypeProviderTest {
@Test
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/MessageBodyWriterTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/MessageBodyWriterTest.java
index c9f051f..a3f75e5 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/MessageBodyWriterTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/MessageBodyWriterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -53,7 +53,7 @@
* Various MessageBodyWriter tests.
*
* @author Michal Gajdos
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class MessageBodyWriterTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/OptionsTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/OptionsTest.java
index dcc1a01..0cca39d 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/OptionsTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/OptionsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class OptionsTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResourceContextTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResourceContextTest.java
index 2d2acdc..2ed4541 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResourceContextTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResourceContextTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -40,7 +40,7 @@
*
* @author Martin Grotzke
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
* @author Miroslav Fuksa
*/
public class ResourceContextTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java
index b206551..d993c23 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseE2ETest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -50,7 +50,7 @@
/**
* Response E2E tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ResponseE2ETest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseIntegrationTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseIntegrationTest.java
index dc63ab4..9703c96 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseIntegrationTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseIntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ResponseIntegrationTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseTest.java
index be018cc..2471f59 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/ResponseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
import static org.junit.Assert.fail;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ResponseTest {
@@ -61,7 +61,7 @@
MediaType mt = new MediaType("text", "plain");
List<Variant> vts = Variant.VariantListBuilder.newInstance().mediaTypes(mt)
.languages(new Locale("en", "US"), new Locale("en", "GB"),
- new Locale("zh", "CN")).encodings((String[]) encoding.toArray())
+ new Locale("zh", "CN")).encodings(encoding.toArray(new String[0]))
.add().build();
String tmp;
@@ -151,7 +151,7 @@
MediaType mt2 = new MediaType("text", "html");
List<Variant> vts = Variant.VariantListBuilder.newInstance().mediaTypes(mt1, mt2)
.languages(new Locale("en", "US"), new Locale("en", "GB"),
- new Locale("zh", "CN")).encodings((String[]) encoding.toArray())
+ new Locale("zh", "CN")).encodings(encoding.toArray(new String[0]))
.add().build();
String tmp;
@@ -214,7 +214,7 @@
MediaType mt = new MediaType("text", "plain");
List<Variant> vts = Variant.VariantListBuilder.newInstance().mediaTypes(mt)
.languages(new Locale("en", "US"), new Locale("en", "GB"),
- new Locale("zh", "CN")).encodings((String[]) encoding.toArray())
+ new Locale("zh", "CN")).encodings(encoding.toArray(new String[0]))
.add().build();
String tmp;
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/UnsafeCharsInUriTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/UnsafeCharsInUriTest.java
index 79edd3f..14bb299 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/UnsafeCharsInUriTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/UnsafeCharsInUriTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -41,7 +41,7 @@
/**
* Test if URI can contain unsafe characters in the query parameter, e.g. for sending JSON
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class UnsafeCharsInUriTest extends JerseyTest {
@Override
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/VariantsTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/VariantsTest.java
index b6c0f74..e283a01 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/VariantsTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/api/VariantsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
* Server-side variant selection & handling test.
*
* @author Paul Sandoz
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class VariantsTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/ClientTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/ClientTest.java
index 9fedb4d..9b13afe 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/ClientTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/ClientTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -45,7 +45,7 @@
import static org.junit.Assert.fail;
/**
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ClientTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/ExecutorServiceProviderTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/ExecutorServiceProviderTest.java
index e2dbe03..654bce4 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/ExecutorServiceProviderTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/ExecutorServiceProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -62,7 +62,7 @@
/**
* {@link org.glassfish.jersey.spi.ExecutorServiceProvider} E2E tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ExecutorServiceProviderTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HugeEntityTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HugeEntityTest.java
index 3f6e0a4..e157590 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HugeEntityTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HugeEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -53,7 +53,7 @@
/**
* Test to make sure huge entity gets chunk-encoded.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class HugeEntityTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ContentLengthTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ContentLengthTest.java
index 6e8785f..a9ae6c4 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ContentLengthTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ContentLengthTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -41,7 +41,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ContentLengthTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/FeatureConstraintTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/FeatureConstraintTest.java
new file mode 100644
index 0000000..76a47dd
--- /dev/null
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/FeatureConstraintTest.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2019 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.tests.e2e.common;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.Uri;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.ConstrainedTo;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.RuntimeType;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Configuration;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class FeatureConstraintTest extends JerseyTest {
+
+ public static AtomicInteger clientEnvironmentHitCount = new AtomicInteger(0);
+ public static AtomicInteger serverEnvironmentHitCount = new AtomicInteger(0);
+ public static AtomicInteger clientServerEnvironmentHitCount = new AtomicInteger(0);
+
+ @Override
+ protected Application configure() {
+ return new ResourceConfig(PropagatedConfigResource.class, ServerConstrainedClassFeature.class,
+ ClientConstrainedClassFeature.class, ClientServerConstrainedClassFeature.class)
+ .register(new ServerConstrainedInstanceFeature())
+ .register(new ClientConstrainedInstanceFeature())
+ .register(new ClientServerConstrainedInstanceFeature());
+ }
+
+ @ConstrainedTo(RuntimeType.SERVER)
+ public static class ServerConstrainedClassFeature implements Feature {
+ protected int increment = 10;
+ @Override
+ public boolean configure(FeatureContext context) {
+ if (context.getConfiguration().getRuntimeType().equals(RuntimeType.CLIENT)) {
+ clientEnvironmentHitCount.addAndGet(increment);
+ }
+ return true;
+ }
+ }
+
+ @ConstrainedTo(RuntimeType.SERVER)
+ public static class ServerConstrainedInstanceFeature extends ServerConstrainedClassFeature {
+ {
+ increment = 100;
+ }
+ };
+
+ @ConstrainedTo(RuntimeType.CLIENT)
+ public static class ClientConstrainedClassFeature implements Feature {
+ protected int increment = 10;
+ @Override
+ public boolean configure(FeatureContext context) {
+ if (context.getConfiguration().getRuntimeType().equals(RuntimeType.SERVER)) {
+ serverEnvironmentHitCount.addAndGet(increment);
+ }
+ return true;
+ }
+ }
+
+ @ConstrainedTo(RuntimeType.CLIENT)
+ public static class ClientConstrainedInstanceFeature extends ClientConstrainedClassFeature {
+ {
+ increment = 100;
+ }
+ };
+
+ public static class ClientServerConstrainedClassFeature implements Feature {
+ protected int increment = 10;
+ @Override
+ public boolean configure(FeatureContext context) {
+ if (context.getConfiguration().getRuntimeType().equals(RuntimeType.SERVER)) {
+ clientServerEnvironmentHitCount.addAndGet(increment);
+ }
+ if (context.getConfiguration().getRuntimeType().equals(RuntimeType.CLIENT)) {
+ clientServerEnvironmentHitCount.addAndGet(100 * increment);
+ }
+ return true;
+ }
+ }
+
+ public static class ClientServerConstrainedInstanceFeature extends ClientServerConstrainedClassFeature {
+ {
+ increment = 100;
+ }
+ };
+
+ @Path("/")
+ public static class PropagatedConfigResource {
+ @Uri("/isRegistered")
+ WebTarget target;
+
+ @Path("isRegistered")
+ @GET
+ public boolean isRegisteredOnServer(@Context Configuration config) {
+ return config.isRegistered(ServerConstrainedClassFeature.class)
+ && config.isRegistered(ServerConstrainedInstanceFeature.class)
+ && config.isRegistered(ClientConstrainedClassFeature.class)
+ && config.isRegistered(ClientConstrainedInstanceFeature.class)
+ && config.isRegistered(ClientServerConstrainedClassFeature.class)
+ && config.isRegistered(ClientServerConstrainedInstanceFeature.class);
+ }
+
+ @Path("isInherited")
+ @GET
+ public boolean isInheritedInInjectedClientConfig() {
+ final Configuration config = target.getConfiguration();
+ return isRegisteredOnServer(config);
+ }
+
+ @Path("featureConfigurationNotInvoked")
+ @GET
+ public boolean featureConfigurationNotInvoked() {
+ return target
+ .register(ServerConstrainedClassFeature.class)
+ .register(new ServerConstrainedInstanceFeature())
+ .register(ClientConstrainedClassFeature.class)
+ .register(new ClientConstrainedInstanceFeature())
+ .register(ClientServerConstrainedClassFeature.class)
+ .register(new ClientServerConstrainedInstanceFeature())
+ .request().get().readEntity(boolean.class);
+ }
+ }
+
+ @Test
+ public void test() {
+ assertThat("*Constrained*Feature must be registered in a server configuration",
+ target("isRegistered")
+ .register(ServerConstrainedClassFeature.class)
+ .register(new ServerConstrainedInstanceFeature())
+ .register(ClientConstrainedClassFeature.class)
+ .register(new ClientConstrainedInstanceFeature())
+ .register(ClientServerConstrainedClassFeature.class)
+ .register(new ClientServerConstrainedInstanceFeature())
+ .request().get().readEntity(boolean.class),
+ is(true));
+
+ assertThat("Server Features should not have been configured on Client", clientEnvironmentHitCount.get(), is(0));
+ assertThat("Client Features should not have been configured on Server", serverEnvironmentHitCount.get(), is(0));
+ assertThat("ClientSever Features should have been configured", clientServerEnvironmentHitCount.get(), is(11110));
+ clientServerEnvironmentHitCount.set(0); //reset configuration invoked on a server, it won't happen again
+
+ assertThat("*Constrained*Feature must be in an application classes set",
+ target("isInherited").request().get().readEntity(boolean.class),
+ is(true));
+
+ assertThat("Server Features should not have been configured on Client", clientEnvironmentHitCount.get(), is(0));
+ assertThat("Client Features should not have been configured on Server", serverEnvironmentHitCount.get(), is(0));
+ assertThat("ClientSever Features should not have been configured", clientServerEnvironmentHitCount.get(), is(0));
+
+ assertThat("ServerConstrainedFeature must be in an application classes set",
+ target("featureConfigurationNotInvoked")
+ .register(ServerConstrainedClassFeature.class)
+ .register(new ServerConstrainedInstanceFeature())
+ .register(ClientConstrainedClassFeature.class)
+ .register(new ClientConstrainedInstanceFeature())
+ .register(ClientServerConstrainedClassFeature.class)
+ .register(new ClientServerConstrainedInstanceFeature())
+ .request().get().readEntity(boolean.class),
+ is(true));
+
+ assertThat("Server Features should not have been configured on Client", clientEnvironmentHitCount.get(), is(0));
+ assertThat("Client Features should not have been configured on Server", serverEnvironmentHitCount.get(), is(0));
+ assertThat("ClientSever Features should have been configured", clientServerEnvironmentHitCount.get(), is(22000));
+ }
+
+
+}
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/MessageBodyWriterObjectDistanceTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/MessageBodyWriterObjectDistanceTest.java
index 4a792e0..6ff32ac 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/MessageBodyWriterObjectDistanceTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/MessageBodyWriterObjectDistanceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019 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
@@ -41,7 +41,7 @@
* Object.class needs special handling when computing type distance - it should be always further than any other
* implemented interface.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@SuppressWarnings("WeakerAccess")
public class MessageBodyWriterObjectDistanceTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/NonPublicNonStaticTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/NonPublicNonStaticTest.java
index f28905c..f148048 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/NonPublicNonStaticTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/NonPublicNonStaticTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -51,7 +51,7 @@
* or on first request).
*
* @author Paul Sandoz
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({NonPublicNonStaticTest.NonStaticResourceTest.class,
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ProvidersLegacyOrderingTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ProvidersLegacyOrderingTest.java
index 012dc88..7829146 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ProvidersLegacyOrderingTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ProvidersLegacyOrderingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -47,7 +47,7 @@
import static org.junit.Assert.fail;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ProvidersLegacyOrderingTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ProvidersOrderingTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ProvidersOrderingTest.java
index 0d5b748..18bab2a 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ProvidersOrderingTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ProvidersOrderingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -55,7 +55,7 @@
import static org.junit.Assert.fail;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ProvidersOrderingTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ResponseLinksTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ResponseLinksTest.java
index 941b3aa..a63d424 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ResponseLinksTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/ResponseLinksTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -39,7 +39,7 @@
import org.junit.Test;
/**
- * @author Libor Kamolis (libor.kramolis at oracle.com)
+ * @author Libor Kamolis
*/
public class ResponseLinksTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/UriComponentTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/UriComponentTest.java
index 5d44b60..a1f5d54 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/UriComponentTest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/UriComponentTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
import org.junit.Test;
/**
- * @author Libor Kamolis (libor.kramolis at oracle.com)
+ * @author Libor Kamolis
*/
public class UriComponentTest extends JerseyTest {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/container/Jersey2462Test.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/container/Jersey2462Test.java
index 17c8c67..e2243d4 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/container/Jersey2462Test.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/container/Jersey2462Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -50,7 +50,7 @@
/**
* Reproducer tests for JERSEY-2462 on Grizzly, Jetty and Simple HTTP server.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({Jersey2462Test.GrizzlyContainerTest.class,
@@ -62,7 +62,7 @@
/**
* Test resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("echo")
public static class EchoResource {
diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/sonar/SonarJerseyE2ETest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/sonar/SonarJerseyE2ETest.java
index a31248b..832db1e 100644
--- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/sonar/SonarJerseyE2ETest.java
+++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/sonar/SonarJerseyE2ETest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
import org.junit.Test;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class SonarJerseyE2ETest {
diff --git a/tests/integration/JERSEY-2988/pom.xml b/tests/integration/JERSEY-2988/pom.xml
index e47be83..a2cd740 100644
--- a/tests/integration/JERSEY-2988/pom.xml
+++ b/tests/integration/JERSEY-2988/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.23-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2988</artifactId>
diff --git a/tests/integration/asm/pom.xml b/tests/integration/asm/pom.xml
new file mode 100644
index 0000000..76dca4d
--- /dev/null
+++ b/tests/integration/asm/pom.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>project</artifactId>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>asm</artifactId>
+ <name>jersey-asm-integration</name>
+ <description>
+ Controls a new version of ASM being repackaged does not break Jersey
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/tests/integration/asm/src/test/java/org/glassfish/jersey/integration/asm/AnnotatedClassVisitorTest.java b/tests/integration/asm/src/test/java/org/glassfish/jersey/integration/asm/AnnotatedClassVisitorTest.java
new file mode 100644
index 0000000..708684d
--- /dev/null
+++ b/tests/integration/asm/src/test/java/org/glassfish/jersey/integration/asm/AnnotatedClassVisitorTest.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2019 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.integration.asm;
+
+import jersey.repackaged.org.objectweb.asm.ClassVisitor;
+import org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener;
+import org.hamcrest.Matchers;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
+
+public class AnnotatedClassVisitorTest {
+
+ @Test
+ public void testInheritedMethodsFromClassVisitor() {
+ Class<?> annotatedClassVisitorClass = null;
+ final Class<?> classVisitorClass = ClassVisitor.class;
+
+ final Class<?>[] listenerClasses = AnnotationAcceptingListener.class.getDeclaredClasses();
+
+ for (Class<?> c : listenerClasses) {
+ if (c.getName().contains("AnnotatedClassVisitor")) {
+ annotatedClassVisitorClass = c;
+ break;
+ }
+ }
+
+ final List<Method> classVisitorMethods = Arrays.asList(classVisitorClass.getDeclaredMethods());
+ final List<Method> annotatedClassVisitorMethods = Arrays.asList(annotatedClassVisitorClass.getDeclaredMethods());
+ boolean containsAllMethods = true;
+ for (Method classVisitorMethod : classVisitorMethods) {
+ boolean foundClassVisitorMethod = false;
+ for (Method annotatedClassVisitorMethod : annotatedClassVisitorMethods) {
+ if (annotatedClassVisitorMethod.getName().equals(classVisitorMethod.getName())
+ && annotatedClassVisitorMethod.getReturnType() == classVisitorMethod.getReturnType()
+ && annotatedClassVisitorMethod.getParameterCount() == classVisitorMethod.getParameterCount()) {
+ final Class<?>[] annotatedClassVisitorTypes = annotatedClassVisitorMethod.getParameterTypes();
+ final Class<?>[] classVisitorTypes = classVisitorMethod.getParameterTypes();
+ boolean typesMatch = true;
+ for (int i = 0; i != annotatedClassVisitorTypes.length; i++) {
+ if (annotatedClassVisitorTypes[i] != classVisitorTypes[i]) {
+ typesMatch = false;
+ break;
+ }
+ }
+ if (typesMatch) {
+ foundClassVisitorMethod = true;
+ //System.out.println("found method " + classVisitorMethod.getName());
+ break;
+ }
+ }
+ }
+ if (!foundClassVisitorMethod) {
+ containsAllMethods = false;
+ System.out.append("Method ")
+ .append(classVisitorMethod.getName())
+ .println(" not implemented by AnnotationAcceptingListener.AnnotatedClassVisitor");
+ }
+ }
+ Assert.assertThat(containsAllMethods, Matchers.is(true));
+ }
+}
diff --git a/tests/integration/async-jersey-filter/pom.xml b/tests/integration/async-jersey-filter/pom.xml
index 0fe0d0f..464368a 100644
--- a/tests/integration/async-jersey-filter/pom.xml
+++ b/tests/integration/async-jersey-filter/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>async-jersey-filter</artifactId>
diff --git a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/async/TestApplication.java b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/async/TestApplication.java
index f23fa16..b06cc8d 100644
--- a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/async/TestApplication.java
+++ b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/async/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* Jersey application for JERSEY-2730.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@ApplicationPath("/")
public class TestApplication extends ResourceConfig {
diff --git a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/TestExceptionResource.java b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/TestExceptionResource.java
index c531760..b2f0112 100644
--- a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/TestExceptionResource.java
+++ b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/TestExceptionResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
import org.glassfish.jersey.tests.integration.jersey2730.exception.UnmappedRuntimeException;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/exception")
@Singleton
diff --git a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/MappedException.java b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/MappedException.java
index cc0ab0f..75a2a5d 100644
--- a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/MappedException.java
+++ b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/MappedException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +20,7 @@
* This exception will get mapped to a 432 response with the application exception mapper
* implemented by {@link MappedExceptionMapper} class.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class MappedException extends Exception {
diff --git a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/MappedExceptionMapper.java b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/MappedExceptionMapper.java
index 052dbc3..a2dd4a2 100644
--- a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/MappedExceptionMapper.java
+++ b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/MappedExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
/**
* An exception mapper to return 432 error response when a {@link MappedException} is thrown.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class MappedExceptionMapper implements ExceptionMapper<MappedException> {
diff --git a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/UnmappedException.java b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/UnmappedException.java
index 751872c..a211204 100644
--- a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/UnmappedException.java
+++ b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/UnmappedException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* An exception that will be propagated to the servlet container.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class UnmappedException extends Exception {
diff --git a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/UnmappedRuntimeException.java b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/UnmappedRuntimeException.java
index d84dc6a..29b8704 100644
--- a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/UnmappedRuntimeException.java
+++ b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2730/exception/UnmappedRuntimeException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* An exception that will be propagated to the servlet container.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class UnmappedRuntimeException extends RuntimeException {
diff --git a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2812/TestFilter.java b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2812/TestFilter.java
index 9fd3cd9..6a6930b 100644
--- a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2812/TestFilter.java
+++ b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2812/TestFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -35,7 +35,7 @@
* <p/>
* Reported as JERSEY-2812.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class TestFilter implements Filter {
diff --git a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2812/TestWaitResource.java b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2812/TestWaitResource.java
index b457107..fa2c64e 100644
--- a/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2812/TestWaitResource.java
+++ b/tests/integration/async-jersey-filter/src/main/java/org/glassfish/jersey/tests/integration/jersey2812/TestWaitResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -39,7 +39,7 @@
/**
* This resource provides a way to reproduce JERSEY-2818.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/async")
@Produces("text/plain")
diff --git a/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/async/AbstractAsyncJerseyTest.java b/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/async/AbstractAsyncJerseyTest.java
index a2e1927..7a780e7 100644
--- a/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/async/AbstractAsyncJerseyTest.java
+++ b/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/async/AbstractAsyncJerseyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
import org.glassfish.jersey.test.spi.TestContainerFactory;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class AbstractAsyncJerseyTest extends JerseyTest {
diff --git a/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/jersey2730/Jersey2730ITCase.java b/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/jersey2730/Jersey2730ITCase.java
index c3ca725..7e9dbf4 100644
--- a/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/jersey2730/Jersey2730ITCase.java
+++ b/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/jersey2730/Jersey2730ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
* <p/>
* This test must not run in parallel.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class Jersey2730ITCase extends AbstractAsyncJerseyTest {
diff --git a/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/jersey2812/Jersey2812ITCase.java b/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/jersey2812/Jersey2812ITCase.java
index d86a8f4..663aefe 100644
--- a/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/jersey2812/Jersey2812ITCase.java
+++ b/tests/integration/async-jersey-filter/src/test/java/org/glassfish/jersey/tests/integration/jersey2812/Jersey2812ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -44,7 +44,7 @@
* <p/>
* This test must not run in parallel.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class Jersey2812ITCase extends AbstractAsyncJerseyTest {
diff --git a/tests/integration/cdi-beanvalidation-webapp/pom.xml b/tests/integration/cdi-beanvalidation-webapp/pom.xml
index cbf58c3..a4bb6f1 100644
--- a/tests/integration/cdi-beanvalidation-webapp/pom.xml
+++ b/tests/integration/cdi-beanvalidation-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-beanvalidation-webapp</artifactId>
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiApplication.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiApplication.java
index 6adcc12..5956ab2 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiApplication.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
* JAX-RS application to configure resources.
* This one is configured as a CDI bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/cdi")
@ApplicationScoped
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiFieldInjectedResource.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiFieldInjectedResource.java
index 31d05cf..f355e8c 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiFieldInjectedResource.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiFieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
/**
* This CDI backed resource should get validated and validation result field injected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("validated/field")
@RequestScoped
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiOldFashionedResource.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiOldFashionedResource.java
index b7a5803..c27e9bc 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiOldFashionedResource.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiOldFashionedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* This CDI backed resource should get validated.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("old/fashioned")
@RequestScoped
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiParamInjectedResource.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiParamInjectedResource.java
index 18f74c7..0c014e1 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiParamInjectedResource.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiParamInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* This CDI backed resource should get validated.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("validated/param")
@RequestScoped
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiPropertyInjectedResource.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiPropertyInjectedResource.java
index 2af8a87..39664ea 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiPropertyInjectedResource.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiPropertyInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
/**
* This CDI backed resource should get validated and validation result property injected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("validated/property")
@RequestScoped
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiValidationInterceptor.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiValidationInterceptor.java
index d3f9d9d..ff5c1c2 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiValidationInterceptor.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiValidationInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -32,7 +32,7 @@
/**
* CDI backed interceptor to handle validation issues.
*
- * @author Jaku Podlesak (jakub.podlesak at oracle.com)
+ * @author Jaku Podlesak
*/
@ApplicationScoped
public class CdiValidationInterceptor implements ValidationInterceptor {
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiValidationResult.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiValidationResult.java
index 0bed3ff..1cabb79 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiValidationResult.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/CdiValidationResult.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
/**
* CDI implementation of validation result.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
public class CdiValidationResult implements ValidationResult {
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2Application.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2Application.java
index e6efb11..3d1c29d 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2Application.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2Application.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
* JAX-RS application to configure resources.
* This one will get fully managed by HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/hk2")
@Vetoed
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2FieldInjectedResource.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2FieldInjectedResource.java
index 3d3b850..8d41193 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2FieldInjectedResource.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2FieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* This one should get validated.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("validated/field")
@Vetoed
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2OldFashionedResource.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2OldFashionedResource.java
index a1c8596..cad09b2 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2OldFashionedResource.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2OldFashionedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* This HK2 managed resource should get validated.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("old/fashioned")
@Vetoed
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2ParamInjectedResource.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2ParamInjectedResource.java
index ee9a6fb..7728903 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2ParamInjectedResource.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2ParamInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
* This HK2 managed resource should get validated and validation
* result injected via resource method parameter.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("validated/param")
@Vetoed
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2PropertyInjectedResource.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2PropertyInjectedResource.java
index ba02b09..44ce591 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2PropertyInjectedResource.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/Hk2PropertyInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* This one should get validated.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("validated/property")
@Vetoed
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/NonJaxRsValidatedBean.java b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/NonJaxRsValidatedBean.java
index 110aca3..9c26a84 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/NonJaxRsValidatedBean.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/main/java/org/glassfish/jersey/tests/cdi/bv/NonJaxRsValidatedBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* does not block the original validator from functioning
* on raw CDI beans.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
public class NonJaxRsValidatedBean {
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/BaseValidationTest.java b/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/BaseValidationTest.java
index f2eb3fb..12a9681 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/BaseValidationTest.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/BaseValidationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* for the following scenarios: Grizzly based combined deployment with CDI enabled,
* WAR based combined deployment with CDI enabled, Grizzly based deployment without CDI enabled.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public abstract class BaseValidationTest extends JerseyTest {
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/CombinedTest.java b/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/CombinedTest.java
index 847b0ef..b1b2961 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/CombinedTest.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/CombinedTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -48,7 +48,7 @@
* For Servlet based container testing, the other two tests, {@link RawCdiTest} and {@link RawHk2Test},
* do the same job, because the WAR application contains both Jersey apps already.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CombinedTest {
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/RawCdiTest.java b/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/RawCdiTest.java
index d0b996c..8932fc8 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/RawCdiTest.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/RawCdiTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -31,7 +31,7 @@
/**
* Validation result test for CDI environment.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class RawCdiTest extends BaseValidationTest {
diff --git a/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/RawHk2Test.java b/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/RawHk2Test.java
index f83ea61..43e551b 100644
--- a/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/RawHk2Test.java
+++ b/tests/integration/cdi-beanvalidation-webapp/src/test/java/org/glassfish/jersey/tests/cdi/bv/RawHk2Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Validation result test for raw HK2 environment.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class RawHk2Test extends BaseValidationTest {
diff --git a/tests/integration/cdi-ejb-test-webapp/pom.xml b/tests/integration/cdi-ejb-test-webapp/pom.xml
index 0a1c35b..824d6d3 100644
--- a/tests/integration/cdi-ejb-test-webapp/pom.xml
+++ b/tests/integration/cdi-ejb-test-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-ejb-test-webapp</artifactId>
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiAppScopedTimer.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiAppScopedTimer.java
index 259e669..19dd3e5 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiAppScopedTimer.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiAppScopedTimer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
/**
* Application scoped CDI bean to be injected into EJB resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
public class CdiAppScopedTimer extends BasicTimer {
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiRequestScopedResource.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiRequestScopedResource.java
index a2e6204..cf152eb 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiRequestScopedResource.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiRequestScopedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
/**
* Request scoped CDI bean injected with EJB timers.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("request-scoped")
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiRequestScopedTimer.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiRequestScopedTimer.java
index f48e1f4..362f220 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiRequestScopedTimer.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiRequestScopedTimer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
/**
* Request scoped CDI timer.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
public class CdiRequestScopedTimer extends BasicTimer {
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbSingletonResource.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbSingletonResource.java
index b3472d9..ffbd70e 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbSingletonResource.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbSingletonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* EJB singleton session bean injected with CDI timers.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Singleton
@Path("singleton")
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbSingletonTimer.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbSingletonTimer.java
index 3bec04d..8077c5f 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbSingletonTimer.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbSingletonTimer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
/**
* EJB singleton timer.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Singleton
public class EjbSingletonTimer extends BasicTimer {
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatefulResource.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatefulResource.java
index 25fbc9f..c40bbcb 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatefulResource.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatefulResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* EJB backed JAX-RS resource injected with CDI service providers.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateful
@Path("stateful")
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatelessResource.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatelessResource.java
index 71da1ce..656b945 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatelessResource.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatelessResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* EJB session bean injected with CDI service providers.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
@Path("stateless")
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatelessTimer.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatelessTimer.java
index 721aa18..7ea94a1 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatelessTimer.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EjbStatelessTimer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
/**
* EJB session timer bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
public class EjbStatelessTimer extends BasicTimer {
diff --git a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
index 69e395d..8dcb555 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS application to configure resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/*")
public class MyApplication extends Application {
diff --git a/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiIntoEjbTest.java b/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiIntoEjbTest.java
index d0e8226..d98c072 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiIntoEjbTest.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiIntoEjbTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
/**
* Test CDI timers injected into EJB beans.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiIntoEjbTest extends TestBase {
diff --git a/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/EjbIntoCdiTest.java b/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/EjbIntoCdiTest.java
index 231836c..b27b0ce 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/EjbIntoCdiTest.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/EjbIntoCdiTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,7 +27,7 @@
/**
* Test EJB timers injected into CDI beans.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class EjbIntoCdiTest extends TestBase {
diff --git a/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/TestBase.java b/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/TestBase.java
index d11189d..670e4fc 100644
--- a/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/TestBase.java
+++ b/tests/integration/cdi-ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/TestBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* $AS_HOME/bin/asadmin deploy target/cdi-test-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class TestBase extends JerseyTest {
diff --git a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/pom.xml b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/pom.xml
index e975525..f4af013 100644
--- a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/pom.xml
+++ b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-iface-with-non-jaxrs-impl-test-webapp</artifactId>
diff --git a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiEcho.java b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiEcho.java
index 217a999..c06d823 100644
--- a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiEcho.java
+++ b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Raw CDI implementation of {@link Echo} service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiEcho implements Echo {
diff --git a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Echo.java b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Echo.java
index 0173d6c..66db32d 100644
--- a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Echo.java
+++ b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Echo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Echo service interface.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface Echo {
diff --git a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java
index 5ca0c7c..ae452a3 100644
--- a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java
+++ b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* JAX-RS resource class backed by CDI bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("echo")
public class EchoResource {
diff --git a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
index a5506a8..c4e6553 100644
--- a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
+++ b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS application to configure resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/*")
public class MyApplication extends Application {
diff --git a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/EchoResourceTest.java b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/EchoResourceTest.java
index dfe58b0..7791a8f 100644
--- a/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/EchoResourceTest.java
+++ b/tests/integration/cdi-iface-with-non-jaxrs-impl-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/EchoResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -39,7 +39,7 @@
* $AS_HOME/bin/asadmin deploy target/cdi-test-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class EchoResourceTest extends JerseyTest {
diff --git a/tests/integration/cdi-log-check/pom.xml b/tests/integration/cdi-log-check/pom.xml
new file mode 100644
index 0000000..e3ae5d9
--- /dev/null
+++ b/tests/integration/cdi-log-check/pom.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <artifactId>project</artifactId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>cdi-log-check</artifactId>
+ <packaging>war</packaging>
+ <name>jersey-tests-cdi-log-check</name>
+
+ <description>Jersey CDI test web application</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.annotation</groupId>
+ <artifactId>jakarta.annotation-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.interceptor</groupId>
+ <artifactId>jakarta.interceptor-api</artifactId>
+ <version>${javax.interceptor.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework</groupId>
+ <artifactId>jersey-test-framework-util</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.cdi</groupId>
+ <artifactId>jersey-weld2-se</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.cdi</groupId>
+ <artifactId>jersey-cdi1x</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>run-external-tests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <jersey.config.test.container.factory>${external.container.factory}</jersey.config.test.container.factory>
+ <jersey.config.test.container.port>${external.container.port}</jersey.config.test.container.port>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <!-- External test container configuration is done via properties to allow overriding via command line. -->
+ <external.container.factory>org.glassfish.jersey.test.external.ExternalTestContainerFactory</external.container.factory>
+ <external.container.port>8080</external.container.port>
+ <maven.test.skip>false</maven.test.skip>
+ </properties>
+ </profile>
+ </profiles>
+</project>
diff --git a/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/ClassBean.java b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/ClassBean.java
new file mode 100644
index 0000000..c87660d
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/ClassBean.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 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.tests.cdi.resources;
+
+public interface ClassBean {
+ Class<?> get();
+
+ void set(Class<?> clazz);
+}
diff --git a/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java
new file mode 100644
index 0000000..0c6e0c3
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2019 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.tests.cdi.resources;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("echo")
+@RequestScoped
+@Fooed
+public class EchoResource {
+ public static final String OK = "OK";
+
+ @Inject
+ WarningClass warningClass;
+
+ @GET
+ public String get() {
+ return OK;
+ }
+
+}
diff --git a/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/FooInterceptor.java b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/FooInterceptor.java
new file mode 100644
index 0000000..617a6e9
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/FooInterceptor.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2019 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.tests.cdi.resources;
+
+import javax.annotation.Priority;
+import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.Intercepted;
+import javax.enterprise.inject.spi.Bean;
+import javax.inject.Inject;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+import java.io.Serializable;
+
+@Interceptor
+@Fooed
+public class FooInterceptor implements Serializable {
+
+ @Inject
+ @Intercepted
+ private Bean<?> interceptedBean;
+ private static final long serialVersionUID = 1L;
+
+ @Inject
+ WarningClass warningClass;
+
+ @AroundInvoke
+ public Object intercept(InvocationContext invocationContext) throws Exception {
+ warningClass.set(interceptedBean.getBeanClass());
+ return invocationContext.proceed();
+ }
+}
+
diff --git a/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/Fooed.java b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/Fooed.java
new file mode 100644
index 0000000..c815632
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/Fooed.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2019 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.tests.cdi.resources;
+
+import javax.interceptor.InterceptorBinding;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Inherited
+@InterceptorBinding
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD, ElementType.TYPE})
+public @interface Fooed {
+}
diff --git a/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
new file mode 100644
index 0000000..3942f35
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2019 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.tests.cdi.resources;
+
+import org.glassfish.jersey.server.ServerProperties;
+
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+@ApplicationPath("/*")
+public class MyApplication extends Application {
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ final Set<Class<?>> classes = new HashSet<>();
+ classes.add(EchoResource.class);
+ classes.add(WarningResource.class);
+ return classes;
+ }
+
+ @Override
+ public Map<String, Object> getProperties() {
+ final Map<String, Object> properties = new HashMap<>();
+ properties.put(ServerProperties.WADL_FEATURE_DISABLE, true);
+ return properties;
+ }
+}
diff --git a/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/WarningClass.java b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/WarningClass.java
new file mode 100644
index 0000000..7dcc12e
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/WarningClass.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019 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.tests.cdi.resources;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class WarningClass implements ClassBean {
+ private Class<?> clazz = WarningClass.class;
+
+ @Override
+ public Class<?> get() {
+ return clazz;
+ }
+
+ @Override
+ public void set(Class<?> clazz) {
+ this.clazz = clazz;
+ }
+}
diff --git a/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/WarningResource.java b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/WarningResource.java
new file mode 100644
index 0000000..2c736e9
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/java/org/glassfish/jersey/tests/cdi/resources/WarningResource.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019 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.tests.cdi.resources;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("warning")
+@RequestScoped
+public class WarningResource {
+ @Inject
+ WarningClass warningClass;
+
+ @GET
+ public String get() {
+ return warningClass.get().getName();
+ }
+}
diff --git a/tests/integration/cdi-log-check/src/main/resources/META-INF/beans.xml b/tests/integration/cdi-log-check/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..ea4422d
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+
+<beans
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+ <interceptors>
+ <class>org.glassfish.jersey.tests.cdi.resources.FooInterceptor</class>
+ </interceptors>
+</beans>
+
diff --git a/tests/integration/cdi-log-check/src/main/webapp/WEB-INF/web.xml b/tests/integration/cdi-log-check/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..daed0f5
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+ version="3.0">
+</web-app>
diff --git a/tests/integration/cdi-log-check/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiComponentProviderWarningTest.java b/tests/integration/cdi-log-check/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiComponentProviderWarningTest.java
new file mode 100644
index 0000000..24dd485
--- /dev/null
+++ b/tests/integration/cdi-log-check/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiComponentProviderWarningTest.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2019 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.tests.cdi.resources;
+
+import org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory;
+import org.glassfish.jersey.server.internal.LocalizationMessages;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.TestProperties;
+import org.glassfish.jersey.test.external.ExternalTestContainerFactory;
+import org.jboss.weld.environment.se.Weld;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ws.rs.core.Application;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+
+import static org.junit.Assert.assertEquals;
+
+public class CdiComponentProviderWarningTest extends JerseyTest {
+ private Weld weld;
+
+ @Before
+ public void setup() {
+ Assume.assumeTrue(Hk2InjectionManagerFactory.isImmediateStrategy());
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ if (Hk2InjectionManagerFactory.isImmediateStrategy()) {
+ if (!ExternalTestContainerFactory.class.isAssignableFrom(getTestContainerFactory().getClass())) {
+ weld = new Weld();
+ weld.initialize();
+ }
+ super.setUp();
+ }
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ if (Hk2InjectionManagerFactory.isImmediateStrategy()) {
+ if (!ExternalTestContainerFactory.class.isAssignableFrom(getTestContainerFactory().getClass())) {
+ weld.shutdown();
+ }
+ super.tearDown();
+ }
+ }
+
+ @Override
+ protected Application configure() {
+ set(TestProperties.RECORD_LOG_LEVEL, Level.WARNING.intValue());
+ return new MyApplication();
+ }
+
+ @Test
+ public void testWarning() {
+ String echo = target("echo").request().get(String.class);
+ assertEquals(echo, EchoResource.OK);
+
+ String resource = target("warning").request().get(String.class);
+ assertEquals(resource, EchoResource.class.getName());
+
+ String warning = LocalizationMessages.PARAMETER_UNRESOLVABLE(echo, echo, echo);
+ String searchInLog = warning.substring(warning.lastIndexOf(echo) + echo.length());
+
+ List<?> logRecords = getLoggedRecords();
+ for (final LogRecord logRecord : getLoggedRecords()) {
+ if (logRecord.getLoggerName().equals("org.glassfish.jersey.internal.Errors")
+ && logRecord.getMessage().contains(searchInLog)) {
+ Assert.fail("Checking CDI bean is a JAX-RS resource should not cast warnings");
+ }
+ }
+ }
+}
diff --git a/tests/integration/cdi-multimodule/ear/pom.xml b/tests/integration/cdi-multimodule/ear/pom.xml
index 15df51e..5508376 100644
--- a/tests/integration/cdi-multimodule/ear/pom.xml
+++ b/tests/integration/cdi-multimodule/ear/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/cdi-multimodule/lib/pom.xml b/tests/integration/cdi-multimodule/lib/pom.xml
index cfb0f41..e9db366 100644
--- a/tests/integration/cdi-multimodule/lib/pom.xml
+++ b/tests/integration/cdi-multimodule/lib/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/cdi-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/lib/JaxRsInjectedDependentBean.java b/tests/integration/cdi-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/lib/JaxRsInjectedDependentBean.java
index 44eca4a..5268a53 100644
--- a/tests/integration/cdi-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/lib/JaxRsInjectedDependentBean.java
+++ b/tests/integration/cdi-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/lib/JaxRsInjectedDependentBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
* CDI managed bean, that gets JAX-RS injected. This bean is being consumed
* by all web apps within an EAR packaged enterprise application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsInjectedDependentBean {
diff --git a/tests/integration/cdi-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/lib/JaxRsInjectedRequestScopedBean.java b/tests/integration/cdi-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/lib/JaxRsInjectedRequestScopedBean.java
index 5664ed8..3397e89 100644
--- a/tests/integration/cdi-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/lib/JaxRsInjectedRequestScopedBean.java
+++ b/tests/integration/cdi-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/lib/JaxRsInjectedRequestScopedBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* CDI managed bean, that gets JAX-RS injected. This bean is being consumed
* by all web apps within an EAR packaged enterprise application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
public class JaxRsInjectedRequestScopedBean {
diff --git a/tests/integration/cdi-multimodule/pom.xml b/tests/integration/cdi-multimodule/pom.xml
index 2a7442c..d68045e 100644
--- a/tests/integration/cdi-multimodule/pom.xml
+++ b/tests/integration/cdi-multimodule/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-multimodule</artifactId>
diff --git a/tests/integration/cdi-multimodule/war1/pom.xml b/tests/integration/cdi-multimodule/war1/pom.xml
index 0506a71..8b0d83f 100644
--- a/tests/integration/cdi-multimodule/war1/pom.xml
+++ b/tests/integration/cdi-multimodule/war1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/AppScopedJaxRsResource.java b/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/AppScopedJaxRsResource.java
index 3a1a69c..01d014f 100644
--- a/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/AppScopedJaxRsResource.java
+++ b/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/AppScopedJaxRsResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* JAX-RS resource backed by an application scoped CDI bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("app-scoped")
@ApplicationScoped
diff --git a/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/JaxRsApp.java b/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/JaxRsApp.java
index f8b64da..7e4795a 100644
--- a/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/JaxRsApp.java
+++ b/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/JaxRsApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS application resource configuration.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/")
public class JaxRsApp extends Application {
diff --git a/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/RequestScopedJaxRsResource.java b/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/RequestScopedJaxRsResource.java
index 5f0ff3e..4b9916b 100644
--- a/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/RequestScopedJaxRsResource.java
+++ b/tests/integration/cdi-multimodule/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/RequestScopedJaxRsResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* JAX-RS resource backed by a request scoped CDI bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("request-scoped")
@RequestScoped
diff --git a/tests/integration/cdi-multimodule/war1/src/test/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/JaxRsCdiIntegrationTest.java b/tests/integration/cdi-multimodule/war1/src/test/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/JaxRsCdiIntegrationTest.java
index 62cf293..aa74ae4 100644
--- a/tests/integration/cdi-multimodule/war1/src/test/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/JaxRsCdiIntegrationTest.java
+++ b/tests/integration/cdi-multimodule/war1/src/test/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web1/JaxRsCdiIntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* Test for CDI web application resources. The JAX-RS resources use CDI components from a library jar.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsCdiIntegrationTest extends JerseyTest {
diff --git a/tests/integration/cdi-multimodule/war2/pom.xml b/tests/integration/cdi-multimodule/war2/pom.xml
index 2f57ea8..b883ff0 100644
--- a/tests/integration/cdi-multimodule/war2/pom.xml
+++ b/tests/integration/cdi-multimodule/war2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsAppOne.java b/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsAppOne.java
index 11d5cb3..333f83e 100644
--- a/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsAppOne.java
+++ b/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsAppOne.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* First JAX-RS application resource configuration.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("one")
public class JaxRsAppOne extends Application {
diff --git a/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsAppTwo.java b/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsAppTwo.java
index 0dbe770..676416a 100644
--- a/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsAppTwo.java
+++ b/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsAppTwo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* Second JAX-RS application resource configuration.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("two")
public class JaxRsAppTwo extends Application {
diff --git a/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/SharedAppScopedJaxRsResource.java b/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/SharedAppScopedJaxRsResource.java
index ba722b7..392ab38 100644
--- a/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/SharedAppScopedJaxRsResource.java
+++ b/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/SharedAppScopedJaxRsResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
* This one is being shared between the two JAX-RS apps
* {@link JaxRsAppOne} and {@link JaxRsAppTwo}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("app-scoped")
@ApplicationScoped
diff --git a/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/SharedRequestScopedJaxRsResource.java b/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/SharedRequestScopedJaxRsResource.java
index 876ee7f..4e5f686 100644
--- a/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/SharedRequestScopedJaxRsResource.java
+++ b/tests/integration/cdi-multimodule/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/SharedRequestScopedJaxRsResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
* This one is being shared between the two JAX-RS apps
* {@link JaxRsAppOne} and {@link JaxRsAppTwo}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("request-scoped")
@RequestScoped
diff --git a/tests/integration/cdi-multimodule/war2/src/test/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsCdiIntegrationTest.java b/tests/integration/cdi-multimodule/war2/src/test/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsCdiIntegrationTest.java
index 033f953..b6c4f0c 100644
--- a/tests/integration/cdi-multimodule/war2/src/test/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsCdiIntegrationTest.java
+++ b/tests/integration/cdi-multimodule/war2/src/test/java/org/glassfish/jersey/tests/integration/multimodule/cdi/web2/JaxRsCdiIntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -35,7 +35,7 @@
/**
* Test for CDI web application resources. The JAX-RS resources use CDI components from a library jar.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsCdiIntegrationTest extends JerseyTest {
diff --git a/tests/integration/cdi-multipart-webapp/pom.xml b/tests/integration/cdi-multipart-webapp/pom.xml
index c4da4b7..840ad52 100644
--- a/tests/integration/cdi-multipart-webapp/pom.xml
+++ b/tests/integration/cdi-multipart-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-multipart-webapp</artifactId>
diff --git a/tests/integration/cdi-multipart-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java b/tests/integration/cdi-multipart-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java
index d64a263..c0331ba 100644
--- a/tests/integration/cdi-multipart-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java
+++ b/tests/integration/cdi-multipart-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -26,7 +26,7 @@
/**
* GF-21033 reproducer. Just a resource using multi-part support.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/echo")
@RequestScoped
diff --git a/tests/integration/cdi-multipart-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java b/tests/integration/cdi-multipart-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
index e730754..22a752f 100644
--- a/tests/integration/cdi-multipart-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
+++ b/tests/integration/cdi-multipart-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
* GF-21033 reproducer. This is to make sure Jersey's multipart
* feature could work in GF with CDI.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/*")
public class MyApplication extends Application {
diff --git a/tests/integration/cdi-multipart-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MultipartFeatureTest.java b/tests/integration/cdi-multipart-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MultipartFeatureTest.java
index 5fb1185..c5c9250 100644
--- a/tests/integration/cdi-multipart-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MultipartFeatureTest.java
+++ b/tests/integration/cdi-multipart-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MultipartFeatureTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -48,7 +48,7 @@
* $AS_HOME/bin/asadmin deploy target/cdi-test-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class MultipartFeatureTest extends JerseyTest {
diff --git a/tests/integration/cdi-test-webapp/pom.xml b/tests/integration/cdi-test-webapp/pom.xml
index 7aada14..9def8b6 100644
--- a/tests/integration/cdi-test-webapp/pom.xml
+++ b/tests/integration/cdi-test-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-test-webapp</artifactId>
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ConstructorInjectedResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ConstructorInjectedResource.java
index 736dfb9..59dd46c 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ConstructorInjectedResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ConstructorInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* and a single String parameter coming from application provided CDI producer,
* {@link CustomCdiProducer}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("ctor-injected/{p}")
@RequestScoped
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CounterResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CounterResource.java
index 8342a0c..06239ff 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CounterResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CounterResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
* Part of JERSEY-2461 reproducer. This one will get injected with a CDI extension.
* HK2 should not mess up with this.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("counter")
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CustomCdiProducer.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CustomCdiProducer.java
index 9f00838..79edb6a 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CustomCdiProducer.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CustomCdiProducer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -27,7 +27,7 @@
* CDI producer to help us make sure HK2 do not mess up with
* types backed by CDI producers.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CustomCdiProducer {
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CustomExtension.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CustomExtension.java
index 081bc51..7bf09f2 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CustomExtension.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CustomExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -23,7 +23,7 @@
* Part of JERSEY-2461 reproducer. We need an extension that we could inject,
* to make sure HK2 custom binding does not attempt to mess up.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CustomExtension implements Extension {
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
index 287d734..1f0ceca 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
/**
* Simple echo service to test injections using {@link Qualifier}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface EchoService {
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/FieldProducedBean.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/FieldProducedBean.java
index 2dbb6c4..db9b00b 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/FieldProducedBean.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/FieldProducedBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
* A bean that would be produced by a CDI producer field.
* This is to make sure we do not mess up with CDI producers with HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Vetoed
public class FieldProducedBean<T> implements ValueHolder<T> {
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/FirstNonJaxRsBeanInjectedResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/FirstNonJaxRsBeanInjectedResource.java
index 60b552e..50b0856 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/FirstNonJaxRsBeanInjectedResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/FirstNonJaxRsBeanInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
* that includes JAX-RS injection points. The very same bean
* gets injected also to {@link FirstNonJaxRsBeanInjectedResource}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("non-jaxrs-bean-injected")
@RequestScoped
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentExceptionMapper.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentExceptionMapper.java
index 390dc97..e6d1ee6 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentExceptionMapper.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -33,7 +33,7 @@
* JAX-RS exception mapper registered as a CDI managed bean.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
@ManagedBean
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentPerRequestResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentPerRequestResource.java
index 2a36eff..9626616 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentPerRequestResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentPerRequestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,7 +37,7 @@
* Request scoped JAX-RS resource registered as a CDI managed bean.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/jcdibean/dependent/per-request")
@ManagedBean
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentResource.java
index 589de49..7547cc5 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* Test case for JERSEY-1747.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/jcdibean/dependent/timer")
public class JCDIBeanDependentResource {
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentSingletonResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentSingletonResource.java
index 09ecf81..d7e9bb0 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentSingletonResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanDependentSingletonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -37,7 +37,7 @@
* Application scoped JAX-RS resource registered as CDI managed bean.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/jcdibean/dependent/singleton/{p}")
@ApplicationScoped
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanPerRequestResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanPerRequestResource.java
index 303e9ad..38a6054 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanPerRequestResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanPerRequestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* Request scoped JAX-RS resource registered.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/jcdibean/per-request")
@RequestScoped
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanRequestScopedTimer.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanRequestScopedTimer.java
index 019f5a5..9b8a21d 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanRequestScopedTimer.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanRequestScopedTimer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
/**
* Request scoped CDI bean to be injected into {@link JCDIBeanDependentResource}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
public class JCDIBeanRequestScopedTimer {
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanSingletonResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanSingletonResource.java
index a181f4f..27cd7c4 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanSingletonResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/JCDIBeanSingletonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -38,7 +38,7 @@
* Application scoped JAX-RS resource.
*
* @author Paul Sandoz
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/jcdibean/singleton/{p}")
@ApplicationScoped
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MainApplication.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MainApplication.java
index b6ec0e6..aa38055 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MainApplication.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MainApplication.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019 Payara Foundation 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
@@ -35,7 +36,8 @@
/**
* JAX-RS application to configure resources.
*
- * @author Jonathan Benoit (jonathan.benoit at oracle.com)
+ * @author Jonathan Benoit
+ * @author Patrik Dudits
*/
@ApplicationPath("main")
@ApplicationScoped
@@ -66,6 +68,7 @@
classes.add(ConstructorInjectedResource.class);
classes.add(ProducerResource.class);
classes.add(FirstNonJaxRsBeanInjectedResource.class);
+ classes.add(ResponseFilter.class);
return classes;
}
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MethodProducedBean.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MethodProducedBean.java
index 94f842f..1ad53e7 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MethodProducedBean.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MethodProducedBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
* A bean that would be produced by a CDI producer method.
* This is to make sure we do not mess up with CDI producers with HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Vetoed
public class MethodProducedBean<T> implements ValueHolder<T> {
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ProducerResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ProducerResource.java
index 4588692..9482e50 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ProducerResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ProducerResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
* This one will get injected with a CDI producer.
* HK2 should not mess up with this.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("producer")
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ResponseFilter.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ResponseFilter.java
new file mode 100644
index 0000000..6acfd36
--- /dev/null
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ResponseFilter.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 Payara Foundation 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.tests.cdi.resources;
+
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import java.io.IOException;
+import java.util.UUID;
+
+/**
+ * CDI Managed response filter that should add single HTTP header.
+ * @author Patrik Dudits
+ */
+public class ResponseFilter implements ContainerResponseFilter {
+
+ @Override
+ public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
+ responseContext.getHeaders().add("Filter-Invoked", UUID.randomUUID().toString());
+ }
+}
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ReverseEcho.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ReverseEcho.java
index b385655..b8bee4b 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ReverseEcho.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ReverseEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Echo implementation to reverse given input.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Reversing
public class ReverseEcho implements EchoService {
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Reversing.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Reversing.java
index afe0ff5..9ffe455 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Reversing.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Reversing.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* Qualifier for reversing echo service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ReversingEchoResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ReversingEchoResource.java
index c1eef59..cac4c3c 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ReversingEchoResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ReversingEchoResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,7 +27,7 @@
* CDI backed JAX-RS resource to reverse input query parameter using
* qualified injection to get a CDI backed service provider.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("reverse")
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/SecondNonJaxRsBeanInjectedResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/SecondNonJaxRsBeanInjectedResource.java
index eb4650a..892307e 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/SecondNonJaxRsBeanInjectedResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/SecondNonJaxRsBeanInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
* that includes JAX-RS injection points. The very same bean
* gets injected also to {@link FirstNonJaxRsBeanInjectedResource}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("non-jaxrs-bean-injected")
@RequestScoped
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/SecondaryApplication.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/SecondaryApplication.java
index fccc031..5b0d909 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/SecondaryApplication.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/SecondaryApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -35,7 +35,7 @@
* in CDI managed environment and JAX-RS injection keeps
* functioning as expected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("secondary")
@ApplicationScoped
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Stuttering.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Stuttering.java
index a1cc1a8..90d5b5a 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Stuttering.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Stuttering.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* Qualifier for stuttering echo service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/StutteringEcho.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/StutteringEcho.java
index 0579f8c..448132e 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/StutteringEcho.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/StutteringEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
* Echo implementation to stutter given input n-times.
* The stutter factor could be set via JAX-RS interface.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stuttering
@ApplicationScoped
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/StutteringEchoResource.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/StutteringEchoResource.java
index c3d5a56..1a140ed 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/StutteringEchoResource.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/StutteringEchoResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
* CDI backed JAX-RS resource to stutter input query parameter.
* Uses qualified injection to get a CDI backed service provider.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@Path("stutter")
diff --git a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ValueHolder.java b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ValueHolder.java
index 11046fc..05cee03 100644
--- a/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ValueHolder.java
+++ b/tests/integration/cdi-test-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/ValueHolder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +20,7 @@
* Helper type to check CDI producer mechanism is not broken
* by automatic HK2/CDI bindings.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface ValueHolder<T> {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
index a3137a9..067e2af 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
* $AS_HOME/bin/asadmin deploy target/cdi-test-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiTest extends JerseyTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CounterTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CounterTest.java
index 62f4f5d..0d7e76d 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CounterTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CounterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
* Part of JERSEY-2641 reproducer. Accessing CDI bean that has custom CDI
* extension injected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CounterTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/JaxRsInjectedCdiBeanTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/JaxRsInjectedCdiBeanTest.java
index 56cc87b..64630ee 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/JaxRsInjectedCdiBeanTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/JaxRsInjectedCdiBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test that a raw CDI managed bean gets JAX-RS injected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsInjectedCdiBeanTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/NonJaxRsBeanJaxRsInjectionTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/NonJaxRsBeanJaxRsInjectionTest.java
index 2775ebf..a955785 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/NonJaxRsBeanJaxRsInjectionTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/NonJaxRsBeanJaxRsInjectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -49,7 +49,7 @@
* and {@link SecondJaxRsInjectedCdiBeanTest},
* do the same job, because the WAR application contains both Jersey apps already.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class NonJaxRsBeanJaxRsInjectionTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/PerRequestBeanTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/PerRequestBeanTest.java
index 19d3984..973860b 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/PerRequestBeanTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/PerRequestBeanTest.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019 Payara Foundation 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,17 +21,22 @@
import java.util.List;
import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Response;
+import org.hamcrest.CoreMatchers;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import static org.hamcrest.CoreMatchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
/**
* Test for the request scoped resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
+ * @author Patrik Dudits
*/
@RunWith(Parameterized.class)
public class PerRequestBeanTest extends CdiTest {
@@ -66,4 +72,18 @@
assertThat(s, containsString(target.getUri().toString()));
assertThat(s, containsString(String.format("queryParam=%s", x)));
}
+
+ @Test
+ public void testSingleResponseFilterInvocation() {
+
+ final WebTarget target = target().path("jcdibean/per-request").queryParam("x", x);
+
+ Response response = target.request().get();
+
+ List<Object> invocationIds = response.getHeaders().get("Filter-Invoked");
+
+ assertNotNull("Filter-Invoked header should be set by ResponseFilter", invocationIds);
+ assertEquals("ResponseFilter should be invoked only once", 1, invocationIds.size());
+ }
+
}
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/PerRequestDependentBeanTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/PerRequestDependentBeanTest.java
index dd2e879..458e548 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/PerRequestDependentBeanTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/PerRequestDependentBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for the request scoped managed bean resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class PerRequestDependentBeanTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ProducerTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ProducerTest.java
index 1ecf8cd..418067b 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ProducerTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ProducerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -26,7 +26,7 @@
/**
* Check that automatic HK2 bindings do not break CDI producer mechanism.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ProducerTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/QualifiedInjectionSetGetTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/QualifiedInjectionSetGetTest.java
index 9a01764..a928b91 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/QualifiedInjectionSetGetTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/QualifiedInjectionSetGetTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
* Test CDI bean injected using a {@link Qualifier}
* is setup via JAX-RS interface first.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class QualifiedInjectionSetGetTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ReverseEchoTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ReverseEchoTest.java
index 0c3c5ca..d7ce046 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ReverseEchoTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ReverseEchoTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for qualified injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class ReverseEchoTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SecondJaxRsInjectedCdiBeanTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SecondJaxRsInjectedCdiBeanTest.java
index a273de4..5b86192 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SecondJaxRsInjectedCdiBeanTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SecondJaxRsInjectedCdiBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -35,7 +35,7 @@
/**
* Test that a raw CDI managed bean gets JAX-RS injected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class SecondJaxRsInjectedCdiBeanTest extends JerseyTest {
Weld weld;
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SingletonBeanTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SingletonBeanTest.java
index 0b35e30..1dcf301 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SingletonBeanTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SingletonBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
/**
* Test for the application scoped resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class SingletonBeanTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SingletonDependentBeanTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SingletonDependentBeanTest.java
index 5a21ae8..056c3c5 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SingletonDependentBeanTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/SingletonDependentBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
/**
* Test for the application scoped managed bean resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class SingletonDependentBeanTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/StutterEchoTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/StutterEchoTest.java
index bc0dc27..b8655a6 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/StutterEchoTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/StutterEchoTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for qualified injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class StutterEchoTest extends CdiTest {
diff --git a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/TimerTest.java b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/TimerTest.java
index ba4ba33..94eee9f 100644
--- a/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/TimerTest.java
+++ b/tests/integration/cdi-test-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/TimerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
/**
* Reproducer for JERSEY-1747.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class TimerTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/pom.xml b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/pom.xml
index c65ef87..d032105 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/pom.xml
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-with-jersey-injection-custom-cfg-webapp</artifactId>
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
index 16f3efb..ef40213 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
/**
* Application specific echo implementation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@AppSpecific
@ApplicationScoped
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
index f153c02..62a932d 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
* CDI backed, application scoped, JAX-RS resource to be injected
* via it's constructor from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@Path("app-ctor-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
index 8999f6a..dda6c10 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,7 +33,7 @@
* CDI backed, application scoped, JAX-RS resource.
* It's fields are injected from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@Path("app-field-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
index 000fc6d..6e156cd 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Qualifier for application specific echo service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
index 8745b22..2ba1f04 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
/**
* Simple echo service to test injections using {@link Qualifier}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface EchoService {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Hk2InjectedType.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Hk2InjectedType.java
index d7d73ed..67b79dd 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Hk2InjectedType.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/Hk2InjectedType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* CDI compliant bean. Injection will be delegated to HK2 anyway.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Hk2InjectedType {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
index a5fc240..9329160 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS application to configure resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/*")
public class MyApplication extends ResourceConfig {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyHk2TypesProvider.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyHk2TypesProvider.java
index 365e41b..379a8d8 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyHk2TypesProvider.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyHk2TypesProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* Tell Jersey CDI extension what types should be bridged from HK2 to CDI.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class MyHk2TypesProvider implements Hk2CustomBoundTypesProvider {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
index e0c26bc..b95c136 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Request specific echo implementation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestSpecific
public class RequestEcho implements EchoService {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
index 881895d..2356b4a 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
* CDI backed, request scoped, JAX-RS resource to be injected
* via it's constructor from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("request-ctor-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
index a24f88f..f87610f 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,7 +33,7 @@
* CDI backed, request scoped, JAX-RS resource.
* It's fields are injected from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("request-field-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
index 05f048d..037f5a5 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Qualifier for request specific echo service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
index bafe964..a3763ff 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
* $AS_HOME/bin/asadmin deploy target/cdi-with-jersey-injection-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiTest extends JerseyTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
index 0b58f6d..e050cff 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
/**
* Test custom HK2 injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class CustomInjectionTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
index 5675349..6319cad 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
/**
* Test for exception mapper injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class ExceptionMappersTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
index 25aed86..c8de729 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for monitoring statistics injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class MonitoringTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
index a31befa..93370c5 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-cfg-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
/**
* Test injection of request depending instances works as expected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class RequestSensitiveTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/pom.xml b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/pom.xml
index 2cc5479..8603866 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/pom.xml
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-with-jersey-injection-custom-hk2-banned-webapp</artifactId>
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
index 16f3efb..ef40213 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
/**
* Application specific echo implementation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@AppSpecific
@ApplicationScoped
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
index a50a688..1e0a529 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
* CDI backed, application scoped, JAX-RS resource to be injected
* via it's constructor from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@Path("app-ctor-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
index 8c16474..06f5160 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,7 +33,7 @@
* CDI backed, application scoped, JAX-RS resource.
* It's fields are injected from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@Path("app-field-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
index 000fc6d..6e156cd 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Qualifier for application specific echo service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiInjectedType.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiInjectedType.java
index 84b1fc2..2f02cd6 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiInjectedType.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/CdiInjectedType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* CDI compliant bean. Injection will be done by CDI in this application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiInjectedType {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
index 8745b22..2ba1f04 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
/**
* Simple echo service to test injections using {@link Qualifier}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface EchoService {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
index 829f43a..fafc0db 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS application to configure resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/*")
public class MyApplication extends ResourceConfig {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
index e0c26bc..b95c136 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Request specific echo implementation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestSpecific
public class RequestEcho implements EchoService {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
index 0080e0d..37f1758 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
* CDI backed, request scoped, JAX-RS resource to be injected
* via it's constructor from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("request-ctor-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
index eecf01e..7363977 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,7 +33,7 @@
* CDI backed, request scoped, JAX-RS resource.
* It's fields are injected from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("request-field-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
index 05f048d..037f5a5 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Qualifier for request specific echo service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
index 89cf238..2399a21 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
* $AS_HOME/bin/asadmin deploy target/cdi-with-jersey-injection-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiTest extends JerseyTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
index 6498726..ccdd993 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
/**
* Test custom HK2 injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class CustomInjectionTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
index e87369f..00001e0 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
/**
* Test for exception mapper injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class ExceptionMappersTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
index 25aed86..c8de729 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for monitoring statistics injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class MonitoringTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
index a31befa..93370c5 100644
--- a/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
+++ b/tests/integration/cdi-with-jersey-injection-custom-hk2-banned-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
/**
* Test injection of request depending instances works as expected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class RequestSensitiveTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/pom.xml b/tests/integration/cdi-with-jersey-injection-webapp/pom.xml
index cc1e4ba..61daf4d 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/pom.xml
+++ b/tests/integration/cdi-with-jersey-injection-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>cdi-with-jersey-injection-webapp</artifactId>
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
index 16f3efb..ef40213 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
/**
* Application specific echo implementation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@AppSpecific
@ApplicationScoped
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
index 2bffeea..442ee42 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedCtorInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
* CDI backed, application scoped, JAX-RS resource to be injected
* via it's constructor from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@Path("app-ctor-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
index 4c196d3..76a49a7 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppScopedFieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,7 +33,7 @@
* CDI backed, application scoped, JAX-RS resource.
* It's fields are injected from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationScoped
@Path("app-field-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
index 000fc6d..6e156cd 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/AppSpecific.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Qualifier for application specific echo service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
index 8745b22..2ba1f04 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/EchoService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
/**
* Simple echo service to test injections using {@link Qualifier}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface EchoService {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
index 027c907..238edb2 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS application to configure resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/*")
public class MyApplication extends ResourceConfig {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyHk2TypesProvider.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyHk2TypesProvider.java
index 362adf3..9131412 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyHk2TypesProvider.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/MyHk2TypesProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* Tell Jersey CDI extension what types should be bridged from HK2 to CDI.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class MyHk2TypesProvider implements Hk2CustomBoundTypesProvider {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
index e0c26bc..b95c136 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Request specific echo implementation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestSpecific
public class RequestEcho implements EchoService {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
index 250c0d8..76ab792 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedCtorInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
* CDI backed, request scoped, JAX-RS resource to be injected
* via it's constructor from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("request-ctor-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
index e762601..9b20728 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestScopedFieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -33,7 +33,7 @@
* CDI backed, request scoped, JAX-RS resource.
* It's fields are injected from both CDI and Jersey HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("request-field-injected")
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
index 05f048d..037f5a5 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/main/java/org/glassfish/jersey/tests/cdi/resources/RequestSpecific.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Qualifier for request specific echo service.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
index 1273dd1..45bc068 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
* $AS_HOME/bin/asadmin deploy target/cdi-with-jersey-injection-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CdiTest extends JerseyTest {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
index 4878426..ffc79ad 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/CustomInjectionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
/**
* Test custom HK2 injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class CustomInjectionTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
index 4020db3..0dc333d 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/ExceptionMappersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
/**
* Test for exception mapper injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class ExceptionMappersTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
index f364be2..ff7de39 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/MonitoringTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for monitoring statistics injection.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class MonitoringTest extends CdiTest {
diff --git a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
index ff41909..930eb37 100644
--- a/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
+++ b/tests/integration/cdi-with-jersey-injection-webapp/src/test/java/org/glassfish/jersey/tests/cdi/resources/RequestSensitiveTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
/**
* Test injection of request depending instances works as expected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(Parameterized.class)
public class RequestSensitiveTest extends CdiTest {
diff --git a/tests/integration/client-connector-provider/pom.xml b/tests/integration/client-connector-provider/pom.xml
index 2ac28a6..202c4c8 100644
--- a/tests/integration/client-connector-provider/pom.xml
+++ b/tests/integration/client-connector-provider/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>client-connector-provider</artifactId>
diff --git a/tests/integration/client-connector-provider/src/main/java/org/glassfish/jersey/tests/integration/client/connector/provider/CustomConnectorProvider.java b/tests/integration/client-connector-provider/src/main/java/org/glassfish/jersey/tests/integration/client/connector/provider/CustomConnectorProvider.java
index 5a4e70b..969e24c 100644
--- a/tests/integration/client-connector-provider/src/main/java/org/glassfish/jersey/tests/integration/client/connector/provider/CustomConnectorProvider.java
+++ b/tests/integration/client-connector-provider/src/main/java/org/glassfish/jersey/tests/integration/client/connector/provider/CustomConnectorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
import org.glassfish.jersey.client.spi.Connector;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public final class CustomConnectorProvider extends HttpUrlConnectorProvider {
diff --git a/tests/integration/client-connector-provider/src/main/java/org/glassfish/jersey/tests/integration/client/connector/provider/TestResource.java b/tests/integration/client-connector-provider/src/main/java/org/glassfish/jersey/tests/integration/client/connector/provider/TestResource.java
index f941b89..a0a7875 100644
--- a/tests/integration/client-connector-provider/src/main/java/org/glassfish/jersey/tests/integration/client/connector/provider/TestResource.java
+++ b/tests/integration/client-connector-provider/src/main/java/org/glassfish/jersey/tests/integration/client/connector/provider/TestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +20,7 @@
import javax.ws.rs.Path;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("test")
public class TestResource {
diff --git a/tests/integration/client-connector-provider/src/test/java/org/glassfish/jersey/tests/integration/client/connector/provider/CustomConnectorProviderTest.java b/tests/integration/client-connector-provider/src/test/java/org/glassfish/jersey/tests/integration/client/connector/provider/CustomConnectorProviderTest.java
index dc4daf1..677cc27 100644
--- a/tests/integration/client-connector-provider/src/test/java/org/glassfish/jersey/tests/integration/client/connector/provider/CustomConnectorProviderTest.java
+++ b/tests/integration/client-connector-provider/src/test/java/org/glassfish/jersey/tests/integration/client/connector/provider/CustomConnectorProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class CustomConnectorProviderTest extends JerseyTest {
diff --git a/tests/integration/ejb-multimodule-reload/ear/pom.xml b/tests/integration/ejb-multimodule-reload/ear/pom.xml
index a91b98e..dc26273 100644
--- a/tests/integration/ejb-multimodule-reload/ear/pom.xml
+++ b/tests/integration/ejb-multimodule-reload/ear/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/ejb-multimodule-reload/lib/pom.xml b/tests/integration/ejb-multimodule-reload/lib/pom.xml
index 5161619..bd30e2d 100644
--- a/tests/integration/ejb-multimodule-reload/lib/pom.xml
+++ b/tests/integration/ejb-multimodule-reload/lib/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ContainerListener.java b/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ContainerListener.java
index 11de9c9..e72c8f6 100644
--- a/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ContainerListener.java
+++ b/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ContainerListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* JAX-RS resource that keeps number of reloads.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
@Singleton
diff --git a/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/EjbReloaderService.java b/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/EjbReloaderService.java
index fc95ca8..79c8490 100644
--- a/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/EjbReloaderService.java
+++ b/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/EjbReloaderService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Singleton EJB bean that is used to reload the first web application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Singleton
public class EjbReloaderService {
diff --git a/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ReloadDetectionResource.java b/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ReloadDetectionResource.java
index 95cbf5b..126942d 100644
--- a/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ReloadDetectionResource.java
+++ b/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ReloadDetectionResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
* returned from its getNano resource method
* will get adjusted with each reload.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("last-init-nano-time")
public class ReloadDetectionResource {
diff --git a/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ReloaderResource.java b/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ReloaderResource.java
index ff2ce6d..a2cd24a 100644
--- a/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ReloaderResource.java
+++ b/tests/integration/ejb-multimodule-reload/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/lib/ReloaderResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
* JAX-RS resource used to reload the first application.
* This resource is only registered inside the second application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
@Path("reload")
diff --git a/tests/integration/ejb-multimodule-reload/pom.xml b/tests/integration/ejb-multimodule-reload/pom.xml
index a70255e..019424b 100644
--- a/tests/integration/ejb-multimodule-reload/pom.xml
+++ b/tests/integration/ejb-multimodule-reload/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>ejb-multimodule-reload</artifactId>
diff --git a/tests/integration/ejb-multimodule-reload/war1/pom.xml b/tests/integration/ejb-multimodule-reload/war1/pom.xml
index b270d60..f02bf85 100644
--- a/tests/integration/ejb-multimodule-reload/war1/pom.xml
+++ b/tests/integration/ejb-multimodule-reload/war1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/ejb-multimodule-reload/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web1/FirstApp.java b/tests/integration/ejb-multimodule-reload/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web1/FirstApp.java
index f24d546..334670a 100644
--- a/tests/integration/ejb-multimodule-reload/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web1/FirstApp.java
+++ b/tests/integration/ejb-multimodule-reload/war1/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web1/FirstApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
* Initial JAX-RS application for the first web application.
* This one will get reloaded.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/")
public class FirstApp extends Application {
diff --git a/tests/integration/ejb-multimodule-reload/war1/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web1/ReloadTest.java b/tests/integration/ejb-multimodule-reload/war1/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web1/ReloadTest.java
index 4d854b0..0fcfe45 100644
--- a/tests/integration/ejb-multimodule-reload/war1/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web1/ReloadTest.java
+++ b/tests/integration/ejb-multimodule-reload/war1/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web1/ReloadTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -37,7 +37,7 @@
* $AS_HOME/bin/asadmin deploy ../ear/target/ejb-multimodule-reload-ear-*.ear
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ReloadTest extends JerseyTest {
diff --git a/tests/integration/ejb-multimodule-reload/war2/pom.xml b/tests/integration/ejb-multimodule-reload/war2/pom.xml
index fdfa36d..3ec6686 100644
--- a/tests/integration/ejb-multimodule-reload/war2/pom.xml
+++ b/tests/integration/ejb-multimodule-reload/war2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/ejb-multimodule-reload/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web2/SecondApp.java b/tests/integration/ejb-multimodule-reload/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web2/SecondApp.java
index 89d2304..fb878f1 100644
--- a/tests/integration/ejb-multimodule-reload/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web2/SecondApp.java
+++ b/tests/integration/ejb-multimodule-reload/war2/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web2/SecondApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
* JAX-RS application from which we are going to reload
* the other one.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/")
public class SecondApp extends Application {
diff --git a/tests/integration/ejb-multimodule-reload/war2/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web2/JaxRsFromEjbLibraryTest.java b/tests/integration/ejb-multimodule-reload/war2/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web2/JaxRsFromEjbLibraryTest.java
index 7dc32da..58ee352 100644
--- a/tests/integration/ejb-multimodule-reload/war2/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web2/JaxRsFromEjbLibraryTest.java
+++ b/tests/integration/ejb-multimodule-reload/war2/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/reload/web2/JaxRsFromEjbLibraryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -41,8 +41,8 @@
* $AS_HOME/bin/asadmin deploy ../ear/target/ejb-multimodule-ear-*.ear
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Jakub Podlesak
+ * @author Libor Kramolis
*/
public class JaxRsFromEjbLibraryTest extends JerseyTest {
diff --git a/tests/integration/ejb-multimodule/ear/pom.xml b/tests/integration/ejb-multimodule/ear/pom.xml
index 35ea492..dec2385 100644
--- a/tests/integration/ejb-multimodule/ear/pom.xml
+++ b/tests/integration/ejb-multimodule/ear/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/ejb-multimodule/lib/pom.xml b/tests/integration/ejb-multimodule/lib/pom.xml
index 9530da4..e9baab7 100644
--- a/tests/integration/ejb-multimodule/lib/pom.xml
+++ b/tests/integration/ejb-multimodule/lib/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/EjbCounterResource.java b/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/EjbCounterResource.java
index b1fcf20..e86aa1f 100644
--- a/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/EjbCounterResource.java
+++ b/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/EjbCounterResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
* The bean is for one published as a standalone JAX-RS resource
* and for two used to inject other EJB based JAX-RS resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Singleton
@Path("counter")
diff --git a/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/StatefulResource.java b/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/StatefulResource.java
index 6250c2d..0d7babd 100644
--- a/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/StatefulResource.java
+++ b/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/StatefulResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS resource backed with a stateful EJB bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateful
@Path("stateful")
diff --git a/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/StatelessResource.java b/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/StatelessResource.java
index b349095..77e77f3 100644
--- a/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/StatelessResource.java
+++ b/tests/integration/ejb-multimodule/lib/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/lib/StatelessResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -26,7 +26,7 @@
/**
* JAX-RS resource backed by a stateless EJB bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
@Path("stateless")
diff --git a/tests/integration/ejb-multimodule/pom.xml b/tests/integration/ejb-multimodule/pom.xml
index d708b3e..7b0d617 100644
--- a/tests/integration/ejb-multimodule/pom.xml
+++ b/tests/integration/ejb-multimodule/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>ejb-multimodule</artifactId>
diff --git a/tests/integration/ejb-multimodule/war/pom.xml b/tests/integration/ejb-multimodule/war/pom.xml
index 8e49c6d..22125cb 100644
--- a/tests/integration/ejb-multimodule/war/pom.xml
+++ b/tests/integration/ejb-multimodule/war/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/ejb-multimodule/war/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/JaxRsConfiguration.java b/tests/integration/ejb-multimodule/war/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/JaxRsConfiguration.java
index 18ab4ce..e0a659d 100644
--- a/tests/integration/ejb-multimodule/war/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/JaxRsConfiguration.java
+++ b/tests/integration/ejb-multimodule/war/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/JaxRsConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
* JAX-RS application resource configuration that includes only
* those JAX-RS components imported from EJB library jar.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("resources")
public class JaxRsConfiguration extends Application {
diff --git a/tests/integration/ejb-multimodule/war/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/WarStatelessResource.java b/tests/integration/ejb-multimodule/war/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/WarStatelessResource.java
index 008539d..a67a94d 100644
--- a/tests/integration/ejb-multimodule/war/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/WarStatelessResource.java
+++ b/tests/integration/ejb-multimodule/war/src/main/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/WarStatelessResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,8 +29,8 @@
/**
* JAX-RS resource backed by a stateless EJB bean placed in WAR module.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Jakub Podlesak
+ * @author Libor Kramolis
*/
@Stateless
@Path("war-stateless")
diff --git a/tests/integration/ejb-multimodule/war/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/JaxRsFromEjbLibraryTest.java b/tests/integration/ejb-multimodule/war/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/JaxRsFromEjbLibraryTest.java
index 3eb6aa0..a2dbf02 100644
--- a/tests/integration/ejb-multimodule/war/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/JaxRsFromEjbLibraryTest.java
+++ b/tests/integration/ejb-multimodule/war/src/test/java/org/glassfish/jersey/tests/integration/multimodule/ejb/web1/JaxRsFromEjbLibraryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -41,8 +41,8 @@
* $AS_HOME/bin/asadmin deploy ../ear/target/ejb-multimodule-ear-*.ear
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Jakub Podlesak
+ * @author Libor Kramolis
*/
public class JaxRsFromEjbLibraryTest extends JerseyTest {
diff --git a/tests/integration/ejb-test-webapp/pom.xml b/tests/integration/ejb-test-webapp/pom.xml
index 5319f9a..67224ef 100644
--- a/tests/integration/ejb-test-webapp/pom.xml
+++ b/tests/integration/ejb-test-webapp/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>ejb-test-webapp</artifactId>
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/AppResource.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/AppResource.java
index ba03d17..44095d2 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/AppResource.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/AppResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test resource that exposes counter from the JAX-RS application subclass.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
@Path("app")
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CounterBean.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CounterBean.java
index 3e43e59..bad5b15 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CounterBean.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CounterBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
/**
* EJB singleton utilized as request counter in this test application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Singleton
public class CounterBean {
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CounterFilter.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CounterFilter.java
index e67edc4..ee9953b 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CounterFilter.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CounterFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
* Response filter implemented as EJB bean. The filter adds Request-Count response header to each response.
* Another EJB singleton bean, CounterBean, is injected that holds the actual request count.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
@Stateless
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomBaseException.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomBaseException.java
index fda6ed4..767f9ea 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomBaseException.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomBaseException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
* This one serves as a base for other exceptions
* mapped by {@link EjbExceptionMapperOne} and {@link EjbExceptionMapperTwo}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CustomBaseException extends Exception {
}
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomExceptionOne.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomExceptionOne.java
index 8a71b6e..c92181b 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomExceptionOne.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomExceptionOne.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +20,7 @@
* Custom exception. Part of JERSEY-2320 reproducer.
* This one gets mapped by {@link EjbExceptionMapperOne}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CustomExceptionOne extends CustomBaseException {
}
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomExceptionTwo.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomExceptionTwo.java
index 021dbdc..bf7afac 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomExceptionTwo.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/CustomExceptionTwo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +20,7 @@
* Custom exception. Part of JERSEY-2320 reproducer.
* This one gets mapped by {@link EjbExceptionMapperTwo}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CustomExceptionTwo extends CustomBaseException {
}
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/Echo.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/Echo.java
index 1e544bb..517bbe7 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/Echo.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/Echo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
* EJB remote interface. Part of the reproducer for GLASSFISH-16199.
* See also the other test case implemented by {@link RawEchoResource}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Remote
public interface Echo {
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EchoBean.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EchoBean.java
index 7763ed8..4c5b3af 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EchoBean.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EchoBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
* This is to prove EJB container is used in {@link EchoResource}
* and {@link RawEchoResource} resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateful
public class EchoBean {
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EchoResource.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EchoResource.java
index 1414e32..6a17f5d 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EchoResource.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EchoResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -31,7 +31,7 @@
* and {@link Remote} annotations.
* Reproducible test case for GLASSFISH-16199.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
@Path("echo")
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperBase.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperBase.java
index 715d481..132bb5a 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperBase.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
* JERSEY-2320 reproducer. {@link CustomBaseException} will get mapped
* to an ordinary response.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public abstract class EjbExceptionMapperBase<T extends CustomBaseException> implements ExceptionMapper<T> {
}
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperOne.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperOne.java
index 0b9a559..4626859 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperOne.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperOne.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
* to an ordinary response. We make sure the mapper gets injected properly
* by both Jersey runtime and EJB container.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Singleton
public class EjbExceptionMapperOne extends EjbExceptionMapperBase<CustomExceptionOne> {
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperTwo.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperTwo.java
index 61227e9..8842ae9 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperTwo.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/EjbExceptionMapperTwo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
* to an ordinary response. We make sure the mapper gets injected properly
* by both Jersey runtime and EJB container.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
public class EjbExceptionMapperTwo extends EjbExceptionMapperBase<CustomExceptionTwo> {
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/ExceptionEjbResource.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/ExceptionEjbResource.java
index 9a12454..e32d4a1 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/ExceptionEjbResource.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/ExceptionEjbResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
/**
* EJB backed JAX-RS resource to test if a custom exception info makes it to the client.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Singleton
@Path("exception")
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/MyApplication.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/MyApplication.java
index c9c84a0..d10f42d 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/MyApplication.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
/**
* JAX-RS application to configure resources.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/rest")
@Singleton
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/RawEcho.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/RawEcho.java
index 5b53347..bd8fcf8 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/RawEcho.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/RawEcho.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +20,7 @@
* Part of the reproducer for GLASSFISH-16199. This EJB business interface
* is being registered by an annotation on the EJB component class, {@link RawEchoResource}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface RawEcho {
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/RawEchoResource.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/RawEchoResource.java
index bbbe77c..6b1c683 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/RawEchoResource.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/RawEchoResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
* implementing EJB interface, {@link RawEcho}, that is registered using {@link Remote} annotations.
* Reproducible test case for GLASSFISH-16199.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
@Path("raw-echo")
diff --git a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/StandaloneServlet.java b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/StandaloneServlet.java
index 29e9ad5..eab13e9 100644
--- a/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/StandaloneServlet.java
+++ b/tests/integration/ejb-test-webapp/src/main/java/org/glassfish/jersey/tests/ejb/resources/StandaloneServlet.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -31,7 +31,7 @@
* It helps to compare Jersey and non-Jersey specific exception handling
* processing.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@WebServlet(name = "StandaloneServlet", urlPatterns = {"/servlet"})
public class StandaloneServlet extends HttpServlet {
diff --git a/tests/integration/ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/ejb/resources/EjbTest.java b/tests/integration/ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/ejb/resources/EjbTest.java
index a588cf6..777d28d 100644
--- a/tests/integration/ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/ejb/resources/EjbTest.java
+++ b/tests/integration/ejb-test-webapp/src/test/java/org/glassfish/jersey/tests/ejb/resources/EjbTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -43,7 +43,7 @@
* $AS_HOME/bin/asadmin deploy target/ejb-test-webapp
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class EjbTest extends JerseyTest {
diff --git a/tests/integration/j-376/pom.xml b/tests/integration/j-376/pom.xml
index 0721459..0dad7dc 100644
--- a/tests/integration/j-376/pom.xml
+++ b/tests/integration/j-376/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.tests.integration</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>j-376</artifactId>
@@ -55,10 +55,9 @@
</dependency>
<dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
<scope>compile</scope>
- <version>1.1.0.Final</version>
</dependency>
<dependency>
diff --git a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ApplicationScopedBean.java b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ApplicationScopedBean.java
index 1f5e78e..5ef33c8 100644
--- a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ApplicationScopedBean.java
+++ b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ApplicationScopedBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
* Test {@code ApplicationScoped} bean to be injected to the test resource, while another {@code RequestScoped}
* bean being injected into this class.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@ApplicationScoped
public class ApplicationScopedBean {
diff --git a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ApplicationScopedResource.java b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ApplicationScopedResource.java
index b0bf055..693fd4d 100644
--- a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ApplicationScopedResource.java
+++ b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ApplicationScopedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* Resource to test CDI injection into {@code ApplicationScoped} JAX-RS resource.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("appScope")
@ApplicationScoped
diff --git a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ConstructorInjectionResource.java b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ConstructorInjectionResource.java
index a016733..08d12c8 100644
--- a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ConstructorInjectionResource.java
+++ b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/ConstructorInjectionResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Resource to test CDI injection into JAX-RS resource via constructor parameter.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("constructor")
@RequestScoped
diff --git a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/FieldInjectionResource.java b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/FieldInjectionResource.java
index 84c6ec5..768c1c6 100644
--- a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/FieldInjectionResource.java
+++ b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/FieldInjectionResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
/**
* Resource to test CDI injection into JAX-RS resource via field.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("field")
@RequestScoped
diff --git a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/GrizzlyApp.java b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/GrizzlyApp.java
index 3de6d9c..a16b78d 100644
--- a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/GrizzlyApp.java
+++ b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/GrizzlyApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
/**
* CDI Test App launcher. Starts the Grizzly server and initializes weld.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class GrizzlyApp {
diff --git a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/MethodInjectionResource.java b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/MethodInjectionResource.java
index 3f19676..a38c9b0 100644
--- a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/MethodInjectionResource.java
+++ b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/MethodInjectionResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
/**
* Resource to test CDI injection into JAX-RS resource via setter.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("method")
@RequestScoped
diff --git a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/MyApplication.java b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/MyApplication.java
index 4ec0beb..e45b2de 100644
--- a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/MyApplication.java
+++ b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* JAX-RS Application subclass, defines the test application resources.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@ApplicationPath("/*")
public class MyApplication extends Application {
diff --git a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/SecondBean.java b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/SecondBean.java
index 2e5ead4..b815903 100644
--- a/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/SecondBean.java
+++ b/tests/integration/j-376/src/main/java/org/glassfish/jersey/tests/integration/j376/SecondBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
* The purpose is to test, that CDI and hk2 injections are working together so that one class be injected by
* both CDI and Jersey/hk2.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@RequestScoped
public class SecondBean {
diff --git a/tests/integration/j-376/src/test/java/org/glassfish/jersey/tests/integration/j376/J376Test.java b/tests/integration/j-376/src/test/java/org/glassfish/jersey/tests/integration/j376/J376Test.java
index fa39021..91b6c50 100644
--- a/tests/integration/j-376/src/test/java/org/glassfish/jersey/tests/integration/j376/J376Test.java
+++ b/tests/integration/j-376/src/test/java/org/glassfish/jersey/tests/integration/j376/J376Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class J376Test {
final Client client = ClientBuilder.newClient();
diff --git a/tests/integration/j-441/ear/pom.xml b/tests/integration/j-441/ear/pom.xml
index 2c5241c..eb3e09a 100644
--- a/tests/integration/j-441/ear/pom.xml
+++ b/tests/integration/j-441/ear/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>j-441-ear</artifactId>
diff --git a/tests/integration/j-441/pom.xml b/tests/integration/j-441/pom.xml
index 250a395..c357b81 100644
--- a/tests/integration/j-441/pom.xml
+++ b/tests/integration/j-441/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>j-441</artifactId>
diff --git a/tests/integration/j-441/war1/pom.xml b/tests/integration/j-441/war1/pom.xml
index d5e0856..dc1ce4c 100644
--- a/tests/integration/j-441/war1/pom.xml
+++ b/tests/integration/j-441/war1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/CdiResource.java b/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/CdiResource.java
index 33ce8da..9f31ab4 100644
--- a/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/CdiResource.java
+++ b/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/CdiResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* CDI backed JAX-RS resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/test")
@RequestScoped
diff --git a/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/CustomExceptionMapper.java b/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/CustomExceptionMapper.java
index d5aa71c..b3832a2 100644
--- a/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/CustomExceptionMapper.java
+++ b/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/CustomExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
* at Jersey bootstrapping phase, we would get a deploy
* error if something went wrong.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CustomExceptionMapper implements ExceptionMapper<Exception> {
diff --git a/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/MyApplication.java b/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/MyApplication.java
index 073b84c..cb0cbab 100644
--- a/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/MyApplication.java
+++ b/tests/integration/j-441/war1/src/main/java/org/glassfish/jersey/tests/integration/j441/one/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
* Test case to ensure proper WAR isolation on Jersey level.
* Define JAX-RS application containing a simple CDI backed JAX-RS resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/")
public class MyApplication extends ResourceConfig {
diff --git a/tests/integration/j-441/war2/pom.xml b/tests/integration/j-441/war2/pom.xml
index a24e60b..bc6c4c9 100644
--- a/tests/integration/j-441/war2/pom.xml
+++ b/tests/integration/j-441/war2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/CdiResource.java b/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/CdiResource.java
index 0629273..ae673c0 100644
--- a/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/CdiResource.java
+++ b/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/CdiResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* CDI backed JAX-RS resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/test")
@RequestScoped
diff --git a/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/CustomExceptionMapper.java b/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/CustomExceptionMapper.java
index 0544100..dfe7cd3 100644
--- a/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/CustomExceptionMapper.java
+++ b/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/CustomExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
* at Jersey bootstrapping phase, we would get a deploy
* error if something went wrong.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class CustomExceptionMapper implements ExceptionMapper<Exception> {
diff --git a/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/MyApplication.java b/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/MyApplication.java
index df6d3e3..9157532 100644
--- a/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/MyApplication.java
+++ b/tests/integration/j-441/war2/src/main/java/org/glassfish/jersey/tests/integration/j441/two/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
* Test case to ensure proper WAR isolation on Jersey level.
* Define JAX-RS application containing a simple CDI backed JAX-RS resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/")
public class MyApplication extends ResourceConfig {
diff --git a/tests/integration/j-59/ear/pom.xml b/tests/integration/j-59/ear/pom.xml
index f3f39e3..ae537c5 100644
--- a/tests/integration/j-59/ear/pom.xml
+++ b/tests/integration/j-59/ear/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/j-59/lib/pom.xml b/tests/integration/j-59/lib/pom.xml
index 34afee2..e5f3755 100644
--- a/tests/integration/j-59/lib/pom.xml
+++ b/tests/integration/j-59/lib/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/tests/integration/j-59/lib/src/main/java/org/glassfish/jersey/tests/integration/j59/ejb/lib/LocalBeanWithRemoteInterface.java b/tests/integration/j-59/lib/src/main/java/org/glassfish/jersey/tests/integration/j59/ejb/lib/LocalBeanWithRemoteInterface.java
index 086976a..81e7883 100644
--- a/tests/integration/j-59/lib/src/main/java/org/glassfish/jersey/tests/integration/j59/ejb/lib/LocalBeanWithRemoteInterface.java
+++ b/tests/integration/j-59/lib/src/main/java/org/glassfish/jersey/tests/integration/j59/ejb/lib/LocalBeanWithRemoteInterface.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
* Local stateless session bean implementing a remote interface.
* Part of CDI extension lookup issue reproducer.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
@LocalBean
diff --git a/tests/integration/j-59/lib/src/main/java/org/glassfish/jersey/tests/integration/j59/ejb/lib/MyRemoteInterface.java b/tests/integration/j-59/lib/src/main/java/org/glassfish/jersey/tests/integration/j59/ejb/lib/MyRemoteInterface.java
index ff53484..7fe870d 100644
--- a/tests/integration/j-59/lib/src/main/java/org/glassfish/jersey/tests/integration/j59/ejb/lib/MyRemoteInterface.java
+++ b/tests/integration/j-59/lib/src/main/java/org/glassfish/jersey/tests/integration/j59/ejb/lib/MyRemoteInterface.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Marker interface for remote beans. Part of CDI extension lookup issue reproducer.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface MyRemoteInterface {
}
diff --git a/tests/integration/j-59/pom.xml b/tests/integration/j-59/pom.xml
index 0d0898b..52332f3 100644
--- a/tests/integration/j-59/pom.xml
+++ b/tests/integration/j-59/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>j-59</artifactId>
diff --git a/tests/integration/j-59/war/pom.xml b/tests/integration/j-59/war/pom.xml
index 286c853..81cb607 100644
--- a/tests/integration/j-59/war/pom.xml
+++ b/tests/integration/j-59/war/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2014, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -96,6 +96,22 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.jws</groupId>
+ <artifactId>jakarta.jws-api</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
<skipTests>true</skipTests>
diff --git a/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/CdiBackedResource.java b/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/CdiBackedResource.java
index f3483dd..1e7a067 100644
--- a/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/CdiBackedResource.java
+++ b/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/CdiBackedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -32,7 +32,7 @@
* Part of CDI extension lookup issue reproducer.
* This bean will CDI-inject a local EJB bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("name")
@RequestScoped
diff --git a/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/JaxRsConfiguration.java b/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/JaxRsConfiguration.java
index 976125a..cf57aa0 100644
--- a/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/JaxRsConfiguration.java
+++ b/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/JaxRsConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* CDI extension lookup issue reproducer application configuration.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("resources")
public class JaxRsConfiguration extends Application {
diff --git a/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/ResourceMarkerInterface.java b/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/ResourceMarkerInterface.java
index f1548c6..e694565 100644
--- a/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/ResourceMarkerInterface.java
+++ b/tests/integration/j-59/war/src/main/java/org/glassfish/jersey/tests/integration/j59/cdi/web/ResourceMarkerInterface.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Marker interface for CDI backed JAX-RS bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public interface ResourceMarkerInterface {
}
diff --git a/tests/integration/j-59/war/src/test/java/org/glassfish/jersey/tests/integration/j59/cdi/web/NameBeanTest.java b/tests/integration/j-59/war/src/test/java/org/glassfish/jersey/tests/integration/j59/cdi/web/NameBeanTest.java
index 26870a9..8335282 100644
--- a/tests/integration/j-59/war/src/test/java/org/glassfish/jersey/tests/integration/j59/cdi/web/NameBeanTest.java
+++ b/tests/integration/j-59/war/src/test/java/org/glassfish/jersey/tests/integration/j59/cdi/web/NameBeanTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -40,7 +40,7 @@
* $AS_HOME/bin/asadmin deploy ../ejb-jax-rs-ear1/target/ejb-jax-rs-ear1
* mvn -DskipTests=false test</pre>
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class NameBeanTest extends JerseyTest {
diff --git a/tests/integration/jaxrs-component-inject/pom.xml b/tests/integration/jaxrs-component-inject/pom.xml
index bc86c65..f09a65d 100644
--- a/tests/integration/jaxrs-component-inject/pom.xml
+++ b/tests/integration/jaxrs-component-inject/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jaxrs-component-inject</artifactId>
diff --git a/tests/integration/jersey-1107/pom.xml b/tests/integration/jersey-1107/pom.xml
index 7596855..cb12268 100644
--- a/tests/integration/jersey-1107/pom.xml
+++ b/tests/integration/jersey-1107/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-1107</artifactId>
diff --git a/tests/integration/jersey-1223/pom.xml b/tests/integration/jersey-1223/pom.xml
index 6a77570..5521a9a 100644
--- a/tests/integration/jersey-1223/pom.xml
+++ b/tests/integration/jersey-1223/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.tests.integration</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jersey-1223</artifactId>
diff --git a/tests/integration/jersey-1604/pom.xml b/tests/integration/jersey-1604/pom.xml
index 4923530..4c58fb1 100644
--- a/tests/integration/jersey-1604/pom.xml
+++ b/tests/integration/jersey-1604/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.tests.integration</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jersey-1604</artifactId>
diff --git a/tests/integration/jersey-1667/pom.xml b/tests/integration/jersey-1667/pom.xml
index b83e829..af23598 100644
--- a/tests/integration/jersey-1667/pom.xml
+++ b/tests/integration/jersey-1667/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-1667</artifactId>
diff --git a/tests/integration/jersey-1829/pom.xml b/tests/integration/jersey-1829/pom.xml
index a6c7fd0..aa6ff93 100644
--- a/tests/integration/jersey-1829/pom.xml
+++ b/tests/integration/jersey-1829/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.tests.integration</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jersey-1829</artifactId>
diff --git a/tests/integration/jersey-1883/pom.xml b/tests/integration/jersey-1883/pom.xml
index d866f6b..f90500b 100644
--- a/tests/integration/jersey-1883/pom.xml
+++ b/tests/integration/jersey-1883/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-1883</artifactId>
diff --git a/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/Life.java b/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/Life.java
index 37effa2..c283df7 100644
--- a/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/Life.java
+++ b/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/Life.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* JAX-RS application mixed with resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath("/rest3")
@Path("/life")
diff --git a/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/MyApplication.java b/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/MyApplication.java
index 764a7b6..34dec5f 100644
--- a/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/MyApplication.java
+++ b/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/MyApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
/**
* Explicitly register {@code @Singleton} resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath("/rest1")
public class MyApplication extends Application {
diff --git a/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/NoLife.java b/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/NoLife.java
index 9a82223..7fc0bc4 100644
--- a/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/NoLife.java
+++ b/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/NoLife.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
/**
* Explicitly registered singleton resource by {@link MyApplication}.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Singleton
@Path("/no-life")
diff --git a/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/SingletonLife.java b/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/SingletonLife.java
index 26ae80b..a5821b1 100644
--- a/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/SingletonLife.java
+++ b/tests/integration/jersey-1883/src/main/java/org/glassfish/jersey/tests/integration/jersey1883/SingletonLife.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* JAX-RS application mixed with resource - singleton class.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Singleton
@ApplicationPath("/rest2")
diff --git a/tests/integration/jersey-1883/src/test/java/org/glassfish/jersey/tests/integration/jersey1883/Jersey1883ITCase.java b/tests/integration/jersey-1883/src/test/java/org/glassfish/jersey/tests/integration/jersey1883/Jersey1883ITCase.java
index b2fb307..703543d 100644
--- a/tests/integration/jersey-1883/src/test/java/org/glassfish/jersey/tests/integration/jersey1883/Jersey1883ITCase.java
+++ b/tests/integration/jersey-1883/src/test/java/org/glassfish/jersey/tests/integration/jersey1883/Jersey1883ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -33,7 +33,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Jersey1883ITCase extends JerseyTest {
diff --git a/tests/integration/jersey-1928/pom.xml b/tests/integration/jersey-1928/pom.xml
index 2a362d9..a78610d 100644
--- a/tests/integration/jersey-1928/pom.xml
+++ b/tests/integration/jersey-1928/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.tests.integration</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jersey-1928</artifactId>
diff --git a/tests/integration/jersey-1960/pom.xml b/tests/integration/jersey-1960/pom.xml
index d72905b..b0ddc07 100644
--- a/tests/integration/jersey-1960/pom.xml
+++ b/tests/integration/jersey-1960/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-1960</artifactId>
diff --git a/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/EchoResource.java b/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/EchoResource.java
index ca3b1a9..13cf6e9 100644
--- a/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/EchoResource.java
+++ b/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/EchoResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* Test resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("echo")
public class EchoResource {
diff --git a/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/Jersey1960App.java b/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/Jersey1960App.java
index 8a87f0b..b075db7 100644
--- a/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/Jersey1960App.java
+++ b/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/Jersey1960App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
/**
* JAX-RS application for the JERSEY-1960 reproducer test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ApplicationPath("application_path")
public class Jersey1960App extends Application {
diff --git a/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/RequestFilter.java b/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/RequestFilter.java
index fde6d21..ecd167d 100644
--- a/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/RequestFilter.java
+++ b/tests/integration/jersey-1960/src/main/java/org/glassfish/jersey/tests/integration/jersey1960/RequestFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -35,7 +35,7 @@
/**
* Filter testing injection support for of servlet artifacts.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@PreMatching
public class RequestFilter implements ContainerRequestFilter {
diff --git a/tests/integration/jersey-1960/src/test/java/org/glassfish/jersey/tests/integration/jersey1960/Jersey1960ITCase.java b/tests/integration/jersey-1960/src/test/java/org/glassfish/jersey/tests/integration/jersey1960/Jersey1960ITCase.java
index da03ead..d4317ac 100644
--- a/tests/integration/jersey-1960/src/test/java/org/glassfish/jersey/tests/integration/jersey1960/Jersey1960ITCase.java
+++ b/tests/integration/jersey-1960/src/test/java/org/glassfish/jersey/tests/integration/jersey1960/Jersey1960ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Reproducer tests for JERSEY-1960.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class Jersey1960ITCase extends JerseyTest {
diff --git a/tests/integration/jersey-1964/pom.xml b/tests/integration/jersey-1964/pom.xml
index 5c763d2..051d186 100644
--- a/tests/integration/jersey-1964/pom.xml
+++ b/tests/integration/jersey-1964/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-1964</artifactId>
diff --git a/tests/integration/jersey-2031/pom.xml b/tests/integration/jersey-2031/pom.xml
index 2715175..930c12f 100644
--- a/tests/integration/jersey-2031/pom.xml
+++ b/tests/integration/jersey-2031/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2031</artifactId>
@@ -66,7 +66,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
- <groupId>org.mortbay.jetty</groupId>
+ <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
</plugin>
</plugins>
diff --git a/tests/integration/jersey-2031/src/main/webapp/WEB-INF/web.xml b/tests/integration/jersey-2031/src/main/webapp/WEB-INF/web.xml
index 18fc4e3..0974cee 100644
--- a/tests/integration/jersey-2031/src/main/webapp/WEB-INF/web.xml
+++ b/tests/integration/jersey-2031/src/main/webapp/WEB-INF/web.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2013, 2019 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
@@ -31,4 +31,12 @@
<filter-name>jersey2031</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <jsp-config>
+ <taglib>
+ <taglib-uri>urn:org:glassfish:jersey:servlet:mvc</taglib-uri>
+ <taglib-location>
+ /WEB-INF/lib/jersey-mvc-jsp-2.29-SNAPSHOT.jar
+ </taglib-location>
+ </taglib>
+ </jsp-config>
</web-app>
diff --git a/tests/integration/jersey-2136/pom.xml b/tests/integration/jersey-2136/pom.xml
index df7d91f..87b7555 100644
--- a/tests/integration/jersey-2136/pom.xml
+++ b/tests/integration/jersey-2136/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2136</artifactId>
diff --git a/tests/integration/jersey-2137/pom.xml b/tests/integration/jersey-2137/pom.xml
index 148d8b8..14a16de 100644
--- a/tests/integration/jersey-2137/pom.xml
+++ b/tests/integration/jersey-2137/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2137</artifactId>
diff --git a/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/Account.java b/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/Account.java
index 1c414b7..2e68823 100644
--- a/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/Account.java
+++ b/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/Account.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -27,7 +27,7 @@
* Entity beans have implicit JTA support, so this will
* save us some lines of code.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Entity
public class Account implements Serializable {
diff --git a/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/CdiTransactionalNoRollbackResource.java b/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/CdiTransactionalNoRollbackResource.java
index 3ce59b1..5bd8eef 100644
--- a/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/CdiTransactionalNoRollbackResource.java
+++ b/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/CdiTransactionalNoRollbackResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* in the JAX-RS spec regardless
* on the {@link javax.transaction.Transactional#dontRollbackOn()} value.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Transactional(dontRollbackOn = WebApplicationException.class)
diff --git a/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/CdiTransactionalResource.java b/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/CdiTransactionalResource.java
index 0132a91..66dc5b0 100644
--- a/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/CdiTransactionalResource.java
+++ b/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/CdiTransactionalResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -36,7 +36,7 @@
* thrown in the resource method below should drive the response as specified
* in the JAX-RS spec.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Transactional
diff --git a/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/TestApplication.java b/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/TestApplication.java
index 8e3f6d0..48e3a8e 100644
--- a/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/TestApplication.java
+++ b/tests/integration/jersey-2137/src/main/java/org/glassfish/jersey/tests/integration/jersey2137/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS application to configure resources for JERSEY-2137 reproducer.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/*")
public class TestApplication extends Application {
diff --git a/tests/integration/jersey-2137/src/test/java/org/glassfish/jersey/tests/integration/jersey2137/WaeExceptionMappingTest.java b/tests/integration/jersey-2137/src/test/java/org/glassfish/jersey/tests/integration/jersey2137/WaeExceptionMappingTest.java
index c722b92..3759b0f 100644
--- a/tests/integration/jersey-2137/src/test/java/org/glassfish/jersey/tests/integration/jersey2137/WaeExceptionMappingTest.java
+++ b/tests/integration/jersey-2137/src/test/java/org/glassfish/jersey/tests/integration/jersey2137/WaeExceptionMappingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -36,7 +36,7 @@
* Ensure that generated {@link WebApplicationException} is propagated
* via transactional CDI call and mapped to response according to JAX-RS spec.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class WaeExceptionMappingTest extends JerseyTest {
diff --git a/tests/integration/jersey-2154/pom.xml b/tests/integration/jersey-2154/pom.xml
index 22d8391..be86524 100644
--- a/tests/integration/jersey-2154/pom.xml
+++ b/tests/integration/jersey-2154/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2154</artifactId>
diff --git a/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/CdiResource.java b/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/CdiResource.java
index 8539fc7..7368bd4 100644
--- a/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/CdiResource.java
+++ b/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/CdiResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
* thrown in the injected EJB bean should get unwrapped
* even when no EJB-backed JAX-RS resources have been registered.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RequestScoped
@Path("cdi")
diff --git a/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/EjbBean.java b/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/EjbBean.java
index bd19227..3522a34 100644
--- a/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/EjbBean.java
+++ b/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/EjbBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
* should get mapped to response even when wrapped into an {@link EJBException}
* by the underlying EJB container.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Stateless
public class EjbBean {
diff --git a/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/TestApplication.java b/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/TestApplication.java
index a794af9..7e5bb35 100644
--- a/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/TestApplication.java
+++ b/tests/integration/jersey-2154/src/main/java/org/glassfish/jersey/tests/integration/jersey2154/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
/**
* JAX-RS application to configure resources for JERSEY-2154 reproducer.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("/*")
public class TestApplication extends Application {
diff --git a/tests/integration/jersey-2154/src/test/java/org/glassfish/jersey/tests/integration/jersey2154/EjbExceptionMappingTest.java b/tests/integration/jersey-2154/src/test/java/org/glassfish/jersey/tests/integration/jersey2154/EjbExceptionMappingTest.java
index 564fc14..2c81076 100644
--- a/tests/integration/jersey-2154/src/test/java/org/glassfish/jersey/tests/integration/jersey2154/EjbExceptionMappingTest.java
+++ b/tests/integration/jersey-2154/src/test/java/org/glassfish/jersey/tests/integration/jersey2154/EjbExceptionMappingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -37,7 +37,7 @@
* Test generated {@link WebApplicationException} is propagated
* via CDI call and mapped to 200 response, even when wrapped with an {@link EJBException}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class EjbExceptionMappingTest extends JerseyTest {
diff --git a/tests/integration/jersey-2160/pom.xml b/tests/integration/jersey-2160/pom.xml
index eb00612..9d7f007 100644
--- a/tests/integration/jersey-2160/pom.xml
+++ b/tests/integration/jersey-2160/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2160</artifactId>
diff --git a/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/Issue2160ReproducerResource.java b/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/Issue2160ReproducerResource.java
index 2097ef2..49ae234 100644
--- a/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/Issue2160ReproducerResource.java
+++ b/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/Issue2160ReproducerResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("servletInjectees")
public class Issue2160ReproducerResource {
diff --git a/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/Jersey2160App.java b/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/Jersey2160App.java
index 29f21c6..e1bd118 100644
--- a/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/Jersey2160App.java
+++ b/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/Jersey2160App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
/**
* JAX-RS application for the JERSEY-1960 reproducer test.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Jersey2160App extends Application {
diff --git a/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/RequestFilter.java b/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/RequestFilter.java
index 8a44f0c..b1bfac0 100644
--- a/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/RequestFilter.java
+++ b/tests/integration/jersey-2160/src/main/java/org/glassfish/jersey/tests/integration/jersey2160/RequestFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
* is expected to be propagated to the resource method via injected
* {@link HttpServletRequest} parameter.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@PreMatching
public class RequestFilter implements ContainerRequestFilter {
diff --git a/tests/integration/jersey-2160/src/test/java/org/glassfish/jersey/tests/integration/jersey2160/Jersey2160ITCase.java b/tests/integration/jersey-2160/src/test/java/org/glassfish/jersey/tests/integration/jersey2160/Jersey2160ITCase.java
index dd7f0b5..788a76b 100644
--- a/tests/integration/jersey-2160/src/test/java/org/glassfish/jersey/tests/integration/jersey2160/Jersey2160ITCase.java
+++ b/tests/integration/jersey-2160/src/test/java/org/glassfish/jersey/tests/integration/jersey2160/Jersey2160ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Reproducer tests for JERSEY-2160.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Jersey2160ITCase extends JerseyTest {
diff --git a/tests/integration/jersey-2164/pom.xml b/tests/integration/jersey-2164/pom.xml
index 925c3c3..16185cb 100644
--- a/tests/integration/jersey-2164/pom.xml
+++ b/tests/integration/jersey-2164/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2164</artifactId>
diff --git a/tests/integration/jersey-2167/pom.xml b/tests/integration/jersey-2167/pom.xml
index ef73a04..a3f649e 100644
--- a/tests/integration/jersey-2167/pom.xml
+++ b/tests/integration/jersey-2167/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2167</artifactId>
diff --git a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/Issue2167Resource.java b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/Issue2167Resource.java
index 48ccef8..cb15851 100644
--- a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/Issue2167Resource.java
+++ b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/Issue2167Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* Test resource for JERSEY-2167 reproducer.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("/MyResource")
diff --git a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/Jersey2167App.java b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/Jersey2167App.java
index 1adc3cc..9615a1c 100644
--- a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/Jersey2167App.java
+++ b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/Jersey2167App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
/**
* JAX-RS application for the JERSEY-2167 reproducer test.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class Jersey2167App extends ResourceConfig {
diff --git a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyAnnotation.java b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyAnnotation.java
index edec66e..e6cb154 100644
--- a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyAnnotation.java
+++ b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyAnnotation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Custom annotation for JERSEY-2167 reproducer test.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Target(ElementType.PARAMETER)
diff --git a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyBinder.java b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyBinder.java
index b6de2c8..d1c9d95 100644
--- a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyBinder.java
+++ b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyBinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Custom annotation binder for JERSEY-2167 reproducer.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class MyBinder extends AbstractBinder {
diff --git a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java
index 5eae5ae..852bec3 100644
--- a/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java
+++ b/tests/integration/jersey-2167/src/main/java/org/glassfish/jersey/tests/integration/jersey2167/MyValueParamProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -30,7 +30,7 @@
/**
* Custom annotation value supplier provider for JERSEY-2167 reproducer.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Singleton
public class MyValueParamProvider extends AbstractValueParamProvider {
diff --git a/tests/integration/jersey-2167/src/test/java/org/glassfish/jersey/tests/integration/jersey2167/Jersey2167ITCase.java b/tests/integration/jersey-2167/src/test/java/org/glassfish/jersey/tests/integration/jersey2167/Jersey2167ITCase.java
index cff58c6..b090745 100644
--- a/tests/integration/jersey-2167/src/test/java/org/glassfish/jersey/tests/integration/jersey2167/Jersey2167ITCase.java
+++ b/tests/integration/jersey-2167/src/test/java/org/glassfish/jersey/tests/integration/jersey2167/Jersey2167ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
/**
* Reproducer tests for JERSEY-2167.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class Jersey2167ITCase extends JerseyTest {
diff --git a/tests/integration/jersey-2176/pom.xml b/tests/integration/jersey-2176/pom.xml
index 28e85b4..7cd48c3 100644
--- a/tests/integration/jersey-2176/pom.xml
+++ b/tests/integration/jersey-2176/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2176</artifactId>
diff --git a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Issue2176ReproducerResource.java b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Issue2176ReproducerResource.java
index 6b0d093..0728fda 100644
--- a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Issue2176ReproducerResource.java
+++ b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Issue2176ReproducerResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Test resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("/resource")
public class Issue2176ReproducerResource {
diff --git a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176App.java b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176App.java
index e28cfc2..4bc3f0c 100644
--- a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176App.java
+++ b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
/**
* JAX-RS application for the JERSEY-2176 reproducer test.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
abstract class Jersey2176App extends ResourceConfig {
diff --git a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SendErrorApp.java b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SendErrorApp.java
index dcdcaed..905cd03 100644
--- a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SendErrorApp.java
+++ b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SendErrorApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
* method {@link javax.servlet.http.HttpServletResponse#sendError} will be called in case of errors
* (status {@code 4xx} or {@code 5xx}).
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath(Jersey2176SendErrorApp.APP_PATH)
public class Jersey2176SendErrorApp extends Jersey2176App {
diff --git a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SetStatusApp.java b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SetStatusApp.java
index 501df02..82c42c2 100644
--- a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SetStatusApp.java
+++ b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SetStatusApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
* method {@link javax.servlet.http.HttpServletResponse#setStatus} will be called in case of errors
* (status {@code 4xx} or {@code 5xx}).
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath(Jersey2176SetStatusApp.APP_PATH)
public class Jersey2176SetStatusApp extends Jersey2176App {
diff --git a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/MyException.java b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/MyException.java
index e7daf21..52ebba9 100644
--- a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/MyException.java
+++ b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/MyException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.tests.integration.jersey2176;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class MyException extends Exception {
diff --git a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/MyWriterInterceptor.java b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/MyWriterInterceptor.java
index f4a4fcd..6eb257d 100644
--- a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/MyWriterInterceptor.java
+++ b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/MyWriterInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* This just set new context output stream and test a clone method on set output stream instance is called.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class MyWriterInterceptor implements WriterInterceptor {
diff --git a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/TraceResponseFilter.java b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/TraceResponseFilter.java
index c20ecf3..abd8b07 100644
--- a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/TraceResponseFilter.java
+++ b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/TraceResponseFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
import javax.servlet.http.HttpServletResponse;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class TraceResponseFilter implements Filter {
diff --git a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/TraceResponseWrapper.java b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/TraceResponseWrapper.java
index 3e2f672..6a7b84f 100644
--- a/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/TraceResponseWrapper.java
+++ b/tests/integration/jersey-2176/src/main/java/org/glassfish/jersey/tests/integration/jersey2176/TraceResponseWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
import java.io.PrintWriter;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class TraceResponseWrapper extends HttpServletResponseWrapper {
private final ByteArrayOutputStream localStream;
diff --git a/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176ITCaseBase.java b/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176ITCaseBase.java
index ffeec36..4210502 100644
--- a/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176ITCaseBase.java
+++ b/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176ITCaseBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -31,7 +31,7 @@
/**
* Reproducer tests for JERSEY-2176.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public abstract class Jersey2176ITCaseBase extends JerseyTest {
diff --git a/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SendErrorITCase.java b/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SendErrorITCase.java
index 9eb2648..51da398 100644
--- a/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SendErrorITCase.java
+++ b/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SendErrorITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
/**
* Reproducer tests for JERSEY-2176.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Jersey2176SendErrorITCase extends Jersey2176ITCaseBase {
diff --git a/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SetStatusITCase.java b/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SetStatusITCase.java
index f894ee0..90fbf4d 100644
--- a/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SetStatusITCase.java
+++ b/tests/integration/jersey-2176/src/test/java/org/glassfish/jersey/tests/integration/jersey2176/Jersey2176SetStatusITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
/**
* Reproducer tests for JERSEY-2176.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Jersey2176SetStatusITCase extends Jersey2176ITCaseBase {
diff --git a/tests/integration/jersey-2184/pom.xml b/tests/integration/jersey-2184/pom.xml
index 798e39b..424fc79 100644
--- a/tests/integration/jersey-2184/pom.xml
+++ b/tests/integration/jersey-2184/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2184</artifactId>
diff --git a/tests/integration/jersey-2184/src/main/java/org/glassfish/jersey/tests/integration/jersey2184/App.java b/tests/integration/jersey-2184/src/main/java/org/glassfish/jersey/tests/integration/jersey2184/App.java
index 04a279f..bcd6c5d 100644
--- a/tests/integration/jersey-2184/src/main/java/org/glassfish/jersey/tests/integration/jersey2184/App.java
+++ b/tests/integration/jersey-2184/src/main/java/org/glassfish/jersey/tests/integration/jersey2184/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
* Test Application subclass for JERSEY-2184 integration test.
*
* Tests the ability to inject {@link ServletContext} into application subclass constructor
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class App extends Application {
diff --git a/tests/integration/jersey-2184/src/main/java/org/glassfish/jersey/tests/integration/jersey2184/MonkeyResource.java b/tests/integration/jersey-2184/src/main/java/org/glassfish/jersey/tests/integration/jersey2184/MonkeyResource.java
index bd9356b..33d34b6 100644
--- a/tests/integration/jersey-2184/src/main/java/org/glassfish/jersey/tests/integration/jersey2184/MonkeyResource.java
+++ b/tests/integration/jersey-2184/src/main/java/org/glassfish/jersey/tests/integration/jersey2184/MonkeyResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
/**
* Test resource for the servlet3-webapp example.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("monkey")
public class MonkeyResource {
diff --git a/tests/integration/jersey-2184/src/test/java/org/glassfish/jersey/tests/integration/jersey2184/Jersey2184ITCase.java b/tests/integration/jersey-2184/src/test/java/org/glassfish/jersey/tests/integration/jersey2184/Jersey2184ITCase.java
index 794203d..8aa9544 100644
--- a/tests/integration/jersey-2184/src/test/java/org/glassfish/jersey/tests/integration/jersey2184/Jersey2184ITCase.java
+++ b/tests/integration/jersey-2184/src/test/java/org/glassfish/jersey/tests/integration/jersey2184/Jersey2184ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -36,7 +36,7 @@
/**
* Tests the JERSEY-2184 fix (the ability to inject ServletContext into application subclass constructor).
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class Jersey2184ITCase extends JerseyTest {
diff --git a/tests/integration/jersey-2255/pom.xml b/tests/integration/jersey-2255/pom.xml
index 305ebe2..1e61597 100644
--- a/tests/integration/jersey-2255/pom.xml
+++ b/tests/integration/jersey-2255/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2255</artifactId>
diff --git a/tests/integration/jersey-2322/pom.xml b/tests/integration/jersey-2322/pom.xml
index d20e4cd..b5bfa69 100644
--- a/tests/integration/jersey-2322/pom.xml
+++ b/tests/integration/jersey-2322/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2322</artifactId>
diff --git a/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/Issue2322Resource.java b/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/Issue2322Resource.java
index 7e8b05f..c006a22 100644
--- a/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/Issue2322Resource.java
+++ b/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/Issue2322Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* Test resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("/")
@Consumes("application/json")
diff --git a/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/Jersey2322.java b/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/Jersey2322.java
index 1e79c1e..858a927 100644
--- a/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/Jersey2322.java
+++ b/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/Jersey2322.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
/**
* JAX-RS application for the JERSEY-2322 reproducer test.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Jersey2322 extends ResourceConfig {
diff --git a/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/MyObjectMapperProvider.java b/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/MyObjectMapperProvider.java
index 61fe632..71f89e8 100644
--- a/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/MyObjectMapperProvider.java
+++ b/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/MyObjectMapperProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
public class MyObjectMapperProvider implements ContextResolver<ObjectMapper> {
diff --git a/tests/integration/jersey-2322/src/test/java/org/glassfish/jersey/tests/integration/jersey2322/Jersey2322ITCase.java b/tests/integration/jersey-2322/src/test/java/org/glassfish/jersey/tests/integration/jersey2322/Jersey2322ITCase.java
index 4f973a9..f3700cf 100644
--- a/tests/integration/jersey-2322/src/test/java/org/glassfish/jersey/tests/integration/jersey2322/Jersey2322ITCase.java
+++ b/tests/integration/jersey-2322/src/test/java/org/glassfish/jersey/tests/integration/jersey2322/Jersey2322ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* Reproducer tests for JERSEY-2322.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Jersey2322ITCase extends JerseyTest {
diff --git a/tests/integration/jersey-2335/pom.xml b/tests/integration/jersey-2335/pom.xml
index 9704ab9..41dc16a 100644
--- a/tests/integration/jersey-2335/pom.xml
+++ b/tests/integration/jersey-2335/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2335</artifactId>
diff --git a/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/ConstructorInjectedProvider.java b/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/ConstructorInjectedProvider.java
index 7f59d01..5dbc195 100644
--- a/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/ConstructorInjectedProvider.java
+++ b/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/ConstructorInjectedProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -36,7 +36,7 @@
* Constructor injected provider to prove that provider registered via meta-inf/services
* mechanism gets constructed via HK2 and so the constructor parameters are properly injected.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
@Produces("text/ctor-injected")
diff --git a/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/FieldInjectedProvider.java b/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/FieldInjectedProvider.java
index 5c6bc08..425c822 100644
--- a/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/FieldInjectedProvider.java
+++ b/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/FieldInjectedProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -36,7 +36,7 @@
* Field injected provider to prove that provider registered via meta-inf/services
* mechanism gets injected via HK2.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
@Produces("text/field-injected")
diff --git a/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/Issue2335Resource.java b/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/Issue2335Resource.java
index c4a44f6..1af12ad 100644
--- a/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/Issue2335Resource.java
+++ b/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/Issue2335Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
* The response text then gets serialized using message body writer
* specified by media type.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/text")
public class Issue2335Resource {
diff --git a/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/Jersey2335.java b/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/Jersey2335.java
index 10ff7e2..4ab91b8 100644
--- a/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/Jersey2335.java
+++ b/tests/integration/jersey-2335/src/main/java/org/glassfish/jersey/tests/integration/jersey2335/Jersey2335.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
/**
* JAX-RS application for the JERSEY-2335 reproducer test.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Jersey2335 extends ResourceConfig {
diff --git a/tests/integration/jersey-2335/src/test/java/org/glassfish/jersey/tests/integration/jersey2335/Jersey2335ITCase.java b/tests/integration/jersey-2335/src/test/java/org/glassfish/jersey/tests/integration/jersey2335/Jersey2335ITCase.java
index dfa5732..6face63 100644
--- a/tests/integration/jersey-2335/src/test/java/org/glassfish/jersey/tests/integration/jersey2335/Jersey2335ITCase.java
+++ b/tests/integration/jersey-2335/src/test/java/org/glassfish/jersey/tests/integration/jersey2335/Jersey2335ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -37,7 +37,7 @@
/**
* Reproducer tests for JERSEY-2335.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Jersey2335ITCase extends JerseyTest {
diff --git a/tests/integration/jersey-2421/pom.xml b/tests/integration/jersey-2421/pom.xml
index 64b56cf..e662802 100644
--- a/tests/integration/jersey-2421/pom.xml
+++ b/tests/integration/jersey-2421/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2421</artifactId>
diff --git a/tests/integration/jersey-2551/pom.xml b/tests/integration/jersey-2551/pom.xml
index 8cd50c6..a385c4e 100644
--- a/tests/integration/jersey-2551/pom.xml
+++ b/tests/integration/jersey-2551/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2551</artifactId>
diff --git a/tests/integration/jersey-2612/pom.xml b/tests/integration/jersey-2612/pom.xml
index c80f2b7..bc687ad 100644
--- a/tests/integration/jersey-2612/pom.xml
+++ b/tests/integration/jersey-2612/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2612</artifactId>
diff --git a/tests/integration/jersey-2637/pom.xml b/tests/integration/jersey-2637/pom.xml
index 004de41..08525c3 100644
--- a/tests/integration/jersey-2637/pom.xml
+++ b/tests/integration/jersey-2637/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2637</artifactId>
diff --git a/tests/integration/jersey-2654/pom.xml b/tests/integration/jersey-2654/pom.xml
index a6e4affa..ad2c90b 100644
--- a/tests/integration/jersey-2654/pom.xml
+++ b/tests/integration/jersey-2654/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2654</artifactId>
diff --git a/tests/integration/jersey-2654/src/main/java/org/glassfish/jersey/tests/integration/jersey2654/ServletFilterTestResource.java b/tests/integration/jersey-2654/src/main/java/org/glassfish/jersey/tests/integration/jersey2654/ServletFilterTestResource.java
index bfc062b..3c367e4 100644
--- a/tests/integration/jersey-2654/src/main/java/org/glassfish/jersey/tests/integration/jersey2654/ServletFilterTestResource.java
+++ b/tests/integration/jersey-2654/src/main/java/org/glassfish/jersey/tests/integration/jersey2654/ServletFilterTestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -26,7 +26,7 @@
/**
* Test resource to be called within an ServletContainer registered as servlet filter.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("filter")
public class ServletFilterTestResource {
diff --git a/tests/integration/jersey-2654/src/main/java/org/glassfish/jersey/tests/integration/jersey2654/TestApplication.java b/tests/integration/jersey-2654/src/main/java/org/glassfish/jersey/tests/integration/jersey2654/TestApplication.java
index 099008f..57bcad9 100644
--- a/tests/integration/jersey-2654/src/main/java/org/glassfish/jersey/tests/integration/jersey2654/TestApplication.java
+++ b/tests/integration/jersey-2654/src/main/java/org/glassfish/jersey/tests/integration/jersey2654/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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,7 +24,7 @@
/**
* JAX-RS application to configure resources for JERSEY-2525 reproducer.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class TestApplication extends Application {
@Override
diff --git a/tests/integration/jersey-2654/src/test/java/org/glassfish/jersey/tests/integration/jersey2654/Jersey2654ITCase.java b/tests/integration/jersey-2654/src/test/java/org/glassfish/jersey/tests/integration/jersey2654/Jersey2654ITCase.java
index 0589b64..c6793b6 100644
--- a/tests/integration/jersey-2654/src/test/java/org/glassfish/jersey/tests/integration/jersey2654/Jersey2654ITCase.java
+++ b/tests/integration/jersey-2654/src/test/java/org/glassfish/jersey/tests/integration/jersey2654/Jersey2654ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -41,7 +41,7 @@
* Tests, that unencoded curly brackets (typically used in URI queries containing JSON) do not cause the request to
* fail when running in a servlet environment and configured as a filter.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class Jersey2654ITCase extends JerseyTest {
diff --git a/tests/integration/jersey-2673/pom.xml b/tests/integration/jersey-2673/pom.xml
index 3f114f9..3120aca 100644
--- a/tests/integration/jersey-2673/pom.xml
+++ b/tests/integration/jersey-2673/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2673</artifactId>
diff --git a/tests/integration/jersey-2689/pom.xml b/tests/integration/jersey-2689/pom.xml
index 0fc4d60..47cd06c 100644
--- a/tests/integration/jersey-2689/pom.xml
+++ b/tests/integration/jersey-2689/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2689</artifactId>
diff --git a/tests/integration/jersey-2704/pom.xml b/tests/integration/jersey-2704/pom.xml
index 4ee7d7d..13c698f 100644
--- a/tests/integration/jersey-2704/pom.xml
+++ b/tests/integration/jersey-2704/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2704</artifactId>
diff --git a/tests/integration/jersey-2776/pom.xml b/tests/integration/jersey-2776/pom.xml
index 421925a..944ac1f 100644
--- a/tests/integration/jersey-2776/pom.xml
+++ b/tests/integration/jersey-2776/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2776</artifactId>
diff --git a/tests/integration/jersey-2794/pom.xml b/tests/integration/jersey-2794/pom.xml
index 6569a7b..50852e0 100644
--- a/tests/integration/jersey-2794/pom.xml
+++ b/tests/integration/jersey-2794/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2794</artifactId>
diff --git a/tests/integration/jersey-2846/pom.xml b/tests/integration/jersey-2846/pom.xml
index 55ca718..290ec21 100644
--- a/tests/integration/jersey-2846/pom.xml
+++ b/tests/integration/jersey-2846/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2846</artifactId>
diff --git a/tests/integration/jersey-2878/pom.xml b/tests/integration/jersey-2878/pom.xml
index 734726c..f030909 100644
--- a/tests/integration/jersey-2878/pom.xml
+++ b/tests/integration/jersey-2878/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2878</artifactId>
diff --git a/tests/integration/jersey-2878/src/main/java/org/glassfish/jersey/tests/integration/jersey2878/TestApplication.java b/tests/integration/jersey-2878/src/main/java/org/glassfish/jersey/tests/integration/jersey2878/TestApplication.java
index a7f533e..03a5b18 100644
--- a/tests/integration/jersey-2878/src/main/java/org/glassfish/jersey/tests/integration/jersey2878/TestApplication.java
+++ b/tests/integration/jersey-2878/src/main/java/org/glassfish/jersey/tests/integration/jersey2878/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
/**
* Jersey application for JERSEY-2878.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@ApplicationPath("/")
public class TestApplication extends ResourceConfig {
diff --git a/tests/integration/jersey-2878/src/main/java/org/glassfish/jersey/tests/integration/jersey2878/TestResource.java b/tests/integration/jersey-2878/src/main/java/org/glassfish/jersey/tests/integration/jersey2878/TestResource.java
index eaada6a..b3414ba 100644
--- a/tests/integration/jersey-2878/src/main/java/org/glassfish/jersey/tests/integration/jersey2878/TestResource.java
+++ b/tests/integration/jersey-2878/src/main/java/org/glassfish/jersey/tests/integration/jersey2878/TestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
/**
* A simple resource that returns a string.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("string")
public class TestResource {
diff --git a/tests/integration/jersey-2878/src/test/java/org/glassfish/jersey/tests/integration/jersey2878/Jersey2878ApacheITCase.java b/tests/integration/jersey-2878/src/test/java/org/glassfish/jersey/tests/integration/jersey2878/Jersey2878ApacheITCase.java
index 8786b52..f23c45e 100644
--- a/tests/integration/jersey-2878/src/test/java/org/glassfish/jersey/tests/integration/jersey2878/Jersey2878ApacheITCase.java
+++ b/tests/integration/jersey-2878/src/test/java/org/glassfish/jersey/tests/integration/jersey2878/Jersey2878ApacheITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
/**
* Additional test class that tests jersey client configured with the apache http.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class Jersey2878ApacheITCase extends Jersey2878ITCase {
diff --git a/tests/integration/jersey-2892/pom.xml b/tests/integration/jersey-2892/pom.xml
index ae3ee2a..81b40d1 100644
--- a/tests/integration/jersey-2892/pom.xml
+++ b/tests/integration/jersey-2892/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-2892</artifactId>
diff --git a/tests/integration/jersey-2892/src/main/java/org/glassfish/jersey/tests/integration/jersey2892/TestApplication.java b/tests/integration/jersey-2892/src/main/java/org/glassfish/jersey/tests/integration/jersey2892/TestApplication.java
index f1b5eb0..78b6f39 100644
--- a/tests/integration/jersey-2892/src/main/java/org/glassfish/jersey/tests/integration/jersey2892/TestApplication.java
+++ b/tests/integration/jersey-2892/src/main/java/org/glassfish/jersey/tests/integration/jersey2892/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Jersey application for JERSEY-2878 and also J-605 (which is derived from the former one).
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@ApplicationPath("/")
public class TestApplication extends ResourceConfig {
diff --git a/tests/integration/jersey-2892/src/main/java/org/glassfish/jersey/tests/integration/jersey2892/TestResource.java b/tests/integration/jersey-2892/src/main/java/org/glassfish/jersey/tests/integration/jersey2892/TestResource.java
index c59b252..dc6593c 100644
--- a/tests/integration/jersey-2892/src/main/java/org/glassfish/jersey/tests/integration/jersey2892/TestResource.java
+++ b/tests/integration/jersey-2892/src/main/java/org/glassfish/jersey/tests/integration/jersey2892/TestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* A resource that provides a means to test whether repeating classes in object graph are correctly filtered out.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
diff --git a/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/AbstractJerseyEntityFilteringITCase.java b/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/AbstractJerseyEntityFilteringITCase.java
index ac5a7ab..4b32ba9 100644
--- a/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/AbstractJerseyEntityFilteringITCase.java
+++ b/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/AbstractJerseyEntityFilteringITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -31,7 +31,7 @@
/**
* Tests whether classes repeating in the object graph are filtered out correctly.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public abstract class AbstractJerseyEntityFilteringITCase extends JerseyTest {
diff --git a/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/J605MoxyITCase.java b/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/J605MoxyITCase.java
index 501df41..bf1798b 100644
--- a/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/J605MoxyITCase.java
+++ b/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/J605MoxyITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Tests whether classes repeating in the object graph are filtered out correctly when using MOXY json provider.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class J605MoxyITCase extends AbstractJerseyEntityFilteringITCase {
diff --git a/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/Jersey2892JacksonITCase.java b/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/Jersey2892JacksonITCase.java
index 1ce858e..2a50bef 100644
--- a/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/Jersey2892JacksonITCase.java
+++ b/tests/integration/jersey-2892/src/test/java/org/glassfish/jersey/tests/integration/jersey2892/Jersey2892JacksonITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Tests whether classes repeating in the object graph are filtered out correctly when using Jackson json provider.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class Jersey2892JacksonITCase extends AbstractJerseyEntityFilteringITCase {
diff --git a/tests/integration/jersey-3670/pom.xml b/tests/integration/jersey-3670/pom.xml
new file mode 100644
index 0000000..8a61c09
--- /dev/null
+++ b/tests/integration/jersey-3670/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <artifactId>project</artifactId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>jersey-3670</artifactId>
+ <packaging>war</packaging>
+ <name>jersey-tests-integration-jersey-3670</name>
+
+ <description>JERSEY-3670 - Broken ParamConverterProvider ordering in 2.26</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-external</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.connectors</groupId>
+ <artifactId>jersey-grizzly-connector</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyApplication.java b/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyApplication.java
new file mode 100644
index 0000000..711cf96
--- /dev/null
+++ b/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyApplication.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019 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.tests.integration.jersey3670;
+
+import javax.ws.rs.core.Application;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+public class MyApplication extends Application {
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ LinkedHashSet<Class<?>> classes = new LinkedHashSet<>();
+ classes.add(MyResource.class);
+ classes.add(MyConverterProvider.class);
+ return classes;
+ }
+
+}
\ No newline at end of file
diff --git a/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyConverterProvider.java b/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyConverterProvider.java
new file mode 100644
index 0000000..e0053f6
--- /dev/null
+++ b/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyConverterProvider.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2019 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.tests.integration.jersey3670;
+
+import javax.annotation.Priority;
+import javax.ws.rs.ext.ParamConverter;
+import javax.ws.rs.ext.ParamConverterProvider;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+@Priority(0)
+public class MyConverterProvider implements ParamConverterProvider {
+
+ @Override
+ public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, Annotation[] annotations) {
+
+ if (rawType.equals(Integer.class)) {
+
+ /*
+ * Dummy ParamConverter which always returns "42".
+ */
+ return (ParamConverter<T>) new ParamConverter<Integer>() {
+ @Override
+ public Integer fromString(String value) {
+ return 42;
+ }
+
+ @Override
+ public String toString(Integer value) {
+ throw new UnsupportedOperationException();
+ }
+ };
+
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyResource.java b/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyResource.java
new file mode 100644
index 0000000..d7aeb6a
--- /dev/null
+++ b/tests/integration/jersey-3670/src/main/java/org/glassfish/jersey/tests/integration/jersey3670/MyResource.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2019 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.tests.integration.jersey3670;
+
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+
+@Path("/param/{value}")
+@ValidateOnExecution(type = ExecutableType.NONE)
+public class MyResource {
+
+ @PathParam("value")
+ private Integer value;
+
+ @GET
+ public String get() {
+ return "Value injected via @PathParam: " + value;
+ }
+
+}
\ No newline at end of file
diff --git a/tests/integration/jersey-3670/src/main/webapp/WEB-INF/beans.xml b/tests/integration/jersey-3670/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 0000000..e90af99
--- /dev/null
+++ b/tests/integration/jersey-3670/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+ bean-discovery-mode="all">
+</beans>
diff --git a/tests/integration/jersey-3670/src/main/webapp/index.html b/tests/integration/jersey-3670/src/main/webapp/index.html
new file mode 100644
index 0000000..21715b1
--- /dev/null
+++ b/tests/integration/jersey-3670/src/main/webapp/index.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Jersey Provider Priority (issue 3670)</title>
+</head>
+<body>
+<h1>Jersey Provider Priority (issue 3670)</h1>
+
+<ul>
+ <li>
+ <a href="./r/param/1">
+ ./r/param/1
+ </a>
+ </li>
+</ul>
+</body>
+</html>
\ No newline at end of file
diff --git a/tests/integration/jersey-3670/src/test/java/org/glassfish/jersey/tests/integration/jersey3670/ExternalApplicationParamConverterTest.java b/tests/integration/jersey-3670/src/test/java/org/glassfish/jersey/tests/integration/jersey3670/ExternalApplicationParamConverterTest.java
new file mode 100644
index 0000000..a166ed1
--- /dev/null
+++ b/tests/integration/jersey-3670/src/test/java/org/glassfish/jersey/tests/integration/jersey3670/ExternalApplicationParamConverterTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2019 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.tests.integration.jersey3670;
+
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.grizzly.GrizzlyTestContainerFactory;
+import org.glassfish.jersey.test.spi.TestContainerException;
+import org.glassfish.jersey.test.spi.TestContainerFactory;
+import org.junit.Test;
+
+import javax.ws.rs.core.Application;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExternalApplicationParamConverterTest extends JerseyTest {
+
+ private static final String CHECK_STRING = "Value injected via @PathParam: 42";
+
+ @Override
+ protected Application configure() {
+ return new MyApplication();
+ }
+
+ @Override
+ protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
+ return new GrizzlyTestContainerFactory();
+ }
+
+ @Test
+ public void testExternalParamConverterValue() {
+ final String resp = target("/param/1").request().get(String.class);
+ assertEquals(CHECK_STRING, resp);
+ }
+
+}
diff --git a/tests/integration/jersey-3796/pom.xml b/tests/integration/jersey-3796/pom.xml
new file mode 100644
index 0000000..cd4c761
--- /dev/null
+++ b/tests/integration/jersey-3796/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2018 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
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <artifactId>project</artifactId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>jersey-3796</artifactId>
+ <packaging>war</packaging>
+ <name>jersey-tests-integration-jersey-3796</name>
+
+ <description>
+ Reproducer of JERSEY-3796.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-servlet</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <artifactId>jersey-media-json-jackson</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-external</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyApplication.java b/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyApplication.java
new file mode 100644
index 0000000..59b19b0
--- /dev/null
+++ b/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyApplication.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2018 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.tests.integration.jersey3796;
+
+import org.glassfish.jersey.server.ResourceConfig;
+
+import javax.ws.rs.ApplicationPath;
+
+/**
+ * The very basic instance of application to init the test
+ */
+
+
+@ApplicationPath("/")
+public class MyApplication
+ extends ResourceConfig {
+
+ public MyApplication() {
+ register(MyResource.class);
+ register(MyProvider.class);
+ }
+}
+
diff --git a/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyProvider.java b/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyProvider.java
new file mode 100644
index 0000000..bf93908
--- /dev/null
+++ b/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyProvider.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2018 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.tests.integration.jersey3796;
+
+import javax.annotation.Priority;
+import javax.ws.rs.Priorities;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
+import javax.ws.rs.ext.Provider;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This is the purpose of the whole test.
+ * Here we test if initialized providers (by interfaces) are initialized only once per scope.
+ * This means the one class per all implemented provider interfaces.
+ */
+@Provider
+@Priority(Priorities.USER + 2)
+public class MyProvider implements Feature, ContainerRequestFilter, ContainerResponseFilter {
+
+ /**
+ * common map which in case of wrong initialization could cause NPE or not contain some expected element
+ */
+ private Map<String, String> sameInstance;
+
+ /**
+ * Feature method which is invoked as the first and initializes the common map.
+ * It also puts the toString value of the implementing class into the map
+ *
+ * @param context feature context (here just skipped)
+ * @return true - always success
+ */
+ @Override
+ public boolean configure(FeatureContext context) {
+ sameInstance = new HashMap<>();
+ sameInstance.put("Feature", this.toString());
+ return true;
+ }
+
+ /**
+ * Request filter provider - uses the common map (if it's not initialized the NPE is thrown).
+ * Puts the toString value of the implementing class into the map
+ *
+ * @param requestContext request context (here just skipped)
+ */
+ @Override
+ public void filter(ContainerRequestContext requestContext) {
+ sameInstance.put("Request", this.toString());
+ }
+
+ /**
+ * Response filter provider - uses the common map (and is called as the last in the providers sequence)
+ * if map is not initialized the NPE is thrown.
+ * Puts the toString value of the implementing class into the map
+ *
+ * maps all elements of the map to the response entity (which is map is well)
+ *
+ * @param requestContext request context (here just skipped)
+ * @param responseContext response context (here just skipped)
+ */
+ @Override
+ public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) {
+ sameInstance.put("Response", this.toString());
+ ((Map) responseContext.getEntity()).putAll(sameInstance);
+ }
+
+}
\ No newline at end of file
diff --git a/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyResource.java b/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyResource.java
new file mode 100644
index 0000000..2a5ea74
--- /dev/null
+++ b/tests/integration/jersey-3796/src/main/java/org/glassfish/jersey/tests/integration/jersey3796/MyResource.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2018 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.tests.integration.jersey3796;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Root resource (exposed at "myresource" path)
+ */
+@Path("/myresource")
+public class MyResource {
+
+ /**
+ * Method handling HTTP GET requests. The returned object will be sent
+ * to the client as "application/json" media type.
+ *
+ * @return Empty map to be willed by providers.
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map<String, String> getIt() {
+ return new HashMap<>();
+ }
+}
\ No newline at end of file
diff --git a/tests/integration/jersey-3796/src/main/webapp/WEB-INF/web.xml b/tests/integration/jersey-3796/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..3ec7e3a
--- /dev/null
+++ b/tests/integration/jersey-3796/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2015, 2018 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
+
+-->
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <servlet>
+ <servlet-name>jersey3796Servlet</servlet-name>
+ <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
+ <init-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>org.glassfish.jersey.tests.integration.jersey3796.MyApplication</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>jersey3796Servlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
diff --git a/tests/integration/jersey-3796/src/test/java/org/glassfish/jersey/tests/integration/jersey3796/Jersey3796ITCase.java b/tests/integration/jersey-3796/src/test/java/org/glassfish/jersey/tests/integration/jersey3796/Jersey3796ITCase.java
new file mode 100644
index 0000000..7d552e8
--- /dev/null
+++ b/tests/integration/jersey-3796/src/test/java/org/glassfish/jersey/tests/integration/jersey3796/Jersey3796ITCase.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018 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.tests.integration.jersey3796;
+
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.external.ExternalTestContainerFactory;
+import org.glassfish.jersey.test.grizzly.GrizzlyTestContainerFactory;
+import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory;
+import org.glassfish.jersey.test.spi.TestContainerException;
+import org.glassfish.jersey.test.spi.TestContainerFactory;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+import java.util.Map;
+
+/**
+ * Tests the one class initialization per all declared provider interfaces
+ */
+public class Jersey3796ITCase extends JerseyTest {
+
+ @Override
+ protected Application configure() {
+ return new MyApplication();
+ }
+
+ @Override
+ protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
+ return new ExternalTestContainerFactory();
+ }
+
+ @Test
+ public void testSameInstanceForProviders() {
+ final Map response = target("/myresource").request(MediaType.APPLICATION_JSON_TYPE).get(Map.class);
+ //Map shall not be null
+ Assert.assertNotNull(response);
+ //Map shall contain exactly three elements
+ Assert.assertEquals(3, response.size());
+ //Map shall contain ony keys Feature, Request and Response
+ //Values of that keys shall be equals.
+ //Equality of all values indicates the class is only one per all tested providers
+ Assert.assertEquals(response.get("Feature"), response.get("Request"));
+ Assert.assertEquals(response.get("Feature"), response.get("Response"));
+ Assert.assertEquals(response.get("Response"), response.get("Request"));
+ }
+}
diff --git a/tests/integration/jersey-3992/pom.xml b/tests/integration/jersey-3992/pom.xml
new file mode 100644
index 0000000..dc0d62e
--- /dev/null
+++ b/tests/integration/jersey-3992/pom.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2018 Payara Foundation 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
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <artifactId>project</artifactId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>jersey-3992</artifactId>
+ <packaging>war</packaging>
+ <name>jersey-3992</name>
+
+ <description>Jersey CDI Inheritance test web application</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.annotation</groupId>
+ <artifactId>jakarta.annotation-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.cdi</groupId>
+ <artifactId>jersey-weld2-se</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>run-external-tests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <jersey.config.test.container.factory>${external.container.factory}</jersey.config.test.container.factory>
+ <jersey.config.test.container.port>${external.container.port}</jersey.config.test.container.port>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <!-- External test container configuration is done via properties to allow overriding via command line. -->
+ <external.container.factory>org.glassfish.jersey.test.external.ExternalTestContainerFactory</external.container.factory>
+ <external.container.port>8080</external.container.port>
+ <maven.test.skip>false</maven.test.skip>
+ </properties>
+ </profile>
+ </profiles>
+</project>
diff --git a/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/MainApplication.java b/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/MainApplication.java
new file mode 100644
index 0000000..70c1939
--- /dev/null
+++ b/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/MainApplication.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation 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.tests.cdi.resources;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.spi.BeanManager;
+
+import javax.inject.Inject;
+
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+
+/**
+ * JAX-RS application to configure resources.
+ *
+ * @author Jonathan Benoit
+ */
+@ApplicationPath("main")
+@ApplicationScoped
+public class MainApplication extends Application {
+
+ static AtomicInteger postConstructCounter = new AtomicInteger();
+
+ @Inject BeanManager bm;
+
+ private static final Logger LOGGER = Logger.getLogger(MainApplication.class.getName());
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ final Set<Class<?>> classes = new HashSet<Class<?>>();
+ classes.add(UserResource.class);
+ classes.add(UserResourceImpl.class);
+ return classes;
+ }
+
+ // JERSEY-2531: make sure this type gets managed by CDI
+ @PostConstruct
+ public void postConstruct() {
+ LOGGER.info(String.format("%s: POST CONSTRUCT.", this.getClass().getName()));
+ postConstructCounter.incrementAndGet();
+ if (bm == null) {
+ throw new IllegalStateException("BeanManager should have been injected into a CDI managed bean.");
+ }
+ if (postConstructCounter.intValue() > 1) {
+ throw new IllegalStateException("postConstruct should have been invoked only once on app scoped bean.");
+ }
+ }
+
+ @PreDestroy
+ public void preDestroy() {
+ LOGGER.info(String.format("%s: PRE DESTROY.", this.getClass().getName()));
+ }
+}
diff --git a/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/UserResource.java b/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/UserResource.java
new file mode 100644
index 0000000..91edf6a8
--- /dev/null
+++ b/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/UserResource.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2018 Payara Foundation 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.tests.cdi.resources;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ *
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+public interface UserResource {
+
+ /**
+ * Gets the user count
+ *
+ * @return user count.
+ */
+ @GET
+ @Path("/count")
+ public int getCount();
+
+}
\ No newline at end of file
diff --git a/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/UserResourceImpl.java b/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/UserResourceImpl.java
new file mode 100644
index 0000000..218d60c
--- /dev/null
+++ b/tests/integration/jersey-3992/src/main/java/org/glassfish/jersey/tests/cdi/resources/UserResourceImpl.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018 Payara Foundation 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.tests.cdi.resources;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ *
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+@Path("user")
+public class UserResourceImpl implements UserResource {
+
+ /**
+ * Gets the user count
+ *
+ * @return user count.
+ */
+ @GET
+ @Path("/count")
+ @Override
+ public int getCount() {
+ return 0;
+ }
+}
diff --git a/tests/integration/jersey-3992/src/main/resources/META-INF/beans.xml b/tests/integration/jersey-3992/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..b30e66e
--- /dev/null
+++ b/tests/integration/jersey-3992/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2018 Payara Foundation 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
+
+-->
+
+<beans
+ xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
+ http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+ bean-discovery-mode="annotated">
+</beans>
diff --git a/tests/integration/jersey-3992/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java b/tests/integration/jersey-3992/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
new file mode 100644
index 0000000..98fd55c
--- /dev/null
+++ b/tests/integration/jersey-3992/src/test/java/org/glassfish/jersey/tests/cdi/resources/CdiTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 Payara Foundation 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.tests.cdi.resources;
+
+import java.net.URI;
+
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.UriBuilder;
+import org.glassfish.jersey.test.JerseyTest;
+import org.jboss.weld.environment.se.Weld;
+
+/**
+ * Test for CDI web application resources.
+ * Run with:
+ * <pre>
+ * mvn clean package
+ * $AS_HOME/bin/asadmin deploy target/cdi-test-webapp
+ * mvn -DskipTests=false test</pre>
+ *
+ * @author Jakub Podlesak
+ */
+public class CdiTest extends JerseyTest {
+
+ Weld weld;
+
+ @Override
+ public void setUp() throws Exception {
+ weld = new Weld();
+ weld.initialize();
+ super.setUp();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ weld.shutdown();
+ super.tearDown();
+ }
+
+ @Override
+ protected Application configure() {
+ return new MainApplication();
+ }
+
+ @Override
+ protected URI getBaseUri() {
+ return UriBuilder.fromUri(super.getBaseUri()).path("cdi-test-webapp/main").build();
+ }
+}
+
diff --git a/tests/integration/jersey-3992/src/test/java/org/glassfish/jersey/tests/cdi/resources/InheritanceTest.java b/tests/integration/jersey-3992/src/test/java/org/glassfish/jersey/tests/cdi/resources/InheritanceTest.java
new file mode 100644
index 0000000..24479fb
--- /dev/null
+++ b/tests/integration/jersey-3992/src/test/java/org/glassfish/jersey/tests/cdi/resources/InheritanceTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018 Payara Foundation 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.tests.cdi.resources;
+
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Response;
+import org.junit.Test;
+import static org.junit.Assert.assertThat;
+import static org.hamcrest.CoreMatchers.is;
+
+/**
+ *
+ * @author Gaurav Gupta (gaurav.gupta@payara.fish)
+ */
+public class InheritanceTest extends CdiTest {
+
+ @Test
+ public void testGet() {
+
+ final WebTarget target = target().path("user/count");
+
+ final Response response = target.request().get();
+ assertThat(response.getStatus(), is(200));
+
+ }
+}
diff --git a/tests/integration/jersey-4099/pom.xml b/tests/integration/jersey-4099/pom.xml
new file mode 100644
index 0000000..64ff33a
--- /dev/null
+++ b/tests/integration/jersey-4099/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 Christian Kaltepoth. 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
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <artifactId>project</artifactId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>jersey-4099</artifactId>
+ <packaging>war</packaging>
+ <name>jersey-tests-integration-jersey-4099</name>
+
+ <description>JERSEY-4099 - @Priority is not always picked up correctly for JAX-RS providers</description>
+
+ <dependencies>
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework</groupId>
+ <artifactId>jersey-test-framework-util</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Jersey modules -->
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-grizzly2-http</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.cdi</groupId>
+ <artifactId>jersey-weld2-se</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.cdi</groupId>
+ <artifactId>jersey-cdi1x</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyApplication.java b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyApplication.java
new file mode 100644
index 0000000..0a440ca
--- /dev/null
+++ b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyApplication.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2019 Christian Kaltepoth. 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.integration.jersey4099;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ws.rs.core.Application;
+
+public class MyApplication extends Application {
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ Set<Class<?>> classes = new HashSet<>();
+ classes.add(MyResource.class);
+ classes.add(MyPriority100Mapper.class);
+ classes.add(MyPriority200Mapper.class);
+ return classes;
+ }
+
+}
\ No newline at end of file
diff --git a/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyException.java b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyException.java
new file mode 100644
index 0000000..5e916f4
--- /dev/null
+++ b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyException.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 Christian Kaltepoth. 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.integration.jersey4099;
+
+public class MyException extends RuntimeException {
+
+ // special exception type thrown from resource and mapped via two exception mappers
+
+}
diff --git a/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyPriority100Mapper.java b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyPriority100Mapper.java
new file mode 100644
index 0000000..461c838
--- /dev/null
+++ b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyPriority100Mapper.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019 Christian Kaltepoth. 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.integration.jersey4099;
+
+import javax.annotation.Priority;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+
+/**
+ * This mapper has a lower priority and should always be selected
+ */
+@Priority(100)
+public class MyPriority100Mapper implements ExceptionMapper<MyException> {
+
+ @Override
+ public Response toResponse(MyException exception) {
+ return Response.ok(this.getClass().getName()).build();
+ }
+
+}
diff --git a/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyPriority200Mapper.java b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyPriority200Mapper.java
new file mode 100644
index 0000000..3bcb8bc
--- /dev/null
+++ b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyPriority200Mapper.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019 Christian Kaltepoth. 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.integration.jersey4099;
+
+import javax.annotation.Priority;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+
+/**
+ * Mapper with higher priority should lose against the other one
+ */
+@Priority(200)
+public class MyPriority200Mapper implements ExceptionMapper<MyException> {
+
+ @Override
+ public Response toResponse(MyException exception) {
+ return Response.ok(this.getClass().getName()).build();
+ }
+
+}
diff --git a/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyResource.java b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyResource.java
new file mode 100644
index 0000000..2fe8a6b
--- /dev/null
+++ b/tests/integration/jersey-4099/src/main/java/org/glassfish/jersey/tests/integration/jersey4099/MyResource.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2019 Christian Kaltepoth. 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.integration.jersey4099;
+
+import javax.enterprise.context.RequestScoped;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@RequestScoped
+@Path("/exception")
+public class MyResource {
+
+ @GET
+ public String get() {
+ throw new MyException();
+ }
+
+}
\ No newline at end of file
diff --git a/tests/integration/jersey-4099/src/main/webapp/WEB-INF/beans.xml b/tests/integration/jersey-4099/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 0000000..3ca0beb
--- /dev/null
+++ b/tests/integration/jersey-4099/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 Christian Kaltepoth. 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
+
+-->
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
+ bean-discovery-mode="all" version="2.0">
+
+ <!-- No special configuration required -->
+
+</beans>
\ No newline at end of file
diff --git a/tests/integration/jersey-4099/src/test/java/org/glassfish/jersey/tests/integration/jersey4099/PriorityAnnotationOnExceptionMappersTest.java b/tests/integration/jersey-4099/src/test/java/org/glassfish/jersey/tests/integration/jersey4099/PriorityAnnotationOnExceptionMappersTest.java
new file mode 100644
index 0000000..3d9ca2e
--- /dev/null
+++ b/tests/integration/jersey-4099/src/test/java/org/glassfish/jersey/tests/integration/jersey4099/PriorityAnnotationOnExceptionMappersTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2019 Christian Kaltepoth. 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.integration.jersey4099;
+
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.jboss.weld.environment.se.Weld;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.junit.Assert.assertThat;
+
+public class PriorityAnnotationOnExceptionMappersTest extends JerseyTest {
+
+ private Weld weld;
+
+ @Override
+ public void setUp() throws Exception {
+ weld = new Weld();
+ weld.initialize();
+ super.setUp();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ weld.shutdown();
+ }
+
+ @Override
+ protected ResourceConfig configure() {
+ return ResourceConfig.forApplicationClass(MyApplication.class);
+ }
+
+ @Test
+ public void testCorrectMapperSelectedAccordingToPriorityAnnotation() {
+
+ assertThat(
+ target("/exception").request().get(String.class),
+ containsString("MyPriority100Mapper") // Prio 100 mapper should win
+ );
+
+ }
+
+}
diff --git a/tests/integration/jersey-780/pom.xml b/tests/integration/jersey-780/pom.xml
index e4e20c1..46061dd 100644
--- a/tests/integration/jersey-780/pom.xml
+++ b/tests/integration/jersey-780/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-780</artifactId>
diff --git a/tests/integration/microprofile/config/helidon/pom.xml b/tests/integration/microprofile/config/helidon/pom.xml
new file mode 100644
index 0000000..448acc3
--- /dev/null
+++ b/tests/integration/microprofile/config/helidon/pom.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>project</artifactId>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <version>2.30-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>helidon-config-webapp</artifactId>
+ <packaging>war</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <artifactId>config-webapp</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.microprofile</groupId>
+ <artifactId>jersey-mp-config</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.helidon.config</groupId>
+ <artifactId>helidon-config</artifactId>
+ <version>${helidon.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.helidon.microprofile.config</groupId>
+ <artifactId>helidon-microprofile-config</artifactId>
+ <version>${helidon.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/tests/integration/microprofile/config/helidon/src/main/java/webapp/WEB-INF/web.xml b/tests/integration/microprofile/config/helidon/src/main/java/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..b27c40e
--- /dev/null
+++ b/tests/integration/microprofile/config/helidon/src/main/java/webapp/WEB-INF/web.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <servlet>
+ <servlet-name>helidonConfigApplicationServlet</servlet-name>
+ <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
+ <init-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>org.glassfish.jersey.tests.integration.config.MyApplication</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>helidonConfigApplicationServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
diff --git a/tests/integration/microprofile/config/helidon/src/test/java/org/glassfish/jersey/tests/integration/config/HelidonConfigApplicationTest.java b/tests/integration/microprofile/config/helidon/src/test/java/org/glassfish/jersey/tests/integration/config/HelidonConfigApplicationTest.java
new file mode 100644
index 0000000..0543f63
--- /dev/null
+++ b/tests/integration/microprofile/config/helidon/src/test/java/org/glassfish/jersey/tests/integration/config/HelidonConfigApplicationTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2019 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.tests.integration.config;
+
+
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.grizzly.GrizzlyTestContainerFactory;
+import org.glassfish.jersey.test.spi.TestContainerException;
+import org.glassfish.jersey.test.spi.TestContainerFactory;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+
+public class HelidonConfigApplicationTest extends JerseyTest {
+
+ @Override
+ protected Application configure() {
+ return new MyApplication();
+ }
+
+ @Override
+ protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
+ return new GrizzlyTestContainerFactory();
+ }
+
+ @Test
+ public void testGetConfigProperty() {
+ final String response = target("/config/getProperty/{name}")
+ .resolveTemplate("name", "jersey.config.disableMetainfServicesLookup")
+ .request(MediaType.TEXT_PLAIN).get(String.class);
+ Assert.assertEquals("true", response);
+ }
+}
\ No newline at end of file
diff --git a/tests/integration/microprofile/config/webapp/pom.xml b/tests/integration/microprofile/config/webapp/pom.xml
new file mode 100644
index 0000000..168ba2f
--- /dev/null
+++ b/tests/integration/microprofile/config/webapp/pom.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>project</artifactId>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <version>2.30-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>config-webapp</artifactId>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.bundles</groupId>
+ <artifactId>jaxrs-ri</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/tests/integration/microprofile/config/webapp/src/main/java/org/glassfish/jersey/tests/integration/config/MyApplication.java b/tests/integration/microprofile/config/webapp/src/main/java/org/glassfish/jersey/tests/integration/config/MyApplication.java
new file mode 100644
index 0000000..1f12a24
--- /dev/null
+++ b/tests/integration/microprofile/config/webapp/src/main/java/org/glassfish/jersey/tests/integration/config/MyApplication.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2019 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.tests.integration.config;
+
+import org.glassfish.jersey.server.ResourceConfig;
+
+import javax.ws.rs.ApplicationPath;
+
+@ApplicationPath("/")
+public class MyApplication
+ extends ResourceConfig {
+
+ public MyApplication() {
+ register(new MyResource(this));
+ }
+}
\ No newline at end of file
diff --git a/tests/integration/microprofile/config/webapp/src/main/java/org/glassfish/jersey/tests/integration/config/MyResource.java b/tests/integration/microprofile/config/webapp/src/main/java/org/glassfish/jersey/tests/integration/config/MyResource.java
new file mode 100644
index 0000000..eafefd5
--- /dev/null
+++ b/tests/integration/microprofile/config/webapp/src/main/java/org/glassfish/jersey/tests/integration/config/MyResource.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2019 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.tests.integration.config;
+
+
+import org.glassfish.jersey.server.ResourceConfig;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Response;
+
+@Path("config")
+public class MyResource {
+ private ResourceConfig config;
+
+ public MyResource(ResourceConfig config) {
+ this.config = config;
+ }
+
+ @GET
+ @Path("getProperty/{name}")
+ public Response getProperty(@PathParam("name") String name) {
+ return Response.ok(config.getProperty(name)).build();
+ }
+}
diff --git a/tests/integration/microprofile/config/webapp/src/main/resources/META-INF/microprofile-config.properties b/tests/integration/microprofile/config/webapp/src/main/resources/META-INF/microprofile-config.properties
new file mode 100644
index 0000000..dbb4a93
--- /dev/null
+++ b/tests/integration/microprofile/config/webapp/src/main/resources/META-INF/microprofile-config.properties
@@ -0,0 +1,3 @@
+jersey.config.disableJsonProcessing = true
+jersey.config.disableAutoDiscovery=1
+jersey.config.disableMetainfServicesLookup=true
\ No newline at end of file
diff --git a/tests/integration/microprofile/rest-client/pom.xml b/tests/integration/microprofile/rest-client/pom.xml
new file mode 100644
index 0000000..bbda656
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/pom.xml
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>project</artifactId>
+ <groupId>org.glassfish.jersey.tests.integration</groupId>
+ <version>2.30-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jersey-rest-client-tck</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.microprofile</groupId>
+ <artifactId>jersey-mp-rest-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- Overrides CDI from parent pom -->
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld.se</groupId>
+ <artifactId>weld-se-core</artifactId>
+ <version>3.0.3.Final</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.smallrye</groupId>
+ <artifactId>smallrye-config</artifactId>
+ <version>1.3.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.microprofile.rest.client</groupId>
+ <artifactId>microprofile-rest-client-tck</artifactId>
+ <version>1.3.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.tomakehurst</groupId>
+ <artifactId>wiremock</artifactId>
+ <version>2.21.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.testng</groupId>
+ <artifactId>arquillian-testng-container</artifactId>
+ <version>1.4.1.Final</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-container-test-spi</artifactId>
+ <version>1.4.1.Final</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-weld-embedded</artifactId>
+ <version>2.0.1.Final</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>testRunner</id>
+ <activation>
+ <property>
+ <name>skipTests</name>
+ <value>!true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-junit47</artifactId>
+ <version>${surefire.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-testng</artifactId>
+ <version>${surefire.version}</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <threadCount>1</threadCount>
+ <suiteXmlFiles>
+ <suiteXmlFile>tck-suite.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>uk.co.deliverymind</groupId>
+ <artifactId>wiremock-maven-plugin</artifactId>
+ <version>2.7.0</version>
+ <executions>
+ <execution>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <dir>target/classes</dir>
+ <params>--port=8765</params>
+ <!-- Enable verbose for more detailed output-->
+ <!-- <params>--verbose</params>-->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <properties>
+ <surefire.security.argline>-Djava.security.manager -Djava.security.policy=${project.build.directory}/test-classes/server.policy</surefire.security.argline>
+ </properties>
+
+
+</project>
\ No newline at end of file
diff --git a/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/message/internal/StringMessageProvider.java b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/message/internal/StringMessageProvider.java
new file mode 100644
index 0000000..203ecbc
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/message/internal/StringMessageProvider.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2019 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.message.internal;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.inject.Singleton;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+
+import org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider;
+
+/*
+ * This class was copied from Jersey Common 2.26 due to TCK workaround reasons.
+ */
+
+/**
+ *
+ * @author Paul Sandoz
+ */
+@Produces
+@Consumes
+@Singleton
+final class StringMessageProvider extends AbstractMessageReaderWriterProvider<String> {
+
+ @Override
+ public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
+ return type == String.class;
+ }
+
+ @Override
+ public String readFrom(
+ Class<String> type,
+ Type genericType,
+ Annotation annotations[],
+ MediaType mediaType,
+ MultivaluedMap<String, String> httpHeaders,
+ InputStream entityStream) throws IOException {
+ return readFromAsString(entityStream, mediaType);
+ }
+
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
+ return type == String.class;
+ }
+
+ @Override
+ public long getSize(String s, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return s.length();
+ }
+
+ @Override
+ public void writeTo(
+ String t,
+ Class<?> type,
+ Type genericType,
+ Annotation annotations[],
+ MediaType mediaType,
+ MultivaluedMap<String, Object> httpHeaders,
+ OutputStream entityStream) throws IOException {
+ writeToAsString(t, entityStream, mediaType);
+ }
+}
diff --git a/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ApplicationResource.java b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ApplicationResource.java
new file mode 100644
index 0000000..5b8ef7c
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ApplicationResource.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2019 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.restclient;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.json.JsonValue;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * Created by David Kral.
+ */
+
+@Path("resource")
+public interface ApplicationResource {
+
+ @GET
+ List<String> getValue();
+
+ @GET
+ @Path("map")
+ Map<String, String> getTestMap();
+
+ @POST
+ String postAppendValue(String value);
+
+ @POST
+ @Path("getJson")
+ @Consumes(MediaType.APPLICATION_JSON)
+ JsonValue someJsonOperation(JsonValue jsonValue);
+
+ @GET
+ @Path("stringEntity")
+ JsonValue jsonValue();
+
+ default String sayHi() {
+ return "Hi";
+ }
+
+ @PUT
+ @Produces(MediaType.TEXT_PLAIN)
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Path("methodContent")
+ String methodContentType(@HeaderParam(HttpHeaders.CONTENT_TYPE) MediaType contentType, String entity);
+
+}
diff --git a/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ApplicationResourceImpl.java b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ApplicationResourceImpl.java
new file mode 100644
index 0000000..f14e027
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ApplicationResourceImpl.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2019 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.restclient;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.json.Json;
+import javax.json.JsonValue;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * Created by David Kral.
+ */
+public class ApplicationResourceImpl implements ApplicationResource {
+ @Override
+ public List<String> getValue() {
+ return Arrays.asList("This is default value!", "Test");
+ }
+
+ @Override
+ public Map<String, String> getTestMap() {
+ Map<String, String> testMap = new HashMap<>();
+ testMap.put("firstKey", "firstValue");
+ testMap.put("secondKey", "secondValue");
+ return testMap;
+ }
+
+ @Override
+ public String postAppendValue(String value) {
+ return null;
+ }
+
+ @Override
+ public JsonValue someJsonOperation(JsonValue jsonValue) {
+ return null;
+ }
+
+ @Override
+ public JsonValue jsonValue() {
+ return Json.createObjectBuilder().add("someKey", "Some value").build();
+ }
+
+ @Override
+ public String methodContentType(MediaType contentType, String entity) {
+ return null;
+ }
+
+}
diff --git a/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ConsumesAndProducesTest.java b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ConsumesAndProducesTest.java
new file mode 100644
index 0000000..2e518bc
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/ConsumesAndProducesTest.java
@@ -0,0 +1,108 @@
+package org.glassfish.jersey.restclient;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import javax.json.Json;
+import javax.json.JsonValue;
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientRequestFilter;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.eclipse.microprofile.rest.client.RestClientBuilder;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.TestProperties;
+import org.junit.Test;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+/**
+ * Created by David Kral.
+ */
+public class ConsumesAndProducesTest extends JerseyTest {
+
+ static final JsonValue EXPECTED_JSON_VALUE = Json.createObjectBuilder().add("someKey", "Some value").build();
+
+ @Override
+ protected ResourceConfig configure() {
+ enable(TestProperties.LOG_TRAFFIC);
+ return new ResourceConfig(ApplicationResourceImpl.class);
+ }
+
+ @Test
+ public void testWithEntity() throws URISyntaxException {
+ ApplicationResource app = RestClientBuilder.newBuilder()
+ .baseUri(new URI("http://localhost:9998"))
+ .register(new TestClientRequestFilter(MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON))
+ .build(ApplicationResource.class);
+
+ app.someJsonOperation(Json.createValue(1));
+ }
+
+ @Test
+ public void testWithoutEntity() throws URISyntaxException {
+ ApplicationResource app = RestClientBuilder.newBuilder()
+ .baseUri(new URI("http://localhost:9998"))
+ .register(new TestClientRequestFilter(MediaType.APPLICATION_JSON, null))
+ .build(ApplicationResource.class);
+
+ app.jsonValue();
+ }
+
+ @Test
+ public void testWithoutEntityActualValue() throws URISyntaxException {
+ ApplicationResource app = RestClientBuilder.newBuilder()
+ .baseUri(new URI("http://localhost:9998"))
+ .build(ApplicationResource.class);
+
+ JsonValue json = app.jsonValue();
+ assertEquals(json, EXPECTED_JSON_VALUE);
+ }
+
+ @Test
+ public void testMethodContentType() throws URISyntaxException {
+ ApplicationResource app = RestClientBuilder.newBuilder()
+ .baseUri(new URI("http://localhost:9998"))
+ .register(new TestClientRequestFilter(MediaType.TEXT_PLAIN, MediaType.TEXT_XML))
+ .build(ApplicationResource.class);
+
+ app.methodContentType(MediaType.TEXT_XML_TYPE, "something");
+ }
+
+ private static class TestClientRequestFilter implements ClientRequestFilter {
+
+ private final String expectedAccept;
+ private final String expectedContentType;
+
+ TestClientRequestFilter(String expectedAccept, String expectedContentType) {
+ this.expectedAccept = expectedAccept;
+ this.expectedContentType = expectedContentType;
+ }
+
+ @Override
+ public void filter(ClientRequestContext requestContext) {
+ assertTrue(requestContext.getHeaders().containsKey(HttpHeaders.ACCEPT));
+ List<Object> accept = requestContext.getHeaders().get(HttpHeaders.ACCEPT);
+ assertTrue(accept.contains(expectedAccept) || accept.contains(MediaType.valueOf(expectedAccept)));
+
+ if (expectedContentType != null) {
+ assertTrue(requestContext.getHeaders().containsKey(HttpHeaders.CONTENT_TYPE));
+ List<Object> contentType = requestContext.getHeaders().get(HttpHeaders.CONTENT_TYPE);
+ assertEquals(contentType.size(), 1);
+ assertTrue(contentType.contains(expectedContentType) || contentType
+ .contains(MediaType.valueOf(expectedContentType)));
+ } else {
+ assertFalse(requestContext.getHeaders().containsKey(HttpHeaders.CONTENT_TYPE));
+ }
+
+ requestContext.abortWith(Response.ok().build());
+ }
+ }
+
+}
diff --git a/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/CorrectInterface.java b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/CorrectInterface.java
new file mode 100644
index 0000000..8a15121
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/CorrectInterface.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2019 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.restclient;
+
+import javax.ws.rs.BeanParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+
+import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
+
+/**
+ * Correct test interface for validation
+ *
+ * @author David Kral
+ */
+
+@Path("test/{first}")
+public interface CorrectInterface {
+
+ @GET
+ @Path("{second}")
+ @ClientHeaderParam(name = "test", value = "someValue")
+ void firstMethod(@PathParam("first") String first, @PathParam("second") String second);
+
+ @GET
+ @ClientHeaderParam(name = "test", value = "{value}")
+ void secondMethod(@PathParam("first") String first, String second);
+
+ @POST
+ @ClientHeaderParam(name = "test",
+ value = "org.glassfish.jersey.org.glassfish.jersey.restclient.CustomHeaderGenerator.customHeader")
+ void thirdMethod(@PathParam("first") String first);
+
+ @GET
+ @Path("{second}")
+ void fourthMethod(@PathParam("first") String first, @BeanParam BeanWithPathParam second);
+
+ default String value() {
+ return "testValue";
+ }
+
+ class CustomHeaderGenerator {
+
+ public static String customHeader() {
+ return "static";
+ }
+
+ }
+
+ class BeanWithPathParam {
+
+ @PathParam("second")
+ public String pathParam;
+
+ }
+
+}
diff --git a/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/RestClientModelTest.java b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/RestClientModelTest.java
new file mode 100644
index 0000000..186b3c6
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/src/test/java/org/glassfish/jersey/restclient/RestClientModelTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2019 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.restclient;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.microprofile.rest.client.RestClientBuilder;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.TestProperties;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by David Kral.
+ */
+public class RestClientModelTest extends JerseyTest {
+ @Override
+ protected ResourceConfig configure() {
+ enable(TestProperties.LOG_TRAFFIC);
+ return new ResourceConfig(ApplicationResourceImpl.class);
+ }
+
+ @Test
+ public void testGetIt() throws URISyntaxException {
+ ApplicationResource app = RestClientBuilder.newBuilder()
+ .baseUri(new URI("http://localhost:9998"))
+ .build(ApplicationResource.class);
+ List<String> collection = app.getValue();
+ assertEquals(2, collection.size());
+ assertEquals("This is default value!", collection.get(0));
+ assertEquals("Test", collection.get(1));
+
+ Map<String, String> map = app.getTestMap();
+ assertEquals(2, map.size());
+ assertEquals("firstValue", map.get("firstKey"));
+ assertEquals("secondValue", map.get("secondKey"));
+
+ assertEquals("Hi", app.sayHi());
+ }
+}
diff --git a/tests/integration/microprofile/rest-client/src/test/resources/arquillian.xml b/tests/integration/microprofile/rest-client/src/test/resources/arquillian.xml
new file mode 100644
index 0000000..e748760
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/src/test/resources/arquillian.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+
+<arquillian xmlns="http://jboss.org/schema/arquillian"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://jboss.org/schema/arquillian
+ http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+ <engine>
+ <property name="deploymentExportPath">target/deployments</property>
+ </engine>
+</arquillian>
diff --git a/tests/integration/microprofile/rest-client/src/test/resources/server.policy b/tests/integration/microprofile/rest-client/src/test/resources/server.policy
new file mode 100644
index 0000000..0a3ee57
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/src/test/resources/server.policy
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 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
+ */
+
+grant {
+ permission java.security.AllPermission;
+};
diff --git a/tests/integration/microprofile/rest-client/tck-suite.xml b/tests/integration/microprofile/rest-client/tck-suite.xml
new file mode 100644
index 0000000..592f136
--- /dev/null
+++ b/tests/integration/microprofile/rest-client/tck-suite.xml
@@ -0,0 +1,28 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+<!--
+
+ Copyright (c) 2019 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
+
+-->
+<suite name="microprofile-rest-client-TCK" verbose="2" configfailurepolicy="continue">
+
+ <test name="microprofile-rest-client TCK">
+ <packages>
+ <package name="org.eclipse.microprofile.rest.client.tck.*">
+ </package>
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file
diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml
index e7cec86..3f78da8 100644
--- a/tests/integration/pom.xml
+++ b/tests/integration/pom.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2018 Payara Foundation 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
@@ -23,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
@@ -32,10 +33,12 @@
<name>jersey-tests-integration</name>
<modules>
+ <module>asm</module>
<module>async-jersey-filter</module>
<module>cdi-beanvalidation-webapp</module>
<module>cdi-ejb-test-webapp</module>
<module>cdi-iface-with-non-jaxrs-impl-test-webapp</module>
+ <module>cdi-log-check</module>
<module>cdi-multimodule</module>
<module>ejb-multimodule-reload</module>
<module>cdi-multipart-webapp</module>
@@ -59,7 +62,7 @@
<module>jersey-1928</module>
<module>jersey-1960</module>
<module>jersey-1964</module>
- <module>jersey-2031</module>
+ <!--<module>jersey-2031</module>-->
<module>jersey-2136</module>
<module>jersey-2137</module>
<module>jersey-2154</module>
@@ -84,7 +87,11 @@
<module>jersey-2846</module>
<module>jersey-2878</module>
<module>jersey-2892</module>
+ <module>jersey-3796</module>
<module>jersey-780</module>
+ <module>jersey-3670</module>
+ <module>jersey-3992</module>
+ <module>jersey-4099</module>
<module>portability-jersey-1</module>
<module>portability-jersey-2</module>
<module>property-check</module>
@@ -125,10 +132,11 @@
<module>servlet-request-wrapper-binding</module>
<module>servlet-tests</module>
<module>sonar-test</module>
- <!-- TODO: temporarily removing spring 4 integration test -->
- <!-- TODO: conflict in ASM version (too old) of jetty plugin -->
- <!--<module>spring4</module>-->
+ <module>spring4</module>
<module>tracing-support</module>
+ <module>microprofile/config/helidon</module>
+ <module>microprofile/config/webapp</module>
+ <module>microprofile/rest-client</module>
</modules>
<profiles>
diff --git a/tests/integration/portability-jersey-1/pom.xml b/tests/integration/portability-jersey-1/pom.xml
index e3167d7..0632d73 100644
--- a/tests/integration/portability-jersey-1/pom.xml
+++ b/tests/integration/portability-jersey-1/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>portability-jersey-1</artifactId>
@@ -84,5 +84,24 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
diff --git a/tests/integration/portability-jersey-2/pom.xml b/tests/integration/portability-jersey-2/pom.xml
index 39491d3..fb673b5 100644
--- a/tests/integration/portability-jersey-2/pom.xml
+++ b/tests/integration/portability-jersey-2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>portability-jersey-2</artifactId>
diff --git a/tests/integration/property-check/pom.xml b/tests/integration/property-check/pom.xml
index 429a30c..cd8e3da 100644
--- a/tests/integration/property-check/pom.xml
+++ b/tests/integration/property-check/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>property-check</artifactId>
diff --git a/tests/integration/property-check/src/test/java/org/glassfish/jersey/tests/integration/propertycheck/PropertyOverlappingCheckTest.java b/tests/integration/property-check/src/test/java/org/glassfish/jersey/tests/integration/propertycheck/PropertyOverlappingCheckTest.java
index ef7072e..9eba3fa 100644
--- a/tests/integration/property-check/src/test/java/org/glassfish/jersey/tests/integration/propertycheck/PropertyOverlappingCheckTest.java
+++ b/tests/integration/property-check/src/test/java/org/glassfish/jersey/tests/integration/propertycheck/PropertyOverlappingCheckTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -62,8 +62,8 @@
* to recognize individual properties.
* </p>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Adam Lindenthal
+ * @author Marek Potociar
*/
public class PropertyOverlappingCheckTest {
diff --git a/tests/integration/security-digest/pom.xml b/tests/integration/security-digest/pom.xml
index 78e7df9..de48090 100644
--- a/tests/integration/security-digest/pom.xml
+++ b/tests/integration/security-digest/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.glassfish.jersey.tests.integration</groupId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>security-digest</artifactId>
diff --git a/tests/integration/servlet-2.5-autodiscovery-1/pom.xml b/tests/integration/servlet-2.5-autodiscovery-1/pom.xml
index 7b1df57..f2e272e 100644
--- a/tests/integration/servlet-2.5-autodiscovery-1/pom.xml
+++ b/tests/integration/servlet-2.5-autodiscovery-1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-autodiscovery-1</artifactId>
diff --git a/tests/integration/servlet-2.5-autodiscovery-2/pom.xml b/tests/integration/servlet-2.5-autodiscovery-2/pom.xml
index ce54a7a..922df68 100644
--- a/tests/integration/servlet-2.5-autodiscovery-2/pom.xml
+++ b/tests/integration/servlet-2.5-autodiscovery-2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-autodiscovery-2</artifactId>
diff --git a/tests/integration/servlet-2.5-filter/pom.xml b/tests/integration/servlet-2.5-filter/pom.xml
index b71c1d8..4974002 100644
--- a/tests/integration/servlet-2.5-filter/pom.xml
+++ b/tests/integration/servlet-2.5-filter/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-filter</artifactId>
@@ -61,4 +61,20 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
diff --git a/tests/integration/servlet-2.5-filter/src/main/java/org/glassfish/jersey/tests/integration/servlet_2_5_filter/MyResource.java b/tests/integration/servlet-2.5-filter/src/main/java/org/glassfish/jersey/tests/integration/servlet_2_5_filter/MyResource.java
index 3f0a802..086915c 100644
--- a/tests/integration/servlet-2.5-filter/src/main/java/org/glassfish/jersey/tests/integration/servlet_2_5_filter/MyResource.java
+++ b/tests/integration/servlet-2.5-filter/src/main/java/org/glassfish/jersey/tests/integration/servlet_2_5_filter/MyResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("myresource")
public class MyResource {
diff --git a/tests/integration/servlet-2.5-filter/src/test/java/org/glassfish/jersey/tests/integration/servlet_2_5_filter/MyResourceITCase.java b/tests/integration/servlet-2.5-filter/src/test/java/org/glassfish/jersey/tests/integration/servlet_2_5_filter/MyResourceITCase.java
index 824a01c..7bff80f 100644
--- a/tests/integration/servlet-2.5-filter/src/test/java/org/glassfish/jersey/tests/integration/servlet_2_5_filter/MyResourceITCase.java
+++ b/tests/integration/servlet-2.5-filter/src/test/java/org/glassfish/jersey/tests/integration/servlet_2_5_filter/MyResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class MyResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-inflector-1/pom.xml b/tests/integration/servlet-2.5-inflector-1/pom.xml
index 133e54e..123b69f 100644
--- a/tests/integration/servlet-2.5-inflector-1/pom.xml
+++ b/tests/integration/servlet-2.5-inflector-1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-inflector-1</artifactId>
diff --git a/tests/integration/servlet-2.5-init-1/pom.xml b/tests/integration/servlet-2.5-init-1/pom.xml
index 7271d36..74fcbec 100644
--- a/tests/integration/servlet-2.5-init-1/pom.xml
+++ b/tests/integration/servlet-2.5-init-1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-init-1</artifactId>
diff --git a/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/ClientUsingResource.java b/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/ClientUsingResource.java
index 0728579..2746461 100644
--- a/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/ClientUsingResource.java
+++ b/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/ClientUsingResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,7 +27,7 @@
/**
* A resource that instantiated & uses JAX-RS/Jersey client to access another resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("viaclient")
public class ClientUsingResource {
diff --git a/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/HelloWorldResource.java b/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/HelloWorldResource.java
index 2ab6f5b..d2c1bbe 100644
--- a/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -29,7 +29,7 @@
import org.glassfish.jersey.servlet.WebConfig;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
*/
@Path("helloworld")
diff --git a/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/MultipleLinksResource.java b/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/MultipleLinksResource.java
index adcafea..e9d4702 100644
--- a/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/MultipleLinksResource.java
+++ b/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/MultipleLinksResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Reproducer for JERSEY-1801. See also E2E {@code LinkTest}.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("links")
public class MultipleLinksResource {
diff --git a/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/Servlet25init1.java b/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/Servlet25init1.java
index b6aec66..10bf9c4 100644
--- a/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/Servlet25init1.java
+++ b/tests/integration/servlet-2.5-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/Servlet25init1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
/**
* JAX-RS application for the Servlet 2.5 initialization test #01.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@ApplicationPath("application_path")
public class Servlet25init1 extends Application {
diff --git a/tests/integration/servlet-2.5-init-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/Servlet25Init1ITCase.java b/tests/integration/servlet-2.5-init-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/Servlet25Init1ITCase.java
index 7ee6968..48324c9 100644
--- a/tests/integration/servlet-2.5-init-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/Servlet25Init1ITCase.java
+++ b/tests/integration/servlet-2.5-init-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_1/Servlet25Init1ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -37,7 +37,7 @@
/**
* Servlet 2.5 initialization test #01.
*
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
*/
public class Servlet25Init1ITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-init-2/pom.xml b/tests/integration/servlet-2.5-init-2/pom.xml
index eb45ebb..977add7 100644
--- a/tests/integration/servlet-2.5-init-2/pom.xml
+++ b/tests/integration/servlet-2.5-init-2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-init-2</artifactId>
diff --git a/tests/integration/servlet-2.5-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_2/HelloWorldResource.java b/tests/integration/servlet-2.5-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_2/HelloWorldResource.java
index 3867cd2..d3fd2f8 100644
--- a/tests/integration/servlet-2.5-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_2/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_2/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-2.5-init-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_2/HelloWorldResourceITCase.java b/tests/integration/servlet-2.5-init-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_2/HelloWorldResourceITCase.java
index 89071b3..6d97207 100644
--- a/tests/integration/servlet-2.5-init-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_2/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-2.5-init-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_2/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-init-3/pom.xml b/tests/integration/servlet-2.5-init-3/pom.xml
index 9df3d79..d66002c 100644
--- a/tests/integration/servlet-2.5-init-3/pom.xml
+++ b/tests/integration/servlet-2.5-init-3/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-init-3</artifactId>
diff --git a/tests/integration/servlet-2.5-init-3/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_3/HelloWorldResource.java b/tests/integration/servlet-2.5-init-3/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_3/HelloWorldResource.java
index 3df9bbe..918b7e0 100644
--- a/tests/integration/servlet-2.5-init-3/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_3/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-init-3/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_3/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-2.5-init-3/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_3/HelloWorldResourceITCase.java b/tests/integration/servlet-2.5-init-3/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_3/HelloWorldResourceITCase.java
index ac2c4fe..b87c539 100644
--- a/tests/integration/servlet-2.5-init-3/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_3/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-2.5-init-3/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_3/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-init-4/pom.xml b/tests/integration/servlet-2.5-init-4/pom.xml
index e84b5c4..e048b4e 100644
--- a/tests/integration/servlet-2.5-init-4/pom.xml
+++ b/tests/integration/servlet-2.5-init-4/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-init-4</artifactId>
diff --git a/tests/integration/servlet-2.5-init-4/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWorldResource.java b/tests/integration/servlet-2.5-init-4/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWorldResource.java
index ebf7b5b..91b685f 100644
--- a/tests/integration/servlet-2.5-init-4/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-init-4/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-2.5-init-4/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWriter.java b/tests/integration/servlet-2.5-init-4/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWriter.java
index 54113d1..25a3d00 100644
--- a/tests/integration/servlet-2.5-init-4/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWriter.java
+++ b/tests/integration/servlet-2.5-init-4/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
import org.glassfish.jersey.message.MessageUtils;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Provider
public class HelloWriter implements MessageBodyWriter<HelloWorldResource.Hello> {
diff --git a/tests/integration/servlet-2.5-init-4/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWorldResourceITCase.java b/tests/integration/servlet-2.5-init-4/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWorldResourceITCase.java
index c16b5ff..1efb844 100644
--- a/tests/integration/servlet-2.5-init-4/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-2.5-init-4/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_4/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-init-5/pom.xml b/tests/integration/servlet-2.5-init-5/pom.xml
index 1911a63..709b107 100644
--- a/tests/integration/servlet-2.5-init-5/pom.xml
+++ b/tests/integration/servlet-2.5-init-5/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-init-5</artifactId>
diff --git a/tests/integration/servlet-2.5-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/HelloWorldResource.java b/tests/integration/servlet-2.5-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/HelloWorldResource.java
index 16003d3..580505a 100644
--- a/tests/integration/servlet-2.5-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("filter_path/helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-2.5-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/Servlet25init5.java b/tests/integration/servlet-2.5-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/Servlet25init5.java
index 272e070..d9e43c7 100644
--- a/tests/integration/servlet-2.5-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/Servlet25init5.java
+++ b/tests/integration/servlet-2.5-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/Servlet25init5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
import javax.ws.rs.core.Application;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@ApplicationPath("application_path")
public class Servlet25init5 extends Application{
diff --git a/tests/integration/servlet-2.5-init-5/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/HelloWorldResourceITCase.java b/tests/integration/servlet-2.5-init-5/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/HelloWorldResourceITCase.java
index 561412a..ab485e1 100644
--- a/tests/integration/servlet-2.5-init-5/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-2.5-init-5/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_5/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-init-6/pom.xml b/tests/integration/servlet-2.5-init-6/pom.xml
index 4fa6294..8805add 100644
--- a/tests/integration/servlet-2.5-init-6/pom.xml
+++ b/tests/integration/servlet-2.5-init-6/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-init-6</artifactId>
diff --git a/tests/integration/servlet-2.5-init-6/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_6/HelloWorldResource.java b/tests/integration/servlet-2.5-init-6/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_6/HelloWorldResource.java
index 0d5c6e3..0e86195 100644
--- a/tests/integration/servlet-2.5-init-6/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_6/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-init-6/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_6/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-2.5-init-6/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_6/HelloWorldResourceITCase.java b/tests/integration/servlet-2.5-init-6/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_6/HelloWorldResourceITCase.java
index e10063f..a8d2c8c 100644
--- a/tests/integration/servlet-2.5-init-6/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_6/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-2.5-init-6/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_6/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-init-7/pom.xml b/tests/integration/servlet-2.5-init-7/pom.xml
index c620162..1969504 100644
--- a/tests/integration/servlet-2.5-init-7/pom.xml
+++ b/tests/integration/servlet-2.5-init-7/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-init-7</artifactId>
diff --git a/tests/integration/servlet-2.5-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_7/HelloWorldResource.java b/tests/integration/servlet-2.5-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_7/HelloWorldResource.java
index 3b924d4..f6e9aee 100644
--- a/tests/integration/servlet-2.5-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_7/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_7/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-2.5-init-7/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_7/HelloWorldResourceITCase.java b/tests/integration/servlet-2.5-init-7/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_7/HelloWorldResourceITCase.java
index b1edf72..c40a8cf 100644
--- a/tests/integration/servlet-2.5-init-7/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_7/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-2.5-init-7/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_7/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-init-8/pom.xml b/tests/integration/servlet-2.5-init-8/pom.xml
index 31b633b..17aee43 100644
--- a/tests/integration/servlet-2.5-init-8/pom.xml
+++ b/tests/integration/servlet-2.5-init-8/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-init-8</artifactId>
diff --git a/tests/integration/servlet-2.5-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWorldResource.java b/tests/integration/servlet-2.5-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWorldResource.java
index ab3917d..8299217 100644
--- a/tests/integration/servlet-2.5-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-2.5-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWriter.java b/tests/integration/servlet-2.5-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWriter.java
index 62dcb6f..f04a47e 100644
--- a/tests/integration/servlet-2.5-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWriter.java
+++ b/tests/integration/servlet-2.5-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -29,7 +29,7 @@
import org.glassfish.jersey.message.MessageUtils;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Provider
public class HelloWriter implements MessageBodyWriter<HelloWorldResource.Hello> {
diff --git a/tests/integration/servlet-2.5-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWorldResourceITCase.java b/tests/integration/servlet-2.5-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWorldResourceITCase.java
index ba304ba..418e5fa 100644
--- a/tests/integration/servlet-2.5-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-2.5-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_25_init_8/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-2.5-mvc-1/pom.xml b/tests/integration/servlet-2.5-mvc-1/pom.xml
index 1a5e3ea..d33473e 100644
--- a/tests/integration/servlet-2.5-mvc-1/pom.xml
+++ b/tests/integration/servlet-2.5-mvc-1/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-mvc-1</artifactId>
@@ -76,4 +76,37 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/BookstoreITCase.java</exclude>
+ <exclude>**/ItemITCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
diff --git a/tests/integration/servlet-2.5-mvc-2/pom.xml b/tests/integration/servlet-2.5-mvc-2/pom.xml
index 52e0803..1ef0da0 100644
--- a/tests/integration/servlet-2.5-mvc-2/pom.xml
+++ b/tests/integration/servlet-2.5-mvc-2/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-mvc-2</artifactId>
@@ -76,4 +76,23 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
diff --git a/tests/integration/servlet-2.5-mvc-3/pom.xml b/tests/integration/servlet-2.5-mvc-3/pom.xml
index 3579374..a0629b1 100644
--- a/tests/integration/servlet-2.5-mvc-3/pom.xml
+++ b/tests/integration/servlet-2.5-mvc-3/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-mvc-3</artifactId>
@@ -76,4 +76,37 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/BookstoreITCase.java</exclude>
+ <exclude>**/ItemITCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
diff --git a/tests/integration/servlet-2.5-reload/pom.xml b/tests/integration/servlet-2.5-reload/pom.xml
index 301b42d..187235c 100644
--- a/tests/integration/servlet-2.5-reload/pom.xml
+++ b/tests/integration/servlet-2.5-reload/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-2.5-reload</artifactId>
diff --git a/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/AnotherResource.java b/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/AnotherResource.java
index 49e28ec..1042e4b 100644
--- a/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/AnotherResource.java
+++ b/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/AnotherResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("another")
public class AnotherResource {
diff --git a/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/HelloWorldResource.java b/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/HelloWorldResource.java
index 2fdcb63..7912918 100644
--- a/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/HelloWorldResource.java
+++ b/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/ReloadResource.java b/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/ReloadResource.java
index e2c1c46..aeb411d 100644
--- a/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/ReloadResource.java
+++ b/tests/integration/servlet-2.5-reload/src/main/java/org/glassfish/jersey/tests/integration/servlet_25_config_reload/ReloadResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
import org.glassfish.jersey.server.ResourceConfig;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("reload")
public class ReloadResource {
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 af22617..6515b8a 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, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -29,7 +29,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class ReloadTestIT extends JerseyTest {
diff --git a/tests/integration/servlet-3-async/pom.xml b/tests/integration/servlet-3-async/pom.xml
index 2890ee4..f3594cf 100644
--- a/tests/integration/servlet-3-async/pom.xml
+++ b/tests/integration/servlet-3-async/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-async</artifactId>
diff --git a/tests/integration/servlet-3-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResource.java b/tests/integration/servlet-3-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResource.java
index 2f96055..e91d67b 100644
--- a/tests/integration/servlet-3-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResource.java
+++ b/tests/integration/servlet-3-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
/**
* Asynchronous servlet-deployed resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("async")
public class AsyncServletResource {
diff --git a/tests/integration/servlet-3-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/Servlet3Async.java b/tests/integration/servlet-3-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/Servlet3Async.java
index 5787a1d..e903da2 100644
--- a/tests/integration/servlet-3-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/Servlet3Async.java
+++ b/tests/integration/servlet-3-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/Servlet3Async.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -25,7 +25,7 @@
/**
* Asynchronous servlet-deployed resource application.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ApplicationPath("/")
public class Servlet3Async extends Application {
diff --git a/tests/integration/servlet-3-async/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResourceITCase.java b/tests/integration/servlet-3-async/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResourceITCase.java
index 6cdfb9a..fb202af 100644
--- a/tests/integration/servlet-3-async/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResourceITCase.java
+++ b/tests/integration/servlet-3-async/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -47,7 +47,7 @@
/**
* Asynchronous servlet-deployed resource test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncServletResourceITCase extends JerseyTest {
private static final Logger LOGGER = Logger.getLogger(AsyncServletResourceITCase.class.getName());
diff --git a/tests/integration/servlet-3-chunked-io/pom.xml b/tests/integration/servlet-3-chunked-io/pom.xml
index 0aa797f..1044631 100644
--- a/tests/integration/servlet-3-chunked-io/pom.xml
+++ b/tests/integration/servlet-3-chunked-io/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-chunked-io</artifactId>
diff --git a/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/App.java b/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/App.java
index 2495c51..7a1ca31 100644
--- a/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/App.java
+++ b/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Chunked I/O test JAX-RS application class.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ApplicationPath("resources")
public class App extends ResourceConfig {
diff --git a/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/Message.java b/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/Message.java
index e8b3304..f19740a 100644
--- a/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/Message.java
+++ b/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/Message.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
/**
* Message POJO.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
diff --git a/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/TestResource.java b/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/TestResource.java
index 6069a99..60a31c5 100644
--- a/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/TestResource.java
+++ b/tests/integration/servlet-3-chunked-io/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/TestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -35,7 +35,7 @@
/**
* Test resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("/test")
public class TestResource {
diff --git a/tests/integration/servlet-3-chunked-io/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/ChunkedInputOutputITCase.java b/tests/integration/servlet-3-chunked-io/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/ChunkedInputOutputITCase.java
index 40d57af..e71406d 100644
--- a/tests/integration/servlet-3-chunked-io/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/ChunkedInputOutputITCase.java
+++ b/tests/integration/servlet-3-chunked-io/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_chunked_io/ChunkedInputOutputITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -41,7 +41,7 @@
/**
* Chunked I/O integration tests.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class ChunkedInputOutputITCase extends JerseyTest {
diff --git a/tests/integration/servlet-3-filter/pom.xml b/tests/integration/servlet-3-filter/pom.xml
index 841ca0a..c542caa 100644
--- a/tests/integration/servlet-3-filter/pom.xml
+++ b/tests/integration/servlet-3-filter/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-filter</artifactId>
@@ -61,4 +61,19 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
diff --git a/tests/integration/servlet-3-filter/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_filter/MyResource.java b/tests/integration/servlet-3-filter/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_filter/MyResource.java
index ca3c3a7..c071afe 100644
--- a/tests/integration/servlet-3-filter/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_filter/MyResource.java
+++ b/tests/integration/servlet-3-filter/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_filter/MyResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Path("myresource")
public class MyResource {
diff --git a/tests/integration/servlet-3-filter/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_filter/MyResourceITCase.java b/tests/integration/servlet-3-filter/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_filter/MyResourceITCase.java
index 226ac74..e3eb454 100644
--- a/tests/integration/servlet-3-filter/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_filter/MyResourceITCase.java
+++ b/tests/integration/servlet-3-filter/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_filter/MyResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class MyResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-3-gf-async/pom.xml b/tests/integration/servlet-3-gf-async/pom.xml
index a516fe7..e159778 100644
--- a/tests/integration/servlet-3-gf-async/pom.xml
+++ b/tests/integration/servlet-3-gf-async/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-gf-async</artifactId>
diff --git a/tests/integration/servlet-3-gf-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResource.java b/tests/integration/servlet-3-gf-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResource.java
index 3cd45ec..51041ee 100644
--- a/tests/integration/servlet-3-gf-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResource.java
+++ b/tests/integration/servlet-3-gf-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -32,7 +32,7 @@
/**
* Asynchronous servlet-deployed resource.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("async")
public class AsyncServletResource {
diff --git a/tests/integration/servlet-3-gf-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/Servlet3Async.java b/tests/integration/servlet-3-gf-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/Servlet3Async.java
index c0be482..abb6463 100644
--- a/tests/integration/servlet-3-gf-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/Servlet3Async.java
+++ b/tests/integration/servlet-3-gf-async/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_async/Servlet3Async.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -25,7 +25,7 @@
/**
* Asynchronous servlet-deployed resource application.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ApplicationPath("/")
public class Servlet3Async extends Application {
diff --git a/tests/integration/servlet-3-gf-async/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResourceTest.java b/tests/integration/servlet-3-gf-async/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResourceTest.java
index 69ac18f..3656086 100644
--- a/tests/integration/servlet-3-gf-async/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResourceTest.java
+++ b/tests/integration/servlet-3-gf-async/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_async/AsyncServletResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -49,7 +49,7 @@
/**
* Asynchronous servlet-deployed resource test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
public class AsyncServletResourceTest extends JerseyTest {
diff --git a/tests/integration/servlet-3-inflector-1/pom.xml b/tests/integration/servlet-3-inflector-1/pom.xml
index eee5a4d..a30db96 100644
--- a/tests/integration/servlet-3-inflector-1/pom.xml
+++ b/tests/integration/servlet-3-inflector-1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-inflector-1</artifactId>
diff --git a/tests/integration/servlet-3-init-1/pom.xml b/tests/integration/servlet-3-init-1/pom.xml
index cd02dc4..c46fdde 100644
--- a/tests/integration/servlet-3-init-1/pom.xml
+++ b/tests/integration/servlet-3-init-1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-1</artifactId>
diff --git a/tests/integration/servlet-3-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/HelloWorldResource.java b/tests/integration/servlet-3-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/HelloWorldResource.java
index ea4d55f..3a27b16 100644
--- a/tests/integration/servlet-3-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/HelloWorldResource.java
+++ b/tests/integration/servlet-3-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-3-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/Servlet3init1.java b/tests/integration/servlet-3-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/Servlet3init1.java
index 13b7c88..61f84ac 100644
--- a/tests/integration/servlet-3-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/Servlet3init1.java
+++ b/tests/integration/servlet-3-init-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/Servlet3init1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
import java.util.Set;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@ApplicationPath("/")
public class Servlet3init1 extends Application {
diff --git a/tests/integration/servlet-3-init-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/HelloWorldResourceITCase.java b/tests/integration/servlet-3-init-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/HelloWorldResourceITCase.java
index b2edbf7..bbfb9a9 100644
--- a/tests/integration/servlet-3-init-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-3-init-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_1/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -30,7 +30,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-3-init-2/pom.xml b/tests/integration/servlet-3-init-2/pom.xml
index 356d41a..bee31fc 100644
--- a/tests/integration/servlet-3-init-2/pom.xml
+++ b/tests/integration/servlet-3-init-2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-2</artifactId>
diff --git a/tests/integration/servlet-3-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/HelloWorldResource.java b/tests/integration/servlet-3-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/HelloWorldResource.java
index 27b3797..b919efd 100644
--- a/tests/integration/servlet-3-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/HelloWorldResource.java
+++ b/tests/integration/servlet-3-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-3-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/Servlet3init2.java b/tests/integration/servlet-3-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/Servlet3init2.java
index 011254f..387839d 100644
--- a/tests/integration/servlet-3-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/Servlet3init2.java
+++ b/tests/integration/servlet-3-init-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/Servlet3init2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
import org.glassfish.jersey.server.ResourceConfig;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Michal Gajdos
*/
@ApplicationPath("/")
diff --git a/tests/integration/servlet-3-init-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/HelloWorldResourceITCase.java b/tests/integration/servlet-3-init-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/HelloWorldResourceITCase.java
index c0fbdb0..fd8388f 100644
--- a/tests/integration/servlet-3-init-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-3-init-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_2/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
* @author Martin Matula
* @author Michal Gajdos
*/
diff --git a/tests/integration/servlet-3-init-3/pom.xml b/tests/integration/servlet-3-init-3/pom.xml
index 64762a2..465dfb0 100644
--- a/tests/integration/servlet-3-init-3/pom.xml
+++ b/tests/integration/servlet-3-init-3/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-3</artifactId>
diff --git a/tests/integration/servlet-3-init-4/pom.xml b/tests/integration/servlet-3-init-4/pom.xml
index bf25f7a..2fc2788 100644
--- a/tests/integration/servlet-3-init-4/pom.xml
+++ b/tests/integration/servlet-3-init-4/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-4</artifactId>
diff --git a/tests/integration/servlet-3-init-5/pom.xml b/tests/integration/servlet-3-init-5/pom.xml
index 09f1268..51a9cee 100644
--- a/tests/integration/servlet-3-init-5/pom.xml
+++ b/tests/integration/servlet-3-init-5/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-5</artifactId>
diff --git a/tests/integration/servlet-3-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWorldResource.java b/tests/integration/servlet-3-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWorldResource.java
index 91d8093..acca41d 100644
--- a/tests/integration/servlet-3-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWorldResource.java
+++ b/tests/integration/servlet-3-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,8 +21,8 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Libor Kramolis
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-3-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWriter.java b/tests/integration/servlet-3-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWriter.java
index d70573a..8c27f42 100644
--- a/tests/integration/servlet-3-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWriter.java
+++ b/tests/integration/servlet-3-init-5/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,8 +30,8 @@
import org.glassfish.jersey.message.MessageUtils;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Libor Kramolis
*/
@Provider
public class HelloWriter implements MessageBodyWriter<HelloWorldResource.Hello> {
diff --git a/tests/integration/servlet-3-init-5/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWorldResourceITCase.java b/tests/integration/servlet-3-init-5/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWorldResourceITCase.java
index af14376..0eaa27d 100644
--- a/tests/integration/servlet-3-init-5/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-3-init-5/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_5/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,8 +27,8 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Libor Kramolis
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-3-init-6/pom.xml b/tests/integration/servlet-3-init-6/pom.xml
index 30f9da1..7bab711 100644
--- a/tests/integration/servlet-3-init-6/pom.xml
+++ b/tests/integration/servlet-3-init-6/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-6</artifactId>
diff --git a/tests/integration/servlet-3-init-7/pom.xml b/tests/integration/servlet-3-init-7/pom.xml
index 69e1eaa..52ee5f0 100644
--- a/tests/integration/servlet-3-init-7/pom.xml
+++ b/tests/integration/servlet-3-init-7/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-7</artifactId>
diff --git a/tests/integration/servlet-3-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWorldResource.java b/tests/integration/servlet-3-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWorldResource.java
index acaaf92..71e237a 100644
--- a/tests/integration/servlet-3-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWorldResource.java
+++ b/tests/integration/servlet-3-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,8 +21,8 @@
import javax.ws.rs.Produces;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Libor Kramolis
*/
@Path("helloworld")
public class HelloWorldResource {
diff --git a/tests/integration/servlet-3-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWriter.java b/tests/integration/servlet-3-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWriter.java
index 3e9898f..ed74936 100644
--- a/tests/integration/servlet-3-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWriter.java
+++ b/tests/integration/servlet-3-init-7/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,8 +28,8 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Libor Kramolis
*/
@Provider
public class HelloWriter implements MessageBodyWriter<HelloWorldResource.Hello> {
diff --git a/tests/integration/servlet-3-init-7/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWorldResourceITCase.java b/tests/integration/servlet-3-init-7/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWorldResourceITCase.java
index 43f36e3..4955e48 100644
--- a/tests/integration/servlet-3-init-7/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-3-init-7/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_7/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -27,8 +27,8 @@
import static org.junit.Assert.assertTrue;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Libor Kramolis
*/
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-3-init-8/pom.xml b/tests/integration/servlet-3-init-8/pom.xml
index dbe9bcf..f984c29 100644
--- a/tests/integration/servlet-3-init-8/pom.xml
+++ b/tests/integration/servlet-3-init-8/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-8</artifactId>
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld1Resource.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld1Resource.java
index 5604139..1ab4152 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld1Resource.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld1Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld1")
public class HelloWorld1Resource {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld2Resource.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld2Resource.java
index cba1bdd..0387d7c 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld2Resource.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld2Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld2")
public class HelloWorld2Resource {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld3Resource.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld3Resource.java
index 010ae62..2f0f9d1 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld3Resource.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld3Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld3")
public class HelloWorld3Resource {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld4Resource.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld4Resource.java
index 82936a1..43bda46 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld4Resource.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorld4Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.Produces;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld4")
public class HelloWorld4Resource {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App1.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App1.java
index e32c718..c7aeadb 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App1.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
* It means {@code ApplicationPath.value} ({@code /app1ann}) is overridden using a {@code servlet-mapping} element.
* The application also explicitly register JAX-RS resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath("/app1ann")
public class Servlet3Init8App1 extends Application {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App2.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App2.java
index 1ca6ecf..d0e000c 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App2.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
* It means {@code ApplicationPath.value} ({@code /app2ann}) is used as base servlet URI.
* The application also explicitly register JAX-RS resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath("/app2ann")
public class Servlet3Init8App2 extends Application {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App3.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App3.java
index c7163e1..6a465be 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App3.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App3.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
* It means {@code ApplicationPath.value} ({@code /app3ann}) is used as base servlet URI.
* The application also explicitly register JAX-RS resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath("/app3ann")
public class Servlet3Init8App3 extends Application {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App4.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App4.java
index 9a3667c..d201a62 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App4.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App4.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
* And there is no {@code ApplicationPath} annotation on the class.
* The application also explicitly register JAX-RS resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Servlet3Init8App4 extends Application {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App5.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App5.java
index b1f2ea8..eb67579 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App5.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/Servlet3Init8App5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
* And there is no {@code ApplicationPath} annotation on the class.
* The application does NOT explicitly register any JAX-RS resource. All available resources are automatically registered.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Servlet3Init8App5 extends Application {
diff --git a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/UnreachableResource.java b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/UnreachableResource.java
index 99f9710..b7e504c 100644
--- a/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/UnreachableResource.java
+++ b/tests/integration/servlet-3-init-8/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/UnreachableResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.core.Response;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("unreachable")
public class UnreachableResource {
diff --git a/tests/integration/servlet-3-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorldResourceITCase.java b/tests/integration/servlet-3-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorldResourceITCase.java
index 0955681..ba14d28 100644
--- a/tests/integration/servlet-3-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorldResourceITCase.java
+++ b/tests/integration/servlet-3-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorldResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -37,7 +37,7 @@
/**
* Test reachable resources.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@RunWith(Parameterized.class)
public class HelloWorldResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-3-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorldResourceUnreachableITCase.java b/tests/integration/servlet-3-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorldResourceUnreachableITCase.java
index 914687d..4a2b21c 100644
--- a/tests/integration/servlet-3-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorldResourceUnreachableITCase.java
+++ b/tests/integration/servlet-3-init-8/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_8/HelloWorldResourceUnreachableITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -37,7 +37,7 @@
/**
* Test unreachable resources.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@RunWith(Parameterized.class)
public class HelloWorldResourceUnreachableITCase extends JerseyTest {
diff --git a/tests/integration/servlet-3-init-provider/pom.xml b/tests/integration/servlet-3-init-provider/pom.xml
index cfce621..12802f5 100644
--- a/tests/integration/servlet-3-init-provider/pom.xml
+++ b/tests/integration/servlet-3-init-provider/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-init-provider</artifactId>
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/AbstractHelloWorldResource.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/AbstractHelloWorldResource.java
index 489a50b..f8ae09e 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/AbstractHelloWorldResource.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/AbstractHelloWorldResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +20,7 @@
import javax.ws.rs.Produces;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public abstract class AbstractHelloWorldResource {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application1.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application1.java
index 8316b40..d521752 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application1.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.core.Application;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Application1 extends Application {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application2.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application2.java
index 89f1683..dc3f33c 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application2.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.core.Application;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Application2 extends Application {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application3.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application3.java
index 20932c5..46d2213 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application3.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application3.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.core.Application;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Application3 extends Application {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application4.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application4.java
index e89767d..60823f9 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application4.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/Application4.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.core.Application;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath("/application4/*")
public class Application4 extends Application {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld1Resource.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld1Resource.java
index 9ffd315..07fd20f 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld1Resource.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld1Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
import javax.ws.rs.PathParam;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld1")
public class HelloWorld1Resource extends AbstractHelloWorldResource {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld2Resource.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld2Resource.java
index 99cc572..0787cca 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld2Resource.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld2Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.ws.rs.Path;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld2")
public class HelloWorld2Resource extends AbstractHelloWorldResource {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld3Resource.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld3Resource.java
index 9f510e0..c4979cc 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld3Resource.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld3Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +20,7 @@
import javax.ws.rs.Path;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld3")
public class HelloWorld3Resource extends AbstractHelloWorldResource {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld4Resource.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld4Resource.java
index f8db2e3..0b662b2 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld4Resource.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld4Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import javax.ws.rs.Path;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld4")
public class HelloWorld4Resource extends AbstractHelloWorldResource {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld5Resource.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld5Resource.java
index aa8350a..0c88162 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld5Resource.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld5Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
import java.util.Enumeration;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("helloworld5")
public class HelloWorld5Resource extends AbstractHelloWorldResource {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWriter.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWriter.java
index cb061cd..d40f44b 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWriter.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -31,8 +31,8 @@
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Pavel Bucek
+ * @author Libor Kramolis
*/
@Provider
public class HelloWriter implements MessageBodyWriter<AbstractHelloWorldResource.Hello> {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestContainerLifecycleListener.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestContainerLifecycleListener.java
index e8a1b0e..f86920a 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestContainerLifecycleListener.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestContainerLifecycleListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,7 +27,7 @@
* This is just test purpose implementation of Jersey SPI {@link ContainerLifecycleListener}.
* The listener class is registered in {@link TestServletContainerProvider} to {@link ResourceConfig}.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class TestContainerLifecycleListener implements ContainerLifecycleListener {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestFilter.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestFilter.java
index 27093c3..1ee7dbd 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestFilter.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -31,7 +31,7 @@
* Servlet.
* The filter class is added in {@link TestServletContainerProvider}.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class TestFilter implements Filter {
diff --git a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestServletContainerProvider.java b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestServletContainerProvider.java
index abe1a50..241c166 100644
--- a/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestServletContainerProvider.java
+++ b/tests/integration/servlet-3-init-provider/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/TestServletContainerProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* This is just test purpose implementation of Jersey internal SPI {@link ServletContainerProvider}.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class TestServletContainerProvider implements ServletContainerProvider {
diff --git a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/AbstractHelloWorldResourceTest.java b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/AbstractHelloWorldResourceTest.java
index fec1830..259dd8d 100644
--- a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/AbstractHelloWorldResourceTest.java
+++ b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/AbstractHelloWorldResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
import javax.ws.rs.NotFoundException;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public abstract class AbstractHelloWorldResourceTest extends JerseyTest {
diff --git a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld1ResourceITCase.java b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld1ResourceITCase.java
index 1299390..ef833d1 100644
--- a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld1ResourceITCase.java
+++ b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld1ResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import org.junit.Test;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class HelloWorld1ResourceITCase extends AbstractHelloWorldResourceTest {
diff --git a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld2ResourceITCase.java b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld2ResourceITCase.java
index e38ac59..d4d1269 100644
--- a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld2ResourceITCase.java
+++ b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld2ResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.tests.integration.servlet_3_init_provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class HelloWorld2ResourceITCase extends AbstractHelloWorldResourceTest {
diff --git a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld3ResourceITCase.java b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld3ResourceITCase.java
index 6a16e46..27f7b64 100644
--- a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld3ResourceITCase.java
+++ b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld3ResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.client.WebTarget;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class HelloWorld3ResourceITCase extends AbstractHelloWorldResourceTest {
diff --git a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld4ResourceITCase.java b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld4ResourceITCase.java
index 9d39e25..d393170 100644
--- a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld4ResourceITCase.java
+++ b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld4ResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.core.Response;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class HelloWorld4ResourceITCase extends AbstractHelloWorldResourceTest {
diff --git a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld5ResourceITCase.java b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld5ResourceITCase.java
index 81dae7b..ab50349 100644
--- a/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld5ResourceITCase.java
+++ b/tests/integration/servlet-3-init-provider/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_init_provider/HelloWorld5ResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +20,7 @@
import org.junit.Test;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class HelloWorld5ResourceITCase extends AbstractHelloWorldResourceTest {
diff --git a/tests/integration/servlet-3-params/pom.xml b/tests/integration/servlet-3-params/pom.xml
index 496bc0b..377d77e 100644
--- a/tests/integration/servlet-3-params/pom.xml
+++ b/tests/integration/servlet-3-params/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-params</artifactId>
diff --git a/tests/integration/servlet-3-params/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_params/CustomContextListener.java b/tests/integration/servlet-3-params/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_params/CustomContextListener.java
index 82a54c8..a726339 100644
--- a/tests/integration/servlet-3-params/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_params/CustomContextListener.java
+++ b/tests/integration/servlet-3-params/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_params/CustomContextListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
import javax.servlet.annotation.WebListener;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@WebListener
public class CustomContextListener implements ServletContextListener {
diff --git a/tests/integration/servlet-3-params/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_params/ParamResource.java b/tests/integration/servlet-3-params/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_params/ParamResource.java
index 79ef7a8..40a2977 100644
--- a/tests/integration/servlet-3-params/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_params/ParamResource.java
+++ b/tests/integration/servlet-3-params/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_params/ParamResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
import javax.ws.rs.core.Context;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
@Path("params")
public class ParamResource {
diff --git a/tests/integration/servlet-3-params/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_params/ParamsTestITCase.java b/tests/integration/servlet-3-params/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_params/ParamsTestITCase.java
index 5dc4151..cf00cc1 100644
--- a/tests/integration/servlet-3-params/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_params/ParamsTestITCase.java
+++ b/tests/integration/servlet-3-params/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_params/ParamsTestITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Pavel Bucek
*/
public class ParamsTestITCase extends JerseyTest {
@Override
diff --git a/tests/integration/servlet-3-sse-1/pom.xml b/tests/integration/servlet-3-sse-1/pom.xml
index ab51ac1..f930eb2 100644
--- a/tests/integration/servlet-3-sse-1/pom.xml
+++ b/tests/integration/servlet-3-sse-1/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-3-sse-1</artifactId>
diff --git a/tests/integration/servlet-3-sse-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreApp.java b/tests/integration/servlet-3-sse-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreApp.java
index 3e37025..85befa9 100644
--- a/tests/integration/servlet-3-sse-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreApp.java
+++ b/tests/integration/servlet-3-sse-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* SSE item store JAX-RS application class.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@ApplicationPath("resources")
public class ItemStoreApp extends ResourceConfig {
diff --git a/tests/integration/servlet-3-sse-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreResource.java b/tests/integration/servlet-3-sse-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreResource.java
index dbbb285..6d8fe8f 100644
--- a/tests/integration/servlet-3-sse-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreResource.java
+++ b/tests/integration/servlet-3-sse-1/src/main/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,7 +42,7 @@
/**
* A resource for storing named items.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Path("items")
public class ItemStoreResource {
diff --git a/tests/integration/servlet-3-sse-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreResourceITCase.java b/tests/integration/servlet-3-sse-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreResourceITCase.java
index 70bdd76..63ca57b 100644
--- a/tests/integration/servlet-3-sse-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreResourceITCase.java
+++ b/tests/integration/servlet-3-sse-1/src/test/java/org/glassfish/jersey/tests/integration/servlet_3_sse_1/ItemStoreResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -61,7 +61,7 @@
/**
* Item store test.
*
- * @author Marek Potociar (marek.potociar at oracle.com)
+ * @author Marek Potociar
*/
@Ignore
public class ItemStoreResourceITCase extends JerseyTest {
diff --git a/tests/integration/servlet-request-wrapper-binding-2/pom.xml b/tests/integration/servlet-request-wrapper-binding-2/pom.xml
index 2b4c729..2b19ba6 100644
--- a/tests/integration/servlet-request-wrapper-binding-2/pom.xml
+++ b/tests/integration/servlet-request-wrapper-binding-2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-request-wrappper-binding-2</artifactId>
diff --git a/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/JaxRsApplicationAutodetected.java b/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/JaxRsApplicationAutodetected.java
index fe3f465..368be71 100644
--- a/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/JaxRsApplicationAutodetected.java
+++ b/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/JaxRsApplicationAutodetected.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
/**
* Test application. This one gets registered automatically.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("autodetected")
public class JaxRsApplicationAutodetected extends Application {
diff --git a/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseInjectedResource.java b/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseInjectedResource.java
index 47370b8..67a2cef 100644
--- a/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseInjectedResource.java
+++ b/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -33,7 +33,7 @@
* {@link HttpServletResponse} instance, so that we could testify custom implementations
* has been used there.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
public class RequestResponseInjectedResource {
diff --git a/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseInjectedSingletonResource.java b/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseInjectedSingletonResource.java
index f916f7e..7af3b31 100644
--- a/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseInjectedSingletonResource.java
+++ b/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseInjectedSingletonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
* {@link HttpServletResponse} instance, so that we could testify custom implementations
* has been used there.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/singleton")
@Singleton
diff --git a/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseWrapperProvider.java b/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseWrapperProvider.java
index e2afcf1..29d5741 100644
--- a/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseWrapperProvider.java
+++ b/tests/integration/servlet-request-wrapper-binding-2/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding2/RequestResponseWrapperProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -83,7 +83,7 @@
* The request wrapper contains a direct reference to the underlying container request
* in case it gets injected into a request scoped component.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class RequestResponseWrapperProvider extends NoOpServletContainerProvider {
diff --git a/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/AbstractRequestResponseTypeTest.java b/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/AbstractRequestResponseTypeTest.java
index 5631450..9756521 100644
--- a/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/AbstractRequestResponseTypeTest.java
+++ b/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/AbstractRequestResponseTypeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -32,7 +32,7 @@
* Make sure that injected request/response instances
* are of the types injected by {@link RequestResponseWrapperProvider}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public abstract class AbstractRequestResponseTypeTest extends JerseyTest {
diff --git a/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/AutodetectedAppRequestResponseTypeITCase.java b/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/AutodetectedAppRequestResponseTypeITCase.java
index 13a6063..88bf864 100644
--- a/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/AutodetectedAppRequestResponseTypeITCase.java
+++ b/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/AutodetectedAppRequestResponseTypeITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test for the autodetected JAX-RS app.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class AutodetectedAppRequestResponseTypeITCase extends AbstractRequestResponseTypeTest {
diff --git a/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/WebXmlConfiguredAppRequestResponseTypeITCase.java b/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/WebXmlConfiguredAppRequestResponseTypeITCase.java
index 9a028dc..5fec570 100644
--- a/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/WebXmlConfiguredAppRequestResponseTypeITCase.java
+++ b/tests/integration/servlet-request-wrapper-binding-2/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper2/WebXmlConfiguredAppRequestResponseTypeITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test for the web.xml configured JAX-RS app.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class WebXmlConfiguredAppRequestResponseTypeITCase extends AbstractRequestResponseTypeTest {
diff --git a/tests/integration/servlet-request-wrapper-binding/pom.xml b/tests/integration/servlet-request-wrapper-binding/pom.xml
index 73e8409..1f28c14 100644
--- a/tests/integration/servlet-request-wrapper-binding/pom.xml
+++ b/tests/integration/servlet-request-wrapper-binding/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-request-wrappper-binding</artifactId>
diff --git a/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/JaxRsApplicationAutodetected.java b/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/JaxRsApplicationAutodetected.java
index 1fe4126..70ad5d4 100644
--- a/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/JaxRsApplicationAutodetected.java
+++ b/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/JaxRsApplicationAutodetected.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -25,7 +25,7 @@
/**
* Test application. This one gets registered automatically.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@ApplicationPath("autodetected")
public class JaxRsApplicationAutodetected extends Application {
diff --git a/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/RequestResponseInjectedResource.java b/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/RequestResponseInjectedResource.java
index 54cc690..a2081d7 100644
--- a/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/RequestResponseInjectedResource.java
+++ b/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/RequestResponseInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
* {@link HttpServletResponse} instance, so that we could testify custom implementations
* has been used there.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
public class RequestResponseInjectedResource {
diff --git a/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/RequestResponseWrapperProvider.java b/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/RequestResponseWrapperProvider.java
index 09f40a7..28a18bf 100644
--- a/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/RequestResponseWrapperProvider.java
+++ b/tests/integration/servlet-request-wrapper-binding/src/main/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper_binding/RequestResponseWrapperProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
/**
* Servlet container provider that wraps the original Servlet request/response.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class RequestResponseWrapperProvider extends NoOpServletContainerProvider {
diff --git a/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/AbstractRequestResponseTypeTest.java b/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/AbstractRequestResponseTypeTest.java
index 4f4710d..29cda9d 100644
--- a/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/AbstractRequestResponseTypeTest.java
+++ b/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/AbstractRequestResponseTypeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -32,7 +32,7 @@
* Make sure that injected request/response instances
* are of the types injected by {@link RequestResponseWrapperProvider}.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public abstract class AbstractRequestResponseTypeTest extends JerseyTest {
diff --git a/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/AutodetectedAppRequestResponseTypeITCase.java b/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/AutodetectedAppRequestResponseTypeITCase.java
index 7b7403a..d9db848 100644
--- a/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/AutodetectedAppRequestResponseTypeITCase.java
+++ b/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/AutodetectedAppRequestResponseTypeITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test for the autodetected JAX-RS app.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class AutodetectedAppRequestResponseTypeITCase extends AbstractRequestResponseTypeTest {
diff --git a/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/WebXmlConfiguredAppRequestResponseTypeITCase.java b/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/WebXmlConfiguredAppRequestResponseTypeITCase.java
index f6a85ad..5e32c0e 100644
--- a/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/WebXmlConfiguredAppRequestResponseTypeITCase.java
+++ b/tests/integration/servlet-request-wrapper-binding/src/test/java/org/glassfish/jersey/tests/integration/servlet_request_wrapper/WebXmlConfiguredAppRequestResponseTypeITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test for the web.xml configured JAX-RS app.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class WebXmlConfiguredAppRequestResponseTypeITCase extends AbstractRequestResponseTypeTest {
diff --git a/tests/integration/servlet-tests/pom.xml b/tests/integration/servlet-tests/pom.xml
index 5d8594b..7f00095 100644
--- a/tests/integration/servlet-tests/pom.xml
+++ b/tests/integration/servlet-tests/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2019 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
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>servlet-tests</artifactId>
@@ -62,7 +62,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
- <groupId>org.mortbay.jetty</groupId>
+ <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
</plugin>
</plugins>
diff --git a/tests/integration/servlet-tests/src/main/java/org/glassfish/jersey/tests/integration/servlettests/SuppressContentLengthFilter.java b/tests/integration/servlet-tests/src/main/java/org/glassfish/jersey/tests/integration/servlettests/SuppressContentLengthFilter.java
index abb2ac6..11f1ff2 100644
--- a/tests/integration/servlet-tests/src/main/java/org/glassfish/jersey/tests/integration/servlettests/SuppressContentLengthFilter.java
+++ b/tests/integration/servlet-tests/src/main/java/org/glassfish/jersey/tests/integration/servlettests/SuppressContentLengthFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* JERSEY-2936 reproducer filter.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class SuppressContentLengthFilter implements Filter {
diff --git a/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/CacheControlOn404ITCase.java b/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/CacheControlOn404ITCase.java
index 5697e39..2152927 100644
--- a/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/CacheControlOn404ITCase.java
+++ b/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/CacheControlOn404ITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -35,7 +35,7 @@
* headers don't get reset by the container.
*
* @author Martin Matula
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class CacheControlOn404ITCase extends JerseyTest {
diff --git a/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/Custom404MediaTypeITCase.java b/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/Custom404MediaTypeITCase.java
index 619d5ba..2912243 100644
--- a/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/Custom404MediaTypeITCase.java
+++ b/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/Custom404MediaTypeITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* @author Miroslav Fuksa
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Custom404MediaTypeITCase extends JerseyTest {
diff --git a/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/DuplicateHeaderITCase.java b/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/DuplicateHeaderITCase.java
index 2856ecb..4de9039 100644
--- a/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/DuplicateHeaderITCase.java
+++ b/tests/integration/servlet-tests/src/test/java/org/glassfish/jersey/tests/integration/servlettests/DuplicateHeaderITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class DuplicateHeaderITCase extends JerseyTest {
@Override
diff --git a/tests/integration/sonar-test/pom.xml b/tests/integration/sonar-test/pom.xml
index 0d7c6f0..08b1f32 100644
--- a/tests/integration/sonar-test/pom.xml
+++ b/tests/integration/sonar-test/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>sonar-test</artifactId>
diff --git a/tests/integration/sonar-test/src/main/java/org/glassfish/jersey/tests/integration/sonar/TestApplication.java b/tests/integration/sonar-test/src/main/java/org/glassfish/jersey/tests/integration/sonar/TestApplication.java
index d5b67e7..c600c29 100644
--- a/tests/integration/sonar-test/src/main/java/org/glassfish/jersey/tests/integration/sonar/TestApplication.java
+++ b/tests/integration/sonar-test/src/main/java/org/glassfish/jersey/tests/integration/sonar/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
/**
* Jersey application for code coverage testing.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@ApplicationPath("/")
public class TestApplication extends ResourceConfig {
diff --git a/tests/integration/sonar-test/src/main/java/org/glassfish/jersey/tests/integration/sonar/TestResource.java b/tests/integration/sonar-test/src/main/java/org/glassfish/jersey/tests/integration/sonar/TestResource.java
index b8bfaab..4f4a3be 100644
--- a/tests/integration/sonar-test/src/main/java/org/glassfish/jersey/tests/integration/sonar/TestResource.java
+++ b/tests/integration/sonar-test/src/main/java/org/glassfish/jersey/tests/integration/sonar/TestResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
import org.glassfish.jersey.server.internal.sonar.SonarJerseyServer;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/")
@Produces("text/plain")
diff --git a/tests/integration/sonar-test/src/test/java/org/glassfish/jersey/tests/integration/sonar/JerseySonarITCase.java b/tests/integration/sonar-test/src/test/java/org/glassfish/jersey/tests/integration/sonar/JerseySonarITCase.java
index 1c9f078..5f0c654 100644
--- a/tests/integration/sonar-test/src/test/java/org/glassfish/jersey/tests/integration/sonar/JerseySonarITCase.java
+++ b/tests/integration/sonar-test/src/test/java/org/glassfish/jersey/tests/integration/sonar/JerseySonarITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
import org.junit.Test;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class JerseySonarITCase extends JerseyTest {
diff --git a/tests/integration/spring4/pom.xml b/tests/integration/spring4/pom.xml
index 668a299..1d1cdeb 100644
--- a/tests/integration/spring4/pom.xml
+++ b/tests/integration/spring4/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.26-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>spring4</artifactId>
@@ -55,9 +55,22 @@
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring4</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ </exclusions>
<scope>compile</scope>
</dependency>
+ <!-- TODO Use spring-context 4 -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>3.2.16.RELEASE</version>
+ </dependency>
+
<dependency>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>jersey-test-framework-core</artifactId>
@@ -81,7 +94,6 @@
<artifactId>commons-logging</artifactId>
<scope>runtime</scope>
</dependency>
-
</dependencies>
<build>
@@ -95,12 +107,12 @@
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
- <groupId>org.mortbay.jetty</groupId>
+ <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<webApp>
<contextPath>/</contextPath>
- <webInfIncludeJarPattern>.*\.jar$</webInfIncludeJarPattern>
+ <webInfIncludeJarPattern>.*$</webInfIncludeJarPattern>
</webApp>
</configuration>
</plugin>
diff --git a/tests/integration/tracing-support/pom.xml b/tests/integration/tracing-support/pom.xml
index 933bed9..8713e62 100644
--- a/tests/integration/tracing-support/pom.xml
+++ b/tests/integration/tracing-support/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.integration</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>tracing-support</artifactId>
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AllTracingSupport.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AllTracingSupport.java
index f260a39..487625d 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AllTracingSupport.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AllTracingSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
import org.glassfish.jersey.server.TracingConfig;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath("/ALL")
public class AllTracingSupport extends TracingSupport {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AsyncResource.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AsyncResource.java
index 338172c..01b3e09 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AsyncResource.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AsyncResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
import javax.ws.rs.container.Suspended;
/**
-* @author Libor Kramolis (libor.kramolis at oracle.com)
+* @author Libor Kramolis
*/
@Path("/async")
public class AsyncResource {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AsyncSubResource.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AsyncSubResource.java
index 9666448..1e25e43 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AsyncSubResource.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/AsyncSubResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.container.Suspended;
/**
-* @author Libor Kramolis (libor.kramolis at oracle.com)
+* @author Libor Kramolis
*/
@Path("/")
public class AsyncSubResource {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerRequestFilter68.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerRequestFilter68.java
index bbf688a..3a47413 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerRequestFilter68.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerRequestFilter68.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Priority(68)
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerRequestFilterNoPriority.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerRequestFilterNoPriority.java
index 80c095c..69c2318 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerRequestFilterNoPriority.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerRequestFilterNoPriority.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
public class ContainerRequestFilterNoPriority implements ContainerRequestFilter {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerResponseFilter5001.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerResponseFilter5001.java
index f674354..93a27e7 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerResponseFilter5001.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerResponseFilter5001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Priority(5001)
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerResponseFilterNoPriority.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerResponseFilterNoPriority.java
index 381da17..c1183a2 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerResponseFilterNoPriority.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ContainerResponseFilterNoPriority.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
public class ContainerResponseFilterNoPriority implements ContainerResponseFilter {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Message.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Message.java
index b8f4f6a..23c561f 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Message.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Message.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.tests.integration.tracing;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Message {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyReaderGeneric.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyReaderGeneric.java
index 4d93336..d61b7e9 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyReaderGeneric.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyReaderGeneric.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Consumes("*/*")
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyReaderTestFormat.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyReaderTestFormat.java
index 81d0941..338c120 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyReaderTestFormat.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyReaderTestFormat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -33,7 +33,7 @@
import org.glassfish.jersey.message.MessageUtils;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Consumes(Utils.APPLICATION_X_JERSEY_TEST)
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyWriterGeneric.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyWriterGeneric.java
index 4e295ba..e19d869 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyWriterGeneric.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyWriterGeneric.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Produces("*/*")
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyWriterTestFormat.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyWriterTestFormat.java
index 6983d18..981fd63 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyWriterTestFormat.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/MessageBodyWriterTestFormat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -32,7 +32,7 @@
import org.glassfish.jersey.message.MessageUtils;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Produces(Utils.APPLICATION_X_JERSEY_TEST)
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/OnDemandTracingSupport.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/OnDemandTracingSupport.java
index 0a15268..485bd1d 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/OnDemandTracingSupport.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/OnDemandTracingSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
import org.glassfish.jersey.server.TracingConfig;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@ApplicationPath("/ON_DEMAND")
public class OnDemandTracingSupport extends TracingSupport {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/PreMatchingContainerRequestFilter23.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/PreMatchingContainerRequestFilter23.java
index 6cc32a9..9720061 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/PreMatchingContainerRequestFilter23.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/PreMatchingContainerRequestFilter23.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@PreMatching
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/PreMatchingContainerRequestFilter42.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/PreMatchingContainerRequestFilter42.java
index fa83983..e41eebb 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/PreMatchingContainerRequestFilter42.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/PreMatchingContainerRequestFilter42.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@PreMatching
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ReaderInterceptor14.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ReaderInterceptor14.java
index e37971c..0c56770 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ReaderInterceptor14.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ReaderInterceptor14.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
import javax.ws.rs.ext.ReaderInterceptorContext;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Priority(14)
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ReaderInterceptor18.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ReaderInterceptor18.java
index 3d3f444..dc99742 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ReaderInterceptor18.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/ReaderInterceptor18.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
import javax.ws.rs.ext.ReaderInterceptorContext;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Priority(18)
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Resource.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Resource.java
index c13b57d..20a5c5c 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Resource.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Resource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -22,7 +22,7 @@
import javax.ws.rs.PathParam;
/**
-* @author Libor Kramolis (libor.kramolis at oracle.com)
+* @author Libor Kramolis
*/
@Path("/root")
public class Resource {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/SubResource.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/SubResource.java
index b803c3e..5547565 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/SubResource.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/SubResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +20,7 @@
import javax.ws.rs.Path;
/**
-* @author Libor Kramolis (libor.kramolis at oracle.com)
+* @author Libor Kramolis
*/
@Path("/")
public class SubResource {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestException.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestException.java
index 26dccfd..041dd94 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestException.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -17,7 +17,7 @@
package org.glassfish.jersey.tests.integration.tracing;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class TestException extends RuntimeException {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExceptionMapper.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExceptionMapper.java
index 04d6dec..cdd5f2a 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExceptionMapper.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExceptionMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
import javax.ws.rs.ext.Provider;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Priority(Priorities.USER)
@Provider
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExtendedExceptionMapperGeneric.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExtendedExceptionMapperGeneric.java
index 6a0cc9d..ca530ee 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExtendedExceptionMapperGeneric.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExtendedExceptionMapperGeneric.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
import org.glassfish.jersey.spi.ExtendedExceptionMapper;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Priority(Priorities.USER + 1)
@Provider
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExtendedExceptionMapperRuntime.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExtendedExceptionMapperRuntime.java
index 0161b37..9087e75 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExtendedExceptionMapperRuntime.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TestExtendedExceptionMapperRuntime.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -26,7 +26,7 @@
import org.glassfish.jersey.spi.ExtendedExceptionMapper;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Priority(Priorities.USER + 2)
@Provider
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TracingSupport.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TracingSupport.java
index fabb7a2..052c12a 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TracingSupport.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/TracingSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -21,7 +21,7 @@
import org.glassfish.jersey.server.TracingConfig;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class TracingSupport extends ResourceConfig {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Utils.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Utils.java
index aa9b45d..957900c 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Utils.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/Utils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
import org.glassfish.jersey.server.ResourceConfig;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public final class Utils {
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/WriterInterceptor39.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/WriterInterceptor39.java
index f6257db..71005c4 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/WriterInterceptor39.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/WriterInterceptor39.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
import javax.ws.rs.ext.WriterInterceptorContext;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Priority(39)
diff --git a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/WriterInterceptor45.java b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/WriterInterceptor45.java
index a76f13f..691a3b1 100644
--- a/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/WriterInterceptor45.java
+++ b/tests/integration/tracing-support/src/main/java/org/glassfish/jersey/tests/integration/tracing/WriterInterceptor45.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
import javax.ws.rs.ext.WriterInterceptorContext;
/**
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Provider
@Priority(45)
diff --git a/tests/integration/tracing-support/src/test/java/org/glassfish/jersey/tests/integration/tracing/AllTracingSupportITCase.java b/tests/integration/tracing-support/src/test/java/org/glassfish/jersey/tests/integration/tracing/AllTracingSupportITCase.java
index 430789e..0983d00 100644
--- a/tests/integration/tracing-support/src/test/java/org/glassfish/jersey/tests/integration/tracing/AllTracingSupportITCase.java
+++ b/tests/integration/tracing-support/src/test/java/org/glassfish/jersey/tests/integration/tracing/AllTracingSupportITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -43,7 +43,7 @@
/**
* 'ALL' tracing support test that is running in external Jetty container.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@RunWith(Parameterized.class)
public class AllTracingSupportITCase extends JerseyTest {
diff --git a/tests/integration/tracing-support/src/test/java/org/glassfish/jersey/tests/integration/tracing/OnDemandTracingSupportITCase.java b/tests/integration/tracing-support/src/test/java/org/glassfish/jersey/tests/integration/tracing/OnDemandTracingSupportITCase.java
index 05ecceb..6353256 100644
--- a/tests/integration/tracing-support/src/test/java/org/glassfish/jersey/tests/integration/tracing/OnDemandTracingSupportITCase.java
+++ b/tests/integration/tracing-support/src/test/java/org/glassfish/jersey/tests/integration/tracing/OnDemandTracingSupportITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -39,7 +39,7 @@
/**
* 'ON_DEMAND' tracing support test that is running in external Jetty container.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class OnDemandTracingSupportITCase extends JerseyTest {
diff --git a/tests/jmockit/pom.xml b/tests/jmockit/pom.xml
new file mode 100644
index 0000000..9847568
--- /dev/null
+++ b/tests/jmockit/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>project</artifactId>
+ <groupId>org.glassfish.jersey.tests</groupId>
+ <version>2.30-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jersey-tests-jmockit</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-server</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <artifactId>jersey-media-multipart</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jmockit</groupId>
+ <artifactId>jmockit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <artifactId>jersey-media-multipart</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- for convenience reasons, 'argLine' should not be overridden in child poms. if needed, a property should be declared and used here -->
+ <argLine>
+ -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
+ -Xmx${surefire.maxmem.argline}m -Dfile.encoding=UTF8 ${surefire.security.argline}
+ ${surefire.coverage.argline}
+ </argLine>
+ <skipTests>${skip.tests}</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/innerstatic/InnerStaticClass.java b/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/innerstatic/InnerStaticClass.java
new file mode 100644
index 0000000..26d2d3c
--- /dev/null
+++ b/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/innerstatic/InnerStaticClass.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, 2019 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.tests.jmockit.server.innerstatic;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @author Paul Sandoz
+ */
+public class InnerStaticClass {
+
+ @Path("/")
+ public static class PublicClass {
+
+ @GET
+ public String getMe() {
+ return "ME";
+ }
+ }
+
+ @Path("/")
+ private static class PrivateClass {
+
+ @GET
+ public String getMe() {
+ return "ME";
+ }
+ }
+
+ @Path("/")
+ protected static class ProtectedClass {
+
+ @GET
+ public String getMe() {
+ return "ME";
+ }
+ }
+
+ @Path("/")
+ /* package */ static class PackageClass {
+
+ @GET
+ public String getMe() {
+ return "ME";
+ }
+ }
+}
diff --git a/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevel/PackageRootResourceClass.java b/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevel/PackageRootResourceClass.java
new file mode 100644
index 0000000..ffb778e
--- /dev/null
+++ b/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevel/PackageRootResourceClass.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014, 2019 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.tests.jmockit.server.toplevel;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @author Paul Sandoz
+ */
+@Path("/")
+/* package */ class PackageRootResourceClass {
+
+ @GET
+ public String getMe() {
+ return "ME";
+ }
+}
diff --git a/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevel/PublicRootResourceClass.java b/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevel/PublicRootResourceClass.java
new file mode 100644
index 0000000..0fb0238
--- /dev/null
+++ b/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevel/PublicRootResourceClass.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014, 2019 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.tests.jmockit.server.toplevel;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @author Paul Sandoz
+ */
+@Path("/")
+public class PublicRootResourceClass {
+
+ @GET
+ public String getMe() {
+ return "ME";
+ }
+}
diff --git a/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevelinnerstatic/PublicRootResourceInnerStaticClass.java b/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevelinnerstatic/PublicRootResourceInnerStaticClass.java
new file mode 100644
index 0000000..191578b
--- /dev/null
+++ b/tests/jmockit/src/main/java/org/glassfish/jersey/tests/jmockit/server/toplevelinnerstatic/PublicRootResourceInnerStaticClass.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014, 2019 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.tests.jmockit.server.toplevelinnerstatic;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @author Paul Sandoz
+ */
+@Path("/")
+public class PublicRootResourceInnerStaticClass {
+
+ @GET
+ public String getMe() {
+ return "ME";
+ }
+
+ @Path("/")
+ public static class PublicClass {
+
+ @GET
+ public String getMe() {
+ return "ME";
+ }
+ }
+}
diff --git a/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/media/multipart/internal/FormDataMultiPartReaderWriterTest.java b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/media/multipart/internal/FormDataMultiPartReaderWriterTest.java
new file mode 100644
index 0000000..3c99d00
--- /dev/null
+++ b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/media/multipart/internal/FormDataMultiPartReaderWriterTest.java
@@ -0,0 +1,205 @@
+/*
+ * Copyright (c) 2012, 2019 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.tests.jmockit.media.multipart.internal;
+
+import mockit.Expectations;
+import mockit.Mocked;
+import mockit.Verifications;
+import org.glassfish.jersey.media.multipart.BodyPartEntity;
+import org.glassfish.jersey.media.multipart.FormDataBodyPart;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.FormDataMultiPart;
+import org.glassfish.jersey.media.multipart.FormDataParam;
+import org.glassfish.jersey.media.multipart.MultiPartFeature;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.junit.Test;
+import org.jvnet.mimepull.MIMEMessage;
+import org.jvnet.mimepull.MIMEParsingException;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.io.File;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Tests for multipart {@code MessageBodyReader} and {@code MessageBodyWriter} as well as {@code FormDataMultiPart} and {@code
+ * FormDataParam} injections.
+ *
+ * @author Paul Sandoz
+ * @author Michal Gajdos
+ */
+public class FormDataMultiPartReaderWriterTest extends JerseyTest {
+
+ @Override
+ protected Application configure() {
+ return new ResourceConfig()
+ .register(MediaTypeWithBoundaryResource.class)
+ .register(FileResource.class)
+ .register(new MultiPartFeature());
+ }
+
+ @Path("/MediaTypeWithBoundaryResource")
+ public static class MediaTypeWithBoundaryResource {
+
+ @PUT
+ @Consumes("multipart/form-data")
+ @Produces("text/plain")
+ public String get(
+ @Context final HttpHeaders h,
+ @FormDataParam("submit") final String s) {
+ final String b = h.getMediaType().getParameters().get("boundary");
+ assertEquals("XXXX_YYYY", b);
+ return s;
+ }
+
+ }
+
+
+ @Path("/FileResource")
+ @Consumes("multipart/form-data")
+ @Produces("text/plain")
+ public static class FileResource {
+
+ @POST
+ @Path("InjectedFileNotCopied")
+ public String injectedFileNotCopied(@FormDataParam("file") final File file) {
+ final String path = file.getAbsolutePath();
+ //noinspection ResultOfMethodCallIgnored
+ file.delete();
+ return path;
+ }
+
+ @POST
+ @Path("ExceptionInMethod")
+ public String exceptionInMethod(@FormDataParam("file") final File file) {
+ throw new WebApplicationException(Response.serverError().entity(file.getAbsolutePath()).build());
+ }
+
+ @POST
+ @Path("SuccessfulMethod")
+ public String successfulMethod(@FormDataParam("file") final File file) {
+ return file.getAbsolutePath();
+ }
+
+ @POST
+ @Path("FileSize")
+ public long fileSize(@FormDataParam("file") final File file) {
+ return file.length();
+ }
+ }
+
+ /**
+ * JERSEY-2663 reproducer. Make sure that temporary file created by MIMEPull is not copied into new temporary file created
+ * by Jersey.
+ */
+ @Test
+ public void testInjectedFileNotCopied(@Mocked final BodyPartEntity entity) throws Exception {
+ final FormDataMultiPart multipart = new FormDataMultiPart();
+ final FormDataBodyPart bodypart = new FormDataBodyPart(FormDataContentDisposition.name("file").fileName("file").build(),
+ "CONTENT");
+ multipart.bodyPart(bodypart);
+
+ final Response response = target().path("FileResource").path("InjectedFileNotCopied")
+ .register(MultiPartFeature.class)
+ .request()
+ .post(Entity.entity(multipart, MediaType.MULTIPART_FORM_DATA));
+
+ // Make sure that the Mimepull temp file has been moved to specific file.
+ new Verifications() {{
+ entity.moveTo(withInstanceOf(File.class));
+ times = 1;
+ }};
+
+ // Make sure that the temp file has been removed.
+ final String pathname = response.readEntity(String.class);
+ // Wait a second to make sure the file doesn't exist.
+ Thread.sleep(1000);
+
+ assertThat("Temporary file, " + pathname + ", on the server has not been removed",
+ new File(pathname).exists(), is(false));
+ }
+
+ /**
+ * Mocked JERSEY-2794 reproducer. Real test is under integration tests.
+ */
+ @Test
+ public void mimeTempFileRemovedAfterAbortedUpload(@Mocked final MIMEMessage message) throws Exception {
+ new Expectations() {{
+ message.getAttachments();
+ result = new MIMEParsingException();
+ }};
+
+ final URL url = new URL(getBaseUri().toString() + "MediaTypeWithBoundaryResource");
+ final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+
+ connection.setRequestMethod("PUT");
+ connection.setRequestProperty("Accept", "text/plain");
+ connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=XXXX_YYYY");
+
+ connection.setDoOutput(true);
+ connection.connect();
+
+ final OutputStream outputStream = connection.getOutputStream();
+ outputStream.write("--XXXX_YYYY".getBytes());
+ outputStream.write('\n');
+ outputStream.write("Content-Type: text/plain".getBytes());
+ outputStream.write('\n');
+ outputStream.write("Content-Disposition: form-data; name=\"big-part\"".getBytes());
+ outputStream.write('\n');
+ outputStream.write('\n');
+
+ // Send big chunk of data.
+ for (int i = 0; i < 16 * 4096; i++) {
+ outputStream.write('E');
+ if (i % 1024 == 0) {
+ outputStream.flush();
+ }
+ }
+
+ // Do NOT send end of the MultiPart message to simulate the issue.
+
+ // Get Response ...
+ final int response = connection.getResponseCode();
+ // ... Disconnect.
+ connection.disconnect();
+
+ assertThat("Bad Request expected", response, is(400));
+
+ // Make sure that the Mimepull message and it's parts have been closed and temporary files deleted.
+ new Verifications() {{
+ message.close();
+ times = 1;
+ }};
+ }
+}
diff --git a/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/ResourceConfigTest.java b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/ResourceConfigTest.java
new file mode 100644
index 0000000..39f3311
--- /dev/null
+++ b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/ResourceConfigTest.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2012, 2019 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.tests.jmockit.server;
+
+import mockit.Mocked;
+import mockit.Verifications;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.internal.scanning.PackageNamesScanner;
+import org.glassfish.jersey.tests.jmockit.server.innerstatic.InnerStaticClass;
+import org.glassfish.jersey.tests.jmockit.server.toplevel.PublicRootResourceClass;
+import org.glassfish.jersey.tests.jmockit.server.toplevelinnerstatic.PublicRootResourceInnerStaticClass;
+import org.junit.Test;
+
+/**
+ * @author Pavel Bucek
+ */
+public class ResourceConfigTest {
+
+ /**
+ * Reproducer for OWLS-19790: Invalidate resource finders in resource config only when needed.
+ */
+ @Test
+ public void testInvalidateResourceFinders(@Mocked final PackageNamesScanner scanner) throws Exception {
+ final ResourceConfig resourceConfig = new ResourceConfig()
+ .packages(false, PublicRootResourceClass.class.getPackage().getName());
+
+ // Scan packages.
+ resourceConfig.getClasses();
+
+ // No reset.
+ new Verifications() {{
+ scanner.reset();
+ times = 0;
+ }};
+
+ resourceConfig.register(InnerStaticClass.PublicClass.class);
+
+ // Reset - we called getClasses() on ResourceConfig.
+ new Verifications() {{
+ scanner.reset();
+ times = 1;
+ }};
+
+ // No reset.
+ resourceConfig.register(PublicRootResourceClass.class);
+ resourceConfig.register(PublicRootResourceInnerStaticClass.PublicClass.class);
+
+ // No reset - simple registering does not invoke cache invalidation and reset of resource finders.
+ new Verifications() {{
+ scanner.reset();
+ times = 1;
+ }};
+
+ // Scan packages.
+ resourceConfig.getClasses();
+
+ resourceConfig.registerFinder(new PackageNamesScanner(new String[] {"javax.ws.rs"}, false));
+
+ // Reset - we called getClasses() on ResourceConfig.
+ new Verifications() {{
+ scanner.reset();
+ times = 2;
+ }};
+ }
+}
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/ServerFactoryTest.java b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/ServerFactoryTest.java
similarity index 93%
rename from core-server/src/test/java/org/glassfish/jersey/server/ServerFactoryTest.java
rename to tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/ServerFactoryTest.java
index 9033318..89187c7 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/ServerFactoryTest.java
+++ b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/ServerFactoryTest.java
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2018 Markus KARG. All rights reserved.
+ * Copyright (c) 2018, Markus KARG. All rights reserved.
+ * Copyright (c) 2019 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
@@ -14,7 +15,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package org.glassfish.jersey.server;
+package org.glassfish.jersey.tests.jmockit.server;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.theInstance;
@@ -31,14 +32,13 @@
import org.glassfish.jersey.internal.guava.Iterators;
import org.glassfish.jersey.internal.inject.InjectionManager;
import org.glassfish.jersey.internal.inject.InjectionManagerFactory;
+import org.glassfish.jersey.server.ServerFactory;
import org.glassfish.jersey.server.spi.Server;
import org.glassfish.jersey.server.spi.ServerProvider;
import org.junit.After;
import org.junit.Test;
-import org.junit.runner.RunWith;
import mockit.Mocked;
-import mockit.integration.junit4.JMockit;
/**
* Unit tests for {@link ServerFactory}.
@@ -46,7 +46,6 @@
* @author Markus KARG (markus@headcrashing.eu)
* @since 2.30
*/
-@RunWith(JMockit.class)
public final class ServerFactoryTest {
@Test
diff --git a/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/RuntimeDelegateImplTest.java b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/RuntimeDelegateImplTest.java
new file mode 100644
index 0000000..a9f4c39
--- /dev/null
+++ b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/RuntimeDelegateImplTest.java
@@ -0,0 +1,361 @@
+/*
+ * Copyright (c) 2018, 2019 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.tests.jmockit.server.internal;
+
+import mockit.Mocked;
+import org.glassfish.jersey.internal.ServiceFinder;
+import org.glassfish.jersey.server.ServerProperties;
+import org.glassfish.jersey.server.internal.RuntimeDelegateImpl;
+import org.glassfish.jersey.server.spi.Container;
+import org.glassfish.jersey.server.spi.Server;
+import org.glassfish.jersey.server.spi.ServerProvider;
+import org.hamcrest.FeatureMatcher;
+import org.hamcrest.Matcher;
+import org.junit.After;
+import org.junit.Test;
+
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.JAXRS;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.ext.RuntimeDelegate;
+import java.security.NoSuchAlgorithmException;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionStage;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+import java.util.function.BiFunction;
+
+import static java.lang.Boolean.FALSE;
+import static java.lang.Boolean.TRUE;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.theInstance;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Unit tests for {@link RuntimeDelegate}.
+ *
+ * @author Markus KARG (markus@headcrashing.eu)
+ */
+public class RuntimeDelegateImplTest {
+ @Test
+ public final void shouldCreateConfigurationBuilder() {
+ // given
+ final RuntimeDelegate runtimeDelegate = new RuntimeDelegateImpl();
+
+ // when
+ final JAXRS.Configuration.Builder configurationBuilder = runtimeDelegate.createConfigurationBuilder();
+
+ // then
+ assertThat(configurationBuilder, is(notNullValue()));
+ }
+
+ @Test
+ public final void shouldBuildDefaultConfiguration() throws NoSuchAlgorithmException {
+ // given
+ final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
+
+ // when
+ final JAXRS.Configuration configuration = configurationBuilder.build();
+
+ // then
+ assertThat(configuration, is(notNullValue()));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
+ assertThat(configuration.property(JAXRS.Configuration.PROTOCOL), is("HTTP"));
+ assertThat(configuration.property(JAXRS.Configuration.HOST), is("localhost"));
+ assertThat(configuration.property(JAXRS.Configuration.PORT), is(JAXRS.Configuration.DEFAULT_PORT));
+ assertThat(configuration.property(JAXRS.Configuration.ROOT_PATH), is("/"));
+ assertThat(configuration.property(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION),
+ is(JAXRS.Configuration.SSLClientAuthentication.NONE));
+ assertThat(configuration.property(JAXRS.Configuration.SSL_CONTEXT), is(theInstance(SSLContext.getDefault())));
+ assertThat(configuration.protocol(), is("HTTP"));
+ assertThat(configuration.host(), is("localhost"));
+ assertThat(configuration.port(), is(JAXRS.Configuration.DEFAULT_PORT));
+ assertThat(configuration.rootPath(), is("/"));
+ assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.NONE));
+ assertThat(configuration.sslContext(), is(theInstance(SSLContext.getDefault())));
+ }
+
+ @Test
+ public final void shouldBuildConfigurationContainingCustomProperties() {
+ // given
+ final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
+
+ // when
+ final JAXRS.Configuration configuration = configurationBuilder.property("property", "value").build();
+
+ // then
+ assertThat(configuration, is(notNullValue()));
+ assertThat(configuration, hasProperty("property"));
+ assertThat(configuration.property("property"), is("value"));
+ }
+
+ @Test
+ public final void shouldBuildCustomConfigurationUsingNamedStandardProperties(@Mocked final SSLContext mockSslContext)
+ throws NoSuchAlgorithmException {
+ // given
+ final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
+
+ // when
+ final JAXRS.Configuration configuration = configurationBuilder.property(JAXRS.Configuration.PROTOCOL, "HTTPS")
+ .property(JAXRS.Configuration.HOST, "hostname").property(JAXRS.Configuration.PORT, 8080)
+ .property(JAXRS.Configuration.ROOT_PATH, "path")
+ .property(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION,
+ JAXRS.Configuration.SSLClientAuthentication.OPTIONAL)
+ .property(JAXRS.Configuration.SSL_CONTEXT, mockSslContext).build();
+
+ // then
+ assertThat(configuration, is(notNullValue()));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
+ assertThat(configuration.protocol(), is("HTTPS"));
+ assertThat(configuration.host(), is("hostname"));
+ assertThat(configuration.port(), is(8080));
+ assertThat(configuration.rootPath(), is("path"));
+ assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL));
+ assertThat(configuration.sslContext(), is(theInstance(mockSslContext)));
+ }
+
+ @Test
+ public final void shouldBuildCustomConfigurationUsingConvenienceMethods(@Mocked final SSLContext mockSslContext)
+ throws NoSuchAlgorithmException {
+ // given
+ final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
+
+ // when
+ final JAXRS.Configuration configuration = configurationBuilder.protocol("HTTPS").host("hostname").port(8080)
+ .rootPath("path").sslClientAuthentication(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL)
+ .sslContext(mockSslContext).build();
+
+ // then
+ assertThat(configuration, is(notNullValue()));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
+ assertThat(configuration.protocol(), is("HTTPS"));
+ assertThat(configuration.host(), is("hostname"));
+ assertThat(configuration.port(), is(8080));
+ assertThat(configuration.rootPath(), is("path"));
+ assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL));
+ assertThat(configuration.sslContext(), is(theInstance(mockSslContext)));
+ }
+
+ @Test
+ public final void shouldBuildCustomConfigurationFromPropertiesProvider(@Mocked final SSLContext mockSslContext) {
+ // given
+ final JAXRS.Configuration.Builder configurationBuilder = new RuntimeDelegateImpl().createConfigurationBuilder();
+ final Class<Server> mockServerClass = Server.class;
+ final BiFunction<String, Class<Object>, Optional<Object>> propertiesProvider = (propertyName, propertyType) -> {
+ if (JAXRS.Configuration.PROTOCOL.equals(propertyName) && String.class.equals(propertyType)) {
+ return Optional.of("HTTPS");
+ }
+ if (JAXRS.Configuration.HOST.equals(propertyName) && String.class.equals(propertyType)) {
+ return Optional.of("hostname");
+ }
+ if (JAXRS.Configuration.PORT.equals(propertyName) && Integer.class.equals(propertyType)) {
+ return Optional.of(8080);
+ }
+ if (JAXRS.Configuration.ROOT_PATH.equals(propertyName) && String.class.equals(propertyType)) {
+ return Optional.of("path");
+ }
+ if (JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION.equals(propertyName)
+ && JAXRS.Configuration.SSLClientAuthentication.class.equals(propertyType)) {
+ return Optional.of(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL);
+ }
+ if (JAXRS.Configuration.SSL_CONTEXT.equals(propertyName) && SSLContext.class.equals(propertyType)) {
+ return Optional.of(mockSslContext);
+ }
+ if (ServerProperties.HTTP_SERVER_CLASS.equals(propertyName) && Class.class.equals(propertyType)) {
+ return Optional.of(mockServerClass);
+ }
+ if (ServerProperties.AUTO_START.equals(propertyName) && Boolean.class.equals(propertyType)) {
+ return Optional.of(FALSE);
+ }
+ return Optional.empty();
+ };
+
+ // when
+ final JAXRS.Configuration configuration = configurationBuilder.from(propertiesProvider).build();
+
+ // then
+ assertThat(configuration, is(notNullValue()));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
+ assertThat(configuration, hasProperty(ServerProperties.HTTP_SERVER_CLASS));
+ assertThat(configuration, hasProperty(ServerProperties.AUTO_START));
+ assertThat(configuration.protocol(), is("HTTPS"));
+ assertThat(configuration.host(), is("hostname"));
+ assertThat(configuration.port(), is(8080));
+ assertThat(configuration.rootPath(), is("path"));
+ assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL));
+ assertThat(configuration.sslContext(), is(theInstance(mockSslContext)));
+ assertThat(configuration.property(ServerProperties.HTTP_SERVER_CLASS), is(theInstance(mockServerClass)));
+ assertThat(configuration.property(ServerProperties.AUTO_START), is(FALSE));
+ }
+
+ @Test
+ public final void shouldBootstrapApplication(@Mocked final Container mockContainer,
+ @Mocked final Application mockApplication,
+ @Mocked final SSLContext mockSslContext) throws InterruptedException,
+ ExecutionException, TimeoutException {
+ // given
+ final Server mockServer = new Server() {
+ @Override
+ public final Container container() {
+ return mockContainer;
+ }
+
+ @Override
+ public final int port() {
+ return 8888;
+ }
+
+ @Override
+ public final CompletionStage<?> start() {
+ return CompletableFuture.completedFuture(null);
+ }
+
+ @Override
+ public final CompletionStage<?> stop() {
+ return CompletableFuture.completedFuture(null);
+ }
+
+ @Override
+ public final <T> T unwrap(final Class<T> nativeClass) {
+ return null;
+ }
+ };
+ final RuntimeDelegate runtimeDelegate = new RuntimeDelegateImpl();
+ final JAXRS.Configuration mockConfiguration = name -> {
+ switch (name) {
+ case JAXRS.Configuration.PROTOCOL:
+ return "HTTPS";
+ case JAXRS.Configuration.HOST:
+ return "hostname";
+ case JAXRS.Configuration.PORT:
+ return JAXRS.Configuration.DEFAULT_PORT;
+ case JAXRS.Configuration.ROOT_PATH:
+ return "path";
+ case JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION:
+ return JAXRS.Configuration.SSLClientAuthentication.OPTIONAL;
+ case JAXRS.Configuration.SSL_CONTEXT:
+ return mockSslContext;
+ case ServerProperties.HTTP_SERVER_CLASS:
+ return Server.class;
+ default:
+ return null;
+ }
+ };
+ ServiceFinder.setIteratorProvider(new ServiceFinder.ServiceIteratorProvider() {
+ @Override
+ public final <T> Iterator<T> createIterator(final Class<T> service, final String serviceName,
+ final ClassLoader loader, final boolean ignoreOnClassNotFound) {
+ return Collections.singleton(service.cast(new ServerProvider() {
+ @Override
+ public final <U extends Server> U createServer(final Class<U> type, final Application application,
+ final JAXRS.Configuration configuration) {
+ return application == mockApplication && configuration == mockConfiguration
+ ? type.cast(mockServer)
+ : null;
+ }
+ })).iterator();
+ }
+
+ @Override
+ public final <T> Iterator<Class<T>> createClassIterator(final Class<T> service,
+ final String serviceName,
+ final ClassLoader loader,
+ final boolean ignoreOnClassNotFound) {
+ return null;
+ }
+ });
+
+ // when
+ final CompletionStage<JAXRS.Instance> bootstrapStage = runtimeDelegate.bootstrap(mockApplication,
+ mockConfiguration);
+ final JAXRS.Instance instance = bootstrapStage.toCompletableFuture().get(15, SECONDS);
+ final JAXRS.Configuration configuration = instance.configuration();
+ final Server server = instance.unwrap(Server.class);
+ final Container container = server.container();
+ final CompletionStage<JAXRS.Instance.StopResult> stopStage = instance.stop();
+ final Object stopResult = stopStage.toCompletableFuture().get(15, SECONDS);
+
+ // then
+ assertThat(instance, is(notNullValue()));
+ assertThat(configuration, is(notNullValue()));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PROTOCOL));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.HOST));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.PORT));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.ROOT_PATH));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CLIENT_AUTHENTICATION));
+ assertThat(configuration, hasProperty(JAXRS.Configuration.SSL_CONTEXT));
+ assertThat(configuration, hasProperty(ServerProperties.HTTP_SERVER_CLASS));
+ assertThat(configuration.protocol(), is("HTTPS"));
+ assertThat(configuration.host(), is("hostname"));
+ assertThat(configuration.port(), is(8888));
+ assertThat(configuration.rootPath(), is("path"));
+ assertThat(configuration.sslClientAuthentication(), is(JAXRS.Configuration.SSLClientAuthentication.OPTIONAL));
+ assertThat(configuration.sslContext(), is(theInstance(mockSslContext)));
+ assertThat(configuration.property(ServerProperties.HTTP_SERVER_CLASS), is(theInstance(mockServer.getClass())));
+ assertThat(server, is(theInstance(mockServer)));
+ assertThat(container, is(theInstance(mockContainer)));
+ assertThat(stopResult, is(notNullValue()));
+ }
+
+ @After
+ public final void resetServiceFinder() {
+ ServiceFinder.setIteratorProvider(null);
+ }
+
+ /**
+ * Creates a matcher that matches any examined object whose <code>hasProperty</code> method
+ * returns {@code true} for the provided property name.
+ * For example:
+ * <pre>assertThat(configuration, hasProperty("HOST"))</pre>
+ *
+ * @param propertyName
+ * the property name to check
+ */
+ private static final Matcher<JAXRS.Configuration> hasProperty(final String propertyName) {
+ return new FeatureMatcher<JAXRS.Configuration, Boolean>(is(TRUE), "hasProperty", "hasProperty") {
+ @Override
+ protected final Boolean featureValueOf(final JAXRS.Configuration actual) {
+ return actual.hasProperty(propertyName);
+ }
+ };
+ }
+}
diff --git a/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/PackageNamesScannerTest.java b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/scanning/PackageNamesScannerTest.java
similarity index 95%
rename from core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/PackageNamesScannerTest.java
rename to tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/scanning/PackageNamesScannerTest.java
index 29b18c0..f8f5668 100644
--- a/core-server/src/test/java/org/glassfish/jersey/server/internal/scanning/PackageNamesScannerTest.java
+++ b/tests/jmockit/src/test/java/org/glassfish/jersey/tests/jmockit/server/internal/scanning/PackageNamesScannerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -14,16 +14,16 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package org.glassfish.jersey.server.internal.scanning;
+package org.glassfish.jersey.tests.jmockit.server.internal.scanning;
import mockit.Expectations;
import mockit.Injectable;
import mockit.Tested;
import mockit.Verifications;
-import mockit.integration.junit4.JMockit;
+import org.glassfish.jersey.server.internal.scanning.PackageNamesScanner;
+import org.glassfish.jersey.server.internal.scanning.ResourceFinderException;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -46,7 +46,6 @@
* @author Eric Navarro
* @author Michal Gajdos
*/
-@RunWith(JMockit.class)
public class PackageNamesScannerTest {
private static final String[] packages = {"javax.ws.rs"};
diff --git a/tests/mem-leaks/pom.xml b/tests/mem-leaks/pom.xml
index f3f7a68..01013eb 100644
--- a/tests/mem-leaks/pom.xml
+++ b/tests/mem-leaks/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.memleaks</groupId>
diff --git a/tests/mem-leaks/redeployment/pom.xml b/tests/mem-leaks/redeployment/pom.xml
index d3f12a4..6aca747 100644
--- a/tests/mem-leaks/redeployment/pom.xml
+++ b/tests/mem-leaks/redeployment/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.memleaks.redeployment</groupId>
diff --git a/tests/mem-leaks/redeployment/redeployment-hello-world-app-ref/pom.xml b/tests/mem-leaks/redeployment/redeployment-hello-world-app-ref/pom.xml
index c27a19b..5d42520 100644
--- a/tests/mem-leaks/redeployment/redeployment-hello-world-app-ref/pom.xml
+++ b/tests/mem-leaks/redeployment/redeployment-hello-world-app-ref/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks.redeployment</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>redeployment-hello-world-app-ref</artifactId>
@@ -132,7 +132,7 @@
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>helloworld-webapp</artifactId>
<type>war</type>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</dependency>
</dependencies>
diff --git a/tests/mem-leaks/redeployment/redeployment-leaking-test-app/pom.xml b/tests/mem-leaks/redeployment/redeployment-leaking-test-app/pom.xml
index 160429b..e21e163 100644
--- a/tests/mem-leaks/redeployment/redeployment-leaking-test-app/pom.xml
+++ b/tests/mem-leaks/redeployment/redeployment-leaking-test-app/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks.redeployment</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>redeployment-leaking-test-app</artifactId>
diff --git a/tests/mem-leaks/redeployment/redeployment-leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/DaemonThreadMemoryLeakingResource.java b/tests/mem-leaks/redeployment/redeployment-leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/DaemonThreadMemoryLeakingResource.java
index 395de4b..369f581 100644
--- a/tests/mem-leaks/redeployment/redeployment-leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/DaemonThreadMemoryLeakingResource.java
+++ b/tests/mem-leaks/redeployment/redeployment-leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/DaemonThreadMemoryLeakingResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -37,7 +37,7 @@
* The purpose of this resource (and the app) is to test whether the memory leaking infrastructure for redeployment scenarios
* works.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/")
@Singleton
diff --git a/tests/mem-leaks/redeployment/redeployment-leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/TestApplication.java b/tests/mem-leaks/redeployment/redeployment-leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/TestApplication.java
index 4d68713..a31f064 100644
--- a/tests/mem-leaks/redeployment/redeployment-leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/TestApplication.java
+++ b/tests/mem-leaks/redeployment/redeployment-leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import org.glassfish.jersey.server.ResourceConfig;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class TestApplication extends ResourceConfig {
diff --git a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/pom.xml b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/pom.xml
index 13e518d..44a967a 100644
--- a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/pom.xml
+++ b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks.redeployment</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>redeployment-no-jersey-app</artifactId>
diff --git a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/GreetingService.java b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/GreetingService.java
index 9dc4237..82842c4 100644
--- a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/GreetingService.java
+++ b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/GreetingService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import org.jvnet.hk2.annotations.Contract;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Contract
public interface GreetingService {
diff --git a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/GreetingWrapper.java b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/GreetingWrapper.java
index c4d0c9b..86bd55e 100644
--- a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/GreetingWrapper.java
+++ b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/GreetingWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import org.glassfish.hk2.api.ServiceLocator;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class GreetingWrapper {
GreetingService service;
diff --git a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/HelloServiceImpl.java b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/HelloServiceImpl.java
index 64aa2bf..6ca650d 100644
--- a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/HelloServiceImpl.java
+++ b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/HelloServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import org.jvnet.hk2.annotations.Service;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Service
public class HelloServiceImpl implements GreetingService {
diff --git a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/Main.java b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/Main.java
index d58b4c6..8fca119 100644
--- a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/Main.java
+++ b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
import org.glassfish.hk2.utilities.binding.AbstractBinder;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class Main {
diff --git a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/MyServlet.java b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/MyServlet.java
index 2d6a266..033c357 100644
--- a/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/MyServlet.java
+++ b/tests/mem-leaks/redeployment/redeployment-no-jersey-app/src/main/java/org/glassfish/jersey/tests/memleaks/nojersey/MyServlet.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
import java.io.IOException;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class MyServlet extends HttpServlet {
@Override
diff --git a/tests/mem-leaks/redeployment/redeployment-threadlocals-app/pom.xml b/tests/mem-leaks/redeployment/redeployment-threadlocals-app/pom.xml
index 487b9fc..ab7d2ad 100644
--- a/tests/mem-leaks/redeployment/redeployment-threadlocals-app/pom.xml
+++ b/tests/mem-leaks/redeployment/redeployment-threadlocals-app/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks.redeployment</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>redeployment-threadlocals-app</artifactId>
diff --git a/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/SomeClass.java b/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/SomeClass.java
index 7f36e53..8790c16 100644
--- a/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/SomeClass.java
+++ b/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/SomeClass.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* A simple class that participates in the class/object reference circle that causes a memory leak.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class SomeClass {
diff --git a/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/StaticReferenceClass.java b/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/StaticReferenceClass.java
index 3662e79..cb82a1c 100644
--- a/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/StaticReferenceClass.java
+++ b/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/StaticReferenceClass.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -22,7 +22,7 @@
* This class is a key to the classloader memory leak since it has a static reference to an object which will refer a {@link
* ThreadLocal} instance which refers a class object.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class StaticReferenceClass {
diff --git a/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/ThreadLocalMemoryLeakServlet.java b/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/ThreadLocalMemoryLeakServlet.java
index a55c85a..790e743 100644
--- a/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/ThreadLocalMemoryLeakServlet.java
+++ b/tests/mem-leaks/redeployment/redeployment-threadlocals-app/src/main/java/org/glassfish/jersey/tests/memleaks/threadlocal/ThreadLocalMemoryLeakServlet.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
* To revert this case to the simple one (the original one), change the {@link #threadLocal} instance should be static and than no
* {@link StaticReferenceClass#STATIC_HOLDER} is needed. The memory leak occurs without any other special actions.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class ThreadLocalMemoryLeakServlet extends HttpServlet {
diff --git a/tests/mem-leaks/test-cases/bean-param-leak/pom.xml b/tests/mem-leaks/test-cases/bean-param-leak/pom.xml
index 123b79a..639a0dc 100644
--- a/tests/mem-leaks/test-cases/bean-param-leak/pom.xml
+++ b/tests/mem-leaks/test-cases/bean-param-leak/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>bean-param-leak</artifactId>
diff --git a/tests/mem-leaks/test-cases/bean-param-leak/src/main/java/org/glassfish/jersey/tests/memleaks/beanparam/BeanParamLeakResource.java b/tests/mem-leaks/test-cases/bean-param-leak/src/main/java/org/glassfish/jersey/tests/memleaks/beanparam/BeanParamLeakResource.java
index b78f64c..2ff22f8 100644
--- a/tests/mem-leaks/test-cases/bean-param-leak/src/main/java/org/glassfish/jersey/tests/memleaks/beanparam/BeanParamLeakResource.java
+++ b/tests/mem-leaks/test-cases/bean-param-leak/src/main/java/org/glassfish/jersey/tests/memleaks/beanparam/BeanParamLeakResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* This resource reproduces JERSEY-2800 when {@link #invokeBeanParamInject()} called repetitively.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/beanparam")
public class BeanParamLeakResource {
diff --git a/tests/mem-leaks/test-cases/bean-param-leak/src/main/java/org/glassfish/jersey/tests/memleaks/beanparam/TestApplication.java b/tests/mem-leaks/test-cases/bean-param-leak/src/main/java/org/glassfish/jersey/tests/memleaks/beanparam/TestApplication.java
index 5333c45..44c8cc3 100644
--- a/tests/mem-leaks/test-cases/bean-param-leak/src/main/java/org/glassfish/jersey/tests/memleaks/beanparam/TestApplication.java
+++ b/tests/mem-leaks/test-cases/bean-param-leak/src/main/java/org/glassfish/jersey/tests/memleaks/beanparam/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
/**
* JAX-RS Application that serves {@link BeanParamLeakResource} class.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class TestApplication extends ResourceConfig {
diff --git a/tests/mem-leaks/test-cases/bean-param-leak/src/test/java/org/glassfish/jersey/tests/memleaks/beanparam/BeanParamLeakResourceITCase.java b/tests/mem-leaks/test-cases/bean-param-leak/src/test/java/org/glassfish/jersey/tests/memleaks/beanparam/BeanParamLeakResourceITCase.java
index b9ffb16..ef9c177 100644
--- a/tests/mem-leaks/test-cases/bean-param-leak/src/test/java/org/glassfish/jersey/tests/memleaks/beanparam/BeanParamLeakResourceITCase.java
+++ b/tests/mem-leaks/test-cases/bean-param-leak/src/test/java/org/glassfish/jersey/tests/memleaks/beanparam/BeanParamLeakResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -33,7 +33,7 @@
* This is an integration test that reproduces JERSEY-2800 by calling RESTful resource {@link BeanParamLeakResource}
* repetitively.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class BeanParamLeakResourceITCase extends AbstractMemoryLeakWebAppTest {
diff --git a/tests/mem-leaks/test-cases/leaking-test-app/pom.xml b/tests/mem-leaks/test-cases/leaking-test-app/pom.xml
index 3a972a4..5eeda05 100644
--- a/tests/mem-leaks/test-cases/leaking-test-app/pom.xml
+++ b/tests/mem-leaks/test-cases/leaking-test-app/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>leaking-test-app</artifactId>
diff --git a/tests/mem-leaks/test-cases/leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/MemoryLeakingResource.java b/tests/mem-leaks/test-cases/leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/MemoryLeakingResource.java
index 4bce46e..f3cccf2 100644
--- a/tests/mem-leaks/test-cases/leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/MemoryLeakingResource.java
+++ b/tests/mem-leaks/test-cases/leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/MemoryLeakingResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
/**
* Resource that causes {@link OutOfMemoryError} exception upon repetitive call of {@link #invoke(int)}.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/")
@Singleton
diff --git a/tests/mem-leaks/test-cases/leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/TestApplication.java b/tests/mem-leaks/test-cases/leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/TestApplication.java
index b0435e5..d74f4ca 100644
--- a/tests/mem-leaks/test-cases/leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/TestApplication.java
+++ b/tests/mem-leaks/test-cases/leaking-test-app/src/main/java/org/glassfish/jersey/tests/memleaks/testleak/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import org.glassfish.jersey.server.ResourceConfig;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class TestApplication extends ResourceConfig {
diff --git a/tests/mem-leaks/test-cases/pom.xml b/tests/mem-leaks/test-cases/pom.xml
index 06d9a68..4ed3490 100644
--- a/tests/mem-leaks/test-cases/pom.xml
+++ b/tests/mem-leaks/test-cases/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.memleaks.testcases</groupId>
diff --git a/tests/mem-leaks/test-cases/shutdown-hook-leak-client/pom.xml b/tests/mem-leaks/test-cases/shutdown-hook-leak-client/pom.xml
index a5d7505..74424f8 100644
--- a/tests/mem-leaks/test-cases/shutdown-hook-leak-client/pom.xml
+++ b/tests/mem-leaks/test-cases/shutdown-hook-leak-client/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>shutdown-hook-leak-client</artifactId>
diff --git a/tests/mem-leaks/test-cases/shutdown-hook-leak-client/src/test/java/org/glassfish/jersey/tests/memleaks/shutdownleak/client/EndlessShutdownHookLeakTest.java b/tests/mem-leaks/test-cases/shutdown-hook-leak-client/src/test/java/org/glassfish/jersey/tests/memleaks/shutdownleak/client/EndlessShutdownHookLeakTest.java
index 330b76e..8b6c24f 100644
--- a/tests/mem-leaks/test-cases/shutdown-hook-leak-client/src/test/java/org/glassfish/jersey/tests/memleaks/shutdownleak/client/EndlessShutdownHookLeakTest.java
+++ b/tests/mem-leaks/test-cases/shutdown-hook-leak-client/src/test/java/org/glassfish/jersey/tests/memleaks/shutdownleak/client/EndlessShutdownHookLeakTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -33,7 +33,7 @@
/**
* Reproducer for JERSEY-2786.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class EndlessShutdownHookLeakTest extends AbstractMemoryLeakSimpleTest {
diff --git a/tests/mem-leaks/test-cases/shutdown-hook-leak/pom.xml b/tests/mem-leaks/test-cases/shutdown-hook-leak/pom.xml
index 999aa31..e204ab9 100644
--- a/tests/mem-leaks/test-cases/shutdown-hook-leak/pom.xml
+++ b/tests/mem-leaks/test-cases/shutdown-hook-leak/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.memleaks.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>shutdown-hook-leak</artifactId>
diff --git a/tests/mem-leaks/test-cases/shutdown-hook-leak/src/main/java/org/glassfish/jersey/tests/memleaks/shutdownhook/ClientShutdownLeakResource.java b/tests/mem-leaks/test-cases/shutdown-hook-leak/src/main/java/org/glassfish/jersey/tests/memleaks/shutdownhook/ClientShutdownLeakResource.java
index ff2a8db..5b649ce 100644
--- a/tests/mem-leaks/test-cases/shutdown-hook-leak/src/main/java/org/glassfish/jersey/tests/memleaks/shutdownhook/ClientShutdownLeakResource.java
+++ b/tests/mem-leaks/test-cases/shutdown-hook-leak/src/main/java/org/glassfish/jersey/tests/memleaks/shutdownhook/ClientShutdownLeakResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
/**
* This resource reproduces JERSEY-2786 when {@link #invokeClient()} called repetitively.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("client")
@Singleton
diff --git a/tests/mem-leaks/test-cases/shutdown-hook-leak/src/main/java/org/glassfish/jersey/tests/memleaks/shutdownhook/TestApplication.java b/tests/mem-leaks/test-cases/shutdown-hook-leak/src/main/java/org/glassfish/jersey/tests/memleaks/shutdownhook/TestApplication.java
index 44ddb33..992cfac 100644
--- a/tests/mem-leaks/test-cases/shutdown-hook-leak/src/main/java/org/glassfish/jersey/tests/memleaks/shutdownhook/TestApplication.java
+++ b/tests/mem-leaks/test-cases/shutdown-hook-leak/src/main/java/org/glassfish/jersey/tests/memleaks/shutdownhook/TestApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
import org.glassfish.jersey.server.ResourceConfig;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class TestApplication extends ResourceConfig {
diff --git a/tests/mem-leaks/test-cases/shutdown-hook-leak/src/test/java/org/glassfish/jersey/tests/memleaks/shutdownhook/ShutdownLeakResourceITCase.java b/tests/mem-leaks/test-cases/shutdown-hook-leak/src/test/java/org/glassfish/jersey/tests/memleaks/shutdownhook/ShutdownLeakResourceITCase.java
index 6d5554f..955d567 100644
--- a/tests/mem-leaks/test-cases/shutdown-hook-leak/src/test/java/org/glassfish/jersey/tests/memleaks/shutdownhook/ShutdownLeakResourceITCase.java
+++ b/tests/mem-leaks/test-cases/shutdown-hook-leak/src/test/java/org/glassfish/jersey/tests/memleaks/shutdownhook/ShutdownLeakResourceITCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -32,7 +32,7 @@
* This is an integration test that reproduces JERSEY-2786 by calling RESTful resource {@link ClientShutdownLeakResource}
* repetitively.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class ShutdownLeakResourceITCase extends AbstractMemoryLeakWebAppTest {
diff --git a/tests/osgi/functional/pom.xml b/tests/osgi/functional/pom.xml
index d9f0ca4..83b9b08 100644
--- a/tests/osgi/functional/pom.xml
+++ b/tests/osgi/functional/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2019 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,7 +24,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.osgi</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>jersey-tests-osgi-functional</artifactId>
@@ -269,8 +269,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -379,7 +379,7 @@
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
- <version>1.2.1</version>
+ <version>${jakarta.activation.version}</version>
<scope>test</scope>
</dependency>
@@ -394,6 +394,39 @@
<profiles>
<profile>
+ <id>testsSkipJdk11</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- Exclude unit tests on jdk 11 for now -->
+ <excludes>
+ <exclude>org/glassfish/jersey/osgi/test/basic/ApacheOsgiIntegrationTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/BasicOsgiIntegrationTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/BeanValidationTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/JaxRsRiBundleTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/JsonJackson1Test.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/JsonJacksonTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/JsonJettisonTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/JsonMoxyTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/JsonProcessingTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/MultiPartTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/PackageScanningTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/ResourceBundleTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/SseTest.java</exclude>
+ <exclude>org/glassfish/jersey/osgi/test/basic/WebResourceFactoryTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>testsSkipJdk6</id>
<activation>
<jdk>1.6</jdk>
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/ApacheOsgiIntegrationTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/ApacheOsgiIntegrationTest.java
index ebdfbbf..da5144f 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/ApacheOsgiIntegrationTest.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/ApacheOsgiIntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -44,7 +44,7 @@
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
/**
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@RunWith(PaxExam.class)
public class ApacheOsgiIntegrationTest {
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/BasicOsgiIntegrationTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/BasicOsgiIntegrationTest.java
index 104347f..2cb6b98 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/BasicOsgiIntegrationTest.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/BasicOsgiIntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -40,7 +40,7 @@
import static org.junit.Assert.assertEquals;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
@RunWith(PaxExam.class)
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/BeanValidationTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/BeanValidationTest.java
index 2220127..b872d10 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/BeanValidationTest.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/BeanValidationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -47,7 +47,7 @@
* Basic test of Bean Validation.
*
* @author Michal Gajdos
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@RunWith(PaxExam.class)
public class BeanValidationTest {
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonJettisonTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonJettisonTest.java
index d173643..c291723 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonJettisonTest.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonJettisonTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,6 +26,7 @@
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.Configuration;
+import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackage;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.systemPackage;
@@ -40,11 +41,13 @@
options.addAll(Helper.getCommonOsgiOptions());
options.addAll(Helper.expandedList(
+ bootDelegationPackage("javax.xml.bind"),
+ bootDelegationPackage("javax.xml.bind.*"),
// jersey-json dependencies
mavenBundle().groupId("org.glassfish.jersey.media").artifactId("jersey-media-json-jettison").versionAsInProject(),
mavenBundle().groupId("org.codehaus.jettison").artifactId("jettison").versionAsInProject(),
//SUN JAXB IMPL OSGI
- mavenBundle().groupId("com.sun.xml.bind").artifactId("jaxb-osgi").versionAsInProject().versionAsInProject(),
+ mavenBundle().groupId("com.sun.xml.bind").artifactId("jaxb-osgi").versionAsInProject(),
systemPackage("com.sun.source.tree"),
systemPackage("com.sun.source.util")
));
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonResource.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonResource.java
index f9c3bdd..58315c4 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonResource.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/JsonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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,7 +24,7 @@
import javax.xml.bind.annotation.XmlRootElement;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("json")
public class JsonResource {
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/PackageScanningTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/PackageScanningTest.java
index dbc299c..03a20cf 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/PackageScanningTest.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/PackageScanningTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -45,7 +45,7 @@
/**
* NOTE: This test is excluded on JDK6 as it requires Servlet 3.1 API that is built against JDK 7.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
* @author Michal Gajdos
*/
@RunWith(PaxExam.class)
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/ResourceBundleTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/ResourceBundleTest.java
index 7f6c6fb..b0e1acf 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/ResourceBundleTest.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/ResourceBundleTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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
@@ -44,7 +44,7 @@
/**
* Ensures server localization resource bundle gets loaded fine in OSGi runtime.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(PaxExam.class)
public class ResourceBundleTest {
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/SimpleResource.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/SimpleResource.java
index 6b672cb..75b853a 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/SimpleResource.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/SimpleResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019 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,7 +20,7 @@
import javax.ws.rs.Path;
/**
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/simple")
public class SimpleResource {
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/SseTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/SseTest.java
index c558f32..67cb9a3 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/SseTest.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/SseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -57,7 +57,7 @@
/**
* Basic test for SSE module OSGification.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@RunWith(PaxExam.class)
public class SseTest {
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/WebResourceFactoryTest.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/WebResourceFactoryTest.java
index faef96f..ffcd49d 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/WebResourceFactoryTest.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/WebResourceFactoryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -48,6 +48,7 @@
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import static org.junit.Assert.assertEquals;
+import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackage;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.systemPackage;
@@ -69,6 +70,8 @@
List<Option> options = Helper.getCommonOsgiOptions();
options.addAll(Helper.expandedList(
+ bootDelegationPackage("javax.xml.bind"),
+ bootDelegationPackage("javax.xml.bind.*"),
// jersey-multipart dependencies
mavenBundle().groupId("org.glassfish.jersey.ext").artifactId("jersey-proxy-client").versionAsInProject(),
//SUN JAXB IMPL OSGI
diff --git a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/subpackage/SimpleResourceSubpackaged.java b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/subpackage/SimpleResourceSubpackaged.java
index e5434eb..9f52b96 100644
--- a/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/subpackage/SimpleResourceSubpackaged.java
+++ b/tests/osgi/functional/src/test/java/org/glassfish/jersey/osgi/test/basic/subpackage/SimpleResourceSubpackaged.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +20,7 @@
import javax.ws.rs.Path;
/**
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
@Path("/sub-packaged")
public class SimpleResourceSubpackaged {
diff --git a/tests/osgi/pom.xml b/tests/osgi/pom.xml
index 622bb33..e80c327 100644
--- a/tests/osgi/pom.xml
+++ b/tests/osgi/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.osgi</groupId>
diff --git a/tests/performance/benchmarks/pom.xml b/tests/performance/benchmarks/pom.xml
index a865a50..c738a36 100644
--- a/tests/performance/benchmarks/pom.xml
+++ b/tests/performance/benchmarks/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>performance-test-benchmarks</artifactId>
diff --git a/tests/performance/jmx-client/src/main/java/org/glassfish/jersey/tests/performance/jmxclient/Main.java b/tests/performance/jmx-client/src/main/java/org/glassfish/jersey/tests/performance/jmxclient/Main.java
index 9cfafb4..342100e 100644
--- a/tests/performance/jmx-client/src/main/java/org/glassfish/jersey/tests/performance/jmxclient/Main.java
+++ b/tests/performance/jmx-client/src/main/java/org/glassfish/jersey/tests/performance/jmxclient/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* JMX Client entry point.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Main {
diff --git a/tests/performance/pom.xml b/tests/performance/pom.xml
index 0178047..1a157aa 100644
--- a/tests/performance/pom.xml
+++ b/tests/performance/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.performance</groupId>
diff --git a/tests/performance/runners/jersey-grizzly-runner/pom.xml b/tests/performance/runners/jersey-grizzly-runner/pom.xml
index 7994539..1c78c53 100644
--- a/tests/performance/runners/jersey-grizzly-runner/pom.xml
+++ b/tests/performance/runners/jersey-grizzly-runner/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.runners</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
diff --git a/tests/performance/runners/pom.xml b/tests/performance/runners/pom.xml
index a9133da..119efc2 100644
--- a/tests/performance/runners/pom.xml
+++ b/tests/performance/runners/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.performance.runners</groupId>
diff --git a/tests/performance/test-cases/assemblies/pom.xml b/tests/performance/test-cases/assemblies/pom.xml
index 9dad3d7..64d19bd 100644
--- a/tests/performance/test-cases/assemblies/pom.xml
+++ b/tests/performance/test-cases/assemblies/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>assemblies</artifactId>
diff --git a/tests/performance/test-cases/filter-dynamic/pom.xml b/tests/performance/test-cases/filter-dynamic/pom.xml
index 347ff70..83787a9 100644
--- a/tests/performance/test-cases/filter-dynamic/pom.xml
+++ b/tests/performance/test-cases/filter-dynamic/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>filter-dynamic</artifactId>
diff --git a/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicFilterFeature.java b/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicFilterFeature.java
index 6539149..c0646e6 100644
--- a/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicFilterFeature.java
+++ b/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicFilterFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
/**
* Dynamic feature to register custom filter.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
public class DynamicFilterFeature implements DynamicFeature {
diff --git a/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicallyBoundFilter.java b/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicallyBoundFilter.java
index c3da591..5c395bd 100644
--- a/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicallyBoundFilter.java
+++ b/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicallyBoundFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Custom filter.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
public class DynamicallyBoundFilter implements ContainerRequestFilter, ContainerResponseFilter {
diff --git a/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicallyBoundFilterResource.java b/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicallyBoundFilterResource.java
index 0a647c8..d0c6391 100644
--- a/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicallyBoundFilterResource.java
+++ b/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/DynamicallyBoundFilterResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Filtered resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/JaxRsApplication.java b/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/JaxRsApplication.java
index 0e68c16..535120a 100644
--- a/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/JaxRsApplication.java
+++ b/tests/performance/test-cases/filter-dynamic/src/main/java/org/glassfish/jersey/tests/performance/filter/dynamic/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/filter-dynamic/src/test/java/org/glassfish/jersey/tests/performance/filter/dynamic/FilterTest.java b/tests/performance/test-cases/filter-dynamic/src/test/java/org/glassfish/jersey/tests/performance/filter/dynamic/FilterTest.java
index 7a31093..2cc9b58 100644
--- a/tests/performance/test-cases/filter-dynamic/src/test/java/org/glassfish/jersey/tests/performance/filter/dynamic/FilterTest.java
+++ b/tests/performance/test-cases/filter-dynamic/src/test/java/org/glassfish/jersey/tests/performance/filter/dynamic/FilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for intercepted text plain resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class FilterTest extends JerseyTest {
diff --git a/tests/performance/test-cases/filter-global/pom.xml b/tests/performance/test-cases/filter-global/pom.xml
index 3af361f..3388b23 100644
--- a/tests/performance/test-cases/filter-global/pom.xml
+++ b/tests/performance/test-cases/filter-global/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>filter-global</artifactId>
diff --git a/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/GlobalFilter.java b/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/GlobalFilter.java
index 5544482..18bbe1e 100644
--- a/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/GlobalFilter.java
+++ b/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/GlobalFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Global custom filter.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
public class GlobalFilter implements ContainerRequestFilter, ContainerResponseFilter {
diff --git a/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/JaxRsApplication.java b/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/JaxRsApplication.java
index 11eb07d..e11fafb 100644
--- a/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/JaxRsApplication.java
+++ b/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/TextEntityResource.java b/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/TextEntityResource.java
index de1ce75..b1978f5 100644
--- a/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/TextEntityResource.java
+++ b/tests/performance/test-cases/filter-global/src/main/java/org/glassfish/jersey/tests/performance/filter/global/TextEntityResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/filter-global/src/test/java/org/glassfish/jersey/tests/performance/filter/global/FilterTest.java b/tests/performance/test-cases/filter-global/src/test/java/org/glassfish/jersey/tests/performance/filter/global/FilterTest.java
index d1fe5ad..2580e50 100644
--- a/tests/performance/test-cases/filter-global/src/test/java/org/glassfish/jersey/tests/performance/filter/global/FilterTest.java
+++ b/tests/performance/test-cases/filter-global/src/test/java/org/glassfish/jersey/tests/performance/filter/global/FilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for intercepted text plain resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class FilterTest extends JerseyTest {
diff --git a/tests/performance/test-cases/filter-name/pom.xml b/tests/performance/test-cases/filter-name/pom.xml
index 0e975be..432e0ac 100644
--- a/tests/performance/test-cases/filter-name/pom.xml
+++ b/tests/performance/test-cases/filter-name/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>filter-name</artifactId>
diff --git a/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/Filtered.java b/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/Filtered.java
index 8928b61..394fe60 100644
--- a/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/Filtered.java
+++ b/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/Filtered.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +24,7 @@
/**
* Custom binding annotation.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@NameBinding
@Target({ElementType.TYPE, ElementType.METHOD})
diff --git a/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/JaxRsApplication.java b/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/JaxRsApplication.java
index 4d1ecc7..bdf11bb 100644
--- a/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/JaxRsApplication.java
+++ b/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/NameBoundFilter.java b/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/NameBoundFilter.java
index 7704c6f..b718810 100644
--- a/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/NameBoundFilter.java
+++ b/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/NameBoundFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Custom filter.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
@Filtered
diff --git a/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/NameBoundFilterResource.java b/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/NameBoundFilterResource.java
index 98c49af..543fa85 100644
--- a/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/NameBoundFilterResource.java
+++ b/tests/performance/test-cases/filter-name/src/main/java/org/glassfish/jersey/tests/performance/filter/name/NameBoundFilterResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Filtered resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/filter-name/src/test/java/org/glassfish/jersey/tests/performance/filter/name/FilterTest.java b/tests/performance/test-cases/filter-name/src/test/java/org/glassfish/jersey/tests/performance/filter/name/FilterTest.java
index 776d0af..2f6cd37 100644
--- a/tests/performance/test-cases/filter-name/src/test/java/org/glassfish/jersey/tests/performance/filter/name/FilterTest.java
+++ b/tests/performance/test-cases/filter-name/src/test/java/org/glassfish/jersey/tests/performance/filter/name/FilterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for intercepted text plain resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class FilterTest extends JerseyTest {
diff --git a/tests/performance/test-cases/interceptor-dynamic/pom.xml b/tests/performance/test-cases/interceptor-dynamic/pom.xml
index b626fae..cb79130 100644
--- a/tests/performance/test-cases/interceptor-dynamic/pom.xml
+++ b/tests/performance/test-cases/interceptor-dynamic/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>interceptor-dynamic</artifactId>
diff --git a/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicInterceptorFeature.java b/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicInterceptorFeature.java
index 1903b09..ab587d1 100644
--- a/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicInterceptorFeature.java
+++ b/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicInterceptorFeature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -23,7 +23,7 @@
/**
* Custom feature to register interceptor.
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
public class DynamicInterceptorFeature implements DynamicFeature {
diff --git a/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicallyBoundInterceptor.java b/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicallyBoundInterceptor.java
index 0ce113e..7b8ab30 100644
--- a/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicallyBoundInterceptor.java
+++ b/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicallyBoundInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Custom interceptor.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
public class DynamicallyBoundInterceptor implements ReaderInterceptor, WriterInterceptor {
diff --git a/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicallyBoundInterceptorResource.java b/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicallyBoundInterceptorResource.java
index a99d426..0978952 100644
--- a/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicallyBoundInterceptorResource.java
+++ b/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/DynamicallyBoundInterceptorResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,7 +27,7 @@
/**
* Intercepted resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/JaxRsApplication.java b/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/JaxRsApplication.java
index f01d2ab..d6f5d0b 100644
--- a/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/JaxRsApplication.java
+++ b/tests/performance/test-cases/interceptor-dynamic/src/main/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/interceptor-dynamic/src/test/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/InterceptorTest.java b/tests/performance/test-cases/interceptor-dynamic/src/test/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/InterceptorTest.java
index e93174c..14a770a 100644
--- a/tests/performance/test-cases/interceptor-dynamic/src/test/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/InterceptorTest.java
+++ b/tests/performance/test-cases/interceptor-dynamic/src/test/java/org/glassfish/jersey/tests/performance/interceptor/dynamic/InterceptorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for intercepted text plain resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class InterceptorTest extends JerseyTest {
diff --git a/tests/performance/test-cases/interceptor-global/pom.xml b/tests/performance/test-cases/interceptor-global/pom.xml
index e2f34bf..0e718bb 100644
--- a/tests/performance/test-cases/interceptor-global/pom.xml
+++ b/tests/performance/test-cases/interceptor-global/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>interceptor-global</artifactId>
diff --git a/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/CustomInterceptor.java b/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/CustomInterceptor.java
index 32d1bb1..825486a 100644
--- a/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/CustomInterceptor.java
+++ b/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/CustomInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Custom interceptor.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
public class CustomInterceptor implements ReaderInterceptor, WriterInterceptor {
diff --git a/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/JaxRsApplication.java b/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/JaxRsApplication.java
index 21d7308..c50a00a 100644
--- a/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/JaxRsApplication.java
+++ b/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/TextEntityResource.java b/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/TextEntityResource.java
index dab5710..b9eea6e 100644
--- a/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/TextEntityResource.java
+++ b/tests/performance/test-cases/interceptor-global/src/main/java/org/glassfish/jersey/tests/performance/interceptor/global/TextEntityResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/interceptor-global/src/test/java/org/glassfish/jersey/tests/performance/interceptor/global/InterceptorTest.java b/tests/performance/test-cases/interceptor-global/src/test/java/org/glassfish/jersey/tests/performance/interceptor/global/InterceptorTest.java
index 6f00764..cb417c8 100644
--- a/tests/performance/test-cases/interceptor-global/src/test/java/org/glassfish/jersey/tests/performance/interceptor/global/InterceptorTest.java
+++ b/tests/performance/test-cases/interceptor-global/src/test/java/org/glassfish/jersey/tests/performance/interceptor/global/InterceptorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for intercepted text plain resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class InterceptorTest extends JerseyTest {
diff --git a/tests/performance/test-cases/interceptor-name/pom.xml b/tests/performance/test-cases/interceptor-name/pom.xml
index 1231aa8..a18fef4 100644
--- a/tests/performance/test-cases/interceptor-name/pom.xml
+++ b/tests/performance/test-cases/interceptor-name/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>interceptor-name</artifactId>
diff --git a/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/Intercepted.java b/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/Intercepted.java
index 1185a0f..ead6540 100644
--- a/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/Intercepted.java
+++ b/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/Intercepted.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -25,7 +25,7 @@
/**
* Custom annotation to bind interceptor.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@NameBinding
@Target({ElementType.TYPE, ElementType.METHOD})
diff --git a/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/InterceptedByNameResource.java b/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/InterceptedByNameResource.java
index d5fc36d..7304912 100644
--- a/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/InterceptedByNameResource.java
+++ b/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/InterceptedByNameResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -28,7 +28,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/JaxRsApplication.java b/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/JaxRsApplication.java
index cc1334e..f3df34b 100644
--- a/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/JaxRsApplication.java
+++ b/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/NameBoundInterceptor.java b/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/NameBoundInterceptor.java
index 0c17811..65a0632 100644
--- a/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/NameBoundInterceptor.java
+++ b/tests/performance/test-cases/interceptor-name/src/main/java/org/glassfish/jersey/tests/performance/interceptor/name/NameBoundInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -30,7 +30,7 @@
/**
* Custom interceptor.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Provider
@Intercepted
diff --git a/tests/performance/test-cases/interceptor-name/src/test/java/org/glassfish/jersey/tests/performance/interceptor/name/InterceptorTest.java b/tests/performance/test-cases/interceptor-name/src/test/java/org/glassfish/jersey/tests/performance/interceptor/name/InterceptorTest.java
index 84c521e..a18c1b0 100644
--- a/tests/performance/test-cases/interceptor-name/src/test/java/org/glassfish/jersey/tests/performance/interceptor/name/InterceptorTest.java
+++ b/tests/performance/test-cases/interceptor-name/src/test/java/org/glassfish/jersey/tests/performance/interceptor/name/InterceptorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for intercepted text plain resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class InterceptorTest extends JerseyTest {
diff --git a/tests/performance/test-cases/mbw-custom-provider/pom.xml b/tests/performance/test-cases/mbw-custom-provider/pom.xml
index 5eba020..2fe449a 100644
--- a/tests/performance/test-cases/mbw-custom-provider/pom.xml
+++ b/tests/performance/test-cases/mbw-custom-provider/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>custom-provider</artifactId>
diff --git a/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/JaxRsApplication.java b/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/JaxRsApplication.java
index d865298..49893f9 100644
--- a/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/JaxRsApplication.java
+++ b/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/Person.java b/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/Person.java
index 105dbb7..7164eb2 100644
--- a/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/Person.java
+++ b/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/Person.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Test data bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Person {
diff --git a/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonProvider.java b/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonProvider.java
index 8e29399..4af5813 100644
--- a/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonProvider.java
+++ b/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -35,7 +35,7 @@
/**
* Custom message body worker.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Produces("application/person")
@Consumes("application/person")
diff --git a/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonResource.java b/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonResource.java
index 59196c1..fbe200f 100644
--- a/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonResource.java
+++ b/tests/performance/test-cases/mbw-custom-provider/src/main/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -26,7 +26,7 @@
/**
* Person resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes("application/person")
diff --git a/tests/performance/test-cases/mbw-custom-provider/src/test/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonEntityTest.java b/tests/performance/test-cases/mbw-custom-provider/src/test/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonEntityTest.java
index 69aaf37..c2044b6 100644
--- a/tests/performance/test-cases/mbw-custom-provider/src/test/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonEntityTest.java
+++ b/tests/performance/test-cases/mbw-custom-provider/src/test/java/org/glassfish/jersey/tests/performance/mbw/custom/PersonEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
/**
* Test for json resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class PersonEntityTest extends JerseyTest {
diff --git a/tests/performance/test-cases/mbw-json-jackson/pom.xml b/tests/performance/test-cases/mbw-json-jackson/pom.xml
index 4517fdf..95ba0e5 100644
--- a/tests/performance/test-cases/mbw-json-jackson/pom.xml
+++ b/tests/performance/test-cases/mbw-json-jackson/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-jackson</artifactId>
diff --git a/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JaxRsApplication.java b/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JaxRsApplication.java
index a85709d..cd1b3cb 100644
--- a/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JaxRsApplication.java
+++ b/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityResource.java b/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityResource.java
index c945291..3b4d848 100644
--- a/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityResource.java
+++ b/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.APPLICATION_JSON)
diff --git a/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/Person.java b/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/Person.java
index b3af2b0..03bb7c5 100644
--- a/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/Person.java
+++ b/tests/performance/test-cases/mbw-json-jackson/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/Person.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Test data bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Person {
diff --git a/tests/performance/test-cases/mbw-json-jackson/src/test/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityTest.java b/tests/performance/test-cases/mbw-json-jackson/src/test/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityTest.java
index 2a25db3..249e367 100644
--- a/tests/performance/test-cases/mbw-json-jackson/src/test/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityTest.java
+++ b/tests/performance/test-cases/mbw-json-jackson/src/test/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for json resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JsonEntityTest extends JerseyTest {
diff --git a/tests/performance/test-cases/mbw-json-moxy/pom.xml b/tests/performance/test-cases/mbw-json-moxy/pom.xml
index 0affa22..22065d6 100644
--- a/tests/performance/test-cases/mbw-json-moxy/pom.xml
+++ b/tests/performance/test-cases/mbw-json-moxy/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>json-moxy</artifactId>
diff --git a/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JaxRsApplication.java b/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JaxRsApplication.java
index 76f96dc..037101d 100644
--- a/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JaxRsApplication.java
+++ b/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -27,7 +27,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityResource.java b/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityResource.java
index b7afc36..d6b166a 100644
--- a/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityResource.java
+++ b/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -27,7 +27,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.APPLICATION_JSON)
diff --git a/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/Person.java b/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/Person.java
index b3af2b0..03bb7c5 100644
--- a/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/Person.java
+++ b/tests/performance/test-cases/mbw-json-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/json/Person.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -21,7 +21,7 @@
/**
* Test data bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class Person {
diff --git a/tests/performance/test-cases/mbw-json-moxy/src/test/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityTest.java b/tests/performance/test-cases/mbw-json-moxy/src/test/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityTest.java
index acf2c42..b01c00d 100644
--- a/tests/performance/test-cases/mbw-json-moxy/src/test/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityTest.java
+++ b/tests/performance/test-cases/mbw-json-moxy/src/test/java/org/glassfish/jersey/tests/performance/mbw/json/JsonEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for json resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JsonEntityTest extends JerseyTest {
diff --git a/tests/performance/test-cases/mbw-kryo/pom.xml b/tests/performance/test-cases/mbw-kryo/pom.xml
index f22de56..a5190fe 100644
--- a/tests/performance/test-cases/mbw-kryo/pom.xml
+++ b/tests/performance/test-cases/mbw-kryo/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>mbw-kryo</artifactId>
diff --git a/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/JaxRsApplication.java b/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/JaxRsApplication.java
index 26eef29..5435a1c 100644
--- a/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/JaxRsApplication.java
+++ b/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/Person.java b/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/Person.java
index 8dc8d9e..0267ad4 100644
--- a/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/Person.java
+++ b/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/Person.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -21,7 +21,7 @@
/**
* Test data bean.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class Person {
diff --git a/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/PersonResource.java b/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/PersonResource.java
index f465365..f76fbf3 100644
--- a/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/PersonResource.java
+++ b/tests/performance/test-cases/mbw-kryo/src/main/java/org/glassfish/jersey/tests/performance/mbw/kryo/PersonResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Test resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
@Path("/")
@Consumes("application/x-kryo")
diff --git a/tests/performance/test-cases/mbw-kryo/src/test/java/org/glassfish/jersey/tests/performance/mbw/kryo/PersonResourceTest.java b/tests/performance/test-cases/mbw-kryo/src/test/java/org/glassfish/jersey/tests/performance/mbw/kryo/PersonResourceTest.java
index bf03e8b..9192580 100644
--- a/tests/performance/test-cases/mbw-kryo/src/test/java/org/glassfish/jersey/tests/performance/mbw/kryo/PersonResourceTest.java
+++ b/tests/performance/test-cases/mbw-kryo/src/test/java/org/glassfish/jersey/tests/performance/mbw/kryo/PersonResourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -29,7 +29,7 @@
/**
* Test for kryo resource.
*
- * @author Libor Kramolis (libor.kramolis at oracle.com)
+ * @author Libor Kramolis
*/
public class PersonResourceTest extends JerseyTest {
diff --git a/tests/performance/test-cases/mbw-text-plain/pom.xml b/tests/performance/test-cases/mbw-text-plain/pom.xml
index 9ea7147..acc8c21 100644
--- a/tests/performance/test-cases/mbw-text-plain/pom.xml
+++ b/tests/performance/test-cases/mbw-text-plain/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>text-plain</artifactId>
diff --git a/tests/performance/test-cases/mbw-text-plain/src/main/java/org/glassfish/jersey/tests/performance/mbw/text/JaxRsApplication.java b/tests/performance/test-cases/mbw-text-plain/src/main/java/org/glassfish/jersey/tests/performance/mbw/text/JaxRsApplication.java
index d6651e6..5cd0cba 100644
--- a/tests/performance/test-cases/mbw-text-plain/src/main/java/org/glassfish/jersey/tests/performance/mbw/text/JaxRsApplication.java
+++ b/tests/performance/test-cases/mbw-text-plain/src/main/java/org/glassfish/jersey/tests/performance/mbw/text/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/mbw-text-plain/src/main/java/org/glassfish/jersey/tests/performance/mbw/text/TextEntityResource.java b/tests/performance/test-cases/mbw-text-plain/src/main/java/org/glassfish/jersey/tests/performance/mbw/text/TextEntityResource.java
index 65af72c..9d83bc9 100644
--- a/tests/performance/test-cases/mbw-text-plain/src/main/java/org/glassfish/jersey/tests/performance/mbw/text/TextEntityResource.java
+++ b/tests/performance/test-cases/mbw-text-plain/src/main/java/org/glassfish/jersey/tests/performance/mbw/text/TextEntityResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/mbw-text-plain/src/test/java/org/glassfish/jersey/tests/performance/mbw/text/TextEntityTest.java b/tests/performance/test-cases/mbw-text-plain/src/test/java/org/glassfish/jersey/tests/performance/mbw/text/TextEntityTest.java
index fb6ecb4..c513571 100644
--- a/tests/performance/test-cases/mbw-text-plain/src/test/java/org/glassfish/jersey/tests/performance/mbw/text/TextEntityTest.java
+++ b/tests/performance/test-cases/mbw-text-plain/src/test/java/org/glassfish/jersey/tests/performance/mbw/text/TextEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for text plain resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class TextEntityTest extends JerseyTest {
diff --git a/tests/performance/test-cases/mbw-xml-jaxb/pom.xml b/tests/performance/test-cases/mbw-xml-jaxb/pom.xml
index fbdb9cd..33d745f 100644
--- a/tests/performance/test-cases/mbw-xml-jaxb/pom.xml
+++ b/tests/performance/test-cases/mbw-xml-jaxb/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>xml-jaxb</artifactId>
@@ -57,4 +57,24 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>jdk11+</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-osgi</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
diff --git a/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/JaxRsApplication.java b/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/JaxRsApplication.java
index 94a47ee..e23b191 100644
--- a/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/JaxRsApplication.java
+++ b/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/Person.java b/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/Person.java
index 8d9f6ff..b3f5692 100644
--- a/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/Person.java
+++ b/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/Person.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -23,7 +23,7 @@
/**
* Test data bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement
public class Person {
diff --git a/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityResource.java b/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityResource.java
index eaf625c..83bc1a0 100644
--- a/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityResource.java
+++ b/tests/performance/test-cases/mbw-xml-jaxb/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.APPLICATION_XML)
diff --git a/tests/performance/test-cases/mbw-xml-jaxb/src/test/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityTest.java b/tests/performance/test-cases/mbw-xml-jaxb/src/test/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityTest.java
index 8982902..4f87ab1 100644
--- a/tests/performance/test-cases/mbw-xml-jaxb/src/test/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityTest.java
+++ b/tests/performance/test-cases/mbw-xml-jaxb/src/test/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -28,7 +28,7 @@
/**
* Test for XML resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class XmlEntityTest extends JerseyTest {
diff --git a/tests/performance/test-cases/mbw-xml-moxy/pom.xml b/tests/performance/test-cases/mbw-xml-moxy/pom.xml
index 921d37f..aaf0edd 100644
--- a/tests/performance/test-cases/mbw-xml-moxy/pom.xml
+++ b/tests/performance/test-cases/mbw-xml-moxy/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>xml-moxy</artifactId>
diff --git a/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/JaxRsApplication.java b/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/JaxRsApplication.java
index 0de51b3..a10ccb0 100644
--- a/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/JaxRsApplication.java
+++ b/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/Person.java b/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/Person.java
index 2909ac5..2cc19b1 100644
--- a/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/Person.java
+++ b/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/Person.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -22,7 +22,7 @@
/**
* Test data bean.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement
public class Person {
diff --git a/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityResource.java b/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityResource.java
index a28abe7..af17728 100644
--- a/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityResource.java
+++ b/tests/performance/test-cases/mbw-xml-moxy/src/main/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019 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
@@ -28,7 +28,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
@Consumes(MediaType.APPLICATION_XML)
diff --git a/tests/performance/test-cases/mbw-xml-moxy/src/test/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityTest.java b/tests/performance/test-cases/mbw-xml-moxy/src/test/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityTest.java
index 9fabc89..d1f6e56 100644
--- a/tests/performance/test-cases/mbw-xml-moxy/src/test/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityTest.java
+++ b/tests/performance/test-cases/mbw-xml-moxy/src/test/java/org/glassfish/jersey/tests/performance/mbw/xml/XmlEntityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -30,7 +30,7 @@
/**
* Test for XML resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class XmlEntityTest extends JerseyTest {
diff --git a/tests/performance/test-cases/param-srl/pom.xml b/tests/performance/test-cases/param-srl/pom.xml
index 650a3eb..5337434 100644
--- a/tests/performance/test-cases/param-srl/pom.xml
+++ b/tests/performance/test-cases/param-srl/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>param-srl</artifactId>
diff --git a/tests/performance/test-cases/param-srl/src/main/java/org/glassfish/jersey/tests/performance/param/srl/JaxRsApplication.java b/tests/performance/test-cases/param-srl/src/main/java/org/glassfish/jersey/tests/performance/param/srl/JaxRsApplication.java
index c6dc78d..a163edb 100644
--- a/tests/performance/test-cases/param-srl/src/main/java/org/glassfish/jersey/tests/performance/param/srl/JaxRsApplication.java
+++ b/tests/performance/test-cases/param-srl/src/main/java/org/glassfish/jersey/tests/performance/param/srl/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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,7 +24,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/param-srl/src/main/java/org/glassfish/jersey/tests/performance/param/srl/SrlResource.java b/tests/performance/test-cases/param-srl/src/main/java/org/glassfish/jersey/tests/performance/param/srl/SrlResource.java
index 2b06e62..e12da4d 100644
--- a/tests/performance/test-cases/param-srl/src/main/java/org/glassfish/jersey/tests/performance/param/srl/SrlResource.java
+++ b/tests/performance/test-cases/param-srl/src/main/java/org/glassfish/jersey/tests/performance/param/srl/SrlResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -27,7 +27,7 @@
/**
* Test resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("/")
public class SrlResource {
diff --git a/tests/performance/test-cases/param-srl/src/test/java/org/glassfish/jersey/tests/performance/param/srl/SrlSrmTest.java b/tests/performance/test-cases/param-srl/src/test/java/org/glassfish/jersey/tests/performance/param/srl/SrlSrmTest.java
index d4ad937..70a559c 100644
--- a/tests/performance/test-cases/param-srl/src/test/java/org/glassfish/jersey/tests/performance/param/srl/SrlSrmTest.java
+++ b/tests/performance/test-cases/param-srl/src/test/java/org/glassfish/jersey/tests/performance/param/srl/SrlSrmTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Test for SRL/SRM resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class SrlSrmTest extends JerseyTest {
diff --git a/tests/performance/test-cases/pom.xml b/tests/performance/test-cases/pom.xml
index 4b0852f..ca32d0b 100644
--- a/tests/performance/test-cases/pom.xml
+++ b/tests/performance/test-cases/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
diff --git a/tests/performance/test-cases/proxy-injection/pom.xml b/tests/performance/test-cases/proxy-injection/pom.xml
index 89c9f15..acc5256 100644
--- a/tests/performance/test-cases/proxy-injection/pom.xml
+++ b/tests/performance/test-cases/proxy-injection/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance.testcases</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>proxy-injection</artifactId>
diff --git a/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/FieldInjectedResource.java b/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/FieldInjectedResource.java
index ff024f7..1e5567a 100644
--- a/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/FieldInjectedResource.java
+++ b/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/FieldInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
/**
* Test resource to test field injected proxy-able parameters.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("field-injected")
@Produces(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/JaxRsApplication.java b/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/JaxRsApplication.java
index c396a1a..6b0faad 100644
--- a/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/JaxRsApplication.java
+++ b/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/JaxRsApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -23,7 +23,7 @@
/**
* Test case JAX-RS application.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class JaxRsApplication extends Application {
diff --git a/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/MethodInjectedResource.java b/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/MethodInjectedResource.java
index 062e8fd..90670dc 100644
--- a/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/MethodInjectedResource.java
+++ b/tests/performance/test-cases/proxy-injection/src/main/java/org/glassfish/jersey/tests/performance/proxy/injection/MethodInjectedResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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
@@ -29,7 +29,7 @@
/**
* Test resource to compare resource method with and without injected method proxiable parameters.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@Path("method-injected")
@Produces(MediaType.TEXT_PLAIN)
diff --git a/tests/performance/test-cases/proxy-injection/src/test/java/org/glassfish/jersey/tests/performance/proxy/injection/InjectedResourcesTest.java b/tests/performance/test-cases/proxy-injection/src/test/java/org/glassfish/jersey/tests/performance/proxy/injection/InjectedResourcesTest.java
index 2c9aeba..e504f05 100644
--- a/tests/performance/test-cases/proxy-injection/src/test/java/org/glassfish/jersey/tests/performance/proxy/injection/InjectedResourcesTest.java
+++ b/tests/performance/test-cases/proxy-injection/src/test/java/org/glassfish/jersey/tests/performance/proxy/injection/InjectedResourcesTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -26,7 +26,7 @@
/**
* Test for field/method injected resource.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class InjectedResourcesTest extends JerseyTest {
diff --git a/tests/performance/tools/pom.xml b/tests/performance/tools/pom.xml
index cce515f..8a4b556 100644
--- a/tests/performance/tools/pom.xml
+++ b/tests/performance/tools/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.glassfish.jersey.tests.performance</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests.performance.tools</groupId>
<artifactId>performance-test-tools</artifactId>
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/ConstantTestValueGenerator.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/ConstantTestValueGenerator.java
index eba4e1b..d4233ab 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/ConstantTestValueGenerator.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/ConstantTestValueGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
*
* Due to its constant nature, this strategy is not suitable for use with {@link java.util.Set}.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class ConstantTestValueGenerator extends TestValueGenerator {
private static final int intConstant = 123456789;
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/GenerateForTest.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/GenerateForTest.java
index 4b6fb27..9ef2059 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/GenerateForTest.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/GenerateForTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -23,7 +23,7 @@
* Annotation to mark fields of a bean to be populated by
* {@link org.glassfish.jersey.tests.performance.tools.TestValueGenerator} during the test data generation process.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface GenerateForTest {
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/Person.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/Person.java
index 9fafa2c..1161482 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/Person.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/Person.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
/**
* Person data bean, copied from mbw tests and annotated for the test data generation tool.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
@XmlRootElement
public class Person {
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/RandomTestValueGenerator.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/RandomTestValueGenerator.java
index 3f0f961..a0b1730 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/RandomTestValueGenerator.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/RandomTestValueGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -21,7 +21,7 @@
/**
* Implementation of {@link org.glassfish.jersey.tests.performance.tools.TestValueGenerator} producing random results.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class RandomTestValueGenerator extends TestValueGenerator {
private static final int MAX_STRING_LENGTH = 50;
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBean.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBean.java
index b3f0317..8447358 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBean.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -28,7 +28,7 @@
/**
* Example of a complex testing bean.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
@XmlRootElement
public class TestBean {
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanCoordinates.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanCoordinates.java
index 7326b98..b256672 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanCoordinates.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanCoordinates.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Part of a complex test bean example, contained in {@link org.glassfish.jersey.tests.performance.tools.TestBeanInfo}
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class TestBeanCoordinates {
@GenerateForTest
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanEnum.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanEnum.java
index 4ba4dc9..c29f65b 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanEnum.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanEnum.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Nested type of {@link org.glassfish.jersey.tests.performance.tools.TestBean}
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public enum TestBeanEnum {
VALUE_1, VALUE_2, VALUE_3;
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanInfo.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanInfo.java
index 5dd6ccc..e73e408 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanInfo.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestBeanInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Nested testing bean, contained in {@link org.glassfish.jersey.tests.performance.tools.TestBean}
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class TestBeanInfo {
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGenerationStrategy.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGenerationStrategy.java
index ab6dc47..49b1f04 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGenerationStrategy.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGenerationStrategy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Enum for test data generation strategies.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public enum TestDataGenerationStrategy {
CONSTANT,
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGenerator.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGenerator.java
index c30efa4..7d093e2 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGenerator.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -22,7 +22,7 @@
/**
* Instantiates and populates a bean with testing data.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class TestDataGenerator {
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGeneratorApp.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGeneratorApp.java
index 857c45f..5db1ea1 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGeneratorApp.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestDataGeneratorApp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -55,7 +55,7 @@
*
* <p>Run the generation by invoking {@code mvn clean compile} and {@code mvn exec:java} commands in the module root folder.</p>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class TestDataGeneratorApp {
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestValueGenerator.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestValueGenerator.java
index 779acfb..6d73d06 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestValueGenerator.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestValueGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 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
@@ -31,7 +31,7 @@
* <p>Every field which should be populated must be annotated by
* {@link org.glassfish.jersey.tests.performance.tools.GenerateForTest}</p>
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public abstract class TestValueGenerator {
diff --git a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestValueGeneratorFactory.java b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestValueGeneratorFactory.java
index cb268b5..f79dac2 100644
--- a/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestValueGeneratorFactory.java
+++ b/tests/performance/tools/src/main/java/org/glassfish/jersey/tests/performance/tools/TestValueGeneratorFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,7 +19,7 @@
/**
* Factory for {@link org.glassfish.jersey.tests.performance.tools.TestValueGenerator} implementations.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public class TestValueGeneratorFactory {
/**
diff --git a/tests/pom.xml b/tests/pom.xml
index 589b811..6f16d9b 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<groupId>org.glassfish.jersey.tests</groupId>
@@ -45,6 +45,7 @@
<module>e2e-server</module>
<module>e2e-testng</module>
<module>integration</module>
+ <module>jmockit</module>
<module>mem-leaks</module>
<module>osgi</module>
<module>stress</module>
diff --git a/tests/stress/pom.xml b/tests/stress/pom.xml
index c9cd360..ce093e3 100644
--- a/tests/stress/pom.xml
+++ b/tests/stress/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.glassfish.jersey.tests</groupId>
<artifactId>project</artifactId>
- <version>2.29-SNAPSHOT</version>
+ <version>2.30-SNAPSHOT</version>
</parent>
<artifactId>stress</artifactId>
diff --git a/tests/stress/src/test/java/org/glassfish/jersey/server/internal/monitoring/MultiThreadingAggregatedReservoirTest.java b/tests/stress/src/test/java/org/glassfish/jersey/server/internal/monitoring/MultiThreadingAggregatedReservoirTest.java
index 95fff83..8e5f485 100644
--- a/tests/stress/src/test/java/org/glassfish/jersey/server/internal/monitoring/MultiThreadingAggregatedReservoirTest.java
+++ b/tests/stress/src/test/java/org/glassfish/jersey/server/internal/monitoring/MultiThreadingAggregatedReservoirTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 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
@@ -39,7 +39,7 @@
/**
* Multi Threading concurrency test of Jersey monitoring internals.
*
- * @author Stepan Vavra (stepan.vavra at oracle.com)
+ * @author Stepan Vavra
*/
public class MultiThreadingAggregatedReservoirTest {
diff --git a/tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/Configuration.java b/tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/Configuration.java
index 16ef162..b461c6e 100644
--- a/tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/Configuration.java
+++ b/tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/Configuration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +20,7 @@
* Container class for plugin configuration.
* Holds the content of the loaded template files.
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
class Configuration {
private String sectionTemplate;
diff --git a/tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/PredefinedCategories.java b/tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/PredefinedCategories.java
index cdc6a2e..e9a5dc7 100644
--- a/tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/PredefinedCategories.java
+++ b/tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/PredefinedCategories.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019 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,7 +20,7 @@
* Jersey module categories definition.
* The categories are based on maven groupId, this enum assigns to each "known" groupId a human-readable caption
*
- * @author Adam Lindenthal (adam.lindenthal at oracle.com)
+ * @author Adam Lindenthal
*/
public enum PredefinedCategories {
CORE("org.glassfish.jersey.core", "Jersey Core"),
diff --git a/tools/perftest-agent/src/main/java/org/glassfish/jersey/perftest/agent/PerfTestAgent.java b/tools/perftest-agent/src/main/java/org/glassfish/jersey/perftest/agent/PerfTestAgent.java
index d574f73..68c7979 100644
--- a/tools/perftest-agent/src/main/java/org/glassfish/jersey/perftest/agent/PerfTestAgent.java
+++ b/tools/perftest-agent/src/main/java/org/glassfish/jersey/perftest/agent/PerfTestAgent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -34,7 +34,7 @@
*
* This one has been tested with Grizzly 2, Catalina and WLS.
*
- * @author Jakub Podlesak (jakub.podlesak at oracle.com)
+ * @author Jakub Podlesak
*/
public class PerfTestAgent {