You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes null elements to be included in the stream, which causes the following findFirst to fail with an NPE. Instead of .map(l -> l.findModule(n).orElse(null)) it should probably be something like flatMap(l -> l.findModule(n).stream()). Or if you're targeting earlier versions of Java where that's not in the API, a more awkward map(l -> l.findModule(n)).filter(Optional::isPresent).map(Optional::get).
If the result is is null this indicates an error anyway ... but the NPE prevents the proper exception from being thrown a few lines later with all the relevant information, so it obscures the cause of the problem.
The same mistake appears on lines 91 and 158.
The text was updated successfully, but these errors were encountered:
efxclipse-rt/modules/core/org.eclipse.fx.osgi/src/main/java/org/eclipse/fx/osgi/fxloader/jpms/JavaModuleLayerModification.java
Line 125 in cfdb23a
This causes null elements to be included in the stream, which causes the following
findFirst
to fail with an NPE. Instead of.map(l -> l.findModule(n).orElse(null))
it should probably be something likeflatMap(l -> l.findModule(n).stream())
. Or if you're targeting earlier versions of Java where that's not in the API, a more awkwardmap(l -> l.findModule(n)).filter(Optional::isPresent).map(Optional::get)
.If the result is is null this indicates an error anyway ... but the NPE prevents the proper exception from being thrown a few lines later with all the relevant information, so it obscures the cause of the problem.
The same mistake appears on lines 91 and 158.
The text was updated successfully, but these errors were encountered: