Skip to content

Commit

Permalink
Merge pull request #3318 from millmanorama/897-return_content
Browse files Browse the repository at this point in the history
adjust to getRelationshipSources returning Set<Content> instead of Se…
  • Loading branch information
rcordovano committed Dec 13, 2017
2 parents c6944f2 + b6cf48c commit e94ec98
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -30,6 +30,7 @@
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.CommunicationsFilter;
import org.sleuthkit.datamodel.CommunicationsManager;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.TskCoreException;

/**
Expand All @@ -48,7 +49,7 @@ class AccountDetailsNode extends AbstractNode {
/**
* Children object for the relationships that the accounts are part of.
*/
private static class AccountRelationshipChildren extends ChildFactory<BlackboardArtifact> {
private static class AccountRelationshipChildren extends ChildFactory<Content> {

private final Set<AccountDeviceInstance> accountDeviceInstances;
private final CommunicationsManager commsManager;
Expand All @@ -61,7 +62,7 @@ private AccountRelationshipChildren(Set<AccountDeviceInstance> accountDeviceInst
}

@Override
protected boolean createKeys(List<BlackboardArtifact> list) {
protected boolean createKeys(List<Content> list) {
try {
list.addAll(commsManager.getRelationshipSources(accountDeviceInstances, filter));
} catch (TskCoreException ex) {
Expand All @@ -71,8 +72,12 @@ protected boolean createKeys(List<BlackboardArtifact> list) {
}

@Override
protected Node createNodeForKey(BlackboardArtifact t) {
return new RelationShipNode(t);
protected Node createNodeForKey(Content t) {
if (t instanceof BlackboardArtifact) {
return new RelationShipNode((BlackboardArtifact) t);
} else {
throw new UnsupportedOperationException("Cannot create a RelationshipNode for non BlackboardArtifact content.");
}
}
}
}

0 comments on commit e94ec98

Please sign in to comment.