Source:
public KeywordCachedArtifact writeSingleFileHitsToBlackBoard(String termHit, KeywordHit hit, String snippet, String listName) { BlackboardArtifact bba; Collection<BlackboardAttribute> attributes = new ArrayList<>(); try { if (keyword.getType() == ATTRIBUTE_TYPE.TSK_ACCOUNT_NUMBER) { bba = hit.getContent().newArtifact(ARTIFACT_TYPE.TSK_CREDIT_CARD_ACCOUNT); Matcher matcher = TRACK1_PATTERN.matcher(hit.getSnippet()); if (matcher.find()) { parseTrackData(bba, matcher, hit, true); } matcher = TRACK2_PATTERN.matcher(hit.getSnippet()); if (matcher.find()) { parseTrackData(bba, matcher, hit, false); } } else { bba = hit.getContent().newArtifact(ARTIFACT_TYPE.TSK_KEYWORD_HIT); attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD, MODULE_NAME, termHit)); attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP, MODULE_NAME, keyword.getQuery())); if (StringUtils.isNotEmpty(listName)) { attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_SET_NAME, MODULE_NAME, listName)); } } } catch (TskCoreException e) { LOGGER.log(Level.WARNING, "Error adding bb artifact for keyword hit", e); return null; } if (snippet != null) { attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW, MODULE_NAME, snippet)); } if (hit.isArtifactHit()) { attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT, MODULE_NAME, hit.getArtifact().getArtifactID())); } try { bba.addAttributes(attributes); KeywordCachedArtifact writeResult = new KeywordCachedArtifact(bba); writeResult.add(attributes); return writeResult; } catch (TskCoreException e) { LOGGER.log(Level.WARNING, "Error adding bb attributes for terms search artifact", e); return null; } }

Target:
public KeywordCachedArtifact writeSingleFileHitsToBlackBoard(String termHit, KeywordHit hit, String snippet, String listName) { BlackboardArtifact bba; Collection<BlackboardAttribute> attributes = new ArrayList<>(); try { if (keyword.getType() == ATTRIBUTE_TYPE.TSK_ACCOUNT_NUMBER) { bba = hit.getContent().newArtifact(ARTIFACT_TYPE.TSK_CREDIT_CARD_ACCOUNT); Matcher matcher = TRACK1_PATTERN.matcher(hit.getSnippet()); if (matcher.find()) { parseTrack1Data(bba, matcher, hit); } matcher = TRACK2_PATTERN.matcher(hit.getSnippet()); if (matcher.find()) { parseTrack2Data(bba, matcher, hit); } } else { bba = hit.getContent().newArtifact(ARTIFACT_TYPE.TSK_KEYWORD_HIT); attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD, MODULE_NAME, termHit)); attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP, MODULE_NAME, keyword.getQuery())); if (StringUtils.isNotEmpty(listName)) { attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_SET_NAME, MODULE_NAME, listName)); } } } catch (TskCoreException e) { LOGGER.log(Level.SEVERE, "Error adding bb artifact for keyword hit", e); return null; } if (snippet != null) { attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW, MODULE_NAME, snippet)); } if (hit.isArtifactHit()) { attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT, MODULE_NAME, hit.getArtifact().getArtifactID())); } try { bba.addAttributes(attributes); KeywordCachedArtifact writeResult = new KeywordCachedArtifact(bba); writeResult.add(attributes); return writeResult; } catch (TskCoreException e) { LOGGER.log(Level.SEVERE, "Error adding bb attributes for terms search artifact", e); return null; } }