immutables icon indicating copy to clipboard operation
immutables copied to clipboard

Code generation fails with Java 17

Open lenaschoenburg opened this issue 4 years ago • 27 comments

Over at Zeebe we are having some issues with immutables in combination with jackson-databind when upgrading from Java 11 to Java 17. We are using immutables version 2.9.0-rc1.

I'll link a minimal reproducing example below, but the basic issue is this:

Given two classes:

public interface Car {
  List<Tire> getTires();
}

@JsonSerialize
@Immutable
@JsonDeserialize(as = ImmutableCar.class)
public abstract class AbstractCar implements Car {
  @Override
  @JsonDeserialize(as = ImmutableTire.class)
  public abstract List<Tire> getTires();
}

and

public interface Tire { }

@Immutable
@JsonDeserialize(as = ImmutableTire.class)
public abstract class AbstractTire implements Tire { }

Compilation with Java 11 works as expected but when switching to Java 17 it fails:

Full build log

/Users/ole/Library/Java/JavaVirtualMachines/temurin-17/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/ole/Source/immutables-reproducer -Dmaven.home=/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3 -Dclassworlds.conf=/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/bin/m2.conf -Dmaven.ext.class.path=/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven-event-listener.jar -javaagent:/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=54494:/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds.license:/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version=2021.2.3 --debug compile
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3
Java version: 17, vendor: Eclipse Adoptium, runtime: /Users/ole/Library/Java/JavaVirtualMachines/temurin-17/Contents/Home
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "11.5", arch: "x86_64", family: "mac"
[DEBUG]   Included /Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven-event-listener.jar
[DEBUG] Populating class realm maven.ext
[DEBUG]   Included /Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven-event-listener.jar
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.annotation.* < maven.ext
[DEBUG]   Imported: javax.annotation.security.* < maven.ext
[DEBUG]   Imported: javax.enterprise.inject.* < maven.ext
[DEBUG]   Imported: javax.enterprise.util.* < maven.ext
[DEBUG]   Imported: javax.inject.* < maven.ext
[DEBUG]   Imported: org.apache.maven.* < maven.ext
[DEBUG]   Imported: org.apache.maven.artifact < maven.ext
[DEBUG]   Imported: org.apache.maven.classrealm < maven.ext
[DEBUG]   Imported: org.apache.maven.cli < maven.ext
[DEBUG]   Imported: org.apache.maven.configuration < maven.ext
[DEBUG]   Imported: org.apache.maven.exception < maven.ext
[DEBUG]   Imported: org.apache.maven.execution < maven.ext
[DEBUG]   Imported: org.apache.maven.execution.scope < maven.ext
[DEBUG]   Imported: org.apache.maven.lifecycle < maven.ext
[DEBUG]   Imported: org.apache.maven.model < maven.ext
[DEBUG]   Imported: org.apache.maven.monitor < maven.ext
[DEBUG]   Imported: org.apache.maven.plugin < maven.ext
[DEBUG]   Imported: org.apache.maven.profiles < maven.ext
[DEBUG]   Imported: org.apache.maven.project < maven.ext
[DEBUG]   Imported: org.apache.maven.reporting < maven.ext
[DEBUG]   Imported: org.apache.maven.repository < maven.ext
[DEBUG]   Imported: org.apache.maven.rtinfo < maven.ext
[DEBUG]   Imported: org.apache.maven.settings < maven.ext
[DEBUG]   Imported: org.apache.maven.toolchain < maven.ext
[DEBUG]   Imported: org.apache.maven.usability < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.* < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.authentication < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.authorization < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.events < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.observers < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.proxy < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.repository < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.resource < maven.ext
[DEBUG]   Imported: org.codehaus.classworlds < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.* < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.classworlds < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.component < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.configuration < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.container < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.context < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.logging < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.personality < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < maven.ext
[DEBUG]   Imported: org.eclipse.aether.* < maven.ext
[DEBUG]   Imported: org.eclipse.aether.artifact < maven.ext
[DEBUG]   Imported: org.eclipse.aether.collection < maven.ext
[DEBUG]   Imported: org.eclipse.aether.deployment < maven.ext
[DEBUG]   Imported: org.eclipse.aether.graph < maven.ext
[DEBUG]   Imported: org.eclipse.aether.impl < maven.ext
[DEBUG]   Imported: org.eclipse.aether.installation < maven.ext
[DEBUG]   Imported: org.eclipse.aether.internal.impl < maven.ext
[DEBUG]   Imported: org.eclipse.aether.metadata < maven.ext
[DEBUG]   Imported: org.eclipse.aether.repository < maven.ext
[DEBUG]   Imported: org.eclipse.aether.resolution < maven.ext
[DEBUG]   Imported: org.eclipse.aether.spi < maven.ext
[DEBUG]   Imported: org.eclipse.aether.transfer < maven.ext
[DEBUG]   Imported: org.eclipse.aether.version < maven.ext
[DEBUG]   Imported: org.fusesource.jansi.* < maven.ext
[DEBUG]   Imported: org.slf4j.* < maven.ext
[DEBUG]   Imported: org.slf4j.event.* < maven.ext
[DEBUG]   Imported: org.slf4j.helpers.* < maven.ext
[DEBUG]   Imported: org.slf4j.spi.* < maven.ext
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong mojo project
[DEBUG] Reading global settings from /Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/conf/settings.xml
[DEBUG] Reading user settings from /Users/ole/.m2/settings.xml
[DEBUG] Reading global toolchains from /Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/conf/toolchains.xml
[DEBUG] Reading user toolchains from /Users/ole/.m2/toolchains.xml
[DEBUG] Using local repository at /Users/ole/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/ole/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.github.oleschoenburg:immutables-reproducer:jar:1.0-SNAPSHOT: (none)
[DEBUG] Looking up lifecycle mappings for packaging jar from ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.github.oleschoenburg:immutables-reproducer:jar:1.0-SNAPSHOT
[DEBUG] Tasks:   [compile]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO] 
[INFO] -----------< com.github.oleschoenburg:immutables-reproducer >-----------
[INFO] Building immutables-reproducer 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       com.github.oleschoenburg:immutables-reproducer:1.0-SNAPSHOT
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [compile]
[DEBUG] Repositories (dependencies): [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins)     : [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <buildFilters default-value="${project.build.filters}"/>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <escapeString>${maven.resources.escapeString}</escapeString>
  <escapeWindowsPaths default-value="true">${maven.resources.escapeWindowsPaths}</escapeWindowsPaths>
  <includeEmptyDirs default-value="false">${maven.resources.includeEmptyDirs}</includeEmptyDirs>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <overwrite default-value="false">${maven.resources.overwrite}</overwrite>
  <project default-value="${project}"/>
  <resources default-value="${project.resources}"/>
  <session default-value="${session}"/>
  <supportMultiLineFiltering default-value="false">${maven.resources.supportMultiLineFiltering}</supportMultiLineFiltering>
  <useBuildFilters default-value="true"/>
  <useDefaultDelimiters default-value="true"/>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <basedir default-value="${basedir}"/>
  <buildDirectory default-value="${project.build.directory}"/>
  <compilePath default-value="${project.compileClasspathElements}"/>
  <compileSourceRoots default-value="${project.compileSourceRoots}"/>
  <compilerArgs>
    <arg>-verbose</arg>
    <arg>-XprintRounds</arg>
    <arg>-XprintProcessorInfo</arg>
    <arg>-Xlint</arg>
    <arg>-J-verbose</arg>
  </compilerArgs>
  <compilerId default-value="javac">${maven.compiler.compilerId}</compilerId>
  <compilerReuseStrategy default-value="${reuseCreated}">${maven.compiler.compilerReuseStrategy}</compilerReuseStrategy>
  <compilerVersion>${maven.compiler.compilerVersion}</compilerVersion>
  <debug default-value="true">${maven.compiler.debug}</debug>
  <debuglevel>${maven.compiler.debuglevel}</debuglevel>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <executable>${maven.compiler.executable}</executable>
  <failOnError default-value="true">${maven.compiler.failOnError}</failOnError>
  <failOnWarning default-value="false">${maven.compiler.failOnWarning}</failOnWarning>
  <forceJavacCompilerUse default-value="false">${maven.compiler.forceJavacCompilerUse}</forceJavacCompilerUse>
  <fork default-value="false">${maven.compiler.fork}</fork>
  <generatedSourcesDirectory default-value="${project.build.directory}/generated-sources/annotations"/>
  <maxmem>${maven.compiler.maxmem}</maxmem>
  <meminitial>${maven.compiler.meminitial}</meminitial>
  <mojoExecution default-value="${mojoExecution}"/>
  <optimize default-value="false">${maven.compiler.optimize}</optimize>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <parameters default-value="false">${maven.compiler.parameters}</parameters>
  <project default-value="${project}"/>
  <projectArtifact default-value="${project.artifact}"/>
  <release>${maven.compiler.release}</release>
  <session default-value="${session}"/>
  <showDeprecation default-value="false">${maven.compiler.showDeprecation}</showDeprecation>
  <showWarnings default-value="false">${maven.compiler.showWarnings}</showWarnings>
  <skipMain>${maven.main.skip}</skipMain>
  <skipMultiThreadWarning default-value="false">${maven.compiler.skipMultiThreadWarning}</skipMultiThreadWarning>
  <source default-value="1.6">${maven.compiler.source}</source>
  <staleMillis default-value="0">${lastModGranularityMs}</staleMillis>
  <target default-value="1.6">${maven.compiler.target}</target>
  <useIncrementalCompilation default-value="true">${maven.compiler.useIncrementalCompilation}</useIncrementalCompilation>
  <verbose default-value="false">${maven.compiler.verbose}</verbose>
</configuration>
[DEBUG] =======================================================================
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=295834, ConflictMarker.markTime=89125, ConflictMarker.nodeCount=5, ConflictIdSorter.graphTime=236375, ConflictIdSorter.topsortTime=160958, ConflictIdSorter.conflictIdCount=4, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=2128250, ConflictResolver.conflictItemCount=4, DefaultDependencyCollector.collectTime=96130208, DefaultDependencyCollector.transformTime=4160292}
[DEBUG] com.github.oleschoenburg:immutables-reproducer:jar:1.0-SNAPSHOT
[DEBUG]    org.immutables:value:jar:2.9.0-rc1:compile
[DEBUG]    com.fasterxml.jackson.core:jackson-databind:jar:2.13.0:compile
[DEBUG]       com.fasterxml.jackson.core:jackson-annotations:jar:2.13.0:compile
[DEBUG]       com.fasterxml.jackson.core:jackson-core:jar:2.13.0:compile
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ immutables-reproducer ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=256167, ConflictMarker.markTime=238166, ConflictMarker.nodeCount=77, ConflictIdSorter.graphTime=212125, ConflictIdSorter.topsortTime=21000, ConflictIdSorter.conflictIdCount=26, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=5814958, ConflictResolver.conflictItemCount=74, DefaultDependencyCollector.collectTime=241330084, DefaultDependencyCollector.transformTime=6637500}
[DEBUG] org.apache.maven.plugins:maven-resources-plugin:jar:2.6
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-core:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6:compile
[DEBUG]       org.apache.maven.reporting:maven-reporting-api:jar:2.0.6:compile
[DEBUG]          org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-error-diagnostics:jar:2.0.6:compile
[DEBUG]       commons-cli:commons-cli:jar:1.0:compile
[DEBUG]       org.apache.maven:maven-plugin-descriptor:jar:2.0.6:compile
[DEBUG]       org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[DEBUG]       classworlds:classworlds:jar:1.1:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-settings:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-model:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-monitor:jar:2.0.6:compile
[DEBUG]    org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]       junit:junit:jar:3.8.1:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
[DEBUG]    org.apache.maven.shared:maven-filtering:jar:1.1:compile
[DEBUG]       org.sonatype.plexus:plexus-build-api:jar:0.0.4:compile
[DEBUG]    org.codehaus.plexus:plexus-interpolation:jar:1.13:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-resources-plugin:2.6
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-resources-plugin:2.6
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-resources-plugin:2.6
[DEBUG]   Included: org.apache.maven.plugins:maven-resources-plugin:jar:2.6
[DEBUG]   Included: org.apache.maven.reporting:maven-reporting-api:jar:2.0.6
[DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7
[DEBUG]   Included: commons-cli:commons-cli:jar:1.0
[DEBUG]   Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
[DEBUG]   Included: org.apache.maven.shared:maven-filtering:jar:1.1
[DEBUG]   Included: org.sonatype.plexus:plexus-build-api:jar:0.0.4
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.13
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-resources-plugin:2.6:resources from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:2.6, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-resources-plugin:2.6:resources' with basic configurator -->
[DEBUG]   (f) buildFilters = []
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) escapeWindowsPaths = true
[DEBUG]   (s) includeEmptyDirs = false
[DEBUG]   (s) outputDirectory = /Users/ole/Source/immutables-reproducer/target/classes
[DEBUG]   (s) overwrite = false
[DEBUG]   (f) project = MavenProject: com.github.oleschoenburg:immutables-reproducer:1.0-SNAPSHOT @ /Users/ole/Source/immutables-reproducer/pom.xml
[DEBUG]   (s) resources = [Resource {targetPath: null, filtering: false, FileSet {directory: /Users/ole/Source/immutables-reproducer/src/main/resources, PatternSet [includes: {}, excludes: {}]}}]
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@67001148
[DEBUG]   (f) supportMultiLineFiltering = false
[DEBUG]   (f) useBuildFilters = true
[DEBUG]   (s) useDefaultDelimiters = true
[DEBUG] -- end configuration --
[DEBUG] properties used {java.specification.version=17, sun.arch.data.model=64, env.JAVA_MAIN_CLASS_9519=org.codehaus.classworlds.Launcher, java.vendor.url=https://adoptium.net/, env.GOPATH=/Users/ole/go/, sun.boot.library.path=/Users/ole/Library/Java/JavaVirtualMachines/temurin-17/Contents/Home/lib, sun.java.command=org.codehaus.classworlds.Launcher -Didea.version=2021.2.3 --debug compile, jdk.debug=release, maven.version=3.6.3, java.specification.vendor=Oracle Corporation, java.version.date=2021-09-14, java.home=/Users/ole/Library/Java/JavaVirtualMachines/temurin-17/Contents/Home, java.vm.specification.vendor=Oracle Corporation, java.specification.name=Java Platform API Specification, env.HOMEBREW_REPOSITORY=/opt/homebrew, env.MANPATH=/opt/homebrew/share/man::, env.STARSHIP_SHELL=zsh, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, java.runtime.version=17+35, env.PATH=/Users/ole/.sdkman/candidates/java/current/bin:/opt/homebrew/opt/gnu-tar/libexec/gnubin:/opt/homebrew/opt/[email protected]/bin:/Users/ole/go/bin:/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/ole/.cargo/bin, env.__CFBundleIdentifier=com.jetbrains.intellij.ce, file.encoding=UTF-8, java.vendor.version=Temurin-17+35, java.io.tmpdir=/var/folders/y1/1l07289s4hdgq88gsys1jdfc0000gn/T/, java.version=17, java.vm.specification.name=Java Virtual Machine Specification, native.encoding=US-ASCII, env.SDKMAN_PLATFORM=darwinx64, java.library.path=/Users/ole/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:., java.vendor=Eclipse Adoptium, classworlds.conf=/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/bin/m2.conf, sun.io.unicode.encoding=UnicodeBig, env.COMMAND_MODE=unix2003, java.vm.specification.version=17, os.name=Mac OS X, maven.compiler.source=11, user.home=/Users/ole, env.HOMEBREW_CELLAR=/opt/homebrew/Cellar, env.HOMEBREW_PREFIX=/opt/homebrew, path.separator=:, os.version=11.5, java.vm.name=OpenJDK 64-Bit Server VM, env.SHELL=/bin/zsh, maven.ext.class.path=/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven-event-listener.jar, os.arch=x86_64, maven.multiModuleProjectDirectory=/Users/ole/Source/immutables-reproducer, java.vm.info=mixed mode, sharing, env.USER=ole, java.class.version=61.0, sun.jnu.encoding=UTF-8, env.SDKMAN_CANDIDATES_API=https://api.sdkman.io/2, maven.build.version=Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f), maven.home=/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3, env.STARSHIP_SESSION_KEY=3207866242351391, env.JAVA_HOME=/Users/ole/.sdkman/candidates/java/current, file.separator=/, java.vm.compressedOopsMode=Zero based, line.separator=
, user.name=ole, env.LOGNAME=ole, env.XPC_FLAGS=0x0, env.__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, idea.version=2021.2.3, env.SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.FTc2fcJstl/Listeners, env.SDKMAN_DIR=/Users/ole/.sdkman, maven.compiler.target=11, env.TMPDIR=/var/folders/y1/1l07289s4hdgq88gsys1jdfc0000gn/T/, env.INFOPATH=/opt/homebrew/share/info:, env.HOMEBREW_SHELLENV_PREFIX=/opt/homebrew, env.SDKMAN_CANDIDATES_DIR=/Users/ole/.sdkman/candidates, env.OLDPWD=/, env.PWD=/Users/ole/Source/immutables-reproducer, env.LC_CTYPE=en_DE.UTF-8, java.class.path=/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds.license:/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.6.0.jar, env.HOME=/Users/ole, java.vm.vendor=Eclipse Adoptium, maven.conf=/Users/ole/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/212.5457.46/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/conf, sun.java.launcher=SUN_STANDARD, user.country=DE, sun.cpu.endian=little, user.language=en, env.XPC_SERVICE_NAME=application.com.jetbrains.intellij.ce.3430818.3434377, java.runtime.name=OpenJDK Runtime Environment, project.build.sourceEncoding=UTF-8, java.vendor.url.bug=https://github.com/adoptium/adoptium-support/issues, user.dir=/Users/ole/Source/immutables-reproducer, env.SDKMAN_VERSION=5.12.4, java.vm.version=17+35}
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[DEBUG] resource with targetPath null
directory /Users/ole/Source/immutables-reproducer/src/main/resources
excludes []
includes []
[INFO] skip non existing resourceDirectory /Users/ole/Source/immutables-reproducer/src/main/resources
[DEBUG] no use filter components
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ immutables-reproducer ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=245166, ConflictMarker.markTime=136834, ConflictMarker.nodeCount=118, ConflictIdSorter.graphTime=383500, ConflictIdSorter.topsortTime=39709, ConflictIdSorter.conflictIdCount=45, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=5088917, ConflictResolver.conflictItemCount=72, DefaultDependencyCollector.collectTime=479895959, DefaultDependencyCollector.transformTime=5914750}
[DEBUG] org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.1
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.0:compile
[DEBUG]       org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
[DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
[DEBUG]             org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:3.0:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:2.0.4:compile
[DEBUG]    org.apache.maven:maven-core:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-settings-builder:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-aether-provider:jar:3.0:runtime
[DEBUG]       org.sonatype.aether:aether-impl:jar:1.7:compile
[DEBUG]          org.sonatype.aether:aether-spi:jar:1.7:compile
[DEBUG]       org.sonatype.aether:aether-api:jar:1.7:compile
[DEBUG]       org.sonatype.aether:aether-util:jar:1.7:compile
[DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:1.7.1:compile (version managed from default)
[DEBUG]       org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]    org.apache.maven.shared:maven-shared-utils:jar:3.2.1:compile
[DEBUG]       commons-io:commons-io:jar:2.5:compile
[DEBUG]    org.apache.maven.shared:maven-shared-incremental:jar:1.1:compile
[DEBUG]    org.codehaus.plexus:plexus-java:jar:0.9.10:compile
[DEBUG]       org.ow2.asm:asm:jar:6.2:compile
[DEBUG]       com.thoughtworks.qdox:qdox:jar:2.0-M9:compile (version managed from default)
[DEBUG]    org.codehaus.plexus:plexus-compiler-api:jar:2.8.4:compile
[DEBUG]    org.codehaus.plexus:plexus-compiler-manager:jar:2.8.4:compile
[DEBUG]    org.codehaus.plexus:plexus-compiler-javac:jar:2.8.4:runtime
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[DEBUG]   Included: org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.1
[DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.4
[DEBUG]   Included: org.sonatype.aether:aether-util:jar:1.7
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.7.1
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.apache.maven.shared:maven-shared-utils:jar:3.2.1
[DEBUG]   Included: commons-io:commons-io:jar:2.5
[DEBUG]   Included: org.apache.maven.shared:maven-shared-incremental:jar:1.1
[DEBUG]   Included: org.codehaus.plexus:plexus-java:jar:0.9.10
[DEBUG]   Included: org.ow2.asm:asm:jar:6.2
[DEBUG]   Included: com.thoughtworks.qdox:qdox:jar:2.0-M9
[DEBUG]   Included: org.codehaus.plexus:plexus-compiler-api:jar:2.8.4
[DEBUG]   Included: org.codehaus.plexus:plexus-compiler-manager:jar:2.8.4
[DEBUG]   Included: org.codehaus.plexus:plexus-compiler-javac:jar:2.8.4
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-compiler-plugin:3.8.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile' with basic configurator -->
[DEBUG]   (f) basedir = /Users/ole/Source/immutables-reproducer
[DEBUG]   (f) buildDirectory = /Users/ole/Source/immutables-reproducer/target
[DEBUG]   (f) compilePath = [/Users/ole/Source/immutables-reproducer/target/classes, /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar, /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar, /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar, /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.0/jackson-core-2.13.0.jar]
[DEBUG]   (f) compileSourceRoots = [/Users/ole/Source/immutables-reproducer/src/main/java]
[DEBUG]   (f) compilerArgs = [-verbose, -XprintRounds, -XprintProcessorInfo, -Xlint, -J-verbose]
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) failOnWarning = false
[DEBUG]   (f) forceJavacCompilerUse = false
[DEBUG]   (f) fork = false
[DEBUG]   (f) generatedSourcesDirectory = /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations
[DEBUG]   (f) mojoExecution = org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile {execution: default-compile}
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputDirectory = /Users/ole/Source/immutables-reproducer/target/classes
[DEBUG]   (f) parameters = false
[DEBUG]   (f) project = MavenProject: com.github.oleschoenburg:immutables-reproducer:1.0-SNAPSHOT @ /Users/ole/Source/immutables-reproducer/pom.xml
[DEBUG]   (f) projectArtifact = com.github.oleschoenburg:immutables-reproducer:jar:1.0-SNAPSHOT
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@67001148
[DEBUG]   (f) showDeprecation = false
[DEBUG]   (f) showWarnings = false
[DEBUG]   (f) skipMultiThreadWarning = false
[DEBUG]   (f) source = 11
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (s) target = 11
[DEBUG]   (f) useIncrementalCompilation = true
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[DEBUG] Using compiler 'javac'.
[DEBUG] Adding /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations to compile source roots:
  /Users/ole/Source/immutables-reproducer/src/main/java
[DEBUG] New compile source roots:
  /Users/ole/Source/immutables-reproducer/src/main/java
  /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations
[DEBUG] CompilerReuseStrategy: reuseCreated
[DEBUG] useIncrementalCompilation enabled
[DEBUG] Stale source detected: /Users/ole/Source/immutables-reproducer/src/main/java/AbstractTire.java
[DEBUG] Stale source detected: /Users/ole/Source/immutables-reproducer/src/main/java/AbstractCar.java
[DEBUG] Stale source detected: /Users/ole/Source/immutables-reproducer/src/main/java/Tire.java
[DEBUG] Stale source detected: /Users/ole/Source/immutables-reproducer/src/main/java/Car.java
[INFO] Changes detected - recompiling the module!
[DEBUG] Classpath:
[DEBUG]  /Users/ole/Source/immutables-reproducer/target/classes
[DEBUG]  /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar
[DEBUG]  /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar
[DEBUG]  /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar
[DEBUG]  /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.0/jackson-core-2.13.0.jar
[DEBUG] Source roots:
[DEBUG]  /Users/ole/Source/immutables-reproducer/src/main/java
[DEBUG]  /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations
[DEBUG] Command line options:
[DEBUG] -d /Users/ole/Source/immutables-reproducer/target/classes -classpath /Users/ole/Source/immutables-reproducer/target/classes:/Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar:/Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar:/Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar:/Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.0/jackson-core-2.13.0.jar: -sourcepath /Users/ole/Source/immutables-reproducer/src/main/java:/Users/ole/Source/immutables-reproducer/target/generated-sources/annotations: -s /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations -g -nowarn -target 11 -source 11 -encoding UTF-8 -verbose -XprintRounds -XprintProcessorInfo -Xlint
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 4 source files to /Users/ole/Source/immutables-reproducer/target/classes
[parsing started SimpleFileObject[/Users/ole/Source/immutables-reproducer/src/main/java/AbstractCar.java]]
[parsing completed 54ms]
[parsing started SimpleFileObject[/Users/ole/Source/immutables-reproducer/src/main/java/AbstractTire.java]]
[parsing completed 1ms]
[parsing started SimpleFileObject[/Users/ole/Source/immutables-reproducer/src/main/java/Tire.java]]
[parsing completed 1ms]
[parsing started SimpleFileObject[/Users/ole/Source/immutables-reproducer/src/main/java/Car.java]]
[parsing completed 1ms]
[loading /modules/jdk.internal.ed/module-info.class]
[loading /modules/jdk.localedata/module-info.class]
[loading /modules/jdk.incubator.foreign/module-info.class]
[loading /modules/jdk.jfr/module-info.class]
[loading /modules/java.security.sasl/module-info.class]
[loading /modules/jdk.crypto.cryptoki/module-info.class]
[loading /modules/jdk.incubator.vector/module-info.class]
[loading /modules/java.naming/module-info.class]
[loading /modules/jdk.jdwp.agent/module-info.class]
[loading /modules/java.management/module-info.class]
[loading /modules/java.xml/module-info.class]
[loading /modules/jdk.naming.rmi/module-info.class]
[loading /modules/java.xml.crypto/module-info.class]
[loading /modules/jdk.unsupported/module-info.class]
[loading /modules/java.base/module-info.class]
[loading /modules/jdk.management/module-info.class]
[loading /modules/jdk.compiler/module-info.class]
[loading /modules/jdk.jpackage/module-info.class]
[loading /modules/java.transaction.xa/module-info.class]
[loading /modules/jdk.unsupported.desktop/module-info.class]
[loading /modules/jdk.jdeps/module-info.class]
[loading /modules/jdk.internal.vm.ci/module-info.class]
[loading /modules/java.se/module-info.class]
[loading /modules/jdk.xml.dom/module-info.class]
[loading /modules/jdk.internal.jvmstat/module-info.class]
[loading /modules/jdk.jartool/module-info.class]
[loading /modules/jdk.net/module-info.class]
[loading /modules/jdk.jconsole/module-info.class]
[loading /modules/java.sql/module-info.class]
[loading /modules/jdk.accessibility/module-info.class]
[loading /modules/jdk.crypto.ec/module-info.class]
[loading /modules/java.rmi/module-info.class]
[loading /modules/java.desktop/module-info.class]
[loading /modules/jdk.sctp/module-info.class]
[loading /modules/jdk.jsobject/module-info.class]
[loading /modules/java.logging/module-info.class]
[loading /modules/jdk.hotspot.agent/module-info.class]
[loading /modules/jdk.security.jgss/module-info.class]
[loading /modules/jdk.zipfs/module-info.class]
[loading /modules/jdk.jstatd/module-info.class]
[loading /modules/java.smartcardio/module-info.class]
[loading /modules/jdk.jlink/module-info.class]
[loading /modules/jdk.internal.le/module-info.class]
[loading /modules/java.instrument/module-info.class]
[loading /modules/jdk.security.auth/module-info.class]
[loading /modules/jdk.management.jfr/module-info.class]
[loading /modules/jdk.random/module-info.class]
[loading /modules/java.scripting/module-info.class]
[loading /modules/jdk.charsets/module-info.class]
[loading /modules/java.net.http/module-info.class]
[loading /modules/jdk.jshell/module-info.class]
[loading /modules/jdk.jcmd/module-info.class]
[loading /modules/java.security.jgss/module-info.class]
[loading /modules/jdk.attach/module-info.class]
[loading /modules/java.datatransfer/module-info.class]
[loading /modules/jdk.internal.opt/module-info.class]
[loading /modules/jdk.jdi/module-info.class]
[loading /modules/jdk.httpserver/module-info.class]
[loading /modules/jdk.javadoc/module-info.class]
[loading /modules/java.compiler/module-info.class]
[loading /modules/jdk.internal.vm.compiler.management/module-info.class]
[loading /modules/jdk.nio.mapmode/module-info.class]
[loading /modules/jdk.management.agent/module-info.class]
[loading /modules/jdk.dynalink/module-info.class]
[loading /modules/java.sql.rowset/module-info.class]
[loading /modules/jdk.internal.vm.compiler/module-info.class]
[loading /modules/java.prefs/module-info.class]
[loading /modules/java.management.rmi/module-info.class]
[loading /modules/jdk.naming.dns/module-info.class]
[loading /modules/jdk.editpad/module-info.class]
[search path for source files: /Users/ole/Source/immutables-reproducer/src/main/java,/Users/ole/Source/immutables-reproducer/target/generated-sources/annotations]
[search path for class files: /Users/ole/Library/Java/JavaVirtualMachines/temurin-17/Contents/Home/lib/modules,/Users/ole/Source/immutables-reproducer/target/classes,/Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar,/Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar,/Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar,/Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.0/jackson-core-2.13.0.jar,.]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar(/com/fasterxml/jackson/databind/annotation/JsonDeserialize.class)]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar(/com/fasterxml/jackson/databind/annotation/JsonSerialize.class)]
[loading /modules/java.base/java/util/List.class]
[loading /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar(/org/immutables/value/Value.class)]
[loading /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar(/org/immutables/value/Value$Immutable.class)]
[loading /modules/java.base/java/lang/Object.class]
[loading /modules/java.base/java/lang/annotation/Target.class]
[loading /modules/java.base/java/lang/annotation/ElementType.class]
[loading /modules/java.base/java/lang/annotation/Retention.class]
[loading /modules/java.base/java/lang/annotation/RetentionPolicy.class]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar(/com/fasterxml/jackson/databind/annotation/JsonSerialize$Typing.class)]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar(/com/fasterxml/jackson/databind/annotation/JsonSerialize$Inclusion.class)]
[loading /modules/java.base/java/lang/Deprecated.class]
[loading /modules/java.base/java/lang/annotation/Annotation.class]
[loading /modules/java.base/java/lang/Class.class]
[loading /modules/java.base/java/lang/Override.class]
Round 1:
	input files: {AbstractCar, AbstractTire, Tire, Car}
	annotations: [com.fasterxml.jackson.databind.annotation.JsonSerialize, org.immutables.value.Value.Immutable, com.fasterxml.jackson.databind.annotation.JsonDeserialize, java.lang.Override]
	last round: false
