<commit_before>package org.probedroid;

import org.probedroid.support.MethodBundle;

public abstract class Instrument {
    public void prepareNativeBridge(String pathLib) {
        System.load(pathLib);
    }

    public void instrumentMethod(boolean isStatic, String nameClass,
            String nameMethod, String signatureMethod, MethodBundle bundle)
            throws ClassNotFoundException, NoSuchMethodException,
            IllegalArgumentException {
        instrumentMethodNative(isStatic, nameClass, nameMethod,
                signatureMethod, bundle);
    }

    public abstract void onApplicationStart();

    public abstract void onApplicationStop();

    private native void instrumentMethodNative(boolean isStatic,
            String nameClass, String nameMethod, String signatureMethod,
            MethodBundle bundle) throws ClassNotFoundException,
            NoSuchMethodException, IllegalArgumentException;
}<commit_msg>Update the javadoc comment for Instrument class.<commit_after>package org.probedroid;

import org.probedroid.support.MethodBundle;

/**
 * The entry point of ProbeDroid which defines the callbacks indicating the
 * change of app life cycle and also provides the interfaces for analysts to
 * register the instrumentation gadgets for interested methods. <b><i>Analysts
 * should inherit this Instrument class as the main class of their analysis
 * package.</i></b>
 *
 * <pre class="prettyprint">
 * public class MyInstrument extends Instrument {
 *
 *     &#064;Override
 *     public void onApplicationStart() {
 *         // Do some initialization.
 *
 *         // Register the instrumentation gadgets.
 *         String nameClass = &quot;java.lang.StringBuilder&quot;;
 *         String nameMethod = &quot;toString&quot;;
 *         String signatureMethod = &quot;()Ljava/lang/String;&quot;;
 *         BundleStringBuilder bundleBuilder = new BundleStringBuilder(false, true);
 *         instrumentMethod(false, nameClass, nameMethod, signatureMethod,
 *                 bundleBuilder);
 *     }
 *
 *     &#064;Override
 *     public void onApplicationStop() {
 *         // Do some finalization.
 *     }
 * }
 * </pre>
 */
public abstract class Instrument {

    /**
     * @hide
     */
    public void prepareNativeBridge(String pathLib) {
        System.load(pathLib);
    }

    /**
     * Let analyst to <b><i>register instrument gadget for the interested
     * method.</i></b> Currently, the abstract method or native method is not
     * supported yet.
     *
     * @param isStatic
     *            The flag indicating whether the target method is static or
     *            not.
     * @param nameClass
     *            The name of the class defining the target method.
     * @param nameMethod
     *            The target method name.
     * @param signatureMethod
     *            The target method signature representing the data types of
     *            arguments and return value.
     * @param bundle
     *            The instrument gadget for the target method.
     *
     *
     * @throws ClassNotFoundException
     *             The class defining the target method cannot be found.
     *
     * @throws NoSuchMethodException
     *             The target method cannot be resolved (Probably due to wrong
     *             signature).
     * @throws IllegalArgumentException
     *             Illegal arguments passed to this method (Probably null String
     *             or MethodBundle).
     *
     */
    public void instrumentMethod(boolean isStatic, String nameClass,
            String nameMethod, String signatureMethod, MethodBundle bundle)
            throws ClassNotFoundException, NoSuchMethodException,
            IllegalArgumentException {
        instrumentMethodNative(isStatic, nameClass, nameMethod,
                signatureMethod, bundle);
    }

    /**
     * The callback indicating that the instrumented app is just launched.
     * <b><i>Analyst should override this method for initialization.</i></b>
     * Like registering the instrumentation gadgets or creating the custom
     * profiling utilities.
     */
    public abstract void onApplicationStart();

    /**
     * The callback indicating that the instrumented app is just terminated.
     * <b><i>Analyst should override this method for finalization.</i></b> Like
     * dumping the profiled information to the external storage.
     */
    public abstract void onApplicationStop();

    private native void instrumentMethodNative(boolean isStatic,
            String nameClass, String nameMethod, String signatureMethod,
            MethodBundle bundle) throws ClassNotFoundException,
            NoSuchMethodException, IllegalArgumentException;
}
{'fraction_non_alphanumeric': 0.07073274036425244, 'fraction_numerical': 0.0012706480304955528, 'mean_word_length': 2.624712202609363, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2261716', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1072, 'n_words': 383}