From 61cdebf9eff06931b4d8e3acde80683c7f4e01cb Mon Sep 17 00:00:00 2001 From: millmanorama Date: Sat, 23 Sep 2017 21:51:23 +0200 Subject: [PATCH] remove null checks --- .../autopsy/keywordsearch/AccountsText.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java index ac94008115..20f8105751 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java @@ -228,14 +228,10 @@ class AccountsText implements IndexedText { //add both the canonical form and the form in the text as accountNumbers to highlight. BlackboardAttribute attribute = artifact.getAttribute(TSK_KEYWORD); - if (attribute != null) { - this.accountNumbers.add(attribute.getValueString()); - } + this.accountNumbers.add(attribute.getValueString()); attribute = artifact.getAttribute(TSK_CARD_NUMBER); - if (attribute != null) { - this.accountNumbers.add(attribute.getValueString()); - } - + this.accountNumbers.add(attribute.getValueString()); + //if the chunk id is present just use that. Optional chunkID = Optional.ofNullable(artifact.getAttribute(TSK_KEYWORD_SEARCH_DOCUMENT_ID)) @@ -323,7 +319,7 @@ class AccountsText implements IndexedText { // extracted content (minus highlight tags) is HTML-escaped return "
" + highlightedText + "
"; //NON-NLS } catch (Exception ex) { - logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage , ex); //NON-NLS + logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage, ex); //NON-NLS return Bundle.AccountsText_getMarkup_queryFailedMsg(); } }