Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-1247

More graceful handling of nulls in Lists

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Won't Do
    • None
    • None
    • mdsal
    • None
    • Operating System: All
      Platform: All

    • 2979

    Description

      Recently encountered a somewhat cryptic exception from the MD-SAL that turned out to be rooted in having null values in a List.

      It would be nice if either:

      a) We threw the NPE with a clear error message at .build() time
      or
      b) We threw a more descriptive exception when we encounter nulls in lists
      in the codecs
      or
      c) Both

      The exception encountered was this:

      java.lang.NullPointerException
      at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow$StreamWriter.serialize(DataObjectSerializerPrototype.java)[264:org.opendaylight.openflowplugin.model.flow-service:0.1.0.SNAPSHOT]
      at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table$StreamWriter.serialize(DataObjectSerializerPrototype.java)[264:org.opendaylight.openflowplugin.model.flow-service:0.1.0.SNAPSHOT]
      at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry$DataObjectSerializerProxy.serialize(BindingNormalizedNodeCodecRegistry.java:294)[181:org.opendaylight.yangtools.binding-data-codec:0.7.0.SNAPSHOT]
      at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry.toNormalizedNode(BindingNormalizedNodeCodecRegistry.java:105)[181:org.opendaylight.yangtools.binding-data-codec:0.7.0.SNAPSHOT]
      at org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec.toNormalizedNode(BindingToNormalizedNodeCodec.java:75)[232:org.opendaylight.controller.sal-binding-broker-impl:1.2.0.SNAPSHOT]
      at org.opendaylight.controller.md.sal.binding.impl.AbstractWriteTransaction.put(AbstractWriteTransaction.java:42)[232:org.opendaylight.controller.sal-binding-broker-impl:1.2.0.SNAPSHOT]
      at org.opendaylight.groupbasedpolicy.renderer.ofoverlay.PolicyManager$FlowMap.commitToDataStore(PolicyManager.java:253)[283:org.opendaylight.groupbasedpolicy.ofoverlay-renderer:0.2.0.SNAPSHOT]
      at org.opendaylight.groupbasedpolicy.renderer.ofoverlay.PolicyManager$FlowUpdateTask.run(PolicyManager.java:335)[283:org.opendaylight.groupbasedpolicy.ofoverlay-renderer:0.2.0.SNAPSHOT]
      at org.opendaylight.groupbasedpolicy.util.SingletonTask$SingletonTaskWorker.run(SingletonTask.java:60)[259:org.opendaylight.groupbasedpolicy:0.2.0.SNAPSHOT]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_72]
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_72]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_72]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_72]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_72]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_72]
      at java.lang.Thread.run(Thread.java:745)[:1.7.0_72]

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tony.tkacik@gmail.com Tony Tkacik
            hagbard Ed Warnicke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: