harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Li (JIRA)" <j...@apache.org>
Subject [jira] Created: (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 Wed, 29 Nov 2006 04:35:21 GMT
[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


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