[ http://issues.apache.org/jira/browse/VALIDATOR-202?page=comments#action_12440200 ] Henri Yandell commented on VALIDATOR-202: -----------------------------------------
ArrayList seemed like a 'doh' moment, but digging into it it's a bit of a pain to code. You can't use set as you have to use add the first time in an ArrayList; so the code would need a large change. When I was looking at this class there were a number of bits that were jumping up and down saying "RECODE ME!", so I'm going to apply the two patches above to get the bug fixed in the nightly build tonight and then I'll look into rewriting things a bit. ArrayList would work fine if the code was changed from set(..) to add(..) semantics, but I also think the whole thing could be simplified. > URL Validator isValid method fails with > java.lang.ArrayIndexOutOfBoundsException at > org.apache.commons.validator.UrlValidator.isValidAuthority(UrlValidator.java:367) > --------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: VALIDATOR-202 > URL: http://issues.apache.org/jira/browse/VALIDATOR-202 > Project: Commons Validator > Issue Type: Bug > Environment: JBOSS Running on Linux > Reporter: Ben > Attachments: 202-fix.patch, 202-test.patch > > > Validating the following URL will throw an ArrayIndexOutOfBoundsException > exception > http://www.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.log > Code: > String[] schemes = {"http","https"}. > UrlValidator urlValidator = new UrlValidator(schemes, > UrlValidator.NO_FRAGMENTS) ; > > urlValidator.isValid("http://www.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.log") > ; -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
