OF-2941: Improve Version comparison that involve SNAPSHOTs #2643
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For certain versions of plugins, Openfire incorrectly identifies that an update is available.
When Openfire has installed
10.1.7.3-SNAPSHOT
it incorrectly identifies that version10.1.7.2
is an update.This seems to be caused by Openfire’s abuse of the 4th numeric value in a version. It was originally intended to be a classifier for the status (eg: ‘the second beta release’). When that 4th value is used as part of a four-digit version, things do not quite compare as expected.
To illustrate, compare these two scenarios. The numbers 3 and 2 are all stored in the same field, which gets interpreted differently.
10.1.7 beta 3
is older than10.1.7 release 2
10.1.7.3-SNAPSHOT
is expected to be newer than10.1.7.2
(release).Prior to this commit, Openfire did not flag that
10.1.7.3-SNAPSHOT
is newer than10.1.7.2
, which was causing confusion.In this commit, only the
SNAPSHOT
release status is now compared differently (as if the 4th value is part of the version string).