Bug 506

Summary: NullPointerException when calling GLProfile.getDefault()
Product: [JogAmp] Jogl Reporter: asarium
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED WORKSFORME    
Severity: blocker CC: asarium, sgothel
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
Workaround: ---
Attachments: Test log

Description asarium 2011-07-19 15:32:12 CEST
When I try to get the default GLProfile using GLProfile.getDefault() a NullPointerException is thrown with the following stack trace:

Exception in thread "main" java.lang.NullPointerException
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1561)
	at javax.media.opengl.GLProfile.get(GLProfile.java:589)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:421)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:429)
	at test.Test.main(Test.java:10)

I'm using the latest autobuild and the following source code to provide a minimal example:

package test;

import javax.media.opengl.GLProfile;

public class Test
{

    public static void main(String[] args)
    {
        GLProfile.getDefault();
    }

}

I also attached the test results for my current system.
Comment 1 asarium 2011-07-19 15:32:40 CEST
Created attachment 261 [details]
Test log
Comment 2 Sven Gothel 2011-07-23 02:49:55 CEST
Tested on linux and windows, latest @ branch wip_mobile (will merge later next week to master)

Couldn't reproduce the bug.

Just in case you need to verify if a profile is available, or if any is available,
pls try the new GLProfile methods:
  boolean isAvailable(String profile)
  boolean isAnyAvailable()
those don't throw a GLException (not NPE) in case the GLProfile is not available
as the 'get' methods do ..