As far as I know, the getPath method is also getting issues when encountering “special” path structures (such as paths where whitespaces are deplaced
by %20). These should get transformed the right way by using the toUri method.
So for fail-safe stability, I’d add both methods to a try catch block, so for example:
File dir;
try {
dir = new File(FileLocator.resolve(colorModesURL).toURI());
} catch(URISyntaxException e) {
dir = new File(FileLocator.resolve(colorModesURL).getPath());
}
Sorry I don’t have this as a patch ready.
Greetings,
Markus
Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx]
Im Auftrag von Christian Krause
Gesendet: Samstag, 5. Juli 2014 14:07
An: Henshin developers mailing list
Betreff: Re: [henshin-dev] Missing Color Modes
Hi Manuel,
thanks for the patch. It works for me. I have merged it already. Anyway, you won't see it in the SVN repo because we are in the middle of our migration to Git.
Christian
2014-07-04 17:40 GMT+02:00 Manuel Hegner (HPI) <manuel.hegner@xxxxxxxxxxxxxxxxxxxxxxxxxx>:
Hey,
another problem I encountered was that my graphical henshin editor didn't use colors. This was due to a bug in org.eclipse.emf.henshin.provider.util.HenshinColorMode. There you call the method
URL::toUri() which sometimes produces illegal URIs and should not be used. In my case the installation path of my eclipse contained characters that were not encoded correctly. Because the File constructor that recieves the created
URI only allows file URIs anyways it would be better to call
URL::getPath(). This solves the problem for me and should not introduce other problems as far as I know. A patch doing this is attached.
Best regards,
Manuel Hegner
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev