mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CIDR:Debugger: correctly escaping and displaying values and expressions
This commit is contained in:
@@ -493,6 +493,15 @@ public class StringUtil {
|
||||
@NotNull String str,
|
||||
@Nullable String additionalChars,
|
||||
@NotNull @NonNls StringBuilder buffer) {
|
||||
return escapeStringCharacters(length, str, additionalChars, true, buffer);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static StringBuilder escapeStringCharacters(int length,
|
||||
@NotNull String str,
|
||||
@Nullable String additionalChars,
|
||||
boolean escapeSlash,
|
||||
@NotNull @NonNls StringBuilder buffer) {
|
||||
for (int idx = 0; idx < length; idx++) {
|
||||
char ch = str.charAt(idx);
|
||||
switch (ch) {
|
||||
@@ -516,12 +525,11 @@ public class StringUtil {
|
||||
buffer.append("\\r");
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
buffer.append("\\\\");
|
||||
break;
|
||||
|
||||
default:
|
||||
if (additionalChars != null && additionalChars.indexOf(ch) > -1) {
|
||||
if (escapeSlash && ch == '\\') {
|
||||
buffer.append("\\\\");
|
||||
}
|
||||
else if (additionalChars != null && additionalChars.indexOf(ch) > -1) {
|
||||
buffer.append("\\").append(ch);
|
||||
}
|
||||
else if (Character.isISOControl(ch)) {
|
||||
|
||||
+2
-3
@@ -76,8 +76,7 @@ public class XValueNodeImpl extends XValueContainerNode<XValue> implements XValu
|
||||
}
|
||||
|
||||
public void setPresentation(@NonNls final String name, @Nullable final Icon icon, @NonNls @Nullable final String type, @NonNls @NotNull final String separator,
|
||||
@NonNls @NotNull final String value,
|
||||
final boolean hasChildren) {
|
||||
@NonNls @NotNull final String value, final boolean hasChildren) {
|
||||
DebuggerUIUtil.invokeOnEventDispatch(new Runnable() {
|
||||
public void run() {
|
||||
setIcon(icon);
|
||||
@@ -116,7 +115,7 @@ public class XValueNodeImpl extends XValueContainerNode<XValue> implements XValu
|
||||
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
|
||||
String value;
|
||||
try {
|
||||
StringUtil.escapeStringCharacters(myValue.length(), myValue, null, builder);
|
||||
StringUtil.escapeStringCharacters(myValue.length(), myValue, null, false, builder);
|
||||
value = builder.toString();
|
||||
}
|
||||
finally {
|
||||
|
||||
Reference in New Issue
Block a user