<commit_before>package net.xpece.android.support.preference;

import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import android.support.annotation.XmlRes;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.preference.PreferenceScreen;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Used to help create {@link Preference} hierarchies
 * from activities or XML.
 * <p>
 * In most cases, clients should use
 * {@link XpPreferenceFragment#addPreferencesFromResource(int)}.
 *
 * @see XpPreferenceFragment
 */
public final class XpPreferenceManager extends PreferenceManager {

    private static final String[] DEFAULT_PACKAGES;

    static {
        final Set<String> defaultPackages = new HashSet<>();
        defaultPackages.add(net.xpece.android.support.preference.Preference.class.getPackage().getName() + ".");
        // Support the AndroidX relocated classes.
        defaultPackages.add(Preference.class.getPackage().getName() + ".");
        try {
            defaultPackages.add(SwitchPreference.class.getPackage().getName() + ".");
        } catch (NoClassDefFoundError ignore) {<commit_msg>Fixed regression: Preserve order of default preference packages<commit_after>package net.xpece.android.support.preference;

import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import android.support.annotation.XmlRes;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.preference.PreferenceScreen;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

/**
 * Used to help create {@link Preference} hierarchies
 * from activities or XML.
 * <p>
 * In most cases, clients should use
 * {@link XpPreferenceFragment#addPreferencesFromResource(int)}.
 *
 * @see XpPreferenceFragment
 */
public final class XpPreferenceManager extends PreferenceManager {

    private static final String[] DEFAULT_PACKAGES;

    static {
        final Set<String> defaultPackages = new LinkedHashSet<>(); // Preserve order.
        defaultPackages.add(net.xpece.android.support.preference.Preference.class.getPackage().getName() + ".");
        // Support the AndroidX relocated classes.
        defaultPackages.add(Preference.class.getPackage().getName() + ".");
        try {
            defaultPackages.add(SwitchPreference.class.getPackage().getName() + ".");
        } catch (NoClassDefFoundError ignore) {
{'fraction_non_alphanumeric': 0.10837438423645321, 'fraction_numerical': 0.003284072249589491, 'mean_word_length': 4.747169811320755, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5568234', 'n_tokens_mistral': 842, 'n_tokens_neox': 828, 'n_words': 175}