don't keep StringRef as field

This commit is contained in:
Dmitry Batkovich
2016-10-26 07:20:48 +03:00
parent 7b2d0c3d4a
commit a75cc0fec7
2 changed files with 6 additions and 7 deletions
@@ -40,7 +40,7 @@ public abstract class FunctionalExpressionElementType<T extends PsiFunctionalExp
@NotNull
@Override
public FunctionalExpressionStub<T> deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
return new FunctionalExpressionStub<T>(parentStub, this, dataStream.readName());
return new FunctionalExpressionStub<T>(parentStub, this, StringRef.toString(dataStream.readName()));
}
@Override
@@ -49,7 +49,7 @@ public abstract class FunctionalExpressionElementType<T extends PsiFunctionalExp
@Override
public FunctionalExpressionStub<T> createStub(LighterAST tree, LighterASTNode funExpr, StubElement parentStub) {
return new FunctionalExpressionStub<T>(parentStub, this, StringRef.fromString(getPresentableText(tree, funExpr)));
return new FunctionalExpressionStub<T>(parentStub, this, getPresentableText(tree, funExpr));
}
@NotNull
@@ -19,17 +19,16 @@ import com.intellij.psi.PsiFunctionalExpression;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.psi.stubs.StubBase;
import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
public class FunctionalExpressionStub<T extends PsiFunctionalExpression> extends StubBase<T> {
private final StringRef myPresentableTextRef;
private final String myPresentableText;
protected FunctionalExpressionStub(StubElement parent, IStubElementType elementType, StringRef presentableTextRef) {
protected FunctionalExpressionStub(StubElement parent, IStubElementType elementType, String presentableTextRef) {
super(parent, elementType);
myPresentableTextRef = presentableTextRef;
myPresentableText = presentableTextRef;
}
public String getPresentableText() {
return myPresentableTextRef.getString();
return myPresentableText;
}
}