<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->

- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: migrating from 3.0.5 to 3.0.6

### Steps to reproduce this issue

https://github.com/XenoAmess/metasploit-java-external-module/runs/5522599197?check_suite_focus=true

https://github.com/XenoAmess/metasploit-java-external-module/pull/65

### Expected Behavior

DO NOT DELETE EXISTED API WITHIN SAME MAJOR VERSION

PLEASE JUST FOLLOW SEMVER

### Actual Behavior

compile failure.

URLClassLoader urlClassLoader = (URLClassLoader) loader;
                List<File> files = new ArrayList<File>();
                for (URL url : urlClassLoader.getURLs()) {
                    files.add(new File(url.getFile()));
                }
                manager.setLocation(StandardLocation.CLASS_PATH, files);
            } catch (IOException e) {
                throw new IllegalStateException(e.getMessage(), e);
            }
        }
        classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoaderImpl>() {
            @Override
            public ClassLoaderImpl run() {
                return new ClassLoaderImpl(loader);
            }
        });
        javaFileManager = new JavaFileManagerImpl(manager, classLoader);
    }
    public JdkCompiler() {
        this(buildDefaultOptions());
    }
    public JdkCompiler(String javaVersion) {
        this(buildDefaultOptions(javaVersion));
    }
    @Override
    public Class<?> doCompile(Class<?> neighbor, ClassLoader ignored, String name, String sourceCode) throws Throwable {
        int i = name.lastIndexOf('.');
        String packageName = i < 0 ? "" : name.substring(0, i);
        String className = i < 0 ? name : name.substring(i + 1);
        JavaFileObjectImpl javaFileObject = new JavaFileObjectImpl(className, sourceCode);