Browse Source

Fix compatibilty breakage for SystemReader

Introducing a new abstract method is not nice when one
expects other to subclass them. Create default implementations
so old code that implements SystemReader does not break.
The default methods just delegate to the JVM.

Change-Id: I42cdfdcb6b29f7203697a23833dca85185b0b9b3
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
stable-1.2
Robin Rosenberg 13 years ago
parent
commit
63bb6ff06c
  1. 19
      org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java

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

@ -121,15 +121,6 @@ public abstract class SystemReader {
public int getTimezone(long when) {
return getTimeZone().getOffset(when) / (60 * 1000);
}
public TimeZone getTimeZone() {
return TimeZone.getDefault();
}
@Override
public Locale getLocale() {
return Locale.getDefault();
}
};
/** @return the live instance to read system properties. */
@ -200,11 +191,17 @@ public abstract class SystemReader {
/**
* @return system time zone, possibly mocked for testing
* @since 1.2
*/
public abstract TimeZone getTimeZone();
public TimeZone getTimeZone() {
return TimeZone.getDefault();
}
/**
* @return the locale to use
* @since 1.2
*/
public abstract Locale getLocale();
public Locale getLocale() {
return Locale.getDefault();
}
}

Loading…
Cancel
Save