[loading /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar(/org/immutables/value/Value$Style.class)]
[loading /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar(/org/immutables/value/Value$Style$ValidationMethod.class)]
[loading /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar(/org/immutables/value/Value$Style$ImplementationVisibility.class)]
[loading /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar(/org/immutables/value/Value$Style$BuilderVisibility.class)]
[loading /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar(/org/immutables/value/Value$Style$Depluralize.class)]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar(/com/fasterxml/jackson/annotation/JacksonAnnotation.class)]
[loading /modules/java.base/java/lang/annotation/Documented.class]
[loading /Users/ole/.m2/repository/org/immutables/value/2.9.0-rc1/value-2.9.0-rc1.jar(/org/immutables/value/Generated.class)]
[loading /modules/java.compiler/javax/annotation/processing/Generated.class]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar(/com/fasterxml/jackson/annotation/JsonCreator.class)]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar(/com/fasterxml/jackson/annotation/JsonCreator$Mode.class)]
[loading /modules/java.base/java/util/Objects.class]
Processor org.immutables.processor.ProxyProcessor matches [/org.immutables.value.Value.Immutable] and returns false.
[parsing started DirectoryFileObject[/Users/ole/Source/immutables-reproducer/target/generated-sources/annotations:ImmutableCar.java]]
[parsing completed 36ms]
[parsing started DirectoryFileObject[/Users/ole/Source/immutables-reproducer/target/generated-sources/annotations:ImmutableTire.java]]
[parsing completed 3ms]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar(/com/fasterxml/jackson/annotation/JsonAutoDetect.class)]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar(/com/fasterxml/jackson/annotation/JsonProperty.class)]
[loading /modules/java.base/java/util/ArrayList.class]
[loading /modules/java.base/java/util/Arrays.class]
[loading /modules/java.base/java/util/Collection.class]
[loading /modules/java.base/java/util/Collections.class]
[loading /modules/java.base/java/lang/SuppressWarnings.class]
[loading /modules/java.base/java/lang/Iterable.class]
[loading /modules/java.base/java/lang/String.class]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar(/com/fasterxml/jackson/annotation/JsonAutoDetect$Visibility.class)]
[loading /Users/ole/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar(/com/fasterxml/jackson/annotation/JsonProperty$Access.class)]
Round 2:
	input files: {}
	annotations: []
	last round: true
