mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-08-21 05:41:20 +02:00
Fix toLowerCase/toUpperCase locale sensitivity
This commit is contained in:
@@ -31,6 +31,8 @@ import net.luckperms.api.node.types.SuffixNode;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Represents a type of chat meta
|
||||
*/
|
||||
@@ -70,7 +72,7 @@ public enum ChatMetaType {
|
||||
private final NodeType<? extends ChatMetaNode<?, ?>> nodeType;
|
||||
|
||||
ChatMetaType(NodeType<? extends ChatMetaNode<?, ?>> nodeType) {
|
||||
this.name = nodeType.name().toLowerCase();
|
||||
this.name = nodeType.name().toLowerCase(Locale.ROOT);
|
||||
this.nodeType = nodeType;
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,7 @@ package net.luckperms.api.node.metadata;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
final class SimpleNodeMetadataKey<T> implements NodeMetadataKey<T> {
|
||||
@@ -34,7 +35,7 @@ final class SimpleNodeMetadataKey<T> implements NodeMetadataKey<T> {
|
||||
private final Class<T> type;
|
||||
|
||||
SimpleNodeMetadataKey(String name, Class<T> type) {
|
||||
this.name = name.toLowerCase();
|
||||
this.name = name.toLowerCase(Locale.ROOT);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,7 @@ package net.luckperms.api.query;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
final class SimpleOptionKey<T> implements OptionKey<T> {
|
||||
@@ -35,7 +36,7 @@ final class SimpleOptionKey<T> implements OptionKey<T> {
|
||||
private final int hashCode;
|
||||
|
||||
SimpleOptionKey(String name, Class<T> type) {
|
||||
this.name = name.toLowerCase();
|
||||
this.name = name.toLowerCase(Locale.ROOT);
|
||||
this.type = type;
|
||||
this.hashCode = Objects.hash(this.name, this.type); // cache hashcode
|
||||
}
|
||||
|
Reference in New Issue
Block a user