You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by bu...@apache.org on 2006/01/25 17:58:01 UTC
DO NOT REPLY [Bug 38385] New: - Nullpointer when creating URI from scheme specific part with null fragment
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
Summary: Nullpointer when creating URI from scheme specific part
with null fragment
Product: HttpClient
Version: 3.0 Final
Platform: All
URL: http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper
/httpclient/trunk/src/java/org/apache/commons/httpclient
/URI.java?rev=358634&view=markup
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Commons HttpClient
AssignedTo: httpclient-dev@jakarta.apache.org
ReportedBy: vivodamichele@hotmail.com
in org.apache.commons.httpclient.URI class constructor:
public URI(String scheme, String schemeSpecificPart, String fragment)
throws URIException {
....
_fragment = fragment.toCharArray();
should be
_fragment = fragment==null ? null : fragment.toCharArray();
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
------- Additional Comments From vivodamichele@hotmail.com 2006-01-26 14:30 -------
> We may consider migrating this code to a module of its own, _provided_ someone
> steps in to maintain it. Otherwise, I would very much rather prefer to use
> something which is a part of standard JDK and is maintained (however badly)
> HttpClient 2.0.x and HttpClient 3.x require JDK 1.2.2 only. HttpClient 4.0 is
> very likely to require JDK 1.4
> Oleg
Oleg
I will give a look if I can refactor the code and if I do I let you know.
Can you tell me if you have know if it is required for it to be modificable and
not readonly ? I am going for a non modificable interface, like io.File or
net.URI
Michele
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
------- Additional Comments From olegk@apache.org 2006-01-26 16:48 -------
(In reply to comment #7)
...
> Oleg
> I will give a look if I can refactor the code and if I do I let you know.
> Can you tell me if you have know if it is required for it to be modificable and
> not readonly ? I am going for a non modificable interface, like io.File or
> net.URI
Michele
Such contribution would be much appreciated. I personally think URI objects
should be immutable but will not insist on a particular design choice.
Oleg
> Michele
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
olegk@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Additional Comments From olegk@apache.org 2006-01-26 17:07 -------
Patch checked in
Oleg
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
------- Additional Comments From olegk@apache.org 2006-01-26 12:13 -------
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > (In reply to comment #2)
> > ...
...
> Oleg,
> I am doing these tests with junit on one side and rfc 3986 in the other and I
> found that java4.net.URI has also some problems. An other thing is that if you
> have a problem with java.net.URI is not possible to change the code. I would
> leave at least a wrapper around so that someone can still intervene in case of
> problems. An other difference is that java.net.URI is unmodificable, while
> httpclient.URI is modificable, do you think is really needed for it to be
> modificable ? The code is perhaps in some parts "ugly" but I cannot say too bad
> things on it since I was using it since when I found it in package
> org.apache.util that was included in Slide in 2001/2 and also thanks to it and
> even thanks to its errors I started to become interested in the concept. Its
> uniqueness is in being quite forgiving in parsing
> My aim is to make a java4-independent URI only package (may be some URI
> comparators for different scopes [like network]). I already fit java4 URI into
> this framework and passed almost all but 3 of the (188) tests, now I am trying
> with httpclient.URI and I am around 20 failures. I must say that I found a
> little bit heavy the fact of needing httpclient, codec and even logging for
> using a URI class. JUnit made me crazy with the class loaded wrong hierarchy
> for logging...
> Last thing...does httpclient need java 1.4 ?
> Ciao
> Michele
We may consider migrating this code to a module of its own, _provided_ someone
steps in to maintain it. Otherwise, I would very much rather prefer to use
something which is a part of standard JDK and is maintained (however badly)
HttpClient 2.0.x and HttpClient 3.x require JDK 1.2.2 only. HttpClient 4.0 is
very likely to require JDK 1.4
Oleg
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
------- Additional Comments From olegk@apache.org 2006-01-26 11:29 -------
(In reply to comment #3)
> (In reply to comment #2)
...
>
> Do you mean the remove the deprecated constructors etc or the whole URI class
> implementation ? I was using this constructor because I was not able to obtain
> an uri whose isOpaquePart returned true using the URI(String, boolean)
> constructor, for example from <ma...@pop.org> What I get is an absolute
> uri with relative path [pop@pop.org] ?? I am asking because I am doing some
> testing following RFC3986 and using httpclient.URI class and JDK1.4
> java.net.URI.
Michele,
I meant the whole class (URI). This is my personal opinion that the URI class
heeds to go, and not that of the HttpClient committers. This issue will be
subject to open discussion on the dev list and eventually to a formal vote. I
will be pressing for deprecation (removal) of this class in favor of JDK14 URI
class, unless someone will step in to maintain and seriously refactor the URI
and related classes. The person who originally wrote the code left the project
about two years ago. The code has been effectively unmaintained ever since.
Oleg
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
odi@odi.ch changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
------- Additional Comments From odi@odi.ch 2006-01-26 00:20 -------
Michele, please post a code snippet that exhibits the problem.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
------- Additional Comments From vivodamichele@hotmail.com 2006-01-26 12:00 -------
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> ...
> >
> > Do you mean the remove the deprecated constructors etc or the whole URI
class
> > implementation ? I was using this constructor because I was not able to
obtain
> > an uri whose isOpaquePart returned true using the URI(String, boolean)
> > constructor, for example from <ma...@pop.org> What I get is an
absolute
> > uri with relative path [pop@pop.org] ?? I am asking because I am doing some
> > testing following RFC3986 and using httpclient.URI class and JDK1.4
> > java.net.URI.
> Michele,
> I meant the whole class (URI). This is my personal opinion that the URI class
> heeds to go, and not that of the HttpClient committers. This issue will be
> subject to open discussion on the dev list and eventually to a formal vote. I
> will be pressing for deprecation (removal) of this class in favor of JDK14 URI
> class, unless someone will step in to maintain and seriously refactor the URI
> and related classes. The person who originally wrote the code left the project
> about two years ago. The code has been effectively unmaintained ever since.
> Oleg
Oleg,
I am doing these tests with junit on one side and rfc 3986 in the other and I
found that java4.net.URI has also some problems. An other thing is that if you
have a problem with java.net.URI is not possible to change the code. I would
leave at least a wrapper around so that someone can still intervene in case of
problems. An other difference is that java.net.URI is unmodificable, while
httpclient.URI is modificable, do you think is really needed for it to be
modificable ? The code is perhaps in some parts "ugly" but I cannot say too bad
things on it since I was using it since when I found it in package
org.apache.util that was included in Slide in 2001/2 and also thanks to it and
even thanks to its errors I started to become interested in the concept. Its
uniqueness is in being quite forgiving in parsing
My aim is to make a java4-independent URI only package (may be some URI
comparators for different scopes [like network]). I already fit java4 URI into
this framework and passed almost all but 3 of the (188) tests, now I am trying
with httpclient.URI and I am around 20 failures. I must say that I found a
little bit heavy the fact of needing httpclient, codec and even logging for
using a URI class. JUnit made me crazy with the class loaded wrong hierarchy
for logging...
Last thing...does httpclient need java 1.4 ?
Ciao
Michele
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
------- Additional Comments From vivodamichele@hotmail.com 2006-01-26 01:38 -------
(In reply to comment #2)
> Odi,
> It is quite obvious that null fragment parameter will cause an NPE in the
> constructor. We should just fix it in HttpClient 3.0 and completely remove all
> this horrible code in HttpClient 4.0
> Oleg
Do you mean the remove the deprecated constructors etc or the whole URI class
implementation ? I was using this constructor because I was not able to obtain
an uri whose isOpaquePart returned true using the URI(String, boolean)
constructor, for example from <ma...@pop.org> What I get is an absolute
uri with relative path [pop@pop.org] ?? I am asking because I am doing some
testing following RFC3986 and using httpclient.URI class and JDK1.4
java.net.URI.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 38385] - Nullpointer when creating URI from scheme specific part with null fragment
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38385>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38385
olegk@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |ASSIGNED
Target Milestone|--- |3.0.1
------- Additional Comments From olegk@apache.org 2006-01-26 00:50 -------
Odi,
It is quite obvious that null fragment parameter will cause an NPE in the
constructor. We should just fix it in HttpClient 3.0 and completely remove all
this horrible code in HttpClient 4.0
Oleg
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org