<commit_before>package com.fireflysource.common.lifecycle;

import com.fireflysource.common.func.Callback;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;

public abstract class AbstractLifeCycle implements LifeCycle {

    protected static final List<Callback> stopActions = new CopyOnWriteArrayList<>();

    static {
        try {
            Runtime.getRuntime().addShutdownHook(new Thread(() -> {
                stopActions.forEach(a -> {
                    try {
                        a.call();
                    } catch (Exception e) {
                        System.err.println(e.getMessage());
                    }
                });
                System.out.println("Shutdown instance: " + stopActions.size());
                stopActions.clear();
            }, "the firefly shutdown thread"));
        } catch (Exception e) {
            System.err.println(e.getMessage());
        }
    }

    protected AtomicBoolean start;

    public AbstractLifeCycle() {
        stopActions.add(this::stop);
    }

    @Override
    public boolean isStarted() {<commit_msg>[fix]: the start flag is null<commit_after>package com.fireflysource.common.lifecycle;

import com.fireflysource.common.func.Callback;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;

public abstract class AbstractLifeCycle implements LifeCycle {

    protected static final List<Callback> stopActions = new CopyOnWriteArrayList<>();

    static {
        try {
            Runtime.getRuntime().addShutdownHook(new Thread(() -> {
                stopActions.forEach(a -> {
                    try {
                        a.call();
                    } catch (Exception e) {
                        System.err.println(e.getMessage());
                    }
                });
                System.out.println("Shutdown instance: " + stopActions.size());
                stopActions.clear();
            }, "the firefly shutdown thread"));
        } catch (Exception e) {
            System.err.println(e.getMessage());
        }
    }

    protected AtomicBoolean start = new AtomicBoolean(false);

    public AbstractLifeCycle() {
        stopActions.add(this::stop);
    }

    @Override
    public boolean isStarted() {
{'fraction_non_alphanumeric': 0.10749047820567076, 'fraction_numerical': 0.0, 'mean_word_length': 1.988621997471555, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '538009', 'n_tokens_mistral': 609, 'n_tokens_neox': 578, 'n_words': 119}