I've managed to get byte code instrumentation working, however, I notice two peculiarities.
1) Several warnings of the form
[WARNING] [warn] [scoverage] Could not instrument [EmptyTree$/null]. No position.
2) A null pointer exception, which breaks the build:
[INFO] last tree to typer: Literal(Constant(String))
[INFO] symbol: null
[INFO] symbol definition: null
[INFO] tpe: Class(classOf[java.lang.String])
[INFO] symbol owners:
[INFO] context owners: package package -> package random
[INFO]
[INFO] == Enclosing template or block ==
[INFO]
[INFO] Template( // val <local package>: <notype> in package random, tree.tpe=org.apache.spark.util.random.package.type
[INFO] "java.lang.Object" // parents
[INFO] ValDef(
[INFO] private
[INFO] "_"
[INFO] <tpt>
[INFO] <empty>
[INFO] )
[INFO] DefDef( // def <init>(): org.apache.spark.util.random.package.type in package random
[INFO] <method>
[INFO] "<init>"
[INFO] []
[INFO] List(Nil)
[INFO] <tpt> // tree.tpe=org.apache.spark.util.random.package.type
[INFO] Block( // tree.tpe=Unit
[INFO] Apply( // def <init>(): Object in class Object, tree.tpe=Object
[INFO] `package`.super."<init>" // def <init>(): Object in class Object, tree.tpe=()Object
[INFO] Nil
[INFO] )
[INFO] ()
[INFO] )
[INFO] )
[INFO] )
[INFO]
[INFO] == Expanded type of tree ==
[INFO]
[INFO] ConstantType(value = Constant(String))
[INFO]
[INFO] uncaught exception during compilation: java.lang.NullPointerException
[ERROR] error: java.lang.NullPointerException
[INFO] at scala.tools.nsc.backend.icode.GenICode$ICodePhase$Context.exitScope(GenICode.scala:2001)
[INFO] at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1067)
[INFO] at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$6$$anonfun$apply$2.apply(GenICode.scala:418)
[INFO] at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$6$$anonfun$apply$2.apply(GenICode.scala:416)
[INFO] at scala.tools.nsc.backend.icode.GenICode$ICodePhase$Context$$anonfun$21.apply(GenICode.scala:2136)
[INFO] at scala.tools.nsc.backend.icode.GenICode$ICodePhase$Context$$anonfun$21.apply(GenICode.scala:2131)
[INFO] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
[INFO] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
[INFO] at scala.collection.immutable.List.foreach(List.scala:318)
[INFO] at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
I've pasted a full trace of a segment of the output here :
https://gist.github.com/jayunit100/9531dce4d95b94286597Any thoguhts would be appreciated.
SCoverage looks very cool ! Cant wait to get it working.