fix: make analytic expression visitor null-safe#1944
Conversation
9dd206c to
caf17a2
Compare
|
Can we please conclude on this? I don't like stale PRs. |
|
Sorry @manticore-projects - what is this PR missing? |
As explained before: _Apologies for being difficult: Without the original expression, I have actually no idea what those code lines want or achieve (simply because I never understood or liked the streaming/functional API). Since I can't stop you from using it (its valid after all), please keep at least the original code lines as comments so we have a clue what this is supposed to mean and to check. Question: the Null test is done rather beautifully in Groovy and much easier to read. |
|
Ah, I don't see that earlier comment for some reason.
I mean, you definitely can. It's not in keeping with the style in the rest of the project so I'm more than happy to change it to a more conventional null check, and add some commentary. |
|
Stopping you is not in my interest and your code is correct and good. Thanks a lot! |
ba41730 to
8e46e7a
Compare
|
Run './gradlew :spotlessApply' to fix these violations. |
src/main/java/net/sf/jsqlparser/expression/ExpressionVisitorAdapter.java
Show resolved
Hide resolved
8e46e7a to
f23f59c
Compare
|
(fixed spotless, sorry about that) |
|
Thank you for your contribution and effort! |
This PR adds some null safety via
Optionals to theExpressionVisitorAdapterwhen handling certain analytic expressions.The added test expression previously parsed fine but resulted in a
NullPointerExceptionwhen visited.