This commit is contained in:
Greg DiCristofaro 2022-04-01 12:32:52 -04:00
parent 4178747fb4
commit 0944fd974e
2 changed files with 15 additions and 18 deletions

View File

@ -89,7 +89,7 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined;
import org.sleuthkit.autopsy.datamodel.CreditCards;
import org.sleuthkit.autopsy.datamodel.accounts.BINRange;
import org.sleuthkit.autopsy.mainui.datamodel.MainDAO;
import org.sleuthkit.autopsy.mainui.nodes.AnalysisResultTypeFactory.KeywordSetFactory;
import org.sleuthkit.autopsy.mainui.nodes.AnalysisResultTypeFactory.KeywordSetNode;
import org.sleuthkit.autopsy.mainui.nodes.AnalysisResultTypeFactory.TreeConfigTypeNode;
import org.sleuthkit.autopsy.mainui.nodes.ChildNodeSelectionInfo.BlackboardArtifactNodeSelectionInfo;
import org.sleuthkit.autopsy.mainui.nodes.DataArtifactTypeFactory.CreditCardByBinParentNode;
@ -1448,11 +1448,8 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
return null;
}
Node configNode = keywordRootNode.getChildren().findChild(kwh.getConfiguration());
if (configNode == null
|| configNode.getChildren() == null
|| configNode.getChildren().getNodesCount(true) == 0) {
Node configNode = keywordRootNode.getChildren().findChild(KeywordSetNode.getNodeName(kwh.getConfiguration()));
if (configNode == null) {
return null;
}
@ -1470,12 +1467,12 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
}
}
if (regex != null) { //For support of regex nodes such as URLs, IPs, Phone Numbers, and Email Addrs as they are down another level
Node regexNode = toRet.getChildren().findChild(regex);
if (regexNode == null
|| regexNode.getChildren() == null
|| regexNode.getChildren().getNodesCount(true) == 0) {
Node regexNode = toRet.getChildren() == null || toRet.getChildren().getNodesCount(true) == 0
? null
: toRet.getChildren().findChild(regex);
if (regexNode == null) {
return null;
}
@ -1484,11 +1481,11 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
}
if (keywordName != null) {
Node keywordNameNode = toRet.getChildren().findChild(keywordName);
if (keywordNameNode == null
|| keywordNameNode.getChildren() == null
|| keywordNameNode.getChildren().getNodesCount(true) == 0) {
Node keywordNameNode = toRet.getChildren() == null || toRet.getChildren().getNodesCount(true) == 0
? null
: toRet.getChildren().findChild(keywordName);
if (keywordNameNode == null) {
return null;
}

View File

@ -324,7 +324,7 @@ public class AnalysisResultTypeFactory extends AbstractAnalysisResultTreeFactory
* @param itemData The data to display.
*/
TreeConfigTypeNode(TreeResultsDTO.TreeItemDTO<? extends AnalysisResultSearchParam> itemData) {
super(itemData.getSearchParams().getArtifactType().getTypeName() + "_SET_" + itemData.getSearchParams().getConfiguration(),
super(getNodeName(itemData.getSearchParams().getArtifactType().getTypeName(), itemData.getSearchParams().getConfiguration()),
getIconPath(itemData.getSearchParams().getArtifactType()),
itemData,
Children.LEAF,
@ -445,7 +445,7 @@ public class AnalysisResultTypeFactory extends AbstractAnalysisResultTreeFactory
* @param itemData The data to display.
*/
public KeywordSetNode(TreeResultsDTO.TreeItemDTO<? extends KeywordListSearchParam> itemData) {
super("TSK_KEYWORD_HIT_SET_" + itemData.getSearchParams().getSetName(),
super(getNodeName(itemData.getSearchParams().getSetName()),
getIconPath(itemData.getSearchParams().getArtifactType()),
itemData,
Children.create(new KeywordSearchTermFactory(itemData.getSearchParams()), true),