Merge pull request #2766 from raman-bt/release-4.4.0

2536: Review ChildFactory uses for long-running tasks
This commit is contained in:
Richard Cordovano 2017-05-02 15:27:37 -04:00 committed by GitHub
commit a3e4f1b440
4 changed files with 29 additions and 16 deletions

View File

@ -379,10 +379,11 @@ public class HashsetHits implements AutopsyVisitableItem {
hashsetResults.getArtifactIds(hashsetName).forEach((id) -> {
try {
BlackboardArtifact art = skCase.getBlackboardArtifact(id);
artifactHits.put(id, art);
list.add(id);
if (!artifactHits.containsKey(id)) {
BlackboardArtifact art = skCase.getBlackboardArtifact(id);
artifactHits.put(id, art);
list.add(id);
}
} catch (TskException ex) {
logger.log(Level.SEVERE, "TSK Exception occurred", ex); //NON-NLS
}

View File

@ -354,10 +354,12 @@ public class InterestingHits implements AutopsyVisitableItem {
interestingResults.getArtifactIds(setName).forEach((id) -> {
try {
BlackboardArtifact art = skCase.getBlackboardArtifact(id);
artifactHits.put(id, art);
list.add(id);
if (!artifactHits.containsKey(id)) {
BlackboardArtifact art = skCase.getBlackboardArtifact(id);
artifactHits.put(id, art);
list.add(id);
}
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "TSK Exception occurred", ex); //NON-NLS
}

View File

@ -707,15 +707,19 @@ public class KeywordHits implements AutopsyVisitableItem {
if ((instances.size() == 1) && (instances.get(0).equals(DEFAULT_INSTANCE_NAME))) {
for (Long id : keywordResults.getArtifactIds(setName, keyword, DEFAULT_INSTANCE_NAME) ) {
RegExpInstanceKey key = new RegExpInstanceKey(id);
nodesMap.put(key, createNode(key));
list.add(key);
if (!nodesMap.containsKey(key)) {
nodesMap.put(key, createNode(key));
list.add(key);
}
}
} else {
for (String instance : instances) {
RegExpInstanceKey key = new RegExpInstanceKey(instance);
nodesMap.put(key, createNode(key));
list.add(key);
if (!nodesMap.containsKey(key)) {
nodesMap.put(key, createNode(key));
list.add(key);
}
}
}
@ -898,9 +902,11 @@ public class KeywordHits implements AutopsyVisitableItem {
@Override
protected boolean createKeys(List<Long> list) {
for (Long id : keywordResults.getArtifactIds(setName, keyword, instance) ) {
if (!nodesMap.containsKey(id)) {
nodesMap.put(id, createBlackboardArtifactNode(id));
list.add(id);
}
}
return true;
}

View File

@ -100,12 +100,16 @@ public class EventRootNode extends DisplayableItemNode {
*/
if (eventIDs.size() < MAX_EVENTS_TO_DISPLAY) {
for (Long eventId: eventIDs){
nodesMap.put(eventId, createNode(eventId));
toPopulate.add(eventId);
if (!nodesMap.containsKey(eventId)) {
nodesMap.put(eventId, createNode(eventId));
toPopulate.add(eventId);
}
}
} else {
nodesMap.put(-1L, createNode(-1L));
toPopulate.add(-1L);
if (!nodesMap.containsKey(-1L)) {
nodesMap.put(-1L, createNode(-1L));
toPopulate.add(-1L);
}
}
return true;
}