classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Replace buggy java.awt.Polygon with GeneralPath frontend


From: Noa Resare
Subject: [cp-patches] Replace buggy java.awt.Polygon with GeneralPath frontend
Date: Sun, 07 Nov 2004 19:32:33 +0100

On my regressions list I have a few entries for contains() tests for
java.awt.Polygon. 

When looking at the code the contains() implementation seems fragile and
buggy. The changes checked in in march fixed some test cases and broke
som other.

Since this is not really my field I decided to try to route around the
problem instead of rewriting large parts of the class. So I rewrote
Polygon to be a frontend for GeneralPath. Sven was nice enough to fix
GeneralPath to be failure free for the test cases in about 10 minutes.

So, I propose the attached change.

Pros:

* Fixes 5 mauve failures in
mauve/gnu/testlet/java/awt/Polygon/contains.java

* The code is much easier to understand and is well maintained. Judging
from the cvs log on Polygon.java it doesn't seem actively maintained.

* According to Sven the contains algorithm in contains is a bit
incorrect. (In addition to the apparent bugs, i presume)

Cons:

* In theory a bit slower

* Polygon uses integer coordinates, which loose precision when cast to
float. 

/noa

-- 
nuclear cia fbi spy password code president bomb
F3C4 AC90 B885 FE15 344B  4D05 220B 7662 A190 6F09

Attachment: classpath-polygon.patch
Description: Text Data

Attachment: signature.asc
Description: Detta är en digitalt signerad meddelandedel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]