You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/07/06 11:45:28 UTC
[PR] refactor: load plugin check class with method handles [pekko-persistence-jdbc]
He-Pin opened a new pull request, #557:
URL: https://github.com/apache/pekko-persistence-jdbc/pull/557
Motivation:
Avoid Class.forName in the JDBC plugin compatibility check.
Modification:
Use MethodHandles.Lookup.findClass to detect the removed Slick database provider class and keep the existing failure behavior when it is present.
Result:
The version checker no longer relies on Class.forName for class-presence detection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Replace Class.forName in plugin version checker [pekko-persistence-jdbc]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #557: Replace Class.forName in plugin version checker
URL: https://github.com/apache/pekko-persistence-jdbc/pull/557
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Replace Class.forName in plugin version checker [pekko-persistence-jdbc]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #557:
URL: https://github.com/apache/pekko-persistence-jdbc/pull/557#discussion_r3531073190
##########
core/src/main/scala/org/apache/pekko/persistence/jdbc/util/PluginVersionChecker.scala:
##########
@@ -14,17 +14,19 @@
package org.apache.pekko.persistence.jdbc.util
+import java.lang.invoke.MethodHandles
+
import org.apache.pekko.annotation.InternalApi
@InternalApi
private[jdbc] object PluginVersionChecker {
def check(): Unit =
try {
- Class.forName("org.apache.pekko.persistence.jdbc.util.DefaultSlickDatabaseProvider")
+ MethodHandles.lookup().findClass("org.apache.pekko.persistence.jdbc.util.DefaultSlickDatabaseProvider")
throw new RuntimeException(
"Old version of Apache Pekko Persistence JDBC found on the classpath. Remove `com.github.dnvriend:pekko-persistence-jdbc` from the classpath..")
Review Comment:
this check is nonsense - an old akka check that was accidentally kept in pekko but modified to make no sense along the way - com.github.dnvriend:pekko-persistence-jdbc never existed
com.github.dnvriend:akka-persistence-jdbc is a thing but it won't interfere with pekko-persistence-jdbc
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Replace Class.forName in plugin version checker [pekko-persistence-jdbc]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #557:
URL: https://github.com/apache/pekko-persistence-jdbc/pull/557#issuecomment-4896133668
ye's
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org