-
Notifications
You must be signed in to change notification settings - Fork 218
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
CollectionIncompatibleType bug in TerminalBuilder found by Error Prone #846
Comments
FYI I've not actually really directly run ErrorProne on JLine, but I'm building JLine in an internal build system at work where this pops up. I have created #847 re. actually adding ErrorProne to jline3 (as in, to the |
Yes, that is a bug. Even eclipse/vscode gives warning for it
Should be providers.sort(Comparator.comparing(l -> {
int idx = order.indexOf(l.name());
return idx >= 0 ? idx : Integer.MAX_VALUE;
})); and sorting starts to work. |
Nice, can one of you create a PR for that ? |
Yes, I can push a PR |
- Change provider sorting so that it uses provider name instead of provider object itself. This fixes getting a proper sorting list index to compare the order. Uses null check in case provider wrongly gives name as null. - Fixes jline#846
I'm running https://errorprone.info on this project, and it claims to have found a bug (line numbers are as of 3.23.0):
See https://errorprone.info/bugpattern/CollectionIncompatibleType ... @gnodet from a quick glance, I think this is a real bug, not a false positive, this does seem wrong (because it mixes
TerminalProvider
andString
):@cushon just FYI
The text was updated successfully, but these errors were encountered: