From 87a6cff826daf010efc638827fcfad92de61875e Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Tue, 2 Oct 2018 18:14:44 +0300 Subject: [PATCH] [groovy] push #getTextSkipWhiteSpaceAndComments() down to GrCodeReferenceElementImpl --- .../lang/psi/impl/GrReferenceElementImpl.java | 10 ---------- .../impl/types/GrCodeReferenceElementImpl.java | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java index 95115b56b86e..7bac89f3aaa0 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java @@ -22,7 +22,6 @@ public abstract class GrReferenceElementImpl extends Groov private static final String DUMMY_FQN = "05ab655a-0e15-4f35-909d-9dff5e757f63"; private volatile String myQualifiedReferenceName = DUMMY_FQN; - private volatile String myCachedTextSkipWhiteSpaceAndComments; public GrReferenceElementImpl(@NotNull ASTNode node) { super(node); @@ -31,7 +30,6 @@ public abstract class GrReferenceElementImpl extends Groov @Override public void subtreeChanged() { myQualifiedReferenceName = DUMMY_FQN; - myCachedTextSkipWhiteSpaceAndComments = null; super.subtreeChanged(); } @@ -175,14 +173,6 @@ public abstract class GrReferenceElementImpl extends Groov PsiImplUtil.setQualifier(this, newQualifier); } - public String getTextSkipWhiteSpaceAndComments() { - String whiteSpaceAndComments = myCachedTextSkipWhiteSpaceAndComments; - if (whiteSpaceAndComments == null) { - myCachedTextSkipWhiteSpaceAndComments = whiteSpaceAndComments = PsiImplUtil.getTextSkipWhiteSpaceAndComments(getNode()); - } - return whiteSpaceAndComments; - } - @Override public boolean isQualified() { return getQualifier() != null; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java index f6b52c5e097d..22e6aaaaf5a2 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java @@ -39,6 +39,22 @@ public class GrCodeReferenceElementImpl extends GrReferenceElementImpl