Bug 506 - NullPointerException when calling GLProfile.getDefault()
Summary: NullPointerException when calling GLProfile.getDefault()
Status: RESOLVED WORKSFORME
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: All all
: --- blocker
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2011-07-19 15:32 CEST by asarium
Modified: 2011-07-23 02:49 CEST (History)
2 users (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---


Attachments
Test log (29.47 KB, text/plain)
2011-07-19 15:32 CEST, asarium
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ..