Skip to content

Commit

Permalink
Merge pull request #68 from oleg-nenashev/JENKINS-26839
Browse files Browse the repository at this point in the history
[JENKINS-26839] - Avoid the usage of static SimpleDateFormat instance
  • Loading branch information
oleg-nenashev committed Feb 19, 2015
2 parents 7abd9de + 7dc6a97 commit fb55d0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/tek42/perforce/parse/ChangelistBuilder.java
Expand Up @@ -55,9 +55,7 @@ public class ChangelistBuilder implements Builder<Changelist> {
//Maximum amount of files to be recorded to a changelist
private int maxFiles;
private final @CheckForNull Depot depot;
private static final SimpleDateFormat dateParser = new
SimpleDateFormat("yyyy/MM/dd HH:mm:ss ZZZZZ", Locale.ENGLISH);


public ChangelistBuilder(int maxFiles) {
this(maxFiles, null);
}
Expand Down Expand Up @@ -281,8 +279,10 @@ public void save(Changelist obj, Writer out) throws PerforceException {
* not be parsed according to the format specified in {@code dateParser}.
* @since 1.3.30 (JENKINS-24401)
*/
private static java.util.Date parseDateWithTimezone(String newDate) throws PerforceException {
try {
/*package*/ static java.util.Date parseDateWithTimezone(String newDate) throws PerforceException {
final SimpleDateFormat dateParser = new
SimpleDateFormat("yyyy/MM/dd HH:mm:ss ZZZZZ", Locale.ENGLISH);
try {
return dateParser.parse(newDate);
} catch(ParseException e) {
throw new PerforceException("Cannot parse changelist timestamp : " + newDate, e);
Expand Down

0 comments on commit fb55d0f

Please sign in to comment.