public void dumpJavaIfNecessary(Class<?> clazz, Map<Class<?>, File> classFiles) {
        File dumpJavaFile = PathUtils.getStorePath(clazz, false);

        File classFile = classFiles.get(clazz);
        String source = Decompiler.decompile(classFile.getAbsolutePath(), null, false);
        Pattern pattern = Pattern.compile("(?m)^/\\*\\s*\\*/\\s*$" + System.getProperty("line.separator"));
        if (source != null) {
            source = pattern.matcher(source).replaceAll("");
        } else {
            source = "unknown";
        }

        PathUtils.writeByteArrayToFile(dumpJavaFile, source.getBytes());
        LogUtils.logit("Store java: " + clazz.getName() + " to " + dumpJavaFile.getAbsolutePath());

    }
referer https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/command/klass100/ClassDumpTransformer.java
agent/src/main/java/code/landgrey/copagent/common/ClassDumpTransformer.java