-
Improvement
-
Resolution: Done
-
None
-
None
-
Operating System: Linux
Platform: PC
In our builders, we should never accept a null-valued list. When building the object, if the list-valued field is null, then we should set it to Collections.emptyList() instead. This makes writing code much more pleasant and really has no downside.
We have something like this: // check if empty if (myObjects.getListParam() == null || myObjects.getListParam().size() == 0) { // ... } becomes: if (myObjects.getListParam().size() == 0) { // ... } And this: if (myObjects.getListParam() != null) { for (ListValue v : myObjects.getListParam()) { // ... } } becomes: for (ListValue v : myObjects.getListParam()) { // ... }
Much nicer!
- relates to
-
YANGTOOLS-585 Data tree: automatic structural lifecycle
- Resolved