diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/DeferredCommand.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/DeferredCommand.java index 1d32012ab04..012c6b4f857 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/DeferredCommand.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/DeferredCommand.java @@ -11,9 +11,9 @@ import java.util.function.Supplier; /** - * Runs the command returned by the supplier when this command is initialized, and ends when it - * ends. Useful for performing runtime tasks before creating a new command. If this command is - * interrupted, it will cancel the command. + * Defers Command construction to runtime. Runs the command returned by the supplier when this + * command is initialized, and ends when it ends. Useful for performing runtime tasks before + * creating a new command. If this command is interrupted, it will cancel the command. * *

Note that the supplier must create a new Command each call. For selecting one of a * preallocated set of commands, use {@link SelectCommand}. @@ -72,6 +72,6 @@ public void end(boolean interrupted) { public void initSendable(SendableBuilder builder) { super.initSendable(builder); builder.addStringProperty( - "deferred", () -> m_command.equals(m_nullCommand) ? "null" : m_command.getName(), null); + "deferred", () -> m_command == m_nullCommand ? "null" : m_command.getName(), null); } } diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/DeferredCommand.h b/wpilibNewCommands/src/main/native/include/frc2/command/DeferredCommand.h index 534c422dbc7..bfabc82e467 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/DeferredCommand.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/DeferredCommand.h @@ -15,9 +15,10 @@ namespace frc2 { /** - * Runs the command returned by the supplier when this command is initialized, - * and ends when it ends. Useful for performing runtime tasks before creating a - * new command. If this command is interrupted, it will cancel the command. + * Defers Command construction to runtime. Runs the command returned by the + * supplier when this command is initialized, and ends when it ends. Useful for + * performing runtime tasks before creating a new command. If this command is + * interrupted, it will cancel the command. * * Note that the supplier must create a new Command each call. For * selecting one of a preallocated set of commands, use SelectCommand.