From 5e61bfb5d6be7d3a9942a9bde20bf1bc1b2e1883 Mon Sep 17 00:00:00 2001 From: Starlight220 <53231611+Starlight220@users.noreply.github.com> Date: Tue, 28 Mar 2023 12:35:17 +0300 Subject: [PATCH 1/2] use ConcurrentHashMap --- .../plugin/networktables/sources/NetworkTableSource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/sources/NetworkTableSource.java b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/sources/NetworkTableSource.java index 876df539d..e1cf6d02b 100644 --- a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/sources/NetworkTableSource.java +++ b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/sources/NetworkTableSource.java @@ -14,9 +14,9 @@ import edu.wpi.first.networktables.NetworkTableInstance; import java.util.EnumSet; -import java.util.HashMap; import java.util.Map; import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; /** * A source for data in network tables. Data can be a single value or a map of keys to values. @@ -28,7 +28,7 @@ */ public abstract class NetworkTableSource extends AbstractDataSource { - private static final Map sources = new HashMap<>(); + private static final Map sources = new ConcurrentHashMap<>(); protected final String fullTableKey; private int listenerUid = -1; From 09dd7b5b21a56619252ae45b5cc64beafda66940 Mon Sep 17 00:00:00 2001 From: Starlight220 <53231611+Starlight220@users.noreply.github.com> Date: Tue, 28 Mar 2023 13:05:58 +0300 Subject: [PATCH 2/2] bump version --- .../shuffleboard/plugin/networktables/NetworkTablesPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/NetworkTablesPlugin.java b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/NetworkTablesPlugin.java index 62a4ee55f..001e9c4f5 100644 --- a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/NetworkTablesPlugin.java +++ b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/NetworkTablesPlugin.java @@ -42,7 +42,7 @@ @Description( group = "edu.wpi.first.shuffleboard", name = "NetworkTables", - version = "2.3.1", + version = "2.3.2", summary = "Provides sources and widgets for NetworkTables" ) public class NetworkTablesPlugin extends Plugin {