abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Heuer (JIRA)" <j...@apache.org>
Subject [jira] Created: (ABDERA-200) IRI: NumberFormatException for IRIs like http://www.example.org:/
Date Thu, 18 Sep 2008 13:57:44 GMT
IRI: NumberFormatException for IRIs like http://www.example.org:/
-----------------------------------------------------------------

                 Key: ABDERA-200
                 URL: https://issues.apache.org/jira/browse/ABDERA-200
             Project: Abdera
          Issue Type: Bug
    Affects Versions: 0.5.0
            Reporter: Lars Heuer


NumberFormatException is thrown if the port delimiter is given but no port, like "http://www.example.org:/"
According to RFC 3987 this should be interpreted as default port (c.f. 5.3.3.  Scheme-Based
Normalization)

Solution:

Change
  private static final Pattern AUTHORITYPATTERN =
    Pattern.compile("^(?:(.*)?@)?((?:\\[.*\\])|(?:[^:]*))?(?::(\\d*))?");

to 
  private static final Pattern AUTHORITYPATTERN =
    Pattern.compile("^(?:(.*)?@)?((?:\\[.*\\])|(?:[^:]*))?(?::(\\d+))?");

This is the change: (\\d*) --> (\\d+)

So, auth.group(3) in "parseAuthority()" becomes "null" if the port delimiter is given but
no port is defined.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message