<commit_before>import ir.ac.aut.ceit.aolab.OnIEvent;
import ir.ac.aut.ceit.aolab.TurnEvent;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by iman on 4/27/16.
 */
public class Parser {
    private static final Logger LOG = LoggerFactory.getLogger(Parser.class);
    public static OnIEvent getOnIEvent(String input) {
        JSONParser parser = new JSONParser();

        OnIEvent onIEvent;
        JSONObject jsonObject = null;
        try {
            jsonObject = (JSONObject) parser.parse(input);
        } catch (ParseException e) {
            e.printStackTrace();
            onIEvent = null;
            return onIEvent;
        }
        String id = (String) jsonObject.get("id");
        long interval = (long) jsonObject.get("command");
        int intVersion = Math.toIntExact(interval);
        onIEvent = new OnIEvent(id, intVersion);
        return onIEvent;
    }

    public static TurnEvent getTurnEvent(String input) {
        JSONParser parser = new JSONParser();

        TurnEvent turnEvent;
        JSONObject jsonObject = null;
        try {
            jsonObject = (JSONObject) parser.parse(input);
        } catch (ParseException e) {
            turnEvent = null;
            return turnEvent;
        }
        String id = (String) jsonObject.get("id");
        Boolean status = (Boolean) jsonObject.get("status");
        turnEvent = new TurnEvent(id, status);
        return turnEvent;
    }
}<commit_msg>Adds parse exception login.<commit_after>import ir.ac.aut.ceit.aolab.OnIEvent;
import ir.ac.aut.ceit.aolab.TurnEvent;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by iman on 4/27/16.
 */
public class Parser {
    private static final Logger LOG = LoggerFactory.getLogger(Parser.class);
    public static OnIEvent getOnIEvent(String input) {
        JSONParser parser = new JSONParser();

        OnIEvent onIEvent;
        JSONObject jsonObject = null;
        try {
            jsonObject = (JSONObject) parser.parse(input);
        } catch (ParseException e) {
            LOG.info("Parse exception");
            onIEvent = null;
            return onIEvent;
        }
        String id = (String) jsonObject.get("id");
        long interval = (long) jsonObject.get("command");
        int intVersion = Math.toIntExact(interval);
        onIEvent = new OnIEvent(id, intVersion);
        return onIEvent;
    }

    public static TurnEvent getTurnEvent(String input) {
        JSONParser parser = new JSONParser();

        TurnEvent turnEvent;
        JSONObject jsonObject = null;
        try {
            jsonObject = (JSONObject) parser.parse(input);
        } catch (ParseException e) {
            LOG.info("Parse exception");
            turnEvent = null;
            return turnEvent;
        }
        String id = (String) jsonObject.get("id");
        Boolean status = (Boolean) jsonObject.get("status");
        turnEvent = new TurnEvent(id, status);
        return turnEvent;
    }
}
{'fraction_non_alphanumeric': 0.1035548686244204, 'fraction_numerical': 0.004327666151468315, 'mean_word_length': 2.438894792773645, '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': '5198921', 'n_tokens_mistral': 935, 'n_tokens_neox': 921, 'n_words': 226}