diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java index 8cdef4af84..2568ba2936 100755 --- a/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java @@ -67,7 +67,7 @@ public class AddBlackboardArtifactTagAction extends AddTagAction { Case.getCurrentCase().getServices().getTagsManager().addBlackboardArtifactTag(artifact, tagName, comment); } catch (TskCoreException ex) { - Logger.getLogger(AddBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); + Logger.getLogger(AddBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "AddBlackboardArtifactTagAction.unableToTag.msg", diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java index 5d7f7d16bf..aef2d79530 100755 --- a/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java @@ -113,7 +113,7 @@ public class AddContentTagAction extends AddTagAction { Case.getCurrentCase().getServices().getTagsManager().addContentTag(file, tagName, comment); } catch (TskCoreException ex) { - Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); + Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "AddContentTagAction.unableToTag.msg2", diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java index 6d5c91d074..e761e0fced 100755 --- a/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java @@ -83,7 +83,7 @@ abstract class AddTagAction extends TagAction implements Presenter.Popup { tagNames = tagsManager.getAllTagNames(); } catch (TskCoreException ex) { - Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); + Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } // Create a "Quick Tag" sub-menu. diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java index db19ad6f6f..3b5decfc4c 100755 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java @@ -61,7 +61,7 @@ public class DeleteBlackboardArtifactTagAction extends TagAction { Case.getCurrentCase().getServices().getTagsManager().deleteBlackboardArtifactTag(tag); } catch (TskCoreException ex) { - Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); + Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "DeleteBlackboardArtifactTagAction.unableToDelTag.msg", diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java index b8bd85e321..3559228e00 100755 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java @@ -61,7 +61,7 @@ public class DeleteContentTagAction extends TagAction { Case.getCurrentCase().getServices().getTagsManager().deleteContentTag(tag); } catch (TskCoreException ex) { - Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); + Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "DeleteContentTagAction.unableToDelTag.msg", diff --git a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java index 68c38b6114..21c8dfc154 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java +++ b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java @@ -94,7 +94,7 @@ public class GetTagNameAndCommentDialog extends JDialog { currentTagNames = tagsManager.getAllTagNames(); } catch (TskCoreException ex) { - Logger.getLogger(GetTagNameAndCommentDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); + Logger.getLogger(GetTagNameAndCommentDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } if (null != currentTagNames && currentTagNames.isEmpty()) { tagCombo.addItem(NO_TAG_NAMES_MESSAGE); diff --git a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java index f74ddd38e8..83813701e9 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java +++ b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java @@ -43,7 +43,7 @@ import org.sleuthkit.datamodel.TagName; import org.sleuthkit.datamodel.TskCoreException; public class GetTagNameDialog extends JDialog { - private static final String TAG_ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; + private static final String TAG_ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; //NON-NLS private final HashMap tagNames = new HashMap<>(); private TagName tagName = null; @@ -79,7 +79,7 @@ public class GetTagNameDialog extends JDialog { currentTagNames = tagsManager.getAllTagNames(); } catch (TskCoreException ex) { - Logger.getLogger(GetTagNameDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); + Logger.getLogger(GetTagNameDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } if (null != currentTagNames) { for (TagName name : currentTagNames) { @@ -299,7 +299,7 @@ public class GetTagNameDialog extends JDialog { dispose(); } catch (TskCoreException ex) { - Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); + Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); //NON-NLS JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "GetTagNameDialog.unableToAddTagNameToCase.msg", @@ -309,7 +309,7 @@ public class GetTagNameDialog extends JDialog { tagName = null; } catch (TagsManager.TagNameAlreadyExistsException ex) { - Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); + Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); //NON-NLS JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagNameAlreadyDef.msg", diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java index d90802a69b..0abeed4ee2 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java @@ -71,7 +71,7 @@ class FileExtMismatchXML { * Singleton provides default configuration from user's directory; user CAN * modify this file. */ - public static FileExtMismatchXML getDefault() { + public static synchronized FileExtMismatchXML getDefault() { if (defaultInstance == null) { final String FILTER_CONFIG_FILE = PlatformUtil.getUserConfigDirectory() + File.separator + DEFAULT_CONFIG_FILE_NAME; defaultInstance = new FileExtMismatchXML(FILTER_CONFIG_FILE); diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetectionInterface.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetectionInterface.java index d748578f91..d1514e91ef 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetectionInterface.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetectionInterface.java @@ -29,6 +29,9 @@ import org.sleuthkit.datamodel.AbstractFile; */ interface FileTypeDetectionInterface { + /** + * Instances of this data structure are not shared between threads + */ public class FileIdInfo { public String type; diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index 0ba451f716..9c328c6d82 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -18,7 +18,7 @@ */ package org.sleuthkit.autopsy.modules.filetypeid; -import java.util.concurrent.atomic.AtomicLong; +import java.util.HashMap; import java.util.logging.Level; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; @@ -47,8 +47,8 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI private static final long MIN_FILE_SIZE = 512; private final FileTypeIdModuleSettings settings; private long jobId; - private static AtomicLong matchTime = new AtomicLong(0); - private static AtomicLong numFiles = new AtomicLong(0); + + private static final HashMap totalsForIngestJobs = new HashMap<>(); private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter(); // The detector. Swap out with a different implementation of FileTypeDetectionInterface as needed. @@ -56,6 +56,27 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI // actually have a list of detectors which are called in order until a match is found. private FileTypeDetectionInterface detector = new TikaFileTypeDetector(); + private static class IngestJobTotals { + long matchTime = 0; + long numFiles = 0; + } + + private static synchronized void initTotals(long ingestJobId) { + totalsForIngestJobs.put(ingestJobId, new IngestJobTotals()); + } + + /** + * Update the match time total and increment num of files for this job + * @param ingestJobId + * @param matchTimeInc amount of time to add + */ + private static synchronized void addToTotals(long ingestJobId, long matchTimeInc) { + IngestJobTotals ingestJobTotals = totalsForIngestJobs.get(ingestJobId); + ingestJobTotals.matchTime += matchTimeInc; + ingestJobTotals.numFiles++; + totalsForIngestJobs.put(ingestJobId, ingestJobTotals); + } + FileTypeIdIngestModule(FileTypeIdModuleSettings settings) { this.settings = settings; } @@ -63,7 +84,9 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI @Override public void startUp(IngestJobContext context) throws IngestModuleException { jobId = context.getJobId(); - refCounter.incrementAndGet(jobId); + if (refCounter.incrementAndGet(jobId) == 1) { + initTotals(jobId); + } } @Override @@ -86,8 +109,7 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI try { long startTime = System.currentTimeMillis(); FileTypeDetectionInterface.FileIdInfo fileId = detector.attemptMatch(abstractFile); - matchTime.getAndAdd(System.currentTimeMillis() - startTime); - numFiles.getAndIncrement(); + addToTotals(jobId, (System.currentTimeMillis() - startTime)); //add match time if (!fileId.type.isEmpty()) { // add artifact @@ -111,15 +133,17 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI public void shutDown(boolean ingestJobCancelled) { // We only need to post the summary msg from the last module per job if (refCounter.decrementAndGet(jobId) == 0) { + IngestJobTotals jobTotals = totalsForIngestJobs.remove(jobId); + StringBuilder detailsSb = new StringBuilder(); detailsSb.append(""); detailsSb.append(""); detailsSb.append("\n"); + .append("\n"); detailsSb.append("\n"); + .append("\n"); detailsSb.append("
").append(FileTypeIdModuleFactory.getModuleName()).append("
") .append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalProcTime")) - .append("").append(matchTime.get()).append("
").append(jobTotals.matchTime).append("
") .append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalFiles")) - .append("").append(numFiles.get()).append("
").append(jobTotals.numFiles).append("
"); IngestServices.getInstance().postMessage(IngestMessage.createMessage(IngestMessage.MessageType.INFO, FileTypeIdModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleSettings.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleSettings.java index 3dbb50c8a9..26caff787d 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleSettings.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleSettings.java @@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; */ public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings { - private boolean skipKnownFiles = true; + private volatile boolean skipKnownFiles = true; FileTypeIdModuleSettings() { } diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/TikaFileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/TikaFileTypeDetector.java index 06794331c7..e51ad24bc2 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/TikaFileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/TikaFileTypeDetector.java @@ -27,7 +27,7 @@ import org.sleuthkit.datamodel.AbstractFile; class TikaFileTypeDetector implements FileTypeDetectionInterface { - private static Tika tikaInst = new Tika(); + private static Tika tikaInst = new Tika(); //calling detect() with this should be thread-safe @Override public FileTypeDetectionInterface.FileIdInfo attemptMatch(AbstractFile abstractFile) { diff --git a/Core/src/org/sleuthkit/autopsy/modules/sevenzip/SevenZipIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/sevenzip/SevenZipIngestModule.java index 768e995a6c..a77b853903 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/sevenzip/SevenZipIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/sevenzip/SevenZipIngestModule.java @@ -187,7 +187,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F @Override public void shutDown(boolean ingestJobCancelled) { - // We don't need the value, but for cleanliness and consistency, -- it + // We don't need the value, but for cleanliness and consistency refCounter.decrementAndGet(jobId); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSearchPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSearchPanel.java index eb8a7799a7..96f48ad393 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSearchPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSearchPanel.java @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.keywordsearch; -import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java index eff9a8f500..d2010818c3 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java @@ -45,7 +45,6 @@ import javax.swing.text.html.HTMLEditorKit.HTMLFactory; import javax.swing.text.html.StyleSheet; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; -import org.openide.util.Exceptions; import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.TextUtil; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedMatchesSource.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedMatchesSource.java index a94d2865ad..79bc54fe73 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedMatchesSource.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedMatchesSource.java @@ -31,7 +31,6 @@ import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrRequest.METHOD; -import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.response.QueryResponse; import org.sleuthkit.autopsy.coreutils.Version; import org.sleuthkit.autopsy.datamodel.HighlightLookup; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java index dc9a2b6ba3..86ec8f4619 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java @@ -22,9 +22,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.IOException; -import java.net.SocketException; import java.util.logging.FileHandler; -import java.util.logging.Level; import java.util.logging.Logger; import java.util.logging.SimpleFormatter; import org.openide.util.Exceptions; @@ -44,7 +42,7 @@ public class KeywordSearch { private static Server server; //we want a custom java.util.logging.Logger here for a reason //a separate logger from framework logs - static final Logger TIKA_LOGGER = Logger.getLogger("Tika"); + private static final Logger TIKA_LOGGER = Logger.getLogger("Tika"); private static final Logger logger = Logger.getLogger(Case.class.getName()); public enum QueryType { LITERAL, REGEX @@ -100,7 +98,7 @@ public class KeywordSearch { changeSupport.removePropertyChangeListener(l); } - static void fireNumIndexedFilesChange(Integer oldNum, Integer newNum) { + public static void fireNumIndexedFilesChange(Integer oldNum, Integer newNum) { try { changeSupport.firePropertyChange(NUM_FILES_CHANGE_EVT, oldNum, newNum); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java index 4ce36d9f94..d20d7c4c96 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java @@ -19,6 +19,8 @@ package org.sleuthkit.autopsy.keywordsearch; import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; import org.openide.util.NbBundle; import org.openide.util.lookup.ServiceProvider; @@ -37,6 +39,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel; @ServiceProvider(service = IngestModuleFactory.class) public class KeywordSearchModuleFactory extends IngestModuleFactoryAdapter { + private static final HashSet defaultDisabledKeywordListNames = new HashSet<>(Arrays.asList("Phone Numbers", "IP Addresses", "URLs")); private KeywordSearchJobSettingsPanel jobSettingsPanel = null; @Override @@ -64,8 +67,9 @@ public class KeywordSearchModuleFactory extends IngestModuleFactoryAdapter { List enabledKeywordLists = new ArrayList<>(); List keywordLists = listManager.getListsL(); for (KeywordList keywordList : keywordLists) { - // All available keyword search lists are enabled by default. - enabledKeywordLists.add(keywordList.getName()); + if (!defaultDisabledKeywordListNames.contains(keywordList.getName())) { + enabledKeywordLists.add(keywordList.getName()); + } } return new KeywordSearchJobSettings(enabledKeywordLists); } diff --git a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java index af8de00f89..d85946a954 100644 --- a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java +++ b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java @@ -115,7 +115,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges @Override public ProcessResult process(AbstractFile abstractFile) { - ScalpelCarver.init(); // RJCTODO: Is this ScalpelCarver class thread-safe? + ScalpelCarver.init(); if (!initialized) { return ProcessResult.OK; diff --git a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/jni/ScalpelCarver.java b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/jni/ScalpelCarver.java index 70ea7cd029..693681523c 100644 --- a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/jni/ScalpelCarver.java +++ b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/jni/ScalpelCarver.java @@ -39,7 +39,7 @@ public class ScalpelCarver { private static final String SCALPEL_JNI_LIB = "libscalpel_jni"; private static final String SCALPEL_OUTPUT_FILE_NAME = "audit.txt"; - private static boolean initialized = false; + private static volatile boolean initialized = false; private static final Logger logger = Logger.getLogger(ScalpelCarver.class.getName()); private static native void carveNat(String carverInputId, ReadContentInputStream input, String configFilePath, String outputFolderPath) throws ScalpelException; @@ -48,7 +48,7 @@ public class ScalpelCarver { } - public static boolean init() { + public static synchronized boolean init() { if (initialized) { return true; } diff --git a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java index 2333ab949c..08aff9c620 100755 --- a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java +++ b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java @@ -252,11 +252,13 @@ public class RegressionTest extends TestCase { if (Boolean.parseBoolean(System.getProperty("ignore_unalloc"))) { jbco0.doClick(); } + new Timeout("pausing", 10000).sleep(); // let things catch up wo.btNext().clickMouse(); } public void testIngest() { logger.info("Ingest 3"); + new Timeout("pausing", 10000).sleep(); // wait for ingest to actually start long startIngest = System.currentTimeMillis(); IngestManager man = IngestManager.getInstance(); while (man.isIngestRunning()) {