From a5dfc920c1be2f70bc8946ffbb5cc7bb8016b247 Mon Sep 17 00:00:00 2001 From: jbrey Date: Tue, 14 Apr 2015 13:13:12 +0200 Subject: [PATCH] Fix null pointer exception when processing report in LinkedList when used with Jasmine and PhantomJS --- .../core/instrumentation/HtmlUnitBasedScriptInstrumenter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/saga-core/src/main/java/com/github/timurstrekalov/saga/core/instrumentation/HtmlUnitBasedScriptInstrumenter.java b/saga-core/src/main/java/com/github/timurstrekalov/saga/core/instrumentation/HtmlUnitBasedScriptInstrumenter.java index d7973d0..5f5900a 100644 --- a/saga-core/src/main/java/com/github/timurstrekalov/saga/core/instrumentation/HtmlUnitBasedScriptInstrumenter.java +++ b/saga-core/src/main/java/com/github/timurstrekalov/saga/core/instrumentation/HtmlUnitBasedScriptInstrumenter.java @@ -27,6 +27,7 @@ import com.google.common.io.CharStreams; import com.google.common.io.Files; import com.google.common.io.InputSupplier; +import java.util.Collections; import net.sourceforge.htmlunit.corejs.javascript.Parser; import net.sourceforge.htmlunit.corejs.javascript.ast.AstRoot; import org.codehaus.plexus.util.FileUtils; @@ -51,7 +52,7 @@ public final class HtmlUnitBasedScriptInstrumenter implements ScriptInstrumenter private static final Set writtenToDisk = Sets.newHashSet(); private final Config config; - private final List scriptDataList = Lists.newLinkedList(); + private final List scriptDataList = Collections.synchronizedList( Lists.newLinkedList() ); private Collection ignorePatterns; private File instrumentedFileDirectory;