Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
7425
Description
Following YANG is not compilable by yangtools:
module demo {
namespace "urn:opendaylight:demo";
prefix "demo";
revision "2016-12-22";
typedef some-type {
type union
}
}
Yangtools generated source code requires union members to have method "String getValue()", which is not case of built-in type InstanceIdentifier.
This results in compilation error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project test-model: Compilation failure
[ERROR] demo/target/generated-sources/mdsal-binding/org/opendaylight/yang/gen/v1/urn/opendaylight/demo/rev161222/SomeType.java:[63,45] cannot find symbol
[ERROR] symbol: method getValue()
[ERROR] location: variable _instanceIdentifier of type org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>
This is generated code (SomeType.java):
60 public char[] getValue() {
61 if (_value == null) {
62 if (_instanceIdentifier != null)
else
65 if (_string != null)
68 }
69 return _value == null ? null : _value.clone();
70 }