Browse Source

Merge pull request #1979 from rupertw

* pr/1979:
  Fix formatting
pull/1979/merge
Stephane Nicoll 6 years ago
parent
commit
cb4fa3795a
  1. 4
      spring-beans/src/main/java/org/springframework/beans/factory/NoUniqueBeanDefinitionException.java
  2. 2
      spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
  3. 4
      spring-beans/src/main/java/org/springframework/beans/factory/config/BeanExpressionContext.java
  4. 4
      spring-beans/src/main/java/org/springframework/beans/factory/config/PreferencesPlaceholderConfigurer.java
  5. 2
      spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java
  6. 4
      spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
  7. 2
      spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
  8. 2
      spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
  9. 2
      spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java
  10. 2
      spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
  11. 6
      spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java
  12. 4
      spring-core/src/main/java/org/springframework/core/AttributeAccessor.java
  13. 4
      spring-core/src/main/java/org/springframework/util/ObjectUtils.java
  14. 6
      spring-core/src/main/java/org/springframework/util/UpdateMessageDigestInputStream.java

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

@ -60,7 +60,7 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti @@ -60,7 +60,7 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti
public NoUniqueBeanDefinitionException(Class<?> type, Collection<String> beanNamesFound) {
super(type, "expected single matching bean but found " + beanNamesFound.size() + ": " +
StringUtils.collectionToCommaDelimitedString(beanNamesFound));
this.numberOfBeansFound = beanNamesFound.size();
this.numberOfBeansFound = beanNamesFound.size();
this.beanNamesFound = beanNamesFound;
}
@ -82,7 +82,7 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti @@ -82,7 +82,7 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti
public NoUniqueBeanDefinitionException(ResolvableType type, Collection<String> beanNamesFound) {
super(type, "expected single matching bean but found " + beanNamesFound.size() + ": " +
StringUtils.collectionToCommaDelimitedString(beanNamesFound));
this.numberOfBeansFound = beanNamesFound.size();
this.numberOfBeansFound = beanNamesFound.size();
this.beanNamesFound = beanNamesFound;
}

2
spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java

