You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/12/16 14:21:06 UTC

[shardingsphere] branch master updated: Remove overrideArgs attribute from advisor configuration (#22921)

This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 236584367b3 Remove overrideArgs attribute from advisor configuration (#22921)
236584367b3 is described below

commit 236584367b302ff659a821ec0a5afb7c718becb0
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Dec 16 22:20:57 2022 +0800

    Remove overrideArgs attribute from advisor configuration (#22921)
---
 .../type/InstanceMethodAdvisorConfiguration.java   |   6 --
 .../type/StaticMethodAdvisorConfiguration.java     |   6 --
 .../agent/core/plugin/OverrideArgsInvoker.java     |  32 -------
 .../InstanceMethodInterceptorArgsOverride.java     | 101 ---------------------
 .../StaticMethodInterceptorArgsOverride.java       |  99 --------------------
 ...posedInstanceMethodInterceptorArgsOverride.java |  34 -------
 ...omposedStaticMethodInterceptorArgsOverride.java |  34 -------
 .../builder/type/InstanceMethodAdvisorBuilder.java |  29 +-----
 .../builder/type/StaticMethodAdvisorBuilder.java   |  29 +-----
 9 files changed, 9 insertions(+), 361 deletions(-)

diff --git a/agent/api/src/main/java/org/apache/shardingsphere/agent/config/advisor/method/type/InstanceMethodAdvisorConfiguration.java b/agent/api/src/main/java/org/apache/shardingsphere/agent/config/advisor/method/type/InstanceMethodAdvisorConfiguration.java
index a045dbdaee1..41dc8a3c13c 100644
--- a/agent/api/src/main/java/org/apache/shardingsphere/agent/config/advisor/method/type/InstanceMethodAdvisorConfiguration.java
+++ b/agent/api/src/main/java/org/apache/shardingsphere/agent/config/advisor/method/type/InstanceMethodAdvisorConfiguration.java
@@ -33,10 +33,4 @@ public final class InstanceMethodAdvisorConfiguration implements MethodAdvisorCo
     private final ElementMatcher<? super MethodDescription> pointcut;
     
     private final String adviceClassName;
-    
-    private final boolean overrideArgs;
-    
-    public InstanceMethodAdvisorConfiguration(final ElementMatcher<? super MethodDescription> pointcut, final String adviceClassName) {
-        this(pointcut, adviceClassName, false);
-    }
 }
diff --git a/agent/api/src/main/java/org/apache/shardingsphere/agent/config/advisor/method/type/StaticMethodAdvisorConfiguration.java b/agent/api/src/main/java/org/apache/shardingsphere/agent/config/advisor/method/type/StaticMethodAdvisorConfiguration.java
index 7da857f88ff..b8be1e9bfb7 100644
--- a/agent/api/src/main/java/org/apache/shardingsphere/agent/config/advisor/method/type/StaticMethodAdvisorConfiguration.java
+++ b/agent/api/src/main/java/org/apache/shardingsphere/agent/config/advisor/method/type/StaticMethodAdvisorConfiguration.java
@@ -33,10 +33,4 @@ public final class StaticMethodAdvisorConfiguration implements MethodAdvisorConf
     private final ElementMatcher<? super MethodDescription> pointcut;
     
     private final String adviceClassName;
-    
-    private final boolean overrideArgs;
-    
-    public StaticMethodAdvisorConfiguration(final ElementMatcher<? super MethodDescription> pointcut, final String adviceClassName) {
-        this(pointcut, adviceClassName, false);
-    }
 }
diff --git a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/OverrideArgsInvoker.java b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/OverrideArgsInvoker.java
deleted file mode 100644
index 0b515367125..00000000000
--- a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/OverrideArgsInvoker.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.core.plugin;
-
-/**
- * Super(origin) method invoker for ByteBuddy only.
- */
-public interface OverrideArgsInvoker {
-    
-    /**
-     * Call invocation origin method.
-     *
-     * @param args the origin method arguments
-     * @return the result of the origin method
-     */
-    Object call(Object[] args);
-}
diff --git a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/InstanceMethodInterceptorArgsOverride.java b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/InstanceMethodInterceptorArgsOverride.java
deleted file mode 100644
index b27eb39367f..00000000000
--- a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/InstanceMethodInterceptorArgsOverride.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.core.plugin.interceptor;
-
-import lombok.RequiredArgsConstructor;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.This;
-import org.apache.shardingsphere.agent.core.plugin.TargetAdviceObject;
-import org.apache.shardingsphere.agent.core.plugin.advice.InstanceMethodAroundAdvice;
-import org.apache.shardingsphere.agent.core.plugin.OverrideArgsInvoker;
-import org.apache.shardingsphere.agent.core.plugin.MethodInvocationResult;
-import org.apache.shardingsphere.agent.core.logging.LoggerFactory;
-import org.apache.shardingsphere.agent.core.plugin.PluginContext;
-
-import java.lang.reflect.Method;
-
-/**
- * Proxy class for ByteBuddy to intercept methods of target and weave pre- and post-method around the target method with args override.
- */
-@RequiredArgsConstructor
-public class InstanceMethodInterceptorArgsOverride {
-    
-    private static final LoggerFactory.Logger LOGGER = LoggerFactory.getLogger(InstanceMethodInterceptorArgsOverride.class);
-    
-    private final InstanceMethodAroundAdvice instanceMethodAroundAdvice;
-    
-    /**
-     * Only intercept instance method.
-     *
-     * @param target the target object
-     * @param method the intercepted method
-     * @param args the all arguments of method
-     * @param callable the origin method invocation
-     * @return the return value of target invocation
-     */
-    @RuntimeType
-    public Object intercept(@This final TargetAdviceObject target, @Origin final Method method, @AllArguments final Object[] args, @Morph final OverrideArgsInvoker callable) {
-        MethodInvocationResult methodResult = new MethodInvocationResult();
-        Object result;
-        boolean adviceEnabled = instanceMethodAroundAdvice.disableCheck() || PluginContext.isPluginEnabled();
-        try {
-            if (adviceEnabled) {
-                instanceMethodAroundAdvice.beforeMethod(target, method, args, methodResult);
-            }
-            // CHECKSTYLE:OFF
-        } catch (final Throwable ex) {
-            // CHECKSTYLE:ON
-            LOGGER.error("Failed to execute the pre-method of method[{}] in class[{}]", method.getName(), target.getClass(), ex);
-        }
-        try {
-            if (methodResult.isRebased()) {
-                result = methodResult.getResult();
-            } else {
-                result = callable.call(args);
-            }
-            methodResult.rebase(result);
-            // CHECKSTYLE:OFF
-        } catch (final Throwable ex) {
-            // CHECKSTYLE:ON
-            try {
-                if (adviceEnabled) {
-                    instanceMethodAroundAdvice.onThrowing(target, method, args, ex);
-                }
-                // CHECKSTYLE:OFF
-            } catch (final Throwable ignored) {
-                // CHECKSTYLE:ON
-                LOGGER.error("Failed to execute the error handler of method[{}] in class[{}]", method.getName(), target.getClass(), ex);
-            }
-            throw ex;
-        } finally {
-            try {
-                if (adviceEnabled) {
-                    instanceMethodAroundAdvice.afterMethod(target, method, args, methodResult);
-                }
-                // CHECKSTYLE:OFF
-            } catch (final Throwable ex) {
-                // CHECKSTYLE:ON
-                LOGGER.error("Failed to execute the post-method of method[{}] in class[{}]", method.getName(), target.getClass(), ex);
-            }
-        }
-        return methodResult.isRebased() ? methodResult.getResult() : result;
-    }
-}
diff --git a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/StaticMethodInterceptorArgsOverride.java b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/StaticMethodInterceptorArgsOverride.java
deleted file mode 100644
index 86120467cac..00000000000
--- a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/StaticMethodInterceptorArgsOverride.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.core.plugin.interceptor;
-
-import lombok.RequiredArgsConstructor;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import org.apache.shardingsphere.agent.core.plugin.advice.StaticMethodAroundAdvice;
-import org.apache.shardingsphere.agent.core.plugin.OverrideArgsInvoker;
-import org.apache.shardingsphere.agent.core.plugin.MethodInvocationResult;
-import org.apache.shardingsphere.agent.core.logging.LoggerFactory;
-import org.apache.shardingsphere.agent.core.plugin.PluginContext;
-
-import java.lang.reflect.Method;
-
-/**
- * Proxy class for ByteBuddy to intercept methods of target and weave pre- and post-method around the target method with args override.
- */
-@RequiredArgsConstructor
-public class StaticMethodInterceptorArgsOverride {
-    
-    private static final LoggerFactory.Logger LOGGER = LoggerFactory.getLogger(StaticMethodInterceptorArgsOverride.class);
-    
-    private final StaticMethodAroundAdvice staticMethodAroundAdvice;
-    
-    /**
-     * Only intercept static method.
-     *
-     * @param klass the class of target
-     * @param method the intercepted method
-     * @param args the all arguments of method
-     * @param callable the origin method invocation
-     * @return the return value of target invocation
-     */
-    @RuntimeType
-    public Object intercept(@Origin final Class<?> klass, @Origin final Method method, @AllArguments final Object[] args, @Morph final OverrideArgsInvoker callable) {
-        MethodInvocationResult methodResult = new MethodInvocationResult();
-        Object result;
-        boolean adviceEnabled = staticMethodAroundAdvice.disableCheck() || PluginContext.isPluginEnabled();
-        try {
-            if (adviceEnabled) {
-                staticMethodAroundAdvice.beforeMethod(klass, method, args, methodResult);
-            }
-            // CHECKSTYLE:OFF
-        } catch (final Throwable ex) {
-            // CHECKSTYLE:ON
-            LOGGER.error("Failed to execute the pre-method of method[{}] in class[{}]", method.getName(), klass, ex);
-        }
-        try {
-            if (methodResult.isRebased()) {
-                result = methodResult.getResult();
-            } else {
-                result = callable.call(args);
-            }
-            methodResult.rebase(result);
-            // CHECKSTYLE:OFF
-        } catch (final Throwable ex) {
-            // CHECKSTYLE:ON
-            try {
-                if (adviceEnabled) {
-                    staticMethodAroundAdvice.onThrowing(klass, method, args, ex);
-                }
-                // CHECKSTYLE:OFF
-            } catch (final Throwable ignored) {
-                // CHECKSTYLE:ON
-                LOGGER.error("Failed to execute the error handler of method[{}] in class[{}]", method.getName(), klass, ex);
-            }
-            throw ex;
-        } finally {
-            try {
-                if (adviceEnabled) {
-                    staticMethodAroundAdvice.afterMethod(klass, method, args, methodResult);
-                }
-                // CHECKSTYLE:OFF
-            } catch (final Throwable ex) {
-                // CHECKSTYLE:ON
-                LOGGER.error("Failed to execute the post-method of method[{}] in class[{}]", method.getName(), klass, ex);
-            }
-        }
-        return methodResult.isRebased() ? methodResult.getResult() : result;
-    }
-}
diff --git a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/composed/ComposedInstanceMethodInterceptorArgsOverride.java b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/composed/ComposedInstanceMethodInterceptorArgsOverride.java
deleted file mode 100644
index af8b241cdb0..00000000000
--- a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/composed/ComposedInstanceMethodInterceptorArgsOverride.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.core.plugin.interceptor.composed;
-
-import org.apache.shardingsphere.agent.core.plugin.advice.InstanceMethodAroundAdvice;
-import org.apache.shardingsphere.agent.core.plugin.advice.composed.ComposedInstanceMethodAroundAdvice;
-import org.apache.shardingsphere.agent.core.plugin.interceptor.InstanceMethodInterceptorArgsOverride;
-
-import java.util.Collection;
-
-/**
- * Composed instance method interceptor args override.
- */
-public class ComposedInstanceMethodInterceptorArgsOverride extends InstanceMethodInterceptorArgsOverride {
-    
-    public ComposedInstanceMethodInterceptorArgsOverride(final Collection<InstanceMethodAroundAdvice> instanceMethodAroundAdvices) {
-        super(new ComposedInstanceMethodAroundAdvice(instanceMethodAroundAdvices));
-    }
-}
diff --git a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/composed/ComposedStaticMethodInterceptorArgsOverride.java b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/composed/ComposedStaticMethodInterceptorArgsOverride.java
deleted file mode 100644
index 4b3dedb0ade..00000000000
--- a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/composed/ComposedStaticMethodInterceptorArgsOverride.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.core.plugin.interceptor.composed;
-
-import org.apache.shardingsphere.agent.core.plugin.advice.StaticMethodAroundAdvice;
-import org.apache.shardingsphere.agent.core.plugin.advice.composed.ComposedStaticMethodAroundAdvice;
-import org.apache.shardingsphere.agent.core.plugin.interceptor.StaticMethodInterceptorArgsOverride;
-
-import java.util.Collection;
-
-/**
- * Composed static method interceptor args override.
- */
-public final class ComposedStaticMethodInterceptorArgsOverride extends StaticMethodInterceptorArgsOverride {
-    
-    public ComposedStaticMethodInterceptorArgsOverride(final Collection<StaticMethodAroundAdvice> instanceMethodAroundAdvices) {
-        super(new ComposedStaticMethodAroundAdvice(instanceMethodAroundAdvices));
-    }
-}
diff --git a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/transformer/build/builder/type/InstanceMethodAdvisorBuilder.java b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/transformer/build/builder/type/InstanceMethodAdvisorBuilder.java
index a40a71e7746..a91d5e526bb 100644
--- a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/transformer/build/builder/type/InstanceMethodAdvisorBuilder.java
+++ b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/transformer/build/builder/type/InstanceMethodAdvisorBuilder.java
@@ -21,22 +21,18 @@ import lombok.RequiredArgsConstructor;
 import net.bytebuddy.description.method.MethodDescription.InDefinedShape;
 import net.bytebuddy.dynamic.DynamicType.Builder;
 import net.bytebuddy.implementation.MethodDelegation;
-import net.bytebuddy.implementation.bind.annotation.Morph;
 import net.bytebuddy.matcher.ElementMatchers;
 import org.apache.shardingsphere.agent.config.advisor.method.type.InstanceMethodAdvisorConfiguration;
-import org.apache.shardingsphere.agent.core.plugin.OverrideArgsInvoker;
 import org.apache.shardingsphere.agent.core.plugin.advice.InstanceMethodAroundAdvice;
 import org.apache.shardingsphere.agent.core.plugin.interceptor.InstanceMethodAroundInterceptor;
-import org.apache.shardingsphere.agent.core.plugin.interceptor.InstanceMethodInterceptorArgsOverride;
 import org.apache.shardingsphere.agent.core.plugin.interceptor.composed.ComposedInstanceMethodAroundInterceptor;
-import org.apache.shardingsphere.agent.core.plugin.interceptor.composed.ComposedInstanceMethodInterceptorArgsOverride;
 import org.apache.shardingsphere.agent.core.transformer.MethodAdvisor;
 import org.apache.shardingsphere.agent.core.transformer.build.advise.AdviceFactory;
 import org.apache.shardingsphere.agent.core.transformer.build.builder.MethodAdvisorBuilder;
 
 import java.util.Collection;
-import java.util.LinkedList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Instance method advisor builder.
@@ -48,10 +44,6 @@ public final class InstanceMethodAdvisorBuilder implements MethodAdvisorBuilder<
     
     @Override
     public Builder<?> create(final Builder<?> builder, final MethodAdvisor methodAdvisor) {
-        if (methodAdvisor.getAdvice() instanceof InstanceMethodInterceptorArgsOverride) {
-            return builder.method(ElementMatchers.is(methodAdvisor.getPointcut()))
-                    .intercept(MethodDelegation.withDefaultConfiguration().withBinders(Morph.Binder.install(OverrideArgsInvoker.class)).to(methodAdvisor.getAdvice()));
-        }
         return builder.method(ElementMatchers.is(methodAdvisor.getPointcut())).intercept(MethodDelegation.withDefaultConfiguration().to(methodAdvisor.getAdvice()));
     }
     
@@ -62,24 +54,13 @@ public final class InstanceMethodAdvisorBuilder implements MethodAdvisorBuilder<
     
     @Override
     public MethodAdvisor getSingleMethodAdvisor(final InDefinedShape methodDescription, final InstanceMethodAdvisorConfiguration advisorConfig) {
-        InstanceMethodAroundAdvice instanceMethodAroundAdvice = adviceFactory.getAdvice(advisorConfig.getAdviceClassName());
-        Object advice = advisorConfig.isOverrideArgs() ? new InstanceMethodInterceptorArgsOverride(instanceMethodAroundAdvice) : new InstanceMethodAroundInterceptor(instanceMethodAroundAdvice);
-        return new MethodAdvisor(methodDescription, advice);
+        return new MethodAdvisor(methodDescription, new InstanceMethodAroundInterceptor(adviceFactory.getAdvice(advisorConfig.getAdviceClassName())));
     }
     
     @Override
     public MethodAdvisor getComposedMethodAdvisor(final InDefinedShape methodDescription, final List<InstanceMethodAdvisorConfiguration> advisorConfigs) {
-        Collection<InstanceMethodAroundAdvice> instanceMethodAroundAdvices = new LinkedList<>();
-        boolean isArgsOverride = false;
-        for (InstanceMethodAdvisorConfiguration each : advisorConfigs) {
-            if (each.isOverrideArgs()) {
-                isArgsOverride = true;
-            }
-            if (null != each.getAdviceClassName()) {
-                instanceMethodAroundAdvices.add(adviceFactory.getAdvice(each.getAdviceClassName()));
-            }
-        }
-        Object advice = isArgsOverride ? new ComposedInstanceMethodInterceptorArgsOverride(instanceMethodAroundAdvices) : new ComposedInstanceMethodAroundInterceptor(instanceMethodAroundAdvices);
-        return new MethodAdvisor(methodDescription, advice);
+        Collection<InstanceMethodAroundAdvice> advices = advisorConfigs
+                .stream().<InstanceMethodAroundAdvice>map(each -> adviceFactory.getAdvice(each.getAdviceClassName())).collect(Collectors.toList());
+        return new MethodAdvisor(methodDescription, new ComposedInstanceMethodAroundInterceptor(advices));
     }
 }
