Skip to content

Commit

Permalink
TECH: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikitae57 committed Aug 16, 2024
1 parent 6180879 commit 96d98a0
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package io.reactivex.exceptions

import java.io.PrintStream
import java.io.PrintWriter
import java.util.Arrays
import java.util.Collections

/**
Expand Down Expand Up @@ -97,6 +96,7 @@ class ExtCompositeException(errors: Iterable<Throwable?>) : RuntimeException() {
*
* @throws IllegalArgumentException if `exceptions` is empty.
*/
@Suppress("SpreadOperator")
constructor(vararg exceptions: Throwable) : this(listOf<Throwable>(*exceptions))

/**
Expand Down Expand Up @@ -154,7 +154,7 @@ class ExtCompositeException(errors: Iterable<Throwable?>) : RuntimeException() {
* stream to print to
*/
private fun printStackTrace(s: PrintStreamOrWriter) {
val b = StringBuilder(128)
val b = StringBuilder()
b.append(this).append('\n')
for (myStackElement in stackTrace) {
b.append("\tat ").append(myStackElement).append('\n')
Expand All @@ -179,21 +179,21 @@ class ExtCompositeException(errors: Iterable<Throwable?>) : RuntimeException() {
}
}

internal abstract class PrintStreamOrWriter {
internal interface PrintStreamOrWriter {
/** Prints the specified string as a line on this StreamOrWriter. */
abstract fun println(o: Any?)
fun println(o: Any?)
}

/**
* Same abstraction and implementation as in JDK to allow PrintStream and PrintWriter to share implementation.
*/
internal class WrappedPrintStream(private val printStream: PrintStream) : PrintStreamOrWriter() {
internal class WrappedPrintStream(private val printStream: PrintStream) : PrintStreamOrWriter {
override fun println(o: Any?) {
printStream.println(o)
}
}

internal class WrappedPrintWriter(private val printWriter: PrintWriter) : PrintStreamOrWriter() {
internal class WrappedPrintWriter(private val printWriter: PrintWriter) : PrintStreamOrWriter {
override fun println(o: Any?) {
printWriter.println(o)
}
Expand Down

0 comments on commit 96d98a0

Please sign in to comment.