Remove redundant non null check in JsonPatchBody 39/116139/11
authorPeter Suna <peter.suna@pantheon.tech>
Wed, 2 Apr 2025 12:29:49 +0000 (14:29 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Mon, 5 May 2025 08:22:05 +0000 (08:22 +0000)
commita3342a0cbb35994b224715c39ad25fab5bfedfc8
tree8202b94d21ed3ca3172d92ae903e322e9075dd56
parent6cb79c455d94332f0ba730e22511c15f572127a8
Remove redundant non null check in JsonPatchBody

Remove the redundant check for a non-null TargetSchemaNode
in JsonPatchBody. Reason:

- The TargetSchemaNode is not used inside this method or under
this if block.
- If the target is not null, then TargetSchemaNode should also
not be null, or it should fail here as an invalid state:
JsonPatchBody.PatchEdit#setTargetSchemaNode()
- The only place where TargetSchemaNode is used is here:
JsonPatchBody#readEditDefinition()
so in this state, it is already checked.

JIRA: NETCONF-1438
Change-Id: Ia08bcbbeb14f425d0b0a430b21257fa6fcf7bffe
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
protocol/restconf-server-api/src/main/java/org/opendaylight/restconf/server/api/JsonPatchBody.java