<commit_before>package org.wikipedia.readinglist.database;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.apache.commons.lang3.StringUtils;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.page.Namespace;
import org.wikipedia.page.PageTitle;
import org.wikipedia.settings.Prefs;

import java.io.Serializable;

public class ReadingListPage implements Serializable {
    public static final int STATUS_QUEUE_FOR_SAVE = 0;
    public static final int STATUS_SAVED = 1;
    public static final int STATUS_QUEUE_FOR_DELETE = 2;
    public static final int STATUS_QUEUE_FOR_FORCED_SAVE = 3;

    public static final ReadingListPageTable DATABASE_TABLE = new ReadingListPageTable();

    private long id;
    private long listId;
    @NonNull private final WikiSite wiki;
    @NonNull private final Namespace namespace;
    @NonNull private String displayTitle;
    @NonNull private final String apiTitle;
    @Nullable private String description;
    @Nullable private String thumbUrl;

    private long mtime;
    private long atime;

    private boolean offline;
    private int status;
    private long sizeBytes;
    private String lang;
    private long revId;
    private long remoteId;

    private transient int downloadProgress;
    private transient boolean selected;
    @Nullable private transient String accentAndCaseInvariantTitle;

    public ReadingListPage(@NonNull WikiSite wiki, @NonNull Namespace namespace,
                           @NonNull String displayTitle, @NonNull String apiTitle, long listId) {
        this.wiki = wiki;
        this.namespace = namespace;
        this.displayTitle = displayTitle;
        this.apiTitle = apiTitle;
        this.listId = listId;
    }

    public ReadingListPage(@NonNull PageTitle title) {
        this.wiki = title.getWikiSite();
        this.namespace = title.namespace();
        this.displayTitle = title.getDisplayText();
        this.apiTitle = title.getPrefixedText();
        this.thumbUrl = title.getThumbUrl();<commit_msg>Prevent empty title when upgrading db<commit_after>package org.wikipedia.readinglist.database;

import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.apache.commons.lang3.StringUtils;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.page.Namespace;
import org.wikipedia.page.PageTitle;
import org.wikipedia.settings.Prefs;

import java.io.Serializable;

public class ReadingListPage implements Serializable {
    public static final int STATUS_QUEUE_FOR_SAVE = 0;
    public static final int STATUS_SAVED = 1;
    public static final int STATUS_QUEUE_FOR_DELETE = 2;
    public static final int STATUS_QUEUE_FOR_FORCED_SAVE = 3;

    public static final ReadingListPageTable DATABASE_TABLE = new ReadingListPageTable();

    private long id;
    private long listId;
    @NonNull private final WikiSite wiki;
    @NonNull private final Namespace namespace;
    @NonNull private String displayTitle;
    @NonNull private final String apiTitle;
    @Nullable private String description;
    @Nullable private String thumbUrl;

    private long mtime;
    private long atime;

    private boolean offline;
    private int status;
    private long sizeBytes;
    private String lang;
    private long revId;
    private long remoteId;

    private transient int downloadProgress;
    private transient boolean selected;
    @Nullable private transient String accentAndCaseInvariantTitle;

    public ReadingListPage(@NonNull WikiSite wiki, @NonNull Namespace namespace,
                           @NonNull String displayTitle, @NonNull String apiTitle, long listId) {
        this.wiki = wiki;
        this.namespace = namespace;
        this.displayTitle = displayTitle;
        this.apiTitle = TextUtils.isEmpty(apiTitle) ? displayTitle : apiTitle;
        this.listId = listId;
    }

    public ReadingListPage(@NonNull PageTitle title) {
        this.wiki = title.getWikiSite();
        this.namespace = title.namespace();
        this.displayTitle = title.getDisplayText();
        this.apiTitle = title.getPrefixedText();
        this.thumbUrl = title.getThumbUrl();
{'fraction_non_alphanumeric': 0.06728704366499642, 'fraction_numerical': 0.0023860653781913625, 'mean_word_length': 3.6065934065934067, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1090688', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1108, 'n_words': 334}