<commit_before>package org.msf.records;

import android.app.Application;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import org.msf.records.net.BuendiaServer;
import org.msf.records.net.OpenMrsServer;
import org.msf.records.net.OpenMrsXformsConnection;
import org.msf.records.net.Server;
import org.msf.records.updater.UpdateManager;
import org.msf.records.user.UserManager;
import org.odk.collect.android.application.Collect;

/**
 * Created by Gil on 08/10/2014.
 */
public class App extends Application {

    /**
     * The current instance of the application.
     */
    private static App sInstance;

    private static UserManager sUserManager;
    private static UpdateManager sUpdateManager;

    private static Server mServer;
    private static OpenMrsXformsConnection mOpenMrsXformsConnection;

    @Override
    public void onCreate() {
        Collect.onCreate(this);
        super.onCreate();

        SharedPreferences preferences =
                PreferenceManager.getDefaultSharedPreferences(this);

        synchronized (App.class) {
            sInstance = this;

            sUserManager = new UserManager();
            sUpdateManager = new UpdateManager();

            String rootUrl;
            if (preferences.getBoolean("use_openmrs", false)) {
                rootUrl = preferences.getString("openmrs_root_url", null);
                mServer = new OpenMrsServer(
                        getApplicationContext(), rootUrl,
                        preferences.getString("openmrs_user", null),
                        preferences.getString("openmrs_password", null));
            } else {
                rootUrl = preferences.getString("api_root_url", null);
                mServer = new BuendiaServer(getApplicationContext(), rootUrl);
            }
            mOpenMrsXformsConnection = new OpenMrsXformsConnection(
                    getApplicationContext(), rootUrl,
                    preferences.getString("openmrs_user", null),
                    preferences.getString("openmrs_password", null));
        }
    }

    public static synchronized App getInstance() {
        return sInstance;
    }

    public static synchronized UserManager getUserManager() {
        return sUserManager;
    }

    public static synchronized UpdateManager getUpdateManager() {
        return sUpdateManager;
    }

    public static synchronized Server getServer() {
        return mServer;
    }

    public static synchronized OpenMrsXformsConnection getmOpenMrsXformsConnection() {
        return mOpenMrsXformsConnection;
    }
}<commit_msg>Manually resolved bad merge in last commit<commit_after>package org.msf.records;

import android.app.Application;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import org.msf.records.net.BuendiaServer;
import org.msf.records.net.OpenMrsConnectionDetails;
import org.msf.records.net.OpenMrsServer;
import org.msf.records.net.OpenMrsXformsConnection;
import org.msf.records.net.Server;
import org.msf.records.updater.UpdateManager;
import org.msf.records.user.UserManager;
import org.odk.collect.android.application.Collect;

/**
 * Created by Gil on 08/10/2014.
 */
public class App extends Application {

    /**
     * The current instance of the application.
     */
    private static App sInstance;

    private static UserManager sUserManager;
    private static UpdateManager sUpdateManager;

    private static Server mServer;
    private static OpenMrsXformsConnection mOpenMrsXformsConnection;

    private static OpenMrsConnectionDetails mConnectionDetails;


    @Override
    public void onCreate() {
        Collect.onCreate(this);
        super.onCreate();

        SharedPreferences preferences =
                PreferenceManager.getDefaultSharedPreferences(this);

        synchronized (App.class) {
            sInstance = this;

            sUserManager = new UserManager();
            sUpdateManager = new UpdateManager();

            mConnectionDetails =
                    new OpenMrsConnectionDetails(
                            preferences.getString("openmrs_root_url", null),
                            preferences.getString("openmrs_user", null),
                            preferences.getString("openmrs_password", null),
                            getApplicationContext());
            if (preferences.getBoolean("use_openmrs", true)) {
                mServer = new OpenMrsServer(mConnectionDetails);
            } else {
                String rootUrl = preferences.getString("api_root_url", null);
                mServer = new BuendiaServer(getApplicationContext(), rootUrl);
            }
        }
    }

    public static synchronized App getInstance() {
        return sInstance;
    }

    public static synchronized UserManager getUserManager() {
        return sUserManager;
    }

    public static synchronized UpdateManager getUpdateManager() {
        return sUpdateManager;
    }

    public static synchronized Server getServer() {
        return mServer;
    }

    public static synchronized OpenMrsConnectionDetails getConnectionDetails() {
        return mConnectionDetails;
    }
}
{'fraction_non_alphanumeric': 0.07815206929740134, 'fraction_numerical': 0.0030798845043310875, 'mean_word_length': 2.6108408617095207, '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': '1678457', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1265, 'n_words': 295}