micronaut-projects / micronaut-sourcegen

Compilation time source code generators
Apache License 2.0
7 stars 4 forks source link

Compilation error with @Wither - Output stream or writer has already been opened #122

Closed brucemelo closed 3 months ago

brucemelo commented 3 months ago

Expected Behavior

Use Wither without Build failing

Actual Behaviour

I'm was working only with @Builder without any problem, I;ve tried to work with @Wither to avoid copy records and got error compilation.

Task :compileJava FAILED 1 actionable task: 1 executed

FAILURE: Build failed with an exception.

The error occurr when implement the interface *Wither and try to build

Steps To Reproduce

  1. Create new micronaut project with Gradle (Kotlin)
  2. Add annotationProcessor("io.micronaut.sourcegen:micronaut-sourcegen-generator-java") implementation("io.micronaut.sourcegen:micronaut-sourcegen-annotations")
  3. Build
  4. Create a record and add @Wither
  5. Build
  6. Implement the interface *Wither
  7. Build and Error

Environment Information

Operating System: Windows 11 Micronaut Version: 4.5.0 JDK Version: 21 Gradle 8.8

Example Application

No response

Version

4.5.0

dstepanov commented 3 months ago

Please create a reproducer

brucemelo commented 3 months ago

Please create a reproducer

https://github.com/brucemelo/micronaut-sourcegen-wither-issue