This doesn't seem to be a problem of Scala IDE. After quick googling
it came out that the method doesn't exist in OpenJDK6:
Hi,
I tried the following scala code with eclipse
"Scala IDE build of Eclipse SDK
Build id: 3.0.0-vfinal-20130326-1453-Typesafe" under Ubuntu
LTS 12.03
object T extends App {
val unsafe: sun.misc.Unsafe = {
val unsafeField =
classOf[sun.misc.Unsafe].getDeclaredField("theUnsafe")
unsafeField.setAccessible(true)
unsafeField.get(null).asInstanceOf[sun.misc.Unsafe]
}
def t() {
//too many arguments for
method copyMemory: (x$1: Long, x$2: Long, x$3: Long)Unit
unsafe.copyMemory(null, 1,
null, 1, 100) // cannot be compiled of this line within
the Scala IDE
}
println (System.getProperty("java.version")) // 1.6.0_45
println (System.getProperty("java.vm.version")) //
20.45-b01
println
(scala.util.Properties.scalaPropOrElse("version.number",
"unknown")) // 2.9.3
}
The IDE complaints about "too many arguments for method
copyMemory: (x$1: Long, x$2: Long, x$3: Long)Unit" for the line
"unsafe.copyMemory(null, 1, null, 1, 100)"; but I am pretty sure
the sun.misc.Unsafe has the method signature
"copyMemory(Object,long,Object,long,long):void"
And I also tried that in Scala Interpreter and Scala IDE on
windows 7, everything works fine.
And I also tried that with the
ScalaIDE(for scala 2.10), everything
works fine too.
Seems it's a quite specific Scala IDE issue for Scala 2.9.3
under Ubuntu to me.
Appreciate it if any comment or workaround solution for that,
I have to coding under Ubuntu with scala 2.9.3.
Thanks,
Hao
--
You received this message because you are subscribed to the Google
Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to scala-ide-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.