diff --git a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/transformer/build/builder/type/StaticMethodAdvisorBuilder.java b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/transformer/build/builder/type/StaticMethodAdvisorBuilder.java
index 3d94666edad..58a372a0543 100644
--- a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/transformer/build/builder/type/StaticMethodAdvisorBuilder.java
+++ b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/transformer/build/builder/type/StaticMethodAdvisorBuilder.java
@@ -21,22 +21,18 @@ import lombok.RequiredArgsConstructor;
 import net.bytebuddy.description.method.MethodDescription.InDefinedShape;
 import net.bytebuddy.dynamic.DynamicType.Builder;
 import net.bytebuddy.implementation.MethodDelegation;
-import net.bytebuddy.implementation.bind.annotation.Morph;
 import net.bytebuddy.matcher.ElementMatchers;
 import org.apache.shardingsphere.agent.config.advisor.method.type.StaticMethodAdvisorConfiguration;
-import org.apache.shardingsphere.agent.core.plugin.OverrideArgsInvoker;
 import org.apache.shardingsphere.agent.core.plugin.advice.StaticMethodAroundAdvice;
 import org.apache.shardingsphere.agent.core.plugin.interceptor.StaticMethodAroundInterceptor;
-import org.apache.shardingsphere.agent.core.plugin.interceptor.StaticMethodInterceptorArgsOverride;
 import org.apache.shardingsphere.agent.core.plugin.interceptor.composed.ComposedStaticMethodAroundInterceptor;
