diff options
author | Thomas Watson | 2021-02-02 16:38:07 +0000 |
---|---|---|
committer | Thomas Watson | 2021-02-02 16:38:07 +0000 |
commit | 9f0f5a10fc5b218ad1a9a5def97744d8ee75a7d1 (patch) | |
tree | 3ed7c7709d7b3db626c059faf8dbed009f6058d1 | |
parent | 111fc40f48c31ff5be08d21b9eb65214ff438c88 (diff) | |
download | rt.equinox.framework-9f0f5a10fc5b218ad1a9a5def97744d8ee75a7d1.tar.gz rt.equinox.framework-9f0f5a10fc5b218ad1a9a5def97744d8ee75a7d1.tar.xz rt.equinox.framework-9f0f5a10fc5b218ad1a9a5def97744d8ee75a7d1.zip |
Bug 570858 - filter framework module from system package calculation
Change-Id: Id9d6cf3aa536f884270705f683a1b163e22332b1
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java index 7a09eb350..153aa9daf 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java @@ -1903,6 +1903,8 @@ public class Storage { private String calculateVMPackages() { try { List<String> packages = new ArrayList<>(); + Method classGetModule = Class.class.getMethod("getModule"); //$NON-NLS-1$ + Object thisModule = classGetModule.invoke(getClass()); Class<?> moduleLayerClass = Class.forName("java.lang.ModuleLayer"); //$NON-NLS-1$ Method boot = moduleLayerClass.getMethod("boot"); //$NON-NLS-1$ Method modules = moduleLayerClass.getMethod("modules"); //$NON-NLS-1$ @@ -1919,6 +1921,12 @@ public class Storage { Object bootLayer = boot.invoke(null); Set<?> bootModules = (Set<?>) modules.invoke(bootLayer); for (Object m : bootModules) { + if (m.equals(thisModule)) { + // Do not calculate the exports from the framework module. + // This is to handle the case where the framework is on the module path + // to avoid double exports from the system.bundles + continue; + } Object descriptor = getDescriptor.invoke(m); if ((Boolean) isAutomatic.invoke(descriptor)) { /* |