Repository navigation
fix: parse Character exception items as boxed character values - #3658
Open
hutiefang76 wants to merge 1 commit into
Open
hutiefang76 wants to merge 1 commit into
hutiefang76 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 testSpecial notes for reviews
AI assistance: implementation and initial review used DeepSeek; Codex coordinated final review and verification.