Merged gcj-eclipse branch to trunk.

From-SVN: r120621
This commit is contained in:
Tom Tromey 2007-01-09 19:58:05 +00:00
parent c648dedbde
commit 97b8365caf
17478 changed files with 606493 additions and 100744 deletions

View file

@ -463,7 +463,8 @@ public class EventHandler implements InvocationHandler
* @param action Target property or method to invoke.
* @return A constructed proxy object.
*/
public static Object create(Class listenerInterface, Object target, String action)
public static <T> T create(Class<T> listenerInterface, Object target,
String action)
{
return create(listenerInterface, target, action, null, null);
}
@ -552,8 +553,8 @@ public class EventHandler implements InvocationHandler
* @param eventPropertyName Name of property to extract from event.
* @return A constructed proxy object.
*/
public static Object create(Class listenerInterface, Object target,
String action, String eventPropertyName)
public static <T> T create(Class<T> listenerInterface, Object target,
String action, String eventPropertyName)
{
return create(listenerInterface, target, action, eventPropertyName, null);
}
@ -587,9 +588,9 @@ public class EventHandler implements InvocationHandler
* @param listenerMethodName Listener method to implement.
* @return A constructed proxy object.
*/
public static Object create(Class listenerInterface, Object target,
String action, String eventPropertyName,
String listenerMethodName)
public static <T> T create(Class<T> listenerInterface, Object target,
String action, String eventPropertyName,
String listenerMethodName)
{
// Create EventHandler instance
EventHandler eh = new EventHandler(target, action, eventPropertyName,
@ -597,10 +598,9 @@ public class EventHandler implements InvocationHandler
// Create proxy object passing in the event handler
Object proxy = Proxy.newProxyInstance(listenerInterface.getClassLoader(),
new Class[] {listenerInterface},
new Class<?>[] {listenerInterface},
eh);
return proxy;
return (T) proxy;
}
}