From 709cd52958e9794827496ce64971a65521ad02d1 Mon Sep 17 00:00:00 2001 From: Daniel Megert Date: Wed, 22 Feb 2012 21:32:43 +0100 Subject: Let the date formatter pick the locale. Instead of using the locale from the SystemReader we let the SystemReader create the date formats without passing the locale. Bug 368756 Change-Id: I6be9e07af804a08f3f3ac2d2d526ef594eed19e3 Signed-off-by: Daniel Megert Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/junit/MockSystemReader.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'org.eclipse.jgit.junit/src') diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java index ae1c5d9fe8..23bf5632cc 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java @@ -47,6 +47,8 @@ package org.eclipse.jgit.junit; import java.io.File; import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Locale; import java.util.Map; @@ -151,6 +153,17 @@ public class MockSystemReader extends SystemReader { return Locale.US; } + @Override + public SimpleDateFormat getSimpleDateFormat(String pattern) { + return new SimpleDateFormat(pattern, getLocale()); + } + + @Override + public DateFormat getDateTimeInstance(int dateStyle, int timeStyle) { + return DateFormat + .getDateTimeInstance(dateStyle, timeStyle, getLocale()); + } + /** * Assign some properties for the currently executing platform */ -- cgit v1.2.3