Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java cmd] Make SelectCommand generic #5849

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

rzblue
Copy link
Member

@rzblue rzblue commented Oct 30, 2023

This allows users to use any type of map and selector without needing to explicitly match Map<Object, Command>

@rzblue rzblue requested review from a team as code owners October 30, 2023 16:48
@rzblue rzblue changed the title Make SelectCommand generic [java cmd] Make SelectCommand generic Oct 30, 2023
@PeterJohnson
Copy link
Member

PeterJohnson commented Oct 30, 2023

It's pretty clearly a breaking change... what does the error message look like if the <> isn't present at the use site?

@Starlight220
Copy link
Member

Starlight220 commented Oct 30, 2023

It should be a raw type usage warning -- old code should still compile (Shuffleboard's source code is full of these).

@rzblue
Copy link
Member Author

rzblue commented Oct 30, 2023

There's no error message at all when used in a robot project, since we don't enable warnings as errors. It will print a warning, and intellisense will yellow underline it with a recommendation to parameterize it, but neither affects the ability to build and deploy.
And there is no behavior breakage, since the implementation doesn't actually care what the object type is, and java will cast everything to Object internally.

@Starlight220 Starlight220 linked an issue Oct 30, 2023 that may be closed by this pull request
@PeterJohnson PeterJohnson merged commit a4a8ad9 into wpilibsuite:main Oct 30, 2023
26 checks passed
@rzblue rzblue deleted the selectcommand-generic branch October 31, 2023 22:11
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SelectCommand not working when Object is a String
3 participants