JRuby

ByteList.endsWith fails on empty bytelist

Details

  • Description:
    Hide

    Test case:

        public void testEndsWithOnEmptyByteList() {
            ByteList blank = new ByteList();
            ByteList blankAndZeroLength = new ByteList(0);
            ByteList str = new ByteList("hello".getBytes());
    
            assertFalse(blank.endsWith(str));
            assertFalse(blankAndZeroLength.endsWith(str));
        }
    

    Result:

        [junit] Testcase: testEndsWithOnEmptyByteList(org.jruby.util.ByteListTest):	Caused an ERROR
        [junit] -5
        [junit] java.lang.ArrayIndexOutOfBoundsException: -5
        [junit] 	at org.jruby.util.ByteList.startsWith(ByteList.java:477)
        [junit] 	at org.jruby.util.ByteList.endsWith(ByteList.java:486)
        [junit] 	at org.jruby.util.ByteListTest.testEndsWithOnEmptyByteList(ByteListTest.java:303)
    

    Fix pending.

    Show
    Test case:
        public void testEndsWithOnEmptyByteList() {
            ByteList blank = new ByteList();
            ByteList blankAndZeroLength = new ByteList(0);
            ByteList str = new ByteList("hello".getBytes());
    
            assertFalse(blank.endsWith(str));
            assertFalse(blankAndZeroLength.endsWith(str));
        }
    
    Result:
        [junit] Testcase: testEndsWithOnEmptyByteList(org.jruby.util.ByteListTest):	Caused an ERROR
        [junit] -5
        [junit] java.lang.ArrayIndexOutOfBoundsException: -5
        [junit] 	at org.jruby.util.ByteList.startsWith(ByteList.java:477)
        [junit] 	at org.jruby.util.ByteList.endsWith(ByteList.java:486)
        [junit] 	at org.jruby.util.ByteListTest.testEndsWithOnEmptyByteList(ByteListTest.java:303)
    
    Fix pending.

Activity

Hide
Charles Oliver Nutter added a comment - 16/Apr/09 1:46 AM

Fixed in r9533, but leaving open for a ByteList release.

Show
Charles Oliver Nutter added a comment - 16/Apr/09 1:46 AM Fixed in r9533, but leaving open for a ByteList release.
Hide
Charles Oliver Nutter added a comment - 19/May/09 2:24 PM

There's another open issue calling for a ByteList release.

Show
Charles Oliver Nutter added a comment - 19/May/09 2:24 PM There's another open issue calling for a ByteList release.

People

Dates

  • Created:
    16/Apr/09 1:22 AM
    Updated:
    27/Oct/09 1:46 PM
    Resolved:
    19/May/09 2:24 PM