Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[FIXED JENKINS-14281] Restored version <3.18 serialization conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jul 5, 2012
1 parent 9df1754 commit 67a47b8
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/main/java/hudson/plugins/warnings/WarningsPublisher.java
Expand Up @@ -50,7 +50,7 @@ public class WarningsPublisher extends HealthAwarePublisher {

/** File pattern and parser configurations. @since 3.19 */
@edu.umd.cs.findbugs.annotations.SuppressWarnings("SE")
private final List<ParserConfiguration> parserConfigurations = Lists.newArrayList();
private List<ParserConfiguration> parserConfigurations = Lists.newArrayList();
/** Parser configurations of the console. @since 4.6 */
@edu.umd.cs.findbugs.annotations.SuppressWarnings("SE")
private List<ConsoleParser> consoleParsers = Lists.newArrayList();
Expand Down Expand Up @@ -176,15 +176,37 @@ protected Object readResolve() {

if (consoleParsers == null) {
consoleParsers = Lists.newArrayList();

if (consoleLogParsers == null || parserConfigurations == null) { // release 3.18 or older
consoleLogParsers = Sets.newHashSet();
parserConfigurations = Lists.newArrayList();

if (parserNames != null) {
convertToNewFormat();
}
}

if (consoleLogParsers != null) {
for (String parser : consoleLogParsers) {
consoleParsers.add(new ConsoleParser(parser));
}
}
}

return this;
}

private void convertToNewFormat() {
if (!ignoreConsole) {
consoleLogParsers.addAll(parserNames);
}
if (StringUtils.isNotBlank(pattern)) {
for (String parser : parserNames) {
parserConfigurations.add(new ParserConfiguration(pattern, parser));
}
}
}

/**
* Returns the Ant file-set pattern of files to include in report.
*
Expand Down

0 comments on commit 67a47b8

Please sign in to comment.