Replace outdated Java collections (#508)

This commit is contained in:
Sam Carlberg
2019-08-27 01:47:18 -04:00
committed by Peter Johnson
parent 8993ce5bf1
commit 4b2b21d247
5 changed files with 23 additions and 103 deletions

View File

@@ -9,7 +9,7 @@ package edu.wpi.first.cameraserver;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
@@ -302,10 +302,10 @@ public final class CameraServer {
"PMD.NPathComplexity"})
private CameraServer() {
m_defaultUsbDevice = new AtomicInteger();
m_sources = new Hashtable<>();
m_sinks = new Hashtable<>();
m_fixedSources = new Hashtable<>();
m_tables = new Hashtable<>();
m_sources = new HashMap<>();
m_sinks = new HashMap<>();
m_fixedSources = new HashMap<>();
m_tables = new HashMap<>();
m_publishTable = NetworkTableInstance.getDefault().getTable(kPublishName);
m_nextPort = kBasePort;
m_addresses = new String[0];
@@ -616,7 +616,9 @@ public final class CameraServer {
// create a dummy CvSource
CvSource source = new CvSource(name, VideoMode.PixelFormat.kMJPEG, 160, 120, 30);
MjpegServer server = startAutomaticCapture(source);
m_fixedSources.put(server.getHandle(), source.getHandle());
synchronized (this) {
m_fixedSources.put(server.getHandle(), source.getHandle());
}
return server;
}