SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@ -3,6 +3,7 @@ package org.bukkit;
|
||||
import static org.bukkit.support.MatcherAssert.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -66,7 +67,7 @@ public class MaterialTest {
|
||||
@Test
|
||||
public void matchMaterialByLowerCaseAndSpaces() {
|
||||
for (Material material : Material.values()) {
|
||||
String name = material.toString().replaceAll("_", " ").toLowerCase(java.util.Locale.ENGLISH);
|
||||
String name = material.toString().replaceAll("_", " ").toLowerCase(Locale.ROOT);
|
||||
assertThat(Material.matchMaterial(name), is(material));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user