diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/RangeMarkerImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/RangeMarkerImpl.java index 3ce45df63f30..6d89f0be3db6 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/RangeMarkerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/RangeMarkerImpl.java @@ -21,7 +21,6 @@ import com.intellij.openapi.editor.ex.DocumentEx; import com.intellij.openapi.editor.ex.RangeMarkerEx; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.UserDataHolderBase; -import com.intellij.util.DistributedCounter; import com.intellij.util.Processor; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -33,7 +32,7 @@ public class RangeMarkerImpl extends UserDataHolderBase implements RangeMarkerEx protected RangeMarkerTree.RMNode myNode; private final long myId; - private static final DistributedCounter counter = new DistributedCounter(); + private static final StripedIDGenerator counter = new StripedIDGenerator(); protected RangeMarkerImpl(@NotNull DocumentEx document, int start, int end, boolean register) { this(document, start, end, register, false, false); diff --git a/platform/util/src/com/intellij/util/DistributedCounter.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/StripedIDGenerator.java similarity index 90% rename from platform/util/src/com/intellij/util/DistributedCounter.java rename to platform/platform-impl/src/com/intellij/openapi/editor/impl/StripedIDGenerator.java index 9fdfcd0b15a1..081bcb666dc5 100644 --- a/platform/util/src/com/intellij/util/DistributedCounter.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/StripedIDGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.util; +package com.intellij.openapi.editor.impl; import java.util.concurrent.atomic.AtomicLong; @@ -21,10 +21,10 @@ import java.util.concurrent.atomic.AtomicLong; * Low-contention counter. * Repeated calls to {@link #next()} return numbers which are unique across all calling threads, and which are increasing over calls within one thread. */ -public class DistributedCounter { +public class StripedIDGenerator { private static final int CHUNK_SIZE = 1000; private final AtomicLong nextChunkStart = new AtomicLong(); - // must not ne static + // must not be static since we might want to have several instances of this class private final ThreadLocal localCounter = new ThreadLocal(); private static class NextPair { long nextId;