Skip to main content

resolve_java

Function resolve_java 

pub fn resolve_java<S: BuildHasher>(
    target: &str,
    live_paths: &HashSet<String, S>,
) -> Option<String>
Expand description

Resolve a Java import FQN (com.foo.Bar) to a tracked .java file by matching the package/class path as a unique repo-path suffix (com/foo/Bar.java — Java packages map directly to directories). The match must be unique (zero or more than one candidate yields None) so an ambiguous suffix never fabricates an edge; JDK / third-party imports (java.util.List) have no tracked file and resolve to None. Wildcard package imports (com.foo.*) name a directory, not a file, and are skipped. A static-member import (com.foo.Bar.baz) or a nested class (com.foo.Outer.Inner) resolves via a single strip-retry to the enclosing class file — the full path is probed first, so a real inner-class file wins before the strip.