<commit_before>package cgeo.geocaching.connector.oc;

import cgeo.geocaching.Geocache;
import cgeo.geocaching.LogCacheActivity;
import cgeo.geocaching.TrackableLog;
import cgeo.geocaching.connector.ILoggingManager;
import cgeo.geocaching.connector.ImageResult;
import cgeo.geocaching.connector.LogResult;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.enumerations.StatusCode;

import android.app.Activity;
import android.net.Uri;

import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;

public class OkapiLoggingManager implements ILoggingManager {

    private final OCApiLiveConnector connector;
    private final Geocache cache;
    private LogCacheActivity activity;

    private final static List<LogType> standardLogTypes = Arrays.asList(LogType.FOUND_IT, LogType.DIDNT_FIND_IT, LogType.NOTE, LogType.NEEDS_MAINTENANCE);
    private final static List<LogType> eventLogTypes = Arrays.asList(LogType.WILL_ATTEND, LogType.ATTENDED, LogType.NOTE);

    public OkapiLoggingManager(Activity activity, OCApiLiveConnector connector, Geocache cache) {
        this.connector = connector;
        this.cache = cache;
        this.activity = (LogCacheActivity) activity;
    }

    @Override
    public void init() {
        activity.onLoadFinished();
    }

    @Override
    public LogResult postLog(Geocache cache, LogType logType, Calendar date, String log, String logPassword, List<TrackableLog> trackableLogs) {
        final LogResult result = OkapiClient.postLog(cache, logType, date, log, logPassword, connector);
        connector.login(null, null);
        return result;
    }

    @Override<commit_msg>Fixes #2880, Need maintenance seems no valid log type on OC.de<commit_after>package cgeo.geocaching.connector.oc;

import cgeo.geocaching.Geocache;
import cgeo.geocaching.LogCacheActivity;
import cgeo.geocaching.TrackableLog;
import cgeo.geocaching.connector.ILoggingManager;
import cgeo.geocaching.connector.ImageResult;
import cgeo.geocaching.connector.LogResult;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.enumerations.StatusCode;

import android.app.Activity;
import android.net.Uri;

import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;

public class OkapiLoggingManager implements ILoggingManager {

    private final OCApiLiveConnector connector;
    private final Geocache cache;
    private LogCacheActivity activity;

    private final static List<LogType> standardLogTypes = Arrays.asList(LogType.FOUND_IT, LogType.DIDNT_FIND_IT, LogType.NOTE);
    private final static List<LogType> eventLogTypes = Arrays.asList(LogType.WILL_ATTEND, LogType.ATTENDED, LogType.NOTE);

    public OkapiLoggingManager(Activity activity, OCApiLiveConnector connector, Geocache cache) {
        this.connector = connector;
        this.cache = cache;
        this.activity = (LogCacheActivity) activity;
    }

    @Override
    public void init() {
        activity.onLoadFinished();
    }

    @Override
    public LogResult postLog(Geocache cache, LogType logType, Calendar date, String log, String logPassword, List<TrackableLog> trackableLogs) {
        final LogResult result = OkapiClient.postLog(cache, logType, date, log, logPassword, connector);
        connector.login(null, null);
        return result;
    }

    @Override
{'fraction_non_alphanumeric': 0.08239810986414649, 'fraction_numerical': 0.0011813349084465446, 'mean_word_length': 4.6262458471760795, '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': '3018654', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1013, 'n_words': 230}