API problems in org.apache.camel.util.OgnlHelper
------------------------------------------------
Key: CAMEL-4821
URL: https://issues.apache.org/jira/browse/CAMEL-4821
Project: Camel
Issue Type: Bug
Reporter: Glen Mazza
Priority: Minor
Hi, the OgnlHelper class:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/OgnlHelper.java?annotate=1145881
appears to have a couple of issues with it:
1.) There's a nonsensically named "isInvalidValidOgnlExpression(String
expression)" method at line #59, I'm not sure why it's needed because there is
an isValidOgnlExpression() just above it, the negative of which can be used to
accomplish to goal of isInvalidValidOgnlExpression. If desired to retain this
method, best to leave a comment why it's not named isInvalidOgnlExpression and
why the negative of isValidOgnlExpression() is insufficient. Otherwise, this
method should be deprecated, either with a new isInvalidOgnlExpression in its
place that does the same thing or with no replacement (i.e., users should just
use !isValidOgnlExpression().
2.) The method "isNullSafeOperator()" at line #89 says it checks whether the
"Elvis" operator is being used -- but the code is just checking for a "?"
According to here: https://docs.google.com/Doc?docid=ddb3zt39_78frdf87dc&hl=en
the Elvis operator is the binary "?:" token (not the ternary a = (b > c) ? d :
e one). Perhaps a change is needed to the logic to check for "?:" or an update
to the JavaDoc for this method that it's not the Elvis operator being checked
for.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira