Skip to content

NullPointerException during icode #93

Closed
@maiflai

Description

@maiflai

Hi,

scoverage/gradle-scoverage#35 was raised recently in the gradle-scoverage repository, but I think it's more likely a problem in the compiler plugin.

Compiling with 2.11.5 gives a NullPointerException with no message.

Compiling with 2.10.4 gives the following:

while compiling: /Users/stu/Documents/Eclipse/kafka/core/src/main/scala/kafka/utils/ZkUtils.scala
        during phase: icode
     library version: version 2.10.4
    compiler version: version 2.10.4
  reconstructed args: -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/classes:/Users/stu/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.10.4/9aae4cb1802537d604e03688cab744ff47b31a7d/scala-library-2.10.4.jar -classpath /Users/stu/Documents/Eclipse/kafka/core/build/classes/scoverage:/Users/stu/Documents/Eclipse/kafka/clients/build/libs/kafka-clients-0.8.3-SNAPSHOT.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.apache.zookeeper/zookeeper/3.4.6/1b2502e29da1ebaade2357cd1de35a855fa3755/zookeeper-3.4.6.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/com.101tec/zkclient/0.3/dedcf2b53fb742adba7080ac3aed781694ba616e/zkclient-0.3.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/com.yammer.metrics/metrics-core/2.2.0/f82c035cfa786d3cbec362c38c22a5f5b1bc8724/metrics-core-2.2.0.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/net.sf.jopt-simple/jopt-simple/3.2/d625f12ba08083c8c16dcedd5396ec730e9e77ab/jopt-simple-3.2.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.6/562424e36df3d2327e8e9301a76027fca17d54ea/slf4j-api-1.7.6.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.xerial.snappy/snappy-java/1.1.1.6/e3f12835a135c0d253bee4dbbe74d37ce35d7269/snappy-java-1.1.1.6.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/net.jpountz.lz4/lz4/1.2.0/cd301e9a481eae5b68c53267100aeca43b782b9f/lz4-1.2.0.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.6.1/b                                                                                             d245d6746cdd4e6203e976e21d597a46f115802/slf4j-log4j12-1.6.1.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/log4j/log4j/1.2.16/7999a63bfccbc7c247a9aea10d83d4272bd492c6/log4j-1.2.16.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.scoverage/gradle-scoverage/1.0-5-g9c68988/19bd553df3d6ced75d56b9912a10672af896ba9e/gradle-scoverage-1.0-5-g9c68988.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-runtime_2.10/1.0.2/92a4a183161a94d80b02697228dc9198dc12e0d8/scalac-scoverage-runtime_2.10-1.0.2.jar -deprecation -Yrangepos -Xplugin:/Users/stu/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-plugin_2.10/1.0.2/90936f85dfa01ba63f31f11544dcec2558281426/scalac-scoverage-plugin_2.10-1.0.2.jar -unchecked -P:scoverage:dataDir:/Users/stu/Documents/Eclipse/kafka/core/build/scoverage

  last tree to typer: Literal(Constant(Class))
              symbol: null
   symbol definition: null
                 tpe: Class(classOf[java.lang.Class])
       symbol owners: 
      context owners: anonymous class anonfun$getAllPartitions$1 -> package utils

== Enclosing template or block ==

Template( // val <local $anonfun>: <notype>, tree.tpe=kafka.utils.anonfun$getAllPartitions$1
  "scala.runtime.AbstractFunction1", "scala.Serializable" // parents
  ValDef(
    private
    "_"
    <tpt>
    <empty>
  )
  // 4 statements
  DefDef( // final def apply(topic: String): Seq
    <method> final <triedcooking>
    "apply"
    []
    // 1 parameter list
    ValDef( // topic: String
      <param> <triedcooking>
      "topic"
      <tpt> // tree.tpe=String
      <empty>
    )
    <tpt> // tree.tpe=Seq
    Block( // tree.tpe=Seq
      Apply( // def invoked(id: Int,dataDir: String): Unit in object Invoker, tree.tpe=Unit
        "scoverage"."Invoker"."invoked" // def invoked(id: Int,dataDir: String): Unit in object Invoker, tree.tpe=(id: Int, dataDir: String)Unit
        // 2 arguments
        25416
        "/Users/stu/Documents/Eclipse/kafka/core/build/scoverage"
      )
      Apply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=Seq
        TypeApply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=()Seq
          ZkUtils.this.getChildren(ZkUtils$$anonfun$getAllPartitions$1.this.zkClient$3, {
  scoverage.Invoker.invoked(25411, "/Users/stu/Documents/Eclipse/kafka/core/build/scoverage");
  ZkUtils.this.getTopicPartitionsPath(topic)
}).map({
  (new anonymous class anonfun$apply$11(ZkUtils$$anonfun$getAllPartitions$1.this): Function1)
}, {
  scoverage.Invoker.invoked(25413, "/Users/stu/Documents/Eclipse/kafka/core/build/scoverage");
  collection.this.Seq.canBuildFrom()
}).$asInstanceOf[collection.TraversableLike]().map({
  (new anonymous class anonfun$apply$12(ZkUtils$$anonfun$getAllPartitions$1.this, topic): Function1)
}, {
  scoverage.Invoker.invoked(25415, "/Users/stu/Documents/Eclipse/kafka/core/build/scoverage");
  collection.this.Seq.canBuildFrom()
})."$asInstanceOf" // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=[T0 >: ? <: ?]()T0
          <tpt> // tree.tpe=Seq
        )
        Nil
      )
    )
  )
  DefDef( // final def apply(v1: Object): Object
    <method> final <bridge>
    "apply"
    []
    // 1 parameter list
    ValDef( // v1: Object
      <param> <triedcooking>
      "v1"
      <tpt> // tree.tpe=Object
      <empty>
    )
    <tpt> // tree.tpe=Object
    Apply( // final def apply(topic: String): Seq, tree.tpe=Seq
      ZkUtils$$anonfun$getAllPartitions$1.this."apply" // final def apply(topic: String): Seq, tree.tpe=(topic: String)Seq
      Apply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=String
        TypeApply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=()String
          "v1"."$asInstanceOf" // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=[T0 >: ? <: ?]()T0
          <tpt> // tree.tpe=String
        )
        Nil
      )
    )
  )
  ValDef( // private[this] val zkClient$3: org.I0Itec.zkclient.ZkClient
    private <local> <synthetic> <paramaccessor> <triedcooking>
    "zkClient$3"
    <tpt> // tree.tpe=org.I0Itec.zkclient.ZkClient
    <empty>
  )
  DefDef( // def <init>(zkClient$3: org.I0Itec.zkclient.ZkClient): kafka.utils.anonfun$getAllPartitions$1
    <method> <triedcooking>
    "<init>"
    []
    // 1 parameter list
    ValDef( // zkClient$3: org.I0Itec.zkclient.ZkClient
      <param> <synthetic> <triedcooking>
      "zkClient$3"
      <tpt> // tree.tpe=org.I0Itec.zkclient.ZkClient
      <empty>
    )
    <tpt> // tree.tpe=kafka.utils.anonfun$getAllPartitions$1
    Block( // tree.tpe=Unit
      // 2 statements
      Assign( // tree.tpe=Unit
        ZkUtils$$anonfun$getAllPartitions$1.this."zkClient$3" // private[this] val zkClient$3: org.I0Itec.zkclient.ZkClient, tree.tpe=org.I0Itec.zkclient.ZkClient
        "zkClient$3" // zkClient$3: org.I0Itec.zkclient.ZkClient, tree.tpe=org.I0Itec.zkclient.ZkClient
      )
      Apply( // def <init>(): scala.runtime.AbstractFunction1 in class AbstractFunction1, tree.tpe=scala.runtime.AbstractFunction1
        ZkUtils$$anonfun$getAllPartitions$1.super."<init>" // def <init>(): scala.runtime.AbstractFunction1 in class AbstractFunction1, tree.tpe=()scala.runtime.AbstractFunction1
        Nil
      )
      ()
    )
  )
)

== Expanded type of tree ==

ConstantType(value = Constant(Class))

uncaught exception during compilation: java.lang.NullPointerException

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions