wpilibsuite / allwpilib

Official Repository of WPILibJ and WPILibC
https://wpilib.org/
Other
1.04k stars 605 forks source link

Make usage of `Set` and `...` syntax more consistent #6642

Closed spacey-sooty closed 1 week ago

spacey-sooty commented 1 month ago

In many places (eg. Commands.java) things like Set<Command> and Set<Subsystem> are used inconsistently with Command... commands or Subsystem... subsystems. This should be fixed either by adding more overloads so as to support both or by removing some and adding others.

Starlight220 commented 1 month ago

One case I'm assuming you're referring to is Defer, which uses Set<Subsystem> so that not passing any requirements is explicit.

addRequirements has overloads for both, especially as getRequirements returns a Set.

What others are there?

KangarooKoala commented 1 month ago

The cases I could find:

Starlight220 commented 1 month ago

Given how trivial it is to convert between the two using Set.of/Set.toArray, I don't think we should duplicate everything for rare cases.

rzblue commented 1 week ago

Can this be closed?