Regression in URI parsing? [message #1020763] |
Mon, 18 March 2013 22:03 |
|
Hi,
I have pulled EMF commit 14739192c0f373916dfc565d78f4c1011e34b85e in
preparation for the Papyrus M6 build.
I get test failures in some tests that try to get EObjects from
resource sets with URIs constructed like this:
URI.createPlatformResourceURI(RESOURCE_URI +
"MyProfile.uml#_XkGiwB07Ed-QQ4mYkrb7Gg", false)
Should constructing platform:/resource URIs including fragments in this
way ever have worked? Because it doesn't now. The result is a URI
like this:
platform:/resource/org.eclipse.papyrus.core.resourceloading.tests/resources/TestModel1/MyProfile.uml%23_XkGiwB07Ed-QQ4mYkrb7Gg
Notice the encoding of the hash mark as %23.
Thanks,
Christian
|
|
|
|
|
Re: Regression in URI parsing? [message #1020856 is a reply to message #1020784] |
Tue, 19 March 2013 03:39 |
|
In fact, it was easy to work around in my case simply by changing the test code to parse the resource URI and then ask the URI to append a fragment ... several times in a few different test classes.
This is not bug 403547. The fragments are UUIDs, not paths. There are no GenModels.
I think it is a valid request of the URI class to parse a string that includes a fragment. Such a string is a URI. I would expect other code already in production to break when upgrading EMF. Accordingly, I have raised bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=403708 .
|
|
|
Re: Regression in URI parsing? [message #1020900 is a reply to message #1020856] |
Tue, 19 March 2013 06:25 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Christian,
As I commented in the bug, I think the whole this is questionable at
best. Firstly, unless the entire string is hard coded, it's
questionable to call
URI.createPlatformResourceURI(<workspace-relative-path>, false) because
you can't know if the path contains characters that need to be encoded.
It's also questionable whether fragments and queries are part of the
concept of a workspace relative path in the first place. If the problem
is indeed restricted to "questionably written" test cases, I think it's
better to change them in favor of an API that behaves consistently with
its description and consistently with respect to encode being true or
false...
On 19/03/2013 4:39 AM, Christian W. Damus wrote:
> In fact, it was easy to work around in my case simply by changing the
> test code to parse the resource URI and then ask the URI to append a
> fragment ... several times in a few different test classes.
>
> This is not bug 403547. The fragments are UUIDs, not paths. There are
> no GenModels.
>
> I think it is a valid request of the URI class to parse a string that
> includes a fragment. Such a string is a URI. I would expect other
> code already in production to break when upgrading EMF. Accordingly, I
> have raised bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=403708 .
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03607 seconds