summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-09-26 19:16:46 +0200
committerPetr Mrázek <peterix@gmail.com>2017-09-26 19:16:46 +0200
commit0595a0009039abcfe68536e23c8a383c36000225 (patch)
tree392dbd7f6d6db2e758a52eab80cb0404712b312e
parent1a38587877a7bcfe015c885eda4a90dca8ac19f4 (diff)
downloadMultiMC-0595a0009039abcfe68536e23c8a383c36000225.tar
MultiMC-0595a0009039abcfe68536e23c8a383c36000225.tar.gz
MultiMC-0595a0009039abcfe68536e23c8a383c36000225.tar.lz
MultiMC-0595a0009039abcfe68536e23c8a383c36000225.tar.xz
MultiMC-0595a0009039abcfe68536e23c8a383c36000225.zip
NOISSUE discourage using java > 8 by sorting it below everything else
-rw-r--r--api/logic/java/JavaVersion.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/api/logic/java/JavaVersion.cpp b/api/logic/java/JavaVersion.cpp
index 8c1bb430..27050da3 100644
--- a/api/logic/java/JavaVersion.cpp
+++ b/api/logic/java/JavaVersion.cpp
@@ -60,9 +60,18 @@ bool JavaVersion::operator<(const JavaVersion &rhs)
{
if(m_parseable && rhs.m_parseable)
{
- if(m_major < rhs.m_major)
+ auto major = m_major;
+ auto rmajor = rhs.m_major;
+
+ // HACK: discourage using java 9
+ if(major > 8)
+ major = -major;
+ if(rmajor > 8)
+ rmajor = -rmajor;
+
+ if(major < rmajor)
return true;
- if(m_major > rhs.m_major)
+ if(major > rmajor)
return false;
if(m_minor < rhs.m_minor)
return true;