From 1a8e36dcebb3fa8bad39983aa860e95155eb15a6 Mon Sep 17 00:00:00 2001 From: Santiago Pericas-Geertsen Date: Mon, 2 Oct 2023 12:25:50 -0400 Subject: [PATCH] Fixed some problems with Entity and Context in comments (#1180) * Fixed some problems with Entity and Context in comments. * Updates copyrights. Signed-off-by: Santiago Pericasgeertsen --------- Signed-off-by: Santiago Pericasgeertsen --- jaxrs-api/src/main/java/jakarta/ws/rs/BeanParam.java | 4 ++-- .../java/jakarta/ws/rs/container/ResourceContext.java | 6 ++---- .../src/main/java/jakarta/ws/rs/core/Application.java | 10 ++++------ .../src/main/java/jakarta/ws/rs/core/Configurable.java | 6 ++---- .../main/java/jakarta/ws/rs/core/Configuration.java | 7 +++---- .../src/main/java/jakarta/ws/rs/core/HttpHeaders.java | 5 +---- .../main/java/jakarta/ws/rs/core/SecurityContext.java | 5 +---- .../src/main/java/jakarta/ws/rs/core/UriInfo.java | 5 +---- .../main/java/jakarta/ws/rs/ext/ContextResolver.java | 5 +---- .../src/main/java/jakarta/ws/rs/ext/Providers.java | 4 +--- .../src/main/java/jakarta/ws/rs/sse/SseEventSink.java | 4 ++-- 11 files changed, 20 insertions(+), 41 deletions(-) diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/BeanParam.java b/jaxrs-api/src/main/java/jakarta/ws/rs/BeanParam.java index 46cae3300..2b685f759 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/BeanParam.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/BeanParam.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -30,7 +30,7 @@ *

* The JAX-RS runtime will instantiate the object and inject all it's fields and properties annotated with either one of * the {@code @XxxParam} annotation ({@link PathParam @PathParam}, {@link FormParam @FormParam} ...) or the - * {@link Entity @Context} annotation. For the POJO classes same instantiation and injection rules + * {@link Entity @Entity} annotation. For the POJO classes same instantiation and injection rules * apply as in case of instantiation and injection of request-scoped root resource classes. *

* For example: diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/container/ResourceContext.java b/jaxrs-api/src/main/java/jakarta/ws/rs/container/ResourceContext.java index 1d90c495b..acb51fd0f 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/container/ResourceContext.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/container/ResourceContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,10 @@ package jakarta.ws.rs.container; -import jakarta.ws.rs.Entity; - /** * The resource context provides access to instances of resource classes. *

- * This interface can be injected using the {@link Entity} annotation. + * This interface can be injected using the {@link jakarta.inject.Inject} annotation. *

*

* The resource context can be utilized when instances of managed resource classes are to be returned by sub-resource diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Application.java b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Application.java index 69f5e3fe0..e9f3f1f55 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Application.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Application.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,14 +20,12 @@ import java.util.Map; import java.util.Set; -import jakarta.ws.rs.Entity; - /** * Defines the components of a JAX-RS application and supplies additional meta-data. A JAX-RS application or * implementation supplies a concrete subclass of this abstract class. *

- * The implementation-created instance of an Application subclass may be injected into resource classes and providers - * using {@link Entity}. + * The implementation-created instance of an Application subclass may be injected into resource classes and + * providers using {@link jakarta.inject.Inject}. *

*

* In case any of the {@code Application} subclass methods or it's constructor throws a {@link RuntimeException}, the @@ -64,7 +62,7 @@ public Set> getClasses() { /** * Get a set of root resource, provider and {@link Feature feature} instances. * - * Fields and properties of returned instances are injected with their declared dependencies (see {@link Entity}) by + * Fields and properties of returned instances are injected with their declared dependencies by * the runtime prior to use. *

* Implementations should warn about and ignore classes that do not conform to the requirements of root resource or diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Configurable.java b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Configurable.java index aded3ab0c..e07766295 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Configurable.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Configurable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,8 +18,6 @@ import java.util.Map; -import jakarta.ws.rs.Entity; - /** * Represents a client or server-side configurable context in JAX-RS. * @@ -263,7 +261,7 @@ public interface Configurable { * As opposed to components registered via {@link #register(Class)} method, the lifecycle of providers registered using * this instance-based {@code register(...)} is not managed by JAX-RS runtime. The same registered component instance is * used during the whole lifespan of the configurable context. Fields and properties of all registered JAX-RS component - * instances are injected with their declared dependencies (see {@link Entity}) by the JAX-RS runtime prior to use. + * instances are injected with their declared dependencies by the JAX-RS runtime prior to use. *

* * @param component JAX-RS component instance to be configured in the scope of this configurable context. diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Configuration.java b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Configuration.java index fd9c2a2eb..6f7e40b3c 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Configuration.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Configuration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,7 +20,6 @@ import java.util.Map; import java.util.Set; -import jakarta.ws.rs.Entity; import jakarta.ws.rs.RuntimeType; /** @@ -33,7 +32,7 @@ * component classes and/or instances. *

*

- * This interface can be injected using the {@link Entity} annotation. + * This interface can be injected using the {@link jakarta.inject.Inject} annotation. *

* * @author Marek Potociar @@ -175,7 +174,7 @@ public default boolean hasProperty(String name) { /** * Get the immutable set of registered JAX-RS component (such as provider or {@link Feature feature}) instances to be * utilized by the configurable instance. Fields and properties of returned instances are injected with their declared - * dependencies (see {@link Entity}) by the runtime prior to use. + * dependencies by the runtime prior to use. *

* For each component type, there can be only a single class-based or instance-based registration present in the * configuration context at any given time. diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/core/HttpHeaders.java b/jaxrs-api/src/main/java/jakarta/ws/rs/core/HttpHeaders.java index d49afa34b..aeaf1e145 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/core/HttpHeaders.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/core/HttpHeaders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,15 +21,12 @@ import java.util.Locale; import java.util.Map; -import jakarta.ws.rs.Entity; - /** * An injectable interface that provides access to HTTP header information. All methods throw * {@link java.lang.IllegalStateException} if called outside the scope of a request (e.g. from a provider constructor). * * @author Paul Sandoz * @author Marc Hadley - * @see Entity * @since 1.0 */ public interface HttpHeaders { diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/core/SecurityContext.java b/jaxrs-api/src/main/java/jakarta/ws/rs/core/SecurityContext.java index 07f0f4824..5f6343d79 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/core/SecurityContext.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/core/SecurityContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,14 +18,11 @@ import java.security.Principal; -import jakarta.ws.rs.Entity; - /** * An injectable interface that provides access to security related information. * * @author Paul Sandoz * @author Marc Hadley - * @see Entity * @since 1.0 */ public interface SecurityContext { diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/core/UriInfo.java b/jaxrs-api/src/main/java/jakarta/ws/rs/core/UriInfo.java index 8a2a0c9f0..271dff6b9 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/core/UriInfo.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/core/UriInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,8 +19,6 @@ import java.net.URI; import java.util.List; -import jakarta.ws.rs.Entity; - /** * An injectable interface that provides access to application and request URI information. Relative URIs are relative * to the base URI of the application, see {@link #getBaseUri}. @@ -32,7 +30,6 @@ * * @author Paul Sandoz * @author Marc Hadley - * @see Entity * @since 1.0 */ public interface UriInfo { diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/ext/ContextResolver.java b/jaxrs-api/src/main/java/jakarta/ws/rs/ext/ContextResolver.java index 094255f58..5ba914141 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/ext/ContextResolver.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/ext/ContextResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,8 +16,6 @@ package jakarta.ws.rs.ext; -import jakarta.ws.rs.Entity; - /** * Contract for a provider that supplies context information to resource classes and other providers. * @@ -32,7 +30,6 @@ * @param type of the context * @author Paul Sandoz * @author Marc Hadley - * @see Entity * @see Providers#getContextResolver(Class, jakarta.ws.rs.core.MediaType) * @see Provider * @see jakarta.ws.rs.Produces diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/ext/Providers.java b/jaxrs-api/src/main/java/jakarta/ws/rs/ext/Providers.java index d436ce5e3..85deb65b8 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/ext/Providers.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/ext/Providers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,7 +19,6 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import jakarta.ws.rs.Entity; import jakarta.ws.rs.core.MediaType; /** @@ -27,7 +26,6 @@ * * @author Paul Sandoz * @author Marc Hadley - * @see Entity * @see MessageBodyReader * @see MessageBodyWriter * @see ContextResolver diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java b/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java index bf37ce372..ae2e55704 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -27,7 +27,7 @@ * @GET * @Path("eventStream") * @Produces(MediaType.SERVER_SENT_EVENTS) - * public void eventStream(@Context SseEventSink eventSink) { + * public void eventStream(SseEventSink eventSink) { * // ... * } *