Polish "Refact iterator of Map with Java 8 forEach"

Closes gh-1451
This commit is contained in:
Stephane Nicoll
2017-06-12 08:53:56 +02:00
parent dab7a7f0ee
commit 27aabb15f9
20 changed files with 32 additions and 40 deletions

View File

@@ -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.

View File

@@ -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;

View File

@@ -455,7 +455,7 @@ public class MimeType implements Comparable<MimeType>, Serializable {
private void appendTo(Map<String, String> map, StringBuilder builder) {
map.forEach((key, val) -> {
builder.append(";");
builder.append(';');
builder.append(key);
builder.append('=');
builder.append(val);

View File

@@ -99,10 +99,8 @@ class StaxEventHandler extends AbstractStaxHandler {
private List<Namespace> getNamespaces(Map<String, String> namespaceMapping) {
List<Namespace> 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;
}