commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject Re: [lang] enum for Java Version [was svn commit: r1065174 - ...]
Date Thu, 01 Jan 1970 00:00:00 GMT
Hi Hen,

Henri Yandell wrote:

> The enum is less to do with Android and more to do with the float and
> int APIs being bizarre. The enum is to have something more useable.
> We could drop the enum and just go with String values.

or use methods. I can see Niall's point if you use the enum in a switch 
statement and suddenly not all values are any longer addressed. But with 
static methods, this is not the case:

class SystemUtils {

boolean isJava16() {
  return JavaVersion.atLeast(JavaVersion.VERSION_1_6);


However, I am not sure if we do us a favor with Android, if we don't mask 
its version i.e. do not return at least 1.5 compatibility. If a library uses 
this version check and an Android programmer wanted to use that library in 
his app, he has a problem. We created such a bad (Android) user experience 
in XStream and therefore I cannot recommend this approach at all.

- Jörg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message