makingthematrix / scalaonandroid

A tutorial and examples of how to write Android apps in Scala 2.13 and Scala 3.
GNU General Public License v3.0
176 stars 10 forks source link

Migrating projects to Scala 3 #8

Closed makingthematrix closed 3 years ago

makingthematrix commented 3 years ago

Issues number 1, I get a crash when I try to use a lazy val in HistoryController:

[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB] Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1856)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1723)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.event.Event.fireEvent(Event.java:198)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.scene.Node.fireEvent(Node.java:8792)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.scene.control.Button.fire(Button.java:203)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:208)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.event.Event.fireEvent(Event.java:198)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.scene.Scene$MouseHandler.process(Scene.java:3861)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.scene.Scene.processMouseEvent(Scene.java:1854)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2587)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at java.security.AccessController.doPrivileged(AccessController.java:100)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:413)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.glass.ui.View.handleMouseEvent(View.java:556)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.glass.ui.View.notifyMouse(View.java:942)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Lcom_sun_glass_ui_View_2_0002enotifyMouse_00028IIIIIIIZZ_00029V(JNIJavaCallWrappers.java:0)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.glass.ui.gtk.GtkApplication._runLoop(GtkApplication.java)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at java.lang.Thread.run(Thread.java:829)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:553)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB] Caused by: java.lang.reflect.InvocationTargetException
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at java.lang.reflect.Method.invoke(Method.java:566)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at java.lang.reflect.Method.invoke(Method.java:566)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1851)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     ... 53 more
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB] Caused by: scala.runtime.LazyVals$$anon$1
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at scala.runtime.LazyVals$.$init$$$anonfun$3(LazyVals.scala:18)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at scala.Option.getOrElse(Option.scala:201)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at scala.runtime.LazyVals$.<clinit>(LazyVals.scala:19)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at calculator.HistoryController$.loader(HistoryController.scala:14)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at calculator.HistoryController$.$init$$$anonfun$1(HistoryController.scala:18)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at scala.util.ChainingOps$.tap$extension(ChainingOps.scala:40)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at calculator.HistoryController$.<clinit>(HistoryController.scala:23)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
[Sat Jun 19 20:02:51 CEST 2021][INFO] [SUB]     at calculator.MainController.onHistory(MainController.scala:38)