ArrayIndexOutOfBoundsException on Windows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ArrayIndexOutOfBoundsException on Windows

NikolayMetchev

Line 170 and 171 of WindowsAWTWGLGraphicsConfigurationFactory.java look like will always throw an ArrayIndexOutOfBoundsException:

                if( 0 > gcIdx ) {
                    chosenGC = configs[gcIdx];

The > should probably be <= but I am only guessing.
and if the gcIdx is < 0 then it should probably set chosenGC as follows:
chosenGC = device.getDefaultConfiguration();


java.lang.ArrayIndexOutOfBoundsException: -1
        at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
        at com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
        at com.jogamp.nativewindow.awt.AWTGraphicsConfiguration.create(AWTGraphicsConfiguration.java:125)
        at com.jogamp.newt.awt.NewtCanvasAWT.addNotify(NewtCanvasAWT.java:590)
        at java.awt.Container.addNotify(Unknown Source)
        at java.awt.Panel.addNotify(Unknown Source)
        at java.awt.Container.addImpl(Unknown Source)
        at java.awt.Container.add(Unknown Source)
        at percentile.chronos.gui.view.chart3d.ChartPanel$1.done(ChartPanel.java:79)
        at javax.swing.SwingWorker$5.run(Unknown Source)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
        at sun.swing.AccumulativeRunnable.run(Unknown Source)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
        at javax.swing.Timer.fireActionPerformed(Unknown Source)
        at javax.swing.Timer$DoPostEvent.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Reply | Threaded
Open this post in threaded view
|

Re: ArrayIndexOutOfBoundsException on Windows

Wade Walker
Administrator
I think you're right that this is a bug in the code, but it shouldn't be getting that far (that failure is in a backup attempt). You might add -Dnativewindow.debug.GraphicsConfiguration to your command line and see why the first method didn't work.
Reply | Threaded
Open this post in threaded view
|

Re: ArrayIndexOutOfBoundsException on Windows

gouessej
Administrator
In reply to this post by NikolayMetchev
This is a known bug reported in our bug tracker:
https://jogamp.org/bugzilla/show_bug.cgi?id=1317
Julien Gouesse | Personal blog | Website