-import org.apache.shardingsphere.agent.core.plugin.interceptor.composed.ComposedStaticMethodInterceptorArgsOverride;
 import org.apache.shardingsphere.agent.core.transformer.MethodAdvisor;
 import org.apache.shardingsphere.agent.core.transformer.build.advise.AdviceFactory;
 import org.apache.shardingsphere.agent.core.transformer.build.builder.MethodAdvisorBuilder;
 
 import java.util.Collection;
-import java.util.LinkedList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Static method advisor builder.
@@ -48,10 +44,6 @@ public final class StaticMethodAdvisorBuilder implements MethodAdvisorBuilder<St
     
     @Override
     public Builder<?> create(final Builder<?> builder, final MethodAdvisor methodAdvisor) {
-        if (methodAdvisor.getAdvice() instanceof StaticMethodInterceptorArgsOverride) {
-            return builder.method(ElementMatchers.is(methodAdvisor.getPointcut()))
-                    .intercept(MethodDelegation.withDefaultConfiguration().withBinders(Morph.Binder.install(OverrideArgsInvoker.class)).to(methodAdvisor.getAdvice()));
-        }
         return builder.method(ElementMatchers.is(methodAdvisor.getPointcut())).intercept(MethodDelegation.withDefaultConfiguration().to(methodAdvisor.getAdvice()));
     }
     
