DebuggerUtils#translateStringValue: useless if removed, SpinAllocator removed

This commit is contained in:
Tagir Valeev
2017-03-15 17:59:09 +07:00
parent d92cfe60dc
commit 7f67ff93b4
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 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.
@@ -42,7 +42,6 @@ import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiTypesUtil;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.StringBuilderSpinAllocator;
import com.intellij.util.containers.ContainerUtil;
import com.sun.jdi.*;
import org.jdom.Element;
@@ -201,17 +200,9 @@ public abstract class DebuggerUtils {
public static String translateStringValue(final String str) {
int length = str.length();
final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
try {
StringUtil.escapeStringCharacters(length, str, buffer);
if (str.length() > length) {
buffer.append("...");
}
return buffer.toString();
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
final StringBuilder buffer = new StringBuilder();
StringUtil.escapeStringCharacters(length, str, buffer);
return buffer.toString();
}
@Nullable