Description
Merge of dto with create Parent set to true, will end on NoSuchElementException, when the dto path is the root.
public static final InstanceIdentifier<RoutingPolicy> ROUTING_POLICY_IID
= InstanceIdentifier.create(RoutingPolicy.class);
wtx.merge(LogicalDatastoreType.CONFIGURATION, ROUTING_POLICY_IID, routingPolicy,
WriteTransaction.CREATE_MISSING_PARENTS);
can be reproduced using patch[0] and running
OpenconfigRoutingPolicyLoaderTest
[0]https://git.opendaylight.org/gerrit/#/c/77460/
java.util.NoSuchElementException at com.google.common.collect.AbstractIndexedListIterator.next(AbstractIndexedListIterator.java:75) at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId(ImmutableNodes.java:199) at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId(ImmutableNodes.java:167) at org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec.instanceIdentifierToNode(BindingToNormalizedNodeCodec.java:449) at org.opendaylight.mdsal.binding.dom.adapter.AbstractWriteTransaction.ensureParentsByMerge(AbstractWriteTransaction.java:125) at org.opendaylight.mdsal.binding.dom.adapter.AbstractWriteTransaction.merge(AbstractWriteTransaction.java:55) at org.opendaylight.bgpcep.config.loader.routing.policy.OpenconfigRoutingPolicyLoader.loadConfiguration(OpenconfigRoutingPolicyLoader.java:73) at org.opendaylight.bgpcep.config.loader.impl.ConfigLoaderImpl.handleConfigFile(ConfigLoaderImpl.java:93) at org.opendaylight.bgpcep.config.loader.impl.ConfigLoaderImpl.registerConfigFile(ConfigLoaderImpl.java:159) at org.opendaylight.bgpcep.config.loader.routing.policy.OpenconfigRoutingPolicyLoader.init(OpenconfigRoutingPolicyLoader.java:51) at org.opendaylight.bgpcep.config.loader.routing.policy.AbstractOpenconfigRoutingPolicyLoaderTest.setUp(AbstractOpenconfigRoutingPolicyLoaderTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Attachments
| # | Subject | Branch | Project | Status | CR | V |
|---|---|---|---|---|---|---|
| 77480,1 | Tolerate empty instance identifier in ImmutableNodes.fromInstanceId() | master | yangtools | Status: MERGED | +2 | +1 |
| 77481,1 | Tolerate empty instance identifier in ImmutableNodes.fromInstanceId() | v2.0.6.x | yangtools | Status: MERGED | +2 | +1 |
| 77482,1 | Tolerate empty instance identifier in ImmutableNodes.fromInstanceId() | v2.0.x | yangtools | Status: MERGED | +2 | +1 |