Skip to content

fix: parse Character exception items as boxed character values - #3658

Open
hutiefang76 wants to merge 1 commit into
alibaba:1.8from
hutiefang76:frank/sentinel-char-20261007-01a11186
Open

hutiefang76 wants to merge 1 commit into
alibaba:1.8from
hutiefang76:frank/sentinel-char-20261007-01a11186

Conversation

@hutiefang76

@hutiefang76 hutiefang76 commented Oct 7, 2026 •

Copy link
Copy Markdown

Describe what this PR does / why we need it

ParamFlowItem.newItem boxes a char and records java.lang.Character, but ParamFlowRuleUtil only recognizes the primitive char class name. The parsed exception item gets a String key and does not match a runtime Character argument.

Does this pull request fix one issue?

Fixes #3656.

Describe how you did it

Recognize Character.class.getName() alongside primitive char, matching the existing primitive/wrapper pairs. Add real newItem parsing and thread-checker threshold regressions.

Describe how to verify it

JDK 17: ParamFlowRuleUtilTest and ParamFlowCheckerTest passed 11 tests independently on this PR branch. Against the old parser, the Character-key assertion fails and the checker cannot find the item threshold. Java 8 execution was blocked by the existing compiler/toolchain bytecode mismatch; no Java 8 pass is claimed.

mvn -q -pl sentinel-extension/sentinel-parameter-flow-control -am -Dtest=ParamFlowRuleUtilTest,ParamFlowCheckerTest -Dsurefire.failIfNoSpecifiedTests=false test

Special notes for reviews

AI assistance: implementation and initial review used DeepSeek; Codex coordinated final review and verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ParamFlowItem.newItem(char, count) produces a Character item parsed as String

1 participant