From aded054d76dc8532c9e73efc3a1ee9dacd9a57ef Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 28 Mar 2009 19:02:38 +0000 Subject: [PATCH] [MNG-2387] on in settings is misleading o Merged from r747683 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@759552 13f79535-47bb-0310-9956-ffa450edef68 --- maven-core/src/main/mdo/settings.mdo | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/maven-core/src/main/mdo/settings.mdo b/maven-core/src/main/mdo/settings.mdo index 99afcb914f..409054e5e5 100644 --- a/maven-core/src/main/mdo/settings.mdo +++ b/maven-core/src/main/mdo/settings.mdo @@ -292,28 +292,19 @@ */ public synchronized Proxy getActiveProxy() { - if(activeProxy == null) + if (activeProxy == null) { - java.util.List proxies = getProxies(); + java.util.List proxies = getProxies(); if ( proxies != null && !proxies.isEmpty() ) { - if ( proxies.size() > 1 ) + for ( Proxy proxy : proxies ) { - for ( java.util.Iterator it = proxies.iterator(); it.hasNext(); ) + if ( proxy.isActive() ) { - Proxy proxy = (Proxy) it.next(); - if ( proxy.isActive() ) - { - activeProxy = proxy; - break; - } + activeProxy = proxy; + break; } } - else - { - // If we only have one proxy, use it as the active one. - activeProxy = (Proxy) proxies.get( 0 ); - } } } @@ -464,7 +455,7 @@ active 1.0.0 false - false + true