From 70f2736c6c2762cccdb14597efcf1f44ab93e827 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 13 Sep 2016 21:58:41 +0200 Subject: [PATCH] Polishing (cherry picked from commit b344c92) --- .../beans/factory/BeanFactory.java | 25 +++++++++++-------- .../format/datetime/DateFormatter.java | 4 +-- .../spel/support/ReflectionHelper.java | 4 +-- .../dao/support/DataAccessUtils.java | 12 ++++----- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java index 00191904e2a..d13b514dbb2 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java @@ -66,24 +66,27 @@ import org.springframework.beans.BeansException; * 1. BeanNameAware's {@code setBeanName}
* 2. BeanClassLoaderAware's {@code setBeanClassLoader}
* 3. BeanFactoryAware's {@code setBeanFactory}
- * 4. ResourceLoaderAware's {@code setResourceLoader} + * 4. EnvironmentAware's {@code setEnvironment} + * 5. EmbeddedValueResolverAware's {@code setEmbeddedValueResolver} + * 6. ResourceLoaderAware's {@code setResourceLoader} * (only applicable when running in an application context)
- * 5. ApplicationEventPublisherAware's {@code setApplicationEventPublisher} + * 7. ApplicationEventPublisherAware's {@code setApplicationEventPublisher} * (only applicable when running in an application context)
- * 6. MessageSourceAware's {@code setMessageSource} + * 8. MessageSourceAware's {@code setMessageSource} * (only applicable when running in an application context)
- * 7. ApplicationContextAware's {@code setApplicationContext} + * 9. ApplicationContextAware's {@code setApplicationContext} * (only applicable when running in an application context)
- * 8. ServletContextAware's {@code setServletContext} + * 10. ServletContextAware's {@code setServletContext} * (only applicable when running in a web application context)
- * 9. {@code postProcessBeforeInitialization} methods of BeanPostProcessors
- * 10. InitializingBean's {@code afterPropertiesSet}
- * 11. a custom init-method definition
- * 12. {@code postProcessAfterInitialization} methods of BeanPostProcessors + * 11. {@code postProcessBeforeInitialization} methods of BeanPostProcessors
+ * 12. InitializingBean's {@code afterPropertiesSet}
+ * 13. a custom init-method definition
+ * 14. {@code postProcessAfterInitialization} methods of BeanPostProcessors * *

On shutdown of a bean factory, the following lifecycle methods apply:
- * 1. DisposableBean's {@code destroy}
- * 2. a custom destroy-method definition + * 1. {@code postProcessBeforeDestruction} methods of DestructionAwareBeanPostProcessors + * 2. DisposableBean's {@code destroy}
+ * 3. a custom destroy-method definition * * @author Rod Johnson * @author Juergen Hoeller diff --git a/spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java b/spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java index b67ab82505c..2e34f7309ed 100644 --- a/spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java +++ b/spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 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. @@ -189,7 +189,7 @@ public class DateFormatter implements Formatter { if (timeStyle != -1) { return DateFormat.getTimeInstance(timeStyle, locale); } - throw new IllegalStateException("Unsupported style pattern '"+ this.stylePattern+ "'"); + throw new IllegalStateException("Unsupported style pattern '" + this.stylePattern + "'"); } return DateFormat.getDateInstance(this.style, locale); diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectionHelper.java b/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectionHelper.java index bb1fcec0c0d..932af80e544 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectionHelper.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectionHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -219,7 +219,7 @@ public class ReflectionHelper { // or more other arguments left to pass to it. Class varargsParamType = expectedArgTypes.get(expectedArgTypes.size() - 1).getElementTypeDescriptor().getType(); - // All remaining parameters must be of this type or convertable to this type + // All remaining parameters must be of this type or convertible to this type for (int i = expectedArgTypes.size() - 1; i < suppliedArgTypes.size(); i++) { TypeDescriptor suppliedArg = suppliedArgTypes.get(i); if (suppliedArg == null) { diff --git a/spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java b/spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java index d4c086695ec..1427eb0a5bd 100644 --- a/spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java +++ b/spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2016 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. @@ -122,7 +122,7 @@ public abstract class DataAccessUtils { /** * Return a unique result object from the given Collection. * Throws an exception if 0 or more than 1 result objects found, - * of if the unique result object is not convertable to the + * of if the unique result object is not convertible to the * specified required type. * @param results the result Collection (can be {@code null}) * @return the unique result object @@ -162,7 +162,7 @@ public abstract class DataAccessUtils { /** * Return a unique int result from the given Collection. * Throws an exception if 0 or more than 1 result objects found, - * of if the unique result object is not convertable to an int. + * of if the unique result object is not convertible to an int. * @param results the result Collection (can be {@code null}) * @return the unique int result * @throws IncorrectResultSizeDataAccessException if more than one @@ -170,7 +170,7 @@ public abstract class DataAccessUtils { * @throws EmptyResultDataAccessException if no result object * at all has been found in the given Collection * @throws TypeMismatchDataAccessException if the unique object - * in the collection is not convertable to an int + * in the collection is not convertible to an int */ public static int intResult(Collection results) throws IncorrectResultSizeDataAccessException, TypeMismatchDataAccessException { @@ -181,7 +181,7 @@ public abstract class DataAccessUtils { /** * Return a unique long result from the given Collection. * Throws an exception if 0 or more than 1 result objects found, - * of if the unique result object is not convertable to a long. + * of if the unique result object is not convertible to a long. * @param results the result Collection (can be {@code null}) * @return the unique long result * @throws IncorrectResultSizeDataAccessException if more than one @@ -189,7 +189,7 @@ public abstract class DataAccessUtils { * @throws EmptyResultDataAccessException if no result object * at all has been found in the given Collection * @throws TypeMismatchDataAccessException if the unique object - * in the collection is not convertable to a long + * in the collection is not convertible to a long */ public static long longResult(Collection results) throws IncorrectResultSizeDataAccessException, TypeMismatchDataAccessException {