mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Use Array Constructor rather then new array to toArray (#1368)
A bit cleaner to use, and more standard for the current java. Still java 8 compatible.
This commit is contained in:
committed by
Peter Johnson
parent
c7118f8ade
commit
11e5faf469
@@ -129,7 +129,7 @@ public final class CameraServer {
|
||||
}
|
||||
}
|
||||
|
||||
return values.toArray(new String[0]);
|
||||
return values.toArray(String[]::new);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
|
||||
|
||||
@@ -152,7 +152,7 @@ public class SendableChooser<V> extends SendableBase {
|
||||
return m_defaultChoice;
|
||||
}, null);
|
||||
builder.addStringArrayProperty(OPTIONS, () -> {
|
||||
return m_map.keySet().toArray(new String[0]);
|
||||
return m_map.keySet().toArray(String[]::new);
|
||||
}, null);
|
||||
builder.addStringProperty(ACTIVE, () -> {
|
||||
m_mutex.lock();
|
||||
|
||||
Reference in New Issue
Block a user