<commit_before>package com.llfix.handlers;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicBoolean;

import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelHandler;
import org.jboss.netty.handler.timeout.IdleState;
import org.jboss.netty.handler.timeout.IdleStateEvent;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.llfix.ILogonManager;
import com.llfix.IQueueFactory;
import com.llfix.ISimpleQueue;
import com.llfix.util.FieldAndRequirement;

public class FIXSessionProcessor extends SimpleChannelHandler {

    final static Logger logger = LoggerFactory.getLogger(FIXSessionProcessor.class);
    final static char SOH_CHAR = '\001';
    final static DateTimeFormatter UTCTimeStampFormat = DateTimeFormat.forPattern("yyyyMMdd-HH:mm:ss.SSS");
    final static DateTimeZone UTCTimeZone = DateTimeZone.forOffsetHours(0);

    private final List<FieldAndRequirement> headerFields;
    private final List<FieldAndRequirement> trailerFields;
	private final ILogonManager logonManager;
	private final boolean isInitiator;

    private long outgoingSeqNum = 1l;
    private long incomingSeqNum = 1l;
    private boolean loggedIn = false;<commit_msg>fixed simple bugs pointed out by static analysis<commit_after>package com.llfix.handlers;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicBoolean;

import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelHandler;
import org.jboss.netty.handler.timeout.IdleState;
import org.jboss.netty.handler.timeout.IdleStateEvent;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.llfix.ILogonManager;
import com.llfix.IQueueFactory;
import com.llfix.ISimpleQueue;
import com.llfix.util.FieldAndRequirement;

public class FIXSessionProcessor extends SimpleChannelHandler {

    final static Logger logger = LoggerFactory.getLogger(FIXSessionProcessor.class);
    final static char SOH_CHAR = '\001';
    final static DateTimeFormatter UTCTimeStampFormat = DateTimeFormat.forPattern("yyyyMMdd-HH:mm:ss.SSS");
    final static DateTimeZone UTCTimeZone = DateTimeZone.forOffsetHours(0);

    private final List<FieldAndRequirement> headerFields;
    private final List<FieldAndRequirement> trailerFields;
	private final ILogonManager logonManager;
	private final boolean isInitiator;

    private long outgoingSeqNum = 1L;
    private long incomingSeqNum = 1L;
    private boolean loggedIn = false;
{'fraction_non_alphanumeric': 0.08930029948271168, 'fraction_numerical': 0.004356112169888375, 'mean_word_length': 5.958333333333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2366482', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1110, 'n_words': 228}