From c860fce299bfa81056030680ce5c18542f892361 Mon Sep 17 00:00:00 2001 From: wizjany Date: Wed, 9 Sep 2020 15:16:15 -0400 Subject: [PATCH] Document ProtectedRegion's comparable behavior. ProtectedRegion's compareTo is inconsistent with equals when comparing regions across managers. --- .../sk89q/worldguard/protection/regions/ProtectedRegion.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegion.java b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegion.java index 18de660d..76a527cc 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegion.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegion.java @@ -46,6 +46,10 @@ * against it. * *

Instances can be modified and access from several threads at a time.

+ * + * 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 {