I don't meant to add any API for external users, but even JDK itself
needs some helper classes, and looks like sun.misc is the place.
In this case, there are too many places inside JDK that checks what the
current OS is. Some uses startsWith and some contains, some toLowerCase
and some toUppreCase, some might not be complete (no OS X?). It will be
nice if we have a safe and consistent way. It could even cover the
PropertyPermission needed.
--Max
On 6/24/13 4:13 PM, Alan Bateman wrote:
On 24/06/2013 05:57, Weijun Wang wrote:
I thought os.name for Solaris is 'Solaris' but it's actually 'SunOS'.
There is a helper class at
http://hg.openjdk.java.net/jdk8/tl/jdk/file/fd050ba1cf72/src/share/classes/sun/awt/OSInfo.java
This file uses
if (osName.contains("Solaris") || osName.contains("SunOS"))
Is it real that the value can be 'Solaris' also?
Can we use this class or make a copy (or move it) into sun.misc?
It's always been "SunOS".
Can you provide more context? The problem with adding or moving things
to sun.misc is that it gets really hard to change or remove things later.
-Alan