You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2006/11/15 14:49:38 UTC
[jira] Resolved: (HARMONY-2087) [classlib][html] Compatibilty.
j.s.t.h.p.DTD.getElement(int) returns null when the RI throws
ArrayIndexOutOfBoundsException
[ http://issues.apache.org/jira/browse/HARMONY-2087?page=all ]
Alexey Petrenko resolved HARMONY-2087.
--------------------------------------
Resolution: Fixed
The patch has been applied.
Miguel, please verify.
> [classlib][html] Compatibilty. j.s.t.h.p.DTD.getElement(int) returns null when the RI throws ArrayIndexOutOfBoundsException
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2087
> URL: http://issues.apache.org/jira/browse/HARMONY-2087
> Project: Harmony
> Issue Type: Bug
> Reporter: Miguel Montes
> Assigned To: Alexey Petrenko
> Attachments: DTD_05.patch, HARMONY-2087-Test.diff, TestDTDGetElementOutOfBounds.java
>
>
> The method j.s.t.h.p.DTD.getElement(int) gets an element from the DTD by index. When the argument is not a valid index, the RI throws ArrayIndexOutOfBoundsException, while the current implementation in Harmony returns null.
> =============== Java Code ==================
> import java.io.IOException;
> import javax.swing.text.html.parser.DTD;
> public class TestDTDGetElement {
> public static void main(String[] args) throws IOException {
> DTD dtd = DTD.getDTD("html");
> System.out.println(dtd.getElement(200));
> }
> }
> ==========================================
> $ java -showversion TestDTDGetElement
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 200 >= 15
> at java.util.Vector.elementAt(Vector.java:432)
> at javax.swing.text.html.parser.DTD.getElement(DTD.java:141)
> at TestDTDGetElement.main(TestDTDGetElement.java:6)
> $ /harmony-hdk-r468731/jdk/jre/bin/java -showversion TestDTDGetElement
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r468731, (Oct 28 2006), Linux/ia32/gcc 3.4.6, release build
> http://incubator.apache.org/harmony
> null
> Attached is a patch
--
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