mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8208080: Locale extensions via Service provider is not working for region extensions
Reviewed-by: rriggs, nishjain
This commit is contained in:
parent
b2a6aa3e80
commit
4ab515f85c
5 changed files with 276 additions and 150 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2018, 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
|
||||
|
@ -41,6 +41,7 @@ import java.util.spi.CalendarNameProvider;
|
|||
public class CalendarDataUtility {
|
||||
public static final String FIRST_DAY_OF_WEEK = "firstDayOfWeek";
|
||||
public static final String MINIMAL_DAYS_IN_FIRST_WEEK = "minimalDaysInFirstWeek";
|
||||
private static final Locale.Builder OVERRIDE_BUILDER = new Locale.Builder();
|
||||
|
||||
// No instantiation
|
||||
private CalendarDataUtility() {
|
||||
|
@ -144,7 +145,9 @@ public class CalendarDataUtility {
|
|||
rg.charAt(1) >= 0x0041 &&
|
||||
rg.charAt(1) <= 0x005A &&
|
||||
rg.substring(2).equals("ZZZZ")) {
|
||||
override = new Locale.Builder().setLocale(l)
|
||||
override = OVERRIDE_BUILDER
|
||||
.clear()
|
||||
.setLocale(l)
|
||||
.setRegion(rg.substring(0, 2))
|
||||
.build();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue