Correct heuristic for urls
@@ -166,20 +166,16 @@ public final class Tokenizer {
return tokens;
}
- @SuppressWarnings("fallthrough")
private boolean acceptApostropheAsWordCharacter(Index currentIndex) {
if ( ! (currentIndex.isUriIndex() || currentIndex.isHostIndex())) {
return true;
}
// this is a heuristic to check whether we probably have reached the end of an URL element
for (int i = tokens.size() - 1; i >= 0; --i) {
- Token lookAt = tokens.get(i);
- switch (lookAt.kind) {
+ switch (tokens.get(i).kind) {
case COLON:
- if (i == indexLastExplicitlyChangedAt) {
- return false;
- }
- // XXX was fallthrough intended here?
+ if (i == indexLastExplicitlyChangedAt) return false;
+ break;
case SPACE:
return true;
default:
