harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miguel Montes (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1272) [classlib][html] Compatibility: j.s.t.h.p.ContentModel structure is different from the RI structure
Date Wed, 15 Nov 2006 01:34:41 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1272?page=all ]

Miguel Montes updated HARMONY-1272:
-----------------------------------

    Patch Info: [Patch Available]

> [classlib][html] Compatibility: j.s.t.h.p.ContentModel structure is different from the
RI structure
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1272
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1272
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Miguel Montes
>         Attachments: ContentModel_02.patch
>
>
> The class j.s.t.h.p.ContentModel is a representation of a ContentModel. Basically it
represents the content model as a binary tree. The structure of the tree created is different
from the structure created by the RI, so the same sequence of constructor calls produces different
trees.
> The following code produces the content model (meta & base) with the RI, and throws
an exception with Harmony
> =============TestContentModel.java==========
> import java.io.IOException;
> import javax.swing.text.html.parser.ContentModel;
> import javax.swing.text.html.parser.DTD;
> public class TestContentModel {
> 	public static void main(String[] args) throws IOException {
>         DTD dtd = DTD.getDTD("dummy");
>         
>         ContentModel model1 = new ContentModel (dtd.getElement(3));
>         ContentModel model2 = new ContentModel (0, dtd.getElement(2), model1);
>         ContentModel model = new ContentModel ('&', model2);
>         System.out.println("ContentModel: " + model);
> 	}
> }
> ==================================================
> [miguel@mp bin]$ java -showversion TestContentModel
> 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)
> ContentModel: (meta & base)
> [miguel@mp bin]$ /harmony/harmony-hdk-r431938/jdk/jre/bin/java -showversion TestContentModel
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r431938, (Aug 16 2006), Linux/ia32/gcc 3.4.6, release build
> http://incubator.apache.org/harmony
> java.lang.IllegalArgumentException: Illegal type, must be ,, |, &
>         at javax.swing.text.html.parser.ContentModel.checkBinaryType(ContentModel.java:310)
>         at javax.swing.text.html.parser.ContentModel.<init>(ContentModel.java:78)
>         at TestContentModel.main(TestContentModel.java:16)
> For generating the above content model with Harmony, the code is
> ==============TestContentModel2=====================
> import java.io.IOException;
> import javax.swing.text.html.parser.ContentModel;
> import javax.swing.text.html.parser.DTD;
> public class TestContentModel2 {
> 	public static void main(String[] args) throws IOException {
>         DTD dtd = DTD.getDTD("tmp");
>         
>         ContentModel model1 = new ContentModel (dtd.getElement(2));
>         ContentModel model2 = new ContentModel (dtd.getElement(3));
>         ContentModel model = new ContentModel ('&', model1, model2);
>         System.out.println("ContentModel: " + model);
> 	}
> }
> ========================================================
> [miguel@mp bin]$ /harmony/harmony-hdk-r431938/jdk/jre/bin/java -showversion TestContentModel2
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r431938, (Aug 16 2006), Linux/ia32/gcc 3.4.6, release build
> http://incubator.apache.org/harmony
> ContentModel: META&BASE
> The same code produces a different content model with the RI
> [miguel@mp bin]$ java -showversion TestContentModel2
> 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)
> ContentModel: (meta)

-- 
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

        

Mime
View raw message