diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java b/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java index 2020c9fa73..8335dbf1ae 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,11 +32,10 @@ import org.springframework.util.Assert; /** * Utility class for handling registration of AOP auto-proxy creators. * - *

Only a single auto-proxy creator can be registered yet multiple concrete - * implementations are available. Therefore this class wraps a simple escalation - * protocol, allowing classes to request a particular auto-proxy creator and know - * that class, {@code or a subclass thereof}, will eventually be resident - * in the application context. + *

Only a single auto-proxy creator should be registered yet multiple concrete + * implementations are available. This class provides a simple escalation protocol, + * allowing a caller to request a particular auto-proxy creator and know that creator, + * or a more capable variant thereof, will be registered as a post-processor. * * @author Rob Harrop * @author Juergen Hoeller @@ -55,12 +54,10 @@ public abstract class AopConfigUtils { /** * Stores the auto proxy creator classes in escalation order. */ - private static final List> APC_PRIORITY_LIST = new ArrayList<>(); + private static final List> APC_PRIORITY_LIST = new ArrayList<>(3); - /** - * Setup the escalation list. - */ static { + // Set up the escalation list... APC_PRIORITY_LIST.add(InfrastructureAdvisorAutoProxyCreator.class); APC_PRIORITY_LIST.add(AspectJAwareAdvisorAutoProxyCreator.class); APC_PRIORITY_LIST.add(AnnotationAwareAspectJAutoProxyCreator.class); @@ -73,8 +70,8 @@ public abstract class AopConfigUtils { } @Nullable - public static BeanDefinition registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry, - @Nullable Object source) { + public static BeanDefinition registerAutoProxyCreatorIfNecessary( + BeanDefinitionRegistry registry, @Nullable Object source) { return registerOrEscalateApcAsRequired(InfrastructureAdvisorAutoProxyCreator.class, registry, source); } @@ -85,8 +82,8 @@ public abstract class AopConfigUtils { } @Nullable - public static BeanDefinition registerAspectJAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry, - @Nullable Object source) { + public static BeanDefinition registerAspectJAutoProxyCreatorIfNecessary( + BeanDefinitionRegistry registry, @Nullable Object source) { return registerOrEscalateApcAsRequired(AspectJAwareAdvisorAutoProxyCreator.class, registry, source); } @@ -97,8 +94,8 @@ public abstract class AopConfigUtils { } @Nullable - public static BeanDefinition registerAspectJAnnotationAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry, - @Nullable Object source) { + public static BeanDefinition registerAspectJAnnotationAutoProxyCreatorIfNecessary( + BeanDefinitionRegistry registry, @Nullable Object source) { return registerOrEscalateApcAsRequired(AnnotationAwareAspectJAutoProxyCreator.class, registry, source); } @@ -118,8 +115,8 @@ public abstract class AopConfigUtils { } @Nullable - private static BeanDefinition registerOrEscalateApcAsRequired(Class cls, BeanDefinitionRegistry registry, - @Nullable Object source) { + private static BeanDefinition registerOrEscalateApcAsRequired( + Class cls, BeanDefinitionRegistry registry, @Nullable Object source) { Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java index 7276ec7843..c5d6e6efb0 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,11 +28,11 @@ import org.springframework.lang.Nullable; * Utility class for handling registration of auto-proxy creators used internally * by the '{@code aop}' namespace tags. * - *

Only a single auto-proxy creator can be registered and multiple tags may wish - * to register different concrete implementations. As such this class delegates to - * {@link AopConfigUtils} which wraps a simple escalation protocol. Therefore classes - * may request a particular auto-proxy creator and know that class, or a subclass - * thereof, will eventually be resident in the application context. + *

Only a single auto-proxy creator should be registered and multiple configuration + * elements may wish to register different concrete implementations. As such this class + * delegates to {@link AopConfigUtils} which provides a simple escalation protocol. + * Callers may request a particular auto-proxy creator and know that creator, + * or a more capable variant thereof, will be registered as a post-processor. * * @author Rob Harrop * @author Juergen Hoeller @@ -95,9 +95,8 @@ public abstract class AopNamespaceUtils { private static void registerComponentIfNecessary(@Nullable BeanDefinition beanDefinition, ParserContext parserContext) { if (beanDefinition != null) { - BeanComponentDefinition componentDefinition = - new BeanComponentDefinition(beanDefinition, AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME); - parserContext.registerComponent(componentDefinition); + parserContext.registerComponent( + new BeanComponentDefinition(beanDefinition, AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME)); } } diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ForkJoinPoolFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ForkJoinPoolFactoryBean.java index 0c6501189a..6ad96135d9 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ForkJoinPoolFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ForkJoinPoolFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,12 +27,6 @@ import org.springframework.lang.Nullable; /** * A Spring {@link FactoryBean} that builds and exposes a preconfigured {@link ForkJoinPool}. * - *

For details on the ForkJoinPool API and its use with RecursiveActions, see the - * JDK 7 javadoc. - * - *

{@code jsr166.jar}, containing {@code java.util.concurrent} updates for Java 6, can be obtained - * from the concurrency interest website. - * * @author Juergen Hoeller * @since 3.1 */ diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java index 543204021e..6ed5a196e1 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java @@ -111,7 +111,7 @@ public class ScheduledExecutorFactoryBean extends ExecutorConfigurationSupport } /** - * Set the remove-on-cancel mode on {@link ScheduledThreadPoolExecutor} (JDK 7+). + * Set the remove-on-cancel mode on {@link ScheduledThreadPoolExecutor}. *

Default is {@code false}. If set to {@code true}, the target executor will be * switched into remove-on-cancel mode (if possible, with a soft fallback otherwise). */ diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java index c19ea3a686..5639d6066d 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java @@ -88,7 +88,7 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport } /** - * Set the remove-on-cancel mode on {@link ScheduledThreadPoolExecutor} (JDK 7+). + * Set the remove-on-cancel mode on {@link ScheduledThreadPoolExecutor}. *

Default is {@code false}. If set to {@code true}, the target executor will be * switched into remove-on-cancel mode (if possible, with a soft fallback otherwise). *

This setting can be modified at runtime, for example through JMX. diff --git a/spring-core/src/main/java/org/springframework/core/annotation/OrderUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/OrderUtils.java index e73ec9d7b7..29fea2133b 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/OrderUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/OrderUtils.java @@ -49,7 +49,7 @@ public abstract class OrderUtils { ClassUtils.forName("javax.annotation.Priority", OrderUtils.class.getClassLoader()); } catch (Throwable ex) { - // javax.annotation.Priority not available, or present but not loadable (on JDK 6) + // javax.annotation.Priority not available priorityAnnotationType = null; } } diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java index a62131a8dd..918f2e8dbb 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java @@ -145,12 +145,7 @@ public class AnnotationUtilsTests { assertNull(getAnnotation(bridgeMethod, Order.class)); assertNotNull(findAnnotation(bridgeMethod, Order.class)); - // As of OpenJDK 8 b99, invoking getAnnotation() on a bridge method actually finds - // an annotation on its 'bridged' method. This differs from the previous behavior - // of JDK 5 through 7 and from the current behavior of the Eclipse compiler; - // however, we need to ensure that the tests pass in the Gradle build. So we - // comment out the following assertion. - // assertNull(bridgeMethod.getAnnotation(Transactional.class)); + assertNotNull(bridgeMethod.getAnnotation(Transactional.class)); assertNotNull(getAnnotation(bridgeMethod, Transactional.class)); assertNotNull(findAnnotation(bridgeMethod, Transactional.class)); } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java index b5b6ec2971..adb89f13a3 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,15 +58,15 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractorThis implementation creates a Spring ResultSetWrappingSqlRowSet - * instance that wraps a standard JDBC CachedRowSet instance. + *

This implementation creates a Spring {@link ResultSetWrappingSqlRowSet} + * instance that wraps a standard JDBC {@link CachedRowSet} instance. * Can be overridden to use a different implementation. * @param rs the original ResultSet (connected) * @return the disconnected SqlRowSet * @throws SQLException if thrown by JDBC methods - * @see #newCachedRowSet + * @see #newCachedRowSet() * @see org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet */ protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException { @@ -76,14 +76,14 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractorThe default implementation uses JDBC 4.1's RowSetProvider - * when running on JDK 7 or higher, falling back to Sun's - * {@code com.sun.rowset.CachedRowSetImpl} class on older JDKs. + *

The default implementation uses JDBC 4.1's {@link RowSetFactory}. * @return a new CachedRowSet instance * @throws SQLException if thrown by JDBC methods * @see #createSqlRowSet + * @see RowSetProvider#newFactory() + * @see RowSetFactory#createCachedRowSet() */ protected CachedRowSet newCachedRowSet() throws SQLException { return rowSetFactory.createCachedRowSet();