Skip to content

fix: recognize Java declarations before generic imports - #560

Merged
codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
original4422:fix/java-language-detection
Nov 2, 2026
Merged

codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
original4422:fix/java-language-detection

Conversation

@original4422

Copy link
Copy Markdown
Contributor

Summary

extract_code_language labels a Java class containing import java.util.List; as Python because the generic Python import check runs first. Defer that check when the snippet has an explicit Java package declaration or public class, allowing the existing Java branch to identify it.

- Java class with imports -> python
+ Java class with imports -> java

Valid Python imports such as import java, import java.util, and import java_api remain Python. Other existing language/fallback heuristics are unchanged.

Evidence

  • New native regressions: 3 Java subtests fail before, all pass after; Python and C++/JavaScript/Rust/SQL/unknown controls pass.
  • Code-utils module: 74 tests OK. Root python -m unittest discover tests: 915 tests OK, 2 skipped, with ambient proxy variables unset. The first root run inherited a SOCKS proxy without its optional transport dependency; the isolated rerun passed.
  • Changed files pass Black and the repository's pinned isort/Black hooks.

Merge Danger

Door: two-way

Blast Radius: classification

This fixes the exported classifier used for default language inference. No compiler, model-backed evolution, or unrelated evaluator repair is claimed. Implemented and tested with Codex.

@CLAassistant

CLAassistant commented Oct 29, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codelion
codelion merged commit a7abae2 into algorithmicsuperintelligence:main Nov 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants