Trying to filter for armor fails because the IsFilter
filter has a string indexing bug. If the filter is just
a single [ character, it crashes trying to do a
substring to an invalid index.
The fix is quite simple. You don't need to use the two
argument substring(), just the one argument. Simply
replace line 11 with "name = query.substring(1);" and
I believe that there are other places that use the two
argument version unnecessariily, as well.
... and about a dozen more. Anything doing
"string.substring(1,string.length() - 1)" is probably
wrong, unless it really is trying to strip off the last
character. Most of them seem to be trying to strip off
starting characters only. If that is what you want,
then you should use the one argument
String.substring(int beginIndex) method.
Log in to post a comment.