Login  Register

ArrayIndexOutOfBoundsException on Windows

Posted by NikolayMetchev on Jan 24, 2019; 5:08pm
URL: https://forum.jogamp.org/ArrayIndexOutOfBoundsException-on-Windows-tp4039424.html


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)