- } else {
- final DataSchemaNode schemaNode = checkListAndOrderedType(schemaContext, path);
- switch (insert) {
- case "first":
- if (schemaNode instanceof ListSchemaNode) {
- final NormalizedNode<?, ?> readData =
- readList(path, schemaContext, transactionChainHandler, schemaNode);
- final OrderedMapNode readList = (OrderedMapNode) readData;
- if (readList == null || readList.getValue().isEmpty()) {
- return makePut(path, schemaContext, readWriteTransaction, data);
- } else {
- readWriteTransaction.delete(LogicalDatastoreType.CONFIGURATION, path.getParent());
- simplePut(LogicalDatastoreType.CONFIGURATION, path, readWriteTransaction,
- schemaContext, data);
- listPut(LogicalDatastoreType.CONFIGURATION, path.getParent(), readWriteTransaction,
- schemaContext, readList);
- return readWriteTransaction.submit();
- }
+ }
+
+ final DataSchemaNode schemaNode = checkListAndOrderedType(schemaContext, path);
+ switch (insert) {
+ case "first":
+ if (schemaNode instanceof ListSchemaNode) {
+ final NormalizedNode<?, ?> readData =
+ readList(path, schemaContext, transactionChainHandler, schemaNode);
+ final OrderedMapNode readList = (OrderedMapNode) readData;
+ if (readList == null || readList.getValue().isEmpty()) {
+ return makePut(path, schemaContext, readWriteTransaction, data);