[total 1205ms]
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations/ImmutableCar.java:[35,25] incompatible types: java.lang.String cannot be converted to java.lang.Class<?>
[ERROR] /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations/ImmutableCar.java:[235,27] incompatible types: java.lang.String cannot be converted to java.lang.Class<?>
[ERROR] /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations/ImmutableCar.java:[111,27] incompatible types: java.lang.String cannot be converted to java.lang.Class<?>
[INFO] 3 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.017 s
[INFO] Finished at: 2021-10-19T15:26:07+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project immutables-reproducer: Compilation failure: Compilation failure: 
[ERROR] /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations/ImmutableCar.java:[35,25] incompatible types: java.lang.String cannot be converted to java.lang.Class<?>
[ERROR] /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations/ImmutableCar.java:[235,27] incompatible types: java.lang.String cannot be converted to java.lang.Class<?>
[ERROR] /Users/ole/Source/immutables-reproducer/target/generated-sources/annotations/ImmutableCar.java:[111,27] incompatible types: java.lang.String cannot be converted to java.lang.Class<?>
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project immutables-reproducer: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1220)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Process finished with exit code 1

The offending generated code looks like this:

  @JsonProperty("tires")
  @JsonDeserialize(as = "<error>")
  @Override
  public List<Tire> getTires() {
    return tires;
  }

