Browse Source

Polishing

pull/1260/head
Juergen Hoeller 10 years ago
parent
commit
d3c0e75b95
  1. 6
      spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java
  2. 16
      spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java
  3. 2
      spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java
  4. 4
      spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java
  5. 12
      spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java
  6. 4
      spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java
  7. 2
      spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java
  8. 2
      spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java
  9. 2
      spring-core/src/main/java/org/springframework/core/NestedRuntimeException.java
  10. 20
      spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java
  11. 8
      spring-core/src/main/java/org/springframework/util/StopWatch.java
  12. 4
      spring-jms/src/main/java/org/springframework/jms/UncategorizedJmsException.java
  13. 12
      spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
  14. 4
      spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java
  15. 2
      spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java

6
spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java

@ -1,5 +1,5 @@ @@ -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 @@ -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 @@ -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;

16
spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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.
*/

2
spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java

@ -130,7 +130,7 @@ public class PropertyBatchUpdateException extends BeansException { @@ -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;
}

4
spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java

@ -123,7 +123,7 @@ public class BeanCreationException extends FatalBeanException { @@ -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 { @@ -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;
}

12
spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java

@ -1,5 +1,5 @@ @@ -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<T> @@ -153,7 +153,7 @@ public abstract class AbstractFactoryBean<T>
*/
@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<T> @@ -201,7 +201,7 @@ public abstract class AbstractFactoryBean<T>
* <p>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<T> @@ -218,9 +218,9 @@ public abstract class AbstractFactoryBean<T>
* 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);
}
/**

4
spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java

@ -1,5 +1,5 @@ @@ -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 @@ -91,7 +91,7 @@ public class PropertiesFactoryBean extends PropertiesLoaderSupport
* <p>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 {

2
spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java

@ -78,7 +78,7 @@ public class AutoProxyRegistrar implements ImportBeanDefinitionRegistrar { @@ -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 " +

2
spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java

@ -138,7 +138,7 @@ public class ConnectorServerFactoryBean extends MBeanRegistrationSupport @@ -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
*/

2
spring-core/src/main/java/org/springframework/core/NestedRuntimeException.java

@ -110,7 +110,7 @@ public abstract class NestedRuntimeException extends RuntimeException { @@ -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;
}

20
spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java vendored

@ -1,5 +1,5 @@ @@ -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; @@ -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; @@ -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.
* <p>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 { @@ -46,10 +46,10 @@ public interface ConfigurablePropertyResolver extends PropertyResolver {
/**
* Set the {@link ConfigurableConversionService} to be used when performing type
* conversions on properties.
* <p><strong>Note:</strong> 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}.
* <p><strong>Note:</strong> 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

8
spring-core/src/main/java/org/springframework/util/StopWatch.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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 { @@ -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);
}
}

4
spring-jms/src/main/java/org/springframework/jms/UncategorizedJmsException.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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);
}
}

12
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java

@ -1,5 +1,5 @@ @@ -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 @@ -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 @@ -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 @@ -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 @@ -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) {

4
spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java

@ -1,5 +1,5 @@ @@ -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 @@ -459,7 +459,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
* {@code org.springframework.oxm} hierarchy.
* <p>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}

2
spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java

@ -83,7 +83,7 @@ public class TransactionSystemException extends TransactionException { @@ -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));
}

Loading…
Cancel
Save