From d3c0e75b95b9acaf555b673732f16f083fcaf9b0 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 15 Jul 2016 18:02:26 +0200 Subject: [PATCH] Polishing --- .../beans/AbstractPropertyAccessor.java | 6 +++--- .../beans/PropertyAccessor.java | 16 +++++++-------- .../beans/PropertyBatchUpdateException.java | 2 +- .../beans/factory/BeanCreationException.java | 4 ++-- .../factory/config/AbstractFactoryBean.java | 12 +++++------ .../factory/config/PropertiesFactoryBean.java | 4 ++-- .../annotation/AutoProxyRegistrar.java | 2 +- .../support/ConnectorServerFactoryBean.java | 2 +- .../core/NestedRuntimeException.java | 2 +- .../env/ConfigurablePropertyResolver.java | 20 +++++++++---------- .../org/springframework/util/StopWatch.java | 8 ++++---- .../jms/UncategorizedJmsException.java | 4 ++-- .../oxm/jaxb/Jaxb2Marshaller.java | 12 +++++------ .../oxm/jibx/JibxMarshaller.java | 4 ++-- .../TransactionSystemException.java | 2 +- 15 files changed, 50 insertions(+), 50 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java b/spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java index 258313c90f3..58668b8612d 100644 --- a/spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -105,7 +105,7 @@ public abstract class AbstractPropertyAccessor extends TypeConverterSupport impl // Redefined with public visibility. @Override - public Class getPropertyType(String propertyPath) { + public Class getPropertyType(String propertyPath) { return null; } @@ -127,7 +127,7 @@ public abstract class AbstractPropertyAccessor extends TypeConverterSupport impl * @throws InvalidPropertyException if there is no such property or * if the property isn't writable * @throws PropertyAccessException if the property was valid but the - * accessor method failed or a type mismatch occured + * accessor method failed or a type mismatch occurred */ public abstract void setPropertyValue(String propertyName, Object value) throws BeansException; diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java b/spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java index 621bae5325b..c7faf35524e 100644 --- a/spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.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. @@ -86,7 +86,7 @@ public interface PropertyAccessor { * @throws PropertyAccessException if the property was valid but the * accessor method failed */ - Class getPropertyType(String propertyName) throws BeansException; + Class getPropertyType(String propertyName) throws BeansException; /** * Return a type descriptor for the specified property: @@ -120,7 +120,7 @@ public interface PropertyAccessor { * @throws InvalidPropertyException if there is no such property or * if the property isn't writable * @throws PropertyAccessException if the property was valid but the - * accessor method failed or a type mismatch occured + * accessor method failed or a type mismatch occurred */ void setPropertyValue(String propertyName, Object value) throws BeansException; @@ -130,7 +130,7 @@ public interface PropertyAccessor { * @throws InvalidPropertyException if there is no such property or * if the property isn't writable * @throws PropertyAccessException if the property was valid but the - * accessor method failed or a type mismatch occured + * accessor method failed or a type mismatch occurred */ void setPropertyValue(PropertyValue pv) throws BeansException; @@ -144,7 +144,7 @@ public interface PropertyAccessor { * @throws InvalidPropertyException if there is no such property or * if the property isn't writable * @throws PropertyBatchUpdateException if one or more PropertyAccessExceptions - * occured for specific properties during the batch update. This exception bundles + * occurred for specific properties during the batch update. This exception bundles * all individual PropertyAccessExceptions. All other properties will have been * successfully updated. */ @@ -164,7 +164,7 @@ public interface PropertyAccessor { * @throws InvalidPropertyException if there is no such property or * if the property isn't writable * @throws PropertyBatchUpdateException if one or more PropertyAccessExceptions - * occured for specific properties during the batch update. This exception bundles + * occurred for specific properties during the batch update. This exception bundles * all individual PropertyAccessExceptions. All other properties will have been * successfully updated. * @see #setPropertyValues(PropertyValues, boolean, boolean) @@ -185,7 +185,7 @@ public interface PropertyAccessor { * @throws InvalidPropertyException if there is no such property or * if the property isn't writable * @throws PropertyBatchUpdateException if one or more PropertyAccessExceptions - * occured for specific properties during the batch update. This exception bundles + * occurred for specific properties during the batch update. This exception bundles * all individual PropertyAccessExceptions. All other properties will have been * successfully updated. * @see #setPropertyValues(PropertyValues, boolean, boolean) @@ -208,7 +208,7 @@ public interface PropertyAccessor { * @throws InvalidPropertyException if there is no such property or * if the property isn't writable * @throws PropertyBatchUpdateException if one or more PropertyAccessExceptions - * occured for specific properties during the batch update. This exception bundles + * occurred for specific properties during the batch update. This exception bundles * all individual PropertyAccessExceptions. All other properties will have been * successfully updated. */ diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java b/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java index 1919a47122b..bfa54687bb7 100644 --- a/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java +++ b/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java @@ -130,7 +130,7 @@ public class PropertyBatchUpdateException extends BeansException { } @Override - public boolean contains(Class exType) { + public boolean contains(Class exType) { if (exType == null) { return false; } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java index 2ffe909a941..7af40875766 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java @@ -123,7 +123,7 @@ public class BeanCreationException extends FatalBeanException { /** * Add a related cause to this bean creation exception, - * not being a direct cause of the failure but having occured + * not being a direct cause of the failure but having occurred * earlier in the creation of the same bean instance. * @param ex the related cause to add */ @@ -185,7 +185,7 @@ public class BeanCreationException extends FatalBeanException { } @Override - public boolean contains(Class exClass) { + public boolean contains(Class exClass) { if (super.contains(exClass)) { return true; } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java index 5c1ad4b751b..7cb1685fede 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.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. @@ -153,7 +153,7 @@ public abstract class AbstractFactoryBean */ @SuppressWarnings("unchecked") private T getEarlySingletonInstance() throws Exception { - Class[] ifcs = getEarlySingletonInterfaces(); + Class[] ifcs = getEarlySingletonInterfaces(); if (ifcs == null) { throw new FactoryBeanNotInitializedException( getClass().getName() + " does not support circular references"); @@ -201,7 +201,7 @@ public abstract class AbstractFactoryBean *

