Skip to content

Fix agent tool Codename One version selection#4965

Merged
shai-almog merged 1 commit into
codenameone:masterfrom
jsfan3:fix-agent-tool-version-sorting
May 16, 2026
Merged

Fix agent tool Codename One version selection#4965
shai-almog merged 1 commit into
codenameone:masterfrom
jsfan3:fix-agent-tool-version-sorting

Conversation

@jsfan3
Copy link
Copy Markdown
Contributor

@jsfan3 jsfan3 commented May 16, 2026

This fixes version discovery in the Codename One agent tools generated by Initializr.

The tools currently sort Maven artifact jar names lexicographically. This can select an older version such as 7.0.26 instead of a newer version such as 7.0.243, because string ordering does not match semantic/numeric version ordering.

This PR changes the sorting logic in:

  • IsApiSupported.java
  • IsCssValid.java

The tools now compare the Maven version directory numerically, so the latest installed Codename One version is selected correctly.

I also fixed IsCssValid.java to use getMethod("getTheme", ...) instead of getDeclaredMethod(...), because getTheme(String) is a public method inherited from Resources, not declared directly on MutableResource.

Verification:

  • IsApiSupported now selects java-runtime/7.0.243 correctly.
  • IsCssValid now selects codenameone-core/7.0.243 and java-runtime/7.0.243.
  • IsCssValid successfully validates a minimal valid CSS file.

@shai-almog shai-almog merged commit 87f8256 into codenameone:master May 16, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants