Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-04-28 10:48:35 -0400
committerPaul Pazderski2019-04-28 10:48:55 -0400
commit72f672fe7e6becae36c083ab3f9162f47476b128 (patch)
treead64fe1307f7c68bc67c4579dcb67a4e15422331
parent33e75e385ad0cf1f967ae7cf69c8b5cfd4adc257 (diff)
downloadeclipse.platform.debug-72f672fe7e6becae36c083ab3f9162f47476b128.tar.gz
eclipse.platform.debug-72f672fe7e6becae36c083ab3f9162f47476b128.tar.xz
eclipse.platform.debug-72f672fe7e6becae36c083ab3f9162f47476b128.zip
Bug 546710 - [console] Unsynchronized lazy initialization in
ConsoleManager Change-Id: I58e441a03f73e6d1bab73408147bd17c1141d0ff Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
index 27b432e9b..7c27120ae 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -61,7 +61,7 @@ public class ConsoleManager implements IConsoleManager {
/**
* Console listeners
*/
- private ListenerList<IConsoleListener> fListeners = null;
+ private ListenerList<IConsoleListener> fListeners = new ListenerList<>();
/**
* List of registered consoles
@@ -168,9 +168,6 @@ public class ConsoleManager implements IConsoleManager {
* @param update the type of change
*/
public void notify(IConsole[] consoles, int update) {
- if (fListeners == null) {
- return;
- }
fChanged = consoles;
fType = update;
for (IConsoleListener iConsoleListener : fListeners) {
@@ -195,17 +192,12 @@ public class ConsoleManager implements IConsoleManager {
@Override
public void addConsoleListener(IConsoleListener listener) {
- if (fListeners == null) {
- fListeners = new ListenerList<>();
- }
fListeners.add(listener);
}
@Override
public void removeConsoleListener(IConsoleListener listener) {
- if (fListeners != null) {
- fListeners.remove(listener);
- }
+ fListeners.remove(listener);
}
@Override

Back to the top