From 2b9f42fa462a5af225bb2654361baacd05856c4d Mon Sep 17 00:00:00 2001
From: thatChadM <31999519+thatChadM@users.noreply.github.com>
Date: Mon, 10 Feb 2020 16:44:38 -0500
Subject: [PATCH 1/4] Update universalJavaApplicationStub

Tweak the java8pattern to accept more than just 1.[4-8].0 since I have an application that lists 1.4.2+ as the required version.
---
 src/universalJavaApplicationStub | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/universalJavaApplicationStub b/src/universalJavaApplicationStub
index 3670a65..2b000b6 100755
--- a/src/universalJavaApplicationStub
+++ b/src/universalJavaApplicationStub
@@ -477,7 +477,7 @@ function get_comparable_java_version() {
 ################################################################################
 function is_valid_requirement_pattern() {
 	local java_req=$1
-	java8pattern='1\.[4-8](\.0)?(\.0_[0-9]+)?[*+]?'
+	java8pattern='1\.[4-8](\.[0-9]+)?(\.0_[0-9]+)?[*+]?'
 	java9pattern='(9|1[0-9])(-ea|[*+]|(\.[0-9]+){1,2}[*+]?)?'
 	# test matches either old Java versioning scheme (up to 1.8) or new scheme (starting with 9)
 	if [[ ${java_req} =~ ^(${java8pattern}|${java9pattern})$ ]]; then

From 5bfefdd4f748ecc1994edf860148935e481b857c Mon Sep 17 00:00:00 2001
From: Tobias Fischer <tobias.carl.fischer@gmail.com>
Date: Tue, 11 Feb 2020 17:53:44 +0100
Subject: [PATCH 2/4] update tests for new Java 4-8 version number pattern

---
 test/java-version-tester.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/java-version-tester.sh b/test/java-version-tester.sh
index 0a70c8d..48151e7 100755
--- a/test/java-version-tester.sh
+++ b/test/java-version-tester.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # Tests for the functions used in universalJavaApplicationStub script
-# tofi86 @ 2018-07-29
+# tofi86 @ 2020-02-11
 
 
 
@@ -84,7 +84,7 @@ function get_comparable_java_version() {
 ################################################################################
 function is_valid_requirement_pattern() {
 	local java_req=$1
-	java8pattern='1\.[4-8](\.0)?(\.0_[0-9]+)?[*+]?'
+	java8pattern='1\.[4-8](\.[0-9]+)?(\.0_[0-9]+)?[*+]?'
 	java9pattern='(9|1[0-9])(-ea|[*+]|(\.[0-9]+){1,2}[*+]?)?'
 	# test matches either old Java versioning scheme (up to 1.8) or new scheme (starting with 9)
 	if [[ ${java_req} =~ ^(${java8pattern}|${java9pattern})$ ]]; then
@@ -179,6 +179,7 @@ echo "Tests with Java 1.6:"
 testExtractMajor "1.6" "6"
 testExtractMajor "1.6+" "6"
 testExtractMajor "1.6.0" "6"
+testExtractMajor "1.6.2" "6"
 testExtractMajor "1.6.0_07" "6"
 testExtractMajor "1.6.0_45" "6"
 testExtractMajor "1.6.0_65-b14-468" "6"
@@ -328,6 +329,7 @@ testValidReqPattern "1.6.0_45" "0"
 testValidReqPattern "1.6.0_45+" "0"
 testValidReqPattern "1.6.0_100" "0"
 testValidReqPattern "1.6.0_100+" "0"
+testValidReqPattern "1.6.2" "0"
 echo ""
 echo "Tests with old version scheme (invalid requirements):"
 testValidReqPattern "1.2" "1"

From 5f3466f4ec8ee6b6f1dc691c67664f107dc00367 Mon Sep 17 00:00:00 2001
From: Tobias Fischer <tobias.carl.fischer@gmail.com>
Date: Tue, 11 Feb 2020 17:59:31 +0100
Subject: [PATCH 3/4] Update dates and license

---
 LICENSE                          | 2 +-
 src/universalJavaApplicationStub | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/LICENSE b/LICENSE
index fe1f190..c58a05e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2014-2018 Tobias Fischer
+Copyright (c) 2014-2020 Tobias Fischer
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/src/universalJavaApplicationStub b/src/universalJavaApplicationStub
index 2b000b6..143237a 100755
--- a/src/universalJavaApplicationStub
+++ b/src/universalJavaApplicationStub
@@ -11,14 +11,14 @@
 #                                                                                #
 # @author    Tobias Fischer                                                      #
 # @url       https://github.com/tofi86/universalJavaApplicationStub              #
-# @date      2019-12-15                                                          #
+# @date      2020-02-11                                                          #
 # @version   3.0.5                                                               #
 #                                                                                #
 ##################################################################################
 #                                                                                #
 # The MIT License (MIT)                                                          #
 #                                                                                #
-# Copyright (c) 2014-2018 Tobias Fischer                                         #
+# Copyright (c) 2014-2020 Tobias Fischer                                         #
 #                                                                                #
 # Permission is hereby granted, free of charge, to any person obtaining a copy   #
 # of this software and associated documentation files (the "Software"), to deal  #

From a749fbbe52a4e2c79c55d57db43f1642bb0ca610 Mon Sep 17 00:00:00 2001
From: Tobias Fischer <tobias.carl.fischer@gmail.com>
Date: Thu, 19 Mar 2020 22:39:53 +0100
Subject: [PATCH 4/4] version 3.0.6

---
 CHANGELOG.md                     | 3 +++
 src/universalJavaApplicationStub | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9eacf75..818971f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
 ChangeLog
 ---------
 
+### v3.0.6 (2020-03-19)
+* Fixed an issue related to Java 4-8 version number detection (PR #81, Thanks to @thatChadM for his contribution)
+
 ### v3.0.5 (2019-12-15)
 * If java is missing, offer a choice between Oracle and AdoptOpenJDK download buttons (#78)
 * Support Array style `Java:Arguments` for Apple Plist style (#76)
diff --git a/src/universalJavaApplicationStub b/src/universalJavaApplicationStub
index 143237a..3525556 100755
--- a/src/universalJavaApplicationStub
+++ b/src/universalJavaApplicationStub
@@ -11,8 +11,8 @@
 #                                                                                #
 # @author    Tobias Fischer                                                      #
 # @url       https://github.com/tofi86/universalJavaApplicationStub              #
-# @date      2020-02-11                                                          #
-# @version   3.0.5                                                               #
+# @date      2020-03-19                                                          #
+# @version   3.0.6                                                               #
 #                                                                                #
 ##################################################################################
 #                                                                                #