quick fix for deserialization error with fileNameCache
package hudson.plugins.analysis.core;
import java.io.IOException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
@@ -55,7 +56,7 @@ public class ParserResult implements Serializable {
private final Workspace workspace;
/** A mapping of relative file names to absolute file names. */
@SuppressWarnings("Se")
- private final Multimap<String, String> fileNameCache = HashMultimap.create();
+ private transient Multimap<String, String> fileNameCache = HashMultimap.create();
/** The log messages. @since 1.20 **/
private String logMessage;
/** Total number of modules. @since 1.31 **/
@@ -457,6 +458,15 @@ public class ParserResult implements Serializable {
return StringUtils.defaultString(logMessage);
}
+ /**
+ * repopulate the transient fileNameCache
+ */
+ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
+ in.defaultReadObject();
+
+ this.fileNameCache = HashMultimap.create();
+ }
+
/**
* Facade for the remote workspace.
*/
