Throw AmbiguousNodeException for more ambiguous cases

This commit is contained in:
jmp 2020-10-26 12:29:13 -07:00 committed by Alexander Söderberg
parent 829c310872
commit 5e27148d82

View file

@ -729,7 +729,9 @@ public final class CommandTree<C> {
} }
final int size = node.children.size(); final int size = node.children.size();
for (final Node<CommandArgument<C, ?>> child : node.children) { for (final Node<CommandArgument<C, ?>> child : node.children) {
if (child.getValue() != null && !child.getValue().isRequired() && size > 1) { if (child.getValue() != null
&& !(child.getValue() instanceof StaticArgument)
&& size > 1) {
throw new AmbiguousNodeException( throw new AmbiguousNodeException(
node.getValue(), node.getValue(),
child.getValue(), child.getValue(),