From 0915b4f4c50d4a5cca60fda6893fa41ba1604340 Mon Sep 17 00:00:00 2001 From: Brian Matzon Date: Mon, 7 Feb 2005 18:38:54 +0000 Subject: [PATCH] cleanup --- src/java/org/lwjgl/Sys.java | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/java/org/lwjgl/Sys.java b/src/java/org/lwjgl/Sys.java index aa52589f..0a633a5d 100644 --- a/src/java/org/lwjgl/Sys.java +++ b/src/java/org/lwjgl/Sys.java @@ -47,22 +47,19 @@ import org.lwjgl.input.Mouse; */ public final class Sys { + /** Current version of library */ public static final String VERSION = "0.95"; /** The native library name */ private static final String LIBRARY_NAME = "lwjgl"; - /** The platform adapter class name */ - private static final String PLATFORM; - - /** - * Debug flag. - */ + /** Debug flag. */ public static final boolean DEBUG = Boolean.getBoolean("org.lwjgl.Sys.debug"); + + /** OS Name */ + private final static String OS_NAME = System.getProperty("os.name"); - /** - * The implementation instance to delegate platform specific behavior to - */ + /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; static { @@ -71,23 +68,20 @@ public final class Sys { String native_version = implementation.getNativeLibraryVersion(); if (!native_version.equals(VERSION)) throw new LinkageError("Version mismatch: jar version is '" + VERSION + - "', native libary version is '" + native_version + "'"); + "', native libary version is '" + native_version + "'"); implementation.setDebug(DEBUG); - - PLATFORM = System.getProperty("org.lwjgl.Sys.platform", "org.lwjgl.SwingAdapter"); } private static SysImplementation createImplementation() { String class_name; - String os_name = System.getProperty("os.name"); - if (os_name.startsWith("Linux")) { + if (OS_NAME.startsWith("Linux")) { class_name = "org.lwjgl.LinuxSysImplementation"; - } else if (os_name.startsWith("Windows")) { + } else if (OS_NAME.startsWith("Windows")) { class_name = "org.lwjgl.Win32SysImplementation"; - } else if (os_name.startsWith("Mac")) { + } else if (OS_NAME.startsWith("Mac")) { class_name = "org.lwjgl.MacOSXSysImplementation"; } else - throw new IllegalStateException("The platform " + os_name + " is not supported"); + throw new IllegalStateException("The platform " + OS_NAME + " is not supported"); try { Class impl_class = Class.forName(class_name); return (SysImplementation)impl_class.newInstance(); @@ -169,7 +163,6 @@ public final class Sys { title = ""; if (message == null) message = ""; - String osName = System.getProperty("os.name"); implementation.alert(title, message); if (grabbed) { Mouse.setGrabbed(true);