Invoked on initialization of this FactoryBean in case of * a singleton; else, on each {@link #getObject()} call. * @return the object returned by this factory - * @throws Exception if an exception occured during object creation + * @throws Exception if an exception occurred during object creation * @see #getObject() */ protected abstract T createInstance() throws Exception; @@ -218,9 +218,9 @@ public abstract class AbstractFactoryBean * or {@code null} to indicate a FactoryBeanNotInitializedException * @see org.springframework.beans.factory.FactoryBeanNotInitializedException */ - protected Class[] getEarlySingletonInterfaces() { - Class type = getObjectType(); - return (type != null && type.isInterface() ? new Class[] {type} : null); + protected Class[] getEarlySingletonInterfaces() { + Class type = getObjectType(); + return (type != null && type.isInterface() ? new Class[] {type} : null); } /** diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java index 9e0673ccfb0..b39e0de0daa 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 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. @@ -91,7 +91,7 @@ public class PropertiesFactoryBean extends PropertiesLoaderSupport *

Invoked on initialization of this FactoryBean in case of a * shared singleton; else, on each {@link #getObject()} call. * @return the object returned by this factory - * @throws IOException if an exception occured during properties loading + * @throws IOException if an exception occurred during properties loading * @see #mergeProperties() */ protected Properties createProperties() throws IOException { diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java b/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java index e8a8727793f..11b3e7f5d66 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java @@ -78,7 +78,7 @@ public class AutoProxyRegistrar implements ImportBeanDefinitionRegistrar { logger.warn(String.format("%s was imported but no annotations were found " + "having both 'mode' and 'proxyTargetClass' attributes of type " + "AdviceMode and boolean respectively. This means that auto proxy " + - "creator registration and configuration may not have occured as " + + "creator registration and configuration may not have occurred as " + "intended, and components may not be proxied as expected. Check to " + "ensure that %s has been @Import'ed on the same class where these " + "annotations are declared; otherwise remove the import of %s " + diff --git a/spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java b/spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java index a717b8a1abd..dbee347fb64 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java @@ -138,7 +138,7 @@ public class ConnectorServerFactoryBean extends MBeanRegistrationSupport * the {@code JMXConnectorServer} will be started in a separate thread. * If the {@code daemon} flag is set to {@code true}, that thread will be * started as a daemon thread. - * @throws JMException if a problem occured when registering the connector server + * @throws JMException if a problem occurred when registering the connector server * with the {@code MBeanServer} * @throws IOException if there is a problem starting the connector server */ diff --git a/spring-core/src/main/java/org/springframework/core/NestedRuntimeException.java b/spring-core/src/main/java/org/springframework/core/NestedRuntimeException.java index 520c8bc9ac5..8d20d81f884 100644 --- a/spring-core/src/main/java/org/springframework/core/NestedRuntimeException.java +++ b/spring-core/src/main/java/org/springframework/core/NestedRuntimeException.java @@ -110,7 +110,7 @@ public abstract class NestedRuntimeException extends RuntimeException { * @param exType the exception type to look for * @return whether there is a nested exception of the specified type */ - public boolean contains(Class exType) { + public boolean contains(Class exType) { if (exType == null) { return false; } diff --git a/spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java b/spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java index e1ec8a2732d..bc626d64310 100644 --- a/spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java +++ b/spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 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. @@ -19,10 +19,10 @@ package org.springframework.core.env; import org.springframework.core.convert.support.ConfigurableConversionService; /** - * Configuration interface to be implemented by most if not all {@link PropertyResolver - * PropertyResolver} types. Provides facilities for accessing and customizing the - * {@link org.springframework.core.convert.ConversionService ConversionService} used when - * converting property values from one type to another. + * Configuration interface to be implemented by most if not all {@link PropertyResolver} + * types. Provides facilities for accessing and customizing the + * {@link org.springframework.core.convert.ConversionService ConversionService} + * used when converting property values from one type to another. * * @author Chris Beams * @since 3.1 @@ -30,7 +30,7 @@ import org.springframework.core.convert.support.ConfigurableConversionService; public interface ConfigurablePropertyResolver extends PropertyResolver { /** - * @return the {@link ConfigurableConversionService} used when performing type + * Return the {@link ConfigurableConversionService} used when performing type * conversions on properties. *

The configurable nature of the returned conversion service allows for * the convenient addition and removal of individual {@code Converter} instances: @@ -46,10 +46,10 @@ public interface ConfigurablePropertyResolver extends PropertyResolver { /** * Set the {@link ConfigurableConversionService} to be used when performing type * conversions on properties. - *

Note: as an alternative to fully replacing the {@code - * ConversionService}, consider adding or removing individual {@code Converter} - * instances by drilling into {@link #getConversionService()} and calling methods - * such as {@code #addConverter}. + *

Note: as an alternative to fully replacing the + * {@code ConversionService}, consider adding or removing individual + * {@code Converter} instances by drilling into {@link #getConversionService()} + * and calling methods such as {@code #addConverter}. * @see PropertyResolver#getProperty(String, Class) * @see #getConversionService() * @see org.springframework.core.convert.converter.ConverterRegistry#addConverter diff --git a/spring-core/src/main/java/org/springframework/util/StopWatch.java b/spring-core/src/main/java/org/springframework/util/StopWatch.java index 0c974991134..57544c4ea57 100644 --- a/spring-core/src/main/java/org/springframework/util/StopWatch.java +++ b/spring-core/src/main/java/org/springframework/util/StopWatch.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 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. @@ -116,15 +116,15 @@ public class StopWatch { if (this.running) { throw new IllegalStateException("Can't start StopWatch: it's already running"); } - this.startTimeMillis = System.currentTimeMillis(); this.running = true; this.currentTaskName = taskName; + this.startTimeMillis = System.currentTimeMillis(); } /** * Stop the current task. The results are undefined if timing * methods are called without invoking at least one pair - * {@link #start()} / {@link #stop()} methods. + * {@code start()} / {@code stop()} methods. * @see #start() */ public void stop() throws IllegalStateException { @@ -302,7 +302,7 @@ public class StopWatch { * Return the time in seconds this task took. */ public double getTimeSeconds() { - return this.timeMillis / 1000.0; + return (this.timeMillis / 1000.0); } } diff --git a/spring-jms/src/main/java/org/springframework/jms/UncategorizedJmsException.java b/spring-jms/src/main/java/org/springframework/jms/UncategorizedJmsException.java index b9531906a4f..e55ba0d61e9 100644 --- a/spring-jms/src/main/java/org/springframework/jms/UncategorizedJmsException.java +++ b/spring-jms/src/main/java/org/springframework/jms/UncategorizedJmsException.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. @@ -51,7 +51,7 @@ public class UncategorizedJmsException extends JmsException { * but can also be a JNDI NamingException or the like. */ public UncategorizedJmsException(Throwable cause) { - super("Uncategorized exception occured during JMS processing", cause); + super("Uncategorized exception occurred during JMS processing", cause); } } diff --git a/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java index d1bc12f038f..ed3d1bf54d5 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.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. @@ -628,13 +628,13 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi * Compare section 8.5.1 of the JAXB2 spec. */ private boolean isPrimitiveWrapper(Class clazz) { - return Boolean.class.equals(clazz) || + return (Boolean.class.equals(clazz) || Byte.class.equals(clazz) || Short.class.equals(clazz) || Integer.class.equals(clazz) || Long.class.equals(clazz) || Float.class.equals(clazz) || - Double.class.equals(clazz); + Double.class.equals(clazz)); } /** @@ -642,7 +642,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi * Compare section 8.5.2 of the JAXB2 spec. */ private boolean isStandardClass(Class clazz) { - return String.class.equals(clazz) || + return (String.class.equals(clazz) || BigInteger.class.isAssignableFrom(clazz) || BigDecimal.class.isAssignableFrom(clazz) || Calendar.class.isAssignableFrom(clazz) || @@ -655,7 +655,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi DataHandler.class.equals(clazz) || // Source and subclasses should be supported according to the JAXB2 spec, but aren't in the RI // Source.class.isAssignableFrom(clazz) || - UUID.class.equals(clazz); + UUID.class.equals(clazz)); } @@ -893,7 +893,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi /** * Convert the given {@code JAXBException} to an appropriate exception from the * {@code org.springframework.oxm} hierarchy. - * @param ex {@code JAXBException} that occured + * @param ex {@code JAXBException} that occurred * @return the corresponding {@code XmlMappingException} */ protected XmlMappingException convertJaxbException(JAXBException ex) { diff --git a/spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java index 5e19c3805d1..cadfa24d04a 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.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. @@ -459,7 +459,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe * {@code org.springframework.oxm} hierarchy. *

A boolean flag is used to indicate whether this exception occurs during marshalling or * unmarshalling, since JiBX itself does not make this distinction in its exception hierarchy. - * @param ex {@code JiBXException} that occured + * @param ex {@code JiBXException} that occurred * @param marshalling indicates whether the exception occurs during marshalling ({@code true}), * or unmarshalling ({@code false}) * @return the corresponding {@code XmlMappingException} diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java index 43518ee9306..2af9b448ce8 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java @@ -83,7 +83,7 @@ public class TransactionSystemException extends TransactionException { } @Override - public boolean contains(Class exType) { + public boolean contains(Class exType) { return super.contains(exType) || (exType != null && exType.isInstance(this.applicationException)); }