Skip to content

Commit ee51463

Browse files
committed
clear warnings in http-core
1 parent b99f368 commit ee51463

File tree

18 files changed

+27
-36
lines changed

18 files changed

+27
-36
lines changed

http-core/src/main/scala/org/apache/pekko/http/impl/engine/http2/Http2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private[http] object Http2 extends ExtensionId[Http2Ext] with ExtensionIdProvide
293293
override def get(system: ClassicActorSystemProvider): Http2Ext = super.get(system)
294294
def apply()(implicit system: ClassicActorSystemProvider): Http2Ext = super.apply(system)
295295
override def apply(system: ActorSystem): Http2Ext = super.apply(system)
296-
def lookup(): ExtensionId[_ <: Extension] = Http2
296+
def lookup: ExtensionId[_ <: Extension] = Http2
297297
def createExtension(system: ExtendedActorSystem): Http2Ext = new Http2Ext()(system)
298298

299299
private[http] type HttpImplementation = Flow[SslTlsInbound, SslTlsOutbound, ServerTerminator]

http-core/src/main/scala/org/apache/pekko/http/impl/engine/rendering/BodyPartRenderer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private[http] object BodyPartRenderer {
151151
def randomBoundary(length: Int = 18, random: java.util.Random = ThreadLocalRandom.current()): String = {
152152
val array = new Array[Byte](length)
153153
random.nextBytes(array)
154-
Base64.custom.encodeToString(array, false)
154+
Base64.custom().encodeToString(array, false)
155155
}
156156

157157
/**

http-core/src/main/scala/org/apache/pekko/http/impl/engine/rendering/RenderSupport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private[http] object RenderSupport {
5656
val defaultLastChunkBytes: ByteString = renderChunk(HttpEntity.LastChunk)
5757

5858
def CancelSecond[T, Mat](first: Source[T, Mat], second: Source[T, Any]): Source[T, Mat] = {
59-
Source.fromGraph(GraphDSL.create(first) { implicit b => frst =>
59+
Source.fromGraph(GraphDSL.createGraph(first) { implicit b => frst =>
6060
import GraphDSL.Implicits._
6161
second ~> Sink.cancelled
6262
SourceShape(frst.out)

http-core/src/main/scala/org/apache/pekko/http/impl/model/parser/CharacterClasses.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
package org.apache.pekko.http.impl.model.parser
1515

16-
import org.apache.pekko
1716
import org.parboiled2.CharPredicate
1817

1918
// efficient encoding of *7-bit* ASCII characters

http-core/src/main/scala/org/apache/pekko/http/javadsl/Http.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import pekko.stream.scaladsl.Keep
4343
object Http extends ExtensionId[Http] with ExtensionIdProvider {
4444
override def get(system: ActorSystem): Http = super.get(system)
4545
override def get(system: ClassicActorSystemProvider): Http = super.get(system)
46-
def lookup() = Http
46+
def lookup = Http
4747
def createExtension(system: ExtendedActorSystem): Http = new Http(system)
4848
}
4949

http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ParserSettings.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import pekko.http.impl.util.JavaMapping.Implicits._
2727
import scala.annotation.varargs
2828
import scala.collection.JavaConverters._
2929
import pekko.http.javadsl.model.{ HttpMethod, MediaType, StatusCode, Uri }
30-
import scala.annotation.nowarn
3130
import com.typesafe.config.Config
3231

3332
/**
@@ -138,7 +137,6 @@ object ParserSettings extends SettingsCompanion[ParserSettings] {
138137
*/
139138
@Deprecated
140139
@deprecated("Use forServer or forClient instead", since = "Akka HTTP 10.2.0")
141-
@nowarn("msg=create overrides concrete, non-deprecated symbol")
142140
override def create(system: ActorSystem): ParserSettings = create(system.settings.config)
143141

144142
def forServer(system: ClassicActorSystemProvider): ParserSettings =

http-core/src/main/scala/org/apache/pekko/http/scaladsl/Http.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ class HttpExt @InternalStableApi /* constructor signature is hardcoded in Teleme
189189
@deprecated(
190190
"Use Http().newServerAt(...)...connectionSource() to create a source that can be materialized to a binding.",
191191
since = "10.2.0")
192-
@nowarn("msg=deprecated")
193192
def bind(interface: String, port: Int = DefaultPortForProtocol,
194193
connectionContext: ConnectionContext = defaultServerHttpContext,
195194
settings: ServerSettings = ServerSettings(system),
@@ -238,7 +237,6 @@ class HttpExt @InternalStableApi /* constructor signature is hardcoded in Teleme
238237
* use the `pekko.http.server` config section or pass in a [[pekko.http.scaladsl.settings.ServerSettings]] explicitly.
239238
*/
240239
@deprecated("Use Http().newServerAt(...)...bindFlow() to create server bindings.", since = "10.2.0")
241-
@nowarn("msg=deprecated")
242240
def bindAndHandle(
243241
handler: Flow[HttpRequest, HttpResponse, Any],
244242
interface: String, port: Int = DefaultPortForProtocol,
@@ -320,7 +318,6 @@ class HttpExt @InternalStableApi /* constructor signature is hardcoded in Teleme
320318
* use the `pekko.http.server` config section or pass in a [[pekko.http.scaladsl.settings.ServerSettings]] explicitly.
321319
*/
322320
@deprecated("Use Http().newServerAt(...)...bindSync() to create server bindings.", since = "10.2.0")
323-
@nowarn("msg=deprecated")
324321
def bindAndHandleSync(
325322
handler: HttpRequest => HttpResponse,
326323
interface: String, port: Int = DefaultPortForProtocol,
@@ -349,7 +346,6 @@ class HttpExt @InternalStableApi /* constructor signature is hardcoded in Teleme
349346
* Any other value for `parallelism` overrides the setting.
350347
*/
351348
@deprecated("Use Http().newServerAt(...)...bind() to create server bindings.", since = "10.2.0")
352-
@nowarn("msg=deprecated")
353349
def bindAndHandleAsync(
354350
handler: HttpRequest => Future[HttpResponse],
355351
interface: String, port: Int = DefaultPortForProtocol,
@@ -1133,7 +1129,7 @@ object Http extends ExtensionId[HttpExt] with ExtensionIdProvider {
11331129
def apply()(implicit system: ClassicActorSystemProvider): HttpExt = super.apply(system)
11341130
override def apply(system: ActorSystem): HttpExt = super.apply(system)
11351131

1136-
def lookup() = Http
1132+
def lookup = Http
11371133

11381134
def createExtension(system: ExtendedActorSystem): HttpExt =
11391135
new HttpExt(system.settings.config.getConfig("pekko.http"))(system)

http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
package org.apache.pekko.http.scaladsl.model
1515

1616
import java.util.OptionalLong
17-
1817
import language.implicitConversions
1918
import java.io.File
2019
import java.nio.file.{ Files, Path }
2120
import java.lang.{ Iterable => JIterable }
22-
2321
import scala.util.control.NonFatal
2422
import scala.concurrent.Future
2523
import scala.concurrent.duration._
@@ -38,10 +36,10 @@ import pekko.http.impl.util.JavaMapping.Implicits._
3836
import scala.compat.java8.OptionConverters._
3937
import scala.compat.java8.FutureConverters._
4038
import java.util.concurrent.CompletionStage
41-
4239
import pekko.actor.ClassicActorSystemProvider
4340
import pekko.annotation.{ DoNotInherit, InternalApi }
4441

42+
import scala.annotation.nowarn
4543
import scala.compat.java8.FutureConverters
4644

4745
/**
@@ -664,6 +662,7 @@ object HttpEntity {
664662
private var maxBytes = -1L
665663
private var bytesLeft = Long.MaxValue
666664

665+
@nowarn("msg=getFirst in class Attributes is deprecated") // there's no valid alternative right now
667666
override def preStart(): Unit = {
668667
attributes.getFirst[SizeLimit] match {
669668
case Some(limit: SizeLimit) if limit.isDisabled =>

http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/HttpCredentials.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final case class BasicHttpCredentials(username: String, password: String) extend
3333
val cookie = {
3434
val userPass = username + ':' + password
3535
val bytes = userPass.getBytes(`UTF-8`.nioCharset)
36-
Base64.rfc2045.encodeToChar(bytes, false)
36+
Base64.rfc2045().encodeToChar(bytes, false)
3737
}
3838
def render[R <: Rendering](r: R): r.type = r ~~ "Basic " ~~ cookie
3939

@@ -44,7 +44,7 @@ final case class BasicHttpCredentials(username: String, password: String) extend
4444

4545
object BasicHttpCredentials {
4646
def apply(credentials: String): BasicHttpCredentials = {
47-
val bytes = Base64.rfc2045.decodeFast(credentials.toCharArray)
47+
val bytes = Base64.rfc2045().decodeFast(credentials.toCharArray)
4848
val userPass = new String(bytes, `UTF-8`.nioCharset)
4949
userPass.indexOf(':') match {
5050
case -1 => apply(userPass, "")

http-core/src/test/scala/org/apache/pekko/http/impl/engine/client/HostConnectionPoolSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ class HostConnectionPoolSpec extends PekkoSpecWithMaterializer(
886886
// 2. when client connection was established, grab server connection as well and attach to proxies
887887
// (cannot be implemented with just mapMaterializedValue because there's no transposing constructor for BidiFlow)
888888
BidiFlow.fromGraph(
889-
GraphDSL.create(Sink.asPublisher[HttpResponse](fanout = false), Source.asSubscriber[HttpRequest],
889+
GraphDSL.createGraph(Sink.asPublisher[HttpResponse](fanout = false), Source.asSubscriber[HttpRequest],
890890
clientConnectionFlow(serverBinding, connectionKillSwitch))((_, _, _)) {
891891
implicit builder => (resIn, reqOut, client) =>
892892
import GraphDSL.Implicits._

0 commit comments

Comments
 (0)