mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[commands] Undeprecate deferredProxy (#7417)
This changes the way deferred proxy is implemented to not use the deprecated ProxyCommand constructor. This function serves a good purpose that should be kept IMO. The constructor was confusing but this is just good syntactic sugar over `defer(() -> supplier.get().asProxy())`. Signed-off-by: Jade Turner <spacey-sooty@proton.me>
This commit is contained in:
@@ -198,15 +198,11 @@ public final class Commands {
|
||||
*
|
||||
* @param supplier the command supplier
|
||||
* @return the command
|
||||
* @deprecated The ProxyCommand supplier constructor has been deprecated in favor of directly
|
||||
* proxying a {@link DeferredCommand}, see ProxyCommand documentation for more details. As a
|
||||
* replacement, consider using `defer(supplier).asProxy()`.
|
||||
* @see ProxyCommand
|
||||
* @see DeferredCommand
|
||||
*/
|
||||
@Deprecated(since = "2025", forRemoval = true)
|
||||
@SuppressWarnings("removal")
|
||||
public static Command deferredProxy(Supplier<Command> supplier) {
|
||||
return new ProxyCommand(supplier);
|
||||
return defer(() -> supplier.get().asProxy(), Set.of());
|
||||
}
|
||||
|
||||
// Command Groups
|
||||
|
||||
Reference in New Issue
Block a user