@ -707,7 +707,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean @@ -707,7 +707,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
ReflectionUtils.makeAccessible(method);
method.invoke(bean, arguments);
}
catch (InvocationTargetException ex){
catch (InvocationTargetException ex) {
throw ex.getTargetException();
}
}

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -59,7 +59,7 @@ public class BeanExpressionContext { @@ -59,7 +59,7 @@ public class BeanExpressionContext {
if (this.beanFactory.containsBean(key)) {
return this.beanFactory.getBean(key);
}
else if (this.scope != null){
else if (this.scope != null) {
return this.scope.resolveContextualObject(key);
}
else {

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -121,7 +121,7 @@ public class PreferencesPlaceholderConfigurer extends PropertyPlaceholderConfigu @@ -121,7 +121,7 @@ public class PreferencesPlaceholderConfigurer extends PropertyPlaceholderConfigu
@Nullable
protected String resolvePlaceholder(@Nullable String path, String key, Preferences preferences) {
if (path != null) {
// Do not create the node if it does not exist...
// Do not create the node if it does not exist...
try {
if (preferences.nodeExists(path)) {
return preferences.node(path).get(key, null);

2
spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java

@ -132,7 +132,7 @@ public class PropertyOverrideConfigurer extends PropertyResourceConfigurer { @@ -132,7 +132,7 @@ public class PropertyOverrideConfigurer extends PropertyResourceConfigurer {
"': expected 'beanName" + this.beanNameSeparator + "property'");
}
String beanName = key.substring(0, separatorIndex);
String beanProperty = key.substring(separatorIndex+1);
String beanProperty = key.substring(separatorIndex + 1);
this.beanNames.add(beanName);
applyPropertyValue(factory, beanName, beanProperty, value);
if (logger.isDebugEnabled()) {

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

@ -1122,7 +1122,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac @@ -1122,7 +1122,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
return obtainFromSupplier(instanceSupplier, beanName);
}
if (mbd.getFactoryMethodName() != null) {
if (mbd.getFactoryMethodName() != null) {
return instantiateUsingFactoryMethod(beanName, mbd, args);
}
@ -1149,7 +1149,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac @@ -1149,7 +1149,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
// Candidate constructors for autowiring?
Constructor<?>[] ctors = determineConstructorsFromBeanPostProcessors(beanClass, beanName);
if (ctors != null || mbd.getResolvedAutowireMode() == AUTOWIRE_CONSTRUCTOR ||
mbd.hasConstructorArgumentValues() || !ObjectUtils.isEmpty(args)) {
mbd.hasConstructorArgumentValues() || !ObjectUtils.isEmpty(args)) {
return autowireConstructor(beanName, mbd, ctors, args);
}

2
spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

@ -661,7 +661,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @@ -661,7 +661,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
@Override
@Nullable
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
throws NoSuchBeanDefinitionException{
throws NoSuchBeanDefinitionException {
A ann = null;
Class<?> beanType = getType(beanName);

2
spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java

@ -510,7 +510,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader @@ -510,7 +510,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
* Reads the value of the entry. Correctly interprets bean references for
* values that are prefixed with an asterisk.
*/
private Object readValue(Map.Entry<? ,?> entry) {
private Object readValue(Map.Entry<?, ?> entry) {
Object val = entry.getValue();
if (val instanceof String) {
String strVal = (String) val;

2
spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java

@ -75,7 +75,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy { @@ -75,7 +75,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
(PrivilegedExceptionAction<Constructor<?>>) clazz::getDeclaredConstructor);
}
else {
constructorToUse = clazz.getDeclaredConstructor();
constructorToUse = clazz.getDeclaredConstructor();
}
bd.resolvedConstructorOrFactoryMethod = constructorToUse;
}

2
spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java

@ -432,7 +432,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory { @@ -432,7 +432,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
@Override
@Nullable
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
throws NoSuchBeanDefinitionException{
throws NoSuchBeanDefinitionException {
Class<?> beanType = getType(beanName);
return (beanType != null ? AnnotationUtils.findAnnotation(beanType, annotationType) : null);

6
spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -118,7 +118,7 @@ public class SimpleConstructorNamespaceHandler implements NamespaceHandler { @@ -118,7 +118,7 @@ public class SimpleConstructorNamespaceHandler implements NamespaceHandler {
"Constructor argument '" + argName + "' specifies a negative index", attr);
}
if (cvs.hasIndexedArgumentValue(index)){
if (cvs.hasIndexedArgumentValue(index)) {
parserContext.getReaderContext().error(
"Constructor argument '" + argName + "' with index "+ index+" already defined using <constructor-arg>." +
" Only one approach may be used per argument.", attr);
@ -130,7 +130,7 @@ public class SimpleConstructorNamespaceHandler implements NamespaceHandler { @@ -130,7 +130,7 @@ public class SimpleConstructorNamespaceHandler implements NamespaceHandler {
// no escaping -> ctr name
else {
String name = Conventions.attributeNameToPropertyName(argName);
if (containsArgWithName(name, cvs)){
if (containsArgWithName(name, cvs)) {
parserContext.getReaderContext().error(
"Constructor argument '" + argName + "' already defined using <constructor-arg>." +
" Only one approach may be used per argument.", attr);

4
spring-core/src/main/java/org/springframework/core/AttributeAccessor.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@ -28,7 +28,7 @@ import org.springframework.lang.Nullable; @@ -28,7 +28,7 @@ import org.springframework.lang.Nullable;
public interface AttributeAccessor {
/**
* Set the attribute defined by {@code name} to the supplied {@code value}.
* Set the attribute defined by {@code name} to the supplied {@code value}.
* If {@code value} is {@code null}, the attribute is {@link #removeAttribute removed}.
* <p>In general, users should take care to prevent overlaps with other
* metadata attributes by using fully-qualified names, perhaps using

4
spring-core/src/main/java/org/springframework/util/ObjectUtils.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -251,7 +251,7 @@ public abstract class ObjectUtils { @@ -251,7 +251,7 @@ public abstract class ObjectUtils {
* @param obj the object to append
* @return the new array (of the same component type; never {@code null})
*/
public static <A, O extends A> A[] addObjectToArray(@Nullable A[] array, @Nullable O obj) {
public static <A, O extends A> A[] addObjectToArray(@Nullable A[] array, @Nullable O obj) {
Class<?> compType = Object.class;
if (array != null) {
compType = array.getClass().getComponentType();

6
spring-core/src/main/java/org/springframework/util/UpdateMessageDigestInputStream.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 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.
@ -38,7 +38,7 @@ abstract class UpdateMessageDigestInputStream extends InputStream { @@ -38,7 +38,7 @@ abstract class UpdateMessageDigestInputStream extends InputStream {
*/
public void updateMessageDigest(MessageDigest messageDigest) throws IOException {
int data;
while ((data = read()) != -1){
while ((data = read()) != -1) {
messageDigest.update((byte) data);
}
}
@ -54,7 +54,7 @@ abstract class UpdateMessageDigestInputStream extends InputStream { @@ -54,7 +54,7 @@ abstract class UpdateMessageDigestInputStream extends InputStream {
public void updateMessageDigest(MessageDigest messageDigest, int len) throws IOException {
int data;
int bytesRead = 0;
while (bytesRead < len && (data = read()) != -1){
while (bytesRead < len && (data = read()) != -1) {
messageDigest.update((byte) data);
bytesRead++;
}

Loading…
Cancel
Save