Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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 :
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.
Fixed in r9533, but leaving open for a ByteList release.