-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#5383 cleanup facelets encoding management #5385
#5383 cleanup facelets encoding management #5385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
if (encoding == null) { | ||
// 5. If still none found then fall back to specified default. | ||
encoding = defaultEncoding.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is calling Optional.get()
without checking emptiness, and the line 1629 is actually passing an empty Optional, resulting in NoSuchElementException: No value present
.
Causing failures in Jakarta TCK:
Caused by: java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:143)
at jakarta.faces.impl@4.0.6.redhat-00001//com.sun.faces.util.Util.getResponseEncoding(Util.java:1680)
at jakarta.faces.impl@4.0.6.redhat-00001//com.sun.faces.util.Util.getResponseEncoding(Util.java:1629)
at jakarta.faces.impl@4.0.6.redhat-00001//com.sun.faces.application.view.MultiViewHandler.getRedirectURL(MultiViewHandler.java:350)
at jakarta.faces.impl@4.0.6.redhat-00001//jakarta.faces.application.ViewHandlerWrapper.getRedirectURL(ViewHandlerWrapper.java:278)
at org.jboss.as.jsf-injection//org.jboss.weld.module.jsf.ConversationAwareViewHandler.getRedirectURL(ConversationAwareViewHandler.java:149)
at jakarta.faces.impl@4.0.6.redhat-00001//jakarta.faces.application.NavigationCase.getRedirectURL(NavigationCase.java:171)
at com.sun.ts//com.sun.ts.tests.jsf.api.jakarta_faces.application.navigationcase.TestServlet.navigationCaseGetRedirectURLTest(TestServlet.java:119)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.sun.ts//com.sun.ts.tests.jsf.common.servlets.HttpTCKServlet.invokeTest(HttpTCKServlet.java:163)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #5429
#5383
Review/cleanup/refactor all code logic related to managing facelets/request/response encoding and centralized in a new
Util#getResponseEncoding()
method.Also took the opportunity to get rid of all hardcoded strings representing
"UTF-8"
throughout the source code and replace them byStandardCharsets.UTF_8
(.name()
)