module
Analyzer::Java::JavaEngine
Defined in:
analyzer/engines/java_engine.crClass Method Summary
-
.find_matching_delimiter(code : String, open_idx : Int32, open_char : Char, close_char : Char) : Int32 | Nil
Index of the delimiter closing the
open_charatopen_idx, or nil when the source runs out first. -
.test_path?(relative_path : String) : Bool
Maven/Gradle pin test sources to
src/test/<lang>/—java,kotlin,scala,groovyall share the layout.
Class Method Detail
Index of the delimiter closing the open_char at open_idx, or nil when
the source runs out first. String and char literals are skipped, so a
)/} inside "…" or '…' cannot close the block early.
Scan by CHARACTER (not byte): open_idx is a char index from
String#index and callers char-slice with — or range-compare — the
returned index. A byte scan corrupts both on multi-byte UTF-8.
ASCII-identical to the previous byte loop.
Maven/Gradle pin test sources to src/test/<lang>/ — java,
kotlin, scala, groovy all share the layout. Real route
handlers never live there, but Quarkus, Micronaut, Spring,
Javalin, JAX-RS and friends routinely declare inline
controllers under src/test/java/... to exercise the
framework. The path layout is part of the build tool's
contract so the prefix check is unambiguous.
Also covers Maven's archetype source-roots
(src/it/, integration-test convention used by some Quarkus
extensions and Apache projects) which sit alongside src/test/.
Takes the scan-base-relative path (Analyzer#base_relative_path),
never the absolute one. The layout is a contract between the build
tool and the project, so matching the absolute path let a
directory above the scan base decide the answer — a CI job that
checks out under a src/test/ step directory silently lost 375 of
the fixture tree's 396 endpoints.