You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/09/07 20:13:27 UTC
[GitHub] [netbeans] jlahoda commented on a change in pull request #3153: LSP Client Improvements (Foldmanager, Performance)
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists