Skip to content

Commit e288edd

Browse files
merksHannesWell
authored andcommitted
[REMOVE] Hack unique bundle IDs when creating new state for bundle
validation
1 parent 89f7a3d commit e288edd

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/BundleValidationOperation.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
*******************************************************************************/
1414
package org.eclipse.pde.internal.core;
1515

16+
import java.lang.reflect.InvocationTargetException;
17+
import java.lang.reflect.Method;
1618
import java.util.Dictionary;
1719
import java.util.HashSet;
1820
import java.util.LinkedHashMap;
@@ -57,10 +59,20 @@ public void run(IProgressMonitor monitor) throws CoreException {
5759
}
5860
SubMonitor subMonitor = SubMonitor.convert(monitor, fModels.size() + 1);
5961
fState = FACTORY.createState(true);
62+
int id = 0;
6063
for (IPluginModelBase fModel : fModels) {
6164
BundleDescription bundle = fModel.getBundleDescription();
6265
if (bundle != null) {
63-
fState.addBundle(FACTORY.createBundleDescription(bundle));
66+
BundleDescription bundleDescription = FACTORY.createBundleDescription(bundle);
67+
try {
68+
Method declaredMethod = bundleDescription.getClass().getDeclaredMethod("setBundleId", long.class); //$NON-NLS-1$
69+
declaredMethod.setAccessible(true);
70+
declaredMethod.invoke(bundleDescription, id++);
71+
} catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
72+
| InvocationTargetException e) {
73+
e.printStackTrace();
74+
}
75+
fState.addBundle(bundleDescription);
6476
}
6577
subMonitor.split(1);
6678
}

0 commit comments

Comments
 (0)