hiero-ledger / hiero-ledger/hiero-consensus-node
SpotBugs review: OutboundConnectionCreator.java:[line 82] createConnection(), unused computation of ownRosterEntry
- Dominant language
- Java
- Stars
- 407
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
### Description
Such warnings may indicate incomplete coding or incomplete cleaning of draft idea.
```
Dead store to ownRosterEntry in com.swirlds.platform.network.connectivity.OutboundConnectionCreator.createConnection(NodeId)
--
| Bug type DLS_DEAD_LOCAL_STORE (click for details)In class com.swirlds.platform.network.connectivity.OutboundConnectionCreatorIn method com.swirlds.platform.network.connectivity.OutboundConnectionCreator.createConnection(NodeId)Local variable named ownRosterEntryAt OutboundConnectionCreator.java:[line 82]
Dead store to ownRosterEntry in com.swirlds.platform.network.connectivity.OutboundConnectionCreator.createConnection(NodeId)
[Bug type DLS_DEAD_LOCAL_STORE (click for details)](https://github.com/hashgraph/hedera-services/issues/new?assignees=&labels=bug&projects=&template=bug.yml#DLS_DEAD_LOCAL_STORE)
In class com.swirlds.platform.network.connectivity.OutboundConnectionCreator
In method com.swirlds.platform.network.connectivity.OutboundConnectionCreator.createConnection(NodeId)
Local variable named ownRosterEntry
At OutboundConnectionCreator.java:[line 82]
```
82 `final RosterEntry ownRosterEntry = RosterUtils.getRosterEntry(roster, selfId.id());`
the variable ownRosterEntry is never used
### Steps to reproduce
To run SpotBugs
### Additional context
_No response_
### Hedera network
_No response_
### Version
v0.58
### Operating system
Linux
Contributor guide
Research direction
Inspect OutboundConnectionCreator.java at line 82 and the createConnection(NodeId) method, focusing on the reported ownRosterEntry computation. Run SpotBugs as described in the issue and confirm the DLS_DEAD_LOCAL_STORE warning is no longer reported for this method.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100