diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java index fe1dcf8bdd4..d589302e9dd 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java @@ -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 * FactoryBean is supposed to implement, for use with an 'early singleton * proxy' that will be exposed in case of a circular reference. *

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', diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java index 48d2b06b44e..5ca1a7892c0 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java @@ -296,7 +296,8 @@ public abstract class YamlProcessor { Collection collection = (Collection) value; if (collection.isEmpty()) { result.put(key, ""); - } else { + } + else { int count = 0; for (Object object : collection) { buildFlattenedMap(result, Collections.singletonMap( diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java index af53e75b40d..9a563f2ac35 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java @@ -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) */ diff --git a/spring-context-indexer/src/main/java/org/springframework/context/index/TypeHelper.java b/spring-context-indexer/src/main/java/org/springframework/context/index/TypeHelper.java index 407eac8f042..e4af2fc167a 100644 --- a/spring-context-indexer/src/main/java/org/springframework/context/index/TypeHelper.java +++ b/spring-context-indexer/src/main/java/org/springframework/context/index/TypeHelper.java @@ -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 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)); } diff --git a/spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java b/spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java index cb5daf76b65..a790dce793d 100644 --- a/spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java +++ b/spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java @@ -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; } diff --git a/spring-core/src/main/java/org/springframework/util/CollectionUtils.java b/spring-core/src/main/java/org/springframework/util/CollectionUtils.java index 8c8efcdd8d4..7e2f5506e15 100644 --- a/spring-core/src/main/java/org/springframework/util/CollectionUtils.java +++ b/spring-core/src/main/java/org/springframework/util/CollectionUtils.java @@ -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)) { diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java index d3f35779868..e43183eff12 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java @@ -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. *

NOTE: 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}