harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r785161 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/EventSetDescriptor.java test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
Date Tue, 16 Jun 2009 11:08:12 GMT
Author: tellison
Date: Tue Jun 16 11:08:12 2009
New Revision: 785161

URL: http://svn.apache.org/viewvc?rev=785161&view=rev
Log:
Apply patch for HARMONY-6206 ([classlib][beans] java.beans.EventSetDescriptor(String, Class<?>
, MethodDescriptor[], Method, Method) throws a NullPointerException while RI doesn't)

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java?rev=785161&r1=785160&r2=785161&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
Tue Jun 16 11:08:12 2009
@@ -177,7 +177,6 @@
             this.listenerMethodDescriptors = new ArrayList<MethodDescriptor>();
 
             for (MethodDescriptor element : listenerMethodDescriptors) {
-                element.getMethod();
                 this.listenerMethodDescriptors.add(element);
             }
         }

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java?rev=785161&r1=785160&r2=785161&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
Tue Jun 16 11:08:12 2009
@@ -1277,7 +1277,24 @@
         new EventSetDescriptor(OtherBean.class, "sample",
                 SampleListener.class, "fireSampleEvent");
     }
-    
+
+    public void test_EventSetDescriptor_Constructor() throws Exception {
+        EventSetDescriptor eventSetDescriptor = new EventSetDescriptor(
+                (String) null, (Class<?>) null, new MethodDescriptor[] { null,
+                        null }, (Method) null, (Method) null);
+        assertNull(eventSetDescriptor.getName());
+        assertNull(eventSetDescriptor.getListenerType());
+        assertNull(eventSetDescriptor.getAddListenerMethod());
+        assertNull(eventSetDescriptor.getRemoveListenerMethod());
+
+        try {
+            eventSetDescriptor.getListenerMethods();
+            fail("should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+    }
+
     //Regression Test
     public void testConstructor_withLackRemoveActionBean() throws Exception {
         try {



Mime
View raw message