JDK-6609388 : (cal) Thai Calendar Year Broken When Using Gregorian BC Era
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 5.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2007-09-26
  • Updated: 2010-07-29
  • Resolved: 2007-10-10
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Linux linux 2.6.13-15.8-smp #1 SMP Tue Feb 7 11:07:24 UTC 2006 i686 i686 i386 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
When Gregorian dates are input in a Gregorian calendar, the year is converted to Buddhist era years; that is, 2006 AD is converted to 2549 BE.

However, if the same instance of the calendar is reset to the BC era, the calendar STILL reports the year as 2549, although the era string changes.

This is clearly wrong. First of all, this is occuring in an instance of a Gregorian calendar. A Gregorian calendar shoule ALWAYS be a Gregorian calendar, unless explicitly converted into another calendar type. Secondly, the BC year is clearly wrong; apparently, the underlying algorithm is simply subtracting 543 from the absolute value of the year, then applying the era strings as though they corresponded exactly to the BC/AD eras, which they do not. 2006 BC, under this system, should be reported as 1463 BE.

Actually, though, the year should ALWAYS be reported as 2006 AD or 2006 BC, respectively, since I haven't asked for a Buddhist calendar; I've asked for, and presumably received, a Gregorian calendar, and it's rules and eras should be consistently respected.

The era issue is obviously a bug, as the years BC are reported incorrectly. Preferably, though, if you want to provide support for a Buddhist calendar, provide a Buddhist calendar class and allow me to ask for it explicitly, or at least know that I'm receiving a completely different calendar than the one I asked for.



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See above.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
See above.
ACTUAL -
See above.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
There is no workaround.  Although the calendar behaves in some respects (but not all) like a Buddhist calendar, it identifies itself as a Gregorian calendar. The 'workaround' is to remove Thai support from my program until this bug is fixed.

Comments
EVALUATION The current Thai Buddhist calendar has many problems/restrictions. Closing as a duplicate of 4833267.
10-10-2007