Index constructor arguments switched?
Closed this issue · 1 comments
I'm not on index, but when I used ./gradlew check
on my code before committing, it mentioned that some arguments may have been swapped in Subsystems.java
when we're initializing indexSubsystem
. Looking at the code, it seems that IndexSubsystem
expects ingestTopProximity
right before the ingest top color inputs, while Subsystems
places ingestTopProximity
right after the other proximity sensors. There's also a difference in the names of the motors- IndexSubsystem
uses firstMotor
and secondMotor
, while Subsystems
/Hardware
use ingestIndexMotor
and feedIndexMotor
- but that shouldn't be a bug.
I just want to bring this to attention, since it may cause severe headaches. If this has already been fixed, or it is not, in fact, a problem, please let me know.
If you're curious, here's gradle's output, excluding the file path (Sorry for the long lines):
warning: [ArgumentSelectionDefectChecker] The following arguments may have been swapped: 'hardware.ingestTopProximity' for formal parameter 'ingestBlueColor', 'hardware.ingestBlueColor' for formal parameter 'ingestRedColor', 'hardware.ingestRedColor' for formal parameter 'feederBlueColor', 'hardware.feederBlueColor' for formal parameter 'feederRedColor', 'hardware.feederRedColor' for formal parameter 'ingestTopProximity'. Either add clarifying `/* paramName= */` comments, or swap the arguments if that is what was intended
indexSubsystem = new IndexSubsystem(hardware.ingestIndexMotor, hardware.feederIndexMotor,
^
(see https://errorprone.info/bugpattern/ArgumentSelectionDefectChecker)
Did you mean 'hardware.ingestProximity, hardware.feederProximity, /* ingestBlueColor= */hardware.ingestTopProximity,' or 'hardware.ingestProximity, hardware.feederProximity, hardware.ingestBlueColor,'?
how did I accidentally self assign this