commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles <gil...@harfang.homelinux.org>
Subject Re: [lang]
Date Thu, 11 Jan 2018 08:52:46 GMT
On Wed, 10 Jan 2018 20:23:04 -0700, Gary Gregory wrote:
> On Wed, Jan 10, 2018 at 5:47 PM, Gilles 
> <gilles@harfang.homelinux.org>
> wrote:
>
>> On Wed, 10 Jan 2018 17:34:55 -0700, Gary Gregory wrote:
>>
>>> Hi All:
>>>
>>> I find myself writing a lot of this kind of code:
>>>
>>> if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)) ...
>>>
>>> and
>>>
>>>
>>> Assume.assumeTrue(SystemUtils.isJavaVersionAtLeast(JavaVersi
>>> on.JAVA_1_8));
>>>
>>> I think this would be more tidy:
>>>
>>> if (SystemUtils.isJavaVersionAtLeast8()) ...
>>>
>>> If this makes your skin crawl, please present a (technical) 
>>> argument
>>> against it...
>>>
>>> Gary
>>>
>>
>> Can't you do something like
>>
>> if (JavaVersion.isAtLeast(JavaVersion.JAVA_1_8)) ...
>>
>
> That would not compile, there is no static JavaVersion.isAtLeast() 
> method.

I rephrase:

Isn't it better (no bloating of a "Utils" class) to define a method
"isAtLeast" in class "JavaVersion" that would be used as the above?

Regards,
Gilles

>
> Gary
>
>>
>> ?
>>
>> Gilles


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message