From e16c03f9d417307afff71d43904aa485356df370 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 15 Feb 2013 14:30:49 +0400 Subject: [PATCH] moved off the testFramework, made thread-safe --- .../openapi/vfs/ex/dummy}/DummyFileIdGenerator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename platform/{platform-api/src/com/intellij/testFramework => platform-impl/src/com/intellij/openapi/vfs/ex/dummy}/DummyFileIdGenerator.java (77%) diff --git a/platform/platform-api/src/com/intellij/testFramework/DummyFileIdGenerator.java b/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyFileIdGenerator.java similarity index 77% rename from platform/platform-api/src/com/intellij/testFramework/DummyFileIdGenerator.java rename to platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyFileIdGenerator.java index 33c954624c56..793dd907ae93 100644 --- a/platform/platform-api/src/com/intellij/testFramework/DummyFileIdGenerator.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyFileIdGenerator.java @@ -17,14 +17,16 @@ /* * @author max */ -package com.intellij.testFramework; +package com.intellij.openapi.vfs.ex.dummy; + +import java.util.concurrent.atomic.AtomicInteger; public class DummyFileIdGenerator { - private static int ourId = Integer.MAX_VALUE / 2; + private static final AtomicInteger ourId = new AtomicInteger(Integer.MAX_VALUE / 2); private DummyFileIdGenerator() {} public static int next() { - return ourId++; + return ourId.getAndIncrement(); } } \ No newline at end of file