Repository navigation
Description
Summary
func_start's java rule (gitgalaxy/standards/language_standards.py) correctly matches a
bodyless abstract/interface method declaration (protected abstract long startTime();) via its
own lookahead, which explicitly allows either { or ; as the terminator. But detector.py's
generic Mode-B fallback (the else: branch used by every lang_id with no dedicated handling,
~detector.py:3551) only ever searches for the next { via safe_code.find(opener, start_idx, search_limit) and continues (silently discards the match) if none is found before the next
func_start match or the 2000-char window limit. Java was never added to the growing list of
languages that already got this exact fix for their own bodyless-declaration shape (csharp #789,
rust/zig/solidity #1319, go #1756, objective-c #1314/#1336, dart, perl #1609) — every one of those
languages' func_start regex, like java's, stops matching right at the parameter list's opening
( and defers the real/bodyless decision downstream, and every one of them needed dedicated
Mode-B handling for it. Java's own regex already validates the shape ((?:throws...)?[{;] in the
lookahead) but nothing downstream ever acts on the ; case.
Real-world impact
This isn't a narrow edge case — abstract methods and (implicitly abstract) interface method
declarations are one of the most common shapes in idiomatic Java (every interface method
signature with no default body, every abstract class's abstract methods). Every one of these is
currently silently dropped from GitGalaxy's function inventory for java.
Evidence
Confirmed via docs/self_scan/tri_comparison_ledger.json's
java/function/existence/agree[ctags,tree_sitter]_vs[gitgalaxy] shape (3 sampled occurrences, all
in springboot/SpringApplication.java's Startup abstract class):
abstract static class Startup {
protected abstract long startTime();
protected abstract @Nullable Long processUptime();
protected abstract String action();
...
}Standalone regex check confirms func_start matches all three lines fine in isolation
(startTime, processUptime, action all captured correctly) — the regex is not the bug.
Tracing detector.py's Mode-B body-slicing loop for protected abstract long startTime();: the
window is bounded by the next func_start match (processUptime's own signature, itself also
bodyless), so no { appears anywhere in the search window before the window closes, and the
match is discarded via the generic else: branch's continue.
Fix
Add a lang_id == "java" branch to detector.py's Mode-B terminator-search chain (same file,
~line 3525-3551, alongside rust/csharp/go/objc/dart/perl's own dedicated branches), scanning for
the first top-level { or ; after the parameter list closes (tracking <...> depth for
generic bounds in a throws clause, and [...] depth for legacy int foo()[]-style array
return-type suffixes) and treating a ; terminator as a real (bodyless) function, mirroring
rust's #1319 fix — not perl's #1609 (which deliberately discards bodyless forward declarations,
since those aren't real callable members the way a java abstract/interface method is).
Activity
fix(java): bodyless abstract-method drop + args annotation gap, tri-c…
squid-protocol commentedon Aug 22, 2026
Fixed via PR #2092.