I've installed NetBeans 6.8 (taking care to avoid spaces in path names) and the Scala plugin. When I try to build Kojo I get several problem tasks that report missing symbols (e.g. Point, method instance() in Singleton subclasses). Most of these disappear if I open the source file that defines the class or symbol, but others remain. Still, the build succeeds and I can run Kojo, but I almost immediately get an NPE or Illegal State Exception.
I've made a slight change to ScalaCodeRunner.scala; in Builtins I changed the declaration of Random and added two methods:
private val Random = new scala.util.Random
import scala.math._
def random[A] (upperBound: A)(implicit n: Numeric[A]): A = {
val ub = n.toDouble(upperBound)
if (upperBound.isInstanceOf[Int]) (Random.nextInt(ub.toInt)).asInstanceOf[A]
else if (upperBound.isInstanceOf[Float]) (Random.nextFloat * ub.toFloat).asInstanceOf[A]
else (Random.nextDouble * ub).asInstanceOf[A]
}
def random[A] (lowerBound: A, upperBound: A)(implicit n: Numeric[A]): A = {
val lb = n.toDouble(lowerBound)
val ub = n.toDouble(upperBound) - lb
val r = lb + random(ub)
if (upperBound.isInstanceOf[Int]) r.toInt.asInstanceOf[A]
else if (upperBound.isInstanceOf[Float]) r.toFloat.asInstanceOf[A]
else r.asInstanceOf[A]
}
If I can't get it to work I'll try reverting the change, but it doesn't seem likely that the above should be causing the problems mentioned.
Any ideas?
EDIT: I've reverted to revision 175 of KojoEnv now, and that actually made the reports about Point go away, but NB still can't find RunContext or CodeRunner unless I open core/codeRunner.scala in a window. And nothing I do makes the instance method visible, apparently. Curious.