@@ -62,25 +54,12 @@ public final class StaticMethodAdvisorBuilder implements MethodAdvisorBuilder<St
     
     @Override
     public MethodAdvisor getSingleMethodAdvisor(final InDefinedShape methodDescription, final StaticMethodAdvisorConfiguration advisorConfig) {
-        StaticMethodAroundAdvice staticMethodAroundAdvice = adviceFactory.getAdvice(advisorConfig.getAdviceClassName());
-        return advisorConfig.isOverrideArgs()
-                ? new MethodAdvisor(methodDescription, new StaticMethodInterceptorArgsOverride(staticMethodAroundAdvice))
-                : new MethodAdvisor(methodDescription, new StaticMethodAroundInterceptor(staticMethodAroundAdvice));
+        return new MethodAdvisor(methodDescription, new StaticMethodAroundInterceptor(adviceFactory.getAdvice(advisorConfig.getAdviceClassName())));
     }
     
     @Override
     public MethodAdvisor getComposedMethodAdvisor(final InDefinedShape methodDescription, final List<StaticMethodAdvisorConfiguration> advisorConfigs) {
-        Collection<StaticMethodAroundAdvice> staticMethodAroundAdvices = new LinkedList<>();
-        boolean isArgsOverride = false;
-        for (StaticMethodAdvisorConfiguration each : advisorConfigs) {
-            if (each.isOverrideArgs()) {
-                isArgsOverride = true;
-            }
-            if (null != each.getAdviceClassName()) {
-                staticMethodAroundAdvices.add(adviceFactory.getAdvice(each.getAdviceClassName()));
-            }
-        }
-        Object advice = isArgsOverride ? new ComposedStaticMethodInterceptorArgsOverride(staticMethodAroundAdvices) : new ComposedStaticMethodAroundInterceptor(staticMethodAroundAdvices);
-        return new MethodAdvisor(methodDescription, advice);
+        Collection<StaticMethodAroundAdvice> advices = advisorConfigs.stream().<StaticMethodAroundAdvice>map(each -> adviceFactory.getAdvice(each.getAdviceClassName())).collect(Collectors.toList());
+        return new MethodAdvisor(methodDescription, new ComposedStaticMethodAroundInterceptor(advices));
     }
 }