Skip to content

java args regex: type-use annotation between modifier and return type not matched (sibling gap to #1486) #2091

Closed

Description

@squid-protocol

Summary

#1486/PR #1489 fixed this exact shape (a JSR-308 type-use annotation like @Nullable sitting
between a modifier and the return type, e.g. protected @Nullable Foo bar(...)) for java's
func_start rule, but the sibling args rule (LANGUAGE_DEFINITIONS["java"]["rules"]["args"],
Branch 1 "Standard Methods") shares the identical modifier-repetition-group shape and never got
the matching fix -- confirmed via direct regex inspection, not an audit-tool artifact.

Confirmed repro

language-crucible/data/java/springboot/Binder.java:384:

private <T> @Nullable T handleBindResult(ConfigurationPropertyName name, Bindable<T> target, BindHandler handler,
        Context context, @Nullable Object result, boolean create) throws Exception {

6 real parameters. func_start matches this signature fine (already fixed by #1486). args
Branch 1 cannot match it at all -- @Nullable breaks the return-type token match, so the branch
fails and the whole args-alternation falls through to Branch 3 (lambdas/method refs), incidentally
matching an unrelated lambda three lines into the function's own body
((dataObjectBinder) -> dataObjectBinder.create(...)) and misattributing its 1-param count as
this function's real parameter count.

Confirmed via docs/self_scan/tri_comparison_ledger.json's
java/function/args/agree[ctags,tree_sitter]_vs[gitgalaxy] shape (28 occurrences, all in
Binder.java/AutoConfigurationImportSelector.java).

Fix (applied)

Widened args Branch 1's modifier-repetition group to include the same
@[\w.]+(?:\([^)]*\))? annotation alternative func_start's equivalent group already has,
mirroring #1486/#1489's fix. Verified: all 28 ledger occurrences now measure the correct arg
count, matching ctags/tree-sitter; tri_comparison_gatherer.gather_language("java") shows zero
remaining args mismatches anywhere in the corpus.

Activity

  1. squid-protocol commented on Aug 22, 2026

    @squid-protocol
    OwnerAuthor

    Fixed via PR #2092.

  2. added
    bug
    core-engine
    threat: false-negative
    on Aug 26, 2026
  3. added this to the v2.4.9 milestone on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginethreat: false-negative

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions