Draft
Java: replace the dead String.valueOf(CharSequence) summary with a synthetic callable#22315
String.valueOf(CharSequence) summary with a synthetic callable#22315Conversation
…a synthetic callable for valueOf(Object) on CharSequence arguments Co-authored-by: hvitved <3667920+hvitved@users.noreply.github.com>
Co-authored-by: hvitved <3667920+hvitved@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix valueOf method call site issue for string arguments
Java: replace the dead Aug 11, 2026
String.valueOf(CharSequence) summary with a synthetic callable
hvitved
requested changes
Aug 11, 2026
hvitved
left a comment
Contributor
There was a problem hiding this comment.
Fix the test failure reported by CI.
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.
java.lang.Stringhas novalueOf(CharSequence)overload — string- andCharSequence-typed arguments compile tovalueOf(Object), which is modelled as neutral. The summary row therefore matched no call site, leaving no propagatingvalueOfmodel for string-typed arguments:Changes
java/ql/lib/ext/java.lang.model.yml: removed the["java.lang", "String", False, "valueOf", "(CharSequence)", ...]row, which matched nothing.java/ql/lib/semmle/code/java/frameworks/Strings.qll(new): aSyntheticCallablethat propagates taintArgument[0]→ReturnValueforString.valueOf(Object)calls whose argument's static type is aCharSequence(String,CharSequence,StringBuilder, …), where the call is equivalent to the documentedCharSequence.toString(). Registered in theSyntheticCallablesmodule inFlowSummary.qll.valueOf(Object)neutral model is kept, so arguments of arbitrary types — whosetoString()may not expose tainted state — remain unaffected.java/ql/test/library-tests/dataflow/string-valueofcoversString,CharSequence,StringBuilder,char[]andchararguments (flow expected) and anObject-typed argument (no flow expected). Change note added.