Check JPath queries for '' instead of " #764
Replies: 2 comments 1 reply
-
@TysvdHeuvel , thank you for the idea! I've created a new rule: LC0080 - Replace double quotes in JPath expressions with two single quotes. which is now available in the v0.31.4 (pre)release version of the LinterCop. The rule is currently straight forward; If there's a double quote in the Path, throw an Warning. For now I've bound the rule exclusivity on If there are exceptions need on this, please let me know. P.S. Do you by any chance now of this is also relevant on |
Beta Was this translation helpful? Give feedback.
-
I've never seen that issue with XML and XPath, so I don't think the rule should include those. |
Beta Was this translation helpful? Give feedback.
-
We tend to use JPath a lot. So, a line of code like this is very common:
But JPath expressions can become quite complex, so therefore you need to test them. And this is where the problem starts. Most of these easy to use online JPath builders/validators all use " (double quotes) to wrap strings. But BC somehow can't handle that. The expression then simply has no result. So you always have to remember not to copy/paste the expression, but also to replace all double quotes with 2 single quotes.
Having a rule that flags this, would have saved me a ton of hours.
Beta Was this translation helpful? Give feedback.
All reactions