<commit_before>package cgeo.geocaching;

import org.apache.commons.lang3.StringUtils;

import android.content.SharedPreferences;
import android.util.Log;

import java.net.URLConnection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Handle cookies obtained from web sites.
 *
 * No other place should touch cookies directly, as we want to make sure
 * that the stored information is up-to-date.
 *
 */
final public class CookieJar {

    static private boolean cookiesLoaded = false;
    final static private HashMap<String, String> cookies = new HashMap<String, String>();

    static private String cache = null; // Cache information, or null if it has been invalidated

    static private void loadCookiesIfNeeded(final SharedPreferences prefs) {
        if (!cookiesLoaded) {
            cookies.clear();
            for (final Map.Entry<String, ?> entry : prefs.getAll().entrySet()) {
                if (entry.getKey().startsWith("cookie_")) {
                    cookies.put(entry.getKey().substring(7), (String) entry.getValue());
                }
            }
            cookiesLoaded = true;
        }
    }

    static public synchronized void setCookie(final SharedPreferences prefs, final String name, final String value) {
        loadCookiesIfNeeded(prefs);
        if (!cookies.containsKey(name) || cookies.get(name) != value) {
            final SharedPreferences.Editor editor = prefs.edit();
            cookies.put(name, value);
            editor.putString(name, value);
            cache = null;
            editor.commit();
        }
    }
<commit_msg>don't compare Strings using equals operator<commit_after>package cgeo.geocaching;

import org.apache.commons.lang3.StringUtils;

import android.content.SharedPreferences;
import android.util.Log;

import java.net.URLConnection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Handle cookies obtained from web sites.
 *
 * No other place should touch cookies directly, as we want to make sure
 * that the stored information is up-to-date.
 *
 */
final public class CookieJar {

    static private boolean cookiesLoaded = false;
    final static private HashMap<String, String> cookies = new HashMap<String, String>();

    static private String cache = null; // Cache information, or null if it has been invalidated

    static private void loadCookiesIfNeeded(final SharedPreferences prefs) {
        if (!cookiesLoaded) {
            cookies.clear();
            for (final Map.Entry<String, ?> entry : prefs.getAll().entrySet()) {
                if (entry.getKey().startsWith("cookie_")) {
                    cookies.put(entry.getKey().substring(7), (String) entry.getValue());
                }
            }
            cookiesLoaded = true;
        }
    }

    static public synchronized void setCookie(final SharedPreferences prefs, final String name, final String value) {
        loadCookiesIfNeeded(prefs);
        if (!cookies.containsKey(name) || !cookies.get(name).equals(value)) {
            final SharedPreferences.Editor editor = prefs.edit();
            cookies.put(name, value);
            editor.putString(name, value);
            cache = null;
            editor.commit();
        }
    }

{'fraction_non_alphanumeric': 0.10295893719806763, 'fraction_numerical': 0.0012077294685990338, 'mean_word_length': 2.7266591676040495, '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': '6425061', 'n_tokens_mistral': 884, 'n_tokens_neox': 872, 'n_words': 254}