swagger-api / swagger-api/swagger-codegen

[Question]: java25 support or build-error

Open
#12,688 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Is this a bug or is java25 unsupported?

Hi,

I currently package swagger-codegen (3.0.77-1) like so, boiling down to:

mvn clean package

which currently is

$ mvn -version
Apache Maven 3.9.12 (848fbb4bf2d427b72bdb2471c22fced7ebd9a7a1)
Maven home: /usr/share/java/maven
Java version: 25.0.2, vendor: Arch Linux, runtime: /usr/lib/jvm/java-25-openjdk
Default locale: de_AT, platform encoding: UTF-8
OS name: "linux", version: "6.18.9-arch1-2", arch: "amd64", family: "unix"

however with swagger-codegen 3.0.78 I get the following error (x 2) during mvn package tests:

[ERROR] Failures: 
[ERROR]   ScalaCodegenTest.shouldCallFormatIdentifierOnGetModelName:27 Mockito 
Mockito cannot mock this class: class io.swagger.codegen.languages.ScalaClientCodegen.

If you're not sure why you're getting this error, please open an issue on GitHub.

[...]

You are seeing this disclaimer because Mockito is configured to create inlined mocks.
You can learn about inline mocks and their limitations under item #39 of the Mockito class javadoc.

Underlying exception : org.mockito.exceptions.base.MockitoException: Could not modify all classes 
  [class io.swagger.codegen.languages.AbstractScalaCodegen,
   class java.lang.Object,
   class io.swagger.codegen.languages.ScalaClientCodegen,
   class io.swagger.codegen.DefaultCodegen, 
   interface io.swagger.codegen.CodegenConfig]

(full log attached)

And to be honest, this is above my java/maven foo. It looks like Mockito cannot parse/dissasable some ScalaClientCodegen class due to too-new java-version?

So, is this a bug or should I package it with a java<=21 requirement? (could not find any info regarding java version)

Swagger Codegen Version

3.0.78

What Have You Tried?

building with java21 works.

Checklist

  • [ x] I have searched the existing issues and documentation.
  • [ x] I have provided enough context for maintainers to understand the question.
  • [ x] This is not a feature request or bug report.

makepkg.log

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with mvn clean package on Java 25 and compare it with the reported Java 21 result. Start with ScalaCodegenTest.shouldCallFormatIdentifierOnGetModelName and the attached makepkg.log; determine whether the Mockito failure is a Java 25 compatibility bug or whether the project documents a supported Java version and needs a packaging constraint.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, scala
Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.