I don't know why (at least, not yet), but if you remove the line
This is the reason:
For your given code, setTimeZone will not re-calculate the time stored within the object, it will just set another object which will point to "GMT". a call to get(HOUR) will re-adjust the values for the new timezone you set (GMT here) (lazy way).
So things went in this way for your code:
1. set time will set internal object to 1196732402000
2. set time zone will set only the object to hold zone = GMT
3. call to calendar.getTime in A. will get time stored (1196732402000)
Output I got with the given code:
A. before GregorianCalendar.set HOUR call: 2007-12-04 07:10:02
B. hour of day = 1
C. after first set HOUR_OF_DAY, 1 call 2007-12-04 07:10:02
D. hour of day = 1
E. after get HOUR_OF_DAY and 2nd set HOUR_OF_DAY, 1 calls: 2007-12-04 07:10:02
Looks like dependent on local timezone?