Fix first call to ToolType.get always returning null (#5396)
This commit is contained in:
parent
4db208332e
commit
2e1456517a
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ public final class ToolType
|
||||||
{
|
{
|
||||||
if (VALID_NAME.matcher(name).find())
|
if (VALID_NAME.matcher(name).find())
|
||||||
throw new IllegalArgumentException("ToolType.create() called with invalid name: " + name);
|
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;
|
private final String name;
|
||||||
|
|
Loading…
Reference in a new issue