From 092149dc11509fd1fb31ba52a7dd14c76055b4e5 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Mon, 12 Aug 2024 02:07:43 -0400 Subject: [PATCH] [wpilib] Deprecate Resource --- wpilibc/src/main/native/include/frc/Resource.h | 3 ++- wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wpilibc/src/main/native/include/frc/Resource.h b/wpilibc/src/main/native/include/frc/Resource.h index 6d9dfa58500..ecc5bca5894 100644 --- a/wpilibc/src/main/native/include/frc/Resource.h +++ b/wpilibc/src/main/native/include/frc/Resource.h @@ -23,8 +23,9 @@ namespace frc { * The Resource class does not allocate the hardware channels or other * resources; it just tracks which indices were marked in use by Allocate and * not yet freed by Free. + * @deprecated Use the HandleResource classes instead */ -class Resource { +class [[deprecated("Use the HandleResource classes instead")]] Resource { public: virtual ~Resource() = default; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java index f4b04587ad4..ba97ca4d700 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java @@ -19,7 +19,10 @@ * created. Then, when the program actually starts - in the Robot constructor, all resources are * initialized. This ensures that the program is restartable in memory without having to * unload/reload. + * + * @deprecated Will be removed with no replacement. */ +@Deprecated(forRemoval = true, since = "2025") public final class Resource { private static Resource resourceList; private final boolean[] m_numAllocated;