[YANGTOOLS-20] Generated code throws compiler errors Created: 24/Sep/13 Updated: 10/Apr/22 Resolved: 26/Sep/13 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Suchitra Raman | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Mac OS |
||
| Attachments: |
|
| Description |
|
Seeing a problem with generated code in the affinity yang file. The compiler errors is: [ERROR] /Users/sraman/affinity/affinity/yang/target/generated-sources/sal/org/opendaylight/yang/gen/v1/urn/opendaylight/affinity/rev130916/CreateAffinityGroupInputBuilder.java:[54,19] error: CreateAffinityGroupInputImpl is not abstract and does not override abstract method getAffinityIdentifier() in AffinityGroup (1) The first error may be due to incorrect order of following blocks of code. (2) There seems to be an issue with the @Override directive at line 66. This is the getAffinityIdentifers() method. Affinity-topology-all.yang is checked into the affinity repo. ==== private static class CreateAffinityGroupInputImpl implements CreateAffinityGroupInput { private final List<AffinityIdentifiers> _affinityIdentifiers; private CreateAffinityGroupInputImpl(CreateAffinityGroupInputBuilder builder) { this._affinityIdentifiers = builder.getAffinityIdentifiers(); this._id = builder.getId(); this.augmentation.putAll(builder.augmentation); } @Override @Override @SuppressWarnings("unchecked") return (E) augmentation.get(augmentationType); } |
| Comments |
| Comment by Martin Vitez [ 25/Sep/13 ] |
|
Hello, " which cannot be resolved (correct name should be opendaylight-inventory). Can you please attach actual affinity-topology-all.yang file for which code generation fails? |
| Comment by Suchitra Raman [ 25/Sep/13 ] |
|
(1) inventory vs. opendaylight-inventory. Pro:yang sraman$ pyang -p $YANG_MODPATH -f tree affinity-topology-all.yang (2) The new file is checked in now, please pull from repo. |
| Comment by Martin Vitez [ 25/Sep/13 ] |
|
I tried it now with updated affinity-topology-all.yang on simple example and it works for me. I add this example in attachments. |
| Comment by Martin Vitez [ 25/Sep/13 ] |
|
Attachment projectx.zip has been added with description: working example |
| Comment by Suchitra Raman [ 25/Sep/13 ] |
|
Error message with 0.5.8 says that there was another yang file with the same revision (not in the main tree, perhaps in the generated-sources, not sure). After updating the revision number this seemed to work fine. |