Polishing
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
*/
|
||||
@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>
|
||||
* <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>
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
* <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 {
|
||||
|
||||
@@ -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 " +
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
* <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 {
|
||||
/**
|
||||
* 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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
* <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}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user