Formatting MMyyyy to MMyy
Use Java's THreadLocal type to wrap your SimpleDateFormat objects.

ThreadLocal&lt;SimpleDateFormat&gt; oriFormatHolder = new ThreadLocal&lt;SimpleDateFormat&gt;() {

    @Override
    protected SimpleDateFormat initialValue() {
        return new SimpleDateFormat("MMyyyy");
    }
};


final SimpleDateFormat oriMonthYear = oriFormatHolder.get();


The reason for this is because SimpleDateFormat is not thread safe.


  Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.


Read more here

I actually ran into this problem.  In a multi threaded env we were sharing a SimpleDateFormat object across many threads and started getting bad results.  By wrapping it with ThreadLocal the problem went away.