<commit_before>package woods.log.timber;

import android.support.annotation.NonNull;

/**
 * A tree catches un-handle exception and monitor memory leak
 */

public class CatcherTree implements Tree {

    // Save input policy here
    private Policy Policy = null;

    // Save system default UncaughtException here
    private Thread.UncaughtExceptionHandler defaultHandler = null;

    @Override
    public Tree tag(String tag) {
        return this;
    }

    @Override
    public Tree policy(Policy policy) {
        Policy = policy;
        return this;
    }

    @Override
    public Tree prober(Prober prober) {
        return this;
    }

    @Override
    public void v(@NonNull String message, Object... args) {
    }

    @Override
    public void v(@NonNull Throwable t, @NonNull String message, Object... args) {
    }

    @Override
    public void d(@NonNull String message, Object... args) {
    }

    @Override
    public void d(@NonNull Throwable t, @NonNull String message, Object... args) {
    }

    @Override
    public void i(@NonNull String message, Object... args) {
    }

    @Override
    public void i(@NonNull Throwable t, @NonNull String message, Object... args) {
    }

    @Override
    public void w(@NonNull String message, Object... args) {
    }

    @Override
    public void w(@NonNull Throwable t, @NonNull String message, Object... args) {
    }

    @Override
    public void e(@NonNull String message, Object... args) {
    }

    @Override
    public void e(@NonNull Throwable t, @NonNull String message, Object... args) {
    }

    @Override
    public void wtf(@NonNull String message, Object... args) {
    }

    @Override
    public void wtf(@NonNull Throwable t, @NonNull String message, Object... args) {
    }

    @Override
    public void plant() {
        defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler(handler);
    }

    @Override
    public void uproot() {
        Thread.setDefaultUncaughtExceptionHandler(defaultHandler);
    }


    private final Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {

        @Override
        public void uncaughtException(Thread thread, Throwable throwable) {
            if (throwable != null) {
                handleException(throwable);<commit_msg>Draw interface plant out of Tree and rename Tree to Wood  Rename LogTree to Tree<commit_after>package woods.log.timber;

/**
 * A tree catches un-handle exception and monitor memory leak
 */

public class CatcherTree implements Plant {

    // Save input policy here
    private Policy Policy = null;

    // Save system default UncaughtException here
    private Thread.UncaughtExceptionHandler defaultHandler = null;

    @Override
    public void plant() {
        defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler(handler);
    }

    @Override
    public void uproot() {
        Thread.setDefaultUncaughtExceptionHandler(defaultHandler);
    }


    private final Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {

        @Override
        public void uncaughtException(Thread thread, Throwable throwable) {
            if (throwable != null) {
                handleException(throwable);
{'fraction_non_alphanumeric': 0.08570572370392568, 'fraction_numerical': 0.0, 'mean_word_length': 2.763246899661781, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '10107', 'n_tokens_mistral': 880, 'n_tokens_neox': 864, 'n_words': 276}