[OpenJDK 2D-Dev] Bug in sun.java2d.pisces.Stroker ?!

Josef Hahn mail at josef-hahn.de
Tue May 20 01:57:51 UTC 2008


Hi people,

i was not able to find your bugtracker, so i post it here:

the following code throws an exception iff antialiasing is activated.
imho it is a bug in
"sun.java2d.pisces.Stroker.finish(Stroker.java:698)". here, it divides
by the line length (which can be zero):

-------------------------------------------
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.JFrame;

public class Example {

	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.setSize(100, 100);
		frame.setVisible(true);
		Graphics2D g = (Graphics2D) frame.getGraphics();
		g.setRenderingHint(
			RenderingHints.KEY_ANTIALIASING,
			RenderingHints.VALUE_ANTIALIAS_ON);

		// here everything is fine
		g.drawOval(10, 10, 80, 80);

		// here it crashes with a divide by zero (only with
		// enabled antialiasing)
		g.drawOval(0, 0, 0, 0);		
	}
}

-------------------------------------------

ps: i'm using the openjdk, which is shipped with fedora 9.

-- 
Josef Alexander Hahn

Instant Messenging (per Jabber): josef.hahn at jabber.rwth-aachen.de
VoIP: sip:ProjectColeslaw at ekiga.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20080520/3fa6e54a/signature.asc>


More information about the 2d-dev mailing list