Commit 07008ce4 by Jakub Jelinek Committed by Jakub Jelinek

TimeZone.java (getDefaultDisplayName): Don't check if TimeZone is instanceof SimpleTimeZone.

	* java/util/TimeZone.java (getDefaultDisplayName): Don't
	check if TimeZone is instanceof SimpleTimeZone.

From-SVN: r122330
parent 681a6919
2007-02-26 Jakub Jelinek <jakub@redhat.com>
* java/util/TimeZone.java (getDefaultDisplayName): Don't
check if TimeZone is instanceof SimpleTimeZone.
2007-02-21 Gary Benson <gbenson@redhat.com> 2007-02-21 Gary Benson <gbenson@redhat.com>
* java/util/GregorianCalendar.java, * java/util/GregorianCalendar.java,
......
...@@ -1402,14 +1402,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable ...@@ -1402,14 +1402,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
private String getDefaultDisplayName(boolean dst) private String getDefaultDisplayName(boolean dst)
{ {
int offset = getRawOffset(); int offset = getRawOffset() + (dst ? getDSTSavings() : 0);
if (dst && this instanceof SimpleTimeZone)
{
// ugly, but this is a design failure of the API:
// getDisplayName takes a dst parameter even though
// TimeZone knows nothing about daylight saving offsets.
offset += ((SimpleTimeZone) this).getDSTSavings();
}
StringBuffer sb = new StringBuffer(9); StringBuffer sb = new StringBuffer(9);
sb.append("GMT"); sb.append("GMT");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment