Community
Participate
Working Groups
Created attachment 287716 [details] Screenshot If you include a bundle into your runtime Eclipse which contains a platform filter not matching your platform you get an NPE in your runtime Eclipse. I have not seen this NPE in earlier releases. To test: 1.) Create plug-in with a platform filter not matching your platform and start ar runtime Eclipse into an empty workspace (see screenshot) 2.) Create a new plug-in in your runtime Eclipse !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at java.base/java.util.Arrays.stream(Arrays.java:5645) at org.eclipse.pde.internal.core.TargetWeaver.findRunningPlatformBundle(TargetWeaver.java:213) at org.eclipse.pde.internal.core.TargetWeaver.isBundleOfRunningPlatform(TargetWeaver.java:195) at org.eclipse.pde.internal.core.TargetWeaver.getDevProperty(TargetWeaver.java:191) at org.eclipse.pde.internal.core.TargetWeaver.weaveManifest(TargetWeaver.java:114) at org.eclipse.pde.internal.core.MinimalState.addBundle(MinimalState.java:201) at org.eclipse.pde.internal.core.MinimalState.addBundle(MinimalState.java:195) at org.eclipse.pde.internal.core.PDEState.createNewTargetState(PDEState.java:166) at org.eclipse.pde.internal.core.PDEState.<init>(PDEState.java:61) at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:602) at org.eclipse.pde.internal.core.PluginModelManager.targetReloaded(PluginModelManager.java:522) at org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard.lambda$0(NewPluginProjectWizard.java:117) at org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard$$Lambda$899/0x0000000000000000.run(Unknown Source) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Hannes and Christoph, did we change something in this area? I don't think we had this NPE earlier and IIRC you were the only people changing target platform handling in this release.
Hannes has added this code and I think a simple null check is required here as the method clearly states that null is a valid return value.
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/189056
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/189057
(In reply to Lars Vogel from comment #1) > Hannes and Christoph, did we change something in this area? I don't think we > had this NPE earlier and IIRC you were the only people changing target > platform handling in this release. Yes that right, I changed TargetWeaver. From your stacktrace I assume the problem is that in TargetWeaver.findRunningPlatformBundle() the call Platform.getBundles(symbolicName, null) returns null in your case but Arrays.stream() does not permit null arguments. A simple null check probably does the job, I have forgot that. Looks like you were to fast for me and found the answer already while I was typing my comment.
Thanks, Christoph and Hannes.
Gerrit change https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/189056 was merged to [master]. Commit: http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=d044176ed3d959a16a0dd7d71d0e2962521e5992