From 6fc234aa1d2b3114aa5d90fc1913e07a4fc3efdb Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Wed, 18 Nov 2009 20:48:12 +0300 Subject: [PATCH] Cheaper lock object --- .../intellij/psi/impl/source/tree/LazyParseableElement.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java index 4d9ba48749..db35eb1d03 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java @@ -29,7 +29,17 @@ import org.jetbrains.annotations.NotNull; public class LazyParseableElement extends CompositeElement { private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.LazyParseableElement"); - private final Object lock = new String("chameleon parsing lock"); + private static class ChameleonLock { + private ChameleonLock() {} + + @Override + public String toString() { + return "chameleon parsing lock"; + } + } + + private final Object lock = new ChameleonLock(); + private CharSequence myText; public LazyParseableElement(@NotNull IElementType type, CharSequence text) { -- 2.11.4.GIT