jakartaee / faces

Jakarta Faces
Other
109 stars 55 forks source link

Create a session to avoid NPE reported in PR 1738 #1769

Closed volosied closed 1 year ago

volosied commented 1 year ago

NPE introduced in 1738. See discussion here: https://github.com/jakartaee/faces/pull/1738#issuecomment-1334688764

Open Liberty encounters an NPE as no session exists in this test yet. The session implicit object therefore returns null.

Caused by: java.lang.NullPointerException: 
at com.sun.ts.tests.jsf.spec.el.elresolvers.TestServlet.validateImplicitObjectValue(TestServlet.java:1566)
at com.sun.ts.tests.jsf.spec.el.elresolvers.TestServlet.facesImplicitObjectResolverGetValueTest(TestServlet.java:615)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Or should the session only be created for the session implicit part of test, and then deleted afterwards? Previously, the session was created within the getELContexts method ( by the JspFactory.getDefaultFactory().getPageContext() call)

volosied commented 1 year ago

@arjantijms @BalusC Any objections to this change? Could it be reviewed/merged?

pnicolucci commented 1 year ago

This looks reasonable to me! If no objections I can merge it in.