Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 3b27b51

Browse files
committed
Merge branch 'thatChadM-patch-1' into develop
2 parents d2f781b + 5bfefdd commit 3b27b51

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/universalJavaApplicationStub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ function get_comparable_java_version() {
477477
################################################################################
478478
function is_valid_requirement_pattern() {
479479
local java_req=$1
480-
java8pattern='1\.[4-8](\.0)?(\.0_[0-9]+)?[*+]?'
480+
java8pattern='1\.[4-8](\.[0-9]+)?(\.0_[0-9]+)?[*+]?'
481481
java9pattern='(9|1[0-9])(-ea|[*+]|(\.[0-9]+){1,2}[*+]?)?'
482482
# test matches either old Java versioning scheme (up to 1.8) or new scheme (starting with 9)
483483
if [[ ${java_req} =~ ^(${java8pattern}|${java9pattern})$ ]]; then

test/java-version-tester.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Tests for the functions used in universalJavaApplicationStub script
4-
# tofi86 @ 2018-07-29
4+
# tofi86 @ 2020-02-11
55

66

77

@@ -84,7 +84,7 @@ function get_comparable_java_version() {
8484
################################################################################
8585
function is_valid_requirement_pattern() {
8686
local java_req=$1
87-
java8pattern='1\.[4-8](\.0)?(\.0_[0-9]+)?[*+]?'
87+
java8pattern='1\.[4-8](\.[0-9]+)?(\.0_[0-9]+)?[*+]?'
8888
java9pattern='(9|1[0-9])(-ea|[*+]|(\.[0-9]+){1,2}[*+]?)?'
8989
# test matches either old Java versioning scheme (up to 1.8) or new scheme (starting with 9)
9090
if [[ ${java_req} =~ ^(${java8pattern}|${java9pattern})$ ]]; then
@@ -179,6 +179,7 @@ echo "Tests with Java 1.6:"
179179
testExtractMajor "1.6" "6"
180180
testExtractMajor "1.6+" "6"
181181
testExtractMajor "1.6.0" "6"
182+
testExtractMajor "1.6.2" "6"
182183
testExtractMajor "1.6.0_07" "6"
183184
testExtractMajor "1.6.0_45" "6"
184185
testExtractMajor "1.6.0_65-b14-468" "6"
@@ -328,6 +329,7 @@ testValidReqPattern "1.6.0_45" "0"
328329
testValidReqPattern "1.6.0_45+" "0"
329330
testValidReqPattern "1.6.0_100" "0"
330331
testValidReqPattern "1.6.0_100+" "0"
332+
testValidReqPattern "1.6.2" "0"
331333
echo ""
332334
echo "Tests with old version scheme (invalid requirements):"
333335
testValidReqPattern "1.2" "1"

0 commit comments

Comments
 (0)