Open King-Ozymandias opened 2 months ago
Might be related: Launched under Metals (clicking on the run option above "main" method):
And while I'm being thorough, build.sbt:
name := "<redacted>"
organization := "<redacted>"
version := "0.1-SNAPSHOT"
scalaVersion := "3.4.1"
libraryDependencies ++= Seq(
"org.scalafx" %% "scalafx" % "22.0.0-R33",
"org.scalatest" %% "scalatest" % "3.2.18" % "test",
"com.orientechnologies" % "orientdb-graphdb" % "3.2.29"
)
// Fork a new JVM for 'run' and 'test:run' to avoid JavaFX double initialization problems
fork := true
// set the main class for the main 'run' task
// change Compile to Test to set it for 'test:run'
Compile / run / mainClass := Some("<redacted>.ScalaFXHelloWorld")
OrientDB Version: 3.2.29
Java Version: 17 (build 17.0.11+9-Debian-1deb12u1, mixed mode, sharing)
OS: Linux 6.1.0-20-amd64#1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux
Scala: 3.4.1
Expected behavior
The Scala demo code (https://orientdb.com/docs/last/scala/Scala-Language.html) works
Actual behavior
The line
edge.getProperty("projects").asInstanceOf[Set[Vertex]].map(v=>v.getProperty[String]("name")).mkString(", ") else "Any"
errors out with:
Exception in thread "main" java.lang.ClassCastException: class com.orientechnologies.orient.core.db.record.ORecordLazySet cannot be cast to class scala.collection.immutable.Set (com.orientechnologies.orient.core.db.record.ORecordLazySet and scala.collection.immutable.Set are in unnamed module of loader 'app')
had to fix it as:
edge.getProperty("projects").asInstanceOf[ju.Set[Vertex]].asScala.map(v=>v.getProperty[String]("name")).mkString(", ") else "Any"
Steps to reproduce
Run the referenced example.