Commit Graph

16 Commits

Author SHA1 Message Date
Guimu
cf628769d6 fix: preserve commas inside regex grouping when splitting filter patterns (#5588)
AviaterRegexFilter#init splits the configured pattern on every comma to
separate multiple regular expressions. That blindly breaks regex
quantifiers such as \d{1,2} or non-capturing alternations like
(a,b|c) because the comma inside the grouping construct is treated as
a top-level separator.

Replace the StringUtils.split call with a parse-aware splitter that
tracks the depth of {}, [], () and respects backslash escapes, so only
top-level commas separate patterns. Apply the change to both copies of
AviaterRegexFilter (filter module and connector/core module).

Add AviaterFilterTest#test_regex_with_quantifier_comma covering: a
single-pattern \d{1,2} quantifier, a multi-pattern list combined with
\d{1,2}, and an open-ended {n,} quantifier.

Fixes #5442
2026-05-29 10:39:04 +08:00
HumanPassenger
10ff148aba 局部变量线程安全,优先使用StringBuilder替换StringBuffer (#4472)
Co-authored-by: 夏亮 <xialiang@newerabc.com>
2022-11-16 09:55:18 +08:00
zavakid
9a332940d7 = remove unused import 2020-09-23 11:34:45 +08:00
zavakid
df24596092 = code cleanup
- for loop replaceable with enhanced 'for' loop
  - using diamond in generic type
  - collapse try catch exception
  - using try-with-resource
  - using  List#sort instead of Collections#sort
  - replaced lambda with method reference
  - using native compare method to compare numbers
  - using switch instead of if for in ESSyncUtil
2020-09-17 23:22:25 +08:00
zavakid
43c23ffb97 = remove unused improt 2020-09-17 22:40:06 +08:00
zavakid
e7658879bc = cold cleanup
* using lambda if possible (we are already building in Java8)
  * using diamond when new generic instance
  * remove used improt
2020-09-17 17:46:20 +08:00
agapple
5e761e14fa format 2020-02-28 13:15:27 +08:00
agapple
18418ebd98 merge pull/2120 2020-02-28 12:29:41 +08:00
agapple
072420c32b fixed 2019-02-25 15:18:04 +08:00
agapple
277a273ebc fixed pull #1266 , optimizer code 2018-12-11 13:40:32 +08:00
agapple
c045dc244e optimizer filter 2018-12-06 10:50:12 +08:00
agapple
ff97dcbbc9 format & import 2017-01-19 13:07:53 +08:00
agapple
c935f06344 remove compiler warning 2015-04-30 11:20:25 +08:00
agapple
7ebb3fd1ab fixed code template and format 2015-04-28 21:11:41 +08:00
wener
6a0733bbab update guava to 18.0, magriate compute map by package level implement 2015-04-23 22:15:57 +08:00
agapple
a0defe575b init 2014-09-23 15:11:35 +08:00