From da7965e5bc8847a50689443936cd1a41deb46963 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 13 Sep 2017 13:01:04 +0300 Subject: [PATCH] changed wording to make clear index/size operations are bad --- .../util/src/com/intellij/util/containers/UnsafeWeakList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/util/src/com/intellij/util/containers/UnsafeWeakList.java b/platform/util/src/com/intellij/util/containers/UnsafeWeakList.java index 385274ff1b41..0fea8964ba97 100644 --- a/platform/util/src/com/intellij/util/containers/UnsafeWeakList.java +++ b/platform/util/src/com/intellij/util/containers/UnsafeWeakList.java @@ -303,6 +303,6 @@ public class UnsafeWeakList extends AbstractList { } private T throwNotRandomAccess() { - throw new IncorrectOperationException("UnsafeWeakList is not RandomAccess, use list.iterator() instead."); + throw new IncorrectOperationException("index/size-based operations in UnsafeWeakList are not supported because they don't make sense in the presence of weak references. Use list.iterator() (which retains elements to avoid sudden GC) instead."); } }