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

albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new 1145b4015b Remove bytebuddy implementation (#13916)
1145b4015b is described below

commit 1145b4015b0f6ead51c3bd192638492bb8ee1a9e
Author: TomlongTK <[email protected]>
AuthorDate: Thu Mar 14 14:36:34 2024 +0800

    Remove bytebuddy implementation (#13916)
---
 .artifacts                                         |   1 -
 dubbo-distribution/dubbo-all/pom.xml               |   9 --
 dubbo-distribution/dubbo-bom/pom.xml               |   5 -
 dubbo-plugin/dubbo-plugin-proxy-bytebuddy/pom.xml  |  41 -------
 .../rpc/proxy/bytebuddy/ByteBuddyInterceptor.java  |  40 -------
 .../dubbo/rpc/proxy/bytebuddy/ByteBuddyProxy.java  | 130 ---------------------
 .../rpc/proxy/bytebuddy/ByteBuddyProxyFactory.java |  40 -------
 .../rpc/proxy/bytebuddy/ByteBuddyProxyInvoker.java |  56 ---------
 .../internal/org.apache.dubbo.rpc.ProxyFactory     |   1 -
 .../apache/dubbo/rpc/proxy/AbstractProxyTest.java  |  87 --------------
 .../org/apache/dubbo/rpc/proxy/RemoteService.java  |  26 -----
 .../proxy/bytebuddy/ByteBuddyInterceptorTest.java  |  45 -------
 .../proxy/bytebuddy/ByteBuddyProxyFactoryTest.java |  26 -----
 .../proxy/bytebuddy/ByteBuddyProxyInvokerTest.java |  41 -------
 .../rpc/proxy/bytebuddy/ByteBuddyProxyTest.java    |  44 -------
 .../org/apache/dubbo/rpc/support/DemoService.java  |  21 ----
 .../apache/dubbo/rpc/support/DemoServiceImpl.java  |  26 -----
 .../org/apache/dubbo/rpc/support/MyInvoker.java    |  89 --------------
 .../src/test/resources/log4j2-test.xml             |  29 -----
 dubbo-plugin/pom.xml                               |   1 -
 dubbo-test/dubbo-dependencies-all/pom.xml          |   5 -
 21 files changed, 763 deletions(-)

diff --git a/.artifacts b/.artifacts
index 3f3d84b604..cd6334693d 100644
--- a/.artifacts
+++ b/.artifacts
@@ -118,7 +118,6 @@ dubbo-seata-spring-boot-starter
 dubbo-spring-security
 dubbo-tracing
 dubbo-xds
-dubbo-plugin-proxy-bytebuddy
 dubbo-plugin-loom
 dubbo-rest-jaxrs
 dubbo-rest-servlet
diff --git a/dubbo-distribution/dubbo-all/pom.xml 
b/dubbo-distribution/dubbo-all/pom.xml
index ee749b1672..19fd7dbbfc 100644
--- a/dubbo-distribution/dubbo-all/pom.xml
+++ b/dubbo-distribution/dubbo-all/pom.xml
@@ -276,14 +276,6 @@
       <optional>true</optional>
     </dependency>
 
-    <dependency>
-      <groupId>org.apache.dubbo</groupId>
-      <artifactId>dubbo-plugin-proxy-bytebuddy</artifactId>
-      <version>${project.version}</version>
-      <scope>compile</scope>
-      <optional>true</optional>
-    </dependency>
-
     <dependency>
       <groupId>org.apache.dubbo</groupId>
       <artifactId>dubbo-rest-jaxrs</artifactId>
@@ -555,7 +547,6 @@
                   <include>org.apache.dubbo:dubbo-security</include>
                   <include>org.apache.dubbo:dubbo-reactive</include>
                   <include>org.apache.dubbo:dubbo-spring-security</include>
-                  
<include>org.apache.dubbo:dubbo-plugin-proxy-bytebuddy</include>
                   <include>org.apache.dubbo:dubbo-registry-api</include>
                   <include>org.apache.dubbo:dubbo-registry-multicast</include>
                   <include>org.apache.dubbo:dubbo-registry-multiple</include>
diff --git a/dubbo-distribution/dubbo-bom/pom.xml 
b/dubbo-distribution/dubbo-bom/pom.xml
index 4b0d3220c8..7e535f3421 100644
--- a/dubbo-distribution/dubbo-bom/pom.xml
+++ b/dubbo-distribution/dubbo-bom/pom.xml
@@ -329,11 +329,6 @@
         <version>${project.version}</version>
       </dependency>
 
-      <dependency>
-        <groupId>org.apache.dubbo</groupId>
-        <artifactId>dubbo-plugin-proxy-bytebuddy</artifactId>
-        <version>${project.version}</version>
-      </dependency>
       <dependency>
         <groupId>org.apache.dubbo</groupId>
         <artifactId>dubbo-rest-jaxrs</artifactId>
diff --git a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/pom.xml 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/pom.xml
deleted file mode 100644
index ac2b0b9d64..0000000000
--- a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.apache.dubbo</groupId>
-    <artifactId>dubbo-plugin</artifactId>
-    <version>${revision}</version>
-    <relativePath>../pom.xml</relativePath>
-  </parent>
-
-  <artifactId>dubbo-plugin-proxy-bytebuddy</artifactId>
-  <packaging>jar</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.dubbo</groupId>
-      <artifactId>dubbo-rpc-api</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>net.bytebuddy</groupId>
-      <artifactId>byte-buddy</artifactId>
-    </dependency>
-  </dependencies>
-</project>
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyInterceptor.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyInterceptor.java
deleted file mode 100644
index 25d5311d2e..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyInterceptor.java
+++ /dev/null
@@ -1,40 +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.dubbo.rpc.proxy.bytebuddy;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-public class ByteBuddyInterceptor {
-
-    private final InvocationHandler handler;
-
-    ByteBuddyInterceptor(InvocationHandler handler) {
-        this.handler = handler;
-    }
-
-    @RuntimeType
-    public Object intercept(@This Object obj, @AllArguments Object[] 
allArguments, @Origin Method method)
-            throws Throwable {
-        return handler.invoke(obj, method, allArguments);
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxy.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxy.java
deleted file mode 100644
index d414e542a1..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxy.java
+++ /dev/null
@@ -1,130 +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.dubbo.rpc.proxy.bytebuddy;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Map;
-import java.util.WeakHashMap;
-import java.util.concurrent.ConcurrentHashMap;
-
-import net.bytebuddy.ByteBuddy;
-import net.bytebuddy.description.ByteCodeElement;
-import net.bytebuddy.implementation.MethodDelegation;
-import net.bytebuddy.matcher.ElementMatcher;
-import net.bytebuddy.matcher.ElementMatchers;
-
-import static 
org.apache.dubbo.common.constants.CommonConstants.MAX_PROXY_COUNT;
-
-public class ByteBuddyProxy {
-
-    private static final Map<ClassLoader, Map<CacheKey, ByteBuddyProxy>> 
PROXY_CACHE_MAP = new WeakHashMap<>();
-
-    private final Class<?> proxyClass;
-
-    private final InvocationHandler handler;
-
-    private ByteBuddyProxy(Class<?> proxyClass, InvocationHandler handler) {
-        this.proxyClass = proxyClass;
-        this.handler = handler;
-    }
-
-    public static Object newInstance(ClassLoader cl, Class<?>[] interfaces, 
InvocationHandler handler) {
-        return getProxy(cl, interfaces, handler).newInstance();
-    }
-
-    private static ByteBuddyProxy getProxy(ClassLoader cl, Class<?>[] 
interfaces, InvocationHandler handler) {
-        if (interfaces.length > MAX_PROXY_COUNT) {
-            throw new IllegalArgumentException("interface limit exceeded");
-        }
-        interfaces = interfaces.clone();
-        Arrays.sort(interfaces, Comparator.comparing(Class::getName));
-        CacheKey key = new CacheKey(interfaces);
-        // get cache by class loader.
-        final Map<CacheKey, ByteBuddyProxy> cache;
-        synchronized (PROXY_CACHE_MAP) {
-            cache = PROXY_CACHE_MAP.computeIfAbsent(cl, k -> new 
ConcurrentHashMap<>());
-        }
-
-        ByteBuddyProxy proxy = cache.get(key);
-        if (proxy == null) {
-            synchronized (interfaces[0]) {
-                proxy = cache.get(key);
-                if (proxy == null) {
-                    // create ByteBuddyProxy class.
-                    proxy = new ByteBuddyProxy(buildProxyClass(cl, interfaces, 
handler), handler);
-                    cache.put(key, proxy);
-                }
-            }
-        }
-        return proxy;
-    }
-
-    private Object newInstance() {
-        try {
-            Constructor<?> constructor = 
proxyClass.getDeclaredConstructor(InvocationHandler.class);
-            return constructor.newInstance(handler);
-        } catch (ReflectiveOperationException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private static Class<?> buildProxyClass(ClassLoader cl, Class<?>[] ics, 
InvocationHandler handler) {
-        ElementMatcher.Junction<ByteCodeElement> methodMatcher = 
Arrays.stream(ics)
-                .map(ElementMatchers::isDeclaredBy)
-                .reduce(ElementMatcher.Junction::or)
-                .orElse(ElementMatchers.none())
-                
.and(ElementMatchers.not(ElementMatchers.isDeclaredBy(Object.class)));
-        return new ByteBuddy()
-                .subclass(Proxy.class)
-                .implement(ics)
-                .method(methodMatcher)
-                .intercept(MethodDelegation.to(new 
ByteBuddyInterceptor(handler)))
-                .make()
-                .load(cl)
-                .getLoaded();
-    }
-
-    private static class CacheKey {
-
-        private final Class<?>[] classes;
-
-        private CacheKey(Class<?>[] classes) {
-            this.classes = classes;
-        }
-
-        public Class<?>[] getClasses() {
-            return classes;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (this == o) return true;
-            if (o == null || getClass() != o.getClass()) return false;
-            CacheKey that = (CacheKey) o;
-            return Arrays.equals(classes, that.classes);
-        }
-
-        @Override
-        public int hashCode() {
-            return Arrays.hashCode(classes);
-        }
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyFactory.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyFactory.java
deleted file mode 100644
index 7f34686647..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyFactory.java
+++ /dev/null
@@ -1,40 +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.dubbo.rpc.proxy.bytebuddy;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.rpc.Invoker;
-import org.apache.dubbo.rpc.proxy.AbstractFallbackJdkProxyFactory;
-import org.apache.dubbo.rpc.proxy.InvokerInvocationHandler;
-
-/**
- * ByteBuddyRpcProxyFactory
- */
-public class ByteBuddyProxyFactory extends AbstractFallbackJdkProxyFactory {
-
-    @Override
-    protected <T> Invoker<T> doGetInvoker(T proxy, Class<T> type, URL url) {
-        return ByteBuddyProxyInvoker.newInstance(proxy, type, url);
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    protected <T> T doGetProxy(Invoker<T> invoker, Class<?>[] interfaces) {
-        ClassLoader classLoader = invoker.getInterface().getClassLoader();
-        return (T) ByteBuddyProxy.newInstance(classLoader, interfaces, new 
InvokerInvocationHandler(invoker));
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyInvoker.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyInvoker.java
deleted file mode 100644
index 9fd1778384..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyInvoker.java
+++ /dev/null
@@ -1,56 +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.dubbo.rpc.proxy.bytebuddy;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.rpc.proxy.AbstractProxyInvoker;
-import org.apache.dubbo.rpc.proxy.MethodInvoker;
-
-class ByteBuddyProxyInvoker<T> extends AbstractProxyInvoker<T> {
-
-    private final MethodInvoker methodInvoker;
-
-    private ByteBuddyProxyInvoker(T proxy, Class<T> type, URL url, 
MethodInvoker methodInvoker) {
-        super(proxy, type, url);
-        this.methodInvoker = methodInvoker;
-    }
-
-    @Override
-    protected Object doInvoke(T instance, String methodName, Class<?>[] 
parameterTypes, Object[] arguments)
-            throws Throwable {
-        if ("getClass".equals(methodName)) {
-            return instance.getClass();
-        }
-        if ("hashCode".equals(methodName)) {
-            return instance.hashCode();
-        }
-        if ("toString".equals(methodName)) {
-            return instance.toString();
-        }
-        if ("equals".equals(methodName)) {
-            if (arguments.length == 1) {
-                return instance.equals(arguments[0]);
-            }
-            throw new IllegalArgumentException("Invoke method [" + methodName 
+ "] argument number error.");
-        }
-        return methodInvoker.invoke(instance, methodName, parameterTypes, 
arguments);
-    }
-
-    static <T> ByteBuddyProxyInvoker<T> newInstance(T proxy, Class<T> type, 
URL url) {
-        return new ByteBuddyProxyInvoker<>(proxy, type, url, 
MethodInvoker.newInstance(proxy.getClass()));
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.ProxyFactory
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.ProxyFactory
deleted file mode 100644
index 54bdcb8d11..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.ProxyFactory
+++ /dev/null
@@ -1 +0,0 @@
-bytebuddy=org.apache.dubbo.rpc.proxy.bytebuddy.ByteBuddyProxyFactory
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/AbstractProxyTest.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/AbstractProxyTest.java
deleted file mode 100644
index 09158b38df..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/AbstractProxyTest.java
+++ /dev/null
@@ -1,87 +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.dubbo.rpc.proxy;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.rpc.Invoker;
-import org.apache.dubbo.rpc.ProxyFactory;
-import org.apache.dubbo.rpc.RpcInvocation;
-import org.apache.dubbo.rpc.service.Destroyable;
-import org.apache.dubbo.rpc.service.EchoService;
-import org.apache.dubbo.rpc.support.DemoService;
-import org.apache.dubbo.rpc.support.DemoServiceImpl;
-import org.apache.dubbo.rpc.support.MyInvoker;
-
-import java.util.Arrays;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-
-public abstract class AbstractProxyTest {
-
-    public static ProxyFactory factory;
-
-    @Test
-    void testGetProxy() {
-        URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1");
-
-        MyInvoker<DemoService> invoker = new MyInvoker<>(url);
-
-        DemoService proxy = factory.getProxy(invoker);
-
-        Assertions.assertNotNull(proxy);
-
-        
Assertions.assertTrue(Arrays.asList(proxy.getClass().getInterfaces()).contains(DemoService.class));
-        
Assertions.assertTrue(Arrays.asList(proxy.getClass().getInterfaces()).contains(Destroyable.class));
-        
Assertions.assertTrue(Arrays.asList(proxy.getClass().getInterfaces()).contains(EchoService.class));
-
-        Assertions.assertEquals(
-                invoker.invoke(new RpcInvocation(
-                                "echo",
-                                DemoService.class.getName(),
-                                DemoService.class.getName() + ":dubbo",
-                                new Class[] {String.class},
-                                new Object[] {"aa"}))
-                        .getValue(),
-                proxy.echo("aa"));
-
-        Destroyable destroyable = (Destroyable) proxy;
-        destroyable.$destroy();
-        Assertions.assertTrue(invoker.isDestroyed());
-    }
-
-    @Test
-    void testGetInvoker() {
-        URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1");
-
-        DemoService origin = new DemoServiceImpl();
-
-        Invoker<DemoService> invoker = factory.getInvoker(new 
DemoServiceImpl(), DemoService.class, url);
-
-        Assertions.assertEquals(invoker.getInterface(), DemoService.class);
-
-        Assertions.assertEquals(
-                invoker.invoke(new RpcInvocation(
-                                "echo",
-                                DemoService.class.getName(),
-                                DemoService.class.getName() + ":dubbo",
-                                new Class[] {String.class},
-                                new Object[] {"aa"}))
-                        .getValue(),
-                origin.echo("aa"));
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/RemoteService.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/RemoteService.java
deleted file mode 100644
index 1cf9878afe..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/RemoteService.java
+++ /dev/null
@@ -1,26 +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.dubbo.rpc.proxy;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface RemoteService extends Remote {
-    String sayHello(String name) throws RemoteException;
-
-    String getThreadName() throws RemoteException;
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyInterceptorTest.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyInterceptorTest.java
deleted file mode 100644
index 3ea668a532..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyInterceptorTest.java
+++ /dev/null
@@ -1,45 +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.dubbo.rpc.proxy.bytebuddy;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.Mockito;
-
-class ByteBuddyInterceptorTest {
-
-    @AfterEach
-    public void after() {
-        Mockito.clearAllCaches();
-    }
-
-    @Test
-    void testIntercept() throws Throwable {
-        InvocationHandler handler = Mockito.mock(InvocationHandler.class);
-        ByteBuddyInterceptor interceptor = new ByteBuddyInterceptor(handler);
-        Method method = Mockito.mock(Method.class);
-        Proxy proxy = Mockito.mock(Proxy.class);
-        Object[] args = new Object[0];
-        interceptor.intercept(proxy, args, method);
-        // 'intercept' method will call 'invoke' method directly
-        Mockito.verify(handler, Mockito.times(1)).invoke(proxy, method, args);
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyFactoryTest.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyFactoryTest.java
deleted file mode 100644
index 776dfa3d6c..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyFactoryTest.java
+++ /dev/null
@@ -1,26 +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.dubbo.rpc.proxy.bytebuddy;
-
-import org.apache.dubbo.rpc.proxy.AbstractProxyTest;
-
-class ByteBuddyProxyFactoryTest extends AbstractProxyTest {
-
-    static {
-        AbstractProxyTest.factory = new ByteBuddyProxyFactory();
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyInvokerTest.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyInvokerTest.java
deleted file mode 100644
index 6dd9c004a3..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyInvokerTest.java
+++ /dev/null
@@ -1,41 +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.dubbo.rpc.proxy.bytebuddy;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.rpc.proxy.RemoteService;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-import org.mockito.Mockito;
-
-class ByteBuddyProxyInvokerTest {
-
-    @Test
-    void testNewInstance() throws Throwable {
-        URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1");
-        RemoteService proxy = Mockito.mock(RemoteService.class);
-        ByteBuddyProxyInvoker<RemoteService> invoker =
-                ByteBuddyProxyInvoker.newInstance(proxy, RemoteService.class, 
url);
-        invoker.doInvoke(proxy, "sayHello", new Class[] {String.class}, new 
Object[] {"test"});
-        Mockito.verify(proxy, Mockito.times(1)).sayHello("test");
-
-        Assertions.assertThrows(
-                IllegalArgumentException.class,
-                () -> invoker.doInvoke(proxy, "equals", new Class[] 
{String.class}, new Object[] {"test", "test2"}));
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyTest.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyTest.java
deleted file mode 100644
index 9cf18e41d6..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/proxy/bytebuddy/ByteBuddyProxyTest.java
+++ /dev/null
@@ -1,44 +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.dubbo.rpc.proxy.bytebuddy;
-
-import org.apache.dubbo.rpc.proxy.InvokerInvocationHandler;
-import org.apache.dubbo.rpc.proxy.RemoteService;
-
-import java.lang.reflect.Proxy;
-
-import org.junit.jupiter.api.Test;
-import org.mockito.Mockito;
-
-import static org.junit.jupiter.api.Assertions.assertInstanceOf;
-import static org.mockito.ArgumentMatchers.any;
-
-class ByteBuddyProxyTest {
-
-    @Test
-    void testNewInstance() throws Throwable {
-        ClassLoader cl = Thread.currentThread().getContextClassLoader();
-        InvokerInvocationHandler handler = 
Mockito.mock(InvokerInvocationHandler.class);
-        Object proxy = ByteBuddyProxy.newInstance(cl, new Class<?>[] 
{RemoteService.class}, handler);
-        assertInstanceOf(RemoteService.class, proxy);
-        assertInstanceOf(Proxy.class, proxy);
-        RemoteService remoteService = (RemoteService) proxy;
-        remoteService.getThreadName();
-        remoteService.sayHello("test");
-        Mockito.verify(handler, Mockito.times(2)).invoke(any(), any(), any());
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/DemoService.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/DemoService.java
deleted file mode 100644
index 8bc9395c8b..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/DemoService.java
+++ /dev/null
@@ -1,21 +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.dubbo.rpc.support;
-
-public interface DemoService {
-    String echo(String text);
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/DemoServiceImpl.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/DemoServiceImpl.java
deleted file mode 100644
index 90fd7b1f84..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/DemoServiceImpl.java
+++ /dev/null
@@ -1,26 +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.dubbo.rpc.support;
-
-/**
- * DemoServiceImpl
- */
-public class DemoServiceImpl implements DemoService {
-    public String echo(String text) {
-        return text;
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/MyInvoker.java
 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/MyInvoker.java
deleted file mode 100644
index 670a3f7885..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/java/org/apache/dubbo/rpc/support/MyInvoker.java
+++ /dev/null
@@ -1,89 +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.dubbo.rpc.support;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.rpc.AppResponse;
-import org.apache.dubbo.rpc.AsyncRpcResult;
-import org.apache.dubbo.rpc.Invocation;
-import org.apache.dubbo.rpc.Invoker;
-import org.apache.dubbo.rpc.Result;
-import org.apache.dubbo.rpc.RpcException;
-
-import java.util.concurrent.CompletableFuture;
-
-/**
- * MockInvoker.java
- */
-public class MyInvoker<T> implements Invoker<T> {
-
-    URL url;
-    Class<T> type;
-    boolean hasException = false;
-    boolean destroyed = false;
-
-    public MyInvoker(URL url) {
-        this.url = url;
-        type = (Class<T>) DemoService.class;
-    }
-
-    public MyInvoker(URL url, boolean hasException) {
-        this.url = url;
-        type = (Class<T>) DemoService.class;
-        this.hasException = hasException;
-    }
-
-    @Override
-    public Class<T> getInterface() {
-        return type;
-    }
-
-    public URL getUrl() {
-        return url;
-    }
-
-    @Override
-    public boolean isAvailable() {
-        return false;
-    }
-
-    @Override
-    public Result invoke(Invocation invocation) throws RpcException {
-        AppResponse result = new AppResponse();
-        if (!hasException) {
-            result.setValue("alibaba");
-        } else {
-            result.setException(new RuntimeException("mocked exception"));
-        }
-
-        return new AsyncRpcResult(CompletableFuture.completedFuture(result), 
invocation);
-    }
-
-    @Override
-    public void destroy() {
-        destroyed = true;
-    }
-
-    public boolean isDestroyed() {
-        return destroyed;
-    }
-
-    @Override
-    public String toString() {
-        return "MyInvoker.toString()";
-    }
-}
diff --git 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/resources/log4j2-test.xml 
b/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/resources/log4j2-test.xml
deleted file mode 100644
index ba99f52cc2..0000000000
--- 
a/dubbo-plugin/dubbo-plugin-proxy-bytebuddy/src/test/resources/log4j2-test.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<Configuration status="WARN">
-    <Appenders>
-        <Console name="Console" target="SYSTEM_OUT" follow="true">
-            <PatternLayout pattern="%d{HH:mm:ss.SSS} |-%highlight{%-5p} [%t] 
%40.40c:%-3L -| 
%m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect,org.junit,org.mockito)}"
 charset="UTF-8"/>
-        </Console>
-    </Appenders>
-    <Loggers>
-        <Root level="info">
-            <AppenderRef ref="Console"/>
-        </Root>
-    </Loggers>
-</Configuration>
diff --git a/dubbo-plugin/pom.xml b/dubbo-plugin/pom.xml
index a345ab5db2..fa1466ef0a 100644
--- a/dubbo-plugin/pom.xml
+++ b/dubbo-plugin/pom.xml
@@ -40,7 +40,6 @@
     <module>dubbo-compiler</module>
     <module>dubbo-filter-cache</module>
     <module>dubbo-filter-validation</module>
-    <module>dubbo-plugin-proxy-bytebuddy</module>
     <module>dubbo-rest-jaxrs</module>
     <module>dubbo-rest-servlet</module>
     <module>dubbo-rest-spring</module>
diff --git a/dubbo-test/dubbo-dependencies-all/pom.xml 
b/dubbo-test/dubbo-dependencies-all/pom.xml
index dc961a6289..8bfc74434b 100644
--- a/dubbo-test/dubbo-dependencies-all/pom.xml
+++ b/dubbo-test/dubbo-dependencies-all/pom.xml
@@ -251,11 +251,6 @@
       <version>${project.version}</version>
     </dependency>
 
-    <dependency>
-      <groupId>org.apache.dubbo</groupId>
-      <artifactId>dubbo-plugin-proxy-bytebuddy</artifactId>
-      <version>${project.version}</version>
-    </dependency>
     <dependency>
       <groupId>org.apache.dubbo</groupId>
       <artifactId>dubbo-rest-jaxrs</artifactId>


Reply via email to