remove some stray java version checks (#2227)

This commit is contained in:
PJ Fanning 2025-09-17 08:31:23 +01:00 committed by GitHub
parent ee704f7e5a
commit e66cda2899
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 15 deletions

View file

@ -12,6 +12,7 @@
*/
package org.apache.pekko.util
import scala.reflect.ClassTag
import scala.util.{ Failure, Success }
@ -26,7 +27,7 @@ import pekko.annotation.InternalApi
private[pekko] object FlightRecorderLoader {
def load[T: ClassTag](casp: ClassicActorSystemProvider, fqcn: String, fallback: T): T = {
val system = casp.classicSystem.asInstanceOf[ExtendedActorSystem]
if (JavaVersion.majorVersion >= 11 && system.settings.config.getBoolean("pekko.java-flight-recorder.enabled")) {
if (system.settings.config.getBoolean("pekko.java-flight-recorder.enabled")) {
// Dynamic instantiation to not trigger class load on earlier JDKs
system.dynamicAccess.createInstanceFor[T](fqcn, Nil) match {
case Success(jfr) =>
@ -36,7 +37,6 @@ private[pekko] object FlightRecorderLoader {
fallback
} // fallback if not possible to dynamically load for some reason
} else
// JFR not available on Java 8
fallback
}
}

View file

@ -5,7 +5,7 @@ project-info {
scaladoc: "https://pekko.apache.org/api/pekko/"${project-info.version}"/org/apache/pekko/"
javadoc: "https://pekko.apache.org/japi/pekko/"${project-info.version}"/org/apache/pekko/"
shared-info {
jdk-versions: ["OpenJDK 8", "OpenJDK 11", "OpenJDK 17", "OpenJDK 21"]
jdk-versions: ["OpenJDK 17", "OpenJDK 21"]
snapshots: {
url: "https://pekko.apache.org/docs/pekko/current/project/links.html#snapshots-repository"
text: "Snapshots are available"

View file

@ -115,8 +115,7 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing
"SslTls" must {
"work for TLSv1.2" must { workFor("TLSv1.2", TLS12Ciphers) }
if (JavaVersion.majorVersion >= 11)
"work for TLSv1.3" must { workFor("TLSv1.3", TLS13Ciphers) }
"work for TLSv1.3" must { workFor("TLSv1.3", TLS13Ciphers) }
def workFor(protocol: String, ciphers: Set[String]): Unit = {
val sslContext = initSslContext(protocol)
@ -483,7 +482,7 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing
Await.result(serverErr, 1.second).getMessage should include("certificate_unknown")
val clientErrText = rootCauseOf(Await.result(clientErr, 1.second)).getMessage
val clientErrText = Await.result(clientErr, 1.second).getMessage
clientErrText should include("unable to find valid certification path to requested target")
}
@ -590,21 +589,13 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing
cause.getClass should ===(classOf[SSLHandshakeException]) // General SSLEngine problem
val rootCause = rootCauseOf(cause.getCause)
val rootCause = cause.getCause
rootCause.getClass should ===(classOf[CertificateException])
rootCause.getMessage should ===("No name matching unknown.example.org found")
}
}
}
def rootCauseOf(e: Throwable): Throwable = {
if (JavaVersion.majorVersion >= 11) e
// Wrapped in extra 'General SSLEngine problem' (sometimes multiple)
// on 1.8.0-265 and before, but not 1.8.0-272 and later...
else if (e.isInstanceOf[SSLHandshakeException]) rootCauseOf(e.getCause)
else e
}
"A SslTlsPlacebo" must {
"pass through data" in {