You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Svetlana Samoilenko (JIRA)" <ji...@apache.org> on 2006/10/06 12:33:20 UTC
[jira] Created: (HARMONY-1743)
[classlib][swing]javax.swing.text.html.parser.DTD.getDTD(null) throws
unspecified IllegalArgumentException
[classlib][swing]javax.swing.text.html.parser.DTD.getDTD(null) throws unspecified IllegalArgumentException
----------------------------------------------------------------------------------------------------------
Key: HARMONY-1743
URL: http://issues.apache.org/jira/browse/HARMONY-1743
Project: Harmony
Issue Type: Bug
Components: Classlib
Reporter: Svetlana Samoilenko
Priority: Minor
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.
-
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
[jira] Updated: (HARMONY-1743)
[classlib][swing]javax.swing.text.html.parser.DTD.getDTD(null) throws
unspecified IllegalArgumentException
Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1743?page=all ]
Svetlana Samoilenko updated HARMONY-1743:
-----------------------------------------
Attachment: DTDTest.patch
test
> [classlib][swing]javax.swing.text.html.parser.DTD.getDTD(null) throws unspecified IllegalArgumentException
> ----------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1743
> URL: http://issues.apache.org/jira/browse/HARMONY-1743
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Priority: Minor
> Attachments: DTDTest.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.
-
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