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.