Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2013-11-21 23:36:40 +0000
committerBrian Vosburgh2015-07-16 18:54:45 +0000
commit4102983083ae008760876f72d6d31b01d3867a78 (patch)
tree26b461110035bb5b20b07ee8681a875394f2282c
parent1213b41849f7f7c1d398f2ee4108b89050b9dca5 (diff)
downloadwebtools.dali-4102983083ae008760876f72d6d31b01d3867a78.tar.gz
webtools.dali-4102983083ae008760876f72d6d31b01d3867a78.tar.xz
webtools.dali-4102983083ae008760876f72d6d31b01d3867a78.zip
rework ListenerList
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java7
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/NotifyingRepeatingJobCommandWrapper.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java6
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractSelectionProvider.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java20
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java18
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ListenerList.java64
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/AsynchronousNotifyingRepeatingCommandWrapper.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/NotifyingRepeatingCommandWrapper.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ChangeSupport.java13
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ModelTools.java47
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackJobSynchronizer.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackSynchronousSynchronizer.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java5
21 files changed, 135 insertions, 111 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java
index e140be0953..00c554427d 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java
@@ -41,6 +41,7 @@ import org.eclipse.jpt.common.core.gen.JptGenerator;
import org.eclipse.jpt.common.core.gen.LaunchConfigListener;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
import org.eclipse.jpt.common.utility.internal.ListenerList;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.osgi.service.datalocation.Location;
import org.osgi.framework.Bundle;
@@ -54,7 +55,7 @@ public abstract class AbstractJptGenerator implements JptGenerator
private final IJavaProject javaProject;
private final String projectLocation;
- private final ListenerList<LaunchConfigListener> launchConfigListenerList;
+ private final ListenerList<LaunchConfigListener> launchConfigListenerList = ModelTools.listenerList();
private boolean isDebug = false;
@@ -64,7 +65,6 @@ public abstract class AbstractJptGenerator implements JptGenerator
super();
this.javaProject = javaProject;
this.projectLocation = javaProject.getProject().getLocation().toString();
- this.launchConfigListenerList = this.buildLaunchConfigListenerList();
this.initialize();
}
@@ -441,9 +441,6 @@ public abstract class AbstractJptGenerator implements JptGenerator
this.isDebug = isDebug;
}
- private ListenerList<LaunchConfigListener> buildLaunchConfigListenerList() {
- return new ListenerList<LaunchConfigListener>(LaunchConfigListener.class);
- }
// ********** listener **********
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java
index fc7961cea0..99a30b2cde 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java
@@ -16,6 +16,7 @@ import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceModel;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragmentRoot;
import org.eclipse.jpt.common.utility.internal.ListenerList;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
/**
* JAR and external types
@@ -28,7 +29,7 @@ abstract class RootBinaryModel
private final AnnotationProvider annotationProvider;
/** listeners notified whenever the resource model changes */
- private final ListenerList<JptResourceModelListener> resourceModelListenerList = new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
+ private final ListenerList<JptResourceModelListener> resourceModelListenerList = ModelTools.listenerList();
// ********** construction **********
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java
index 81eaad7cf3..3d8475f389 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java
@@ -22,6 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
import org.eclipse.jpt.common.utility.command.CommandContext;
import org.eclipse.jpt.common.utility.internal.ListenerList;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
/**
* Java compilation unit (source file)
@@ -43,7 +44,7 @@ public abstract class SourceCompilationUnit
private final CommandContext modifySharedDocumentCommandContext;
/** listeners notified whenever the resource model changes */
- private final ListenerList<JptResourceModelListener> resourceModelListenerList;
+ private final ListenerList<JptResourceModelListener> resourceModelListenerList = ModelTools.listenerList();
// ********** construction **********
@@ -58,7 +59,6 @@ public abstract class SourceCompilationUnit
this.annotationProvider = annotationProvider;
this.annotationEditFormatter = annotationEditFormatter;
this.modifySharedDocumentCommandContext = modifySharedDocumentCommandContext;
- this.resourceModelListenerList = new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
}
void openCompilationUnit() {
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/NotifyingRepeatingJobCommandWrapper.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/NotifyingRepeatingJobCommandWrapper.java
index 4569c7d2b6..6bad23cc21 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/NotifyingRepeatingJobCommandWrapper.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/NotifyingRepeatingJobCommandWrapper.java
@@ -16,6 +16,7 @@ import org.eclipse.jpt.common.core.utility.command.JobCommandContext;
import org.eclipse.jpt.common.core.utility.command.NotifyingRepeatingJobCommand;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
import org.eclipse.jpt.common.utility.internal.ListenerList;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
/**
* @see org.eclipse.jpt.common.utility.internal.command.NotifyingRepeatingCommandWrapper
@@ -24,7 +25,7 @@ public class NotifyingRepeatingJobCommandWrapper
extends RepeatingJobCommandWrapper
implements NotifyingRepeatingJobCommand
{
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ private final ListenerList<Listener> listenerList = ModelTools.listenerList();
// ********** construction **********
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java
index 68909994a5..75c0e7d15d 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -31,6 +31,7 @@ import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver;
import org.eclipse.wst.common.internal.emf.resource.Renderer;
import org.eclipse.wst.common.internal.emf.resource.Translator;
@@ -69,8 +70,7 @@ public class JptXmlResource
protected final Translator rootTranslator;
- protected final ListenerList<JptResourceModelListener> resourceModelListenerList =
- new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
+ private final ListenerList<JptResourceModelListener> resourceModelListenerList = ModelTools.listenerList();
public JptXmlResource(URI uri, Renderer renderer, IContentType contentType, Translator rootTranslator) {
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java
index 1791561eb6..08506d72ea 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java
@@ -24,6 +24,7 @@ import org.eclipse.jpt.common.ui.jface.StructuredStateProvider;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.swt.graphics.Image;
import com.ibm.icu.text.MessageFormat;
@@ -68,7 +69,7 @@ abstract class AbstractItemStructuredStateProviderManager<V extends StructuredVi
private final ResourceManager resourceManager;
- private final ListenerList<ILabelProviderListener> listenerList = new ListenerList<ILabelProviderListener>(ILabelProviderListener.class);
+ private final ListenerList<ILabelProviderListener> listenerList = ModelTools.listenerList();
private final ExceptionHandler exceptionHandler;
/* private-protected */ final static JptCommonUiPlugin PLUG_IN = JptCommonUiPlugin.instance();
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractSelectionProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractSelectionProvider.java
index f4dd827af4..2862148d38 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractSelectionProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractSelectionProvider.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
/**
* Provide support for {@link ISelectionChangedListener selection change
@@ -26,7 +27,7 @@ public abstract class AbstractSelectionProvider
implements ISelectionProvider
{
private final ExceptionHandler exceptionHandler;
- private ListenerList<ISelectionChangedListener> listenerList = new ListenerList<ISelectionChangedListener>(ISelectionChangedListener.class);
+ private final ListenerList<ISelectionChangedListener> listenerList = ModelTools.listenerList();
protected AbstractSelectionProvider(ExceptionHandler exceptionHandler) {
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java
index eb5cea5010..010fde9abc 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java
@@ -16,6 +16,7 @@ import org.eclipse.jpt.common.ui.internal.swt.listeners.SWTListenerTools;
import org.eclipse.jpt.common.utility.internal.ArrayTools;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
@@ -105,14 +106,12 @@ public abstract class AbstractComboModelAdapter<E> {
/**
* Clients that are interested in selection change events.
*/
- @SuppressWarnings("unchecked")
- protected final ListenerList<SelectionChangeListener> selectionChangeListenerList;
+ protected final ListenerList<SelectionChangeListener> selectionChangeListenerList = ModelTools.listenerList();
/**
* Clients that are interested in double click events.
*/
- @SuppressWarnings("unchecked")
- protected final ListenerList<DoubleClickListener> doubleClickListenerList;
+ protected final ListenerList<DoubleClickListener> doubleClickListenerList = ModelTools.listenerList();
/**
* A listener that allows us to stop listening to stuff when the combo
@@ -160,9 +159,6 @@ public abstract class AbstractComboModelAdapter<E> {
this.comboHolder.addSelectionListener(this.comboSelectionListener);
}
- this.selectionChangeListenerList = this.buildSelectionChangeListenerList();
- this.doubleClickListenerList = this.buildDoubleClickListenerList();
-
this.comboDisposeListener = this.buildComboDisposeListener();
this.comboHolder.addDisposeListener(this.comboDisposeListener);
@@ -242,16 +238,6 @@ public abstract class AbstractComboModelAdapter<E> {
};
}
- @SuppressWarnings("unchecked")
- protected ListenerList<DoubleClickListener> buildDoubleClickListenerList() {
- return new ListenerList<DoubleClickListener>(DoubleClickListener.class);
- }
-
- @SuppressWarnings("unchecked")
- protected ListenerList<SelectionChangeListener> buildSelectionChangeListenerList() {
- return new ListenerList<SelectionChangeListener>(SelectionChangeListener.class);
- }
-
protected DisposeListener buildComboDisposeListener() {
return new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java
index d402a33992..f750d92f9c 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java
@@ -20,6 +20,7 @@ import org.eclipse.jpt.common.ui.internal.swt.listeners.SWTListenerTools;
import org.eclipse.jpt.common.utility.internal.ArrayTools;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
@@ -94,12 +95,12 @@ public class TableModelAdapter<E> {
/**
* Clients that are interested in selection change events.
*/
- protected final ListenerList<SelectionChangeListener<E>> selectionChangeListenerList;
+ protected final ListenerList<SelectionChangeListener<E>> selectionChangeListenerList = ModelTools.listenerList();
/**
* Clients that are interested in double click events.
*/
- protected final ListenerList<DoubleClickListener<E>> doubleClickListenerList;
+ protected final ListenerList<DoubleClickListener<E>> doubleClickListenerList = ModelTools.listenerList();
/**
* A listener that allows us to stop listening to stuff when the table
@@ -216,9 +217,6 @@ public class TableModelAdapter<E> {
this.tableSelectionListener = this.buildTableSelectionListener();
this.table.addSelectionListener(this.tableSelectionListener);
- this.selectionChangeListenerList = this.buildSelectionChangeListenerList();
- this.doubleClickListenerList = this.buildDoubleClickListenerList();
-
this.tableDisposeListener = this.buildTableDisposeListener();
this.table.addDisposeListener(this.tableDisposeListener);
@@ -299,16 +297,6 @@ public class TableModelAdapter<E> {
};
}
- @SuppressWarnings({"rawtypes", "unchecked"})
- protected ListenerList<DoubleClickListener<E>> buildDoubleClickListenerList() {
- return new ListenerList(DoubleClickListener.class);
- }
-
- @SuppressWarnings({"rawtypes", "unchecked"})
- protected ListenerList<SelectionChangeListener<E>> buildSelectionChangeListenerList() {
- return new ListenerList(SelectionChangeListener.class);
- }
-
protected DisposeListener buildTableDisposeListener() {
return new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ListenerList.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ListenerList.java
index cc870b3038..e2ebddcdc3 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ListenerList.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ListenerList.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.common.utility.internal;
-import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Iterator;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
@@ -20,44 +19,41 @@ import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
*
* @param <L> the type of listeners held by the list
*/
-public class ListenerList<L>
+public final class ListenerList<L>
implements Iterable<L>
{
/**
* We can mark this <code>volatile</code> and not synchronize the read
* methods because we never change the <em>contents</em> of the array.
*/
- private transient volatile L[] listeners;
+ @SuppressWarnings("unchecked")
+ private transient volatile L[] listeners = (L[]) ObjectTools.EMPTY_OBJECT_ARRAY;
/**
- * Construct a listener list for listeners of the specified type.
+ * Construct a listener list initialized with the specified listener.
*/
- public ListenerList(Class<L> listenerClass) {
- super();
- this.listeners = this.buildListenerArray(listenerClass, 0);
- }
-
- /**
- * Construct a listener list for listeners of the specified type.
- * Add the specified listener to the list.
- */
- public ListenerList(Class<L> listenerClass, L listener) {
- super();
+ @SuppressWarnings("unchecked")
+ public ListenerList(L listener) {
+ this();
if (listener == null) {
throw new NullPointerException();
}
- this.listeners = this.buildListenerArray(listenerClass, 1);
- this.listeners[0] = listener;
+ this.listeners = (L[]) new Object[] { listener };
}
- @SuppressWarnings("unchecked")
- private L[] buildListenerArray(Class<L> listenerClass, int length) {
- return (L[]) Array.newInstance(listenerClass, length);
+ /**
+ * Construct an empty listener list.
+ */
+ public ListenerList() {
+ super();
}
/**
- * Return the listeners.
+ * Return the listeners. The returned list will be a "snapshot" of the list
+ * of listeners at the time this method is called. There is no possibility
+ * of a {@link java.util.ConcurrentModificationException} with the returned
+ * iterator.
*/
public Iterator<L> iterator() {
return IteratorTools.iterator(this.listeners);
@@ -81,10 +77,14 @@ public class ListenerList<L>
* Add the specified listener to the listener list.
* Duplicate listeners are not allowed.
*/
- public synchronized void add(L listener) {
+ public void add(L listener) {
if (listener == null) {
throw new NullPointerException();
}
+ this.add_(listener);
+ }
+
+ private synchronized void add_(L listener) {
if (ArrayTools.contains(this.listeners, listener)) {
throw new IllegalArgumentException("duplicate listener: " + listener); //$NON-NLS-1$
}
@@ -95,10 +95,11 @@ public class ListenerList<L>
* Remove the specified listener from the listener list.
* Removing a listener that is not on the list is not allowed.
*/
- public synchronized void remove(L listener) {
- if (listener == null) {
- throw new NullPointerException();
- }
+ public void remove(L listener) {
+ this.remove_(listener);
+ }
+
+ private synchronized void remove_(L listener) {
int index = ArrayTools.indexOf(this.listeners, listener);
if (index == -1) {
throw new IllegalArgumentException("unregistered listener: " + listener); //$NON-NLS-1$
@@ -109,16 +110,9 @@ public class ListenerList<L>
/**
* Clear the listener list.
*/
- public synchronized void clear() {
- this.listeners = ArrayTools.clear(this.listeners);
- }
-
- /**
- * Return the type of listeners held by the listener list.
- */
@SuppressWarnings("unchecked")
- public Class<L> getListenerType() {
- return (Class<L>) this.listeners.getClass().getComponentType();
+ public synchronized void clear() {
+ this.listeners = (L[]) ObjectTools.EMPTY_OBJECT_ARRAY;
}
@Override
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/AsynchronousNotifyingRepeatingCommandWrapper.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/AsynchronousNotifyingRepeatingCommandWrapper.java
index 57ff46144d..7fddd1b1ba 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/AsynchronousNotifyingRepeatingCommandWrapper.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/AsynchronousNotifyingRepeatingCommandWrapper.java
@@ -15,6 +15,7 @@ import org.eclipse.jpt.common.utility.command.NotifyingRepeatingCommand;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
import org.eclipse.jpt.common.utility.internal.ConsumerThreadCoordinator;
import org.eclipse.jpt.common.utility.internal.ListenerList;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
/**
* Extend the asynchronous repeating command to notify listeners
@@ -28,7 +29,7 @@ public class AsynchronousNotifyingRepeatingCommandWrapper
extends AsynchronousRepeatingCommandWrapper
implements NotifyingRepeatingCommand
{
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ private final ListenerList<Listener> listenerList = ModelTools.listenerList();
/**
* This handles any exceptions thrown by the listeners.
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/NotifyingRepeatingCommandWrapper.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/NotifyingRepeatingCommandWrapper.java
index 149433c204..df13e091b9 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/NotifyingRepeatingCommandWrapper.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/NotifyingRepeatingCommandWrapper.java
@@ -14,6 +14,7 @@ import org.eclipse.jpt.common.utility.command.Command;
import org.eclipse.jpt.common.utility.command.CommandContext;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
import org.eclipse.jpt.common.utility.internal.ListenerList;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
/**
* <strong>NB:</strong> If another execution cycle is initiated while we are
@@ -35,7 +36,7 @@ public class NotifyingRepeatingCommandWrapper
extends RepeatingCommandWrapper
implements NotifyingRepeatingCommand
{
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ private final ListenerList<Listener> listenerList = ModelTools.listenerList();
// ********** construction **********
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ChangeSupport.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ChangeSupport.java
index d27bf080e9..269b4e9a2e 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ChangeSupport.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ChangeSupport.java
@@ -91,7 +91,6 @@ public class ChangeSupport {
* Construct support for the specified source of change events.
* The source cannot be <code>null</code>.
*/
- // TODO remove
public ChangeSupport(Model source) {
this(source, DefaultExceptionHandler.instance());
}
@@ -2715,21 +2714,23 @@ public class ChangeSupport {
* listeners.
*/
static abstract class AspectListenerListPair<L extends EventListener> {
+ private final Class<? extends EventListener> listenerClass;
final ListenerList<L> listenerList;
AspectListenerListPair(Class<L> listenerClass, L listener) {
super();
- this.listenerList = new ListenerList<L>(listenerClass, listener);
+ this.listenerClass = listenerClass;
+ this.listenerList = ModelTools.listenerList(listener);
}
abstract String getAspectName();
- boolean matches(Class<? extends EventListener> listenerClass, @SuppressWarnings("unused") String aspectName) {
- return this.listenerList.getListenerType() == listenerClass;
+ boolean matches(Class<? extends EventListener> listenerType, @SuppressWarnings("unused") String aspectName) {
+ return this.listenerClass == listenerType;
}
- boolean matches(Class<? extends EventListener> listenerClass) {
- return this.matches(listenerClass, null);
+ boolean matches(Class<? extends EventListener> listenerType) {
+ return this.matches(listenerType, null);
}
@Override
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ModelTools.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ModelTools.java
new file mode 100644
index 0000000000..d6d0563512
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/ModelTools.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.internal.model;
+
+import org.eclipse.jpt.common.utility.internal.ListenerList;
+
+public final class ModelTools {
+
+ // ********** listener list **********
+
+ /**
+ * Build a listener list that does not allow adding
+ * duplicate listeners or removing non-listeners.
+ * @param <L> the type of listeners held by the list
+ */
+ public static <L> ListenerList<L> listenerList() {
+ return new ListenerList<L>();
+ }
+
+ /**
+ * Build a listener list that does not allow adding
+ * duplicate listeners or removing non-listeners
+ * and is initialized with the specified listener.
+ * @param <L> the type of listeners held by the list
+ */
+ public static <L> ListenerList<L> listenerList(L listener) {
+ return new ListenerList<L>(listener);
+ }
+
+
+ // ********** constructor **********
+
+ /**
+ * Suppress default constructor, ensuring non-instantiability.
+ */
+ private ModelTools() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java
index 231f653bfc..dd379f48ff 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java
@@ -23,7 +23,7 @@ public class ListenerListTests extends TestCase {
}
public void testGetListeners() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
Listener listener1 = new LocalListener();
Listener listener2 = new LocalListener();
assertEquals(0, IterableTools.size(listenerList));
@@ -36,7 +36,7 @@ public class ListenerListTests extends TestCase {
}
public void testSize() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
Listener listener1 = new LocalListener();
Listener listener2 = new LocalListener();
assertEquals(0, listenerList.size());
@@ -47,7 +47,7 @@ public class ListenerListTests extends TestCase {
}
public void testIsEmpty() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
Listener listener1 = new LocalListener();
Listener listener2 = new LocalListener();
assertTrue(listenerList.isEmpty());
@@ -58,7 +58,7 @@ public class ListenerListTests extends TestCase {
}
public void testAdd_null() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
boolean exCaught = false;
try {
listenerList.add(null);
@@ -70,7 +70,7 @@ public class ListenerListTests extends TestCase {
}
public void testAdd_duplicate() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
Listener listener = new LocalListener();
listenerList.add(listener);
@@ -85,7 +85,7 @@ public class ListenerListTests extends TestCase {
}
public void testRemove() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
Listener listener1 = new LocalListener();
Listener listener2 = new LocalListener();
listenerList.add(listener1);
@@ -102,19 +102,19 @@ public class ListenerListTests extends TestCase {
}
public void testRemove_null() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
boolean exCaught = false;
try {
listenerList.remove(null);
fail("invalid listener list: " + listenerList);
- } catch (NullPointerException ex) {
+ } catch (IllegalArgumentException ex) {
exCaught = true;
}
assertTrue(exCaught);
}
public void testRemove_unregistered() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
Listener listener = new LocalListener();
listenerList.add(listener);
listenerList.remove(listener);
@@ -130,7 +130,7 @@ public class ListenerListTests extends TestCase {
}
public void testClear() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ ListenerList<Listener> listenerList = new ListenerList<Listener>();
Listener listener1 = new LocalListener();
Listener listener2 = new LocalListener();
listenerList.add(listener1);
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
index 5de2a2dab8..a3480813b2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html
@@ -22,6 +22,7 @@ import org.eclipse.jpt.common.core.JptResourceModel;
import org.eclipse.jpt.common.core.JptResourceModelListener;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.StringTools;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jpt.jaxb.core.internal.plugin.JptJaxbCorePlugin;
public abstract class AbstractJaxbFileResourceModel<S>
@@ -36,8 +37,7 @@ public abstract class AbstractJaxbFileResourceModel<S>
protected final S state;
- protected final ListenerList<JptResourceModelListener> resourceModelListenerList =
- new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
+ protected final ListenerList<JptResourceModelListener> resourceModelListenerList = ModelTools.listenerList();
protected AbstractJaxbFileResourceModel(IFile file) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackJobSynchronizer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackJobSynchronizer.java
index 8be934d081..593ed81c37 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackJobSynchronizer.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackJobSynchronizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -14,6 +14,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jpt.common.core.utility.command.JobCommand;
import org.eclipse.jpt.common.utility.internal.ListenerList;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jpt.jaxb.core.utility.CallbackSynchronizer;
/**
@@ -29,7 +30,7 @@ public class CallbackJobSynchronizer
extends JobSynchronizer
implements CallbackSynchronizer
{
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ private final ListenerList<Listener> listenerList = ModelTools.listenerList();
// ********** construction **********
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackSynchronousSynchronizer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackSynchronousSynchronizer.java
index 97b2b3a6d6..92a9a7504d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackSynchronousSynchronizer.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/utility/CallbackSynchronousSynchronizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -11,6 +11,7 @@ package org.eclipse.jpt.jaxb.core.internal.utility;
import org.eclipse.jpt.common.utility.command.Command;
import org.eclipse.jpt.common.utility.internal.ListenerList;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jpt.jaxb.core.utility.CallbackSynchronizer;
/**
@@ -34,7 +35,7 @@ public class CallbackSynchronousSynchronizer
extends SynchronousSynchronizer
implements CallbackSynchronizer
{
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ private final ListenerList<Listener> listenerList = ModelTools.listenerList();
// ********** construction **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java
index 700b718663..f59d4a67b7 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java
@@ -17,6 +17,7 @@ import org.eclipse.datatools.enablement.jdt.classpath.DriverClasspathContainer;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.db.ConnectionProfile;
@@ -130,7 +131,7 @@ public final class DTPConnectionProfileFactory
private static class LocalProfileListener
implements IProfileListener1
{
- private final ListenerList<ConnectionProfileListener> listenerList = new ListenerList<ConnectionProfileListener>(ConnectionProfileListener.class);
+ private final ListenerList<ConnectionProfileListener> listenerList = ModelTools.listenerList();
LocalProfileListener() {
super();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java
index 04fcdac48b..95a809f9cb 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -22,6 +22,7 @@ import org.eclipse.datatools.sqltools.core.DatabaseIdentifier;
import org.eclipse.datatools.sqltools.core.profile.ProfileUtil;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jpt.jpa.db.ConnectionListener;
import org.eclipse.jpt.jpa.db.ConnectionProfile;
import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
@@ -392,7 +393,7 @@ final class DTPConnectionProfileWrapper
private class LocalConnectionListener
implements IManagedConnectionOfflineListener
{
- private ListenerList<ConnectionListener> listenerList = new ListenerList<ConnectionListener>(ConnectionListener.class);
+ private ListenerList<ConnectionListener> listenerList = ModelTools.listenerList();
LocalConnectionListener() {
super();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java
index 4b02e66b00..4314993038 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -17,6 +17,7 @@ import org.eclipse.jpt.common.ui.internal.WorkbenchTools;
import org.eclipse.jpt.common.ui.internal.swt.widgets.DisplayTools;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
+import org.eclipse.jpt.common.utility.internal.model.ModelTools;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.db.ConnectionAdapter;
import org.eclipse.jpt.jpa.db.ConnectionListener;
@@ -52,7 +53,7 @@ public class DatabaseSchemaWizardPage extends WizardPage {
final JpaProject jpaProject;
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
+ private final ListenerList<Listener> listenerList = ModelTools.listenerList();
private DatabaseGroup databaseGroup;

Back to the top