JRuby

ByteList.endsWith fails on empty bytelist

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.2
  • Fix Version/s: JRuby 1.3RC2
  • Component/s: Core Classes/Modules
  • Labels:
    None
  • Number of attachments :
    0

Description

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 -

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

Show
Charles Oliver Nutter added a comment - Fixed in r9533, but leaving open for a ByteList release.
Hide
Charles Oliver Nutter added a comment -

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

Show
Charles Oliver Nutter added a comment - There's another open issue calling for a ByteList release.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: