mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[debugger] avoid using writeUTF, it does not work for long strings
GitOrigin-RevId: 9242ed91f50c3f1ce5c449b03755e9982d95805a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5fad39b04c
commit
ff429048a2
@@ -106,7 +106,9 @@ class BatchEvaluator private constructor() {
|
||||
var count = 0
|
||||
while (dis.available() > 0) {
|
||||
val error = dis.readBoolean()
|
||||
val message = dis.readUTF()
|
||||
val data = ByteArray(dis.readInt())
|
||||
dis.readFully(data)
|
||||
val message = String(data, Charsets.UTF_8)
|
||||
if (count >= requests.size) {
|
||||
LOG.error("Invalid number of results: required " + requests.size + ", reply = " + bytes.contentToString())
|
||||
return false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
/*
|
||||
* @author Eugene Zhuravlev
|
||||
@@ -8,6 +8,7 @@ package com.intellij.rt.debugger;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class BatchEvaluatorServer {
|
||||
@@ -33,7 +34,11 @@ public final class BatchEvaluatorServer {
|
||||
}
|
||||
|
||||
dos.writeBoolean(error);
|
||||
dos.writeUTF(res);
|
||||
// do not use writeUTF as it supports only 65535 symbols
|
||||
// dos.writeUTF(res);
|
||||
byte[] stringBytes = res.getBytes(StandardCharsets.UTF_8);
|
||||
dos.writeInt(stringBytes.length);
|
||||
dos.write(stringBytes);
|
||||
}
|
||||
return bas.toString("ISO-8859-1");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user