提交 da7aa37a 编写于 作者: J Juergen Hoeller

refined generic getProxy signature

上级 d64bc93e
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -94,8 +94,8 @@ public class ProxyFactory extends ProxyCreatorSupport {
* @return the proxy object
*/
@SuppressWarnings("unchecked")
public <T> T getProxy() {
return (T) createAopProxy().getProxy();
public Object getProxy() {
return createAopProxy().getProxy();
}
/**
......@@ -108,8 +108,8 @@ public class ProxyFactory extends ProxyCreatorSupport {
* @return the proxy object
*/
@SuppressWarnings("unchecked")
public <T> T getProxy(ClassLoader classLoader) {
return (T) createAopProxy().getProxy(classLoader);
public Object getProxy(ClassLoader classLoader) {
return createAopProxy().getProxy(classLoader);
}
......@@ -123,8 +123,9 @@ public class ProxyFactory extends ProxyCreatorSupport {
* @return the proxy object
* @see #ProxyFactory(Class, org.aopalliance.intercept.Interceptor)
*/
public static Object getProxy(Class proxyInterface, Interceptor interceptor) {
return new ProxyFactory(proxyInterface, interceptor).getProxy();
@SuppressWarnings("unchecked")
public static <T> T getProxy(Class<T> proxyInterface, Interceptor interceptor) {
return (T) new ProxyFactory(proxyInterface, interceptor).getProxy();
}
/**
......@@ -135,8 +136,9 @@ public class ProxyFactory extends ProxyCreatorSupport {
* @return the proxy object
* @see #ProxyFactory(Class, org.springframework.aop.TargetSource)
*/
public static Object getProxy(Class proxyInterface, TargetSource targetSource) {
return new ProxyFactory(proxyInterface, targetSource).getProxy();
@SuppressWarnings("unchecked")
public static <T> T getProxy(Class<T> proxyInterface, TargetSource targetSource) {
return (T) new ProxyFactory(proxyInterface, targetSource).getProxy();
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册