diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 2598142fdb15..095dd5abc415 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,3 +1,4 @@
+---
version: 2
updates:
- package-ecosystem: "github-actions"
@@ -9,36 +10,56 @@ updates:
schedule:
interval: "daily"
ignore:
- # see https://github.com/jenkinsci/jenkins/pull/5112#issuecomment-744429487 and https://github.com/jenkinsci/jenkins/pull/5116#issuecomment-744526638
- # it would be good to update it at some point, but requires significant testing
+ # Exclusions in this section have been triaged and determined to be
+ # permanent. We do not anticipate removing exclusions from this section.
+
+ # Provided by Jetty and should be aligned with the version provided by the
+ # version of Jetty we deliver. See:
+ # https://github.com/jenkinsci/jenkins/pull/5211
+ - dependency-name: "javax.servlet:javax.servlet-api"
+
+ # Jetty Maven Plugin and Winstone should be upgraded in lockstep in order
+ # to keep their corresponding Jetty versions aligned.
+ - dependency-name: "org.eclipse.jetty:jetty-maven-plugin"
+ - dependency-name: "org.jenkins-ci:winstone"
+
+ # Log4j 1.2.17 is the final 1.x release.
+ - dependency-name: "log4j:log4j"
+
+
+ # Here lies technical debt. Exclusions in this section have been triaged
+ # and determined to be temporary. Exclusions should be removed from this
+ # section once the remaining action items have been completed.
+
+ # Fails test automation; needs further investigation.
+ - dependency-name: "com.google.inject:guice-bom"
+
+ # Requires Java 11 starting with version 10.0.
+ - dependency-name: "com.puppycrawl.tools:checkstyle"
+ versions: [">=10.0"]
+
+ # Contains incompatible API changes and needs compatibility work.
+ - dependency-name: "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api"
+
+ # This is a banned dependency, and we have a redundant trick in our POM to
+ # prevent it from being pulled in. If and when the reference is removed in
+ # our POM, this exclusion can also be removed.
+ - dependency-name: "javax.servlet:servlet-api"
+
+ # Needs significant testing. See:
+ # https://github.com/jenkinsci/jenkins/pull/5112#issuecomment-744429487
+ # https://github.com/jenkinsci/jenkins/pull/5116#issuecomment-744526638
- dependency-name: "org.codehaus.groovy:groovy-all"
versions: [">=2.5.0"]
- # see https://github.com/jenkinsci/jenkins/pull/5184 should be updated with groovy-all
+
+ # Consumed by Groovy and should be updated in lockstep with Groovy. See:
+ # https://github.com/jenkinsci/jenkins/pull/5184
- dependency-name: "org.fusesource.jansi:jansi"
- # see https://github.com/jenkinsci/jenkins/pull/5144#pullrequestreview-559661934
- # will require source code changes to replace javax.mail with jakarta.mail
- # and some handling for plugins that depend on javax.mail being provided by Jenkins core.
- - dependency-name: "com.sun.mail:jakarta.mail"
- # this is a banned dependency, we have a hack in our pom to prevent anyone else pulling it in
- - dependency-name: "javax.servlet.servlet-api"
- # needs a jakarta upgrade project, imports changed
- - dependency-name: "jakarta.servlet.jsp.jstl.jakarta.servlet.jsp.jstl-api"
- # Starting with version 2.0.2, this library requires Java 11
+
+ # Requires Java 11 starting with version 2.0.2.
- dependency-name: "org.glassfish.tyrus.bundles:tyrus-standalone-client-jdk"
versions: [">=2.0.2"]
- # see https://github.com/jenkinsci/jenkins/pull/4224 can't be updated without breaking api
+
+ # Contains incompatible API changes and needs compatibility work. See:
+ # https://github.com/jenkinsci/jenkins/pull/4224
- dependency-name: "org.jfree:jfreechart"
- # the dependency is actually provided by the Web container, hence it is aligned with Jetty. See https://github.com/jenkinsci/jenkins/pull/5211
- - dependency-name: "javax.servlet:javax.servlet-api"
- # log4j 1.2.17 is the final 1.x release
- - dependency-name: "log4j:log4j"
- # using a newer version clashes in RequireUpperBoundDeps with plugins using a valid script-security dependency
- - dependency-name: "org.jenkins-ci:symbol-annotation"
- # Must remain within jetty 9.x until Java 8 support is removed, ignore jetty 10.x and jetty 11.x updates
- - dependency-name: "org.eclipse.jetty:jetty-maven-plugin"
- versions: [">=10.0.0"]
- # Winstone upgrades require multiple changes in pom.xml. See https://github.com/jenkinsci/jenkins/pull/5439#discussion_r616418468
- - dependency-name: "org.jenkins-ci:winstone"
- # Starting with version 10.0, this library requires Java 11
- - dependency-name: "com.puppycrawl.tools:checkstyle"
- versions: [">=10.0"]
diff --git a/Jenkinsfile b/Jenkinsfile
index a769a0d2cb34..8016e9d91363 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -5,14 +5,7 @@
* It makes assumptions about plugins being installed, labels mapping to nodes that can build what is needed, etc.
*/
-def buildNumber = BUILD_NUMBER as int; if (buildNumber > 1) milestone(buildNumber - 1); milestone(buildNumber) // JENKINS-43353 / JENKINS-58625
-
def failFast = false
-// Same memory sizing for both builds and ATH
-def javaOpts = [
- 'JAVA_OPTS=-Xmx1536m -Xms512m',
- 'MAVEN_OPTS=-Xmx1536m -Xms512m',
-]
properties([
buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3')),
@@ -43,7 +36,7 @@ for (i = 0; i < buildTypes.size(); i++) {
// First stage is actually checking out the source. Since we're using Multibranch
// currently, we can use "checkout scm".
stage('Checkout') {
- checkout scm
+ infra.checkoutSCM()
}
def changelistF = "${pwd tmp: true}/changelist"
@@ -68,7 +61,7 @@ for (i = 0; i < buildTypes.size(); i++) {
'clean',
'install',
]
- infra.runMaven(mavenOptions, jdk.toString(), javaOpts, null, true)
+ infra.runMaven(mavenOptions, jdk)
if (isUnix()) {
sh 'git add . && git diff --exit-code HEAD'
}
@@ -127,7 +120,7 @@ for (i = 0; i < buildTypes.size(); i++) {
dir(m2repo) {
archiveArtifacts(
artifacts: "**/*$changelist/*$changelist*",
- excludes: '**/*.lastUpdated,**/jenkins-test*/',
+ excludes: '**/*.lastUpdated,**/jenkins-coverage*/,**/jenkins-test*/',
allowEmptyArchive: true, // in case we forgot to reincrementalify
fingerprint: true
)
@@ -155,7 +148,7 @@ builds.ath = {
'war',
'package',
]
- infra.runMaven(mavenOptions, '11', javaOpts, null, true)
+ infra.runMaven(mavenOptions, 11)
dir('war/target') {
fileUri = 'file://' + pwd() + '/jenkins.war'
}
diff --git a/README.md b/README.md
index ecf83732aa6f..9c48c427cc2b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,9 @@
-[![][ButlerImage]][website]
+
+
+
+
+
+
# About
@@ -68,9 +73,6 @@ See [adopters](https://www.jenkins.io/project/adopters/) for the list of Jenkins
# License
Jenkins is **licensed** under the **[MIT License]**.
-
-[ButlerImage]: https://www.jenkins.io/sites/default/files/jenkins_logo.png
[MIT License]: https://github.com/jenkinsci/jenkins/blob/master/LICENSE.txt
-[Mirrors]: http://mirrors.jenkins-ci.org
[GitHub]: https://github.com/jenkinsci/jenkins
[website]: https://www.jenkins.io/
diff --git a/bom/pom.xml b/bom/pom.xml
index cf75ee27e20e..a2929a173b77 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -40,7 +40,7 @@ THE SOFTWARE.
9.31.7.36
- 1669.v95a_4b_919a_b_a_2
+ 1685.v3b_5035c4ce052.4.21
@@ -56,7 +56,7 @@ THE SOFTWARE.
org.springframeworkspring-framework-bom
- 5.3.19
+ 5.3.20pomimport
@@ -64,7 +64,7 @@ THE SOFTWARE.
org.springframework.securityspring-security-bom
- 5.6.3
+ 5.7.1pomimport
@@ -239,7 +239,7 @@ THE SOFTWARE.
org.jenkins-cisymbol-annotation
- 1.1
+ 1.23org.jenkins-ci
@@ -261,31 +261,6 @@ THE SOFTWARE.
instance-identity2.2
-
- org.jenkins-ci.modules
- launchd-slave-installer
- 1.2
-
-
- org.jenkins-ci.modules
- slave-installer
- 1.7
-
-
- org.jenkins-ci.modules
- systemd-slave-installer
- 1.1
-
-
- org.jenkins-ci.modules
- upstart-slave-installer
- 1.1
-
-
- org.jenkins-ci.modules
- windows-slave-installer
- 2.0
- org.jfreejfreechart
diff --git a/core/pom.xml b/core/pom.xml
index bf1b35b11045..27554bf94680 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -832,7 +832,7 @@ THE SOFTWARE.
maven-surefire-plugin
- @{jacocoSurefireArgs} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
+ @{jacocoSurefireArgs} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.desktop/com.sun.beans.introspect=ALL-UNNAMED
diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java
index 356e6e8e9065..13976387db19 100644
--- a/core/src/main/java/hudson/ClassicPluginStrategy.java
+++ b/core/src/main/java/hudson/ClassicPluginStrategy.java
@@ -717,5 +717,5 @@ protected URL findResource(String name) {
}
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
- public static /* not final */ boolean useAntClassLoader = SystemProperties.getBoolean(ClassicPluginStrategy.class.getName() + ".useAntClassLoader", true);
+ public static /* not final */ boolean useAntClassLoader = SystemProperties.getBoolean(ClassicPluginStrategy.class.getName() + ".useAntClassLoader");
}
diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java
index 0d523fdb2227..a67bf746c3b8 100644
--- a/core/src/main/java/hudson/Functions.java
+++ b/core/src/main/java/hudson/Functions.java
@@ -73,6 +73,7 @@
import hudson.security.csrf.CrumbIssuer;
import hudson.slaves.Cloud;
import hudson.slaves.ComputerLauncher;
+import hudson.slaves.JNLPLauncher;
import hudson.slaves.NodeProperty;
import hudson.slaves.NodePropertyDescriptor;
import hudson.slaves.RetentionStrategy;
@@ -134,6 +135,7 @@
import java.util.SortedMap;
import java.util.TimeZone;
import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Predicate;
import java.util.logging.Level;
@@ -698,6 +700,13 @@ public static String getUserTimeZonePostfix() {
return tz.getDisplayName(tz.observesDaylightTime(), TimeZone.SHORT);
}
+ @Restricted(NoExternalUse.class)
+ public static long getHourLocalTimezone() {
+ // Work around JENKINS-68215. When JENKINS-68215 is resolved, this logic can be moved back to Jelly.
+ TimeZone tz = TimeZone.getDefault();
+ return TimeUnit.MILLISECONDS.toHours(tz.getRawOffset() + tz.getDSTSavings());
+ }
+
/**
* Finds the given object in the ancestor list and returns its URL.
* This is used to determine the "current" URL assigned to the given object,
@@ -1866,9 +1875,12 @@ public static String toEmailSafeString(String projectName) {
/**
* Obtains the host name of the Hudson server that clients can use to talk back to.
*
- * This is primarily used in {@code jenkins-agent.jnlp.jelly} to specify the destination
+ * This was primarily used in {@code jenkins-agent.jnlp.jelly} to specify the destination
* that the agents talk to.
+ *
+ * @deprecated use {@link JNLPLauncher#getInboundAgentUrl}
*/
+ @Deprecated
public String getServerName() {
// Try to infer this from the configured root URL.
// This makes it work correctly when Hudson runs behind a reverse proxy.
@@ -2289,12 +2301,17 @@ public static Icon tryGetIcon(String iconGuess) {
return null;
}
- StaplerRequest currentRequest = Stapler.getCurrentRequest();
- currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse());
Icon iconMetadata = IconSet.icons.getIconByClassSpec(iconGuess);
+ // `iconGuess` must be class names if it contains a whitespace.
+ // It may contains extra css classes unrelated to icons.
+ // Filter classes with `icon-` prefix.
+ if (iconMetadata == null && iconGuess.contains(" ")) {
+ iconMetadata = IconSet.icons.getIconByClassSpec(filterIconNameClasses(iconGuess));
+ }
+
if (iconMetadata == null) {
- // Icon could be provided as a simple iconFileName e.g. "settings.png"
+ // Icon could be provided as a simple iconFileName e.g. "help.svg"
iconMetadata = IconSet.icons.getIconByClassSpec(IconSet.toNormalizedIconNameClass(iconGuess) + " icon-md");
}
@@ -2306,6 +2323,12 @@ public static Icon tryGetIcon(String iconGuess) {
return iconMetadata;
}
+ private static @NonNull String filterIconNameClasses(@NonNull String classNames) {
+ return Arrays.stream(StringUtils.split(classNames, ' '))
+ .filter(className -> className.startsWith("icon-"))
+ .collect(Collectors.joining(" "));
+ }
+
@Restricted(NoExternalUse.class)
public static String extractPluginNameFromIconSrc(String iconSrc) {
if (iconSrc == null) {
diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java
index e4575086d9fb..c3cd3a750e6d 100644
--- a/core/src/main/java/hudson/PluginManager.java
+++ b/core/src/main/java/hudson/PluginManager.java
@@ -1412,16 +1412,6 @@ public HttpResponse doPluginsSearch(@QueryParameter String query, @QueryParamete
if (plugin.isForNewerHudson()) {
jsonObject.put("newerCoreRequired", Messages.PluginManager_coreWarning(plugin.requiredCore));
}
- if (plugin.isForNewerJava()) {
- jsonObject.put("newerJavaRequired", Messages.PluginManager_javaWarning(plugin.minimumJavaVersion));
- }
- if (plugin.isNeededDependenciesForNewerJava()) {
- VersionNumber javaVersion = plugin.getNeededDependenciesMinimumJavaVersion();
- if (javaVersion == null) {
- throw new IllegalStateException("java version cannot be null here");
- }
- jsonObject.put("dependenciesNewerJava", Messages.PluginManager_depJavaWarning(javaVersion.toString()));
- }
if (plugin.hasWarnings()) {
JSONObject unresolvedSecurityWarnings = new JSONObject();
unresolvedSecurityWarnings.put("text", Messages.PluginManager_securityWarning());
@@ -2057,9 +2047,6 @@ private void logPluginWarnings(Map.Entry requestedPlugin,
if (toInstall.isForNewerHudson()) {
LOGGER.log(WARNING, "{0}@{1} was built for a newer Jenkins", new Object[] {toInstall.name, toInstall.version});
}
- if (toInstall.isForNewerJava()) {
- LOGGER.log(WARNING, "{0}@{1} was built for a newer Java", new Object[] {toInstall.name, toInstall.version});
- }
}
/**
diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java
index a42596726cdb..aa408cf9c752 100644
--- a/core/src/main/java/hudson/PluginWrapper.java
+++ b/core/src/main/java/hudson/PluginWrapper.java
@@ -43,7 +43,6 @@
import hudson.model.UpdateCenter;
import hudson.model.UpdateSite;
import hudson.util.VersionNumber;
-import io.jenkins.lib.versionnumber.JavaSpecificationVersion;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
@@ -75,7 +74,6 @@
import jenkins.security.UpdateSiteWarningsMonitor;
import jenkins.util.AntClassLoader;
import jenkins.util.URLClassLoader2;
-import jenkins.util.java.JavaUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.LogFactory;
import org.kohsuke.accmod.Restricted;
@@ -690,20 +688,6 @@ private String getVersionOf(Manifest manifest) {
return null;
}
- /**
- * Returns the minimum Java version of this plugin, as specified in the plugin metadata.
- * Generally coming from the {@code java.level} extracted as MANIFEST's metadata with
- * this addition on the plugins' parent pom.
- *
- * @see maven-hpi-plugin#PR-75
- *
- * @since 2.158
- */
- @Exported
- public @CheckForNull String getMinimumJavaVersion() {
- return manifest.getMainAttributes().getValue("Minimum-Java-Version");
- }
-
/**
* Returns the version number of this plugin
*/
@@ -958,14 +942,6 @@ public boolean hasLicensesXml() {
versionDependencyError(Messages.PluginWrapper_obsoleteCore(Jenkins.getVersion().toString(), requiredCoreVersion), Jenkins.getVersion().toString(), requiredCoreVersion);
}
}
-
- String minimumJavaVersion = getMinimumJavaVersion();
- if (minimumJavaVersion != null) {
- JavaSpecificationVersion actualVersion = JavaUtils.getCurrentJavaRuntimeVersionNumber();
- if (actualVersion.isOlderThan(new JavaSpecificationVersion(minimumJavaVersion))) {
- versionDependencyError(Messages.PluginWrapper_obsoleteJava(actualVersion.toString(), minimumJavaVersion), actualVersion.toString(), minimumJavaVersion);
- }
- }
}
// make sure dependencies exist
for (Dependency d : dependencies) {
diff --git a/core/src/main/java/hudson/ProxyConfiguration.java b/core/src/main/java/hudson/ProxyConfiguration.java
index c087c00ceb8c..fa55888a1df2 100644
--- a/core/src/main/java/hudson/ProxyConfiguration.java
+++ b/core/src/main/java/hudson/ProxyConfiguration.java
@@ -26,6 +26,7 @@
import com.thoughtworks.xstream.XStream;
import edu.umd.cs.findbugs.annotations.CheckForNull;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.model.Saveable;
@@ -400,6 +401,7 @@ private static void decorate(URLConnection con) throws IOException {
@Extension @Symbol("proxy")
public static class DescriptorImpl extends Descriptor {
+ @NonNull
@Override
public String getDisplayName() {
return "Proxy Configuration";
diff --git a/core/src/main/java/hudson/cli/CLIAction.java b/core/src/main/java/hudson/cli/CLIAction.java
index d42e974452a2..31d4700e4cb1 100644
--- a/core/src/main/java/hudson/cli/CLIAction.java
+++ b/core/src/main/java/hudson/cli/CLIAction.java
@@ -136,7 +136,7 @@ public void close() throws IOException {
}
}
- private void doClose() {
+ private void doClose() throws IOException {
close();
}
diff --git a/core/src/main/java/hudson/console/ConsoleAnnotationDescriptor.java b/core/src/main/java/hudson/console/ConsoleAnnotationDescriptor.java
index e13d65ea4627..bb68ccc66194 100644
--- a/core/src/main/java/hudson/console/ConsoleAnnotationDescriptor.java
+++ b/core/src/main/java/hudson/console/ConsoleAnnotationDescriptor.java
@@ -24,6 +24,7 @@
package hudson.console;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.DescriptorExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Descriptor;
@@ -55,6 +56,7 @@ protected ConsoleAnnotationDescriptor() {
*
* Users use this name to enable/disable annotations.
*/
+ @NonNull
@Override
public String getDisplayName() {
return super.getDisplayName();
diff --git a/core/src/main/java/hudson/console/ExpandableDetailsNote.java b/core/src/main/java/hudson/console/ExpandableDetailsNote.java
index 57ed88e06e22..6dcc949199b1 100644
--- a/core/src/main/java/hudson/console/ExpandableDetailsNote.java
+++ b/core/src/main/java/hudson/console/ExpandableDetailsNote.java
@@ -24,6 +24,7 @@
package hudson.console;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.MarkupText;
import java.io.IOException;
@@ -67,6 +68,7 @@ public static String encodeTo(String buttonCaption, String html) {
@Extension
public static final class DescriptorImpl extends ConsoleAnnotationDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return "Expandable details";
diff --git a/core/src/main/java/hudson/console/HyperlinkNote.java b/core/src/main/java/hudson/console/HyperlinkNote.java
index f8e7e6520838..93e2ff40f493 100644
--- a/core/src/main/java/hudson/console/HyperlinkNote.java
+++ b/core/src/main/java/hudson/console/HyperlinkNote.java
@@ -24,6 +24,7 @@
package hudson.console;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.MarkupText;
import hudson.Util;
@@ -102,6 +103,7 @@ static String encodeTo(String url, String text, BiFunction {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.JDK_DisplayName();
diff --git a/core/src/main/java/hudson/model/ListView.java b/core/src/main/java/hudson/model/ListView.java
index 14de68474e22..9f47962b92bd 100644
--- a/core/src/main/java/hudson/model/ListView.java
+++ b/core/src/main/java/hudson/model/ListView.java
@@ -26,6 +26,7 @@
package hudson.model;
import edu.umd.cs.findbugs.annotations.CheckForNull;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.Util;
import hudson.diagnosis.OldDataMonitor;
@@ -499,6 +500,7 @@ public void setStatusFilter(Boolean statusFilter) {
@Extension @Symbol("list")
public static class DescriptorImpl extends ViewDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ListView_DisplayName();
diff --git a/core/src/main/java/hudson/model/MyView.java b/core/src/main/java/hudson/model/MyView.java
index f4338aa959fb..bc98d9a55f7f 100644
--- a/core/src/main/java/hudson/model/MyView.java
+++ b/core/src/main/java/hudson/model/MyView.java
@@ -24,6 +24,7 @@
package hudson.model;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Descriptor.FormException;
import java.io.IOException;
@@ -99,6 +100,7 @@ public boolean isInstantiable() {
return Jenkins.get().isUseSecurity();
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.MyView_DisplayName();
diff --git a/core/src/main/java/hudson/model/MyViewsProperty.java b/core/src/main/java/hudson/model/MyViewsProperty.java
index a09906056d86..10a16f935f11 100644
--- a/core/src/main/java/hudson/model/MyViewsProperty.java
+++ b/core/src/main/java/hudson/model/MyViewsProperty.java
@@ -25,6 +25,7 @@
package hudson.model;
import edu.umd.cs.findbugs.annotations.CheckForNull;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.Util;
import hudson.model.Descriptor.FormException;
@@ -235,6 +236,7 @@ public String getUrlName() {
@Extension @Symbol("myView")
public static class DescriptorImpl extends UserPropertyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.MyViewsProperty_DisplayName();
diff --git a/core/src/main/java/hudson/model/ParametersAction.java b/core/src/main/java/hudson/model/ParametersAction.java
index f94e7aacdadb..662946d23213 100644
--- a/core/src/main/java/hudson/model/ParametersAction.java
+++ b/core/src/main/java/hudson/model/ParametersAction.java
@@ -335,10 +335,11 @@ private List extends ParameterValue> filter(List parameters) {
if (this.parameterDefinitionNames.contains(v.getName()) || isSafeParameter(v.getName())) {
filteredParameters.add(v);
} else if (shouldKeepFlag == null) {
- LOGGER.log(Level.WARNING, "Skipped parameter `{0}` as it is undefined on `{1}`. Set `-D{2}=true` to allow "
- + "undefined parameters to be injected as environment variables or `-D{3}=[comma-separated list]` to whitelist specific parameter names, "
- + "even though it represents a security breach or `-D{2}=false` to no longer show this message.",
- new Object [] { v.getName(), run.getParent().getFullName(), KEEP_UNDEFINED_PARAMETERS_SYSTEM_PROPERTY_NAME, SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME });
+ LOGGER.log(Level.WARNING, "Skipped parameter `{0}` as it is undefined on `{1}` (#{2}). Set `-D{3}=true` to allow "
+ + "undefined parameters to be injected as environment variables or `-D{4}=[comma-separated list]` to whitelist specific parameter names, "
+ + "even though it represents a security breach or `-D{3}=false` to no longer show this message.",
+ new Object [] { v.getName(), run.getParent().getFullName(), run.getNumber(),
+ KEEP_UNDEFINED_PARAMETERS_SYSTEM_PROPERTY_NAME, SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME });
}
}
diff --git a/core/src/main/java/hudson/model/PasswordParameterDefinition.java b/core/src/main/java/hudson/model/PasswordParameterDefinition.java
index 58846ac4a2b5..8074740088f0 100644
--- a/core/src/main/java/hudson/model/PasswordParameterDefinition.java
+++ b/core/src/main/java/hudson/model/PasswordParameterDefinition.java
@@ -138,6 +138,7 @@ public boolean equals(Object obj) {
@Extension @Symbol("password")
public static final class ParameterDescriptorImpl extends ParameterDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.PasswordParameterDefinition_DisplayName();
diff --git a/core/src/main/java/hudson/model/ProxyView.java b/core/src/main/java/hudson/model/ProxyView.java
index 3f33302744dc..b3d19282752c 100644
--- a/core/src/main/java/hudson/model/ProxyView.java
+++ b/core/src/main/java/hudson/model/ProxyView.java
@@ -24,6 +24,7 @@
package hudson.model;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.Util;
import hudson.model.Descriptor.FormException;
@@ -129,6 +130,7 @@ public FormValidation doViewExistsCheck(@QueryParameter String value) {
@Extension @Symbol("proxy")
public static class DescriptorImpl extends ViewDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ProxyView_DisplayName();
diff --git a/core/src/main/java/hudson/model/RunParameterDefinition.java b/core/src/main/java/hudson/model/RunParameterDefinition.java
index 3ac138a8761c..9aec159686b9 100644
--- a/core/src/main/java/hudson/model/RunParameterDefinition.java
+++ b/core/src/main/java/hudson/model/RunParameterDefinition.java
@@ -143,6 +143,7 @@ public RunList getBuilds() {
@Extension @Symbol({"run", "runParam"})
public static class DescriptorImpl extends ParameterDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.RunParameterDefinition_DisplayName();
diff --git a/core/src/main/java/hudson/model/TextParameterDefinition.java b/core/src/main/java/hudson/model/TextParameterDefinition.java
index 4db836a7b7e5..a22b1903e59b 100644
--- a/core/src/main/java/hudson/model/TextParameterDefinition.java
+++ b/core/src/main/java/hudson/model/TextParameterDefinition.java
@@ -55,6 +55,7 @@ public TextParameterDefinition(@NonNull String name, @CheckForNull String defaul
@Extension @Symbol({"text", "textParam"})
public static class DescriptorImpl extends ParameterDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.TextParameterDefinition_DisplayName();
diff --git a/core/src/main/java/hudson/model/UpdateSite.java b/core/src/main/java/hudson/model/UpdateSite.java
index 985aef2020e1..389e3cb3890f 100644
--- a/core/src/main/java/hudson/model/UpdateSite.java
+++ b/core/src/main/java/hudson/model/UpdateSite.java
@@ -44,7 +44,6 @@
import hudson.util.HttpResponses;
import hudson.util.TextFile;
import hudson.util.VersionNumber;
-import io.jenkins.lib.versionnumber.JavaSpecificationVersion;
import java.io.File;
import java.io.IOException;
import java.net.URI;
@@ -80,7 +79,6 @@
import jenkins.util.JSONSignatureValidator;
import jenkins.util.PluginLabelUtil;
import jenkins.util.SystemProperties;
-import jenkins.util.java.JavaUtils;
import net.sf.json.JSONArray;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
@@ -1141,13 +1139,6 @@ public final class Plugin extends Entry {
*/
@Exported
public final String requiredCore;
- /**
- * Version of Java this plugin requires to run.
- *
- * @since 2.158
- */
- @Exported
- public final String minimumJavaVersion;
/**
* Categories for grouping plugins, taken from labels assigned to wiki page.
* Can be {@code null} if the update center does not return categories.
@@ -1211,7 +1202,6 @@ public Plugin(String sourceId, JSONObject o) {
this.title = get(o, "title");
this.excerpt = get(o, "excerpt");
this.compatibleSinceVersion = Util.intern(get(o, "compatibleSinceVersion"));
- this.minimumJavaVersion = Util.intern(get(o, "minimumJavaVersion"));
this.latest = get(o, "latest");
this.requiredCore = Util.intern(get(o, "requiredCore"));
final String releaseTimestamp = get(o, "releaseTimestamp");
@@ -1301,9 +1291,9 @@ public boolean isCompatible() {
@Restricted(NoExternalUse.class) // table.jelly
public boolean isCompatible(PluginManager.MetadataCache cache) {
- return isCompatibleWithInstalledVersion() && !isForNewerHudson() && !isForNewerJava() &&
+ return isCompatibleWithInstalledVersion() && !isForNewerHudson() &&
isNeededDependenciesCompatibleWithInstalledVersion(cache) &&
- !isNeededDependenciesForNewerJenkins(cache) && !isNeededDependenciesForNewerJava();
+ !isNeededDependenciesForNewerJenkins(cache);
}
/**
@@ -1387,21 +1377,6 @@ public boolean isForNewerHudson() {
}
}
- /**
- * Returns true iff the plugin declares a minimum Java version and it's newer than what the Jenkins master is running on.
- * @since 2.158
- */
- public boolean isForNewerJava() {
- try {
- final JavaSpecificationVersion currentRuntimeJavaVersion = JavaUtils.getCurrentJavaRuntimeVersionNumber();
- return minimumJavaVersion != null && new JavaSpecificationVersion(minimumJavaVersion).isNewerThan(
- currentRuntimeJavaVersion);
- } catch (NumberFormatException nfe) {
- logBadMinJavaVersion();
- return false; // treat this as undeclared minimum Java version
- }
- }
-
public VersionNumber getNeededDependenciesRequiredCore() {
VersionNumber versionNumber = null;
try {
@@ -1416,36 +1391,6 @@ public VersionNumber getNeededDependenciesRequiredCore() {
return versionNumber;
}
- /**
- * Returns the minimum Java version needed to use the plugin and all its dependencies.
- * @since 2.158
- * @return the minimum Java version needed to use the plugin and all its dependencies, or null if unspecified.
- */
- @CheckForNull
- public VersionNumber getNeededDependenciesMinimumJavaVersion() {
- VersionNumber versionNumber = null;
- try {
- versionNumber = minimumJavaVersion == null ? null : new VersionNumber(minimumJavaVersion);
- } catch (NumberFormatException nfe) {
- logBadMinJavaVersion();
- }
- for (Plugin p : getNeededDependencies()) {
- VersionNumber v = p.getNeededDependenciesMinimumJavaVersion();
- if (v == null) {
- continue;
- }
- if (versionNumber == null || v.isNewerThan(versionNumber)) {
- versionNumber = v;
- }
- }
- return versionNumber;
- }
-
- private void logBadMinJavaVersion() {
- LOGGER.log(Level.WARNING, "minimumJavaVersion was specified for plugin {0} but unparseable (received {1})",
- new String[]{this.name, this.minimumJavaVersion});
- }
-
public boolean isNeededDependenciesForNewerJenkins() {
return isNeededDependenciesForNewerJenkins(new PluginManager.MetadataCache());
}
@@ -1462,20 +1407,6 @@ public boolean isNeededDependenciesForNewerJenkins(PluginManager.MetadataCache c
});
}
- /**
- * Returns true iff any of the plugin dependencies require a newer Java than Jenkins is running on.
- *
- * @since 2.158
- */
- public boolean isNeededDependenciesForNewerJava() {
- for (Plugin p : getNeededDependencies()) {
- if (p.isForNewerJava() || p.isNeededDependenciesForNewerJava()) {
- return true;
- }
- }
- return false;
- }
-
/**
* If at least some of the plugin's needed dependencies are already installed, and the new version of the
* needed dependencies plugin have a "compatibleSinceVersion"
diff --git a/core/src/main/java/hudson/node_monitors/ArchitectureMonitor.java b/core/src/main/java/hudson/node_monitors/ArchitectureMonitor.java
index b7e88d8e0eef..44af3340e434 100644
--- a/core/src/main/java/hudson/node_monitors/ArchitectureMonitor.java
+++ b/core/src/main/java/hudson/node_monitors/ArchitectureMonitor.java
@@ -24,6 +24,7 @@
package hudson.node_monitors;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Computer;
import hudson.remoting.Callable;
@@ -46,6 +47,7 @@ protected Callable createCallable(Computer c) {
return new GetArchTask();
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ArchitectureMonitor_DisplayName();
diff --git a/core/src/main/java/hudson/node_monitors/ClockMonitor.java b/core/src/main/java/hudson/node_monitors/ClockMonitor.java
index 6c7dc54f343d..533de56a7ddd 100644
--- a/core/src/main/java/hudson/node_monitors/ClockMonitor.java
+++ b/core/src/main/java/hudson/node_monitors/ClockMonitor.java
@@ -24,6 +24,7 @@
package hudson.node_monitors;
+import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.Computer;
@@ -72,6 +73,7 @@ protected Callable createCallable(Computer c) {
return n.getClockDifferenceCallable();
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ClockMonitor_DisplayName();
diff --git a/core/src/main/java/hudson/node_monitors/DiskSpaceMonitor.java b/core/src/main/java/hudson/node_monitors/DiskSpaceMonitor.java
index bcf96ba02704..b3080d074925 100644
--- a/core/src/main/java/hudson/node_monitors/DiskSpaceMonitor.java
+++ b/core/src/main/java/hudson/node_monitors/DiskSpaceMonitor.java
@@ -24,6 +24,7 @@
package hudson.node_monitors;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.model.Computer;
@@ -61,6 +62,7 @@ public String getColumnCaption() {
}
public static final DiskSpaceMonitorDescriptor DESCRIPTOR = new DiskSpaceMonitorDescriptor() {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.DiskSpaceMonitor_DisplayName();
diff --git a/core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java b/core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java
index 8932941432c1..0a4be196009e 100644
--- a/core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java
+++ b/core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java
@@ -24,6 +24,7 @@
package hudson.node_monitors;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Computer;
import hudson.remoting.Callable;
@@ -80,6 +81,7 @@ protected Map monitor() throws InterruptedException {
return monitoringData;
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ResponseTimeMonitor_DisplayName();
diff --git a/core/src/main/java/hudson/node_monitors/SwapSpaceMonitor.java b/core/src/main/java/hudson/node_monitors/SwapSpaceMonitor.java
index 286274b42fe5..97965cc4afe9 100644
--- a/core/src/main/java/hudson/node_monitors/SwapSpaceMonitor.java
+++ b/core/src/main/java/hudson/node_monitors/SwapSpaceMonitor.java
@@ -24,6 +24,7 @@
package hudson.node_monitors;
+import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.Functions;
@@ -101,6 +102,7 @@ protected MonitorTask createCallable(Computer c) {
return new MonitorTask();
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.SwapSpaceMonitor_DisplayName();
diff --git a/core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java b/core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java
index 0b2254e34416..77f2d2cffbc3 100644
--- a/core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java
+++ b/core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java
@@ -24,6 +24,7 @@
package hudson.node_monitors;
+import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.FilePath;
@@ -82,6 +83,7 @@ public DescriptorImpl() {
DESCRIPTOR = this;
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.TemporarySpaceMonitor_DisplayName();
diff --git a/core/src/main/java/hudson/scm/NullSCM.java b/core/src/main/java/hudson/scm/NullSCM.java
index 8d7781688655..3485be05347d 100644
--- a/core/src/main/java/hudson/scm/NullSCM.java
+++ b/core/src/main/java/hudson/scm/NullSCM.java
@@ -24,6 +24,7 @@
package hudson.scm;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.Launcher;
@@ -69,6 +70,7 @@ public DescriptorImpl() {
super(null);
}
+ @NonNull
@Override public String getDisplayName() {
return Messages.NullSCM_DisplayName();
}
diff --git a/core/src/main/java/hudson/search/UserSearchProperty.java b/core/src/main/java/hudson/search/UserSearchProperty.java
index 50813ce3c79b..7e9836944c0b 100644
--- a/core/src/main/java/hudson/search/UserSearchProperty.java
+++ b/core/src/main/java/hudson/search/UserSearchProperty.java
@@ -1,5 +1,6 @@
package hudson.search;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.User;
import hudson.model.UserProperty;
@@ -37,6 +38,7 @@ public static boolean isCaseInsensitive() {
@Extension @Symbol("search")
public static final class DescriptorImpl extends UserPropertyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.UserSearchProperty_DisplayName();
diff --git a/core/src/main/java/hudson/security/AuthorizationStrategy.java b/core/src/main/java/hudson/security/AuthorizationStrategy.java
index e1ce1596b74a..f77385829730 100644
--- a/core/src/main/java/hudson/security/AuthorizationStrategy.java
+++ b/core/src/main/java/hudson/security/AuthorizationStrategy.java
@@ -234,6 +234,7 @@ private Object readResolve() {
@Extension @Symbol("unsecured")
public static final class DescriptorImpl extends Descriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.AuthorizationStrategy_DisplayName();
diff --git a/core/src/main/java/hudson/security/FullControlOnceLoggedInAuthorizationStrategy.java b/core/src/main/java/hudson/security/FullControlOnceLoggedInAuthorizationStrategy.java
index 7dbb0ab67021..1ff59f295569 100644
--- a/core/src/main/java/hudson/security/FullControlOnceLoggedInAuthorizationStrategy.java
+++ b/core/src/main/java/hudson/security/FullControlOnceLoggedInAuthorizationStrategy.java
@@ -24,6 +24,7 @@
package hudson.security;
+import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.Descriptor;
@@ -103,6 +104,7 @@ public DescriptorImpl() {
DESCRIPTOR = this;
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.FullControlOnceLoggedInAuthorizationStrategy_DisplayName();
diff --git a/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java b/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java
index 84f6b52e1e8a..9af94aaa70a8 100644
--- a/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java
+++ b/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java
@@ -218,6 +218,7 @@ public Descriptor getDescriptor() {
@Extension @Symbol("security")
public static final class DescriptorImpl extends Descriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.GlobalSecurityConfiguration_DisplayName();
diff --git a/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java b/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
index 0ecb21f981f3..91376af16efd 100644
--- a/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
+++ b/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
@@ -769,6 +769,7 @@ public static class ConverterImpl extends XStream2.PassthruConverter {
@Extension @Symbol("password")
public static final class DescriptorImpl extends UserPropertyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.HudsonPrivateSecurityRealm_Details_DisplayName();
@@ -964,6 +965,7 @@ public boolean isPasswordHashed(String password) {
@Extension @Symbol("local")
public static final class DescriptorImpl extends Descriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.HudsonPrivateSecurityRealm_DisplayName();
diff --git a/core/src/main/java/hudson/security/LegacyAuthorizationStrategy.java b/core/src/main/java/hudson/security/LegacyAuthorizationStrategy.java
index fc4f613bd9ba..f9285262d9ac 100644
--- a/core/src/main/java/hudson/security/LegacyAuthorizationStrategy.java
+++ b/core/src/main/java/hudson/security/LegacyAuthorizationStrategy.java
@@ -24,6 +24,7 @@
package hudson.security;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Descriptor;
import java.util.Collection;
@@ -59,6 +60,7 @@ public Collection getGroups() {
@Extension @Symbol("legacy")
public static final class DescriptorImpl extends Descriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.LegacyAuthorizationStrategy_DisplayName();
diff --git a/core/src/main/java/hudson/security/LegacySecurityRealm.java b/core/src/main/java/hudson/security/LegacySecurityRealm.java
index 91ea25f31428..1e869475caf2 100644
--- a/core/src/main/java/hudson/security/LegacySecurityRealm.java
+++ b/core/src/main/java/hudson/security/LegacySecurityRealm.java
@@ -24,6 +24,7 @@
package hudson.security;
+import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.Descriptor;
@@ -106,6 +107,7 @@ public DescriptorImpl() {
DESCRIPTOR = this;
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.LegacySecurityRealm_Displayname();
diff --git a/core/src/main/java/hudson/security/SecurityRealm.java b/core/src/main/java/hudson/security/SecurityRealm.java
index b959d2d1bbb3..f2ad1fa7b63d 100644
--- a/core/src/main/java/hudson/security/SecurityRealm.java
+++ b/core/src/main/java/hudson/security/SecurityRealm.java
@@ -24,6 +24,7 @@
package hudson.security;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.DescriptorExtensionList;
import hudson.Extension;
import hudson.ExtensionPoint;
@@ -715,6 +716,7 @@ private Object readResolve() {
@Symbol("none")
public static class DescriptorImpl extends Descriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.NoneSecurityRealm_DisplayName();
diff --git a/core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java b/core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java
index 3cb8c3eace10..89c7da39e7b4 100644
--- a/core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java
+++ b/core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java
@@ -6,6 +6,7 @@
package hudson.security.csrf;
+import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.Util;
@@ -127,6 +128,7 @@ public DescriptorImpl() {
super(CRUMB_SALT.get(), SystemProperties.getString("hudson.security.csrf.requestfield", CrumbIssuer.DEFAULT_CRUMB_NAME));
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.DefaultCrumbIssuer_DisplayName();
diff --git a/core/src/main/java/hudson/slaves/EnvironmentVariablesNodeProperty.java b/core/src/main/java/hudson/slaves/EnvironmentVariablesNodeProperty.java
index 65d84f6426b6..be50bc982062 100644
--- a/core/src/main/java/hudson/slaves/EnvironmentVariablesNodeProperty.java
+++ b/core/src/main/java/hudson/slaves/EnvironmentVariablesNodeProperty.java
@@ -24,6 +24,7 @@
package hudson.slaves;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.EnvVars;
import hudson.Extension;
import hudson.Launcher;
@@ -89,6 +90,7 @@ public void buildEnvVars(EnvVars env, TaskListener listener) throws IOException,
@Extension @Symbol("envVars")
public static class DescriptorImpl extends NodePropertyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.EnvironmentVariablesNodeProperty_displayName();
diff --git a/core/src/main/java/hudson/slaves/JNLPLauncher.java b/core/src/main/java/hudson/slaves/JNLPLauncher.java
index f549e6acb78d..1098769b8146 100644
--- a/core/src/main/java/hudson/slaves/JNLPLauncher.java
+++ b/core/src/main/java/hudson/slaves/JNLPLauncher.java
@@ -36,7 +36,6 @@
import jenkins.model.Jenkins;
import jenkins.slaves.RemotingWorkDirSettings;
import jenkins.util.SystemProperties;
-import jenkins.util.java.JavaUtils;
import jenkins.websocket.WebSockets;
import org.jenkinsci.Symbol;
import org.kohsuke.accmod.Restricted;
@@ -67,11 +66,10 @@ public class JNLPLauncher extends ComputerLauncher {
public final String tunnel;
/**
- * Additional JVM arguments. Can be null.
- * @since 1.297
+ * @deprecated No longer used.
*/
- @CheckForNull
- public final String vmargs;
+ @Deprecated
+ public final transient String vmargs = null;
@NonNull
private RemotingWorkDirSettings workDirSettings = RemotingWorkDirSettings.getEnabledDefaults();
@@ -103,10 +101,20 @@ public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs, @C
}
}
+ // TODO cannot easily make tunnel into a @DataBoundSetter because then the @DataBoundConstructor would be on a no-arg constructor
+ // which is already defined and deprecated. Could retroactively let no-arg constructor use default for workDirSettings,
+ // which would be a behavioral change only for callers of the Java constructor (unlikely).
@DataBoundConstructor
+ public JNLPLauncher(@CheckForNull String tunnel) {
+ this.tunnel = Util.fixEmptyAndTrim(tunnel);
+ }
+
+ /**
+ * @deprecated use {@link JNLPLauncher#JNLPLauncher(String)}
+ */
+ @Deprecated
public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs) {
this.tunnel = Util.fixEmptyAndTrim(tunnel);
- this.vmargs = Util.fixEmptyAndTrim(vmargs);
}
/**
@@ -249,22 +257,6 @@ public FormValidation doCheckWebSocket(@QueryParameter boolean webSocket, @Query
}
- /**
- * Returns true if Java Web Start button should be displayed.
- * Java Web Start is only supported when the Jenkins server is
- * running with Java 8. Earlier Java versions are not supported by Jenkins.
- * Later Java versions do not support Java Web Start.
- *
- * This flag is checked in {@code config.jelly} before displaying the
- * Java Web Start button.
- * @return {@code true} if Java Web Start button should be displayed.
- * @since 2.153
- */
- @Restricted(NoExternalUse.class) // Jelly use
- public boolean isJavaWebStartSupported() {
- return JavaUtils.isRunningWithJava8OrBelow();
- }
-
/**
* Overrides the url that inbound TCP agents should connect to
* as advertised in the agent.jnlp file. If not set, the default
diff --git a/core/src/main/java/hudson/slaves/RetentionStrategy.java b/core/src/main/java/hudson/slaves/RetentionStrategy.java
index 34da53d05806..e06b8e42c069 100644
--- a/core/src/main/java/hudson/slaves/RetentionStrategy.java
+++ b/core/src/main/java/hudson/slaves/RetentionStrategy.java
@@ -176,6 +176,7 @@ public long check(SlaveComputer c) {
@Extension(ordinal = 100) @Symbol("always")
public static class DescriptorImpl extends Descriptor> {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.RetentionStrategy_Always_displayName();
@@ -289,6 +290,7 @@ public long check(final SlaveComputer c) {
@Extension @Symbol("demand")
public static class DescriptorImpl extends Descriptor> {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.RetentionStrategy_Demand_displayName();
diff --git a/core/src/main/java/hudson/slaves/SimpleScheduledRetentionStrategy.java b/core/src/main/java/hudson/slaves/SimpleScheduledRetentionStrategy.java
index efb0df51b3ba..adabf6e07dc3 100644
--- a/core/src/main/java/hudson/slaves/SimpleScheduledRetentionStrategy.java
+++ b/core/src/main/java/hudson/slaves/SimpleScheduledRetentionStrategy.java
@@ -28,6 +28,7 @@
import static java.util.logging.Level.INFO;
import antlr.ANTLRException;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Computer;
import hudson.model.Descriptor;
@@ -248,6 +249,7 @@ private synchronized boolean isOnlineScheduled() {
@Extension @Symbol("schedule")
public static class DescriptorImpl extends Descriptor> {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.SimpleScheduledRetentionStrategy_displayName();
diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java
index a2e7d9195822..0f8b9255357b 100644
--- a/core/src/main/java/hudson/slaves/SlaveComputer.java
+++ b/core/src/main/java/hudson/slaves/SlaveComputer.java
@@ -921,7 +921,7 @@ private void closeChannel() {
if (c != null) {
try {
c.close();
- } catch (IOException e) {
+ } catch (Exception e) {
logger.log(Level.SEVERE, "Failed to terminate channel to " + getDisplayName(), e);
}
Listeners.notify(ComputerListener.class, true, l -> l.onOffline(this, offlineCause));
diff --git a/core/src/main/java/hudson/tasks/ArtifactArchiver.java b/core/src/main/java/hudson/tasks/ArtifactArchiver.java
index 44702bf64dc9..ffeefda8afe7 100644
--- a/core/src/main/java/hudson/tasks/ArtifactArchiver.java
+++ b/core/src/main/java/hudson/tasks/ArtifactArchiver.java
@@ -347,6 +347,7 @@ public DescriptorImpl() {
DESCRIPTOR = this; // backward compatibility
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ArtifactArchiver_DisplayName();
diff --git a/core/src/main/java/hudson/tasks/BatchFile.java b/core/src/main/java/hudson/tasks/BatchFile.java
index 2d1b2e4cc7c1..38cd9841a78d 100644
--- a/core/src/main/java/hudson/tasks/BatchFile.java
+++ b/core/src/main/java/hudson/tasks/BatchFile.java
@@ -25,6 +25,7 @@
package hudson.tasks;
import edu.umd.cs.findbugs.annotations.CheckForNull;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.Util;
@@ -113,6 +114,7 @@ public String getHelpFile() {
return "/help/project-config/batch.html";
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.BatchFile_DisplayName();
diff --git a/core/src/main/java/hudson/tasks/BuildTrigger.java b/core/src/main/java/hudson/tasks/BuildTrigger.java
index 9325514e9d59..08c3a147f8d7 100644
--- a/core/src/main/java/hudson/tasks/BuildTrigger.java
+++ b/core/src/main/java/hudson/tasks/BuildTrigger.java
@@ -59,6 +59,8 @@
import java.util.Comparator;
import java.util.List;
import java.util.StringTokenizer;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.DependencyDeclarer;
@@ -256,8 +258,23 @@ public static boolean execute(AbstractBuild build, BuildListener listener, Build
public static boolean execute(AbstractBuild build, BuildListener listener) {
PrintStream logger = listener.getLogger();
// Check all downstream Project of the project, not just those defined by BuildTrigger
- // TODO this may not yet be up to date if rebuildDependencyGraphAsync has been used; need a method to wait for the last call made before now to finish
- final DependencyGraph graph = Jenkins.get().getDependencyGraph();
+
+ DependencyGraph graphTemp;
+ try {
+ // Note: futureDependencyGraph can be null, if no asynchronous computation of the
+ // dependency graph has been performed.
+ Future futureDependencyGraph = Jenkins.get().getFutureDependencyGraph();
+ if (futureDependencyGraph != null) {
+ graphTemp = futureDependencyGraph.get();
+ } else {
+ graphTemp = Jenkins.get().getDependencyGraph();
+ }
+ } catch (IllegalStateException | InterruptedException | ExecutionException e) {
+ // Use old version of dependency graph instead
+ graphTemp = Jenkins.get().getDependencyGraph();
+ }
+ DependencyGraph graph = graphTemp;
+
List downstreamProjects = new ArrayList<>(
graph.getDownstreamDependencies(build.getProject()));
// Sort topologically
diff --git a/core/src/main/java/hudson/tasks/Fingerprinter.java b/core/src/main/java/hudson/tasks/Fingerprinter.java
index 0a683fb13c45..3be7631bb1f0 100644
--- a/core/src/main/java/hudson/tasks/Fingerprinter.java
+++ b/core/src/main/java/hudson/tasks/Fingerprinter.java
@@ -24,6 +24,7 @@
package hudson.tasks;
+import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.EnvVars;
import hudson.Extension;
@@ -331,6 +332,7 @@ private void record(Run, ?> build, FilePath ws, TaskListener listener, Map {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.Fingerprinter_DisplayName();
diff --git a/core/src/main/java/hudson/tasks/LogRotator.java b/core/src/main/java/hudson/tasks/LogRotator.java
index f3d0f0d630c8..3d5f3975808a 100644
--- a/core/src/main/java/hudson/tasks/LogRotator.java
+++ b/core/src/main/java/hudson/tasks/LogRotator.java
@@ -28,6 +28,7 @@
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.FINER;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Job;
import hudson.model.Run;
@@ -296,6 +297,7 @@ private String toString(Integer i) {
@Extension @Symbol("logRotator")
public static final class LRDescriptor extends BuildDiscarderDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return "Log Rotation";
diff --git a/core/src/main/java/hudson/tasks/Maven.java b/core/src/main/java/hudson/tasks/Maven.java
index 4c059b78f1b4..beee7b8624d5 100644
--- a/core/src/main/java/hudson/tasks/Maven.java
+++ b/core/src/main/java/hudson/tasks/Maven.java
@@ -446,6 +446,7 @@ public String getHelpFile(String fieldName) {
return super.getHelpFile(fieldName);
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.Maven_DisplayName();
@@ -684,6 +685,7 @@ public MavenInstallation forNode(Node node, TaskListener log) throws IOException
@Extension @Symbol("maven")
public static class DescriptorImpl extends ToolDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return "Maven";
@@ -764,6 +766,7 @@ public MavenInstaller(String id) {
@Extension @Symbol("maven")
public static final class DescriptorImpl extends DownloadFromUrlInstaller.DescriptorImpl {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.InstallFromApache();
diff --git a/core/src/main/java/hudson/tasks/_maven/Maven3MojoNote.java b/core/src/main/java/hudson/tasks/_maven/Maven3MojoNote.java
index 3bca8127be68..f43f96cb783d 100644
--- a/core/src/main/java/hudson/tasks/_maven/Maven3MojoNote.java
+++ b/core/src/main/java/hudson/tasks/_maven/Maven3MojoNote.java
@@ -24,6 +24,7 @@
package hudson.tasks._maven;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.MarkupText;
import hudson.console.ConsoleAnnotationDescriptor;
@@ -60,6 +61,7 @@ public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
@Extension @Symbol("maven3Mojos")
public static final class DescriptorImpl extends ConsoleAnnotationDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return "Maven 3 Mojos";
diff --git a/core/src/main/java/hudson/tasks/_maven/MavenErrorNote.java b/core/src/main/java/hudson/tasks/_maven/MavenErrorNote.java
index ec7a231403f6..467b3884ac8e 100644
--- a/core/src/main/java/hudson/tasks/_maven/MavenErrorNote.java
+++ b/core/src/main/java/hudson/tasks/_maven/MavenErrorNote.java
@@ -24,6 +24,7 @@
package hudson.tasks._maven;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.MarkupText;
import hudson.console.ConsoleAnnotationDescriptor;
@@ -47,6 +48,7 @@ public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
@Extension @Symbol("mavenErrors")
public static final class DescriptorImpl extends ConsoleAnnotationDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return "Maven Errors";
diff --git a/core/src/main/java/hudson/tasks/_maven/MavenMojoNote.java b/core/src/main/java/hudson/tasks/_maven/MavenMojoNote.java
index 581cb8d22b21..184fda189bb5 100644
--- a/core/src/main/java/hudson/tasks/_maven/MavenMojoNote.java
+++ b/core/src/main/java/hudson/tasks/_maven/MavenMojoNote.java
@@ -24,6 +24,7 @@
package hudson.tasks._maven;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.MarkupText;
import hudson.console.ConsoleAnnotationDescriptor;
@@ -52,6 +53,7 @@ public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
@Extension @Symbol("mavenMojos")
public static final class DescriptorImpl extends ConsoleAnnotationDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return "Maven Mojos";
diff --git a/core/src/main/java/hudson/tasks/_maven/MavenWarningNote.java b/core/src/main/java/hudson/tasks/_maven/MavenWarningNote.java
index f6eaa933461d..6d894a556b57 100644
--- a/core/src/main/java/hudson/tasks/_maven/MavenWarningNote.java
+++ b/core/src/main/java/hudson/tasks/_maven/MavenWarningNote.java
@@ -24,6 +24,7 @@
package hudson.tasks._maven;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.MarkupText;
import hudson.console.ConsoleAnnotationDescriptor;
@@ -49,6 +50,7 @@ public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
@Extension @Symbol("mavenWarnings")
public static final class DescriptorImpl extends ConsoleAnnotationDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return "Maven Warnings";
diff --git a/core/src/main/java/hudson/tools/BatchCommandInstaller.java b/core/src/main/java/hudson/tools/BatchCommandInstaller.java
index 763f20192f16..d2e9275b1d61 100644
--- a/core/src/main/java/hudson/tools/BatchCommandInstaller.java
+++ b/core/src/main/java/hudson/tools/BatchCommandInstaller.java
@@ -24,6 +24,7 @@
package hudson.tools;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.util.LineEndingConversion;
@@ -60,6 +61,7 @@ private Object readResolve() throws ObjectStreamException {
@Extension @Symbol("batchFile")
public static class DescriptorImpl extends Descriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.BatchCommandInstaller_DescriptorImpl_displayName();
diff --git a/core/src/main/java/hudson/tools/CommandInstaller.java b/core/src/main/java/hudson/tools/CommandInstaller.java
index 13e9029a9f52..a3c3e71fc9aa 100644
--- a/core/src/main/java/hudson/tools/CommandInstaller.java
+++ b/core/src/main/java/hudson/tools/CommandInstaller.java
@@ -24,6 +24,7 @@
package hudson.tools;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.util.LineEndingConversion;
@@ -59,6 +60,7 @@ private Object readResolve() throws ObjectStreamException {
@Extension @Symbol("command")
public static class DescriptorImpl extends Descriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.CommandInstaller_DescriptorImpl_displayName();
diff --git a/core/src/main/java/hudson/tools/InstallSourceProperty.java b/core/src/main/java/hudson/tools/InstallSourceProperty.java
index 6de1af522318..2e2eaf5a2232 100644
--- a/core/src/main/java/hudson/tools/InstallSourceProperty.java
+++ b/core/src/main/java/hudson/tools/InstallSourceProperty.java
@@ -24,6 +24,7 @@
package hudson.tools;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.Saveable;
@@ -65,6 +66,7 @@ public Class type() {
@Extension @Symbol("installSource")
public static class DescriptorImpl extends ToolPropertyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.InstallSourceProperty_DescriptorImpl_displayName();
diff --git a/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java b/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java
index 290f1e4e3baa..d6cf27305939 100644
--- a/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java
+++ b/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java
@@ -24,6 +24,7 @@
package hudson.tools;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.DescriptorExtensionList;
import hudson.Extension;
import hudson.model.Descriptor;
@@ -118,6 +119,7 @@ public static String getToolHome(Node node, ToolInstallation installation, TaskL
@Extension @Symbol("toolLocation")
public static class DescriptorImpl extends NodePropertyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ToolLocationNodeProperty_displayName();
diff --git a/core/src/main/java/hudson/tools/ZipExtractionInstaller.java b/core/src/main/java/hudson/tools/ZipExtractionInstaller.java
index b1204bd0da07..a3ded83462f8 100644
--- a/core/src/main/java/hudson/tools/ZipExtractionInstaller.java
+++ b/core/src/main/java/hudson/tools/ZipExtractionInstaller.java
@@ -24,6 +24,7 @@
package hudson.tools;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.Functions;
@@ -92,6 +93,7 @@ public FilePath performInstallation(ToolInstallation tool, Node node, TaskListen
@Extension @Symbol("zip")
public static class DescriptorImpl extends ToolInstallerDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ZipExtractionInstaller_DescriptorImpl_displayName();
diff --git a/core/src/main/java/hudson/views/BuildButtonColumn.java b/core/src/main/java/hudson/views/BuildButtonColumn.java
index 5a48f0da6de8..39d20f6cb5a6 100644
--- a/core/src/main/java/hudson/views/BuildButtonColumn.java
+++ b/core/src/main/java/hudson/views/BuildButtonColumn.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.AbstractItem;
import org.jenkinsci.Symbol;
@@ -43,6 +44,7 @@ public String taskNoun(Object job) {
@Extension(ordinal = DEFAULT_COLUMNS_ORDINAL_ACTIONS_START - 1) @Symbol("buildButton")
public static class DescriptorImpl extends ListViewColumnDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.BuildButtonColumn_DisplayName();
diff --git a/core/src/main/java/hudson/views/DefaultMyViewsTabBar.java b/core/src/main/java/hudson/views/DefaultMyViewsTabBar.java
index d697552a6857..68870f137b2b 100644
--- a/core/src/main/java/hudson/views/DefaultMyViewsTabBar.java
+++ b/core/src/main/java/hudson/views/DefaultMyViewsTabBar.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -42,6 +43,7 @@ public DefaultMyViewsTabBar() {
@Extension @Symbol("standard")
public static class DescriptorImpl extends MyViewsTabBarDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.DefaultMyViewsTabsBar_DisplayName();
diff --git a/core/src/main/java/hudson/views/DefaultViewsTabBar.java b/core/src/main/java/hudson/views/DefaultViewsTabBar.java
index 6f697f96a86e..8054a3ae1ec5 100644
--- a/core/src/main/java/hudson/views/DefaultViewsTabBar.java
+++ b/core/src/main/java/hudson/views/DefaultViewsTabBar.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -42,6 +43,7 @@ public DefaultViewsTabBar() {
@Extension @Symbol("standard")
public static class DescriptorImpl extends ViewsTabBarDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.DefaultViewsTabsBar_DisplayName();
diff --git a/core/src/main/java/hudson/views/JobColumn.java b/core/src/main/java/hudson/views/JobColumn.java
index b2ec060f09c3..026ea7e17448 100644
--- a/core/src/main/java/hudson/views/JobColumn.java
+++ b/core/src/main/java/hudson/views/JobColumn.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Item;
import org.jenkinsci.Symbol;
@@ -40,6 +41,7 @@ public JobColumn() {
// put this in the middle of icons and properties
@Extension(ordinal = DEFAULT_COLUMNS_ORDINAL_ICON_END + 1) @Symbol("jobName")
public static class DescriptorImpl extends ListViewColumnDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.JobColumn_DisplayName();
diff --git a/core/src/main/java/hudson/views/LastDurationColumn.java b/core/src/main/java/hudson/views/LastDurationColumn.java
index f1d7258e5b95..60a0ddc239fa 100644
--- a/core/src/main/java/hudson/views/LastDurationColumn.java
+++ b/core/src/main/java/hudson/views/LastDurationColumn.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -35,6 +36,7 @@ public LastDurationColumn() {
@Extension(ordinal = DEFAULT_COLUMNS_ORDINAL_PROPERTIES_START - 4) @Symbol("lastDuration")
public static class DescriptorImpl extends ListViewColumnDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.LastDurationColumn_DisplayName();
diff --git a/core/src/main/java/hudson/views/LastFailureColumn.java b/core/src/main/java/hudson/views/LastFailureColumn.java
index c31f3f9590a0..50978c5accd2 100644
--- a/core/src/main/java/hudson/views/LastFailureColumn.java
+++ b/core/src/main/java/hudson/views/LastFailureColumn.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -35,6 +36,7 @@ public LastFailureColumn() {
@Extension(ordinal = DEFAULT_COLUMNS_ORDINAL_PROPERTIES_START - 2) @Symbol("lastFailure")
public static class DescriptorImpl extends ListViewColumnDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.LastFailureColumn_DisplayName();
diff --git a/core/src/main/java/hudson/views/LastStableColumn.java b/core/src/main/java/hudson/views/LastStableColumn.java
index 7dfd482eaab3..1915b6bd4c7d 100644
--- a/core/src/main/java/hudson/views/LastStableColumn.java
+++ b/core/src/main/java/hudson/views/LastStableColumn.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -35,6 +36,7 @@ public LastStableColumn() {
@Extension(ordinal = DEFAULT_COLUMNS_ORDINAL_PROPERTIES_START - 3) @Symbol("lastStable")
public static class DescriptorImpl extends ListViewColumnDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.LastStableColumn_DisplayName();
diff --git a/core/src/main/java/hudson/views/LastSuccessColumn.java b/core/src/main/java/hudson/views/LastSuccessColumn.java
index 98571e8e9bf3..b4a1cddafad1 100644
--- a/core/src/main/java/hudson/views/LastSuccessColumn.java
+++ b/core/src/main/java/hudson/views/LastSuccessColumn.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -35,6 +36,7 @@ public LastSuccessColumn() {
@Extension(ordinal = DEFAULT_COLUMNS_ORDINAL_PROPERTIES_START - 1) @Symbol("lastSuccess")
public static class DescriptorImpl extends ListViewColumnDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.LastSuccessColumn_DisplayName();
diff --git a/core/src/main/java/hudson/views/StatusColumn.java b/core/src/main/java/hudson/views/StatusColumn.java
index 9d9e92d3dfdd..83f3b79dd174 100644
--- a/core/src/main/java/hudson/views/StatusColumn.java
+++ b/core/src/main/java/hudson/views/StatusColumn.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.StatusIcon;
import org.jenkinsci.Symbol;
@@ -41,6 +42,7 @@ public StatusColumn() {
@Extension(ordinal = DEFAULT_COLUMNS_ORDINAL_ICON_START - 1) @Symbol("status")
public static class DescriptorImpl extends ListViewColumnDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.StatusColumn_DisplayName();
diff --git a/core/src/main/java/hudson/views/WeatherColumn.java b/core/src/main/java/hudson/views/WeatherColumn.java
index ee04f7c0f08b..ec31fc4deaf2 100644
--- a/core/src/main/java/hudson/views/WeatherColumn.java
+++ b/core/src/main/java/hudson/views/WeatherColumn.java
@@ -24,6 +24,7 @@
package hudson.views;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -35,6 +36,7 @@ public WeatherColumn() {
@Extension(ordinal = DEFAULT_COLUMNS_ORDINAL_ICON_START - 2) @Symbol("weather")
public static class DescriptorImpl extends ListViewColumnDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.WeatherColumn_DisplayName();
diff --git a/core/src/main/java/jenkins/MetaLocaleDrivenResourceProvider.java b/core/src/main/java/jenkins/MetaLocaleDrivenResourceProvider.java
index b87653301930..5235c7a5d88f 100644
--- a/core/src/main/java/jenkins/MetaLocaleDrivenResourceProvider.java
+++ b/core/src/main/java/jenkins/MetaLocaleDrivenResourceProvider.java
@@ -28,7 +28,8 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.ExtensionList;
import java.net.URL;
-import org.apache.log4j.Logger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.kohsuke.MetaInfServices;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
@@ -53,7 +54,7 @@ public URL lookup(@NonNull String s) {
return url;
}
} catch (RuntimeException e) {
- LOGGER.warn("Failed to lookup URL for '" + s + "' from '" + provider.toString(), e);
+ LOGGER.log(Level.WARNING, "Failed to lookup URL for '" + s + "' from '" + provider.toString(), e);
}
}
return null;
diff --git a/core/src/main/java/jenkins/agents/WebSocketAgents.java b/core/src/main/java/jenkins/agents/WebSocketAgents.java
index 4c4451b974fe..f3953106dadf 100644
--- a/core/src/main/java/jenkins/agents/WebSocketAgents.java
+++ b/core/src/main/java/jenkins/agents/WebSocketAgents.java
@@ -27,6 +27,7 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.ExtensionList;
+import hudson.Util;
import hudson.model.Computer;
import hudson.model.InvisibleAction;
import hudson.model.UnprotectedRootAction;
@@ -89,16 +90,24 @@ public HttpResponse doIndex(StaplerRequest req, StaplerResponse rsp) throws IOEx
state.setRemoteEndpointDescription(req.getRemoteAddr());
state.fireBeforeProperties();
LOGGER.fine(() -> "connecting " + agent);
- // TODO or just pass all request headers?
Map properties = new HashMap<>();
properties.put(JnlpConnectionState.CLIENT_NAME_KEY, agent);
properties.put(JnlpConnectionState.SECRET_KEY, secret);
+ String unsafeCookie = req.getHeader(Engine.WEBSOCKET_COOKIE_HEADER);
+ String cookie;
+ if (unsafeCookie != null) {
+ // This will blow up if the client sent us a malformed cookie.
+ cookie = Util.toHexString(Util.fromHexString(unsafeCookie));
+ } else {
+ cookie = JnlpAgentReceiver.generateCookie();
+ }
+ properties.put(JnlpConnectionState.COOKIE_KEY, cookie);
state.fireAfterProperties(Collections.unmodifiableMap(properties));
Capability remoteCapability = Capability.fromASCII(remoteCapabilityStr);
LOGGER.fine(() -> "received " + remoteCapability);
rsp.setHeader(Capability.KEY, new Capability().toASCII());
rsp.setHeader(Engine.REMOTING_MINIMUM_VERSION_HEADER, RemotingVersionInfo.getMinimumSupportedVersion().toString());
- rsp.setHeader(JnlpConnectionState.COOKIE_KEY, JnlpAgentReceiver.generateCookie()); // TODO figure out what this is for, if anything
+ rsp.setHeader(Engine.WEBSOCKET_COOKIE_HEADER, cookie);
return WebSockets.upgrade(new Session(state, agent, remoteCapability));
}
diff --git a/core/src/main/java/jenkins/fingerprints/FileFingerprintStorage.java b/core/src/main/java/jenkins/fingerprints/FileFingerprintStorage.java
index a0ada4a71d17..d3154e6db6a3 100644
--- a/core/src/main/java/jenkins/fingerprints/FileFingerprintStorage.java
+++ b/core/src/main/java/jenkins/fingerprints/FileFingerprintStorage.java
@@ -368,6 +368,7 @@ protected File getRootDir() {
@Extension
public static class DescriptorImpl extends FingerprintStorageDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.FileFingerprintStorage_DisplayName();
diff --git a/core/src/main/java/jenkins/install/SetupWizard.java b/core/src/main/java/jenkins/install/SetupWizard.java
index b4467b5c9e68..6513823cd82a 100644
--- a/core/src/main/java/jenkins/install/SetupWizard.java
+++ b/core/src/main/java/jenkins/install/SetupWizard.java
@@ -644,7 +644,7 @@ public JSONArray getPlatformPluginUpdates() {
for (UpdateSite site : jenkins.getUpdateCenter().getSiteList()) {
UpdateSite.Plugin sitePlug = site.getPlugin(pluginName);
if (sitePlug != null
- && !sitePlug.isForNewerHudson() && !sitePlug.isForNewerJava()
+ && !sitePlug.isForNewerHudson()
&& !sitePlug.isNeededDependenciesForNewerJenkins()) {
foundCompatibleVersion = true;
break;
diff --git a/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java b/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java
index 5fa8b66c173b..eb9685f54ba0 100644
--- a/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java
+++ b/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java
@@ -24,6 +24,7 @@
package jenkins.management;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.diagnosis.ReverseProxySetupMonitor;
import hudson.model.AdministrativeMonitor;
@@ -62,6 +63,7 @@ public AdministrativeMonitorsDecorator() {
ignoredJenkinsRestOfUrls.add("configure");
}
+ @NonNull
@Override
public String getDisplayName() {
return Messages.AdministrativeMonitorsDecorator_DisplayName();
diff --git a/core/src/main/java/jenkins/model/BuildDiscarderProperty.java b/core/src/main/java/jenkins/model/BuildDiscarderProperty.java
index 3113445efbd6..3128a56831eb 100644
--- a/core/src/main/java/jenkins/model/BuildDiscarderProperty.java
+++ b/core/src/main/java/jenkins/model/BuildDiscarderProperty.java
@@ -24,6 +24,7 @@
package jenkins.model;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.DescriptorVisibilityFilter;
@@ -53,6 +54,7 @@ public BuildDiscarder getStrategy() {
@Symbol("buildDiscarder")
public static class DescriptorImpl extends OptionalJobPropertyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.BuildDiscarderProperty_displayName();
diff --git a/core/src/main/java/jenkins/model/DefaultUserCanonicalIdResolver.java b/core/src/main/java/jenkins/model/DefaultUserCanonicalIdResolver.java
index bc7d92c8887f..57106782a7ba 100644
--- a/core/src/main/java/jenkins/model/DefaultUserCanonicalIdResolver.java
+++ b/core/src/main/java/jenkins/model/DefaultUserCanonicalIdResolver.java
@@ -25,6 +25,7 @@
package jenkins.model;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.Functions;
import hudson.model.Descriptor;
@@ -59,6 +60,7 @@ public Descriptor getDescriptor() {
}
public static final Descriptor DESCRIPTOR = new Descriptor() {
+ @NonNull
@Override
public String getDisplayName() {
return "compute default user ID";
diff --git a/core/src/main/java/jenkins/model/IdStrategy.java b/core/src/main/java/jenkins/model/IdStrategy.java
index 34f798844e73..13cd86bd5a76 100644
--- a/core/src/main/java/jenkins/model/IdStrategy.java
+++ b/core/src/main/java/jenkins/model/IdStrategy.java
@@ -264,6 +264,7 @@ public int compare(@NonNull String id1, @NonNull String id2) {
@Extension @Symbol("caseSensitive")
public static class DescriptorImpl extends IdStrategyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.IdStrategy_CaseSensitive_DisplayName();
@@ -308,6 +309,7 @@ public int compare(@NonNull String id1, @NonNull String id2) {
@Extension
public static class DescriptorImpl extends IdStrategyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.IdStrategy_CaseSensitiveEmailAddress_DisplayName();
diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java
index 94f4b068c362..3aa50e0882a9 100644
--- a/core/src/main/java/jenkins/model/Jenkins.java
+++ b/core/src/main/java/jenkins/model/Jenkins.java
@@ -237,6 +237,7 @@
import java.util.TimerTask;
import java.util.TreeMap;
import java.util.TreeSet;
+import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
@@ -247,7 +248,6 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Predicate;
import java.util.logging.Level;
import java.util.logging.LogRecord;
@@ -498,7 +498,9 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
private volatile List jdks = new ArrayList<>();
private transient volatile DependencyGraph dependencyGraph;
- private final transient AtomicBoolean dependencyGraphDirty = new AtomicBoolean();
+ private transient Future scheduledFutureDependencyGraph;
+ private transient Future calculatingFutureDependencyGraph;
+ private transient Object dependencyGraphLock = new Object();
/**
* Currently active Views tab bar.
@@ -3579,6 +3581,8 @@ public void cleanUp() {
final Set> pending = _cleanUpDisconnectComputers(errors);
+ _cleanUpCancelDependencyGraphCalculation();
+
_cleanUpInterruptReloadThread(errors);
_cleanUpShutdownTriggers(errors);
@@ -3929,6 +3933,18 @@ private void _cleanUpReleaseAllLoggers(List errors) {
}
}
+ private void _cleanUpCancelDependencyGraphCalculation() {
+ synchronized (dependencyGraphLock) {
+ LOGGER.log(Level.FINE, "Canceling internal dependency graph calculation");
+ if (scheduledFutureDependencyGraph != null && !scheduledFutureDependencyGraph.isDone()) {
+ scheduledFutureDependencyGraph.cancel(true);
+ }
+ if (calculatingFutureDependencyGraph != null && !calculatingFutureDependencyGraph.isDone()) {
+ calculatingFutureDependencyGraph.cancel(true);
+ }
+ }
+ }
+
public Object getDynamic(String token) {
for (Action a : getActions()) {
String url = a.getUrlName();
@@ -4899,6 +4915,23 @@ public static boolean isCheckURIEncodingEnabled() {
return ExtensionList.lookupSingleton(URICheckEncodingMonitor.class).isCheckEnabled();
}
+ public Future getFutureDependencyGraph() {
+ synchronized (dependencyGraphLock) {
+ // Scheduled future will be the most recent one --> Return
+ if (scheduledFutureDependencyGraph != null) {
+ return scheduledFutureDependencyGraph;
+ }
+
+ // Calculating future will be the most recent one --> Return
+ if (calculatingFutureDependencyGraph != null) {
+ return calculatingFutureDependencyGraph;
+ }
+
+ // No scheduled or calculating future --> Already completed dependency graph is the most recent one
+ return CompletableFuture.completedFuture(dependencyGraph);
+ }
+ }
+
/**
* Rebuilds the dependency map.
*/
@@ -4908,7 +4941,6 @@ public void rebuildDependencyGraph() {
// volatile acts a as a memory barrier here and therefore guarantees
// that graph is fully build, before it's visible to other threads
dependencyGraph = graph;
- dependencyGraphDirty.set(false);
}
/**
@@ -4921,13 +4953,44 @@ public void rebuildDependencyGraph() {
* @since 1.522
*/
public Future rebuildDependencyGraphAsync() {
- dependencyGraphDirty.set(true);
+ synchronized (dependencyGraphLock) {
+ // Collect calls to this method to avoid unnecessary calculation of the dependency graph
+ if (scheduledFutureDependencyGraph != null) {
+ return scheduledFutureDependencyGraph;
+ }
+ // Schedule new calculation
+ return scheduledFutureDependencyGraph = scheduleCalculationOfFutureDependencyGraph(500, TimeUnit.MILLISECONDS);
+ }
+ }
+
+ private Future scheduleCalculationOfFutureDependencyGraph(int delay, TimeUnit unit) {
return Timer.get().schedule(() -> {
- if (dependencyGraphDirty.get()) {
- rebuildDependencyGraph();
+ // Wait for the currently running calculation to finish without blocking rebuildDependencyGraphAsync()
+ Future temp = null;
+ synchronized (dependencyGraphLock) {
+ if (calculatingFutureDependencyGraph != null) {
+ temp = calculatingFutureDependencyGraph;
+ }
+ }
+
+ if (temp != null) {
+ temp.get();
}
+
+ synchronized (dependencyGraphLock) {
+ // Scheduled future becomes the currently calculating future
+ calculatingFutureDependencyGraph = scheduledFutureDependencyGraph;
+ scheduledFutureDependencyGraph = null;
+ }
+
+ rebuildDependencyGraph();
+
+ synchronized (dependencyGraphLock) {
+ calculatingFutureDependencyGraph = null;
+ }
+
return dependencyGraph;
- }, 500, TimeUnit.MILLISECONDS);
+ }, delay, unit);
}
public DependencyGraph getDependencyGraph() {
diff --git a/core/src/main/java/jenkins/monitor/JavaVersionRecommendationAdminMonitor.java b/core/src/main/java/jenkins/monitor/JavaVersionRecommendationAdminMonitor.java
index a846e6cb2112..133ea2b37731 100644
--- a/core/src/main/java/jenkins/monitor/JavaVersionRecommendationAdminMonitor.java
+++ b/core/src/main/java/jenkins/monitor/JavaVersionRecommendationAdminMonitor.java
@@ -47,7 +47,7 @@
public class JavaVersionRecommendationAdminMonitor extends AdministrativeMonitor {
public JavaVersionRecommendationAdminMonitor() {
- super(JavaVersionRecommendationAdminMonitor.class.getName() + "-2");
+ super(JavaVersionRecommendationAdminMonitor.class.getName() + "-3");
}
private static Boolean disabled = SystemProperties.getBoolean(JavaVersionRecommendationAdminMonitor.class.getName() + ".disabled", false);
diff --git a/core/src/main/java/jenkins/mvn/DefaultGlobalSettingsProvider.java b/core/src/main/java/jenkins/mvn/DefaultGlobalSettingsProvider.java
index 1a7abfa74fb6..e870c98f7a0f 100644
--- a/core/src/main/java/jenkins/mvn/DefaultGlobalSettingsProvider.java
+++ b/core/src/main/java/jenkins/mvn/DefaultGlobalSettingsProvider.java
@@ -1,5 +1,6 @@
package jenkins.mvn;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.model.AbstractBuild;
@@ -26,6 +27,7 @@ public FilePath supplySettings(AbstractBuild, ?> project, TaskListener listene
@Extension(ordinal = 99) @Symbol("standard")
public static class DescriptorImpl extends GlobalSettingsProviderDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.DefaultGlobalSettingsProvider_DisplayName();
diff --git a/core/src/main/java/jenkins/mvn/DefaultSettingsProvider.java b/core/src/main/java/jenkins/mvn/DefaultSettingsProvider.java
index cc476146a461..4b4d41107cf3 100644
--- a/core/src/main/java/jenkins/mvn/DefaultSettingsProvider.java
+++ b/core/src/main/java/jenkins/mvn/DefaultSettingsProvider.java
@@ -1,5 +1,6 @@
package jenkins.mvn;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.model.AbstractBuild;
@@ -26,6 +27,7 @@ public FilePath supplySettings(AbstractBuild, ?> project, TaskListener listene
@Extension(ordinal = 99) @Symbol("standard")
public static class DescriptorImpl extends SettingsProviderDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.DefaultSettingsProvider_DisplayName();
diff --git a/core/src/main/java/jenkins/mvn/FilePathGlobalSettingsProvider.java b/core/src/main/java/jenkins/mvn/FilePathGlobalSettingsProvider.java
index a6edcef0298a..a0f81e09e21c 100644
--- a/core/src/main/java/jenkins/mvn/FilePathGlobalSettingsProvider.java
+++ b/core/src/main/java/jenkins/mvn/FilePathGlobalSettingsProvider.java
@@ -1,5 +1,6 @@
package jenkins.mvn;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.model.AbstractBuild;
@@ -41,6 +42,7 @@ public FilePath supplySettings(AbstractBuild, ?> build, TaskListener listener)
@Extension(ordinal = 10)
public static class DescriptorImpl extends GlobalSettingsProviderDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.FilePathGlobalSettingsProvider_DisplayName();
diff --git a/core/src/main/java/jenkins/mvn/FilePathSettingsProvider.java b/core/src/main/java/jenkins/mvn/FilePathSettingsProvider.java
index 232705246490..1079d8bb63f1 100644
--- a/core/src/main/java/jenkins/mvn/FilePathSettingsProvider.java
+++ b/core/src/main/java/jenkins/mvn/FilePathSettingsProvider.java
@@ -1,5 +1,6 @@
package jenkins.mvn;
+import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.FilePath;
import hudson.model.AbstractBuild;
@@ -41,6 +42,7 @@ public FilePath supplySettings(AbstractBuild, ?> build, TaskListener listener)
@Extension(ordinal = 10) @Symbol("filePath")
public static class DescriptorImpl extends SettingsProviderDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.FilePathSettingsProvider_DisplayName();
diff --git a/core/src/main/java/jenkins/plugins/DetachedPluginsUtil.java b/core/src/main/java/jenkins/plugins/DetachedPluginsUtil.java
index 9a0bd3d4ed22..779ab79ace89 100644
--- a/core/src/main/java/jenkins/plugins/DetachedPluginsUtil.java
+++ b/core/src/main/java/jenkins/plugins/DetachedPluginsUtil.java
@@ -5,7 +5,6 @@
import hudson.ClassicPluginStrategy;
import hudson.PluginWrapper;
import hudson.util.VersionNumber;
-import io.jenkins.lib.versionnumber.JavaSpecificationVersion;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
@@ -17,7 +16,6 @@
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import jenkins.util.java.JavaUtils;
import org.apache.commons.io.IOUtils;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
@@ -54,11 +52,9 @@ public class DetachedPluginsUtil {
DETACHED_LIST = Collections.unmodifiableList(configLines(is).map(line -> {
String[] pieces = line.split(" ");
- // defaults to Java 1.0 to install unconditionally if unspecified
return new DetachedPluginsUtil.DetachedPlugin(pieces[0],
pieces[1] + ".*",
- pieces[2],
- pieces.length == 4 ? pieces[3] : "1.0");
+ pieces[2]);
}).collect(Collectors.toList()));
} catch (IOException x) {
throw new ExceptionInInitializerError(x);
@@ -101,16 +97,13 @@ public static List getImpliedDependencies(String plugi
}
/**
- * Get the list of all plugins that have ever been {@link DetachedPlugin detached} from Jenkins core, applicable to the current Java runtime.
+ * Get the list of all plugins that have ever been {@link DetachedPlugin detached} from Jenkins core.
*
* @return A {@link List} of {@link DetachedPlugin}s.
- * @see JavaUtils#getCurrentJavaRuntimeVersionNumber()
*/
public static @NonNull
List getDetachedPlugins() {
- return DETACHED_LIST.stream()
- .filter(plugin -> JavaUtils.getCurrentJavaRuntimeVersionNumber().isNewerThanOrEqualTo(plugin.getMinimumJavaVersion()))
- .collect(Collectors.toList());
+ return Collections.unmodifiableList(new ArrayList<>(DETACHED_LIST));
}
/**
@@ -174,13 +167,11 @@ public static final class DetachedPlugin {
*/
private final VersionNumber splitWhen;
private final String requiredVersion;
- private final JavaSpecificationVersion minJavaVersion;
- private DetachedPlugin(String shortName, String splitWhen, String requiredVersion, String minJavaVersion) {
+ private DetachedPlugin(String shortName, String splitWhen, String requiredVersion) {
this.shortName = shortName;
this.splitWhen = new VersionNumber(splitWhen);
this.requiredVersion = requiredVersion;
- this.minJavaVersion = new JavaSpecificationVersion(minJavaVersion);
}
/**
@@ -215,10 +206,5 @@ public VersionNumber getRequiredVersion() {
public String toString() {
return shortName + " " + splitWhen.toString().replace(".*", "") + " " + requiredVersion;
}
-
- @NonNull
- public JavaSpecificationVersion getMinimumJavaVersion() {
- return minJavaVersion;
- }
}
}
diff --git a/core/src/main/java/jenkins/security/ApiTokenProperty.java b/core/src/main/java/jenkins/security/ApiTokenProperty.java
index 5ab7fc475e25..000913120bbf 100644
--- a/core/src/main/java/jenkins/security/ApiTokenProperty.java
+++ b/core/src/main/java/jenkins/security/ApiTokenProperty.java
@@ -408,6 +408,7 @@ public void revokeToken(@NonNull String tokenUuid) throws IOException {
@Extension
@Symbol("apiToken")
public static final class DescriptorImpl extends UserPropertyDescriptor {
+ @NonNull
@Override
public String getDisplayName() {
return Messages.ApiTokenProperty_DisplayName();
diff --git a/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java b/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
index dbe60372e961..f130fdf27a73 100644
--- a/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
+++ b/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
@@ -9,6 +9,7 @@
import hudson.model.Computer;
import hudson.model.Slave;
import hudson.remoting.Channel;
+import hudson.remoting.ChannelClosedException;
import hudson.slaves.ComputerLauncher;
import hudson.slaves.ComputerLauncherFilter;
import hudson.slaves.DelegatingComputerLauncher;
@@ -188,7 +189,7 @@ public void afterChannel(@NonNull JnlpConnectionState event) {
public void channelClosed(@NonNull JnlpConnectionState event) {
final String nodeName = event.getProperty(JnlpConnectionState.CLIENT_NAME_KEY);
IOException cause = event.getCloseCause();
- if (cause instanceof ClosedChannelException) {
+ if (cause instanceof ClosedChannelException || cause instanceof ChannelClosedException) {
LOGGER.log(Level.INFO, "{0} for {1} terminated: {2}", new Object[] {Thread.currentThread().getName(), nodeName, cause});
} else if (cause != null) {
LOGGER.log(Level.WARNING, Thread.currentThread().getName() + " for " + nodeName + " terminated",
diff --git a/core/src/main/java/jenkins/triggers/ReverseBuildTrigger.java b/core/src/main/java/jenkins/triggers/ReverseBuildTrigger.java
index 2efe76a6f9d4..87ace6af6e94 100644
--- a/core/src/main/java/jenkins/triggers/ReverseBuildTrigger.java
+++ b/core/src/main/java/jenkins/triggers/ReverseBuildTrigger.java
@@ -193,6 +193,7 @@ private boolean shouldTrigger(Run upstreamBuild, TaskListener listener) {
@Extension @Symbol("upstream")
public static final class DescriptorImpl extends TriggerDescriptor {
+ @NonNull
@Override public String getDisplayName() {
return Messages.ReverseBuildTrigger_build_after_other_projects_are_built();
}
diff --git a/core/src/main/java/jenkins/websocket/WebSocketEcho.java b/core/src/main/java/jenkins/websocket/WebSocketEcho.java
index 6b370bba5f69..b1576690ba8b 100644
--- a/core/src/main/java/jenkins/websocket/WebSocketEcho.java
+++ b/core/src/main/java/jenkins/websocket/WebSocketEcho.java
@@ -27,6 +27,7 @@
import hudson.Extension;
import hudson.model.InvisibleAction;
import hudson.model.RootAction;
+import java.io.IOException;
import java.nio.ByteBuffer;
import jenkins.model.Jenkins;
import org.kohsuke.accmod.Restricted;
@@ -46,12 +47,12 @@ public HttpResponse doIndex() {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);
return WebSockets.upgrade(new WebSocketSession() {
@Override
- protected void text(String message) {
+ protected void text(String message) throws IOException {
sendText("hello " + message);
}
@Override
- protected void binary(byte[] payload, int offset, int len) {
+ protected void binary(byte[] payload, int offset, int len) throws IOException {
ByteBuffer data = ByteBuffer.allocate(len);
for (int i = 0; i < len; i++) {
byte b = payload[offset + i];
diff --git a/core/src/main/java/jenkins/websocket/WebSocketSession.java b/core/src/main/java/jenkins/websocket/WebSocketSession.java
index 4eb36ed4e167..341be5ea71c5 100644
--- a/core/src/main/java/jenkins/websocket/WebSocketSession.java
+++ b/core/src/main/java/jenkins/websocket/WebSocketSession.java
@@ -24,6 +24,7 @@
package jenkins.websocket;
+import java.io.IOException;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.util.concurrent.Future;
@@ -114,45 +115,45 @@ protected void error(Throwable cause) {
LOGGER.log(Level.WARNING, "unhandled WebSocket service error", cause);
}
- protected void binary(byte[] payload, int offset, int len) {
+ protected void binary(byte[] payload, int offset, int len) throws IOException {
LOGGER.warning("unexpected binary frame");
}
- protected void text(String message) {
+ protected void text(String message) throws IOException {
LOGGER.warning("unexpected text frame");
}
@SuppressWarnings("unchecked")
- protected final Future sendBinary(ByteBuffer data) {
+ protected final Future sendBinary(ByteBuffer data) throws IOException {
try {
return (Future) remoteEndpoint.getClass().getMethod("sendBytesByFuture", ByteBuffer.class).invoke(remoteEndpoint, data);
} catch (Exception x) {
- throw new RuntimeException(x);
+ throw new IOException(x);
}
}
- protected final void sendBinary(ByteBuffer partialByte, boolean isLast) {
+ protected final void sendBinary(ByteBuffer partialByte, boolean isLast) throws IOException {
try {
remoteEndpoint.getClass().getMethod("sendPartialBytes", ByteBuffer.class, boolean.class).invoke(remoteEndpoint, partialByte, isLast);
} catch (Exception x) {
- throw new RuntimeException(x);
+ throw new IOException(x);
}
}
@SuppressWarnings("unchecked")
- protected final Future sendText(String text) {
+ protected final Future sendText(String text) throws IOException {
try {
return (Future) remoteEndpoint.getClass().getMethod("sendStringByFuture", String.class).invoke(remoteEndpoint, text);
} catch (Exception x) {
- throw new RuntimeException(x);
+ throw new IOException(x);
}
}
- protected final void close() {
+ protected final void close() throws IOException {
try {
session.getClass().getMethod("close").invoke(session);
} catch (Exception x) {
- throw new RuntimeException(x);
+ throw new IOException(x);
}
}
diff --git a/core/src/main/java/org/jenkins/ui/icon/Icon.java b/core/src/main/java/org/jenkins/ui/icon/Icon.java
index d4a5e9910ca2..c639c5cbb767 100644
--- a/core/src/main/java/org/jenkins/ui/icon/Icon.java
+++ b/core/src/main/java/org/jenkins/ui/icon/Icon.java
@@ -68,7 +68,7 @@ public class Icon {
/**
* Creates a {@link IconType#CORE core} icon.
*
- * @param classSpec The icon class names.
+ * @param classSpec The icon class names. Expected to start with `icon-`.
* @param style The icon style.
*/
public Icon(String classSpec, String style) {
@@ -78,7 +78,7 @@ public Icon(String classSpec, String style) {
/**
* Creates a {@link IconType#CORE core} icon.
*
- * @param classSpec The icon class names.
+ * @param classSpec The icon class names. Expected to start with `icon-`.
* @param url The icon image url.
* @param style The icon style.
*/
@@ -96,7 +96,7 @@ public Icon(String classSpec, String url, String style) {
/**
* Icon instance.
*
- * @param classSpec The icon class specification.
+ * @param classSpec The icon class specification. Expected to start with `icon-`.
* @param url The icon image url.
* @param style The icon style.
* @param iconType The icon type.
@@ -108,7 +108,7 @@ public Icon(String classSpec, String url, String style, IconType iconType) {
/**
* Creates an icon.
*
- * @param classSpec The icon class names.
+ * @param classSpec The icon class names. Expected to start with `icon-`.
* @param url The icon image url.
* @param style The icon style.
* @param iconFormat the {@link IconFormat}.
diff --git a/core/src/main/java/org/jenkins/ui/icon/IconSet.java b/core/src/main/java/org/jenkins/ui/icon/IconSet.java
index 3f7dd29792a7..13e6716d2a0d 100644
--- a/core/src/main/java/org/jenkins/ui/icon/IconSet.java
+++ b/core/src/main/java/org/jenkins/ui/icon/IconSet.java
@@ -81,7 +81,7 @@ private static String prependTitleIfRequired(String icon, String title) {
// for Jelly
@Restricted(NoExternalUse.class)
- public static String getSymbol(String name, String title, String tooltip, String classes, String pluginName) {
+ public static String getSymbol(String name, String title, String tooltip, String classes, String pluginName, String id) {
String translatedName = cleanName(name);
String identifier = Util.fixEmpty(pluginName) == null ? "core" : pluginName;
@@ -91,9 +91,13 @@ public static String getSymbol(String name, String title, String tooltip, String
String symbol = symbolsForLookup.get(translatedName);
symbol = symbol.replaceAll("(class=\")[^&]*?(\")", "$1$2");
symbol = symbol.replaceAll("(tooltip=\")[^&]*?(\")", "");
+ symbol = symbol.replaceAll("(id=\")[^&]*?(\")", "");
if (!tooltip.isEmpty()) {
symbol = symbol.replaceAll("