From 60ae3bf050f2edc82be153b15156c044145dd874 Mon Sep 17 00:00:00 2001 From: irengrig Date: Fri, 8 Feb 2013 18:34:43 +0400 Subject: [PATCH] not used class --- .../jetbrains/idea/svn/ReentranceDefence.java | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 plugins/svn4idea/src/org/jetbrains/idea/svn/ReentranceDefence.java diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/ReentranceDefence.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/ReentranceDefence.java deleted file mode 100644 index aa32a683dada..000000000000 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/ReentranceDefence.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jetbrains.idea.svn; - -public class ReentranceDefence { - protected final ThreadLocal myThreadLocal; - - protected ReentranceDefence() { - myThreadLocal = new ThreadLocal() { - @Override - protected Boolean initialValue() { - return Boolean.TRUE; - } - }; - } - - public static T executeReentrant(final ReentranceDefence defence, final MyControlled controlled) { - if (defence.isInside()) { - return controlled.executeMeSimple(); - } - return controlled.executeMe(); - } - - public boolean isInside() { - return ! Boolean.TRUE.equals(myThreadLocal.get()); - } - - public boolean isOutside() { - return ! isInside(); - } - - public void executeOtherDefended(final Runnable runnable) { - try { - myThreadLocal.set(Boolean.FALSE); - runnable.run(); - } finally { - myThreadLocal.set(Boolean.TRUE); - } - } - - public interface MyControlled { - T executeMe(); - T executeMeSimple(); - } -}