rename method

Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
Armin Schrenk
2025-12-21 11:00:01 +01:00
parent 0fa27f66c9
commit 7718445f7c
2 changed files with 4 additions and 2 deletions

View File

@@ -73,7 +73,9 @@ public class NotificationManager {
* @param target list where the filesystem events are copied to
* @return {@code true}, if elements were copied
*/
public boolean addTo(List<VaultEvent> target) {
public boolean appendToAndClear(List<VaultEvent> target) {
//it is not clear, if addAll iterates thread-safe over the pendingEvents
//hence we synchronize moving (copy then clear) and adding-single-element operations
synchronized (this) {
var result = target.addAll(pendingEvents);
pendingEvents.clear();

View File

@@ -43,7 +43,7 @@ public class FxNotificationManager {
private void checkForPendingNotifications() {
Platform.runLater(() -> {
if (notificationManager.addTo(eventsRequiringNotification)) {
if (notificationManager.appendToAndClear(eventsRequiringNotification)) {
applicationWindows.showNotification();
}
});