Skip to content

Commit

Permalink
fix ThreadLocal with date formats
Browse files Browse the repository at this point in the history
  • Loading branch information
iryndin committed Jul 14, 2014
1 parent 75e5d60 commit 622abb6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/net/iryndin/jdbf/util/JdbfUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public class JdbfUtils {
public static final int FIELD_RECORD_LENGTH = 32;
public static final int HEADER_TERMINATOR = 0x0D;

public static ThreadLocal<SimpleDateFormat> dateFormatRef = new ThreadLocal<SimpleDateFormat>();
static {
SimpleDateFormat f = new SimpleDateFormat("yyyyMMdd");
dateFormatRef.set(f);
}
public static final ThreadLocal<SimpleDateFormat> dateFormatRef = new ThreadLocal<SimpleDateFormat>() {
@Override
protected SimpleDateFormat initialValue() {
return new SimpleDateFormat("yyyyMMdd");
}
};

public static List<DbfField> createFieldsFromString(String fieldsString) {
List<DbfField> list = new ArrayList<DbfField>();
String[] a = fieldsString.split("\\|");
Expand Down

0 comments on commit 622abb6

Please sign in to comment.