Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-181

Java binding v1: IAE from provideTypeForLeafref(TypeProviderImpl.java:510)

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • External issue ID:
      6135

      Description

      When an enumeration is typedeffed and then used in leaf, leafref does not find it creating IllegalArgumentException instead.

      Example Yang model: https://git.opendaylight.org/gerrit/41142

      The stacktrace:

      [ERROR] yang-to-sources: Unable to generate sources with org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl generator
      java.lang.IllegalArgumentException: Failed to find leafref target: /tl:my-leaf in module test-leafref (QNameModule

      {ns=odl:test:leafref, rev=2015-04-09}

      ) [org.opendaylight.yangtools.sal.binding.yang.types.TypeProviderImpl@5489b1f7]
      at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
      at org.opendaylight.yangtools.sal.binding.yang.types.TypeProviderImpl.provideTypeForLeafref(TypeProviderImpl.java:510)
      at org.opendaylight.yangtools.sal.binding.yang.types.TypeProviderImpl.javaTypeForLeafrefOrIdentityRef(TypeProviderImpl.java:318)
      at org.opendaylight.yangtools.sal.binding.yang.types.TypeProviderImpl.javaTypeForSchemaDefinitionType(TypeProviderImpl.java:211)
      at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.resolveLeafSchemaNodeAsMethod(BindingGeneratorImpl.java:1452)
      at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.addSchemaNodeToBuilderAsMethod(BindingGeneratorImpl.java:1143)
      at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.resolveDataSchemaNodes(BindingGeneratorImpl.java:1080)
      at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.moduleToGenTypes(BindingGeneratorImpl.java:290)
      at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.generateTypes(BindingGeneratorImpl.java:259)
      at org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl.generateSources(CodeGeneratorImpl.java:61)
      at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.generateSourcesWithOneGenerator(YangToSourcesProcessor.java:348)
      at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.generateSources(YangToSourcesProcessor.java:293)
      at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.execute(YangToSourcesProcessor.java:95)
      at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.conditionalExecute(YangToSourcesProcessor.java:104)
      at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesMojo.execute(YangToSourcesMojo.java:119)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                martin.ciglan Martin Ciglan
                Reporter:
                vrpolak Vratko Polak
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: