Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/java.base/share/classes/java/text/Collator.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@
* <br>
* @apiNote {@code CollationKey}s from different
* {@code Collator}s can not be compared. See the class description
* for {@link CollationKey}
* for an example using {@code CollationKey}s.
* for {@link CollationKey} for an example using {@code CollationKey}s.
*
* @implNote Significant thread contention may occur during concurrent usage
* of the JDK Reference Implementation's {@link RuleBasedCollator}, which is the
* subtype returned by the default provider of the {@link #getInstance()} factory
* methods. As such, users should consider retrieving a separate instance for
* each thread when used in multithreaded environments.
*
* @see RuleBasedCollator
* @see CollationKey
Expand Down
11 changes: 6 additions & 5 deletions src/java.base/share/classes/java/text/RuleBasedCollator.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
Expand Down Expand Up @@ -38,10 +38,6 @@

package java.text;

import java.text.Normalizer;
import java.util.Vector;
import java.util.Locale;

/**
* The {@code RuleBasedCollator} class is a concrete subclass of
* {@code Collator} that provides a simple, data-driven, table
Expand Down Expand Up @@ -239,6 +235,11 @@
* </pre>
* </blockquote>
*
* @implNote For this implementation, concurrent usage of this class may
* lead to significant thread contention since {@code synchronized} is employed
* to ensure thread-safety. As such, users of this class should consider creating
* a separate instance for each thread when used in multithreaded environments.
*
* @see Collator
* @see CollationElementIterator
* @author Helena Shih, Laura Werner, Richard Gillam
Expand Down