Browse Source

Add locale to the properties manageable by SystemReader

Change-Id: I5e9af40d38bb671cb9fcdb0fa3b4eb3af5f36f6c
stable-1.2
Robin Rosenberg 13 years ago
parent
commit
3a4fa52723
  1. 6
      org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
  2. 11
      org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java

6
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java

@ -48,6 +48,7 @@ package org.eclipse.jgit.junit;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
@ -144,4 +145,9 @@ public class MockSystemReader extends SystemReader {
public TimeZone getTimeZone() {
return TimeZone.getTimeZone("GMT-03:30");
}
@Override
public Locale getLocale() {
return Locale.US;
}
}

11
org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java

@ -48,6 +48,7 @@ package org.eclipse.jgit.util;
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Locale;
import java.util.TimeZone;
import org.eclipse.jgit.lib.Config;
@ -124,6 +125,11 @@ public abstract class SystemReader {
public TimeZone getTimeZone() {
return TimeZone.getDefault();
}
@Override
public Locale getLocale() {
return Locale.getDefault();
}
};
/** @return the live instance to read system properties. */
@ -196,4 +202,9 @@ public abstract class SystemReader {
* @return system time zone, possibly mocked for testing
*/
public abstract TimeZone getTimeZone();
/**
* @return the locale to use
*/
public abstract Locale getLocale();
}

Loading…
Cancel
Save