You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Miguel Montes (JIRA)" <ji...@apache.org> on 2006/08/30 18:48:23 UTC

[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

[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

        

[jira] Assigned: (HARMONY-1350) [classlib][html] The method j.s.t.h.p.ContentModel.first() returns a value in cases in which it should return null

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1350?page=all ]

Paulex Yang reassigned HARMONY-1350:
------------------------------------

    Assignee: Paulex Yang

> [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
>         Assigned To: Paulex Yang
>         Attachments: ContentModel01.patch, 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

        

[jira] Resolved: (HARMONY-1350) [classlib][html] The method j.s.t.h.p.ContentModel.first() returns a value in cases in which it should return null

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1350?page=all ]

Paulex Yang resolved HARMONY-1350.
----------------------------------

    Resolution: Fixed

Miguel, sorry, it's my carelessness, actually the patch caused the original testFirst() fail, and I thought it can pass on RI. Today I looked at it closer, and found it didn't really pass on RI, because there was a workaround like this:(
        
       if (!SwingTestCase.isHarmony()) {
            return;
        }

Now I updated that tests and make it *really* pass on RI, and after applying your patch, this tests as well as the one you provided passed happily on Harmony. 

The patch, and the merged testcase, is applied at revision r450673, thank you for this enhancement, please verify the problem is fully resolved as you expected.


> [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
>         Assigned To: Paulex Yang
>         Attachments: ContentModel01.patch, 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

        

[jira] Commented: (HARMONY-1350) [classlib][html] The method j.s.t.h.p.ContentModel.first() returns a value in cases in which it should return null

Posted by "Miguel Montes (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1350?page=comments#action_12438097 ] 
            
Miguel Montes commented on HARMONY-1350:
----------------------------------------

I will check it. We tested on Linux, but that shouldn't be relevant. You mean that with the patch applied, the return value of the test case is not null?
In fact, it is related with HARMONY-1272, but the patch should work with the current structure. We have also a patch for  the proposed structure, and maybe they mixed up.

> [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
>         Assigned To: Paulex Yang
>         Attachments: ContentModel01.patch, 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

        

[jira] Updated: (HARMONY-1350) [classlib][html] The method j.s.t.h.p.ContentModel.first() returns a value in cases in which it should return null

Posted by "Miguel Montes (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1350?page=all ]

Miguel Montes updated HARMONY-1350:
-----------------------------------

    Attachment: ContentModel01.patch

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

        

[jira] Commented: (HARMONY-1350) [classlib][html] The method j.s.t.h.p.ContentModel.first() returns a value in cases in which it should return null

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1350?page=comments#action_12438006 ] 
            
Paulex Yang commented on HARMONY-1350:
--------------------------------------

Miguel, thank you for the jira and patch, but the test case you provided still fail on my WinXP with your patch, did I miss something? or it depends on HARMONY-1272? 

> [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
>         Assigned To: Paulex Yang
>         Attachments: ContentModel01.patch, 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

        

[jira] Commented: (HARMONY-1350) [classlib][html] The method j.s.t.h.p.ContentModel.first() returns a value in cases in which it should return null

Posted by "Miguel Montes (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1350?page=comments#action_12438242 ] 
            
Miguel Montes commented on HARMONY-1350:
----------------------------------------

Paulex (or is it Yang?), we have applied the patch on the last version available in svn, and it works just fine. We are using Linux, but I don't see why should this be an issue. 
Which test case are you using? It should be the one marked as "java code for harmony", which uses the current version of ContentModel. The other case is for the structure used in the RI (that is the difference reported in HARMONY-1272).

> [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
>         Assigned To: Paulex Yang
>         Attachments: ContentModel01.patch, 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