diff --git a/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java b/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java index 903f203194..8e6b5839c7 100644 --- a/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java +++ b/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java @@ -87,10 +87,8 @@ public class MutablePropertyValues implements PropertyValues, Serializable { // There is no replacement of existing property values. if (original != null) { this.propertyValueList = new ArrayList<>(original.size()); - original.forEach( - (attrName, attrValue) - -> this.propertyValueList.add(new PropertyValue(attrName.toString(), attrValue)) - ); + original.forEach((attrName, attrValue) -> this.propertyValueList.add( + new PropertyValue(attrName.toString(), attrValue))); } else { this.propertyValueList = new ArrayList<>(0); @@ -152,10 +150,8 @@ public class MutablePropertyValues implements PropertyValues, Serializable { */ public MutablePropertyValues addPropertyValues(@Nullable Map other) { if (other != null) { - other.forEach( - (attrName, attrValue) - -> addPropertyValue(new PropertyValue(attrName.toString(), attrValue)) - ); + other.forEach((attrName, attrValue) -> addPropertyValue( + new PropertyValue(attrName.toString(), attrValue))); } return this; } diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java index 9b7d7e0c61..1fe6fbe932 100644 --- a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java +++ b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java @@ -457,7 +457,7 @@ public class PropertyEditorRegistrySupport implements PropertyEditorRegistry { String actualPropertyName = (nestedProperty != null ? PropertyAccessorUtils.getPropertyName(nestedProperty) : null); if (this.customEditors != null) { - this.customEditors.forEach((clazz, propertyEditor) -> target.registerCustomEditor(clazz, propertyEditor)); + this.customEditors.forEach(target::registerCustomEditor); } if (this.customEditorsForPath != null) { for (Map.Entry entry : this.customEditorsForPath.entrySet()) { diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java index 9478baf52a..33d354b6e2 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java @@ -77,7 +77,7 @@ public class ConstructorArgumentValues { ); other.genericArgumentValues.stream() .filter(valueHolder -> !this.genericArgumentValues.contains(valueHolder)) - .forEach(valueHolder -> addOrMergeGenericArgumentValue(valueHolder)); + .forEach(valueHolder -> addOrMergeGenericArgumentValue(valueHolder.copy())); } } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java index ad437717d8..56d5b6feb2 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2017 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. @@ -17,7 +17,6 @@ package org.springframework.beans.factory.config; import java.beans.PropertyEditor; -import java.util.Arrays; import java.util.Map; import org.apache.commons.logging.Log; @@ -141,7 +140,9 @@ public class CustomEditorConfigurer implements BeanFactoryPostProcessor, Ordered @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { if (this.propertyEditorRegistrars != null) { - Arrays.stream(this.propertyEditorRegistrars).forEach(beanFactory::addPropertyEditorRegistrar); + for (PropertyEditorRegistrar propertyEditorRegistrar : this.propertyEditorRegistrars) { + beanFactory.addPropertyEditorRegistrar(propertyEditorRegistrar); + } } if (this.customEditors != null) { this.customEditors.forEach(beanFactory::registerCustomEditor); diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java index 37a5e66829..3b36eef8ca 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. 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 20625ca8b6..d7fe0ef2be 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-context/src/main/java/org/springframework/cache/interceptor/NameMatchCacheOperationSource.java b/spring-context/src/main/java/org/springframework/cache/interceptor/NameMatchCacheOperationSource.java index e80974e722..71b2b17361 100644 --- a/spring-context/src/main/java/org/springframework/cache/interceptor/NameMatchCacheOperationSource.java +++ b/spring-context/src/main/java/org/springframework/cache/interceptor/NameMatchCacheOperationSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java index f85d5b82db..9e9680c9af 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java @@ -351,7 +351,8 @@ class ConfigurationClassBeanDefinitionReader { } private void loadBeanDefinitionsFromRegistrars(Map registrars) { - registrars.forEach((registrar, metadata) -> registrar.registerBeanDefinitions(metadata, this.registry)); + registrars.forEach((registrar, metadata) -> + registrar.registerBeanDefinitions(metadata, this.registry)); } diff --git a/spring-context/src/main/java/org/springframework/context/support/StaticMessageSource.java b/spring-context/src/main/java/org/springframework/context/support/StaticMessageSource.java index b21bbae244..9efe2b141f 100644 --- a/spring-context/src/main/java/org/springframework/context/support/StaticMessageSource.java +++ b/spring-context/src/main/java/org/springframework/context/support/StaticMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java index efb2e7c60f..467a828e74 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java @@ -544,7 +544,8 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo } if (!this.beans.isEmpty()) { - this.beans.forEach((beanName, instance) -> registerBeanNameOrInstance(instance, beanName)); + this.beans.forEach((beanName, instance) -> + registerBeanNameOrInstance(instance, beanName)); } } diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractConfigurableMBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractConfigurableMBeanInfoAssembler.java index 5cad1a437e..9269126e40 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractConfigurableMBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractConfigurableMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -53,10 +53,8 @@ public abstract class AbstractConfigurableMBeanInfoAssembler extends AbstractRef } public void setNotificationInfoMappings(Map notificationInfoMappings) { - notificationInfoMappings.forEach( - (beanKey, result) - -> this.notificationInfoMappings.put(beanKey, extractNotificationMetadata(result)) - ); + notificationInfoMappings.forEach((beanKey, result) -> + this.notificationInfoMappings.put(beanKey, extractNotificationMetadata(result))); } diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java index 70c02e02aa..8fcfb298f6 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java @@ -315,11 +315,8 @@ public class ScheduledAnnotationBeanPostProcessor } else { // Non-empty set of methods - annotatedMethods.forEach((method, scheduleds) -> { - for (Scheduled scheduled : scheduleds) { - processScheduled(scheduled, method, bean); - } - }); + annotatedMethods.forEach((method, scheduledMethods) -> + scheduledMethods.forEach(scheduled -> processScheduled(scheduled, method, bean))); if (logger.isDebugEnabled()) { logger.debug(annotatedMethods.size() + " @Scheduled methods processed on bean '" + beanName + "': " + annotatedMethods); diff --git a/spring-context/src/main/java/org/springframework/scheduling/config/ScheduledTaskRegistrar.java b/spring-context/src/main/java/org/springframework/scheduling/config/ScheduledTaskRegistrar.java index 743bb760cd..8c19d64545 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/config/ScheduledTaskRegistrar.java +++ b/spring-context/src/main/java/org/springframework/scheduling/config/ScheduledTaskRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-201 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java b/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java index 91410cf80d..41b35d14e4 100644 --- a/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java +++ b/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java b/spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java index 620175a654..fce7420811 100644 --- a/spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java +++ b/spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-core/src/main/java/org/springframework/core/type/classreading/MethodMetadataReadingVisitor.java b/spring-core/src/main/java/org/springframework/core/type/classreading/MethodMetadataReadingVisitor.java index 26a06a86ef..6727f1db93 100644 --- a/spring-core/src/main/java/org/springframework/core/type/classreading/MethodMetadataReadingVisitor.java +++ b/spring-core/src/main/java/org/springframework/core/type/classreading/MethodMetadataReadingVisitor.java @@ -147,7 +147,7 @@ public class MethodMetadataReadingVisitor extends MethodVisitor implements Metho for (AnnotationAttributes annotationAttributes : attributesList) { AnnotationAttributes convertedAttributes = AnnotationReadingVisitorUtils.convertClassValues( "method '" + getMethodName() + "'", this.classLoader, annotationAttributes, classValuesAsString); - convertedAttributes.forEach((attrName, attrValue) -> allAttributes.add(attrName, attrValue)); + convertedAttributes.forEach(allAttributes::add); } } return allAttributes; diff --git a/spring-core/src/main/java/org/springframework/util/MimeType.java b/spring-core/src/main/java/org/springframework/util/MimeType.java index 4c2a12273b..982db7cd94 100644 --- a/spring-core/src/main/java/org/springframework/util/MimeType.java +++ b/spring-core/src/main/java/org/springframework/util/MimeType.java @@ -455,7 +455,7 @@ public class MimeType implements Comparable, Serializable { private void appendTo(Map map, StringBuilder builder) { map.forEach((key, val) -> { - builder.append(";"); + builder.append(';'); builder.append(key); builder.append('='); builder.append(val); diff --git a/spring-core/src/main/java/org/springframework/util/xml/StaxEventHandler.java b/spring-core/src/main/java/org/springframework/util/xml/StaxEventHandler.java index afef82aeb3..12845be305 100644 --- a/spring-core/src/main/java/org/springframework/util/xml/StaxEventHandler.java +++ b/spring-core/src/main/java/org/springframework/util/xml/StaxEventHandler.java @@ -99,10 +99,8 @@ class StaxEventHandler extends AbstractStaxHandler { private List getNamespaces(Map namespaceMapping) { List result = new ArrayList<>(); - namespaceMapping.forEach( - (prefix, namespaceUri) - -> result.add(this.eventFactory.createNamespace(prefix, namespaceUri)) - ); + namespaceMapping.forEach((prefix, namespaceUri) -> + result.add(this.eventFactory.createNamespace(prefix, namespaceUri))); return result; } diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java index 21b638e4e8..f3947f8da1 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java index acd5de24c0..85f9d68d39 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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.