Alex Rivera | Logout

Call to method of static java.text.DateFormat not advisable?

Asked 2010-03-09T14:24:53.420
52

I am receiving a Find Bugs error - call to method of static java.text.DateFormat and I don't know the reason why it's not good / advisable to be doing these things below.

private static final Date TODAY = Calendar.getInstance().getTime();
private static final DateFormat yymmdd = new SimpleDateFormat("yyMMdd"); 

private String fileName = "file_" + yymmdd.format(TODAY);
Edit
Report

1 Answer

0

I assume this is because format is not thread-safe?

(I have not seen what findbugs complain about, can you provide the warning text?)

answered 2010-03-09T14:29:06.237

Your Answer