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

o:importFunctions' failure to find a function could be more explicit #164

Closed
VsevolodGolovanov opened this Issue Sep 15, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@VsevolodGolovanov

VsevolodGolovanov commented Sep 15, 2015

OmniFaces 2.1.

Say, we're importing a correct existing class, but it has no specified function.

<o:importFunctions type="org.company.AnExistingClass" />
#{AnExistingClass.nonExistentFunction()}

This results in a not very telling exception:

Caused by: java.lang.NullPointerException
    at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1124) [rt.jar:1.7.0_80]
    at org.omnifaces.taghandler.ImportFunctions$1.resolveFunction(ImportFunctions.java:139) [omnifaces-2.1.jar:2.1]
    at com.sun.el.lang.FunctionMapperFactory.resolveFunction(FunctionMapperFactory.java:71) [javax.el-3.0.1-b05.jar:]
    at com.sun.el.lang.ExpressionBuilder.visit(ExpressionBuilder.java:272) [javax.el-3.0.1-b05.jar:]
    at com.sun.el.parser.SimpleNode.accept(SimpleNode.java:172) [javax.el-3.0.1-b05.jar:]

ImportFunctions$1.resolveFunction could've thrown a RuntimeException with a message like "The class AnExistingClass doesn't have the nonExistentFunction static method".

@BalusC BalusC closed this in 99900c8 Sep 15, 2015

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 15, 2015

Member

This was an oversight, those checks on user errors are usually over all place in OmniFaces. Thank you for reporting and making OmniFaces better!

Fix is available in today's latest 2.2 snapshot.

Member

BalusC commented Sep 15, 2015

This was an oversight, those checks on user errors are usually over all place in OmniFaces. Thank you for reporting and making OmniFaces better!

Fix is available in today's latest 2.2 snapshot.

@BalusC BalusC added the enhancement label Oct 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment