/** * This will set the equinox classpath of <code>bundle</code> to reflect the eclipse classpath of * <code>plugin</code>. * * @param plugin The eclipse plugin which classpath is to be set for its corresponding equinox * bundle. * @param bundle The equinox bundle which classpath is to reflect an eclipse development plugin. */ @SuppressWarnings("restriction") /* * This methods sports a number of restricted class/method usage, yet there is no workaround and the * equinox team has no plan to open it. We're suppressing the warning until plans change. Details in bug * 271761. */ private void setBundleClasspath(IProject plugin, Bundle bundle) { final Set<String> classpathEntries = getOutputFolders(plugin); if (classpathEntries.size() > 0) { final org.eclipse.osgi.baseadaptor.BaseData bundleData = (org.eclipse.osgi.baseadaptor.BaseData) ((org.eclipse.osgi.framework.internal.core.AbstractBundle) bundle).getBundleData(); final StringBuilder classpath = new StringBuilder(); classpath.append(bundleData.getClassPathString()).append(','); final Iterator<String> entryIterator = classpathEntries.iterator(); while (entryIterator.hasNext()) { classpath.append(entryIterator.next()); if (entryIterator.hasNext()) { classpath.append(','); } } bundleData.setClassPathString(classpath.toString()); } }