> @@ -180,6 +186,15 @@ protected 
> CreateNodesWithGroupEncodedIntoNameThenAddToSet(
>      */
>     protected Set<String> getNextNames(final String group, final Template 
> template, int count) {
>        Set<String> names = newLinkedHashSet();
> +      if (!template.getOptions().getNodeNames().isEmpty()) {
> +         if (template.getOptions().getNodeNames().size() == count) {
> +            return ImmutableSet.copyOf(template.getOptions().getNodeNames());
> +         } else if (template.getOptions().getNodeNames().size() > count) {
> +            return 
> ImmutableSet.copyOf(Iterables.limit(template.getOptions().getNodeNames(), 
> count));

These two branches are certainly clear, but would
```
Set<String> nodeNames = template.getOptions().getNodeNames();
if (nodeNames.size() >= count) {
  return ImmutableSet.copyOf(Iterables.limit(nodeNames, count));
} else {
  names.addAll(nodeNames);
}
```
be clear enough, and a bit shorter?

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

Reply via email to