Skip to content

Record classfile-derived API for un-loadable Java classes (#837)#1729

Merged
eed3si9n merged 1 commit into
sbt:developfrom
jozanek:feat/classfile-java-api-unloadable
Jun 22, 2026
Merged

Record classfile-derived API for un-loadable Java classes (#837)#1729
eed3si9n merged 1 commit into
sbt:developfrom
jozanek:feat/classfile-java-api-unloadable

Conversation

@jozanek

@jozanek jozanek commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Builds on #1714 (merged). Records an xsbti.api.ClassLike for Java classes that can't be reflectively loaded during analysis (#837, sbt/sbt#117), so name-hashing tracks changes to their own public shape — derived directly from the classfile instead of reflection.

  • ClassfileToAPI builds a class + module ClassLike from the classfile (members split static/instance), conservatively folding constants, the raw Signature, throws, and annotation types so changes are detected.
  • JavaAnalyze gains a readClassfileAPI callback (no-op default), wired in AnalyzingJavaCompiler, for the un-loadable fallback path Fix IllegalAccessError analyzing Java compiled with --add-exports (#837) #1714 added.

Does not touch loadable classes (still reflection-based). Covered by ClassfileToAPISpecification / AnalyzeSpecification.

@eed3si9n eed3si9n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eed3si9n eed3si9n merged commit e489c3e into sbt:develop Jun 22, 2026
8 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.

2 participants