diff options
author | Sven Gothel <[email protected]> | 2012-05-13 22:51:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-05-13 22:51:30 +0200 |
commit | a338d1c94617f923609619d4edde7e1b1084cad5 (patch) | |
tree | 0e5a4382268d7a60627c938f570523d1e0839b8e /src | |
parent | 212cd096e2c1d92b565cf60dd4c3714f59a07d9e (diff) |
Refine commit be7cac1713b166ca6578c685ec8a7231a8429919:
Throw ClassNotFoundException in Display/Screen/Window factory if neither custom
nor default class is available.
Suppress Warning of non existing custom class (in non DEBUG mode),
rely on later ClassNotFoundException (see above).
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/NewtFactory.java | 2 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/DisplayImpl.java | 3 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/ScreenImpl.java | 3 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 3 |
4 files changed, 10 insertions, 1 deletions
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java index 82f74e370..61dbfb34c 100644 --- a/src/newt/classes/com/jogamp/newt/NewtFactory.java +++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java @@ -63,8 +63,8 @@ public class NewtFactory { try { clazz = Class.forName(clazzName); } catch (Throwable t) { - System.err.println("Warning: Failed to find class <"+clazzName+">: "+t.getMessage()); if(DEBUG_IMPLEMENTATION) { + System.err.println("Warning: Failed to find class <"+clazzName+">: "+t.getMessage()); t.printStackTrace(); } } diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java index f2f35135a..a0bbcc264 100644 --- a/src/newt/classes/jogamp/newt/DisplayImpl.java +++ b/src/newt/classes/jogamp/newt/DisplayImpl.java @@ -70,6 +70,9 @@ public abstract class DisplayImpl extends Display { throw new RuntimeException("Unknown display type \"" + type + "\""); } } + if(null==displayClass) { + throw new ClassNotFoundException("Failed to find NEWT Display Class <"+type+".Display>"); + } return displayClass; } diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java index 72f1b5a2c..cf614b6f1 100644 --- a/src/newt/classes/jogamp/newt/ScreenImpl.java +++ b/src/newt/classes/jogamp/newt/ScreenImpl.java @@ -111,6 +111,9 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener { throw new RuntimeException("Unknown window type \"" + type + "\""); } } + if(null==screenClass) { + throw new ClassNotFoundException("Failed to find NEWT Screen Class <"+type+".Screen>"); + } return (Class<? extends Screen>)screenClass; } diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 143e7c1ed..074f635e4 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -170,6 +170,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer throw new NativeWindowException("Unknown window type \"" + type + "\""); } } + if(null==windowClass) { + throw new ClassNotFoundException("Failed to find NEWT Window Class <"+type+".Window>"); + } return windowClass; } |