Fix first call to ToolType.get always returning null (#5396)

This commit is contained in:
mariaum 2019-01-26 01:40:03 -02:00 committed by tterrag
parent 4db208332e
commit 2e1456517a

View file

@ -38,7 +38,7 @@ public final class ToolType
{
if (VALID_NAME.matcher(name).find())
throw new IllegalArgumentException("ToolType.create() called with invalid name: " + name);
return values.putIfAbsent(name, new ToolType(name));
return values.computeIfAbsent(name, k -> new ToolType(name));
}
private final String name;