Polishing
This commit is contained in:
parent
78d3164543
commit
a2765c009e
|
@ -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.
|
||||
|
@ -225,7 +225,7 @@ public abstract class AbstractFactoryBean<T>
|
|||
* FactoryBean is supposed to implement, for use with an 'early singleton
|
||||
* proxy' that will be exposed in case of a circular reference.
|
||||
* <p>The default implementation returns this FactoryBean's object type,
|
||||
* provided that it is an interface, or {@code null} else. The latter
|
||||
* provided that it is an interface, or {@code null} otherwise. The latter
|
||||
* indicates that early singleton access is not supported by this FactoryBean.
|
||||
* This will lead to a FactoryBeanNotInitializedException getting thrown.
|
||||
* @return the interfaces to use for 'early singletons',
|
||||
|
|
|
@ -301,7 +301,8 @@ public abstract class YamlProcessor {
|
|||
Collection<Object> collection = (Collection<Object>) value;
|
||||
if (collection.isEmpty()) {
|
||||
result.put(key, "");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
int count = 0;
|
||||
for (Object object : collection) {
|
||||
buildFlattenedMap(result, Collections.singletonMap(
|
||||
|
|
|
@ -1501,7 +1501,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
|||
* should be used as fallback.
|
||||
* @param beanName the name of the bean
|
||||
* @param mbd the merged bean definition for the bean
|
||||
* @return the type for the bean if determinable, or {@code null} else
|
||||
* @return the type for the bean if determinable, or {@code null} otherwise
|
||||
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
|
||||
* @see #getBean(String)
|
||||
*/
|
||||
|
|
|
@ -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.
|
||||
|
@ -62,9 +62,9 @@ class TypeHelper {
|
|||
DeclaredType declaredType = (DeclaredType) type;
|
||||
Element enclosingElement = declaredType.asElement().getEnclosingElement();
|
||||
if (enclosingElement != null && enclosingElement instanceof TypeElement) {
|
||||
return getQualifiedName(enclosingElement) + "$"
|
||||
+ declaredType.asElement().getSimpleName().toString();
|
||||
} else {
|
||||
return getQualifiedName(enclosingElement) + "$" + declaredType.asElement().getSimpleName().toString();
|
||||
}
|
||||
else {
|
||||
return getQualifiedName(declaredType.asElement());
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ class TypeHelper {
|
|||
public Element getSuperClass(Element element) {
|
||||
List<? extends TypeMirror> superTypes = this.types.directSupertypes(element.asType());
|
||||
if (superTypes.isEmpty()) {
|
||||
return null; // reached java.lang.Object
|
||||
return null; // reached java.lang.Object
|
||||
}
|
||||
return this.types.asElement(superTypes.get(0));
|
||||
}
|
||||
|
|
|
@ -431,9 +431,10 @@ public abstract class DataBufferUtils {
|
|||
skipUntil(dataBuffer -> {
|
||||
int delta = -dataBuffer.readableByteCount();
|
||||
long currentCount = byteCountDown.addAndGet(delta);
|
||||
if(currentCount < 0) {
|
||||
if (currentCount < 0) {
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ public abstract class CollectionUtils {
|
|||
* Check whether the given Iterator contains the given element.
|
||||
* @param iterator the Iterator to check
|
||||
* @param element the element to look for
|
||||
* @return {@code true} if found, {@code false} else
|
||||
* @return {@code true} if found, {@code false} otherwise
|
||||
*/
|
||||
public static boolean contains(@Nullable Iterator<?> iterator, Object element) {
|
||||
if (iterator != null) {
|
||||
|
@ -140,7 +140,7 @@ public abstract class CollectionUtils {
|
|||
* Check whether the given Enumeration contains the given element.
|
||||
* @param enumeration the Enumeration to check
|
||||
* @param element the element to look for
|
||||
* @return {@code true} if found, {@code false} else
|
||||
* @return {@code true} if found, {@code false} otherwise
|
||||
*/
|
||||
public static boolean contains(@Nullable Enumeration<?> enumeration, Object element) {
|
||||
if (enumeration != null) {
|
||||
|
@ -160,7 +160,7 @@ public abstract class CollectionUtils {
|
|||
* {@code true} for an equal element as well.
|
||||
* @param collection the Collection to check
|
||||
* @param element the element to look for
|
||||
* @return {@code true} if found, {@code false} else
|
||||
* @return {@code true} if found, {@code false} otherwise
|
||||
*/
|
||||
public static boolean containsInstance(@Nullable Collection<?> collection, Object element) {
|
||||
if (collection != null) {
|
||||
|
@ -268,7 +268,7 @@ public abstract class CollectionUtils {
|
|||
* Determine whether the given Collection only contains a single unique object.
|
||||
* @param collection the Collection to check
|
||||
* @return {@code true} if the collection contains a single reference or
|
||||
* multiple references to the same instance, {@code false} else
|
||||
* multiple references to the same instance, {@code false} otherwise
|
||||
*/
|
||||
public static boolean hasUniqueObject(Collection<?> collection) {
|
||||
if (isEmpty(collection)) {
|
||||
|
|
|
@ -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.
|
||||
|
@ -122,8 +122,8 @@ public interface TransactionDefinition {
|
|||
|
||||
/**
|
||||
* Execute within a nested transaction if a current transaction exists,
|
||||
* behave like {@link #PROPAGATION_REQUIRED} else. There is no analogous
|
||||
* feature in EJB.
|
||||
* behave like {@link #PROPAGATION_REQUIRED} otherwise. There is no
|
||||
* analogous feature in EJB.
|
||||
* <p><b>NOTE:</b> Actual creation of a nested transaction will only work on
|
||||
* specific transaction managers. Out of the box, this only applies to the JDBC
|
||||
* {@link org.springframework.jdbc.datasource.DataSourceTransactionManager}
|
||||
|
|
Loading…
Reference in New Issue