ByteList.endsWith fails on empty bytelist
-----------------------------------------
Key: JRUBY-3578
URL: http://jira.codehaus.org/browse/JRUBY-3578
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.2
Reporter: Charles Oliver Nutter
Assignee: Charles Oliver Nutter
Fix For: JRuby 1.3
Test case:
{noformat}
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));
}
{noformat}
Result:
{noformat}
[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)
{noformat}
Fix pending.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email