Document ProtectedRegion's comparable behavior.

ProtectedRegion's compareTo is inconsistent with equals when comparing regions across managers.
This commit is contained in:
wizjany 2020-09-09 15:16:15 -04:00 committed by GitHub
parent 0cb84927a3
commit c860fce299
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,10 @@ import javax.annotation.Nullable;
* against it.
*
* <p>Instances can be modified and access from several threads at a time.</p>
*
* Note: this class has a natural ordering that is inconsistent with equals.
* Regions with identical ids (and also the same priority) may exist in different managers (or no manager at all),
* so care should be taken when comparing regions that have not been obtained from a single manager.
*/
public abstract class ProtectedRegion implements ChangeTracked, Comparable<ProtectedRegion> {