Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-401

Restricted leaf's union type - Java API generator fails with IllegalArgumentException

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Operating System: Linux
      Platform: PC

    • 2619

    Description

      module union-restrictions {
      yang-version 1;
      namespace "urn:yang.foo";
      prefix "foo";

      import ietf-inet-types

      { prefix inet; }

      container foo {
      leaf address {
      type inet:host

      { //blah,blah,blah }

      }
      }
      }

      Binding Java API generator fails with "strange" (not relevant from user's point of view) error:

      java.lang.IllegalArgumentException: Type cannot have Package Name referenced as NULL!
      at com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)
      at org.opendaylight.yangtools.sal.java.api.generator.GeneratorUtil.putTypeIntoImports(GeneratorUtil.java:138)
      at org.opendaylight.yangtools.sal.java.api.generator.BaseTemplate.importedName(BaseTemplate.java:244)
      at org.opendaylight.yangtools.sal.java.api.generator.InterfaceTemplate.generateMethods(InterfaceTemplate.java:369)
      at org.opendaylight.yangtools.sal.java.api.generator.InterfaceTemplate.body(InterfaceTemplate.java:113)
      at org.opendaylight.yangtools.sal.java.api.generator.BaseTemplate.generate(BaseTemplate.java:77)

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              milos.fabian@pantheon.tech Milos Fabian
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: