Repository navigation
Description
Summary
func_recall for java is 87.6% (233/266 found), with 0 extra_functions -- GitGalaxy isn't
over-matching, it's under-matching. Root-caused to a single recurring shape.
LANGUAGE_DEFINITIONS["java"]["rules"]["func_start"] in
gitgalaxy/standards/language_standards.py only allows annotations in the leading position,
before any modifiers:
^[ \t]*(?:@[\w.]+(?:\([^)]*\))?[ \t\n]*){0,10}(?!...)(?:(?:public|protected|private|static|final|abstract|synchronized|native|default|<...>)[ \t\n]+){0,5}(?:(?:[a-zA-Z_$][\w<>$\[\]?.,]*[ \t\n]+){1,5}...)
Real Java (JSR-308 type-use annotations, e.g. @Nullable/@NonNull) commonly places the
annotation between a modifier and the return type instead:
protected @Nullable AnnotationAttributes getAttributes(AnnotationMetadata metadata) {The regex has no alternative for this position, so the whole declaration goes unmatched.
Confirmed repro
language-crucible/data/java/springboot/AutoConfigurationImportSelector.java:176:
protected @Nullable AnnotationAttributes getAttributes(AnnotationMetadata metadata) { --
confirmed absent from GitGalaxy's own function_data for this file. This shape
(^\s*(public|protected|private|static|final)\s+@[A-Za-z]) occurs 47 times across the 7-file
java crucible corpus (grep count per file: OnClassCondition.java 7, ServletWebServerApplicationContext.java
5, AutoConfigurationImportSelector.java 3, SpringApplication.java 20, Binder.java 5,
WebMvcAutoConfiguration.java 7) -- almost certainly the dominant cause of the 33 missing
functions (266 real - 233 found).
Suggested fix shape
Allow an annotation to appear between/after modifiers too, not just in the single leading
position -- e.g. change the modifier-repetition group to alternate between a modifier keyword and
an annotation on each iteration ((?:(?:public|protected|...)|@[\w.]+(?:\([^)]*\))?)[ \t\n]+){0,5}
shape, or add a second optional annotation-group between the modifier group and the return-type
group). Keep the existing ReDoS-safety bounds ({0,5}/{0,10} caps) intact -- this is purely about
where annotations are allowed to appear, not removing any existing bound.
Scope note
This affects GitGalaxy's actual func_start extraction (epic #813's extraction-hardening scope),
not just measurement -- confirmed via direct regex/corpus inspection, not an audit-tool artifact.
Activity
chore: regenerate golden masters after merging origin/main (java #1486 …
fix(dart): 4 func_start false-positive shapes (const ctors, bodyless …
fix(java): bodyless abstract-method drop + args annotation gap, tri-c…