You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Loenko (JIRA)" <ji...@apache.org> on 2006/10/18 06:54:39 UTC
[jira] Closed: (HARMONY-1403) [classlib][awt] Arc2D doesn't throw
IAE for invalid type value
[ http://issues.apache.org/jira/browse/HARMONY-1403?page=all ]
Mikhail Loenko closed HARMONY-1403.
-----------------------------------
> [classlib][awt] Arc2D doesn't throw IAE for invalid type value
> --------------------------------------------------------------
>
> Key: HARMONY-1403
> URL: http://issues.apache.org/jira/browse/HARMONY-1403
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Mikhail Loenko
> Attachments: 1403-Arc2D tests.patch, 1403-Arc2D.patch
>
>
> Harmony implementation of Arc2D doesn't validate arc type value while RI does.
> =============== Test.java ==================
> import java.awt.geom.*;
> public class Test {
> public static void main(String[] argv) {
> Arc2D arc;
> try {
> System.err.println("double");
> arc = new Arc2D.Double(1, 2, 3, 4, 5, 6, 17);
> } catch (IllegalArgumentException e) {
> e.printStackTrace();
> }
> try {
> System.err.println("float");
> arc = new Arc2D.Float(1, 2, 3, 4, 5, 6, -13);
> } catch (IllegalArgumentException e) {
> e.printStackTrace();
> }
> try {
> System.err.println("double.setarc");
> arc = new Arc2D.Double(1, 2, 3, 4, 5, 6, 0);
> arc.setArcType(11);
> } catch (IllegalArgumentException e) {
> e.printStackTrace();
> }
> try {
> System.err.println("float.setarc");
> arc = new Arc2D.Float(1, 2, 3, 4, 5, 6, 0);
> arc.setArcType(11);
> } catch (IllegalArgumentException e) {
> e.printStackTrace();
> }
> }
> }
> RI Output ==========================
> double
> java.lang.IllegalArgumentException: invalid type for Arc: 17
> at java.awt.geom.Arc2D.setArcType(Arc2D.java:872)
> at java.awt.geom.Arc2D.<init>(Arc2D.java:570)
> at java.awt.geom.Arc2D$Double.<init>(Arc2D.java:381)
> at Test.main(Test.java:8)
> float
> java.lang.IllegalArgumentException: invalid type for Arc: -13
> at java.awt.geom.Arc2D.setArcType(Arc2D.java:872)
> at java.awt.geom.Arc2D.<init>(Arc2D.java:570)
> at java.awt.geom.Arc2D$Float.<init>(Arc2D.java:131)
> at Test.main(Test.java:14)
> double.setarc
> java.lang.IllegalArgumentException: invalid type for Arc: 11
> at java.awt.geom.Arc2D.setArcType(Arc2D.java:872)
> at Test.main(Test.java:21)
> float.setarc
> java.lang.IllegalArgumentException: invalid type for Arc: 11
> at java.awt.geom.Arc2D.setArcType(Arc2D.java:872)
> at Test.main(Test.java:28)
> Harmony Output ====================
> double
> float
> double.setarc
> float.setarc
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira