--- a/jdk/src/share/classes/java/util/SimpleTimeZone.java Tue Feb 15 16:40:25 2011 +0300
+++ b/jdk/src/share/classes/java/util/SimpleTimeZone.java Wed Feb 16 16:51:21 2011 +0900
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -825,10 +825,7 @@
* @since 1.2
*/
public int getDSTSavings() {
- if (useDaylight) {
- return dstSavings;
- }
- return 0;
+ return useDaylight ? dstSavings : 0;
}
/**
@@ -842,6 +839,20 @@
}
/**
+ * Returns {@code true} if this {@code SimpleTimeZone} observes
+ * Daylight Saving Time. This method is equivalent to {@link
+ * #useDaylightTime()}.
+ *
+ * @return {@code true} if this {@code SimpleTimeZone} observes
+ * Daylight Saving Time; {@code false} otherwise.
+ * @since 1.7
+ */
+ @Override
+ public boolean observesDaylightTime() {
+ return useDaylightTime();
+ }
+
+ /**
* Queries if the given date is in daylight saving time.
* @return true if daylight saving time is in effective at the
* given date; false otherwise.