< prev index next >

src/java.base/share/classes/java/time/temporal/ChronoField.java

Print this page
rev 47925 : 8191349: Add a new method in j.t.f.DateTimeFormatter to reflect Unicode extensions
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 77,86 **** --- 77,87 ---- import java.time.chrono.ChronoLocalDate; import java.time.chrono.Chronology; import java.util.Locale; import java.util.Objects; import java.util.ResourceBundle; + import sun.util.locale.provider.CalendarDataUtility; import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleResources; /** * A standard set of fields.
*** 630,640 **** if (displayNameKey == null) { return name; } LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased() ! .getLocaleResources(locale); ResourceBundle rb = lr.getJavaTimeFormatData(); String key = "field." + displayNameKey; return rb.containsKey(key) ? rb.getString(key) : name; } --- 631,643 ---- if (displayNameKey == null) { return name; } LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased() ! .getLocaleResources( ! CalendarDataUtility ! .findRegionOverride(locale).orElse(locale)); ResourceBundle rb = lr.getJavaTimeFormatData(); String key = "field." + displayNameKey; return rb.containsKey(key) ? rb.getString(key) : name; }
< prev index next >