diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java index a2ca725f3b76..89cd2bd89ef5 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java @@ -50,6 +50,7 @@ import com.intellij.ui.classFilter.ClassFilter; import com.intellij.util.SmartList; import com.intellij.util.containers.ContainerUtil; import com.intellij.xdebugger.XSourcePosition; +import com.intellij.xdebugger.frame.XValueNode; import com.intellij.xdebugger.impl.XSourcePositionImpl; import com.sun.jdi.*; import com.sun.jdi.event.Event; @@ -66,8 +67,6 @@ import java.util.regex.PatternSyntaxException; public abstract class DebuggerUtilsEx extends DebuggerUtils { private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.impl.DebuggerUtilsEx"); - private static final int MAX_LABEL_SIZE = 255; - /** * @param context * @return all CodeFragmentFactoryProviders that provide code fragment factories suitable in the context given @@ -594,8 +593,9 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils { } public static String truncateString(final String str) { - if (str.length() > MAX_LABEL_SIZE) { - return str.substring(0, MAX_LABEL_SIZE) + "..."; + // leave a small gap over XValueNode.MAX_VALUE_LENGTH to detect oversize + if (str.length() > XValueNode.MAX_VALUE_LENGTH + 5) { + return str.substring(0, XValueNode.MAX_VALUE_LENGTH + 5); } return str; }