harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Liang (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-2355) [classlib[luni]java.lang.reflect.Proxy.newProxyInstance throws IllegalArgumentException with two interfaces one method of which have the same signature except compatible return types.
Date Fri, 01 Dec 2006 07:55:25 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2355?page=all ]

Richard Liang closed HARMONY-2355.
----------------------------------


Verified by Leo

> [classlib[luni]java.lang.reflect.Proxy.newProxyInstance throws IllegalArgumentException
with two interfaces one method of which have the same signature except compatible return types.
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2355
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2355
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>         Assigned To: Richard Liang
>         Attachments: patch-2355.diff
>
>
> Here is the testcase:
> public void testNewProxyInstanceWithCompatibleReturnTypes() {
> 		Object o = Proxy
> 				.newProxyInstance(this.getClass().getClassLoader(),
> 						new Class[] { ITestReturnObject.class,
> 								ITestReturnString.class },
> 						new TestProxyHandler(new TestProxyImpl()));
> 		assertNotNull(o);
> 	}
> 	public static interface ITestReturnObject {
> 		Object f();
> 	}
> 	public static interface ITestReturnString {
> 		String f();
> 	}
> 	public static class TestProxyImpl implements ITestReturnObject,
> 			ITestReturnString {
> 		public String f() {
> 			// do nothing
> 			return null;
> 		}
> 	}
> 	public static class TestProxyHandler implements InvocationHandler {
> 		private Object proxied;
> 		public TestProxyHandler(Object object) {
> 			proxied = object;
> 		}
> 		public Object invoke(Object object, Method method, Object[] args)
> 				throws Throwable {
> 			// do nothing
> 			return method.invoke(proxied, args);
> 		}
> 	}
> RI passes.
> Harmony fails.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message