Skip to content

MavenBuildSpec discards the JDK version read from the JAR when no language version is recorded #1464

Description

@lenamonj

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions