Polish some Map operations

Closes gh-15103
This commit is contained in:
dreis2211
2018-11-05 20:11:31 +01:00
committed by Stephane Nicoll
parent 804f647a34
commit 3e95af2c85
5 changed files with 10 additions and 11 deletions

View File

@@ -68,8 +68,8 @@ class JavaBeanBinder implements BeanBinder {
private <T> boolean bind(BeanPropertyBinder propertyBinder, Bean<T> bean,
BeanSupplier<T> beanSupplier) {
boolean bound = false;
for (Map.Entry<String, BeanProperty> entry : bean.getProperties().entrySet()) {
bound |= bind(beanSupplier, propertyBinder, entry.getValue());
for (BeanProperty beanProperty : bean.getProperties().values()) {
bound |= bind(beanSupplier, propertyBinder, beanProperty);
}
return bound;
}

View File

@@ -620,7 +620,7 @@ public class MapBinderTests {
.withExistingValue(Collections.singletonMap("a", "b")))
.get();
assertThat(result).hasSize(3);
assertThat(result.entrySet()).containsExactly(entry("a", "b"), entry("c", "d"),
assertThat(result).containsExactly(entry("a", "b"), entry("c", "d"),
entry("e", "f"));
}