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
fix(java): source-code analysis crashes with Path(None) — JDK cache resolution assumes a project dir #256
Java source-code analysis (CLDK.java(source_code=...), and the deprecated CLDK(language="java").analysis(source_code=...) shim) crashes before the analyzer ever runs:
TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType'
In source-code mode BOTH analysis_json_path and project_dir are None, so cache_subdir(None, None, "java") hits Path(None). Broken since 21b3e3b (feat: run codeanalyzer.jar on a fetched Temurin JDK) — i.e. in released v1.4.0 and v1.4.1; predates and is unrelated to the #248 lookup fixes.
WITNESSES
tests/analysis/java/test_java_analysis.py: "Should return a symbol table for source analysis with expected class/method count" and "Should return per-variable initializer text for fields" — the two deterministic failures visible in every release-workflow log and on any healthy dev machine.
FIX CONTRACT
When both are None, resolve the JDK cache to a stable user-level dir (e.g. Path.home()/.cldk/java/jdk or platformdirs cache), so source/pipe mode works without a project dir.
Both witness tests pass; no behavior change for project-path mode.
Won't fix — source-code (single-file) analysis is not a supported mode; the crash path stays as-is. Consequences tracked elsewhere: the two witness tests (test_get_symbol_table_source_code, test_get_fields_variable_initializers) get removed or skip-gated as unsupported under #255's suite-hygiene work, and the formal removal of the already-deprecated source_code parameter slots into the 2.0.0 breaking window.
Activity
rahlk commentedon Jul 14, 2026
Won't fix — source-code (single-file) analysis is not a supported mode; the crash path stays as-is. Consequences tracked elsewhere: the two witness tests (test_get_symbol_table_source_code, test_get_fields_variable_initializers) get removed or skip-gated as unsupported under #255's suite-hygiene work, and the formal removal of the already-deprecated source_code parameter slots into the 2.0.0 breaking window.