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 2007/03/14 15:36:09 UTC
[jira] Closed: (HARMONY-1272) [classlib][html] Compatibility:
j.s.t.h.p.ContentModel structure is different from the RI structure
[ https://issues.apache.org/jira/browse/HARMONY-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Petrenko closed HARMONY-1272.
------------------------------------
> [classlib][html] Compatibility: j.s.t.h.p.ContentModel structure is different from the RI structure
> ---------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1272
> URL: https://issues.apache.org/jira/browse/HARMONY-1272
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Miguel Montes
> Assigned To: Alexey Petrenko
> Attachments: ContentModel_02.patch, test-HARMONY-1272.zip
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.