Skip to content

Commit

Permalink
simplified method getSelectedBaseTreeNode that eliminates an intellij…
Browse files Browse the repository at this point in the history
… warning
  • Loading branch information
astrapi69 committed Nov 18, 2023
1 parent 7128b41 commit 751f0e1
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ protected void onDuplicateSelectedTreeNode(MouseEvent mouseEvent)
MaxIndexFinderTreeNodeVisitor<GenericTreeElement<List<MysticCryptEntryModelBean>>, Long, BaseTreeNode<GenericTreeElement<List<MysticCryptEntryModelBean>>, Long>> maxIndexFinderTreeNodeVisitor;

Long maxIndex;
Long nextId;
long nextId;
// implement the visitor for find the max index
maxIndexFinderTreeNodeVisitor = new MaxIndexFinderTreeNodeVisitor<>()
{
Expand Down Expand Up @@ -756,9 +756,7 @@ protected void onDeleteTableEntry()

protected void onEditTableEntry()
{
getTblTreeEntryTable().getSingleSelectedRowData().ifPresent(tableEntry -> {
showEditMysticCryptEntryDialog(tableEntry);
});
getTblTreeEntryTable().getSingleSelectedRowData().ifPresent(this::showEditMysticCryptEntryDialog);
}

protected void onOpenUrlOfTableEntry()
Expand All @@ -778,7 +776,6 @@ protected void onOpenUrlOfTableEntry()
});
}

@SuppressWarnings("unchecked")
protected void onAddTableEntry()
{
MysticCryptEntryTabbedPanel panel = new MysticCryptEntryTabbedPanel();
Expand Down Expand Up @@ -818,16 +815,14 @@ private void addNewTableEntryToModel(MysticCryptEntryModelBean modelObject)
private BaseTreeNode<GenericTreeElement<List<MysticCryptEntryModelBean>>, Long> getSelectedBaseTreeNode()
{
DefaultMutableTreeNode selectedTreeNode = getSelectedTreeNode();
BaseTreeNode<GenericTreeElement<List<MysticCryptEntryModelBean>>, Long> selectedBaseTreeNode;
if (selectedTreeNode == null)
{
selectedBaseTreeNode = getModelObject().getRoot();
return getModelObject().getRoot();
}
{
Object userObject = selectedTreeNode.getUserObject();
selectedBaseTreeNode = (BaseTreeNode<GenericTreeElement<List<MysticCryptEntryModelBean>>, Long>)userObject;
return (BaseTreeNode<GenericTreeElement<List<MysticCryptEntryModelBean>>, Long>)userObject;
}
return selectedBaseTreeNode;
}

private void reloadApplicationTreeModel()
Expand Down

0 comments on commit 751f0e1

Please sign in to comment.