Skip to content

Commit a2765c0

Browse files
committed
Polishing
1 parent 78d3164 commit a2765c0

File tree

7 files changed

+20
-18
lines changed

7 files changed

+20
-18
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -225,7 +225,7 @@ public void destroy() throws Exception {
225225
* FactoryBean is supposed to implement, for use with an 'early singleton
226226
* proxy' that will be exposed in case of a circular reference.
227227
* <p>The default implementation returns this FactoryBean's object type,
228-
* provided that it is an interface, or {@code null} else. The latter
228+
* provided that it is an interface, or {@code null} otherwise. The latter
229229
* indicates that early singleton access is not supported by this FactoryBean.
230230
* This will lead to a FactoryBeanNotInitializedException getting thrown.
231231
* @return the interfaces to use for 'early singletons',

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ else if (value instanceof Collection) {
301301
Collection<Object> collection = (Collection<Object>) value;
302302
if (collection.isEmpty()) {
303303
result.put(key, "");
304-
} else {
304+
}
305+
else {
305306
int count = 0;
306307
for (Object object : collection) {
307308
buildFlattenedMap(result, Collections.singletonMap(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ protected boolean isFactoryBean(String beanName, RootBeanDefinition mbd) {
15011501
* should be used as fallback.
15021502
* @param beanName the name of the bean
15031503
* @param mbd the merged bean definition for the bean
1504-
* @return the type for the bean if determinable, or {@code null} else
1504+
* @return the type for the bean if determinable, or {@code null} otherwise
15051505
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
15061506
* @see #getBean(String)
15071507
*/

spring-context-indexer/src/main/java/org/springframework/context/index/TypeHelper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -62,9 +62,9 @@ public String getType(TypeMirror type) {
6262
DeclaredType declaredType = (DeclaredType) type;
6363
Element enclosingElement = declaredType.asElement().getEnclosingElement();
6464
if (enclosingElement != null && enclosingElement instanceof TypeElement) {
65-
return getQualifiedName(enclosingElement) + "$"
66-
+ declaredType.asElement().getSimpleName().toString();
67-
} else {
65+
return getQualifiedName(enclosingElement) + "$" + declaredType.asElement().getSimpleName().toString();
66+
}
67+
else {
6868
return getQualifiedName(declaredType.asElement());
6969
}
7070
}
@@ -85,7 +85,7 @@ private String getQualifiedName(Element element) {
8585
public Element getSuperClass(Element element) {
8686
List<? extends TypeMirror> superTypes = this.types.directSupertypes(element.asType());
8787
if (superTypes.isEmpty()) {
88-
return null; // reached java.lang.Object
88+
return null; // reached java.lang.Object
8989
}
9090
return this.types.asElement(superTypes.get(0));
9191
}

spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,10 @@ public static Flux<DataBuffer> skipUntilByteCount(Publisher<DataBuffer> publishe
431431
skipUntil(dataBuffer -> {
432432
int delta = -dataBuffer.readableByteCount();
433433
long currentCount = byteCountDown.addAndGet(delta);
434-
if(currentCount < 0) {
434+
if (currentCount < 0) {
435435
return true;
436-
} else {
436+
}
437+
else {
437438
DataBufferUtils.release(dataBuffer);
438439
return false;
439440
}

spring-core/src/main/java/org/springframework/util/CollectionUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public static <K, V> void mergePropertiesIntoMap(@Nullable Properties props, Map
122122
* Check whether the given Iterator contains the given element.
123123
* @param iterator the Iterator to check
124124
* @param element the element to look for
125-
* @return {@code true} if found, {@code false} else
125+
* @return {@code true} if found, {@code false} otherwise
126126
*/
127127
public static boolean contains(@Nullable Iterator<?> iterator, Object element) {
128128
if (iterator != null) {
@@ -140,7 +140,7 @@ public static boolean contains(@Nullable Iterator<?> iterator, Object element) {
140140
* Check whether the given Enumeration contains the given element.
141141
* @param enumeration the Enumeration to check
142142
* @param element the element to look for
143-
* @return {@code true} if found, {@code false} else
143+
* @return {@code true} if found, {@code false} otherwise
144144
*/
145145
public static boolean contains(@Nullable Enumeration<?> enumeration, Object element) {
146146
if (enumeration != null) {
@@ -160,7 +160,7 @@ public static boolean contains(@Nullable Enumeration<?> enumeration, Object elem
160160
* {@code true} for an equal element as well.
161161
* @param collection the Collection to check
162162
* @param element the element to look for
163-
* @return {@code true} if found, {@code false} else
163+
* @return {@code true} if found, {@code false} otherwise
164164
*/
165165
public static boolean containsInstance(@Nullable Collection<?> collection, Object element) {
166166
if (collection != null) {
@@ -268,7 +268,7 @@ public static Object findValueOfType(Collection<?> collection, Class<?>[] types)
268268
* Determine whether the given Collection only contains a single unique object.
269269
* @param collection the Collection to check
270270
* @return {@code true} if the collection contains a single reference or
271-
* multiple references to the same instance, {@code false} else
271+
* multiple references to the same instance, {@code false} otherwise
272272
*/
273273
public static boolean hasUniqueObject(Collection<?> collection) {
274274
if (isEmpty(collection)) {

spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -122,8 +122,8 @@ public interface TransactionDefinition {
122122

123123
/**
124124
* Execute within a nested transaction if a current transaction exists,
125-
* behave like {@link #PROPAGATION_REQUIRED} else. There is no analogous
126-
* feature in EJB.
125+
* behave like {@link #PROPAGATION_REQUIRED} otherwise. There is no
126+
* analogous feature in EJB.
127127
* <p><b>NOTE:</b> Actual creation of a nested transaction will only work on
128128
* specific transaction managers. Out of the box, this only applies to the JDBC
129129
* {@link org.springframework.jdbc.datasource.DataSourceTransactionManager}

0 commit comments

Comments
 (0)