Jakarta EE 9 migration

Upgrades many dependency declarations; removes old EJB 2.x support and outdated Servlet-based integrations (Commons FileUpload, FreeMarker JSP support, Tiles).

Closes gh-22093
Closes gh-25354
Closes gh-26185
Closes gh-27423
See gh-27424
This commit is contained in:
Juergen Hoeller
2021-09-17 09:14:07 +02:00
parent 5822f1bf85
commit d84ca2ba90
1291 changed files with 4992 additions and 25322 deletions

View File

@@ -409,7 +409,7 @@ public class MethodParameter {
/**
* Check whether this method parameter is annotated with any variant of a
* {@code Nullable} annotation, e.g. {@code javax.annotation.Nullable} or
* {@code Nullable} annotation, e.g. {@code jakarta.annotation.Nullable} or
* {@code edu.umd.cs.findbugs.annotations.Nullable}.
*/
private boolean hasNullableAnnotation() {

View File

@@ -29,7 +29,7 @@ import org.springframework.lang.Nullable;
* {@code AnnotationAwareOrderComparator} is an extension of
* {@link OrderComparator} that supports Spring's
* {@link org.springframework.core.Ordered} interface as well as the
* {@link Order @Order} and {@link javax.annotation.Priority @Priority}
* {@link Order @Order} and {@link jakarta.annotation.Priority @Priority}
* annotations, with an order value provided by an {@code Ordered}
* instance overriding a statically defined annotation value (if any).
*
@@ -42,7 +42,7 @@ import org.springframework.lang.Nullable;
* @since 2.0.1
* @see org.springframework.core.Ordered
* @see org.springframework.core.annotation.Order
* @see javax.annotation.Priority
* @see jakarta.annotation.Priority
*/
public class AnnotationAwareOrderComparator extends OrderComparator {
@@ -54,7 +54,7 @@ public class AnnotationAwareOrderComparator extends OrderComparator {
/**
* This implementation checks for {@link Order @Order} or
* {@link javax.annotation.Priority @Priority} on various kinds of
* {@link jakarta.annotation.Priority @Priority} on various kinds of
* elements, in addition to the {@link org.springframework.core.Ordered}
* check in the superclass.
*/
@@ -80,7 +80,7 @@ public class AnnotationAwareOrderComparator extends OrderComparator {
}
/**
* This implementation retrieves an @{@link javax.annotation.Priority}
* This implementation retrieves an @{@link jakarta.annotation.Priority}
* value, allowing for additional semantics over the regular @{@link Order}
* annotation: typically, selecting one object over another in case of
* multiple matches but only one object to be returned.

View File

@@ -40,7 +40,7 @@ import org.springframework.core.Ordered;
* order which is an orthogonal concern determined by dependency relationships and
* {@code @DependsOn} declarations (influencing a runtime-determined dependency graph).
*
* <p>Since Spring 4.1, the standard {@link javax.annotation.Priority} annotation
* <p>Since Spring 4.1, the standard {@link jakarta.annotation.Priority} annotation
* can be used as a drop-in replacement for this annotation in ordering scenarios.
* Note that {@code @Priority} may have additional semantics when a single element
* has to be picked (see {@link AnnotationAwareOrderComparator#getPriority}).
@@ -58,7 +58,7 @@ import org.springframework.core.Ordered;
* @see org.springframework.core.Ordered
* @see AnnotationAwareOrderComparator
* @see OrderUtils
* @see javax.annotation.Priority
* @see jakarta.annotation.Priority
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})

View File

@@ -25,20 +25,20 @@ import org.springframework.util.ConcurrentReferenceHashMap;
/**
* General utility for determining the order of an object based on its type declaration.
* Handles Spring's {@link Order} annotation as well as {@link javax.annotation.Priority}.
* Handles Spring's {@link Order} annotation as well as {@link jakarta.annotation.Priority}.
*
* @author Stephane Nicoll
* @author Juergen Hoeller
* @since 4.1
* @see Order
* @see javax.annotation.Priority
* @see jakarta.annotation.Priority
*/
public abstract class OrderUtils {
/** Cache marker for a non-annotated Class. */
private static final Object NOT_ANNOTATED = new Object();
private static final String JAVAX_PRIORITY_ANNOTATION = "javax.annotation.Priority";
private static final String JAVAX_PRIORITY_ANNOTATION = "jakarta.annotation.Priority";
/** Cache for @Order value (or NOT_ANNOTATED marker) per Class. */
private static final Map<AnnotatedElement, Object> orderCache = new ConcurrentReferenceHashMap<>(64);
@@ -47,7 +47,7 @@ public abstract class OrderUtils {
/**
* Return the order on the specified {@code type}, or the specified
* default value if none can be found.
* <p>Takes care of {@link Order @Order} and {@code @javax.annotation.Priority}.
* <p>Takes care of {@link Order @Order} and {@code @jakarta.annotation.Priority}.
* @param type the type to handle
* @return the priority value, or the specified default order if none can be found
* @since 5.0
@@ -61,7 +61,7 @@ public abstract class OrderUtils {
/**
* Return the order on the specified {@code type}, or the specified
* default value if none can be found.
* <p>Takes care of {@link Order @Order} and {@code @javax.annotation.Priority}.
* <p>Takes care of {@link Order @Order} and {@code @jakarta.annotation.Priority}.
* @param type the type to handle
* @return the priority value, or the specified default order if none can be found
* @see #getPriority(Class)
@@ -74,7 +74,7 @@ public abstract class OrderUtils {
/**
* Return the order on the specified {@code type}.
* <p>Takes care of {@link Order @Order} and {@code @javax.annotation.Priority}.
* <p>Takes care of {@link Order @Order} and {@code @jakarta.annotation.Priority}.
* @param type the type to handle
* @return the order value, or {@code null} if none can be found
* @see #getPriority(Class)
@@ -86,7 +86,7 @@ public abstract class OrderUtils {
/**
* Return the order declared on the specified {@code element}.
* <p>Takes care of {@link Order @Order} and {@code @javax.annotation.Priority}.
* <p>Takes care of {@link Order @Order} and {@code @jakarta.annotation.Priority}.
* @param element the annotated element (e.g. type or method)
* @return the order value, or {@code null} if none can be found
* @since 5.3
@@ -99,7 +99,7 @@ public abstract class OrderUtils {
/**
* Return the order from the specified annotations collection.
* <p>Takes care of {@link Order @Order} and
* {@code @javax.annotation.Priority}.
* {@code @jakarta.annotation.Priority}.
* @param element the source element
* @param annotations the annotation to consider
* @return the order value, or {@code null} if none can be found
@@ -132,7 +132,7 @@ public abstract class OrderUtils {
}
/**
* Return the value of the {@code javax.annotation.Priority} annotation
* Return the value of the {@code jakarta.annotation.Priority} annotation
* declared on the specified type, or {@code null} if none.
* @param type the type to handle
* @return the priority value if the annotation is declared, or {@code null} if none

View File

@@ -18,7 +18,7 @@ package org.springframework.core.io;
/**
* Extended interface for a resource that is loaded from an enclosing
* 'context', e.g. from a {@link javax.servlet.ServletContext} but also
* 'context', e.g. from a {@link jakarta.servlet.ServletContext} but also
* from plain classpath paths or relative file system paths (specified
* without an explicit prefix, hence applying relative to the local
* {@link ResourceLoader}'s context).

View File

@@ -102,7 +102,7 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator
* Specify an external factory to use for creating new Threads,
* instead of relying on the local properties of this executor.
* <p>You may specify an inner ThreadFactory bean or also a ThreadFactory reference
* obtained from JNDI (on a Java EE 6 server) or some other lookup mechanism.
* obtained from JNDI (on a Jakarta EE server) or some other lookup mechanism.
* @see #setThreadNamePrefix
* @see #setThreadPriority
*/

View File

@@ -30,12 +30,12 @@ import org.springframework.util.Assert;
* <p>This is primarily for adapting to client components that communicate via the
* {@code java.util.concurrent.ExecutorService} API. It can also be used as
* common ground between a local Spring {@code TaskExecutor} backend and a
* JNDI-located {@code ManagedExecutorService} in a Java EE 7 environment.
* JNDI-located {@code ManagedExecutorService} in a Jakarta EE environment.
*
* <p><b>NOTE:</b> This ExecutorService adapter does <em>not</em> support the
* lifecycle methods in the {@code java.util.concurrent.ExecutorService} API
* ("shutdown()" etc), similar to a server-wide {@code ManagedExecutorService}
* in a Java EE 7 environment. The lifecycle is always up to the backend pool,
* in a Jakarta EE environment. The lifecycle is always up to the backend pool,
* with this adapter acting as an access-only proxy for that target pool.
*
* @author Juergen Hoeller

View File

@@ -32,9 +32,9 @@ import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.Resource;
import javax.annotation.meta.When;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

View File

@@ -19,8 +19,7 @@ package org.springframework.core.annotation;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Priority;
import jakarta.annotation.Priority;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -35,8 +35,7 @@ import java.util.NoSuchElementException;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.core.Ordered;
@@ -3011,14 +3010,14 @@ class MergedAnnotationsTests {
}
/**
* Mimics javax.persistence.Id
* Mimics jakarta.persistence.Id
*/
@Retention(RUNTIME)
@interface Id {
}
/**
* Mimics javax.persistence.GeneratedValue
* Mimics jakarta.persistence.GeneratedValue
*/
@Retention(RUNTIME)
@interface GeneratedValue {

View File

@@ -16,8 +16,7 @@
package org.springframework.core.annotation;
import javax.annotation.Priority;
import jakarta.annotation.Priority;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -18,8 +18,7 @@ package org.springframework.util;
import java.io.UnsupportedEncodingException;
import javax.xml.bind.DatatypeConverter;
import jakarta.xml.bind.DatatypeConverter;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;