From 0595a0009039abcfe68536e23c8a383c36000225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 26 Sep 2017 19:16:46 +0200 Subject: [PATCH] NOISSUE discourage using java > 8 by sorting it below everything else --- api/logic/java/JavaVersion.cpp | 13 +++++++++++-- 1 file 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;