brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #549: SecurityGroupEditor- Allow for different ...
Date Fri, 03 Feb 2017 18:49:49 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/549#discussion_r99397420
  
    --- Diff: locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/SecurityGroupEditor.java
---
    @@ -156,11 +162,14 @@ public AmbiguousGroupName(String s) {
          * @throws AmbiguousGroupName in the unexpected case that the cloud returns more
than one matching group.
          */
         public Optional<SecurityGroup> findSecurityGroupByName(final String name) {
    -        final String query = name.startsWith(JCLOUDS_PREFIX) ? name : JCLOUDS_PREFIX
+ name;
             final Iterable<SecurityGroup> groupsMatching = findSecurityGroupsMatching(new
Predicate<SecurityGroup>() {
    +            final String rawName = name.matches(IS_JCLOUDS_PREFIXED_REGEX)
    +                ? name.substring(JCLOUDS_PREFIX_REGEX.length())
    +                : name;
    --- End diff --
    
    Now that you are using a regex could simplify to name.replaceAll("^jclouds[#-]", "")


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message