Use kotlin-stdlib to fully read a reader in CompilerOutputParser
The `FileUtil` requires additional dependency on intellij util artifacts #KT-61449 In Progress
This commit is contained in:
committed by
Space Team
parent
b4e8e27a6f
commit
c3f8706fe2
+2
-3
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.compilerRunner
|
package org.jetbrains.kotlin.compilerRunner
|
||||||
|
|
||||||
import com.intellij.openapi.util.io.FileUtil
|
|
||||||
import com.intellij.util.containers.Stack
|
import com.intellij.util.containers.Stack
|
||||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
||||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||||
@@ -43,7 +42,7 @@ object CompilerOutputParser {
|
|||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
override fun read(cbuf: CharArray, off: Int, len: Int): Int {
|
override fun read(cbuf: CharArray, off: Int, len: Int): Int {
|
||||||
val read = reader.read(cbuf, off, len)
|
val read = reader.read(cbuf, off, len)
|
||||||
stringBuilder.append(cbuf, off, len)
|
stringBuilder.appendRange(cbuf, off, off + len)
|
||||||
return read
|
return read
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +67,7 @@ object CompilerOutputParser {
|
|||||||
// Load all the text into the stringBuilder
|
// Load all the text into the stringBuilder
|
||||||
try {
|
try {
|
||||||
// This will not close the reader (see the wrapper above)
|
// This will not close the reader (see the wrapper above)
|
||||||
FileUtil.loadTextAndClose(wrappingReader)
|
wrappingReader.readText()
|
||||||
} catch (ioException: IOException) {
|
} catch (ioException: IOException) {
|
||||||
reportException(messageCollector, ioException)
|
reportException(messageCollector, ioException)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user