<commit_before>/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.harmony.tools.javac;

import java.io.File;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;

/**
 * A proxy to the Java source code compiler itself.
 */
class Compiler {

    /* A default encoding for console messages */
    static String CONSOLE_ENCODING = System.getProperty("console.encoding",
            "ISO8859_1");

    /* FIXME: Hard-coded for now, the name of the ECJ JAR file */
    static final String ECJ_JAR_FILE = "ecj_3.2RC5.jar";

    /* The name of the ECJ compiler class */
    static final String MAIN_CLASS_NAME = "org.eclipse.jdt.internal.compiler.batch.Main";

    /*
     * Invokes the compiler with the given command-line arguments. The supported
     * arguments can be determined form the usage mesage.
     */
    public static void main(String[] args) {
        Compiler myself = new Compiler();
        myself.initialize();
        // If there is a problem invoking the method, simply dump the trace for
        // now
        try {
            myself.staticMainMth.invoke(myself.mainInst, new Object[] { args });
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }

    // Reference to ECJ 'Main' compiler class.
    Class ecjCompilerClass;

    // An instance of the ECJ compiler
    Object mainInst;

    // The Main#printUsage() method.<commit_msg>Update compiler impl reference (should not be hardcoded like this)<commit_after>/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.harmony.tools.javac;

import java.io.File;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;

/**
 * A proxy to the Java source code compiler itself.
 */
class Compiler {

    /* A default encoding for console messages */
    static String CONSOLE_ENCODING = System.getProperty("console.encoding",
            "ISO8859_1");

    /* FIXME: Hard-coded for now, the name of the ECJ JAR file */
    static final String ECJ_JAR_FILE = "ecj_3.2MAINT.jar";

    /* The name of the ECJ compiler class */
    static final String MAIN_CLASS_NAME = "org.eclipse.jdt.internal.compiler.batch.Main";

    /*
     * Invokes the compiler with the given command-line arguments. The supported
     * arguments can be determined form the usage mesage.
     */
    public static void main(String[] args) {
        Compiler myself = new Compiler();
        myself.initialize();
        // If there is a problem invoking the method, simply dump the trace for
        // now
        try {
            myself.staticMainMth.invoke(myself.mainInst, new Object[] { args });
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }

    // Reference to ECJ 'Main' compiler class.
    Class ecjCompilerClass;

    // An instance of the ECJ compiler
    Object mainInst;

    // The Main#printUsage() method.
{'fraction_non_alphanumeric': 0.08632218844984803, 'fraction_numerical': 0.006281661600810537, 'mean_word_length': 3.0326797385620914, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '260210', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1286, 'n_words': 488}