<!-- 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.

javaFileManager.putFileForInput(StandardLocation.SOURCE_PATH, packageName,
                className + ClassUtils.JAVA_EXTENSION, javaFileObject);
        Boolean result = compiler.getTask(null, javaFileManager, diagnosticCollector, options,
                null, Collections.singletonList(javaFileObject)).call();
        if (result == null || !result) {
            throw new IllegalStateException("Compilation failed. class: " + name + ", diagnostics: " + diagnosticCollector);
        }
        return classLoader.loadClass(name);
    }
    private static final class JavaFileObjectImpl extends SimpleJavaFileObject {
        private final CharSequence source;
        private ByteArrayOutputStream bytecode;
        public JavaFileObjectImpl(final String baseName, final CharSequence source) {
            super(ClassUtils.toURI(baseName + ClassUtils.JAVA_EXTENSION), Kind.SOURCE);
            this.source = source;
        }
        JavaFileObjectImpl(final String name, final Kind kind) {
            super(ClassUtils.toURI(name), kind);
            source = null;
        }
        public JavaFileObjectImpl(URI uri, Kind kind) {
            super(uri, kind);
            source = null;
        }
        @Override
        public CharSequence getCharContent(final boolean ignoreEncodingErrors) throws UnsupportedOperationException {
            if (source == null) {
                throw new UnsupportedOperationException("source == null");
            }
            return source;