Full project to reproduce is here: https://github.com/oleschoenburg/immutables-bug-reproducer

I think this could be a new instance of https://github.com/immutables/immutables/issues/360?

lenaschoenburg avatar Oct 19 '21 13:10 lenaschoenburg

@SimY4 can you pls take a look at this issue ?

Let me know if you don't have time.

asereda-gs avatar Oct 20 '21 03:10 asereda-gs

@oleschoenburg seems to be working fine in github actions pipeline: https://github.com/SimY4/immutables/actions/runs/1362104867

Do you know what could be different between immutables fixtures set up and your build pipeline set up?

SimY4 avatar Oct 20 '21 05:10 SimY4

Interesting, thanks for looking into it! The only difference I can think of is that I'm running on arm64 (the JDK is x86 though). I'll try to confirm that this doesn't happen on a x86 machine first.

lenaschoenburg avatar Oct 20 '21 07:10 lenaschoenburg

I've tested a couple of different combinations now:

Architecture JDK Reproducible
x86_64 openjdk 11
x86_64 openjdk 16
x86_64 temurin 17
aarch64 azul 11
aarch64 azul 16
aarch64 temurin 17

This means that the title is incorrect, this occurs for Java 16 too.

lenaschoenburg avatar Oct 20 '21 07:10 lenaschoenburg

