GJL commented on a change in pull request #7273: [FLINK-11122][core] Change
signature of WrappingProxyUtil#stripProxy(T)
URL: https://github.com/apache/flink/pull/7273#discussion_r240925036
##########
File path:
flink-core/src/main/java/org/apache/flink/util/WrappingProxyUtil.java
##########
@@ -31,15 +33,19 @@ private WrappingProxyUtil() {
}
@SuppressWarnings("unchecked")
- public static <T> T stripProxy(T object) {
+ public static <T> T stripProxy(@Nullable final WrappingProxy<T>
wrappingProxy) {
+ if (wrappingProxy == null) {
+ return null;
+ }
- T previous = null;
+ WrappingProxy<T> previous = null;
+ Object delegate = wrappingProxy.getWrappedDelegate();
- while (object instanceof WrappingProxy && previous != object) {
- previous = object;
- object = ((WrappingProxy<T>)
object).getWrappedDelegate();
+ while (delegate instanceof WrappingProxy && previous !=
delegate) {
+ previous = (WrappingProxy<T>) delegate;
+ delegate = ((WrappingProxy<T>)
delegate).getWrappedDelegate();
Review comment:
As discussed offline, all proxies must be assignable to T as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services