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

replace anonymous runnable class with lambda #1459

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -872,18 +872,14 @@ public void processEvent(VerifyEvent e) {
private void filterProposals() {
++ fInvocationCounter;
Control control= fViewer.getTextWidget();
control.getDisplay().asyncExec(new Runnable() {
long fCounter= fInvocationCounter;
@Override
public void run() {

if (fCounter != fInvocationCounter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition not being always true (before) but being always true (after)

return;
if (fInvocationProcessedCounter == fInvocationCounter)
return;
long fCounter= fInvocationCounter;
control.getDisplay().asyncExec(() -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not equivalent and will most likely cause bugs:

if (fCounter != fInvocationCounter)
return;
if (fInvocationProcessedCounter == fInvocationCounter)
return;

doFilterProposals();
}
doFilterProposals();
});
}

Expand Down
Loading