Skip to content

Commit

Permalink
Remove the synchronized block
Browse files Browse the repository at this point in the history
  • Loading branch information
Paras committed Oct 4, 2024
1 parent 5f2b1d1 commit 013f639
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public final class ToolkitNotification extends AbstractNotificationPopup {
private final String description;
private Image infoIcon;
private static CopyOnWriteArrayList<ToolkitNotification> activeNotifications = new CopyOnWriteArrayList<>();
private static Object lock = new Object();
private static final int MAX_WIDTH = 400;
private static final int MIN_HEIGHT = 100;
private static final int PADDING_EDGE = 5;
Expand Down Expand Up @@ -81,9 +80,7 @@ protected void initializeBounds() {
}
getShell().setLocation(x, y);
getShell().setSize(size);
synchronized (lock) {
activeNotifications.add(this);
}
activeNotifications.add(this);
}

private Rectangle getPrimaryClientArea() {
Expand All @@ -109,9 +106,7 @@ private void repositionNotifications() {

@Override
public boolean close() {
synchronized (lock) {
activeNotifications.remove(this);
}
activeNotifications.remove(this);
repositionNotifications();
if (this.infoIcon != null && !this.infoIcon.isDisposed()) {
this.infoIcon.dispose();
Expand Down

0 comments on commit 013f639

Please sign in to comment.