You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by so...@apache.org on 2023/01/17 10:46:44 UTC
[wicket] 01/01: [WICKET-7025] package private methods are intercepted by ByteBuddy
This is an automated email from the ASF dual-hosted git repository.
solomax pushed a commit to branch WICKET-7025-package-private-methods
in repository https://gitbox.apache.org/repos/asf/wicket.git
commit 779aca0d16853899819cd6b63b4f53f072abe0cb
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Tue Jan 17 17:46:19 2023 +0700
[WICKET-7025] package private methods are intercepted by ByteBuddy
---
.../wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java
index 4d53be283b..9cc5cf419b 100644
--- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java
+++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java
@@ -60,13 +60,13 @@ public class ByteBuddyProxyFactory implements IProxyFactory
/**
* Create a lazy init proxy for the specified type. The target object will be located using the
* provided locator upon first method invocation.
- *
+ *
* @param type
* type that proxy will represent
- *
+ *
* @param locator
* object locator that will locate the object the proxy represents
- *
+ *
* @return lazily initializable proxy
*/
@Override
@@ -75,7 +75,7 @@ public class ByteBuddyProxyFactory implements IProxyFactory
Class<T> proxyClass = createOrGetProxyClass(type);
T instance;
-
+
if (!hasNoArgConstructor(type))
{
instance = INSTANTIATOR.newInstance(proxyClass);
@@ -91,10 +91,10 @@ public class ByteBuddyProxyFactory implements IProxyFactory
throw new WicketRuntimeException(e);
}
}
-
+
ByteBuddyInterceptor interceptor = new ByteBuddyInterceptor(type, locator);
((InterceptorMutator) instance).setInterceptor(interceptor);
-
+
return instance;
}
@@ -106,7 +106,7 @@ public class ByteBuddyProxyFactory implements IProxyFactory
new TypeCache.SimpleKey(type),
() -> BYTE_BUDDY
.subclass(type)
- .method(ElementMatchers.isPublic())
+ .method(ElementMatchers.isPublic().or(ElementMatchers.isPackagePrivate()))
.intercept(
MethodDelegation
.withDefaultConfiguration()