Skip to content

Commit b0dd5d5

Browse files
authored
Use Map#forEach directly instead of Map#entrySet().forEach (#16)
1 parent 3772c04 commit b0dd5d5

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

processor/src/main/resources/org/mapstruct/tools/gem/processor/Gem.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public class ${gemInfo.gemName} implements Gem {
103103

104104
// fetch all explicitely set annotation values in the annotation instance
105105
Map<String, AnnotationValue> values = new HashMap<>( enclosed.size() );
106-
mirror.getElementValues().entrySet().forEach( e -> values.put( e.getKey().getSimpleName().toString(), e.getValue() ) );
106+
mirror.getElementValues().forEach( (key, value) -> values.put( key.getSimpleName().toString(), value ) );
107107

108108
// iterate and populate builder
109109
for ( String methodName : defaultValues.keySet() ) {

processor/src/test/resources/fixtures/org/mapstruct/tools/gem/processor/SomeAnnotationGem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public static <T> T build(AnnotationMirror mirror, Builder<T> builder ) {
333333

334334
// fetch all explicitely set annotation values in the annotation instance
335335
Map<String, AnnotationValue> values = new HashMap<>( enclosed.size() );
336-
mirror.getElementValues().entrySet().forEach( e -> values.put( e.getKey().getSimpleName().toString(), e.getValue() ) );
336+
mirror.getElementValues().forEach( (key, value) -> values.put( key.getSimpleName().toString(), value ) );
337337

338338
// iterate and populate builder
339339
for ( String methodName : defaultValues.keySet() ) {

processor/src/test/resources/fixtures/org/mapstruct/tools/gem/processor/SomeAnnotationsGem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static <T> T build(AnnotationMirror mirror, Builder<T> builder ) {
8080

8181
// fetch all explicitely set annotation values in the annotation instance
8282
Map<String, AnnotationValue> values = new HashMap<>( enclosed.size() );
83-
mirror.getElementValues().entrySet().forEach( e -> values.put( e.getKey().getSimpleName().toString(), e.getValue() ) );
83+
mirror.getElementValues().forEach( (key, value) -> values.put( key.getSimpleName().toString(), value ) );
8484

8585
// iterate and populate builder
8686
for ( String methodName : defaultValues.keySet() ) {

processor/src/test/resources/fixtures/org/mapstruct/tools/gem/processor/SomeArrayAnnotationGem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static <T> T build(AnnotationMirror mirror, Builder<T> builder ) {
117117

118118
// fetch all explicitely set annotation values in the annotation instance
119119
Map<String, AnnotationValue> values = new HashMap<>( enclosed.size() );
120-
mirror.getElementValues().entrySet().forEach( e -> values.put( e.getKey().getSimpleName().toString(), e.getValue() ) );
120+
mirror.getElementValues().forEach( (key, value) -> values.put( key.getSimpleName().toString(), value ) );
121121

122122
// iterate and populate builder
123123
for ( String methodName : defaultValues.keySet() ) {

0 commit comments

Comments
 (0)