Improper warning on calling getDisplaySystem(String)

Currently, DisplaySystem.getDisplaySystem(String) also 'set' new DisplaySystem.

If I set LWJGL DisplaySystem and call getDisplaySystem("LWJGL") instead of getDisplaySystem(),

it warns me "SystemProvider already set".

Equality check may be a solution to this.

But I think getter should do only getting things.



And SystemProvider must be set just once according to DisplaySystem.setSystemProvider() source code.

Then the method 'getDisplaySystem(String)' may not be necessary.



One more, if there is no registered SystemProvider, default LWJGLSystemProvider is created.

But it is not added to the cache variable 'systemProviderMap'.



Index: src/com/jme/system/DisplaySystem.java
===================================================================
--- src/com/jme/system/DisplaySystem.java   (revision 4048)
+++ src/com/jme/system/DisplaySystem.java   (working copy)
@@ -173,15 +173,8 @@
         // LWJGL issues with creating it afterwards.
         // FIXME What about the impact on other display systems?
         JoystickInput.get();
-
-        try {
-            setSystemProvider(getCachedSystemProvider(key));
-        }
-        catch (IllegalStateException alreadySet) {
-            LOGGER.warning(alreadySet.getMessage());
-        }
-
-        return getDisplaySystem();
+       
+        return getCachedSystemProvider(key).getDisplaySystem();
     }
 
     private static SystemProvider getCachedSystemProvider(String providerId) {
@@ -245,7 +238,7 @@
         // if none defined by Service.providers, use fallback default
         synchronized (DisplaySystem.class) {
             if (system == null) {
-                system = new LWJGLSystemProvider();
+               system = getCachedSystemProvider("LWJGL");
             }
            
             return system;

Actually, I found this patch is not backward compatible.

Almost all codes in jme doesn't use SystemProvider and just call getDisplaySystem() to set SystemProvider.

I'll drop this because of compatibility reason and actually it may not be important.

but someday it needs to be fixed. I think.