Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect interpretation of trailling and leading spaces in version range parsing #1054

Open
hj-lorenz opened this issue Feb 18, 2025 · 0 comments
Assignees
Labels
bug Something isn't working core FileAccess, ProcessUtil, IdeContext, etc. dependency Tool dependencies (if tool A requires tool B)

Comments

@hj-lorenz
Copy link
Contributor

hj-lorenz commented Feb 18, 2025

Expected behavior

As a developer, I want the version range expression can be parsed correctly so that extra leading and trailling spaces won't cause problems.

Actual behavior

// this is acceptable, and it's actually fine
"versionRange": "[17, )"   (space between "," and ")")
"versionRange": "[17,21)"   (no leading or trailling spaces)

// this should also be acceptable but unfortunately you will encounter an incorrect interpretation
"versionRange": "[17,21 )"  (trailing space after "21")

From dependencies.json test with:

          "[2022-09,2023-09)": [
            {
              "tool": "java",
              "versionRange": "[17,21 )"
            }
          ],

we got this log:

Tool eclipse has 1 other tool(s) as dependency
Configured version of tool java is 11.0.26_4 but does not match version to install [17,21 ) - need to use different version from software repository.
Resolved version pattern [17,21 ) to version 21_35
Tool java has 0 other tool(s) as dependency
Version 21_35 of tool java is already installed at C:\projects\_ide\software\default\java\java\21_35
Version 2022-09 of tool eclipse is already installed at C:\projects\_ide\software\default\eclipse\eclipse\2022-09
Step 'Install eclipse' ended successfully.

It seems as if due to the extra space the max version was ignored in the version range.
This needs to be investigated.

Related issues

See PR #1020

Comments/Hints:

  • leading spaces probably actual not really a problem but should also be deleted for interpretation to be left/right uniform
  • Jörg: Maybe there is no bug in VersionRange but a bug in installToolDependencies that might just take the maximum/supremum of the range and then proceed with that version for the installation (21 -> 21_35). Further analysis and investigation required.

Affected version:

ide: 2025.02.001-beta-02_18_02-SNAPSHOT

@hj-lorenz hj-lorenz added the bug Something isn't working label Feb 18, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Feb 18, 2025
@hj-lorenz hj-lorenz moved this from 🆕 New to Refinement in IDEasy board Feb 18, 2025
@hj-lorenz hj-lorenz assigned hj-lorenz and hohwille and unassigned hj-lorenz Feb 18, 2025
@hj-lorenz hj-lorenz changed the title Trailling and leading spaces in version range parsing Incorrect interpretation of trailling and leading spaces in version range parsing Feb 18, 2025
@hohwille hohwille moved this from Refinement to 🆕 New in IDEasy board Feb 19, 2025
@hohwille hohwille added core FileAccess, ProcessUtil, IdeContext, etc. dependency Tool dependencies (if tool A requires tool B) labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core FileAccess, ProcessUtil, IdeContext, etc. dependency Tool dependencies (if tool A requires tool B)
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants