| Summary: | CVSURI can't parse a supported format | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Matthew Piggott <matthew> | ||||||||||||
| Component: | CVS | Assignee: | platform-cvs-inbox <platform-cvs-inbox> | ||||||||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | pascal | ||||||||||||
| Version: | 3.6 | ||||||||||||||
| Target Milestone: | --- | ||||||||||||||
| Hardware: | All | ||||||||||||||
| OS: | All | ||||||||||||||
| Whiteboard: | stalebug | ||||||||||||||
| Attachments: |
|
||||||||||||||
Matthew could you provide a failing unit test for a CVSURI that cannot be parsed? This should be straightforward, just take a look at /org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/CVSURITest.java. Created attachment 172522 [details]
JUnit test v01
After having a quick look at the CVSURI code, my first impression was that the case you're referring to is the one where password contains '/' character. When running the tests it does fail, but unfortunately your patch doesn't fix it.
Feel free to modify this patch to fit your case.
Created attachment 172523 [details]
mylyn/context/zip
Created attachment 172619 [details]
Test case
Here is a test case for the problem; in your test you're using the URI of the other format type. If you open the CVS perspective or repository view, right click on any of the connections then Copy to Clipboard. If you prefix it with cvs:// that is the base URI its just missing a path.
Another note, if the URI doesn't have a fragment (used for the path) the method will also throw a NullPointerException. The javadoc doesn't describe the fragment as optional, but perhaps it should default to the root path?
Created attachment 172627 [details]
Test case v03
Well, if the javadoc doesn't say the fragment is optional, getting a NPE when it's not provided is kinda expected, isn't?
I updated your test case (thanks btw). If you're fine with the changes I will commit both test and the fix you suggested.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Created attachment 172429 [details] Removes // from scheme specific part of URI In the documentation for CVSURI.fromURI the format: * cvs://[:]method:user[:password]@host:[port]/root/path#project/path[,tagName] is described, however if the method is called with a URI of this format a NullPointerException is thrown. Through debugging I found the exception occurs because the // is not removed from the scheme specific part and an attempt is made to find a handler for // rather than pserver, extssh, etc. which occur afterwards. I've attached a patch which removes the // from the scheme specific which fixes the problem.