Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.beust.jcommander.ParameterException;

import hudson.util.VersionNumber;
import java.util.Collections;

/**
* POJO containing CLI arguments & help.
Expand Down Expand Up @@ -227,7 +228,7 @@ public String getHookPrefixes() {
}

public List<File> getExternalHooksJars() {
return externalHooksJars;
return externalHooksJars != null ? Collections.unmodifiableList(externalHooksJars) : null;
}

public String getLocalCheckoutDir() {
Expand All @@ -250,7 +251,7 @@ public String getTestJavaArgs() {

@CheckForNull
public List<PCTPlugin> getOverridenPlugins() {
return overridenPlugins;
return overridenPlugins != null ? Collections.unmodifiableList(overridenPlugins) : null;
}

@CheckForNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
package org.jenkins.tools.test.model;

import java.util.Collections;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -101,6 +102,6 @@ public void setBuildLogPath(String buildLogPath) {
}

public Set<String> getTestsDetails() {
return testDetails;
return Collections.unmodifiableSet(testDetails);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
package org.jenkins.tools.test.model;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
Expand All @@ -45,6 +46,7 @@
*
* @author Frederic Camblor
*/
@SuppressFBWarnings(value = {"EI_EXPOSE_REP", "EI_EXPOSE_REP2"}, justification = "limited callers should know not to mutate")
public class PluginCompatTesterConfig {

private static final Logger LOGGER = Logger.getLogger(PluginCompatTesterConfig.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
package org.jenkins.tools.test.model;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.CheckForNull;
Expand Down Expand Up @@ -65,6 +66,7 @@ public void setConnectionUrl(String connectionUrl) {
this.connectionUrl = connectionUrl;
}

@SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "Deliberately mutable")
public List<String> getWarningMessages() {
return warningMessages;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.AbortException;
import hudson.Functions;
import hudson.model.UpdateSite;
Expand Down Expand Up @@ -132,6 +133,7 @@ public class PluginCompatTester {
private List<String> splits;
private Set<String> splitCycles;

@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "not mutated after this point I hope")
public PluginCompatTester(PluginCompatTesterConfig config){
this.config = config;
runner = new ExternalMavenRunner(config.getExternalMaven());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
package org.jenkins.tools.test.exception;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
Expand Down Expand Up @@ -56,6 +57,7 @@ public PomExecutionException(PomExecutionException exceptionToCopy){
this(exceptionToCopy.getMessage(), exceptionToCopy.succeededPluginArtifactIds, exceptionToCopy.exceptionsThrown, exceptionToCopy.pomWarningMessages, exceptionToCopy.testDetails);
}

@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "oh well")
public PomExecutionException(String message, List<String> succeededPluginArtifactIds, List<Throwable> exceptionsThrown, List<String> pomWarningMessages, ExecutedTestNamesDetails testDetails){
super(message, exceptionsThrown.isEmpty() ? null : exceptionsThrown.iterator().next());
this.exceptionsThrown = new ArrayList<>(exceptionsThrown);
Expand All @@ -77,10 +79,12 @@ public String getErrorMessage(){
return strBldr.toString();
}

@SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "deliberately mutable")
public List<String> getPomWarningMessages() {
return pomWarningMessages;
}

@SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "oh well")
public ExecutedTestNamesDetails getTestDetails() {
return testDetails;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import hudson.model.UpdateSite.Plugin;
import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.maven.scm.ScmFileSet;
Expand Down Expand Up @@ -32,7 +33,7 @@ public ExampleMultiParent() {}
* All the plugins that are part of this repository.
*/
public List<String> transformedPlugins() {
return allBundlePlugins;
return Collections.unmodifiableList(allBundlePlugins);
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -88,6 +89,6 @@ public Map<String, Object> action(Map<String, Object> info) throws Exception {

@Override
public List<String> transformedPlugins() {
return transformedPlugins;
return Collections.unmodifiableList(transformedPlugins);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public SkipUIHelperPlugins() {}

@Override
public List<String> transformedPlugins() {
return allBundlePlugins;
return Collections.unmodifiableList(allBundlePlugins);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
package org.jenkins.tools.test.logging;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
Expand Down Expand Up @@ -52,6 +53,7 @@ public File getCurrentPSFile() {
return currentPSFile;
}

@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "as designed")
public static class SystemIOWrapper extends PrintStream {
private SystemIOLoggerFilter loggerFilter;
private PrintStream systemIO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jenkins.tools.test.model;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -29,6 +30,7 @@ public MavenBom(File path) throws IOException, XmlPullParserException {
}
}

@SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "so be it")
public Model getModel() {
return contents;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
package org.jenkins.tools.test.model;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collections;
import java.util.List;
import java.util.Set;
Expand All @@ -46,11 +47,13 @@ public TestExecutionResult(List<String> pomWarningMessages){
this(pomWarningMessages, new ExecutedTestNamesDetails());
}

@SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "oh well")
public TestExecutionResult(List<String> pomWarningMessages, ExecutedTestNamesDetails testDetails){
this.pomWarningMessages = Collections.unmodifiableList(pomWarningMessages);
this.testDetails = testDetails;
}

@SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "oh well")
public ExecutedTestNamesDetails getTestDetails() {
return testDetails;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci</groupId>
<artifactId>jenkins</artifactId>
<version>1.57</version>
<version>1.67</version>
<relativePath />
</parent>

Expand Down