@oleschoenburg thank you for your inputs. I was able to reproduce it on another project of mine.

SimY4 avatar Oct 20 '21 09:10 SimY4

@oleschoenburg apparently the difference that fixes this issue is this one:

        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <fork>true</fork>
              <compilerArgs combine.children="append">
                <!-- required by errorprone -->
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
                <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
              </compilerArgs>
            </configuration>
          </plugin>
        </plugins>

value fixture uses error-prone that requires all these additional opens. Apparently, some of them are also needed for an immutables annotation processor to work.

The working theory that I'm currently working on is that if you define a module-info.java for your module using immutables you don't have to declare opens. Otherwise, we can work on figuring out the absolute minimum of required opens for immutavles.

SimY4 avatar Oct 20 '21 09:10 SimY4

@SimY4 Thank you, I can confirm that adding the exports fixes the problem! 🥳 I didn't test adding module-info.java because AFAIK that'd require some more changes in our setup. Let me know if I can help you in some way.

lenaschoenburg avatar Oct 20 '21 10:10 lenaschoenburg

Follow up

Narrowed down list of opens that will make immutables work for this case is:

            <configuration>
              <fork>true</fork>
              <compilerArgs combine.children="append">
                <!-- required by javac detection logic in immutables -->
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
              </compilerArgs>
            </configuration>

