diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactoryUtils.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactoryUtils.java index 30d99fb7396..079139fe410 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactoryUtils.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactoryUtils.java @@ -265,7 +265,6 @@ public abstract class BeanFactoryUtils { if (hbf.getParentBeanFactory() instanceof ListableBeanFactory) { Map parentResult = beansOfTypeIncludingAncestors( (ListableBeanFactory) hbf.getParentBeanFactory(), type); - parentResult.forEach((beanName, beanType) -> { if (!result.containsKey(beanName) && !hbf.containsLocalBean(beanName)) { result.put(beanName, beanType); @@ -314,7 +313,6 @@ public abstract class BeanFactoryUtils { if (hbf.getParentBeanFactory() instanceof ListableBeanFactory) { Map parentResult = beansOfTypeIncludingAncestors( (ListableBeanFactory) hbf.getParentBeanFactory(), type, includeNonSingletons, allowEagerInit); - parentResult.forEach((beanName, beanType) -> { if (!result.containsKey(beanName) && !hbf.containsLocalBean(beanName)) { result.put(beanName, beanType); 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 e2c3b570f6a..6b824d70af4 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 @@ -1187,11 +1187,9 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp } } if (!this.customEditors.isEmpty()) { - this.customEditors.forEach( - (requiredType, editorClass) - -> registry.registerCustomEditor(requiredType, BeanUtils.instantiateClass(editorClass)) - ); - } + this.customEditors.forEach((requiredType, editorClass) -> + registry.registerCustomEditor(requiredType, BeanUtils.instantiateClass(editorClass))); + } } diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientRequestBuilder.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientRequestBuilder.java index 319cd58b777..4afeb41f27a 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientRequestBuilder.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientRequestBuilder.java @@ -175,11 +175,10 @@ class DefaultClientRequestBuilder implements ClientRequest.Builder { MultiValueMap requestCookies = request.getCookies(); if (!this.cookies.isEmpty()) { - this.cookies.forEach(( name , values) -> - values.forEach(value -> { - HttpCookie cookie = new HttpCookie(name, value); - requestCookies.add(name, cookie); - })); + this.cookies.forEach((name, values) -> values.forEach(value -> { + HttpCookie cookie = new HttpCookie(name, value); + requestCookies.add(name, cookie); + })); } return this.inserter.insert(request, new BodyInserter.Context() { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java index a2fbcb071c6..f95c91b8db2 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.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. @@ -281,9 +281,8 @@ public class BaseViewTests { */ @SuppressWarnings({ "rawtypes", "unchecked" }) private void checkContainsAll(Map expected, Map actual) { - expected.forEach( - (k, v) -> assertEquals("Values for model key '" + k + "' must match", expected.get(k), actual.get(k)) - ); + expected.forEach((k, v) -> assertEquals("Values for model key '" + k + + "' must match", expected.get(k), actual.get(k))); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java index 69aac911922..bea57308ce1 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.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. @@ -84,10 +84,8 @@ public class InternalResourceViewTests { view.render(model, request, response); assertEquals(url, response.getForwardedUrl()); - - model.forEach( - (key, value) -> assertEquals("Values for model key '" + key + "' must match", value, request.getAttribute(key)) - ); + model.forEach((key, value) -> assertEquals("Values for model key '" + key + + "' must match", value, request.getAttribute(key))); } @Test