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

fix issue with getReplacement when version is empty string #26

Merged
merged 2 commits into from
Feb 8, 2023

Conversation

bjlaub
Copy link
Contributor

@bjlaub bjlaub commented Feb 8, 2023

It is possible that JakartaPackageAlignmentPlugin will call getReplacement with an empty string for the version. Previously, this code would erroneously return a replacement version because the comparator for ComparableVersion returns -1 when an empty string is compared with the maximum Jakarta version.

To address that, only look for a replacement when the version is non-null and non-empty.

Fixes #25

It is possible that JakartaPackageAlignmentPlugin will call
getReplacement with an empty string for the version. Previously, this
code would erroneously return a replacement version because the
comparator for ComparableVersion returns -1 when an empty string is
compared with the maximum Jakarta version.

To address that, only look for a replacement when the version is
non-null and non-empty.

Fixes #25
@changelog-app
Copy link

changelog-app bot commented Feb 8, 2023

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

fix issue with getReplacement when version is empty string

It is possible that JakartaPackageAlignmentPlugin will call getReplacement with an empty string for the version. Previously, this code would erroneously return a replacement version because the comparator for ComparableVersion returns -1 when an empty string is compared with the maximum Jakarta version.

To address that, only look for a replacement when the version is non-null and non-empty.

Fixes #25

Check the box to generate changelog(s)

  • Generate changelog entry

Copy link

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bulldozer-bot bulldozer-bot bot merged commit 995e82d into develop Feb 8, 2023
@bulldozer-bot bulldozer-bot bot deleted the blaub/fix-bug branch February 8, 2023 20:41
@svc-autorelease
Copy link
Collaborator

Released 0.4.0

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

Successfully merging this pull request may close these issues.

acceptable jakarta versions are erroneously replaced
4 participants