Author: oheger
Date: Sat Feb  6 16:09:55 2010
New Revision: 907244

URL: http://svn.apache.org/viewvc?rev=907244&view=rev
Log:
Removed reference to HierarchicalConfiguration and fixed some raw type warnings.

Modified:
    
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java

Modified: 
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java
URL: 
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java?rev=907244&r1=907243&r2=907244&view=diff
==============================================================================
--- 
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java
 (original)
+++ 
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java
 Sat Feb  6 16:09:55 2010
@@ -48,9 +48,8 @@
  * property clear events, and property add events). If this mode is turned off
  * (which is the default), detail events are suppressed, so only property set
  * events will be received. Note that the number of received detail events may
- * differ for different configuration implementations.
- * <code>{...@link org.apache.commons.configuration2.HierarchicalConfiguration 
HierarchicalConfiguration}</code>
- * for instance has a custom implementation of <code>setProperty()</code>,
+ * differ for different configuration implementations. Hierarchical 
configurations
+ * for instance have a custom implementation of <code>setProperty()</code>,
  * which does not generate any detail events.
  * </p>
  * <p>
@@ -329,6 +328,7 @@
      * @throws CloneNotSupportedException if cloning is not allowed
      * @since 1.4
      */
+    @Override
     protected Object clone() throws CloneNotSupportedException
     {
         EventSource copy = (EventSource) super.clone();
@@ -340,10 +340,11 @@
      * Adds a new listener object to a listener collection. This is done in a
      * synchronized block. The listener must not be <b>null</b>.
      *
+     * @param <T> the type of listener to be added
      * @param listeners the collection with the listeners
      * @param l the listener object
      */
-    private static void doAddListener(Collection listeners, Object l)
+    private static <T> void doAddListener(Collection<T> listeners, T l)
     {
         if (l == null)
         {
@@ -359,11 +360,12 @@
      * Removes an event listener from a listener collection. This is done in a
      * synchronized block.
      *
+     * @param <T> the type of listener to be removed
      * @param listeners the collection with the listeners
      * @param l the listener object
      * @return a flag whether the listener could be found and removed
      */
-    private static boolean doRemoveListener(Collection listeners, Object l)
+    private static <T> boolean doRemoveListener(Collection<T> listeners, T l)
     {
         synchronized (listeners)
         {
@@ -376,7 +378,7 @@
      *
      * @param listeners the collection with the listeners
      */
-    private static void doClearListeners(Collection listeners)
+    private static void doClearListeners(Collection<?> listeners)
     {
         synchronized (listeners)
         {
@@ -387,14 +389,16 @@
     /**
      * Returns an unmodifiable snapshot of the given event listener collection.
      *
+     * @param <T> the type of the collection with the listeners
      * @param listeners the collection with the listeners
      * @return a snapshot of the listeners collection
      */
-    private static Collection doGetListeners(Collection listeners)
+    private static <T> Collection<T> doGetListeners(Collection<T> listeners)
     {
         synchronized (listeners)
         {
-            return Collections.unmodifiableCollection(new 
ArrayList(listeners));
+            return Collections.unmodifiableCollection(new ArrayList<T>(
+                    listeners));
         }
     }
 


Reply via email to