jlahoda commented on a change in pull request #3153:
URL: https://github.com/apache/netbeans/pull/3153#discussion_r703797803
##########
File path: ide/lsp.client/src/org/netbeans/modules/lsp/client/LSPBindings.java
##########
@@ -432,14 +447,19 @@ public void runOnBackground(Runnable r) {
}
private static void scheduleBackgroundTask(RequestProcessor.Task req) {
- WORKER.post(req, DELAY);
+ synchronized(WORKER_SCHEDULED) {
+ if(! WORKER_SCHEDULED.containsKey(req)) {
+ WORKER_SCHEDULED.put(req, null);
+ WORKER.post(req, DELAY);
Review comment:
Hmmm, I apparently forgot how this works - I somehow managed to think
`post` will defer the task when the same task is posted again, but that is
wrong. But I don't think there is a need to keep track of the tasks manually -
the correct idiom is (I hope I am right this time!) `req.schedule(DELAY);`.
Should take care of the re-scheduling/moving to a new time. Should work
similarly to the map (I hope!) but much simpler.
Sorry for the trouble.
##########
File path: ide/lsp.client/src/org/netbeans/modules/lsp/client/LSPBindings.java
##########
@@ -400,9 +403,17 @@ public InitializeResult getInitResult() {
return initResult;
}
- @SuppressWarnings("AccessingNonPublicFieldOfAnotherObject")
+ @SuppressWarnings({"AccessingNonPublicFieldOfAnotherObject",
"NestedSynchronizedStatement"})
Review comment:
Seems like a mistake in the hint, will try to take a look.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists