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:
parent
891d28c46c
commit
cdd6ae204d
@ -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);
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user