SimY4 avatar Oct 31 '21 01:10 SimY4

done in 2.9.0 ?

elucash avatar Jan 19 '22 05:01 elucash

@elucash yes, with everything I had on this was merged to master. The final version requires only one additional export:

<configuration>
  <fork>true</fork>
  <compilerArgs combine.children="append">
    <!-- required by javac detection logic in immutables -->
    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
  </compilerArgs>
</configuration>

SimY4 avatar Jan 19 '22 06:01 SimY4

Hey @SimY4! Do you have any more information on the root cause on why the export is required here, and if there are any possible workarounds? In my company, we have a several rather large projects making heavy use of immutables, and forking the maven compiler causes a ~10x slowdown in build times, so would be quite a blocker for moving onto JDK 17. I was hoping that the final version would not require any exports at all.

I did find https://bugs.openjdk.java.net/browse/JDK-8229535, which I wonder is related to the underlying issue at hand.

If you had any pointers to investigating deeper, that would be greatly appreciated!

dwragge avatar Jan 21 '22 04:01 dwragge

@dwragge In immutables, there are features that are compiler-specific. To be clear - not every feature of immutables is compiler-specific so you may not need to include this in your build. In my personal projects I somehow completely avoided the need to have it set.

When you have a feature that requires Immutables to look beyond shared public compiler APIs of Hotspot JDK, this is where you would need to set this open.

