dachuan9e commented on a change in pull request #12448:
URL: https://github.com/apache/shardingsphere/pull/12448#discussion_r709809966
##########
File path:
shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/ShardingSphereTransformer.java
##########
@@ -145,28 +132,32 @@
return result;
}
+ private ShardingSphereTransformationPoint<?>
getStaticClassTransformationPoint(final MethodDescription.InDefinedShape md,
final List<ClassStaticMethodPoint> classStaticMethodAroundPoints) {
+ List<ClassStaticMethodPoint> classStaticMethodPoints =
classStaticMethodAroundPoints.stream().filter(point ->
point.getMatcher().matches(md)).collect(Collectors.toList());
+ if (classStaticMethodPoints.isEmpty()) {
+ return null;
+ }
+ if (classStaticMethodPoints.size() == 1) {
+ return new ShardingSphereTransformationPoint<>(md, new
ClassStaticMethodAroundInterceptor(pluginLoader.getOrCreateInstance(classStaticMethodPoints.get(0).getAdvice())));
+ } else {
+ Collection<ClassStaticMethodAroundAdvice>
classStaticMethodAroundAdvices = new LinkedList<>();
+ for (ClassStaticMethodPoint point : classStaticMethodPoints) {
+ if (null != point.getAdvice()) {
+
classStaticMethodAroundAdvices.add(pluginLoader.getOrCreateInstance(point.getAdvice()));
+ }
+ }
+ return new ShardingSphereTransformationPoint<>(md, new
ComposeClassStaticMethodAroundInterceptor(classStaticMethodAroundAdvices));
Review comment:
thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]