MavenBuildSpec.resolve_fields selects the JDK version with
selected_jdk_version = jdk_from_jar or existing if existing else "8"
Python parses this as (jdk_from_jar or existing) if existing else "8", so whenever the database has no recorded language_version, the JDK version just read from the Maven Central JAR is discarded and the build spec says Java 8, whatever the JAR was built with. The comment above the line describes the intended order, JAR first, then the existing value, then the default.
Reproduces on main at 16c6a1e: with language_version=[] and a JAR reporting 17, resolve_fields leaves language_version == ["8"]. A one-line fix with a parametrized test follows as a PR.
MavenBuildSpec.resolve_fieldsselects the JDK version withPython parses this as
(jdk_from_jar or existing) if existing else "8", so whenever the database has no recordedlanguage_version, the JDK version just read from the Maven Central JAR is discarded and the build spec says Java 8, whatever the JAR was built with. The comment above the line describes the intended order, JAR first, then the existing value, then the default.Reproduces on
mainat 16c6a1e: withlanguage_version=[]and a JAR reporting17,resolve_fieldsleaveslanguage_version == ["8"]. A one-line fix with a parametrized test follows as a PR.