>        public Role build() {
> -         return new Role(name, description, defaultAttributes.build(), 
> runList.build(), overrideAttributes.build());
> +         // Assemble an immutable envRunList where each entry is an 
> immutable list of entries.
> +         ImmutableMap.Builder<String, List<String>> immutableEnvRunList = 
> ImmutableMap.builder();
> +         for (Entry<String, List<String>> e : envRunList.entrySet()) {
> +            ImmutableList.Builder<String> value = ImmutableList.builder();
> +            value.addAll(e.getValue());
> +            immutableEnvRunList.put(e.getKey(), value.build());

No need for a builder and a list here. Something like the following is more 
concise and easier to read?
```java
immutableEnvRunList.put(e.getKey(), ImmutableList.copyOf(e.getValue()));
```
Or use the more functional approach:
```java
immutableEnv = Maps.transformValues(envRunList, new Function<List<String>, 
List<String>>() {
   @Override public List<String> apply(List<String> input) {
      return ImmutableList.copyOf(input);
   }
});
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/912/files#r51649513

Reply via email to