From d81d00ec47bda5f96ae8a4453f2a3ea2ee916b88 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 15 Apr 2016 15:08:45 +0300 Subject: [PATCH] autotools: Adapt to generified ListenerList. Neon generified ListenerList so cleanup here too. Change-Id: I569ddf79d4cc0e805da5083867f3c403aa6d79b9 Signed-off-by: Alexander Kurtakov --- .../cdt/autotools/ui/editors/AutoconfEditor.java | 9 ++++----- .../ui/editors/automake/MakefileEditor.java | 9 ++++----- .../ui/properties/AutotoolsConfigurePrefStore.java | 4 ++-- .../ui/properties/AutotoolsPropertyManager.java | 12 ++++++------ 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java index 45d0c458d07..bf29355fab8 100644 --- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java +++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 Red Hat, Inc. + * Copyright (c) 2006, 2016 Red Hat, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -111,7 +111,7 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro /** * Reconciling listeners */ - private ListenerList fReconcilingListeners= new ListenerList(ListenerList.IDENTITY); + private ListenerList fReconcilingListeners = new ListenerList<>(ListenerList.IDENTITY); public AutoconfEditor() { @@ -600,9 +600,8 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro */ public void reconciled() { // Notify listeners - Object[] listeners = fReconcilingListeners.getListeners(); - for (int i = 0, length= listeners.length; i < length; ++i) { - ((IReconcilingParticipant)listeners[i]).reconciled(); + for (IReconcilingParticipant listener : fReconcilingListeners) { + listener.reconciled(); } } diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java index 58b0d0e13a7..b125e98c9a0 100644 --- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java +++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -68,7 +68,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe * Reconciling listeners. * @since 3.0 */ - private ListenerList fReconcilingListeners= new ListenerList(ListenerList.IDENTITY); + private ListenerList fReconcilingListeners = new ListenerList<>(ListenerList.IDENTITY); MakefileSourceConfiguration getMakefileSourceConfiguration() { @@ -331,9 +331,8 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe @Override public void reconciled() { // Notify listeners - Object[] listeners = fReconcilingListeners.getListeners(); - for (int i = 0, length= listeners.length; i < length; ++i) { - ((IReconcilingParticipant)listeners[i]).reconciled(); + for (IReconcilingParticipant listener: fReconcilingListeners) { + listener.reconciled(); } } diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java index 0f0d54f8678..5833cc89ba1 100644 --- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java +++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 Red Hat Inc. + * Copyright (c) 2009, 2016 Red Hat Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -29,7 +29,7 @@ public class AutotoolsConfigurePrefStore implements IPreferenceStore { private static AutotoolsConfigurePrefStore instance = null; private ToolListElement selectedElement; private IAConfiguration cfg; - private ListenerList listenerList = new ListenerList(); + private ListenerList listenerList = new ListenerList<>(); private boolean isdirty; private AutotoolsConfigurePrefStore() { diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsPropertyManager.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsPropertyManager.java index 2fb3c62e6b6..a5584e4ce42 100644 --- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsPropertyManager.java +++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsPropertyManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 Red Hat Inc. + * Copyright (c) 2007, 2016 Red Hat Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,7 +19,7 @@ import org.eclipse.core.runtime.ListenerList; public class AutotoolsPropertyManager implements IPropertyChangeManager { private static volatile AutotoolsPropertyManager fInstance; - private Map projectList; + private Map> projectList; private AutotoolsPropertyManager() { projectList = new HashMap<>(); @@ -34,9 +34,9 @@ public class AutotoolsPropertyManager implements IPropertyChangeManager { @Override public synchronized void addProjectPropertyListener(IProject project, IProjectPropertyListener listener) { - ListenerList list = projectList.get(project); + ListenerList list = projectList.get(project); if (list == null) { - list = new ListenerList(); + list = new ListenerList<>(); projectList.put(project, list); } list.add(listener); @@ -44,7 +44,7 @@ public class AutotoolsPropertyManager implements IPropertyChangeManager { @Override public synchronized void notifyPropertyListeners(IProject project, String property) { - ListenerList list = projectList.get(project); + ListenerList list = projectList.get(project); if (list != null) { Object[] listeners = list.getListeners(); for (int i = 0; i < listeners.length; ++i) { @@ -56,7 +56,7 @@ public class AutotoolsPropertyManager implements IPropertyChangeManager { @Override public synchronized void removeProjectPropertyListener(IProject project, IProjectPropertyListener listener) { - ListenerList list = projectList.get(project); + ListenerList list = projectList.get(project); if (list != null) list.remove(listener); }