<commit_before>package com.path.android.jobqueue;

import com.path.android.jobqueue.log.JqLog;

import java.io.Serializable;

abstract public class BaseJob implements Serializable {
    public static final int DEFAULT_RETRY_LIMIT = 20;
    private final boolean requiresNetwork;
    private final String groupId;
    private transient int currentRunCount;

    protected BaseJob(boolean requiresNetwork) {
        this(requiresNetwork, null);
    }

    protected BaseJob(String groupId) {
        this(false, groupId);
    }

    protected BaseJob(boolean requiresNetwork, String groupId) {
        this.requiresNetwork = requiresNetwork;
        this.groupId = groupId;
    }

    /**
     * called when the job is added to disk and committed.
     * this means job will eventually run. this is a good time to update local database and dispatch events
     * Changes to this class will not be preserved if your job is persistent !!!
     * Also, if your app crashes right after adding the job, {@code onRun} might be called without an {@code onAdded} call<commit_msg>add custom serialization code to base job<commit_after>package com.path.android.jobqueue;

import com.path.android.jobqueue.log.JqLog;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

abstract public class BaseJob implements Serializable {
    public static final int DEFAULT_RETRY_LIMIT = 20;
    private boolean requiresNetwork;
    private String groupId;
    private transient int currentRunCount;

    protected BaseJob(boolean requiresNetwork) {
        this(requiresNetwork, null);
    }

    protected BaseJob(String groupId) {
        this(false, groupId);
    }

    protected BaseJob(boolean requiresNetwork, String groupId) {
        this.requiresNetwork = requiresNetwork;
        this.groupId = groupId;
    }

    private void writeObject(ObjectOutputStream oos) throws IOException {
        oos.writeBoolean(requiresNetwork);
        oos.writeObject(groupId);
    }


    private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
        requiresNetwork = ois.readBoolean();
        groupId = (String) ois.readObject();
    }

    /**
     * called when the job is added to disk and committed.
     * this means job will eventually run. this is a good time to update local database and dispatch events
     * Changes to this class will not be preserved if your job is persistent !!!
     * Also, if your app crashes right after adding the job, {@code onRun} might be called without an {@code onAdded} call
{'fraction_non_alphanumeric': 0.0676142912024587, 'fraction_numerical': 0.001536688436419516, 'mean_word_length': 3.458904109589041, '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': '4370050', 'n_tokens_mistral': 681, 'n_tokens_neox': 654, 'n_words': 249}