After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 325444 - Constructors of org.gnu.gdk.Pixmap don't handle null pointers
Constructors of org.gnu.gdk.Pixmap don't handle null pointers
Status: RESOLVED FIXED
Product: java-gnome
Classification: Bindings
Component: GTK
mainline
Other All
: Normal normal
: ---
Assigned To: Ismael Juma
java-gnome bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2006-01-01 14:22 UTC by Emmanuel Rodriguez
Modified: 2006-01-09 06:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Constructos handle null arguments (8.13 KB, patch)
2006-01-01 14:25 UTC, Emmanuel Rodriguez
committed Details | Review

Description Emmanuel Rodriguez 2006-01-01 14:22:54 UTC
Please describe the problem:
The constructors described in the C API for the object GdkPixmap
(http://developer.gnome.org/doc/API/2.0/gdk/gdk-Bitmaps-and-Pixmaps.html) allow
some of their arguments to be NULL. 

When a null object is provided through the java API a null pointer it thrown.


Steps to reproduce:
1. Pixmap buffer = new Pixmap(null, 20, 20, 24);
2. 
3. 


Actual results:
A null pointer is thrown.

Expected results:
I expect a pixmap to be created.

Does this happen every time?
Yes

Other information:
A patch will follow.
Comment 1 Emmanuel Rodriguez 2006-01-01 14:25:43 UTC
Created attachment 56629 [details] [review]
Constructos handle null arguments

This patch modifies the constructors in order to handle null arguments where allowed by the C API.

The Javadocs for the constructors have been created.
Comment 2 Ismael Juma 2006-01-09 02:04:45 UTC
Thanks for the patch. I've applied it to CVS HEAD with one slight addition, there was a case where transparent_color could be NULL and this had not been accounted for in the patch.
Comment 3 Emmanuel Rodriguez 2006-01-09 06:30:08 UTC
It's a good thing that you checked!