You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 138a622
Browse filesBrowse the repository at this point in the historyBrowse files
fix(registry): resolve package-path imports against the project's own packages
JVM package imports were read as external. A Kotlin or Java specifier is a
dotted package path whether the package belongs to the indexed tree or to a
dependency -- `import org.jetbrains.exposed.v1.tests.shared.assertEquals`
and `import kotlin.test.assertEquals` have the same shape, and neither is
"relative". The package map cannot separate them either: the manifests it
reads for the JVM (pom.xml, build.gradle) name build artifacts, not
packages. So every package-path specifier fell through to "external" and
the guard cut calls into the project's own code.
Measured on JetBrains/Exposed at 0e4d81a5, full index: the guard removed
426 CALLS edges, all of them suffix_match, all of them into the
repository's own exposed-tests/.../shared/Assert.kt. Every callee was
assertEquals, assertTrue or assertFalse -- names that file declares and
that the test files import twice, once from the project package and once
from kotlin.test. The double import is what leaves the import map without a
key and hands the call to the project-wide guess.
The evidence that separates the two is the tree's own `package`
declarations, and the pipeline already collects them: the import passes
build a namespace map keyed by the dot-normalized `package` / `namespace` /
`use` of every indexed file, to resolve namespace imports. Publish that map
for the duration of the run instead of freeing it at the end of the import
pass, and consult it before calling a package-path specifier external. The
trailing member segment is walked off one at a time, the same way the
namespace-map lookup in cbm_pipeline_resolve_import_node does it.
This keeps the effect the census called valuable. `java.net.URL` walks to
"java.net" and then "java", neither of which any project file declares, so
a bare `URL` bound to an in-tree URL class is still cut. Only specifiers
the tree itself claims are kept. Passing NULL restores the previous
contract, which is what the unit tests exercise.
After the change Exposed carries 31195 CALLS edges, the same as the
merge-base, with none removed and none added -- stable across 28 indexations
of the repository (8 with this branch, 20 single-threaded). Total edge counts
are not a usable invariant here: roughly one indexation in ten materializes a
`.properties` resource file as a File node under Folder nodes instead of a
Module with its Variables, on the merge-base binary as well, and the file it
picks varies. That flip never touches a CALLS edge and disappears entirely
under CBM_INDEX_SINGLE_THREAD=1.
The walk that strips the trailing member segment has no floor, on purpose: a
third-party package published under a prefix the tree declares reads as
in-tree and the guard stands down, leaving exactly the edge the merge-base
emits. A call-resolution suppressor has to fail on that side.
Signed-off-by: Yyunozor <yyunozor@icloud.com>
0 commit comments