follow up to address context menu change
What changed, and why it matters
This commit only removes code comments and switches a fully-qualified class name to a regular import. There is no change to program logic, user-facing behavior, or security controls. It is a minor cleanup follow-up to an earlier change.
No security action needed. Treat as routine non-functional cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff deletes three explanatory JavaDoc/comments in AddressCell.java, EntryCell.java, and NodeEntry.java, and replaces java.util.function.Supplier<NodeEntry> with an imported Supplier<NodeEntry>. No executable code, constructors, methods, or control flow are modified. The behavior described in the removed comments (lazy NodeEntry creation via a Supplier) remains in place.
Changed components
src/main/java/com/sparrowwallet/sparrow/control/AddressCell.javasrc/main/java/com/sparrowwallet/sparrow/control/EntryCell.javasrc/main/java/com/sparrowwallet/sparrow/wallet/NodeEntry.javaInspect captured patch +2 / −9
### src/main/java/com/sparrowwallet/sparrow/control/AddressCell.java
@@ -41,7 +41,6 @@ protected void updateItem(UtxoEntry.AddressStatus addressStatus, boolean empty)
if(utxoEntry != null) {
Address address = addressStatus.getAddress();
setText(address.toString());
- //Pass the wallet and node rather than a NodeEntry, which would eagerly create an entry for every transaction output of the address on each cell update
setContextMenu(new EntryCell.AddressContextMenu(address, utxoEntry.getOutputDescriptor(), utxoEntry.getWallet(), utxoEntry.getNode(),
() -> new NodeEntry(utxoEntry.getWallet(), utxoEntry.getNode(), false), false, getTreeTableView()));
Tooltip tooltip = new Tooltip();
### src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java
@@ -34,6 +34,7 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
+import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -717,11 +718,7 @@ public AddressContextMenu(Address address, String outputDescriptor, NodeEntry no
this(address, outputDescriptor, nodeEntry == null ? null : nodeEntry.getWallet(), nodeEntry == null ? null : nodeEntry.getNode(), () -> nodeEntry, addUtxoItems, treetable);
}
- /**
- * Creates the menu from the wallet and address node only. The NodeEntry, which eagerly creates an entry for every transaction output of the address,
- * is only created by the supplier when an action that requires it is selected.
- */
- public AddressContextMenu(Address address, String outputDescriptor, Wallet wallet, WalletNode node, java.util.function.Supplier<NodeEntry> nodeEntrySupplier, boolean addUtxoItems, TreeTableView<Entry> treetable) {
+ public AddressContextMenu(Address address, String outputDescriptor, Wallet wallet, WalletNode node, Supplier<NodeEntry> nodeEntrySupplier, boolean addUtxoItems, TreeTableView<Entry> treetable) {
if(node == null || (!wallet.isBip47() && wallet.getPolicyType() != PolicyType.SINGLE_SP)) {
MenuItem receiveToAddress = new MenuItem("Receive To");
receiveToAddress.setGraphic(getReceiveGlyph());
### src/main/java/com/sparrowwallet/sparrow/wallet/NodeEntry.java
@@ -19,9 +19,6 @@ public NodeEntry(Wallet wallet, WalletNode node) {
this(wallet, node, true);
}
- /**
- * @param createChildren false to skip creating an entry for every child node or transaction output, for uses that only need the node, address and label
- */
public NodeEntry(Wallet wallet, WalletNode node, boolean createChildren) {
super(wallet, node.getLabel(), createChildren ? createChildren(wallet, node) : new ArrayList<>());
this.node = node;Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.