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

Avoid duplicate suppress warning suggestions through new API method. #3362

Merged

Conversation

rgrunber
Copy link
Contributor

@rgrunber rgrunber commented Jan 16, 2025

I don't think we are seeing these duplicate entries, so it's worth me having a quick look to see why that is.

Update:

It's because of

Set<ProposalKindWrapper> quickSet = new TreeSet<>(comparator);
quickSet.addAll(quickfixProposals);
proposals.addAll(quickSet);

private static class ChangeCorrectionProposalComparator implements Comparator<ProposalKindWrapper> {
@Override
public int compare(ProposalKindWrapper p1, ProposalKindWrapper p2) {
String k1 = p1.getKind();
String k2 = p2.getKind();
if (!StringUtils.isBlank(k1) && !StringUtils.isBlank(k2) && !k1.equals(k2)) {
return k1.compareTo(k2);
}
int r1 = p1.getProposal().getRelevance();
int r2 = p2.getProposal().getRelevance();
int relevanceDif = r2 - r1;
if (relevanceDif != 0) {
return relevanceDif;
}
return p1.getProposal().getName().compareToIgnoreCase(p2.getProposal().getName());
}
}

We remove duplicates on our end also

- Implement alreadyHasProposal to avoid duplicates

Signed-off-by: Roland Grunberg <[email protected]>
@rgrunber rgrunber added this to the End January 2025 milestone Jan 16, 2025
@rgrunber rgrunber self-assigned this Jan 16, 2025
@rgrunber rgrunber merged commit 2102508 into eclipse-jdtls:master Jan 16, 2025
7 checks passed
@rgrunber rgrunber deleted the fix-suppress-warnings-processor branch January 16, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant