package ingraph.bulkloader.csv.loader.cellprocessor;

import org.supercsv.cellprocessor.CellProcessorAdaptor;
import org.supercsv.cellprocessor.ift.StringCellProcessor;
import org.supercsv.exception.SuperCsvCellProcessorException;
import org.supercsv.util.CsvContext;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.TimeZone;

abstract public class AbstractParseEpoch extends CellProcessorAdaptor implements StringCellProcessor {

	protected final DateFormat formatter;

	public AbstractParseEpoch(final String dateTimeFormat) {
		super();
		formatter = new SimpleDateFormat(dateTimeFormat);
		formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
	}

	public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);

		if (!(value instanceof String)) {
			throw new SuperCsvCellProcessorException(String.class, value, context, this);
		}

		long epoch = Long.parseLong(value.toString());
		long result = Long.valueOf(formatter.format(new java.util.Date(epoch)));

		return next.execute(result, context);
	}

}

@@ -166,70 +166,8 @@
 or;%0A
-import org.supercsv.exception.SuperCsvCellProcessorException;%0A
 impo
@@ -731,130 +731,8 @@
 );%0A%0A
-%09%09if (!(value instanceof String)) %7B%0A%09%09%09throw new SuperCsvCellProcessorException(String.class, value, context, this);%0A%09%09%7D%0A%0A
 %09%09lo

Remove error handling for cases that never occur with benchmark data