From ef7ed937c18b7def279dc0092520bc9149c6e045 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Fri, 12 Oct 2012 15:32:08 +0400 Subject: [PATCH] Cache getting qualified name for package expression --- .../org/jetbrains/jet/lang/psi/JetNamespaceHeader.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespaceHeader.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespaceHeader.java index 7cc50a64cb5..e3efa034180 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespaceHeader.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespaceHeader.java @@ -33,6 +33,8 @@ import java.util.List; * @author abreslav */ public class JetNamespaceHeader extends JetReferenceExpression { + private String qualifiedNameCache = null; + public JetNamespaceHeader(@NotNull ASTNode node) { super(node); } @@ -104,9 +106,14 @@ public class JetNamespaceHeader extends JetReferenceExpression { @NotNull public String getQualifiedName() { - return getQualifiedNameParentOf(null); + if (qualifiedNameCache == null) { + qualifiedNameCache = getQualifiedNameParentOf(null); + } + + return qualifiedNameCache; } + @NotNull private String getQualifiedNameParentOf(@Nullable JetReferenceExpression nameExpression) { StringBuilder builder = new StringBuilder(); for (JetSimpleNameExpression e : findChildrenByClass(JetSimpleNameExpression.class)) {