You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Denis Kishenko (JIRA)" <ji...@apache.org> on 2006/08/03 13:55:14 UTC

[jira] Created: (HARMONY-1059) [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE

[classlib][text]compatibility: createLineBidi(-1, 1) expected IAE
-----------------------------------------------------------------

                 Key: HARMONY-1059
                 URL: http://issues.apache.org/jira/browse/HARMONY-1059
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Denis Kishenko


RI throws IAE when input parameters of createLineBidi(int, int) are invalid while Harmony doesn't. 

Spec ----------------------------------------------------------
No throws 

Test ------------------------------------------------------------

import java.text.*;

public class bug9414 {
    public static void main(String[] args) {
        new Bidi("str", 1).createLineBidi(-1, 1);
    }
}

Output ---------------------------------------------------------

RI
java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
	at java.text.Bidi.createLineBidi(Bidi.java:286)
	at bug9414.main(bug9414.java:6)

Harmony
java.lang.RuntimeException: ICU Internal Error: 8
	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
	at java.text.Bidi.createLineBidi(Bidi.java:293)
	at bug9414.main(bug9414.java:6)


-- 
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-1059) [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE

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

Denis Kishenko updated HARMONY-1059:
------------------------------------

    Attachment: 1050-BidiTest.patch

junit patch

> [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE
> -----------------------------------------------------------------
>
>                 Key: HARMONY-1059
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1059
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Attachments: 1050-Bidi.patch, 1050-BidiTest.patch
>
>
> RI throws IAE when input parameters of createLineBidi(int, int) are invalid while Harmony doesn't. 
> Spec ----------------------------------------------------------
> No throws 
> Test ------------------------------------------------------------
> import java.text.*;
> public class bug9414 {
>     public static void main(String[] args) {
>         new Bidi("str", 1).createLineBidi(-1, 1);
>     }
> }
> Output ---------------------------------------------------------
> RI
> java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
> 	at java.text.Bidi.createLineBidi(Bidi.java:286)
> 	at bug9414.main(bug9414.java:6)
> Harmony
> java.lang.RuntimeException: ICU Internal Error: 8
> 	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
> 	at java.text.Bidi.createLineBidi(Bidi.java:293)
> 	at bug9414.main(bug9414.java:6)

-- 
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-1059) [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE

Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1059?page=comments#action_12425696 ] 
            
Denis Kishenko commented on HARMONY-1059:
-----------------------------------------

Paulex thanks for correction. You caught details which I missed =)
All works.

> [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE
> -----------------------------------------------------------------
>
>                 Key: HARMONY-1059
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1059
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Paulex Yang
>         Attachments: 1050-Bidi.patch, 1050-BidiTest.patch
>
>
> RI throws IAE when input parameters of createLineBidi(int, int) are invalid while Harmony doesn't. 
> Spec ----------------------------------------------------------
> No throws 
> Test ------------------------------------------------------------
> import java.text.*;
> public class bug9414 {
>     public static void main(String[] args) {
>         new Bidi("str", 1).createLineBidi(-1, 1);
>     }
> }
> Output ---------------------------------------------------------
> RI
> java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
> 	at java.text.Bidi.createLineBidi(Bidi.java:286)
> 	at bug9414.main(bug9414.java:6)
> Harmony
> java.lang.RuntimeException: ICU Internal Error: 8
> 	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
> 	at java.text.Bidi.createLineBidi(Bidi.java:293)
> 	at bug9414.main(bug9414.java:6)

-- 
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-1059) [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE

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

Paulex Yang reassigned HARMONY-1059:
------------------------------------

    Assignee: Paulex Yang

> [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE
> -----------------------------------------------------------------
>
>                 Key: HARMONY-1059
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1059
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Paulex Yang
>         Attachments: 1050-Bidi.patch, 1050-BidiTest.patch
>
>
> RI throws IAE when input parameters of createLineBidi(int, int) are invalid while Harmony doesn't. 
> Spec ----------------------------------------------------------
> No throws 
> Test ------------------------------------------------------------
> import java.text.*;
> public class bug9414 {
>     public static void main(String[] args) {
>         new Bidi("str", 1).createLineBidi(-1, 1);
>     }
> }
> Output ---------------------------------------------------------
> RI
> java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
> 	at java.text.Bidi.createLineBidi(Bidi.java:286)
> 	at bug9414.main(bug9414.java:6)
> Harmony
> java.lang.RuntimeException: ICU Internal Error: 8
> 	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
> 	at java.text.Bidi.createLineBidi(Bidi.java:293)
> 	at bug9414.main(bug9414.java:6)

-- 
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-1059) [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE

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

Denis Kishenko updated HARMONY-1059:
------------------------------------

    Attachment: 1050-Bidi.patch

source patch

> [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE
> -----------------------------------------------------------------
>
>                 Key: HARMONY-1059
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1059
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Attachments: 1050-Bidi.patch
>
>
> RI throws IAE when input parameters of createLineBidi(int, int) are invalid while Harmony doesn't. 
> Spec ----------------------------------------------------------
> No throws 
> Test ------------------------------------------------------------
> import java.text.*;
> public class bug9414 {
>     public static void main(String[] args) {
>         new Bidi("str", 1).createLineBidi(-1, 1);
>     }
> }
> Output ---------------------------------------------------------
> RI
> java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
> 	at java.text.Bidi.createLineBidi(Bidi.java:286)
> 	at bug9414.main(bug9414.java:6)
> Harmony
> java.lang.RuntimeException: ICU Internal Error: 8
> 	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
> 	at java.text.Bidi.createLineBidi(Bidi.java:293)
> 	at bug9414.main(bug9414.java:6)

-- 
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] Closed: (HARMONY-1059) [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE

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

Paulex Yang closed HARMONY-1059.
--------------------------------


Verified by Denis.

> [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE
> -----------------------------------------------------------------
>
>                 Key: HARMONY-1059
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1059
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Paulex Yang
>         Attachments: 1050-Bidi.patch, 1050-BidiTest.patch
>
>
> RI throws IAE when input parameters of createLineBidi(int, int) are invalid while Harmony doesn't. 
> Spec ----------------------------------------------------------
> No throws 
> Test ------------------------------------------------------------
> import java.text.*;
> public class bug9414 {
>     public static void main(String[] args) {
>         new Bidi("str", 1).createLineBidi(-1, 1);
>     }
> }
> Output ---------------------------------------------------------
> RI
> java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
> 	at java.text.Bidi.createLineBidi(Bidi.java:286)
> 	at bug9414.main(bug9414.java:6)
> Harmony
> java.lang.RuntimeException: ICU Internal Error: 8
> 	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
> 	at java.text.Bidi.createLineBidi(Bidi.java:293)
> 	at bug9414.main(bug9414.java:6)

-- 
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-1059) [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE

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

Paulex Yang resolved HARMONY-1059.
----------------------------------

    Resolution: Fixed

Denis, HARMONY-1031 and HARMONY-1059 patch applied together at revision r428634 with modifications, thanks a lot for the enhancement. About the modification, I removed the fail() statement in exception catching block, because we have made agreement on the list about this, I also modified the license to (2005, 2006) to reflect the update date, and I found that neighther requireBidi()'s implementation nor its test complies with RI, so I also modified them both. Please verify the problems are fully resolved  as you expected.

[1]
try{
   blabla
}catch(Exception e){
   fail()
}

> [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE
> -----------------------------------------------------------------
>
>                 Key: HARMONY-1059
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1059
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Paulex Yang
>         Attachments: 1050-Bidi.patch, 1050-BidiTest.patch
>
>
> RI throws IAE when input parameters of createLineBidi(int, int) are invalid while Harmony doesn't. 
> Spec ----------------------------------------------------------
> No throws 
> Test ------------------------------------------------------------
> import java.text.*;
> public class bug9414 {
>     public static void main(String[] args) {
>         new Bidi("str", 1).createLineBidi(-1, 1);
>     }
> }
> Output ---------------------------------------------------------
> RI
> java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
> 	at java.text.Bidi.createLineBidi(Bidi.java:286)
> 	at bug9414.main(bug9414.java:6)
> Harmony
> java.lang.RuntimeException: ICU Internal Error: 8
> 	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
> 	at java.text.Bidi.createLineBidi(Bidi.java:293)
> 	at bug9414.main(bug9414.java:6)

-- 
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-1059) [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE

Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1059?page=comments#action_12425531 ] 
            
Denis Kishenko commented on HARMONY-1059:
-----------------------------------------

I made more advanced testing  

Test -------------------------------------------------------------------

import java.text.*;

public class bug9414 {
    public static void main(String[] args) {
    	try {
            new Bidi("str", 1).createLineBidi(-1, 1);
    		System.err.println("failed 1");    		
    	} catch (IllegalArgumentException e) {
    		System.err.println("passed 1");    		
            e.printStackTrace();
    	} catch (Exception e) {
    		System.err.println("failed 1");
            e.printStackTrace();
    	}
    	
    	try {
            new Bidi("str", 1).createLineBidi(1, -1);
    		System.err.println("failed 2");    		
    	} catch (IllegalArgumentException e) {
    		System.err.println("passed 2");    		
            e.printStackTrace();
    	} catch (Exception e) {
    		System.err.println("failed 2");
            e.printStackTrace();
    	}
    	
    	try {
            new Bidi("str", 1).createLineBidi(-1, -1);
    		System.err.println("failed 3");    		
    	} catch (IllegalArgumentException e) {
    		System.err.println("passed 3");    		
            e.printStackTrace();
    	} catch (Exception e) {
    		System.err.println("failed 3");
            e.printStackTrace();
    	}

    	try {
            new Bidi("str", 1).createLineBidi(2, 1);
    		System.err.println("failed 4");    		
    	} catch (IllegalArgumentException e) {
    		System.err.println("passed 4");    		
            e.printStackTrace();
    	} catch (Exception e) {
    		System.err.println("failed 4");
            e.printStackTrace();
    	}

    	try {
            new Bidi("str", 1).createLineBidi(2, 4);
    		System.err.println("failed 5");    		
    	} catch (IllegalArgumentException e) {
    		System.err.println("passed 5");    		
            e.printStackTrace();
    	} catch (Exception e) {
    		System.err.println("failed 5");
            e.printStackTrace();
    	}
    	
    	try {
            new Bidi("str", 1).createLineBidi(2, 4);
    		System.err.println("failed 6");    		
    	} catch (IllegalArgumentException e) {
    		System.err.println("passed 6");    		
            e.printStackTrace();
    	} catch (Exception e) {
    		System.err.println("failed 6");
            e.printStackTrace();
    	}
    	
    }
}

Output -------------------------------------------------------------

RI
passed 1
java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
	at java.text.Bidi.createLineBidi(Bidi.java:286)
	at bug9414.main(bug9414.java:7)
passed 2
java.lang.IllegalArgumentException: range 1 to -1 is invalid for paragraph of length 3
	at java.text.Bidi.createLineBidi(Bidi.java:286)
	at bug9414.main(bug9414.java:18)
passed 3
java.lang.IllegalArgumentException: range -1 to -1 is invalid for paragraph of length 3
	at java.text.Bidi.createLineBidi(Bidi.java:286)
	at bug9414.main(bug9414.java:29)
passed 4
java.lang.IllegalArgumentException: range 2 to 1 is invalid for paragraph of length 3
	at java.text.Bidi.createLineBidi(Bidi.java:286)
	at bug9414.main(bug9414.java:40)
passed 5
java.lang.IllegalArgumentException: range 2 to 4 is invalid for paragraph of length 3
	at java.text.Bidi.createLineBidi(Bidi.java:286)
	at bug9414.main(bug9414.java:51)
passed 6
java.lang.IllegalArgumentException: range 2 to 4 is invalid for paragraph of length 3
	at java.text.Bidi.createLineBidi(Bidi.java:286)
	at bug9414.main(bug9414.java:62)

Harmony
failed 1
java.lang.RuntimeException: ICU Internal Error: 8
	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
	at java.text.Bidi.createLineBidi(Bidi.java:296)
	at bug9414.main(bug9414.java:7)
failed 2
java.lang.RuntimeException: ICU Internal Error: 1
	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
	at java.text.Bidi.createLineBidi(Bidi.java:296)
	at bug9414.main(bug9414.java:18)
failed 3
java.lang.RuntimeException: ICU Internal Error: 8
	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
	at java.text.Bidi.createLineBidi(Bidi.java:296)
	at bug9414.main(bug9414.java:29)
failed 4
java.lang.RuntimeException: ICU Internal Error: 1
	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
	at java.text.Bidi.createLineBidi(Bidi.java:296)
	at bug9414.main(bug9414.java:40)
failed 5
java.lang.RuntimeException: ICU Internal Error: 8
	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
	at java.text.Bidi.createLineBidi(Bidi.java:296)
	at bug9414.main(bug9414.java:51)
failed 6
java.lang.RuntimeException: ICU Internal Error: 8
	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
	at java.text.Bidi.createLineBidi(Bidi.java:296)
	at bug9414.main(bug9414.java:62)


> [classlib][text]compatibility: createLineBidi(-1, 1) expected IAE
> -----------------------------------------------------------------
>
>                 Key: HARMONY-1059
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1059
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>
> RI throws IAE when input parameters of createLineBidi(int, int) are invalid while Harmony doesn't. 
> Spec ----------------------------------------------------------
> No throws 
> Test ------------------------------------------------------------
> import java.text.*;
> public class bug9414 {
>     public static void main(String[] args) {
>         new Bidi("str", 1).createLineBidi(-1, 1);
>     }
> }
> Output ---------------------------------------------------------
> RI
> java.lang.IllegalArgumentException: range -1 to 1 is invalid for paragraph of length 3
> 	at java.text.Bidi.createLineBidi(Bidi.java:286)
> 	at bug9414.main(bug9414.java:6)
> Harmony
> java.lang.RuntimeException: ICU Internal Error: 8
> 	at org.apache.harmony.text.BidiWrapper.ubidi_setLine(BidiWrapper.java)
> 	at java.text.Bidi.createLineBidi(Bidi.java:293)
> 	at bug9414.main(bug9414.java:6)

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