From 083162bd6e546e4c0717cb382fffddcbc7b9ca60 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Wed, 11 Nov 2009 13:27:31 +0300 Subject: [PATCH] cosmetics --- platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java | 4 ++-- platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java index 9809e3699d..b53d91f6ec 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java @@ -178,7 +178,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe try { try { // disable up-to-date check to avoid locks on attempt to acquire index write lock while holding at the same time the readLock for this index - FileBasedIndex.getInstance().disableUpToDateCheckForCurrentThread(); + FileBasedIndex.disableUpToDateCheckForCurrentThread(); index.getReadLock().lock(); final ValueContainer container = index.getData(key); @@ -257,7 +257,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe } finally { index.getReadLock().unlock(); - FileBasedIndex.getInstance().enableUpToDateCheckForCurrentThread(); + FileBasedIndex.enableUpToDateCheckForCurrentThread(); } } catch (StorageException e) { diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java index c0b7224835..1cca34d6b0 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java @@ -528,12 +528,12 @@ public class FileBasedIndex implements ApplicationComponent { private static final ThreadLocal myUpToDateCheckState = new ThreadLocal(); - public void disableUpToDateCheckForCurrentThread() { + public static void disableUpToDateCheckForCurrentThread() { final Integer currentValue = myUpToDateCheckState.get(); myUpToDateCheckState.set(currentValue == null? 1 : currentValue.intValue() + 1); } - public void enableUpToDateCheckForCurrentThread() { + public static void enableUpToDateCheckForCurrentThread() { final Integer currentValue = myUpToDateCheckState.get(); if (currentValue != null) { final int newValue = currentValue.intValue() - 1; -- 2.11.4.GIT