Community
Participate
Working Groups
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13 Build Identifier: M20090211-1700 This is related to the fix for Bug 256332 . At this time, org.eclipse.equinox/p2/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java #createBundleLocation(URI, boolean) encodes a ',' in a location as '%2C' and org.eclipse.equinox/p2/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java #parseLocation(String) decodes it. Unfortunately, it is quite allowed on Linux to name a file '%2C' or simply have '%2C' in it at an arbitrary location. As a result, it is not enough to simply escape ',' as '%2C'. The only clean thing to do is to properly escape '%' in the location as '%25'. Otherwise bundles with '%2C' in the URI will have ',' incorrectly substituted when deserialized. It seems that the easiest fix for this would simply be to encode the '%' to '%25' first, then encode ',' to '%2C'. Decoding would then do the opposite, decode '%2C' to ',' first, then decode '%25' to '%'. Of course, other methods are possible. Reproducible: Always Steps to Reproduce: 1. Create a plugin jar with '%2C' in the filename (or otherwise put the plugin in a path with '%2C' in it). 2. Get the plugin into the bundles.info file somehow (dropins, p2, link). 3. Profit!!! 4. Bad things(TM) willl happen because the '%2C' got turned into ',' so the wrong file will be set for the bundle.
See also bug #289644.
Seems like it is a bug of org.eclipse.osgi.internal.baseadaptor.BundleInstall. The code from line 73: File inFile = new File(source.getURL().getPath()); if (inFile.isDirectory()) AdaptorUtil.copyDir(inFile, outFile); else AdaptorUtil.readFile(in, outFile); source.getURL() contains URL encoded file name. The file name should be decoded back before creating of java.io.File instance. BR, Vyacheslav
I'm not seeing problems here, on linux I dropped in a bundle named "aniefer,junit%25Cheadless_1.0.0.200911060948.jar". This was correctly installed into the bundle.info as "dropins/aniefer%2Cjunit%252Cheadless_1.0.0.200911060948.jar" The bundle is resolved and working in the running eclipse. The unit test I wrote for SimpleConfiguratorManipulator saveConfiguration & loadConfiguration is properly handling "plu%2cins" and "plu,ins".
Hi Andrew This is not a problem of loading bundle from jar file. This is a problem of loading bundle from the folder. I understand that in OSGI specification the bundle should be a jar file, but Equinox framework supports the loading bundle from the folder as additional feature. I think it should work fine. Ok, i going to prepare the unit test for demonstrate the bug, and will sent it today. Thank You, Vyacheslav
Created attachment 164381 [details] The unit test for catch the bug with space in budne path The unit test is attached. Once i also not get the problem with ',' symbol in the path, but i've the problem with ' ' space symbol in path. BR, Vyacheslav
SimpleConfigurator works fine for me here, sending over to the framework for comment on installing bundles with an encoded location. Note that the simple configurator unencodes the location before calling install.
Please try on the latest build. bug290193 was fixed in 3.6 M3. *** This bug has been marked as a duplicate of bug 290193 ***