harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r433600 - in /incubator/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, 22 Aug 2006 11:36:41 GMT
Author: mloenko
Date: Tue Aug 22 04:36:40 2006
New Revision: 433600

URL: http://svn.apache.org/viewvc?rev=433600&view=rev
Log:
applied patch for HARMONY-1237
[classlib][beans] unexpected StringIndexOutOfBoundsException for EventSetDescriptor(class,
String, class, String[], String, String, String)

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java?rev=433600&r1=433599&r2=433600&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
Tue Aug 22 04:36:40 2006
@@ -363,8 +363,10 @@
             throws ClassNotFoundException {
         String listenerTypeName = listenerType.getName();
         int idx = listenerTypeName.lastIndexOf("Listener");
-        String eventTypeName = listenerTypeName.substring(0, idx) + "Event";
-
+        String eventTypeName = listenerTypeName;
+        if (idx != -1) {
+            eventTypeName = listenerTypeName.substring(0, idx) + "Event";
+        }
         return Class
                 .forName(eventTypeName, true, listenerType.getClassLoader());
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java?rev=433600&r1=433599&r2=433600&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
Tue Aug 22 04:36:40 2006
@@ -601,6 +601,14 @@
 		assertEquals(listenerType, esd.getListenerType());
 		assertTrue(esd.isInDefaultEventSet());
 		assertFalse(esd.isUnicast());
+		// Regression for HARMONY-1237
+        try {
+            new EventSetDescriptor(Thread.class, "0xABCD", Thread.class,
+                    new String[] {}, "aaa", null, "bbb");
+            fail("IntrospectionException expected");
+        } catch (IntrospectionException e) {
+            //expected
+        }
 	}
 
 	/*



Mime
View raw message