Skip to content

Commit 11a232b

Browse files
kopporSiedlerchr
andauthored
alpha.2 should be upgradeable to alpha.3 (#14208)
Co-authored-by: Siedlerchr <[email protected]>
1 parent 0cd3219 commit 11a232b

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

jabgui/src/main/java/org/jabref/gui/help/VersionWorker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
import org.slf4j.LoggerFactory;
2020

2121
/**
22-
* This worker checks if there is a new version of JabRef available. If there is it will display a dialog to the user
22+
* This worker checks if there is a new version of JabRef available. If there is, it will display a dialog to the user
2323
* offering him multiple options to proceed (see changelog, go to the download page, ignore this version, and remind
2424
* later).
2525
* <p>
26-
* If the versions check is executed manually and this is the latest version it will also display a dialog to inform the
26+
* If the version check is executed manually and this is the latest version, it will also display a dialog to inform the
2727
* user.
2828
*/
2929
public class VersionWorker {

jablib/src/main/java/org/jabref/logic/util/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class Version {
2626

2727
private static final Version UNKNOWN_VERSION = new Version();
2828

29-
private final static Pattern VERSION_PATTERN = Pattern.compile("(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?(?<stage>-alpha|-beta)?(?<num>\\d+)?(?<dev>-?dev)?.*");
29+
private final static Pattern VERSION_PATTERN = Pattern.compile("(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?(?<stage>-alpha|-beta)?(?:[._]?(?<num>\\d+))?(?<dev>-?dev)?.*");
3030
private final static Pattern CI_SUFFIX_PATTERN = Pattern.compile("-ci\\.\\d+");
3131

3232
private static final String JABREF_GITHUB_RELEASES = "https://api.github.com/repos/JabRef/JabRef/releases";

jablib/src/test/java/org/jabref/logic/util/VersionTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@ void alphaShouldBeUpdatedToBeta() {
285285
assertTrue(alpha.shouldBeUpdatedTo(beta));
286286
}
287287

288+
@Test
289+
void alphaTwoShouldBeUpdatedToAlpha3() {
290+
Version alpha2 = Version.parse("6.0-alpha.2");
291+
Version alpha3 = Version.parse("6.0-alpha.3");
292+
assertTrue(alpha2.shouldBeUpdatedTo(alpha3));
293+
}
294+
288295
@Test
289296
void betaShouldBeUpdatedToStable() {
290297
Version beta = Version.parse("2.8-beta");

0 commit comments

Comments
 (0)