<commit_before>/*******************************************************************************
 * Copyright (c) 2010 Oak Ridge National Laboratory.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package org.csstudio.email;

import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IPreferencesService;

/** Access to preference settings.
 * 
 *  See preferences.ini for details on the available settings
 *  @author <NAME>
 */
@SuppressWarnings("nls")
public class Preferences
{
    final public static String SMTP_HOST = "smtp_host";
    
    public static String getSMTP_Host()
    {
        final IPreferencesService prefs = Platform.getPreferencesService();
        return prefs.getString(Activator.ID, SMTP_HOST, "undefined.host", null);
    }
}
<commit_msg>o.c.email: Preferences work in unit tests w/o runtime<commit_after>/*******************************************************************************
 * Copyright (c) 2010 Oak Ridge National Laboratory.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package org.csstudio.email;

import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IPreferencesService;

/** Access to preference settings.
 *
 *  See preferences.ini for details on the available settings
 *  @author <NAME>
 */
@SuppressWarnings("nls")
public class Preferences
{
    final public static String SMTP_HOST = "smtp_host";

    /** @return SMTP URL */
    public static String getSMTP_Host()
    {
        String host = "localhost";
        final IPreferencesService service = Platform.getPreferencesService();
        if (service != null)
            host = service.getString(Activator.ID, SMTP_HOST, host, null);
        return host;
    }
}

{'fraction_non_alphanumeric': 0.2170305676855895, 'fraction_numerical': 0.0069868995633187774, 'mean_word_length': 4.4677804295942725, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '985579', 'n_tokens_mistral': 582, 'n_tokens_neox': 551, 'n_words': 180}