SimY4 avatar Jan 21 '22 05:01 SimY4

One way how Immutables can attempt to mitigate that is by specifying required opens in jar manifest:

file: META-INF/MANIFEST.MF

Add-Opens: jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
...

But this would require Immutables to get onboard with JPMS (AKA module system).

SimY4 avatar Jan 21 '22 05:01 SimY4

Turned out to be easy: https://github.com/immutables/immutables/pull/1354

Now I wish to come up with it earlier.

SimY4 avatar Jan 21 '22 06:01 SimY4

That's awesome, thanks a lot @SimY4 !

dwragge avatar Jan 23 '22 23:01 dwragge

I'm not sure if this is related to this, as our issues were with @JsonSerialize and @JsonDeserialize worked fine.

It turned out that problem was using @JsonSerialize in passAnnotations option of @Style annotation. When we removed that, build worked fine on JDK17 without adding any opens/exports VM options. This was on version 2.7.4

As example project didn't use passAnnotations, this might not be related. But javadoc of this options says following: By default, no annotations are copied unless you specify non-empty annotation type list as value for passAnnotations attribute. Howerver there are some special annotations which are copied using special logic, such as Nullable annotations (and Jackson annotations)

antemo avatar Mar 17 '22 11:03 antemo

I'm seeing this issue on 2.9.3 with @JsonSubTypes, identical to https://github.com/immutables/immutables/issues/360

