> + public Set<SecurityGroup> listSecurityGroups() {
> + Iterable<? extends org.jclouds.ec2.domain.SecurityGroup> rawGroups =
> pollSecurityGroups();
> + Iterable<SecurityGroup> groups = transform(filter(rawGroups,
> notNull()),
> + groupConverter);
> + return ImmutableSet.copyOf(groups);
> + }
> +
> +
> + @Override
> + public Set<SecurityGroup> listSecurityGroupsInLocation(final Location
> location) {
> + String region = AWSUtils.getRegionFromLocationOrNull(location);
> + if (region != null) {
> + return listSecurityGroupsInLocation(region);
> + } else {
> + return ImmutableSet.of();
> + }
Quick style question (also applies below): what do you feel about making the
"exceptional case" (`region == null`, I'm guessing?) the bit you handle in the
`if...` clause, e.g.
```
if (region == null) {
return ImmutableSet.of(); // handle special case
}
return listSecurityGroupsInLocation(region);
```
?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/33/files#r4736710