aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2011-10-09 14:47:19 +0200
committerRobin Rosenberg <robin.rosenberg@dewire.com>2011-10-20 23:49:51 +0200
commit06b183f9b7f902d3e81bea9aa909a044f76d79fb (patch)
treedd94a973ab6ecf87fcfc834881ae48e8adac626f /org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
parentfb68c7a4cddc9e207f3f191d4bb73e809790cffd (diff)
downloadjgit-06b183f9b7f902d3e81bea9aa909a044f76d79fb.tar.gz
jgit-06b183f9b7f902d3e81bea9aa909a044f76d79fb.zip
Add a method to SystemReader to get the time zone
Change-Id: Ifd31f408ed2c5b7869694b715fea3219e74963ef
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
index ced1d90b8e..0b72ade50b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
@@ -118,7 +118,11 @@ public abstract class SystemReader {
@Override
public int getTimezone(long when) {
- return TimeZone.getDefault().getOffset(when) / (60 * 1000);
+ return getTimeZone().getOffset(when) / (60 * 1000);
+ }
+
+ public TimeZone getTimeZone() {
+ return TimeZone.getDefault();
}
};
@@ -187,4 +191,9 @@ public abstract class SystemReader {
* @return the local time zone
*/
public abstract int getTimezone(long when);
+
+ /**
+ * @return system time zone, possibly mocked for testing
+ */
+ public abstract TimeZone getTimeZone();
}