Remove Optional.ofNullable() antipatterns 43/80443/4
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 20 Feb 2019 22:21:13 +0000 (23:21 +0100)
committerArunprakash D <d.arunprakash@ericsson.com>
Thu, 7 Mar 2019 06:03:17 +0000 (06:03 +0000)
commit9fce9741dd02dd0999e1b5025394ede6d2824e70
tree492e632898a47e23bb20a955aabfbd14956e1bce
parent755683a5ec51f8bfc676a7114d82b88bbe8e0339
Remove Optional.ofNullable() antipatterns

Use of Optional.ofNullable().{map,orElseGet,...} are an antipattern
which is inefficient (as it hides logic from the compiler) and
places burden on EA to prove the objects can actually not be allocated.

This patch eliminates the trivial uses, leaving some more complex
flows to be untangled later.

Change-Id: Id05292b125dcfac4f77d2ea0a70a01ef04a78a0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ForwardingRulesManagerImpl.java
applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAger.java
openflowplugin-common/src/main/java/org/opendaylight/openflowplugin/common/txchain/TransactionChainManager.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetTpDstActionSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetTpSrcActionSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractMatchEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/util/ActionUtil.java