harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r447825 - in /incubator/harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/beancontext/ main/java/org/apache/harmony/beans/internal/nls/ test/java/org/apache/harmony/beans/tests/java/beans/beancontext/
Date Tue, 19 Sep 2006 12:10:25 GMT
Author: tellison
Date: Tue Sep 19 05:10:24 2006
New Revision: 447825

URL: http://svn.apache.org/viewvc?view=rev&rev=447825
Log:
Applied patch HARMONY-1393 ([classlib][beans] no IllegalArgumentException for BeanContextSupport.getChildBeanContextChild())

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java?view=diff&rev=447825&r1=447824&r2=447825
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
Tue Sep 19 05:10:24 2006
@@ -656,6 +656,11 @@
             return null;
         }
 
+        if (child instanceof BeanContextChild && child instanceof BeanContextProxy)
{
+            // beans.49=Child cannot implement both BeanContextChild and BeanContextProxy
+            throw new IllegalArgumentException(Messages.getString("beans.49")); //$NON-NLS-1$
+        } 
+
         // See if the child implements BeanContextChild or BeanContextProxy. 
         // Cast it to appropriate class or simply return null
         if (child instanceof BeanContextChild) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties?view=diff&rev=447825&r1=447824&r2=447825
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties
Tue Sep 19 05:10:24 2006
@@ -87,3 +87,4 @@
 beans.46=Not a valid child
 beans.47=Unable to instantiate property editor
 beans.48=Property editor is not assignable from the PropertyEditor interface
+beans.49=Child cannot implement both BeanContextChild and BeanContextProxy

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java?view=diff&rev=447825&r1=447824&r2=447825
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
Tue Sep 19 05:10:24 2006
@@ -22,6 +22,7 @@
 import java.beans.Visibility;
 import java.beans.beancontext.BeanContext;
 import java.beans.beancontext.BeanContextChild;
+import java.beans.beancontext.BeanContextChildSupport;
 import java.beans.beancontext.BeanContextMembershipEvent;
 import java.beans.beancontext.BeanContextMembershipListener;
 import java.beans.beancontext.BeanContextProxy;
@@ -933,6 +934,21 @@
         BeanContextChild result = MockBeanContextSupport
                 .publicGetChildBeanContextChild(child);
         assertSame(child, result);
+
+        //Regression for HARMONY-1393
+		class TestBeanException extends BeanContextChildSupport implements BeanContextProxy {
+			private BeanContextChildSupport childSupport = new BeanContextChildSupport();
+			public BeanContextChild getBeanContextProxy() {
+				return childSupport;
+			}
+		}
+		TestBeanException bean = new TestBeanException();
+		try {
+			MockBeanContextSupport.publicGetChildBeanContextChild(bean);
+			fail("IllegalArgumentException expected");
+		} catch (IllegalArgumentException e) {
+			//expected
+		}
     }
 
     public void testGetChildBeanContextChild_BeanContextProxy() {



Mime
View raw message