You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sergey Krivenko (JIRA)" <ji...@apache.org> on 2007/01/23 16:37:49 UTC
[jira] Updated: (HARMONY-1743)
[classlib][swing]javax.swing.text.html.parser.DTD.getDTD(null) throws
unspecified IllegalArgumentException
[ https://issues.apache.org/jira/browse/HARMONY-1743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Krivenko updated HARMONY-1743:
-------------------------------------
Attachment: Harmony-1743-DTD.patch
The attached is a fix to the bug
> [classlib][swing]javax.swing.text.html.parser.DTD.getDTD(null) throws unspecified IllegalArgumentException
> ----------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1743
> URL: https://issues.apache.org/jira/browse/HARMONY-1743
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Priority: Minor
> Attachments: DTDTest.patch, Harmony-1743-DTD.patch
>
>
> Description:
> Compatibility issue.
> There is no mention of any exception except for IOException in the specification.
> Harmony throws IllegalArgumentException for DTD.getDTD(null) while RI throws NPE.
> The same issue is for DTD.putDTDHash(null,DTD) method.
> Test for reproducing:
> import junit.framework.TestCase;
> import javax.swing.text.html.parser.*;
> import java.io.*;
> public class test extends TestCase {
> public void testGetDTD_Null() throws IOException {
> try {
> DTD.getDTD(null);
> fail("NullPointerException is thrown");
> } catch (NullPointerException e) {
> //expected
> }
> }
> public void testPutDTDHash_Null_DTD() throws IOException {
> try {
> DTD.putDTDHash(null,DTD.getDTD("str"));
> fail("NullPointerException is thrown");
> } catch (NullPointerException e) {
> //expected
> }
> }
> }
> HARMONY output:
> =============
> 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 = r450941, (Sep 28 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .E.E
> Time: 0.032
> There were 2 errors:
> 1) testGetDTD_Null(test)java.lang.IllegalArgumentException: Name must be not null
> at javax.swing.text.html.parser.DTD.checkName(DTD.java:79)
> at javax.swing.text.html.parser.DTD.getDTD(DTD.java:63)
> at test.testGetDTD_Null(test.java:14)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> 2) testPutDTDHash_Null_DTD(test)java.lang.IllegalArgumentException: Name must benot null
> at javax.swing.text.html.parser.DTD.checkName(DTD.java:79)
> at javax.swing.text.html.parser.DTD.putDTDHash(DTD.java:75)
> at test.testPutDTDHash_Null_DTD(test.java:17)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> FAILURES!!!
> Tests run: 2, Failures: 0, Errors: 2
> SUN output:
> ========
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> ..
> Time: 0.01
> OK (2 test)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.