From fc46abf0b7c19865e86658f1d39afabfffe24db0 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 12 Jun 2019 18:04:06 +0200 Subject: [PATCH] Polishing --- .../beans/propertyeditors/CustomCollectionEditor.java | 4 ++-- .../beans/propertyeditors/CustomMapEditor.java | 4 ++-- .../org/springframework/cache/annotation/CacheEvict.java | 2 +- .../org/springframework/cache/annotation/CachePut.java | 2 +- .../org/springframework/cache/annotation/Cacheable.java | 2 +- .../org/springframework/cache/annotation/Caching.java | 2 +- .../springframework/context/annotation/Description.java | 2 +- .../org/springframework/scheduling/annotation/Async.java | 2 +- .../java/org/springframework/core/CollectionFactory.java | 4 ++-- .../org/springframework/expression/spel/ast/Indexer.java | 4 ++-- .../jms/listener/AbstractMessageListenerContainer.java | 4 ++-- .../messaging/handler/annotation/SendTo.java | 2 +- .../messaging/simp/annotation/SendToUser.java | 2 +- .../test/context/junit/jupiter/DisabledIf.java | 6 +++--- .../test/context/junit/jupiter/EnabledIf.java | 6 +++--- .../transaction/annotation/Transactional.java | 2 +- .../springframework/web/bind/annotation/CrossOrigin.java | 8 ++++---- .../web/bind/annotation/RequestMapping.java | 2 +- .../web/servlet/mvc/ServletWrappingController.java | 4 ++-- 19 files changed, 32 insertions(+), 32 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java index e841c06158..bcf39977df 100644 --- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java +++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 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. @@ -150,7 +150,7 @@ public class CustomCollectionEditor extends PropertyEditorSupport { * @param initialCapacity the initial capacity * @return the new Collection instance */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) protected Collection createCollection(Class collectionType, int initialCapacity) { if (!collectionType.isInterface()) { try { diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java index f625bc2c9a..a1e5ebd119 100644 --- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java +++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 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. @@ -126,7 +126,7 @@ public class CustomMapEditor extends PropertyEditorSupport { * @param initialCapacity the initial capacity * @return the new Map instance */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) protected Map createMap(Class mapType, int initialCapacity) { if (!mapType.isInterface()) { try { diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java b/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java index 448d02079f..bbfc6526d5 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java @@ -38,7 +38,7 @@ import org.springframework.core.annotation.AliasFor; * @since 3.1 * @see CacheConfig */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java b/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java index f0cc04965d..8743df7e66 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java @@ -45,7 +45,7 @@ import org.springframework.core.annotation.AliasFor; * @since 3.1 * @see CacheConfig */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java index 44ed3e3094..b93cf9373f 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java @@ -52,7 +52,7 @@ import org.springframework.core.annotation.AliasFor; * @since 3.1 * @see CacheConfig */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java b/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java index d3f2e488a8..7deb26ad90 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java @@ -33,7 +33,7 @@ import java.lang.annotation.Target; * @author Chris Beams * @since 3.1 */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Description.java b/spring-context/src/main/java/org/springframework/context/annotation/Description.java index af10554c32..f7da0dcf22 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Description.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/Description.java @@ -30,7 +30,7 @@ import java.lang.annotation.Target; * @since 4.0 * @see org.springframework.beans.factory.config.BeanDefinition#getDescription() */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Description { diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java index 57c4b858c6..cbfae4d60a 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java @@ -48,7 +48,7 @@ import java.lang.annotation.Target; * @see AnnotationAsyncExecutionInterceptor * @see AsyncAnnotationAdvisor */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Async { diff --git a/spring-core/src/main/java/org/springframework/core/CollectionFactory.java b/spring-core/src/main/java/org/springframework/core/CollectionFactory.java index e0a9907610..d4515bdb41 100644 --- a/spring-core/src/main/java/org/springframework/core/CollectionFactory.java +++ b/spring-core/src/main/java/org/springframework/core/CollectionFactory.java @@ -119,7 +119,7 @@ public final class CollectionFactory { * @see java.util.TreeSet * @see java.util.LinkedHashSet */ - @SuppressWarnings({ "unchecked", "cast", "rawtypes" }) + @SuppressWarnings({"rawtypes", "unchecked", "cast"}) public static Collection createApproximateCollection(@Nullable Object collection, int capacity) { if (collection instanceof LinkedList) { return new LinkedList<>(); @@ -178,7 +178,7 @@ public final class CollectionFactory { * {@code null}; or if the desired {@code collectionType} is {@link EnumSet} and * the supplied {@code elementType} is not a subtype of {@link Enum} */ - @SuppressWarnings({ "unchecked", "cast" }) + @SuppressWarnings({"unchecked", "cast"}) public static Collection createCollection(Class collectionType, @Nullable Class elementType, int capacity) { Assert.notNull(collectionType, "Collection type must not be null"); if (collectionType.isInterface()) { diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java b/spring-expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java index 741390057f..0cba28524e 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 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. @@ -639,7 +639,7 @@ public class Indexer extends SpelNodeImpl { } - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) private class CollectionIndexingValueRef implements ValueRef { private final Collection collection; diff --git a/spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java b/spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java index 9d705050c0..534e12285f 100644 --- a/spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java +++ b/spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 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. @@ -718,7 +718,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen * @see SessionAwareMessageListener * @see #setExposeListenerSession */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"rawtypes", "unchecked"}) protected void doInvokeListener(SessionAwareMessageListener listener, Session session, Message message) throws JMSException { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/SendTo.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/SendTo.java index 2408975fc4..4b538cf18a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/SendTo.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/SendTo.java @@ -39,7 +39,7 @@ import org.springframework.messaging.Message; * @author Stephane Nicoll * @since 4.0 */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface SendTo { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java index 4ca1942f67..311b19cf99 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java @@ -44,7 +44,7 @@ import org.springframework.core.annotation.AliasFor; * @see org.springframework.messaging.simp.user.UserDestinationMessageHandler * @see org.springframework.messaging.simp.SimpMessageHeaderAccessor#getUser() */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface SendToUser { diff --git a/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/DisabledIf.java b/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/DisabledIf.java index a3451e886c..139d162574 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/DisabledIf.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/DisabledIf.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2019 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. @@ -41,7 +41,7 @@ import org.springframework.core.annotation.AliasFor; * {@code @DisabledOnMac} annotation can be created as follows. * *
- * {@literal @}Target({ ElementType.TYPE, ElementType.METHOD })
+ * {@literal @}Target({ElementType.TYPE, ElementType.METHOD})
  * {@literal @}Retention(RetentionPolicy.RUNTIME)
  * {@literal @}DisabledIf(
  *     expression = "#{systemProperties['os.name'].toLowerCase().contains('mac')}",
@@ -57,7 +57,7 @@ import org.springframework.core.annotation.AliasFor;
  * @see EnabledIf
  * @see org.junit.jupiter.api.Disabled
  */
-@Target({ ElementType.TYPE, ElementType.METHOD })
+@Target({ElementType.TYPE, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 @ExtendWith(DisabledIfCondition.class)
diff --git a/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/EnabledIf.java b/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/EnabledIf.java
index a929e0db70..c1fd3bbaf1 100644
--- a/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/EnabledIf.java
+++ b/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/EnabledIf.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -41,7 +41,7 @@ import org.springframework.core.annotation.AliasFor;
  * {@code @EnabledOnMac} annotation can be created as follows.
  *
  * 
- * {@literal @}Target({ ElementType.TYPE, ElementType.METHOD })
+ * {@literal @}Target({ElementType.TYPE, ElementType.METHOD})
  * {@literal @}Retention(RetentionPolicy.RUNTIME)
  * {@literal @}EnabledIf(
  *     expression = "#{systemProperties['os.name'].toLowerCase().contains('mac')}",
@@ -56,7 +56,7 @@ import org.springframework.core.annotation.AliasFor;
  * @see DisabledIf
  * @see org.junit.jupiter.api.Disabled
  */
-@Target({ ElementType.TYPE, ElementType.METHOD })
+@Target({ElementType.TYPE, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 @ExtendWith(EnabledIfCondition.class)
diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java
index 5024dde8aa..3c2046c97a 100644
--- a/spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java
+++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java
@@ -56,7 +56,7 @@ import org.springframework.transaction.TransactionDefinition;
  * @see org.springframework.transaction.interceptor.DefaultTransactionAttribute
  * @see org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
  */
-@Target({ElementType.METHOD, ElementType.TYPE})
+@Target({ElementType.TYPE, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 @Inherited
 @Documented
diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
index ac2f82d114..7fb1b88c4d 100644
--- a/spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
+++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -47,18 +47,18 @@ import org.springframework.web.cors.CorsConfiguration;
  * @author Sam Brannen
  * @since 4.2
  */
-@Target({ ElementType.METHOD, ElementType.TYPE })
+@Target({ElementType.TYPE, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 public @interface CrossOrigin {
 
 	/** @deprecated as of Spring 5.0, in favor of {@link CorsConfiguration#applyPermitDefaultValues} */
 	@Deprecated
-	String[] DEFAULT_ORIGINS = { "*" };
+	String[] DEFAULT_ORIGINS = {"*"};
 
 	/** @deprecated as of Spring 5.0, in favor of {@link CorsConfiguration#applyPermitDefaultValues} */
 	@Deprecated
-	String[] DEFAULT_ALLOWED_HEADERS = { "*" };
+	String[] DEFAULT_ALLOWED_HEADERS = {"*"};
 
 	/** @deprecated as of Spring 5.0, in favor of {@link CorsConfiguration#applyPermitDefaultValues} */
 	@Deprecated
diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java
index 3fa2f5198e..1a510da07d 100644
--- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java
+++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java
@@ -70,7 +70,7 @@ import org.springframework.core.annotation.AliasFor;
  * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
  * @see org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter
  */
-@Target({ElementType.METHOD, ElementType.TYPE})
+@Target({ElementType.TYPE, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 @Mapping
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java
index 25173f6628..5e4a42f74d 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -204,7 +204,7 @@ public class ServletWrappingController extends AbstractController
 		}
 
 		@Override
-		@SuppressWarnings({ "unchecked", "rawtypes" })
+		@SuppressWarnings({"rawtypes", "unchecked"})
 		public Enumeration getInitParameterNames() {
 			return (Enumeration) initParameters.keys();
 		}