tuned -- avoid deprecated operations;
authorwenzelm
Wed, 08 Apr 2020 14:06:26 +0200
changeset 71734 713fafb3de79
parent 71733 6c470c918aad
child 71735 9644811b5b0a
tuned -- avoid deprecated operations;
src/Pure/PIDE/protocol_handlers.scala
src/Pure/System/isabelle_system.scala
--- a/src/Pure/PIDE/protocol_handlers.scala	Wed Apr 08 13:14:05 2020 +0200
+++ b/src/Pure/PIDE/protocol_handlers.scala	Wed Apr 08 14:06:26 2020 +0200
@@ -51,7 +51,10 @@
     def init(name: String): State =
     {
       val new_handler =
-        try { Some(Class.forName(name).newInstance.asInstanceOf[Session.Protocol_Handler]) }
+        try {
+          Some(Class.forName(name).getDeclaredConstructor().newInstance()
+            .asInstanceOf[Session.Protocol_Handler])
+        }
         catch { case exn: Throwable => bad_handler(exn, name); None }
       new_handler match { case Some(handler) => init(handler) case None => this }
     }
--- a/src/Pure/System/isabelle_system.scala	Wed Apr 08 13:14:05 2020 +0200
+++ b/src/Pure/System/isabelle_system.scala	Wed Apr 08 14:06:26 2020 +0200
@@ -380,7 +380,9 @@
       def err(msg: String): Nothing =
         error("Bad entry " + quote(name) + " in " + variable + "\n" + msg)
 
-      try { Class.forName(name).asInstanceOf[Class[A]].newInstance() }
+      try {
+        Class.forName(name).asInstanceOf[Class[A]].getDeclaredConstructor().newInstance()
+      }
       catch {
         case _: ClassNotFoundException => err("Class not found")
         case exn: Throwable => err(Exn.message(exn))