From 86ac0c8b1aecf3f321e6db7a517ea7230d73d436 Mon Sep 17 00:00:00 2001 From: ragnar Date: Sat, 20 Jul 2024 18:18:46 +0200 Subject: [PATCH] address some more publishing warnings/errors --- .../js/src/main/scala/channels/webrtc/WebRTCConnector.scala | 4 ++-- .../shared/src/main/scala/dtn/routing/DirectRouter.scala | 4 +++- .../src/main/scala/lofi_acl/crypto/X509Util.scala | 2 +- Modules/Lore/jvm/src/main/scala/lore/cli/Options.scala | 2 +- .../main/scala/benchmarks/encrdt/BenchmarkRunnerApp.scala | 4 ++-- .../encrdt/StateBasedUntrustedReplicaSizeBenchmark.scala | 6 +++--- .../src/main/scala/benchmarks/encrdt/ToDoAppBenchmark.scala | 4 ++-- .../jvm/src/main/scala/replication/dtn/dtn.scala | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Modules/Channels/js/src/main/scala/channels/webrtc/WebRTCConnector.scala b/Modules/Channels/js/src/main/scala/channels/webrtc/WebRTCConnector.scala index b491a8ee2..e0974f5d2 100644 --- a/Modules/Channels/js/src/main/scala/channels/webrtc/WebRTCConnector.scala +++ b/Modules/Channels/js/src/main/scala/channels/webrtc/WebRTCConnector.scala @@ -43,7 +43,7 @@ object WebRTCConnector { * Then create a channel directly on peer connection, which will trigger the connection initiation process. * Somehow transfer the local session description to a remote peer, and [[updateRemoteDescription]] there. * Accepting a remote description will update the local description, - * which then needs to be transferred back to the original peer and [[updateLocalDescription]] there should complete the connection. + * which then needs to be transferred back to the original peer and [[smartUpdateLocalDescription]] there should complete the connection. */ class WebRTCConnector(configuration: dom.RTCConfiguration) { @@ -83,7 +83,7 @@ class WebRTCConnector(configuration: dom.RTCConfiguration) { SessionDescription(peerConnection.localDescription).get } - /** Use [[peerConnection.addIceCandidate]] to apply on remote. + /** Use `peerConnection.addIceCandidate` to apply on remote. * Once an ICE candidate exists it is also automatically included in the local description, so this is not necessary. */ def iceCandidates: Async[Any, RTCIceCandidate] = Async.fromCallback: diff --git a/Modules/DTN/shared/src/main/scala/dtn/routing/DirectRouter.scala b/Modules/DTN/shared/src/main/scala/dtn/routing/DirectRouter.scala index e7d4af0bc..fc20ddf81 100644 --- a/Modules/DTN/shared/src/main/scala/dtn/routing/DirectRouter.scala +++ b/Modules/DTN/shared/src/main/scala/dtn/routing/DirectRouter.scala @@ -2,6 +2,7 @@ package dtn.routing import dtn.{DtnPeer, Packet, Sender, WSEroutingClient} +import java.lang import java.util.concurrent.ConcurrentHashMap import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future @@ -11,7 +12,8 @@ import scala.concurrent.Future */ class DirectRouter(ws: WSEroutingClient) extends BaseRouter(ws: WSEroutingClient) { - val delivered = ConcurrentHashMap.newKeySet[String]() // will grow indefinitely as we do not garbage collect here + val delivered: ConcurrentHashMap.KeySetView[String, lang.Boolean] = + ConcurrentHashMap.newKeySet[String]() // will grow indefinitely as we do not garbage collect here override def onRequestSenderForBundle(packet: Packet.RequestSenderForBundle) : Option[Packet.ResponseSenderForBundle] = { diff --git a/Modules/Local-first Access Control/src/main/scala/lofi_acl/crypto/X509Util.scala b/Modules/Local-first Access Control/src/main/scala/lofi_acl/crypto/X509Util.scala index 11669163f..00e33a23f 100644 --- a/Modules/Local-first Access Control/src/main/scala/lofi_acl/crypto/X509Util.scala +++ b/Modules/Local-first Access Control/src/main/scala/lofi_acl/crypto/X509Util.scala @@ -80,7 +80,7 @@ object X509Util { * * @param certificate * The certificate to extract the subject identity from. - * @throws CertificateException + * @throws java.security.cert.CertificateException * if the validation failed */ @throws[CertificateException] diff --git a/Modules/Lore/jvm/src/main/scala/lore/cli/Options.scala b/Modules/Lore/jvm/src/main/scala/lore/cli/Options.scala index 3f673b45e..187139263 100644 --- a/Modules/Lore/jvm/src/main/scala/lore/cli/Options.scala +++ b/Modules/Lore/jvm/src/main/scala/lore/cli/Options.scala @@ -7,7 +7,7 @@ import java.nio.file.Path /** @param file Path to a file * @param inline inline sourcecode of a program - * @param outputOptions output mode. Can be either [[ToFile]], [[SplitMode]] or [[StdOut]] + * @param outputOptions output mode. Can be either [[lore.cli.OutputOptions.ToFile]], [[lore.cli.OutputOptions.SplitMode]] or [[lore.cli.OutputOptions.StdOut]] */ case class Options(file: Option[Path] = None, inline: Option[String] = None, outputOptions: OutputOptions = StdOut) { diff --git a/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/BenchmarkRunnerApp.scala b/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/BenchmarkRunnerApp.scala index 13115ea32..dea43695b 100644 --- a/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/BenchmarkRunnerApp.scala +++ b/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/BenchmarkRunnerApp.scala @@ -3,7 +3,7 @@ package benchmarks.encrdt import org.openjdk.jmh.results.RunResult import org.openjdk.jmh.results.format.ResultFormatType import org.openjdk.jmh.runner.Runner -import org.openjdk.jmh.runner.options.OptionsBuilder +import org.openjdk.jmh.runner.options.{Options, OptionsBuilder} import java.nio.file.Paths import java.util @@ -14,7 +14,7 @@ object BenchmarkRunnerApp extends App { val timeBefore = System.currentTimeMillis() - val jmhOptions = new OptionsBuilder() + val jmhOptions: Options = new OptionsBuilder() .include("serializeOnly|encryptOnly") .resultFormat(ResultFormatType.CSV) .result("benchmarks/results/jmh_benchmark.csv") diff --git a/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/StateBasedUntrustedReplicaSizeBenchmark.scala b/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/StateBasedUntrustedReplicaSizeBenchmark.scala index c0c164b09..5ad205113 100644 --- a/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/StateBasedUntrustedReplicaSizeBenchmark.scala +++ b/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/StateBasedUntrustedReplicaSizeBenchmark.scala @@ -6,10 +6,10 @@ import com.github.plokhotnyuk.jsoniter_scala.core.writeToArray import rdts.syntax.DeltaAWLWWMContainer import rdts.syntax.DeltaAWLWWMContainer.State import rdts.time.VectorClock -import scala.language.implicitConversions +import scala.language.implicitConversions import java.io.PrintWriter -import java.nio.file.{Files, Paths} +import java.nio.file.{Files, Path, Paths} import scala.language.implicitConversions object StateBasedUntrustedReplicaSizeBenchmark extends App { @@ -18,7 +18,7 @@ object StateBasedUntrustedReplicaSizeBenchmark extends App { val MAX_TESTED_ELEMENTS = Math.pow(10, maxElementExponent.toDouble).toInt val MAX_PARALLEL_UPDATES = 4 - val outDir = Paths.get("./benchmarks/results/") + val outDir: Path = Paths.get("./benchmarks/results/") if !outDir.toFile.exists() then outDir.toFile.mkdirs() () diff --git a/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/ToDoAppBenchmark.scala b/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/ToDoAppBenchmark.scala index 33c81fa53..560503550 100644 --- a/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/ToDoAppBenchmark.scala +++ b/Modules/Microbenchmarks/src/main/scala/benchmarks/encrdt/ToDoAppBenchmark.scala @@ -8,7 +8,7 @@ import com.google.crypto.tink.Aead import rdts.syntax.DeltaAWLWWMContainer import java.io.PrintWriter -import java.nio.file.{Files, Paths} +import java.nio.file.{Files, Path, Paths} import java.util.UUID object ToDoAppBenchmark extends App { @@ -39,7 +39,7 @@ object ToDoAppBenchmark extends App { clientReplica = new AlternativeInsecureToDoListClient("client", clientCrdt, intermediaryReplica) } - val csvFileF = + val csvFileF: Path = if USE_ENCRYPTION then Paths.get("./benchmarks/results/todoapp_benchmark.csv") else Paths.get("./benchmarks/results/todoapp_benchmark trusted intermediary.csv") Files.createDirectories(csvFileF.getParent) diff --git a/Modules/Replication/jvm/src/main/scala/replication/dtn/dtn.scala b/Modules/Replication/jvm/src/main/scala/replication/dtn/dtn.scala index 26cba9c4e..646dcbc3f 100644 --- a/Modules/Replication/jvm/src/main/scala/replication/dtn/dtn.scala +++ b/Modules/Replication/jvm/src/main/scala/replication/dtn/dtn.scala @@ -23,7 +23,7 @@ def api(using scheme: String = "http"): String = val port = 3000 s"$scheme://$ip:$port" -val client = HttpClient.newBuilder() +val client: HttpClient = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(20)) .build()