mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Insert Locale.ROOT into all case change methods
This commit is contained in:
committed by
Kenzie Togami
parent
b47c70025e
commit
13a8c480e3
@ -31,6 +31,7 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
@ -161,7 +162,7 @@ public class TreeGenerator {
|
||||
*/
|
||||
@Nullable
|
||||
public static TreeType lookup(String name) {
|
||||
return lookup.get(name.toLowerCase());
|
||||
return lookup.get(name.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -60,7 +61,7 @@ public class LevenshteinDistance implements Function<String, Integer> {
|
||||
checkNotNull(baseString);
|
||||
this.caseSensitive = caseSensitive;
|
||||
this.replacePattern = replacePattern;
|
||||
baseString = caseSensitive ? baseString : baseString.toLowerCase();
|
||||
baseString = caseSensitive ? baseString : baseString.toLowerCase(Locale.ROOT);
|
||||
baseString = replacePattern != null ? replacePattern.matcher(baseString).replaceAll("") : baseString;
|
||||
this.baseString = baseString;
|
||||
}
|
||||
@ -79,7 +80,7 @@ public class LevenshteinDistance implements Function<String, Integer> {
|
||||
if (caseSensitive) {
|
||||
return distance(baseString, input);
|
||||
} else {
|
||||
return distance(baseString, input.toLowerCase());
|
||||
return distance(baseString, input.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,5 +190,5 @@ public class LevenshteinDistance implements Function<String, Integer> {
|
||||
// actually has the most recent cost counts
|
||||
return p[n];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user