class StaticHolder {
    private static ClassPathConfigFunctionLoader INSTANCE = new ClassPathConfigFunctionLoader();
  }

  public static ClassPathConfigFunctionLoader getInstance() {
    return StaticHolder.INSTANCE;
  }

  private Map<String, AviatorFunction> functions = Collections.emptyMap();

  private ClassPathConfigFunctionLoader() {
    this.functions = this.load();
  }


  @Override
  public AviatorFunction onFunctionNotFound(String name) {
    return this.functions.get(name);
  }


  private static void info(String msg) {
    System.out.println("[Aviator INFO] " + msg);
  }


  private static void error(String msg) {
    System.out.println("[Aviator ERROR] " + msg);
  }


  /**
   * Load custom functions from config file, default is "aviator_functions.config" in classpath.
   *
   * @return
   */
  private Map<String, AviatorFunction> load() {<FILL_FUNCTION_BODY>

    InputStream in = null;
    InputStreamReader inreader = null;
    BufferedReader reader = null;
    Map<String, AviatorFunction> ret = new HashMap<String, AviatorFunction>();
    try {
      in = ClassPathConfigFunctionLoader.class.getClassLoader()
          .getResourceAsStream(CUSTOM_FUNCTION_LIST_FILE);
      if (in != null) {
        inreader = new InputStreamReader(in);
        reader = new BufferedReader(inreader);
        String line = null;
        while ((line = reader.readLine()) != null) {
          line = line.trim();
          if (line.startsWith("#")) {
            // skip comment
            continue;
          }
          if (line.length() > 0) {
            AviatorFunction func = loadClass(line);
            if (func != null) {
              ret.put(func.getName(), func);
            }
          }
        }
      }
    } catch (Throwable e) {
      error("Load aviator custom functions config from " + CUSTOM_FUNCTION_LIST_FILE + " failed.");
      e.printStackTrace();
    } finally {
      closeQuietly(reader);
      closeQuietly(inreader);
      closeQuietly(in);
      if (totalCustomFunctions > 0) {
        info("Total " + totalCustomFunctions + " custom functions loaded.");
      }
    }
    return ret;
  
<no_super_class>