dylanbaroody avatar Apr 10 '23 20:04 dylanbaroody

TBH I do observe this issue in one of my projects also. I can't reproduce it in any other repo except one so I can't blame it specifically on Java 17. I believe there might be a race condition or something that in some circumstances doesn't let Immuables to calculate the future reference for not yet existent type (like Immutable* or Immutable*.BuilderImpl).

SimY4 avatar Apr 10 '23 23:04 SimY4

Sorry for not contributing much here, but I don't know how to approach this. Jackson binding is working at runtime. Annotation processor generates source code. If compilation succeeds, then there is code generated (aside from problems where no code is generated but compilation still succeeds) Then, if something fails at runtime, then there must be some discrepancy in the generated code, missing members, annotations or any other problem, anything like that? Or just runtime environment is not the same and with Jackson+Java17 generated code layout is not what binding recognizes properly, so what to fix in this case?

elucash avatar Apr 11 '23 02:04 elucash

It's not a runtime issue though, it's a compile time one. I've got an example that reproduces here: https://github.com/dylanbaroody/reproduce-immutables-issue

This does actually work if I generate the dependent files (BandPlot) first, and then do a mvn compile without cleaning, which implies to me that it's exactly the problem with the not yet existent type.

I can confirm that this example builds with java 11.0.15, but fails with java 17.0.5

dylanbaroody avatar Apr 11 '23 15:04 dylanbaroody

Sorry, I only now got to the repro. But I wish I would see the actual error earlier (yep, it was in the original report)

@JsonSubTypes(@JsonSubTypes.Type(value = "<error>", name = "BAND_PLOT"))

Where instead of class we have string "<error>", obviously, as was mentioned, this is due the usage of not yet existing type. On java 11 and below we had some workarounds working. I'll try to see if something is possible with Java 17

elucash avatar Apr 12 '23 15:04 elucash

Ok, so here's my understanding so far:

  1. It is a peculiarity of Javac (or a bug, but it's a grey territory IMO) that instead of returning unresolved type it provides a literal string "error".
  2. Due to jms restrictions we no longer can workaround the "bug".
  3. So we should either stop using not-yet-generated types (in signatures and annotation at least, can still refer to those in the code)
  4. Or give all the Javac access as was shown in the comment above https://github.com/immutables/immutables/issues/1339#issuecomment-955618171

At some point we might consider doing Add-Opens: jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED in MANIFEST.MF, but that future version of Immutables will not require any Javac access by design, at least I would set it as a goal. Switching current version to JMS completely would be really big and possibly compatibility breaking undertaking and I not sure it will work out eventually for the use cases we want to solve.

Let's discuss how we can fix Jackson integration in light of this. What do we need for this?

elucash avatar Apr 12 '23 16:04 elucash

I can confirm that adding -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED to compiler args list solved the problem for me.

The problem with my previous suggestion of adding opens to jar manifest is that it won't work for annotation processors. This trick will only work for executable jars.

I wonder if we can do something with programmatically opening modules at runtime. I think I saw JUnit 5 or Mockito (ByteBuddy in particular) doing something funky with modules to access classes.

SimY4 avatar Apr 17 '23 12:04 SimY4

Also, this looks like a JEP that should solve this: https://openjdk.org/jeps/8280389

SimY4 avatar Apr 17 '23 22:04 SimY4

Idk, looks more like a "standard" alternative to asm bytecode lib

elucash avatar Apr 17 '23 22:04 elucash

Is there a way to get this to work without forking the compiler? Forking the compiler slows stuff WAY down

dylanbaroody avatar Oct 17 '23 21:10 dylanbaroody

@dylanbaroody if I understand the question correctly (I didn't re-read the whole thread): yes, the alternative is to pass the relevant flags to the Maven process itself, e.g. by placing them in .mvn/jvm.config. That way forking isn't necessary.

This is a project that follows that approach. (It doesn't use Immutables, but it does use a compiler plugin that heavily relies on compiler internals that are not exposed by default; see also their documentation where the non-fork approach is mentioned.)

Stephan202 avatar Oct 18 '23 05:10 Stephan202