Bug 1238 - Fix NPE for Window-Icon's PNGPixelRect for unresolved location, i.e. null URLConnections
Summary: Fix NPE for Window-Icon's PNGPixelRect for unresolved location, i.e. null URL...
Status: RESOLVED FIXED
Alias: None
Product: Newt
Classification: JogAmp
Component: core (show other bugs)
Version: 2.3.2
Hardware: pc_x86_64 linux
: --- normal
Assignee: Sven Gothel
URL:
Depends on: 1237
Blocks: 1199
  Show dependency treegraph
 
Reported: 2015-09-29 11:43 CEST by Xerxes Rånby
Modified: 2015-10-03 12:09 CEST (History)
0 users

See Also:
Type: DEFECT
SCM Refs:
24d30eec425ca6c62f72e7c218a9149777dbec52
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xerxes Rånby 2015-09-29 11:43:05 CEST
(11:37:22) xranby_f22: concrete example: i open gluegen, joal and jogl sourcetrees in eclipse
(11:37:30) xranby_f22: eclipse compiles all thre eprojects
(11:38:19) sgothel: I only use it for editing and maybe run a unit test, setup using JAR files
(11:38:28) xranby_f22: i select  jogamp.newt.driver.x11.X11UnderlayTracker and right click to "run as" a "java application"
(11:38:31) xranby_f22: then i hit  java.lang.NullPointerException
(11:38:31) xranby_f22: 	at jogamp.newt.driver.opengl.JoglUtilPNGIcon.arrayToX11BGRAImages(JoglUtilPNGIcon.java:49)
(11:38:31) xranby_f22: 	at jogamp.newt.driver.PNGIcon.arrayToX11BGRAImages(PNGIcon.java:76)
(11:38:31) xranby_f22: 	at jogamp.newt.driver.x11.WindowDriver.<clinit>(WindowDriver.java:80)
(11:38:31) xranby_f22: 	at jogamp.newt.driver.x11.DisplayDriver.initIDs0(Native Method)
(11:38:31) xranby_f22: 	at jogamp.newt.driver.x11.DisplayDriver.<clinit>(DisplayDriver.java:55)
(11:38:31) xranby_f22: 	at java.lang.Class.forName0(Native Method)
(11:38:31) xranby_f22: 	at java.lang.Class.forName(Class.java:264)
(11:38:31) xranby_f22: 	at com.jogamp.newt.NewtFactory.getCustomClass(NewtFactory.java:111)
(11:38:31) xranby_f22: 	at jogamp.newt.DisplayImpl.getDisplayClass(DisplayImpl.java:275)
(11:38:31) xranby_f22: 	at jogamp.newt.DisplayImpl.create(DisplayImpl.java:285)
(11:38:31) xranby_f22: 	at com.jogamp.newt.NewtFactory.createDisplay(NewtFactory.java:203)
(11:38:31) xranby_f22: 	at jogamp.newt.driver.x11.X11UnderlayTracker.<init>(X11UnderlayTracker.java:107)
(11:38:32) sgothel: but yes, I can check commandline w/ CLASSPATH instead of jars
(11:39:44) xranby_f22: hence JoglUtilPNGIcon can return a null resouce despite the checks currently placed
(11:40:20) xranby_f22: PNGIcon.java:76 have a check that the resouces should be avail
(11:40:24) xranby_f22: avail is true
(11:40:28) xranby_f22: but the resource is still null
(11:40:49) sgothel: not so nice :)
(11:41:10) sgothel: make it 2.3.2
Comment 1 Xerxes Rånby 2015-09-29 11:51:33 CEST
it is the line
            final URLConnection urlConn = resources.resolve(i);
in JoglUtilPNGIcon.java:48
that returns a null urlConn

resources is com.jogamp.common.util.IOUtil$ClassResources@5b6f7412
urlConn is null
Comment 2 Sven Gothel 2015-10-03 12:00:52 CEST
Testing w/ jogl/make/scripts/tests.sh USE_BUILDDIR=1,
discloses this issue - since the icons are available in jar only.

Handling all unresolved resources, i.e. null URLConnection,
is required.

Further more, the icon list passed via property 'newt.window.icons' 
shall be separated by comma as well.
This allows passing the list via scripts more conveniently.
Comment 3 Sven Gothel 2015-10-03 12:07:41 CEST
commit 24d30eec425ca6c62f72e7c218a9149777dbec52

    Bug 1238 - Fix NPE for Window-Icon's PNGPixelRect for unresolved location; Bug 1199 - Add setting to disable default window icons
    
    Bug 1238 - Fix NPE for Window-Icon's PNGPixelRect for unresolved location, i.e. null URLConnections
    
    Testing w/ jogl/make/scripts/tests.sh USE_BUILDDIR=1,
    discloses this issue - since the icons are available in jar only.
    
    Handling all unresolved resources, i.e. null URLConnection,
    is required.
    
    Further more, the icon list passed via property 'newt.window.icons'
    shall be separated by comma as well.
    This allows passing the list via scripts more conveniently.
      -Dnewt.window.icons="newt/data/jogamp-16x16.png,newt/data/jogamp-32x32.png"
    
    +++
    
    Bug 1199 - Add setting to disable default window icons
    
    This patch also allows disabling JogAmp's own window icons
    by simply defining a non-existing location, i.e.
      -Dnewt.window.icons="null,null"