You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2016/05/01 12:56:18 UTC

[16/50] [abbrv] maven-aether git commit: Bug 436292 - Allow comma as delimiter for non-proxy hosts in DefaultProxySelector

Bug 436292 - Allow comma as delimiter for non-proxy hosts in DefaultProxySelector


Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/c2b1c3db
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/c2b1c3db
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/c2b1c3db

Branch: refs/heads/master
Commit: c2b1c3dbe927ada1cc0dee55a5a734de898c0e2d
Parents: 93310af
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat May 31 17:35:51 2014 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat May 31 17:35:51 2014 +0200

----------------------------------------------------------------------
 .../eclipse/aether/util/repository/DefaultProxySelector.java    | 4 ++--
 .../aether/util/repository/DefaultProxySelectorTest.java        | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-aether/blob/c2b1c3db/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java
----------------------------------------------------------------------
diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java b/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java
index 0bccf8a..5f3d411 100644
--- a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java
+++ b/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java
@@ -40,7 +40,7 @@ public final class DefaultProxySelector
      * @param nonProxyHosts The list of (case-insensitive) host names to exclude from proxying, may be {@code null}. The
      *            syntax of this list resembles that of the property "http.nonProxyHosts" from the JRE, i.e. the
      *            asterisk character ('*') serves as a wildcard for pattern matching. Multiple entries are separated by
-     *            the pipe character ('|') and surrounding whitespace is trimmed.
+     *            the pipe character ('|') or comma (',') and surrounding whitespace is trimmed.
      * @return This proxy selector for chaining, never {@code null}.
      */
     public DefaultProxySelector add( Proxy proxy, String nonProxyHosts )
@@ -139,7 +139,7 @@ public final class DefaultProxySelector
             List<String> hosts = null;
             if ( nonProxyHosts != null )
             {
-                hosts = Arrays.asList( nonProxyHosts.trim().split( "\\s*\\|\\s*" ) );
+                hosts = Arrays.asList( nonProxyHosts.trim().split( "\\s*[|,]\\s*" ) );
             }
             return hosts;
         }

http://git-wip-us.apache.org/repos/asf/maven-aether/blob/c2b1c3db/aether-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java
----------------------------------------------------------------------
diff --git a/aether-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java
index 80392b1..85eeac6 100644
--- a/aether-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java
+++ b/aether-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java
@@ -70,7 +70,12 @@ public class DefaultProxySelectorTest
         assertTrue( isNonProxyHost( "eclipse.org", "host1|eclipse.org" ) );
         assertTrue( isNonProxyHost( "eclipse.org", "host1|eclipse.org|host2" ) );
 
+        assertTrue( isNonProxyHost( "eclipse.org", "eclipse.org,host2" ) );
+        assertTrue( isNonProxyHost( "eclipse.org", "host1,eclipse.org" ) );
+        assertTrue( isNonProxyHost( "eclipse.org", "host1,eclipse.org,host2" ) );
+
         assertFalse( isNonProxyHost( "", "||host||" ) );
+        assertFalse( isNonProxyHost( "", ",,host,," ) );
     }
 
     @Test