[YANGTOOLS-535] NPE when reading an object generated from a choice statement Created: 23/Oct/15 Updated: 10/Apr/22 Resolved: 28/Oct/15 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Lori Jakab | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 4520 |
| Description |
|
Trying to get an object generated from a choice statement including both leaf and container results in a NPE. I'm not 100% sure that the NPE is caused by the combination of leaf and container, but there it is. The model used resembles the following: grouping object { container complex-type { uses some-grouping; } } Real version at [1]. The object grouping is used as the input for an RPC. When trying to call RPCInput.getObject().getType() the NPE is thrown. Same result if the grouping is used for RESTCONF input, when reading the generated objects. Here are the relevant first few lines (based on the real model): java.lang.NullPointerException |
| Comments |
| Comment by Vratko Polak [ 23/Oct/15 ] |
|
Is this just another symptom of |
| Comment by Lori Jakab [ 23/Oct/15 ] |
|
I will check if the proposed fix for |
| Comment by Martin Ciglan [ 28/Oct/15 ] |
|
Hi
|
| Comment by Lori Jakab [ 28/Oct/15 ] |
|
I just checked, the issue is now fixed. The problem was not mixing leaves and containers under `choice`, but rather the lack of a `case` statement for each choice, because by adding a `case` statement also fixed the issue. But now it works without the `case` statement too. |
| Comment by Martin Ciglan [ 28/Oct/15 ] |
|
real issue was case-shorthand stated in GROUPING. Glad to hear it works. Thank you. |