JDK-8044671 : NPE from JapaneseEra when a new era is defined in calendar.properties
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 8u5
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-06-03
  • Updated: 2016-06-13
  • Resolved: 2014-08-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b26Fixed
Related Reports
Relates :  
Description
A NullPointerException is thrown from java.time.chrono.JapaneseEra if a new 
era has been defined in calendar.properties

Exception in thread "main" java.lang.NullPointerException
        at java.time.chrono.JapaneseEra.privateEraFrom(JapaneseEra.java:271)
        at 
java.time.chrono.JapaneseDate.toPrivateJapaneseDate(JapaneseDate.java:502)
        at java.time.chrono.JapaneseDate.<init>(JapaneseDate.java:333)
        at java.time.chrono.JapaneseDate.of(JapaneseDate.java:255)
        at JapaneseNewEra.main(JapaneseNewEra.java:16)

Comments
to test, copy attached calendars.properties to JAVA_HOME/jre/lib and run the test: import java.time.chrono.*; public class JapaneseNewEra { public static void main(String[] args) { JapaneseDate date = JapaneseDate.of(2100,1,1); } }
23-07-2014