docs: @Override
      public synchronized Class<?> doCompile(String name, String sourceCode, OutputStream os) throws Throwable {
  
          if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("Begin to compile source code: class is '{}'", name);
          }
  
          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);
          javaFileManager.putFileForInput(StandardLocation.SOURCE_PATH, packageName,
                  className + ClassUtils.JAVA_EXTENSION, javaFileObject);
  
          DiagnosticCollector<JavaFileObject> diagnosticCollector = new DiagnosticCollector<JavaFileObject>();
          Boolean result = compiler.getTask(null, javaFileManager, diagnosticCollector, options, null,
                  Arrays.asList(new JavaFileObject[] { javaFileObject })).call();
          if (result == null || !result.booleanValue()) {
              throw new IllegalStateException(
                      "Compilation failed. class: " + name + ", diagnostics: " + diagnosticCollector.getDiagnostics());
          }
  
          if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("compile source code done: class is '{}'", name);
              LOGGER.debug("loading class '{}'", name);
          }
  
          Class<?> retClass = classLoader.loadClass(name);
          if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("loading class done  '{}'", name);
          }
  
          if (os != null) {
              byte[] bytes = classLoader.loadClassBytes(name);
              if (bytes != null) {
                  os.write(bytes);
                  os.flush();
              }
          }
          return retClass;
      }