From 74fe4c340162e973e86c0e405de915cea8c72ec4 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sun, 26 Oct 2014 02:22:50 +0100
Subject: Use ExceptionUtils.dumpStack(..) instead of Thread.dumpStack()

---
 src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java            | 5 +++--
 src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java    | 3 ++-
 .../jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java    | 5 +++--
 3 files changed, 8 insertions(+), 5 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/x11/glx')

diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
index 9631dbb5b..5f6960911 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -59,6 +59,7 @@ import jogamp.opengl.GLContextImpl;
 import jogamp.opengl.GLDrawableImpl;
 import jogamp.opengl.GLXExtensions;
 
+import com.jogamp.common.ExceptionUtils;
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.util.VersionNumber;
 import com.jogamp.gluegen.runtime.ProcAddressTable;
@@ -258,8 +259,8 @@ public class X11GLXContext extends GLContextImpl {
         ctx = _glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs);
     } catch (final RuntimeException re) {
         if(DEBUG) {
-          final Throwable t = new Throwable(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
-          t.printStackTrace();
+          System.err.println(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"));
+          ExceptionUtils.dumpThrowable("", re);
         }
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index 60e4438d0..65cb3c31d 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -72,6 +72,7 @@ import jogamp.opengl.GLDynamicLookupHelper;
 import jogamp.opengl.GLGraphicsConfigurationUtil;
 import jogamp.opengl.SharedResourceRunner;
 
+import com.jogamp.common.ExceptionUtils;
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.util.VersionNumber;
 import com.jogamp.nativewindow.x11.X11GraphicsDevice;
@@ -329,7 +330,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
                 System.err.println("Screen  : " + sr.screen);
                 System.err.println("Drawable: " + sr.drawable);
                 System.err.println("CTX     : " + sr.context);
-                Thread.dumpStack();
+                ExceptionUtils.dumpStack(System.err);
             }
 
             if (null != sr.context) {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
index 44479acc0..caa336d5a 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -49,6 +49,7 @@ import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
+import com.jogamp.common.ExceptionUtils;
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.nio.PointerBuffer;
 import com.jogamp.nativewindow.x11.X11GraphicsDevice;
@@ -375,7 +376,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         if ( 0 > chosenIndex ) {
             if (DEBUG) {
                 System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: failed, return null");
-                Thread.dumpStack();
+                ExceptionUtils.dumpStack(System.err);
             }
             return null;
         }
@@ -472,7 +473,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         if ( 0 > chosenIndex ) {
             if (DEBUG) {
                 System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: failed, return null");
-                Thread.dumpStack();
+                ExceptionUtils.dumpStack(System.err);
             }
             return null;
         }
-- 
cgit v1.2.3