Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 7546 invoked from network); 30 Aug 2006 16:51:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Aug 2006 16:51:43 -0000 Received: (qmail 58109 invoked by uid 500); 30 Aug 2006 16:51:43 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 58081 invoked by uid 500); 30 Aug 2006 16:51:43 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 58070 invoked by uid 99); 30 Aug 2006 16:51:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2006 09:51:43 -0700 X-ASF-Spam-Status: No, hits=1.6 required=10.0 tests=GAPPY_SUBJECT X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2006 09:51:42 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 516207142D5 for ; Wed, 30 Aug 2006 16:48:23 +0000 (GMT) Message-ID: <5473216.1156956503330.JavaMail.jira@brutus> Date: Wed, 30 Aug 2006 09:48:23 -0700 (PDT) From: "Miguel Montes (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Created: (HARMONY-1350) [classlib][html] The method j.s.t.h.p.ContentModel.first() returns a value in cases in which it should return null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [classlib][html] The method j.s.t.h.p.ContentModel.first() returns a value in cases in which it should return null ------------------------------------------------------------------------------------------------------------------ Key: HARMONY-1350 URL: http://issues.apache.org/jira/browse/HARMONY-1350 Project: Harmony Issue Type: Bug Components: Classlib Reporter: Miguel Montes Attachments: ContentModel01.patch The class ContentModel is a representation of a restricted BNF expression, for instance, (meta & base). The method first() returns the element that MUST be next. In the previous example, there is no such element. Both, meta and base, can be next. With this content model the RI returns null, buth the implementation in harmony returns 'base'. The test code provided is different for both implementations, because the internal representations are also different (issue HARMONY-1272) ==============================java code for harmony ============================ import java.io.IOException; import javax.swing.text.html.parser.*; public class TestContentModelHarmony { 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+ " First: "+model.first()); } } =============================java code for RI============================ import java.io.IOException; import javax.swing.text.html.parser.*; public class TestContentModelSun { public static void main(String[] args) throws IOException { DTD dtd = DTD.getDTD("tmp"); 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+ " First: "+model.first()); } } ===================================================================== Output $ java -showversion TestContentModelSun 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) First: null $/harmony-hdk-r431938/jdk/jre/bin/java -showversion TestContentModelHarmony 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 First: javax.swing.text.html.parser.Element[index=3,name=BASE,oStart=false,oEnd=false,inclusions=null,exclusions=null,type=19,content=null,atts=null,data=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