glazedlists/glazedlists — pull request #3 by cmadsen (2014-10-21 09:08:43+00:00)
Title: Workaround for GLAZEDLISTS-564/JDK-8054478

This is a workaround for https://java.net/jira/browse/GLAZEDLISTS-564 which is caused by https://bugs.openjdk.java.net/browse/JDK-8054478

The following test case will crashes on the following JDK's 1.7.51, 1.7.60, 1.8.05 and 1.8.25
```java
public class CrashBoyerMooreCaseInsensitiveTextSearchStrategy {
static void test(String s) {
BoyerMooreCaseInsensitiveTextSearchStrategy b = new BoyerMooreCaseInsensitiveTextSearchStrategy();
b.setSubtext(s);
b.indexOf("Saskatchewan Roughriders");
}
public static void main(String[] args) {
for (int i = 0; i < 10000000; i++) {
test("Sask");
test("S");
}
}
}
```
Moving `subtextPosition--` to the bottom of the while loop eliminates the crash.