MPLINKCHECK-21 : java.lang.NumberFormatException if proxy port is setted to ""

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@155277 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2005-02-24 23:23:29 +00:00
parent 891d28c46c
commit cdd6ae204d
2 changed files with 11 additions and 4 deletions

View File

@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory;
/**
* Checks links which are normal URLs
* @author <a href="mailto:bwalding@apache.org">Ben Walding</a>
* @version $Id: HTTPLinkValidator.java,v 1.13 2004/08/01 22:28:14 carlos Exp $
* @version $Id$
*/
public class HTTPLinkValidator implements LinkValidator
{
@ -51,7 +51,7 @@ public class HTTPLinkValidator implements LinkValidator
public HTTPLinkValidator(String proxyHost, String proxyPort, String proxyUser, String proxyPass)
{
if (proxyHost == null)
if (proxyHost == null || proxyHost.trim().equals(""))
{
LOG.info("maven-linkcheck-plugin: Not using a proxy");
this.proxyHost = null;
@ -59,7 +59,13 @@ public class HTTPLinkValidator implements LinkValidator
else
{
this.proxyHost = proxyHost;
this.proxyPort = Integer.parseInt(proxyPort);
try{
this.proxyPort = Integer.parseInt(proxyPort);
}catch(NumberFormatException e){
LOG.warn("maven-linkcheck-plugin: Invalid number for Proxy Port:" + proxyPort);
LOG.warn("maven-linkcheck-plugin: Proxy Port won't be used.");
this.proxyPort = 0;
}
this.proxyUser = proxyUser;
this.proxyPass = proxyPass;
LOG.info("maven-linkcheck-plugin: Proxy Host:" + proxyHost);

View File

@ -25,8 +25,9 @@
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<release version="1.4-SNAPSHOT" date="in CVS">
<release version="1.4-SNAPSHOT" date="in SVN">
<action dev="brett" type="update">Make compatible with Maven 1.1</action>
<action dev="aheritier" type="fix" issue="MPLINKCHECK-21">java.lang.NumberFormatException if proxy port is setted to ""</action>
</release>
<release version="1.3.4" date="2004-11-20">
<action dev="carlos" type="fix" issue="MPLINKCHECK-17">Made compatible with JDK 1.3</action>