Skip to content

Commit 013f639

Browse files
author
Paras
committed
Remove the synchronized block
1 parent 5f2b1d1 commit 013f639

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

plugin/src/software/aws/toolkits/eclipse/amazonq/util/ToolkitNotification.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public final class ToolkitNotification extends AbstractNotificationPopup {
2525
private final String description;
2626
private Image infoIcon;
2727
private static CopyOnWriteArrayList<ToolkitNotification> activeNotifications = new CopyOnWriteArrayList<>();
28-
private static Object lock = new Object();
2928
private static final int MAX_WIDTH = 400;
3029
private static final int MIN_HEIGHT = 100;
3130
private static final int PADDING_EDGE = 5;
@@ -81,9 +80,7 @@ protected void initializeBounds() {
8180
}
8281
getShell().setLocation(x, y);
8382
getShell().setSize(size);
84-
synchronized (lock) {
85-
activeNotifications.add(this);
86-
}
83+
activeNotifications.add(this);
8784
}
8885

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

110107
@Override
111108
public boolean close() {
112-
synchronized (lock) {
113-
activeNotifications.remove(this);
114-
}
109+
activeNotifications.remove(this);
115110
repositionNotifications();
116111
if (this.infoIcon != null && !this.infoIcon.isDisposed()) {
117112
this.infoIcon.dispose();

0 commit comments

Comments
 (0)