Skip to content

Commit f650933

Browse files
committed
perform all history date parsing in Locale.ENGLISH
1 parent 359190a commit f650933

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/org/opensolaris/opengrok/history/Repository.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,13 @@ boolean supportsSubRepositories() {
417417

418418
public DateFormat getDateFormat() {
419419
return new DateFormat() {
420+
private final Locale locale = Locale.ENGLISH;
420421
private final SimpleDateFormat[] formatters = new SimpleDateFormat[datePatterns.length];
421422

422423
{
423424
// initialize date formatters
424425
for (int i = 0; i < datePatterns.length; i++) {
425-
formatters[i] = new SimpleDateFormat(datePatterns[i]);
426+
formatters[i] = new SimpleDateFormat(datePatterns[i], locale);
426427
/*
427428
* TODO: the following would be nice - but currently it
428429
* could break the compatibility with some repository dates
@@ -454,7 +455,7 @@ public Date parse(String source) throws ParseException {
454455
String.format("%s with format \"%s\" and locale \"%s\"",
455456
ex1.getMessage(),
456457
formatter.toPattern(),
457-
Locale.getDefault().toString()),
458+
locale),
458459
ex1.getErrorOffset()
459460
);
460461
if (head == null || tail == null) {

0 commit comments

Comments
 (0)