Skip to content

Commit 028785b

Browse files
committed
Scalafmt
1 parent af422ed commit 028785b

File tree

70 files changed

+222
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+222
-228
lines changed

core/src/main/scala/org/http4s/blaze/channel/ChannelHead.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ object ChannelHead {
4747
"Connection reset", // Found on Linux, Java 13
4848
"An existing connection was forcibly closed by the remote host", // Found on Windows
4949
"Broken pipe", // also found on Linux
50-
"The specified network name is no longer available.\r\n", // Found on Windows NIO2
50+
"The specified network name is no longer available.\r\n" // Found on Windows NIO2
5151
)
5252
}

core/src/main/scala/org/http4s/blaze/channel/nio1/FixedSelectorPool.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import scala.annotation.tailrec
2626
final class FixedSelectorPool(
2727
poolSize: Int,
2828
bufferSize: Int,
29-
threadFactory: ThreadFactory,
29+
threadFactory: ThreadFactory
3030
) extends SelectorLoopPool {
3131
require(poolSize > 0, s"Invalid pool size: $poolSize")
3232

core/src/main/scala/org/http4s/blaze/channel/nio1/NIO1ClientChannel.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean
2525

2626
private[blaze] final class NIO1ClientChannel(
2727
private[this] val underlying: SocketChannel,
28-
private[this] val onClose: () => Unit,
28+
private[this] val onClose: () => Unit
2929
) extends NIO1Channel {
3030

3131
private[this] val closed = new AtomicBoolean(false)

core/src/main/scala/org/http4s/blaze/channel/nio1/NIO1HeadStage.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private[nio1] object NIO1HeadStage {
7272
private def performWrite(
7373
ch: NIO1ClientChannel,
7474
scratch: ByteBuffer,
75-
buffers: Array[ByteBuffer],
75+
buffers: Array[ByteBuffer]
7676
): WriteResult =
7777
try
7878
if (BufferTools.areDirectOrEmpty(buffers)) {
@@ -122,7 +122,7 @@ private[nio1] object NIO1HeadStage {
122122
private[nio1] final class NIO1HeadStage(
123123
ch: NIO1ClientChannel,
124124
selectorLoop: SelectorLoop,
125-
key: SelectionKey,
125+
key: SelectionKey
126126
) extends ChannelHead
127127
with Selectable {
128128
import NIO1HeadStage._

core/src/main/scala/org/http4s/blaze/channel/nio1/NIO1SocketServerGroup.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.http4s.blaze.channel.{
2828
DefaultPoolSize,
2929
ServerChannel,
3030
ServerChannelGroup,
31-
SocketPipelineBuilder,
31+
SocketPipelineBuilder
3232
}
3333
import org.http4s.blaze.pipeline.Command
3434
import org.http4s.blaze.util.{BasicThreadFactory, Connections}
@@ -67,7 +67,7 @@ object NIO1SocketServerGroup {
6767
acceptorPool: SelectorLoopPool,
6868
workerPool: SelectorLoopPool,
6969
channelOptions: ChannelOptions = ChannelOptions.DefaultOptions,
70-
maxConnections: Int = DefaultMaxConnections,
70+
maxConnections: Int = DefaultMaxConnections
7171
): ServerChannelGroup =
7272
new NIO1SocketServerGroup(acceptorPool, workerPool, channelOptions, maxConnections)
7373

@@ -82,7 +82,7 @@ object NIO1SocketServerGroup {
8282
selectorThreadFactory: ThreadFactory = defaultWorkerThreadFactory,
8383
acceptorThreads: Int = 1,
8484
acceptorThreadFactory: ThreadFactory = defaultAcceptorThreadFactory,
85-
maxConnections: Int = DefaultMaxConnections,
85+
maxConnections: Int = DefaultMaxConnections
8686
): ServerChannelGroup = {
8787
val acceptorPool = new FixedSelectorPool(acceptorThreads, 1, acceptorThreadFactory)
8888
val workerPool = new FixedSelectorPool(workerThreads, bufferSize, selectorThreadFactory)
@@ -104,7 +104,7 @@ object NIO1SocketServerGroup {
104104

105105
override def bind(
106106
address: InetSocketAddress,
107-
service: SocketPipelineBuilder,
107+
service: SocketPipelineBuilder
108108
): Try[ServerChannel] =
109109
underlying.bind(address, service)
110110
}
@@ -122,7 +122,7 @@ private final class NIO1SocketServerGroup private (
122122
acceptorPool: SelectorLoopPool,
123123
workerPool: SelectorLoopPool,
124124
channelOptions: ChannelOptions,
125-
maxConnections: Int,
125+
maxConnections: Int
126126
) extends ServerChannelGroup {
127127
private[this] val logger = getLogger
128128
// Also acts as our intrinsic lock.
@@ -140,7 +140,7 @@ private final class NIO1SocketServerGroup private (
140140
private[this] class SocketAcceptor(
141141
key: SelectionKey,
142142
ch: ServerChannelImpl,
143-
service: SocketPipelineBuilder,
143+
service: SocketPipelineBuilder
144144
) extends Selectable {
145145
// Save it since once the channel is closed, we're in trouble.
146146
private[this] val closed = new AtomicBoolean(false)
@@ -192,7 +192,7 @@ private final class NIO1SocketServerGroup private (
192192
// minimize race conditions.
193193
private[this] final class ServerChannelImpl(
194194
val selectableChannel: ServerSocketChannel,
195-
selectorLoop: SelectorLoop,
195+
selectorLoop: SelectorLoop
196196
) extends ServerChannel
197197
with NIO1Channel {
198198
@volatile
@@ -252,7 +252,7 @@ private final class NIO1SocketServerGroup private (
252252
*/
253253
override def bind(
254254
address: InetSocketAddress,
255-
service: SocketPipelineBuilder,
255+
service: SocketPipelineBuilder
256256
): Try[ServerChannel] =
257257
Try {
258258
val ch = ServerSocketChannel.open().bind(address)
@@ -283,7 +283,7 @@ private final class NIO1SocketServerGroup private (
283283
// Will be called from within the SelectorLoop
284284
private[this] def buildSocketAcceptor(
285285
ch: ServerChannelImpl,
286-
service: SocketPipelineBuilder,
286+
service: SocketPipelineBuilder
287287
)(key: SelectionKey): Selectable = {
288288
val acceptor = new SocketAcceptor(key, ch, service)
289289
try key.interestOps(SelectionKey.OP_ACCEPT)
@@ -295,7 +295,7 @@ private final class NIO1SocketServerGroup private (
295295

296296
private[this] def handleClientChannel(
297297
clientChannel: NIO1ClientChannel,
298-
service: SocketPipelineBuilder,
298+
service: SocketPipelineBuilder
299299
): Unit =
300300
try {
301301
clientChannel.configureBlocking(false)

core/src/main/scala/org/http4s/blaze/channel/nio1/SelectorLoop.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import scala.util.control.{ControlThrowable, NonFatal}
4747
final class SelectorLoop(
4848
selector: Selector,
4949
bufferSize: Int,
50-
threadFactory: ThreadFactory,
50+
threadFactory: ThreadFactory
5151
) extends Executor
5252
with ExecutionContext {
5353
require(bufferSize > 0, s"Invalid buffer size: $bufferSize")
@@ -126,7 +126,7 @@ final class SelectorLoop(
126126
*/
127127
def initChannel(
128128
ch: NIO1Channel,
129-
mkStage: SelectionKey => Selectable,
129+
mkStage: SelectionKey => Selectable
130130
): Unit =
131131
enqueueTask(new Runnable {
132132
override def run(): Unit =

core/src/main/scala/org/http4s/blaze/channel/nio2/ByteBufferHead.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private[nio2] final class ByteBufferHead(channel: AsynchronousSocketChannel, buf
6868
p.success(())
6969
()
7070
}
71-
},
71+
}
7272
)
7373

7474
go(0)
@@ -107,7 +107,7 @@ private[nio2] final class ByteBufferHead(channel: AsynchronousSocketChannel, buf
107107
p.success(BufferTools.copyBuffer(scratchBuffer))
108108
()
109109
}
110-
},
110+
}
111111
)
112112
p.future
113113
}

core/src/main/scala/org/http4s/blaze/channel/nio2/ClientChannelFactory.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ final class ClientChannelFactory(
4444
group: Option[AsynchronousChannelGroup] = None,
4545
channelOptions: ChannelOptions = ChannelOptions.DefaultOptions,
4646
scheduler: TickWheelExecutor = Execution.scheduler,
47-
connectTimeout: Duration = Duration.Inf,
47+
connectTimeout: Duration = Duration.Inf
4848
) {
4949
private[this] val logger = getLogger
5050

5151
// for binary compatibility with <=0.14.6
5252
def this(
5353
bufferSize: Int,
5454
group: Option[AsynchronousChannelGroup],
55-
channelOptions: ChannelOptions,
55+
channelOptions: ChannelOptions
5656
) =
5757
this(bufferSize, group, channelOptions, Execution.scheduler, Duration.Inf)
5858

5959
def connect(
6060
remoteAddress: SocketAddress,
61-
bufferSize: Int = bufferSize,
61+
bufferSize: Int = bufferSize
6262
): Future[HeadStage[ByteBuffer]] = {
6363
val p = Promise[HeadStage[ByteBuffer]]()
6464

core/src/main/scala/org/http4s/blaze/pipeline/PipelineBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ object LeafBuilder {
5656
*/
5757
final class TrunkBuilder[I1, O] private[pipeline] (
5858
protected val head: MidStage[I1, _],
59-
protected val tail: MidStage[_, O],
59+
protected val tail: MidStage[_, O]
6060
) {
6161
def append[N](stage: MidStage[O, N]): TrunkBuilder[I1, N] = {
6262
if (stage._prevStage != null) sys.error(s"Stage $stage must be fresh")

core/src/main/scala/org/http4s/blaze/pipeline/stages/SSLStage.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import org.http4s.blaze.util.{
3232
BufferTools,
3333
Execution,
3434
SerialExecutionContext,
35-
ThreadLocalScratchBuffer,
35+
ThreadLocalScratchBuffer
3636
}
3737
import org.http4s.blaze.util.BufferTools._
3838

0 commit comments

Comments
 (0)