Eclipse 2021-03RC1 Question/Problem [message #1838925] |
Tue, 09 March 2021 11:54  |
Eclipse User |
|
|
|
I have a internationalized Eclipse RCP app that I tried upgrading to Eclipse 2021-03RC1 target. On the upgrading, it no longer launches and produces this partial stack trace:
Caused by: java.lang.NullPointerException
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at org.eclipse.osgi.internal.loader.buddy.GlobalPolicy.loadResource(GlobalPolicy.java:66)
at org.eclipse.osgi.internal.loader.buddy.PolicyHandler.doBuddyResourceLoading(PolicyHandler.java:171)
at org.eclipse.osgi.internal.loader.BundleLoader.findResource(BundleLoader.java:685)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.getResource(ModuleClassLoader.java:216)
at java.base/java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1736)
at org.eclipse.osgi.util.NLS.load(NLS.java:332)
at org.eclipse.osgi.util.NLS.initializeMessages(NLS.java:152)
at XXX.Messages.<clinit>(Messages.java:1538)
The plugin it failed to load has a global BuddyPolicy:
Eclipse-BuddyPolicy: global
The issues seems to occur when it is trying to load variants of the various translation files (for example en_US), which don't exist (we only have en).
I think I tracked down the issue to this function in the GlobalPolicy class:
@Override
public URL loadResource(String name) {
return getExportingBundles(BundleLoader.getResourcePackageName(name)) //
.stream().findFirst().map(b -> {
return b.getResource(name);
}).orElseGet(null);
}
This:
getExportingBundles(BundleLoader.getResourcePackageName(name)).stream().findFirst()
returns an optional that has no value. I think when it tries to execute "map" it is failing.
This was on RC1, so it might be something that's already been fixed or perhaps I need to change something on my side. Any thoughts would be appreciated.
Thanks,
Emily
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04834 seconds