Commit 5a05075
* fix: JSONPath syntax error when 'in' filter follows other filters (#3997)
The IN/NOT_IN, RLIKE, and CONTAINS cases in parseFilter() unconditionally
consumed a closing ')' even when called from parseFilterRest() where
parentheses=false, stealing the outer filter's closing paren. Guard
closing paren consumption with 'if (parentheses)' to match the BETWEEN
case and the default path at the end of parseFilter().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use 'parentheses || filterNests > 0' instead of just 'parentheses'
The previous fix used only 'if (parentheses)' to guard closing paren
consumption in RLIKE/IN/CONTAINS cases, but this broke expressions
using filterNests-tracked grouping parens like:
$[?( (@.name =~ /aa/ && (@.city=='aa')) && @.age==18 )]
The correct condition is 'parentheses || filterNests > 0' which
handles both parentheses-tracked and filterNests-tracked contexts.
Fixes regression in Issue1516.testFastjson2JSONPathCompile.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: add @tag("regression") and rlike chaining tests
Address review feedback:
- Add @tag("regression") to match other tests in issues_3900
- Add tests for rlike after equality with && and ||
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 14ea6ea commit 5a05075
2 files changed
Lines changed: 113 additions & 6 deletions
File tree
- core/src
- main/java/com/alibaba/fastjson2
- test/java/com/alibaba/fastjson2/issues_3900
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
819 | | - | |
820 | | - | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
821 | 823 | | |
822 | 824 | | |
823 | 825 | | |
| |||
863 | 865 | | |
864 | 866 | | |
865 | 867 | | |
866 | | - | |
867 | | - | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
868 | 872 | | |
869 | 873 | | |
870 | 874 | | |
| |||
915 | 919 | | |
916 | 920 | | |
917 | 921 | | |
918 | | - | |
919 | | - | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
920 | 930 | | |
921 | 931 | | |
922 | 932 | | |
| |||
Lines changed: 97 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
0 commit comments