brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorbett <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #319: Clean up duplicated code in JcloudsLocati...
Date Tue, 18 Oct 2016 14:15:40 GMT
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/319#discussion_r83863239
  
    --- Diff: utils/common/src/main/java/org/apache/brooklyn/util/net/Networking.java ---
    @@ -241,7 +241,12 @@ public static void checkPortsValid(Map<?, ?> ports) {
         public static RangeSet<Integer> portRulesToRanges(Collection<String>
portRules) {
             RangeSet<Integer> result = TreeRangeSet.create();
             for (String portRule : portRules) {
    -            if (portRule.contains("-")) {
    +            if (portRule.isEmpty()) {
    +                throw new IllegalArgumentException("portRule shouldn't be empty");
    +            }
    +            if (portRule.equals("-1")) {
    +                result.add(Range.closed(Integer.parseInt("-1"), Integer.parseInt("-1")));
    --- End diff --
    
    Is this necessary? Strikes me as surprising and I can't see where it's required in these
changes.


---
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