Skip to content

add support for originating elements - #29

Merged
dmlloyd merged 1 commit into
smallrye:mainfrom
Ladicek:originating-elements
Nov 12, 2026
Merged

dmlloyd merged 1 commit into
smallrye:mainfrom
Ladicek:originating-elements

Conversation

@Ladicek

@Ladicek Ladicek commented Nov 12, 2026

Copy link
Copy Markdown
Member

Let callers attach javax.lang.model.element.Element instances to a generated source file via SourceFileCreator.originatingElement() and forward them to Filer.openWriter().

The new three-argument openWriter() method delegates to the existing two-argument one, so Filer stays a functional interface.

Filer.newInstance(javax.annotation.processing.Filer) overrides it and passes the elements to createSourceFile(), so generated files are properly registered for incremental compilation.

Let callers attach `javax.lang.model.element.Element` instances
to a generated source file via `SourceFileCreator.originatingElement()`
and forward them to `Filer.openWriter()`.

The new three-argument `openWriter()` method delegates to the existing
two-argument one, so `Filer` stays a functional interface.

`Filer.newInstance(javax.annotation.processing.Filer)` overrides it
and passes the elements to `createSourceFile()`, so generated files
are properly registered for incremental compilation.
@dmlloyd
dmlloyd merged commit 54a54ea into smallrye:main Nov 12, 2026
2 checks passed
@github-actions github-actions Bot added this to the 3.0 milestone Nov 12, 2026
@Ladicek
Ladicek deleted the originating-elements branch November 12, 2026 13:43
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