GitNexus/gitnexus/test
henry201605 0936553d63
fix(ingestion/routes): recognise Spring method-level array-form route mappings (#2281)
* feat(routes): extract Spring method-level array-form routes in ingestion + extractor parity test (#2138 follow-up)

ingestion's `extractSpringRoutes` (route-extractors/spring.ts) matched only a
single string literal on `@(Get|...)Mapping`, so the array form
`@GetMapping({"/a","/b"})` produced no graph Route node — while the group-layer
`java.ts` scan did match it. That divergence was the root of the #2265 array-form
parse-skip gap.

- spring.ts: add the array-form alternation
  `[(string_literal) @value (element_value_array_initializer (string_literal) @value)]`
  to the two method-declaration query branches (positional + `path=`/`value=`),
  mirroring the group query. A multi-element array yields one match per element,
  so the Phase 2 loop emits one route per path with no other change. Class-level
  `@RequestMapping` array prefixes remain single-literal (rare; left to a
  follow-up).
- test: spring-route-parity runs one shared Java fixture through BOTH extractors
  (ingestion `extractSpringRoutes` + group `JAVA_HTTP_PLUGIN.scan`) and asserts
  identical provider {method,path} sets — the parity guard the maintainer asked
  for in #2078, so the two Spring extractors can't silently drift again
  (verified: reverting the array branch turns the parity test red).

* fix(ingestion/routes): suppress wrong unprefixed route under class-array @RequestMapping; cover named-array + class-array parity

Addresses PR review on #2281:
- P2 class-array wrong-route: class branches now match the array form only to detect it; a method-level array route under a class-level array-form @RequestMapping is suppressed rather than emitted with a dropped prefix, so ingestion stays a strict subset of the group scan. Scalar method paths under an array class prefix are unchanged (pre-existing). Full class-array cross-product support tracked in a follow-up.
- P2 named-array coverage: added value={...}/path={...} parity cases, a consumes/produces array false-positive case, and a dedicated empty-provider-set assertion.
- P3 stale comments: updated the routeCoverage comment in java.ts and the route-parse-skip test note; narrowed the parity test drift claim.

routeCoverage stays 'partial'.

---------

Co-authored-by: henry <zhangwei2017@unipus.cn>
Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
2026-06-24 07:10:37 +01:00
..
fixtures fix(lang-kotlin): support fun interface extraction via tree-sitter-kotlin re-vendor (#2271) 2026-06-23 10:01:28 +01:00
helpers feat(cfg): PDG/CFG visitors for all supported languages (#2195) (#2197) 2026-06-15 12:31:04 +01:00
integration fix(ingestion/routes): recognise Spring method-level array-form route mappings (#2281) 2026-06-24 07:10:37 +01:00
unit fix(ingestion/routes): recognise Spring method-level array-form route mappings (#2281) 2026-06-24 07:10:37 +01:00
utils perf(hooks): cmdline-first Linux db-lock scan, drop the lsof fallback (#2180) (#2183) 2026-06-13 11:52:14 +01:00