I'm checking this in.
This fixes PR 27189. I've already checked in the Mauve test.
Tom
2006-04-19 Tom Tromey <[EMAIL PROTECTED]>
* java/text/SimpleDateFormat.java (formatWithAttribute): Take absolute
value of 'pureMinutes'. PR classpath/27189.
Index: java/text/SimpleDateFormat.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/text/SimpleDateFormat.java,v
retrieving revision 1.51
diff -u -r1.51 SimpleDateFormat.java
--- java/text/SimpleDateFormat.java 25 Aug 2005 02:04:36 -0000 1.51
+++ java/text/SimpleDateFormat.java 19 Apr 2006 17:45:17 -0000
@@ -805,7 +805,8 @@
buffer.setDefaultAttribute(DateFormat.Field.RFC822_TIME_ZONE);
int pureMinutes = (calendar.get(Calendar.ZONE_OFFSET) +
calendar.get(Calendar.DST_OFFSET)) / (1000 *
60);
- String sign = (pureMinutes < 0) ? "-" : "+";
+ String sign = (pureMinutes < 0) ? "-" : "+";
+ pureMinutes = Math.abs(pureMinutes);
int hours = pureMinutes / 60;
int minutes = pureMinutes % 60;
buffer.append(sign);