harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r416846 - in /incubator/harmony/enhanced/classlib/trunk/modules/awt: ./ src/main/java/common/java/awt/ src/test/api/ src/test/api/java/ src/test/api/java/org/ src/test/api/java/org/apache/ src/test/api/java/org/apache/harmony/ src/test/api/...
Date Sat, 24 Jun 2006 00:45:20 GMT
Author: ndbeyer
Date: Fri Jun 23 17:45:19 2006
New Revision: 416846

URL: http://svn.apache.org/viewvc?rev=416846&view=rev
Log:
Cleanup, generify and add test.

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/tests/
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/tests/java/
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/tests/java/awt/
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/tests/java/awt/AllTests.java
      - copied, changed from r416837, incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/java/org/apache/harmony/tests/awt/AllTests.java
Removed:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/java/org/apache/harmony/tests/awt/AllTests.java
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/.classpath
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/.classpath
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/.classpath?rev=416846&r1=416845&r2=416846&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/.classpath (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/.classpath Fri Jun 23 17:45:19 2006
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry path="src/main/java/common" kind="src" output="bin/main/common"/>
-	<classpathentry path="src/main/java/windows" kind="src" output="bin/main/windows"/>
-	<classpathentry path="src/main/java/linux" kind="src" output="bin/main/linux"/>
-	<classpathentry path="src/test/java" kind="src" output="bin/test"/>
-	<classpathentry path="org.eclipse.pde.core.requiredPlugins" kind="con"/>
-	<classpathentry path="JUNIT_HOME/junit.jar" kind="var" sourcepath="JUNIT_SRC_HOME/junitsrc.zip"/>
-	<classpathentry path="bin" kind="output"/>
+	<classpathentry output="bin/main/common" kind="src" path="src/main/java/common"/>
+	<classpathentry output="bin/test" kind="src" path="src/test/api/java"/>
+	<classpathentry output="bin/main/windows" kind="src" path="src/main/java/windows"/>
+	<classpathentry output="bin/main/linux" kind="src" path="src/main/java/linux"/>
+	<classpathentry output="bin/test" kind="src" path="src/test/java"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry sourcepath="JUNIT_SRC_HOME/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/>
+	<classpathentry kind="output" path="bin/main/common"/>
 </classpath>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java?rev=416846&r1=416845&r2=416846&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java
Fri Jun 23 17:45:19 2006
@@ -23,6 +23,7 @@
 
 import java.io.IOException;
 import java.io.ObjectOutputStream;
+import java.lang.reflect.Array;
 
 import java.util.EventListener;
 import java.util.LinkedList;
@@ -65,18 +66,18 @@
         s.writeObject(l);
     }
 
-    public static EventListener[] getListeners(EventListener l,
-            Class listenerType) throws ClassCastException
+    public static <T extends EventListener> T[] getListeners(EventListener l,
+            Class<T> listenerType) throws ClassCastException
     {
-        if (l == null) {
-            return new EventListener[0];
-        } else {
-            return (EventListener[]) addListeners(l, listenerType, new LinkedList()).toArray
-                    ((EventListener[]) java.lang.reflect.Array.newInstance(listenerType,
0));
+        T[] result = (T[])Array.newInstance(listenerType, 0);
+        if (l != null) {
+            LinkedList<EventListener> listeners = addListeners(l, listenerType, new
LinkedList<EventListener>());
+            result = listeners.toArray(result);
         }
+        return result;
     }
 
-    private static LinkedList addListeners(EventListener l, Class listenerType, LinkedList
list) {
+    private static LinkedList<EventListener> addListeners(EventListener l, Class<?>
listenerType, LinkedList<EventListener> list) {
         if (l instanceof AWTEventMulticaster) {
             AWTEventMulticaster ml = (AWTEventMulticaster) l;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/tests/java/awt/AllTests.java
(from r416837, incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/java/org/apache/harmony/tests/awt/AllTests.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/tests/java/awt/AllTests.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/tests/java/awt/AllTests.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/java/org/apache/harmony/tests/awt/AllTests.java&r1=416837&r2=416846&rev=416846&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/java/org/apache/harmony/tests/awt/AllTests.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/tests/java/awt/AllTests.java
Fri Jun 23 17:45:19 2006
@@ -14,7 +14,7 @@
  * the License.
  */
 
-package org.apache.harmony.tests.awt;
+package org.apache.harmony.tests.java.awt;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -27,8 +27,9 @@
 
 	public static Test suite() {
 		TestSuite suite = new TestSuite(
-				"Test for org.apache.harmony.tests.awt");
+				"Test for org.apache.harmony.tests.java.awt");
 		//$JUnit-BEGIN$
+        suite.addTestSuite(AWTEventMulticasterTest.class);
 		//$JUnit-END$
 		return suite;
 	}



Mime
View raw message