public static CompilerOptions createOptions()

in src/main/java/org/apache/sling/scripting/java/impl/CompilerOptions.java [33:54]


    public static CompilerOptions createOptions(final JavaScriptEngineFactory.Config config) {
        final String currentVersion = System.getProperty("java.specification.version");
        final CompilerOptions opts = new CompilerOptions();

        opts.put(Options.KEY_GENERATE_DEBUG_INFO, config.java_classdebuginfo());

        opts.put(Options.KEY_SOURCE_VERSION, config.java_compilerSourceVM());
        if (JavaScriptEngineFactory.VERSION_AUTO.equalsIgnoreCase((String) opts.get(Options.KEY_SOURCE_VERSION))) {
            opts.put(Options.KEY_SOURCE_VERSION, currentVersion);
        }

        opts.put(Options.KEY_TARGET_VERSION, config.java_compilerTargetVM());
        if (JavaScriptEngineFactory.VERSION_AUTO.equalsIgnoreCase((String) opts.get(Options.KEY_TARGET_VERSION))) {
            opts.put(Options.KEY_TARGET_VERSION, currentVersion);
        }

        opts.encoding = config.java_javaEncoding();

        opts.put(Options.KEY_IGNORE_WARNINGS, true);

        return opts;
    }