Bug 177847 - In Java BufferedImage gets an exception when calling getGraphics
In Java BufferedImage gets an exception when calling getGraphics
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: java-1.4.2-gcj-compat (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Fitzsimmons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-15 09:13 EST by Dennis Payne
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-26 13:58:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dennis Payne 2006-01-15 09:13:45 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
I noticed that createImage doesn't create a BufferedImage so I modified my code to create a BufferedImage instead of using createImage.  Unfortunately this causes an exception when calling getGraphics.  I've included a simple example of the problem.

Version-Release number of selected component (if applicable):
libgcj-4.0.2-8.fc4

How reproducible:
Always

Steps to Reproduce:
1. Compile this program with gcj -C

import java.awt.image.BufferedImage;
import java.awt.*;

class TestMe
{
  public static void main(String [] args)
  {
    BufferedImage imgMonster = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);
    Graphics gImg = imgMonster.getGraphics();
    gImg.setColor(Color.white);
    gImg.fillRect(0, 0, 20, 20);
    gImg.dispose();
  }
}


2. Run it 'gij TestMe'
  

Actual Results:  Exception in thread "main" java.lang.UnsatisfiedLinkError: initState
   at gnu.java.awt.peer.gtk.GdkGraphics2D.initState(int[], int, int) (/usr/lib/lib-gnu-java-awt-peer-gtk.so.6.0.0)
   at gnu.java.awt.peer.gtk.GdkGraphics2D.GdkGraphics2D(java.awt.image.BufferedImage) (/usr/lib/lib-gnu-java-awt-peer-gtk.so.6.0.0)
   at gnu.java.awt.peer.gtk.GdkGraphicsEnvironment.createGraphics(java.awt.image.BufferedImage) (/usr/lib/lib-gnu-java-awt-peer-gtk.so.6.0.0)
   at java.awt.image.BufferedImage.createGraphics() (/usr/lib/libgcj.so.6.0.0)
   at java.awt.image.BufferedImage.getGraphics() (/usr/lib/libgcj.so.6.0.0)
   at TestMe.main(java.lang.String[]) (Unknown Source)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)


Expected Results:  Nothing.  It should run without error.

Additional info:
Comment 1 Thomas Fitzsimmons 2006-02-03 20:28:51 EST
Graphics2D requires the Cairo backend which we didn't enable for FC4 because
Cairo was missing.  I'll look into enabling it for FC5.
Comment 2 Thomas Fitzsimmons 2006-03-02 11:41:16 EST
I couldn't enable this in time for FC5 final.  I'll try to do a merge of the
updated GUI packages from GNU Classpath to libgcj, for a future FC5 gcc update.
Comment 3 Thomas Fitzsimmons 2006-07-26 13:58:09 EDT
Fixed in Rawhide by libgcj backport.

Note You need to log in before you can comment on or make changes to this bug.