Skip to content

Commit 86800eb

Browse files
author
Justin Lu
committed
8378723: Locale variant delimiter is unclear
Reviewed-by: naoto
1 parent df43ef9 commit 86800eb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/java.base/share/classes/java/util/Locale.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2026, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -176,7 +176,10 @@
176176
* SUBTAG (('_'|'-') SUBTAG)*} where {@code SUBTAG =
177177
* [0-9][0-9a-zA-Z]{3} | [0-9a-zA-Z]{5,8}}.</dd>
178178
* <dd> <em>BCP 47 deviation:</em> BCP 47 only
179-
* uses hyphen ('-') as a delimiter, {@code Locale} is more lenient.</dd>
179+
* uses hyphen ('-') as a delimiter and APIs provided by {@code Locale} which accept
180+
* BCP 47 language tags expect as such. However, for backwards compatibility,
181+
* {@link Locale.Builder#setVariant(String)} also accepts underscore ('_').
182+
* {@link Locale#of(String, String, String)} accepts only underscore ('_').</dd>
180183
*
181184
* <dd> <em>Example:</em> "polyton" (Polytonic Greek), "POSIX"</dd>
182185
*

0 commit comments

Comments
 (0)