From b25b45bc90f45dbc65c2623d489e3bc0fb5fa58f Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 31 Dec 2021 07:54:03 -0800 Subject: [PATCH] Remove trailing whitespace (#6138) --- cli/src/main/java/hudson/cli/CLI.java | 2 +- .../hudson/cli/PrivateKeyProviderTest.java | 8 +- .../java/hudson/ClassicPluginStrategy.java | 18 +- core/src/main/java/hudson/CopyOnWrite.java | 8 +- .../java/hudson/ExtensionListListener.java | 2 +- core/src/main/java/hudson/ExtensionPoint.java | 10 +- core/src/main/java/hudson/FilePath.java | 72 ++--- core/src/main/java/hudson/Launcher.java | 76 ++--- core/src/main/java/hudson/PluginManager.java | 30 +- core/src/main/java/hudson/PluginWrapper.java | 32 +- core/src/main/java/hudson/WebAppMain.java | 14 +- .../hudson/cli/declarative/CLIMethod.java | 2 +- .../hudson/console/AnnotatedLargeText.java | 2 +- .../main/java/hudson/init/Initializer.java | 4 +- .../hudson/init/impl/GroovyInitScript.java | 2 +- .../RestartNotSupportedException.java | 2 +- .../lifecycle/WindowsServiceLifecycle.java | 14 +- .../main/java/hudson/model/AbstractBuild.java | 22 +- .../main/java/hudson/model/AbstractItem.java | 30 +- .../main/java/hudson/model/AperiodicWork.java | 18 +- core/src/main/java/hudson/model/Build.java | 14 +- .../java/hudson/model/BuildBadgeAction.java | 10 +- .../main/java/hudson/model/ComputerSet.java | 16 +- .../main/java/hudson/model/Describable.java | 8 +- .../main/java/hudson/model/Descriptor.java | 20 +- core/src/main/java/hudson/model/Executor.java | 6 +- .../hudson/model/HealthReportingAction.java | 10 +- .../java/hudson/model/InvisibleAction.java | 10 +- core/src/main/java/hudson/model/Job.java | 56 ++-- .../java/hudson/model/NoFingerprintMatch.java | 8 +- .../hudson/model/PaneStatusProperties.java | 22 +- .../model/ParametersDefinitionProperty.java | 12 +- .../main/java/hudson/model/PeriodicWork.java | 10 +- core/src/main/java/hudson/model/Queue.java | 24 +- .../java/hudson/model/ResourceActivity.java | 12 +- core/src/main/java/hudson/model/Run.java | 132 ++++---- core/src/main/java/hudson/model/RunMap.java | 8 +- .../main/java/hudson/model/UpdateCenter.java | 26 +- .../main/java/hudson/model/UpdateSite.java | 30 +- .../java/hudson/model/UsageStatistics.java | 14 +- .../hudson/model/UserPropertyDescriptor.java | 12 +- core/src/main/java/hudson/model/View.java | 36 +-- .../hudson/model/queue/MappingWorksheet.java | 2 +- core/src/main/java/hudson/os/SU.java | 2 +- .../main/java/hudson/scheduler/CronTab.java | 16 +- .../main/java/hudson/scm/SCMDescriptor.java | 10 +- .../hudson/scm/browsers/QueryBuilder.java | 8 +- .../main/java/hudson/search/QuickSilver.java | 10 +- core/src/main/java/hudson/search/Search.java | 34 +- .../main/java/hudson/search/SearchItems.java | 8 +- .../HudsonAuthenticationEntryPoint.java | 10 +- .../java/hudson/security/HudsonFilter.java | 12 +- .../security/HudsonPrivateSecurityRealm.java | 6 +- .../java/hudson/security/SecurityMode.java | 12 +- .../src/main/java/hudson/security/SidACL.java | 10 +- .../main/java/hudson/security/SparseACL.java | 8 +- .../main/java/hudson/tasks/LogRotator.java | 30 +- .../main/java/hudson/triggers/SCMTrigger.java | 26 +- .../java/hudson/triggers/TimerTrigger.java | 12 +- .../main/java/hudson/util/ComboBoxModel.java | 2 +- .../src/main/java/hudson/util/DirScanner.java | 4 +- .../java/hudson/util/DoubleLaunchChecker.java | 10 +- .../main/java/hudson/util/ErrorObject.java | 8 +- .../java/hudson/util/FormFieldValidator.java | 12 +- core/src/main/java/hudson/util/Function1.java | 10 +- .../java/hudson/util/HudsonIsLoading.java | 10 +- .../java/hudson/util/HudsonIsRestarting.java | 8 +- .../main/java/hudson/util/OneShotEvent.java | 10 +- .../main/java/hudson/util/ProcessTree.java | 70 ++--- .../util/RobustReflectionConverter.java | 12 +- core/src/main/java/hudson/util/Secret.java | 10 +- core/src/main/java/hudson/util/Service.java | 8 +- .../java/hudson/util/jna/package-info.java | 8 +- .../java/jenkins/install/InstallUtil.java | 18 +- .../java/jenkins/install/SetupWizard.java | 80 ++--- core/src/main/java/jenkins/model/Jenkins.java | 26 +- .../model/JenkinsLocationConfiguration.java | 4 +- .../jenkins/model/ParameterizedJobMixIn.java | 2 +- .../model/lazy/AbstractLazyLoadRunMap.java | 6 +- .../main/java/jenkins/views/FullHeader.java | 6 +- core/src/test/java/hudson/FilePathTest.java | 60 ++-- core/src/test/java/hudson/FunctionsTest.java | 12 +- .../test/java/hudson/PluginManagerTest.java | 34 +- .../test/java/hudson/PluginWrapperTest.java | 6 +- core/src/test/java/hudson/XmlFileTest.java | 2 +- .../java/hudson/console/UrlAnnotatorTest.java | 8 +- .../java/hudson/model/AbstractItemTest.java | 18 +- .../hudson/model/BuildStatusSummaryTest.java | 94 +++--- .../hudson/model/DisplayNameListenerTest.java | 24 +- .../hudson/model/FileParameterValueTest.java | 12 +- .../java/hudson/model/FingerprintTest.java | 10 +- .../hudson/model/ParametersActionTest.java | 18 +- .../hudson/model/RunParameterValueTest.java | 2 +- core/src/test/java/hudson/model/UserTest.java | 14 +- core/src/test/java/hudson/model/ViewTest.java | 18 +- .../model/listeners/SCMListenerTest.java | 2 +- .../scheduler/CronTabDayOfWeekLocaleTest.java | 94 +++--- .../scheduler/CronTabEventualityTest.java | 2 +- .../hudson/slaves/ComputerLauncherTest.java | 2 +- .../hudson/util/ArgumentListBuilderTest.java | 26 +- .../java/hudson/util/CopyOnWriteMapTest.java | 8 +- .../test/java/hudson/util/DirScannerTest.java | 32 +- core/src/test/java/hudson/util/Point.java | 8 +- .../java/hudson/util/ProcessTreeTest.java | 2 +- .../src/test/java/hudson/util/SecretTest.java | 8 +- .../java/hudson/util/io/TarArchiverTest.java | 8 +- .../model/CoreEnvironmentContributorTest.java | 4 +- .../test/java/jenkins/model/JDKNameTest.java | 8 +- .../jenkins/model/JenkinsGetRootUrlTest.java | 6 +- .../JenkinsLocationConfigurationTest.java | 20 +- .../java/jenkins/model/NewViewLinkTest.java | 2 +- .../labels/LabelAutoCompleteSeederTest.java | 8 +- .../lazy/AbstractLazyLoadRunMapTest.java | 4 +- .../jenkins/model/lazy/SortedListTest.java | 2 +- ...SecretJsonInErrorMessageSanitizerTest.java | 24 +- .../security/apitoken/ApiTokenStatsTest.java | 26 +- .../test/java/jenkins/util/UrlHelperTest.java | 22 +- .../java/jenkins/util/VirtualFileTest.java | 2 +- .../jenkins/util/xstream/XStreamDOMTest.java | 6 +- .../test/java/jenkins/xml/XMLUtilsTest.java | 4 +- .../acegisecurity/util/FieldUtilsTest.java | 2 +- pom.xml | 1 + .../test/java/hudson/AboutJenkinsTest.java | 14 +- .../hudson/ClassicPluginStrategyTest.java | 2 +- .../java/hudson/CustomPluginManagerTest.java | 8 +- .../test/java/hudson/ExtensionFinderTest.java | 2 +- test/src/test/java/hudson/FilePathTest.java | 6 +- test/src/test/java/hudson/LauncherTest.java | 4 +- .../test/java/hudson/PluginManagerTest.java | 44 +-- .../bugs/JnlpAccessWithSecuredHudsonTest.java | 14 +- .../java/hudson/bugs/seasar/package-info.java | 8 +- .../java/hudson/cli/BuildCommandTest.java | 2 +- .../test/java/hudson/cli/CLIActionTest.java | 2 +- test/src/test/java/hudson/cli/CLITest.java | 4 +- .../java/hudson/cli/ConsoleCommandTest.java | 18 +- .../hudson/cli/ListPluginsCommandTest.java | 12 +- .../HudsonHomeDiskUsageMonitorTest.java | 2 +- .../ReverseProxySetupMonitorTest.java | 14 +- .../diagnosis/TooManyJobsButNoViewTest.java | 6 +- .../java/hudson/init/InitMilestoneTest.java | 2 +- .../test/java/hudson/jobs/CreateItemTest.java | 4 +- .../java/hudson/model/AbstractBuildTest.java | 12 +- .../java/hudson/model/BuildExecutionTest.java | 2 +- .../test/java/hudson/model/ComputerTest.java | 2 +- .../hudson/model/DependencyGraphTest.java | 8 +- .../model/DirectoryBrowserSupportTest.java | 10 +- .../java/hudson/model/DisplayNameTest.java | 20 +- .../hudson/model/FileParameterValueTest.java | 100 +++--- .../java/hudson/model/FingerprintTest.java | 82 ++--- .../src/test/java/hudson/model/ItemsTest.java | 4 +- test/src/test/java/hudson/model/JobTest.java | 30 +- .../test/java/hudson/model/ListViewTest.java | 6 +- .../test/java/hudson/model/MyViewTest.java | 20 +- .../hudson/model/MyViewsPropertyTest.java | 28 +- .../PasswordParameterDefinitionTest.java | 2 +- .../test/java/hudson/model/ProjectTest.java | 214 ++++++------- .../src/test/java/hudson/model/QueueTest.java | 20 +- .../model/RunParameterDefinitionTest.java | 42 +-- test/src/test/java/hudson/model/RunTest.java | 10 +- .../test/java/hudson/model/SimpleJobTest.java | 72 ++--- .../hudson/model/UpdateCenterCustomTest.java | 20 +- .../java/hudson/model/UpdateCenterTest.java | 10 +- .../java/hudson/model/UpdateSiteTest.java | 4 +- test/src/test/java/hudson/model/UserTest.java | 2 +- test/src/test/java/hudson/model/ViewTest.java | 2 +- ...ildKeepsRunningWhenFaultySubTasksTest.java | 4 +- .../ClockMonitorDescriptorTest.java | 4 +- .../pages/SystemConfigurationTestCase.java | 8 +- .../hudson/scm/AbstractScmTagActionTest.java | 6 +- test/src/test/java/hudson/scm/ScmTest.java | 8 +- .../test/java/hudson/search/SearchTest.java | 54 ++-- .../security/ExtendedReadPermissionTest.java | 2 +- .../HudsonPrivateSecurityRealmTest.java | 42 +-- .../hudson/security/PermissionGroupTest.java | 8 +- .../test/java/hudson/security/WhoAmITest.java | 8 +- .../security/csrf/DefaultCrumbIssuerTest.java | 6 +- .../EnvironmentVariableNodePropertyTest.java | 20 +- .../java/hudson/slaves/JNLPLauncherTest.java | 40 +-- .../hudson/slaves/NodeProvisionerTest.java | 8 +- .../java/hudson/tasks/FingerprinterTest.java | 40 +-- .../java/hudson/tasks/LogRotatorTest.java | 20 +- .../src/test/java/hudson/tasks/MavenTest.java | 18 +- .../hudson/tasks/UserAvatarResolverTest.java | 8 +- .../tools/ZipExtractionInstallerTest.java | 48 +-- .../java/hudson/triggers/SCMTriggerTest.java | 8 +- .../java/hudson/util/BootFailureTest.java | 2 +- .../util/RobustReflectionConverterTest.java | 78 ++--- .../GlobalDefaultViewConfigurationTest.java | 10 +- .../test/java/jenkins/AgentProtocolTest.java | 20 +- .../ControllerExecutorsAgentsTest.java | 4 +- .../ControllerExecutorsNoAgentsTest.java | 4 +- .../diagnostics/RootUrlNotSetMonitorTest.java | 18 +- .../jenkins/install/InstallStateTest.java | 18 +- .../java/jenkins/install/SetupWizardTest.java | 12 +- .../JenkinsLocationConfigurationTest.java | 2 +- .../test/java/jenkins/model/JenkinsTest.java | 80 ++--- .../model/MasterBuildConfigurationTest.java | 8 +- .../model/UnlabeledLoadStatisticsTest.java | 22 +- .../security/ApiTokenPropertyTest.java | 124 ++++---- .../BasicHeaderApiTokenAuthenticatorTest.java | 34 +- .../security/BasicHeaderProcessorTest.java | 4 +- ...etJsonInErrorMessageSanitizerHtmlTest.java | 94 +++--- .../security/RekeySecretAdminMonitorTest.java | 2 +- .../jenkins/security/Security177Test.java | 2 +- .../jenkins/security/Security637Test.java | 54 ++-- .../SecurityContextExecutorServiceTest.java | 2 +- .../jenkins/security/SpySecurityListener.java | 14 +- .../ApiTokenPropertyConfigurationTest.java | 12 +- .../apitoken/ApiTokenStatsRestartTest.java | 28 +- .../security/apitoken/ApiTokenStatsTest.java | 36 +-- ...gacyApiTokenAdministrativeMonitorTest.java | 162 +++++----- .../csrf/CSRFAdministrativeMonitorTest.java | 8 +- .../seed/UserSeedChangeListenerTest.java | 10 +- .../security/seed/UserSeedPropertyTest.java | 4 +- .../CustomRoutingDecisionProviderTest.java | 24 +- .../security/stapler/DoActionFilterTest.java | 294 +++++++++--------- .../stapler/GetterMethodFilterTest.java | 168 +++++----- .../security/stapler/Security400Test.java | 220 ++++++------- .../security/stapler/Security867Test.java | 58 ++-- .../security/stapler/Security914Test.java | 16 +- .../security/stapler/StaplerAbstractTest.java | 52 ++-- .../StaticRoutingDecisionProvider2Test.java | 64 ++-- .../StaticRoutingDecisionProviderTest.java | 202 ++++++------ .../jenkins/util/SystemPropertiesTest.java | 16 +- .../jenkins/widgets/BuildTimeTrendTest.java | 28 +- test/src/test/java/lib/form/ComboBoxTest.java | 18 +- .../java/lib/form/ExpandableTextboxTest.java | 40 +-- .../test/java/lib/form/HeteroListTest.java | 8 +- .../java/lib/form/RepeatablePropertyTest.java | 16 +- .../test/java/lib/form/RepeatableTest.java | 20 +- test/src/test/java/lib/form/TextAreaTest.java | 2 +- .../java/lib/form/ValidateButtonTest.java | 56 ++-- .../java/lib/layout/ConfirmationLinkTest.java | 60 ++-- .../test/java/lib/layout/StopButtonTest.java | 40 +-- .../src/test/java/lib/layout/SvgIconTest.java | 6 +- 235 files changed, 2798 insertions(+), 2797 deletions(-) diff --git a/cli/src/main/java/hudson/cli/CLI.java b/cli/src/main/java/hudson/cli/CLI.java index 06baf6be13..24a9d07c61 100644 --- a/cli/src/main/java/hudson/cli/CLI.java +++ b/cli/src/main/java/hudson/cli/CLI.java @@ -115,7 +115,7 @@ public class CLI { if (url==null) url = System.getenv("HUDSON_URL"); - + boolean noKeyAuth = false; // TODO perhaps allow mode to be defined by environment variable too (assuming $JENKINS_USER_ID can be used for -user) diff --git a/cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java b/cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java index 9205c853f8..8d960e87a4 100644 --- a/cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java +++ b/cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java @@ -50,7 +50,7 @@ public class PrivateKeyProviderTest { String password = "password"; assertKeyPairNotNull(file, password); } - + /** key command: ssh-keygen -f rsa -t rsa -b 1024 -m PEM */ @@ -69,7 +69,7 @@ public class PrivateKeyProviderTest { String password = "password"; assertKeyPairNotNull(file, password); } - + /** key command: ssh-keygen -f openssh -t rsa -b 1024 */ @@ -78,7 +78,7 @@ public class PrivateKeyProviderTest { File file = new File(this.getClass().getResource("openssh").getFile()); assertKeyPairNotNull(file, null); } - + /** key command: ssh-keygen -f openssh-unsupported -t rsa -b 1024 -m PKCS8 -p password */ @@ -123,7 +123,7 @@ public class PrivateKeyProviderTest { /** key command: ssh-keygen -f openssh -t rsa -b 1024 in this key we remove some lines to break the key. - */ + */ @Test public void loadKeyBroken() throws IOException, GeneralSecurityException { File file = new File(this.getClass().getResource("openssh-broken").getFile()); diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index ef29f48158..46e2d7235f 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -1,18 +1,18 @@ /* * The MIT License - * + * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Jean-Baptiste Quenot, Tom Huybrechts - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -121,7 +121,7 @@ public class ClassicPluginStrategy implements PluginStrategy { } private static Manifest loadLinkedManifest(File archive) throws IOException { - // resolve the .hpl file to the location of the manifest file + // resolve the .hpl file to the location of the manifest file try { // Locate the manifest String firstLine; @@ -137,7 +137,7 @@ public class ClassicPluginStrategy implements PluginStrategy { // indirection archive = resolve(archive, firstLine); } - + // Read the manifest try (InputStream manifestInput = Files.newInputStream(archive.toPath())) { return new Manifest(manifestInput); @@ -232,7 +232,7 @@ public class ClassicPluginStrategy implements PluginStrategy { } } } - + fix(atts,optionalDependencies); // Register global classpath mask. This is useful for hiding JavaEE APIs that you might see from the container, @@ -253,7 +253,7 @@ public class ClassicPluginStrategy implements PluginStrategy { private void fix(Attributes atts, List optionalDependencies) { String pluginName = atts.getValue("Short-Name"); - + String jenkinsVersion = atts.getValue("Jenkins-Version"); if (jenkinsVersion==null) jenkinsVersion = atts.getValue("Hudson-Version"); @@ -430,7 +430,7 @@ public class ClassicPluginStrategy implements PluginStrategy { if (classLoader instanceof DependencyClassLoader) { return (DependencyClassLoader)classLoader; } - + if (classLoader instanceof AntClassLoader) { // AntClassLoaders hold parents not only as AntClassLoader#getParent() // but also as AntClassLoader#getConfiguredParent() diff --git a/core/src/main/java/hudson/CopyOnWrite.java b/core/src/main/java/hudson/CopyOnWrite.java index ff6bc92d57..a36dbaf4e9 100644 --- a/core/src/main/java/hudson/CopyOnWrite.java +++ b/core/src/main/java/hudson/CopyOnWrite.java @@ -1,18 +1,18 @@ /* * The MIT License - * + * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/core/src/main/java/hudson/ExtensionListListener.java b/core/src/main/java/hudson/ExtensionListListener.java index f5c8528add..6a29da2d46 100644 --- a/core/src/main/java/hudson/ExtensionListListener.java +++ b/core/src/main/java/hudson/ExtensionListListener.java @@ -35,7 +35,7 @@ public abstract class ExtensionListListener { * {@link ExtensionList} contents has changed. *

* This would be called when an entry gets added to or removed from the list for any reason e.g. - * when a dynamically loaded plugin introduces a new {@link ExtensionPoint} implementation + * when a dynamically loaded plugin introduces a new {@link ExtensionPoint} implementation * that adds an entry to the {@link ExtensionList} being listened to. */ public abstract void onChange(); diff --git a/core/src/main/java/hudson/ExtensionPoint.java b/core/src/main/java/hudson/ExtensionPoint.java index 73063ec832..426aa52b05 100644 --- a/core/src/main/java/hudson/ExtensionPoint.java +++ b/core/src/main/java/hudson/ExtensionPoint.java @@ -1,18 +1,18 @@ /* * The MIT License - * + * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -51,7 +51,7 @@ public interface ExtensionPoint { /** * Used by designers of extension points (direct subtypes of {@link ExtensionPoint}) to indicate that * the legacy instances are scoped to {@link Jenkins} instance. By default, legacy instances are - * static scope. + * static scope. */ @Target(TYPE) @Retention(RUNTIME) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index cadb8cc257..8612e35e2d 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -1,20 +1,20 @@ /* * The MIT License - * + * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, * Eric Lefevre-Ardant, Erik Ramfelt, Michael B. Donohue, Alan Harder, * Manufacture Francaise des Pneumatiques Michelin, Romain Seguy - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -198,7 +198,7 @@ import org.kohsuke.stapler.Stapler; *

* When {@link FileCallable} is transferred to a remote node, it will be done so * by using the same Java serialization scheme that the remoting module uses. - * See {@link Channel} for more about this. + * See {@link Channel} for more about this. * *

* {@link FilePath} itself can be sent over to a remote node as a part of {@link Callable} @@ -229,7 +229,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { * This is used to determine whether we are running on the controller / the built-in node, or an agent. */ private transient VirtualChannel channel; - + /** * Represent the path to the file in the controller or the agent * Since the platform of the agent might be different, can't use java.io.File @@ -369,7 +369,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { // if the path represents a local path, there' no need to guess. if(!isRemote()) return File.pathSeparatorChar!=';'; - + // note that we can't use the usual File.pathSeparator and etc., as the OS of // the machine where this code runs and the OS that this FilePath refers to may be different. @@ -411,7 +411,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { zip(os); } } - + /** * Creates a zip file from this directory by using the specified filter, * and sends the result to the given output stream. @@ -808,7 +808,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { return null; } } - + /** * Resolves symlink, if the given file is a symlink. Otherwise return null. *

@@ -843,7 +843,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { public int hashCode() { return 31 * (channel != null ? channel.hashCode() : 0) + remote.hashCode(); } - + /** * Supported tar file compression methods. */ @@ -1083,7 +1083,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { /** * Convenience method to call {@link FilePath#copyTo(FilePath)}. - * + * * @since 1.311 */ public void copyFrom(FilePath src) throws IOException, InterruptedException { @@ -1345,7 +1345,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { return mkdirs(f) || f.exists(); } } - + /** * Deletes all suffixes recursively. * @throws IOException if it exists but could not be successfully deleted @@ -1368,7 +1368,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { Util.deleteRecursive(file.toPath(), path -> path.toFile()); } } - + return null; } } @@ -1734,7 +1734,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { return null; } } - + private void setLastModifiedIfPossible(final long timestamp) throws IOException, InterruptedException { String message = act(new SetLastModified(timestamp)); @@ -1776,7 +1776,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { return f.isDirectory(); } } - + /** * Returns the file size in bytes. * @@ -2242,18 +2242,18 @@ public final class FilePath implements SerializableOnlyOverRemoting { actAsync(new OffsetPipeSecureFileCallable(p, offset)); return new java.util.zip.GZIPInputStream(p.getIn()); } - + private static class OffsetPipeSecureFileCallable extends MasterToSlaveFileCallable { private static final long serialVersionUID = 1L; - + private Pipe p; private long offset; - + private OffsetPipeSecureFileCallable(Pipe p, long offset) { this.p = p; this.offset = offset; } - + @Override public Void invoke(File f, VirtualChannel channel) throws IOException { try (OutputStream os = p.getOut(); @@ -2275,9 +2275,9 @@ public final class FilePath implements SerializableOnlyOverRemoting { */ public String readToString() throws IOException, InterruptedException { return act(new ReadToString()); - } + } private static class ReadToString extends MasterToSlaveFileCallable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; @Override public String invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { return new String(Files.readAllBytes(fileToPath(f)), Charset.defaultCharset()); @@ -2536,10 +2536,10 @@ public final class FilePath implements SerializableOnlyOverRemoting { /** * Copies the contents of this directory recursively into the specified target directory. - * + * * @return * the number of files copied. - * @since 1.312 + * @since 1.312 */ public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException { return copyRecursiveTo("**/*",target); @@ -2685,8 +2685,8 @@ public final class FilePath implements SerializableOnlyOverRemoting { if (exceptionEncountered) { Files.copy(fileToPath(f), targetPath, StandardCopyOption.REPLACE_EXISTING); if (!logMessageShown) { - LOGGER.log(Level.INFO, - "JENKINS-52325: Jenkins failed to retain attributes when copying to {0}, so proceeding without attributes.", + LOGGER.log(Level.INFO, + "JENKINS-52325: Jenkins failed to retain attributes when copying to {0}, so proceeding without attributes.", dest.getAbsolutePath()); logMessageShown = true; } @@ -2958,7 +2958,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { final String fileMask = tokens.nextToken().trim(); if(hasMatch(dir,fileMask,caseSensitive)) continue; // no error on this portion - + // JENKINS-5253 - if we can get some match in case insensitive mode // and user requested case sensitive match, notify the user if (caseSensitive && hasMatch(dir, fileMask, false)) { @@ -3126,7 +3126,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { public static FormValidation validateFileMask(@CheckForNull FilePath path, String value) throws IOException { return FilePath.validateFileMask(path, value, true); } - + /** * Shortcut for {@link #validateFileMask(String,boolean,boolean)} with {@code errorIfNotExist} true, as the left-hand side can be null. */ @@ -3136,14 +3136,14 @@ public final class FilePath implements SerializableOnlyOverRemoting { } /** - * Short for {@code validateFileMask(value, true, true)} + * Short for {@code validateFileMask(value, true, true)} */ public FormValidation validateFileMask(String value) throws IOException { return validateFileMask(value, true, true); } - + /** - * Short for {@code validateFileMask(value, errorIfNotExist, true)} + * Short for {@code validateFileMask(value, errorIfNotExist, true)} */ public FormValidation validateFileMask(String value, boolean errorIfNotExist) throws IOException { return validateFileMask(value, errorIfNotExist, true); @@ -3226,7 +3226,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { } } - String msg = expectingFile ? Messages.FilePath_validateRelativePath_noSuchFile(value) : + String msg = expectingFile ? Messages.FilePath_validateRelativePath_noSuchFile(value) : Messages.FilePath_validateRelativePath_noSuchDirectory(value); if(errorIfNotExist) return FormValidation.error(msg); else return FormValidation.warning(msg); @@ -3266,7 +3266,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { } /** - * Returns true if this {@link FilePath} represents a remote file. + * Returns true if this {@link FilePath} represents a remote file. */ public boolean isRemote() { return channel!=null; @@ -3424,7 +3424,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { new NamingThreadFactory(new DaemonThreadFactory(), "FilePath.localPool")) )); - + /** * Channel to the current instance. */ @@ -3490,7 +3490,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { if (new File(potentialChildRelativePath).isAbsolute()) { throw new IllegalArgumentException("Only a relative path is supported, the given path is absolute: " + potentialChildRelativePath); } - + Path parentAbsolutePath = Util.fileToPath(parentFile.getAbsoluteFile()); Path parentRealPath; try { @@ -3538,7 +3538,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { } } catch (NoSuchFileException e) { // nonexistent file / Windows Server 2016 + MSFT docker - // in case this folder / file will be copied somewhere else, + // in case this folder / file will be copied somewhere else, // it becomes the responsibility of that system to check the isDescendant with the existing links // we are not taking the parentRealPath to avoid possible problem Path child = currentFileAbsolutePath.normalize(); @@ -3560,7 +3560,7 @@ public final class FilePath implements SerializableOnlyOverRemoting { } return current; } - + private @NonNull Path windowsToRealPath(@NonNull Path path) throws IOException { try { return path.toRealPath(); diff --git a/core/src/main/java/hudson/Launcher.java b/core/src/main/java/hudson/Launcher.java index 57de28f89d..c08c46d294 100644 --- a/core/src/main/java/hudson/Launcher.java +++ b/core/src/main/java/hudson/Launcher.java @@ -1,18 +1,18 @@ /* * The MIT License - * + * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly, CloudBees, Inc. - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -85,7 +85,7 @@ import org.kohsuke.accmod.restrictions.NoExternalUse; * * * @author Kohsuke Kawaguchi - * @see FilePath#createLauncher(TaskListener) + * @see FilePath#createLauncher(TaskListener) */ public abstract class Launcher { @@ -146,7 +146,7 @@ public abstract class Launcher { /** * Gets the {@link TaskListener} that this launcher uses to * report the commands that it's executing. - * + * * @return Task listener */ @NonNull @@ -289,7 +289,7 @@ public abstract class Launcher { /** * Sets the current directory. - * + * * @param workDir Work directory to be used. * If {@code null}, the default/current directory will be used by the process starter * @return {@code this} @@ -314,8 +314,8 @@ public abstract class Launcher { /** * Sets STDOUT destination. - * - * @param out Output stream. + * + * @param out Output stream. * Use {@code null} to send STDOUT to {@code /dev/null}. * @return {@code this} */ @@ -327,7 +327,7 @@ public abstract class Launcher { /** * Sends the stdout to the given {@link TaskListener}. - * + * * @param out Task listener (must be safely remotable) * @return {@code this} */ @@ -339,7 +339,7 @@ public abstract class Launcher { /** * Gets current STDOUT destination. - * + * * @return STDOUT output stream. {@code null} if STDOUT is suppressed or undefined. */ @CheckForNull @@ -358,7 +358,7 @@ public abstract class Launcher { /** * Gets current STDERR destination. - * + * * @return STDERR output stream. {@code null} if suppressed or undefined. */ @CheckForNull @@ -369,7 +369,7 @@ public abstract class Launcher { /** * Controls where the stdin of the process comes from. * By default, {@code /dev/null}. - * + * * @return {@code this} */ @NonNull @@ -380,7 +380,7 @@ public abstract class Launcher { /** * Gets current STDIN destination. - * + * * @return STDIN output stream. {@code null} if suppressed or undefined. */ @CheckForNull @@ -395,7 +395,7 @@ public abstract class Launcher { * In addition to what the current process * is inherited (if this is going to be launched from a agent agent, that * becomes the "current" process), these variables will be also set. - * + * * @param overrides Environment variables to be overridden * @return {@code this} */ @@ -407,7 +407,7 @@ public abstract class Launcher { /** * @param overrides * List of "VAR=VALUE". See {@link #envs(Map)} for the semantics. - * + * * @return {@code this} */ public ProcStarter envs(@CheckForNull String... overrides) { @@ -425,7 +425,7 @@ public abstract class Launcher { /** * Gets a list of environment variables to be set. * Returns an empty array if envs field has not been initialized. - * + * * @return If initialized, returns a copy of internal envs array. Otherwise - a new empty array. */ @NonNull @@ -470,7 +470,7 @@ public abstract class Launcher { * Indicates that the caller will directly write to the child process {@link #stdin()} via {@link Proc#getStdin()}. * (Whereas by default you call {@link #stdin(InputStream)} * and let Jenkins pump your {@link InputStream} of choosing to stdin.) - * + * * @return {@code this} * @since 1.399 */ @@ -518,7 +518,7 @@ public abstract class Launcher { // The logging around procHolderForJoin prevents the preliminary object deallocation we saw in JENKINS-23271 final Proc procHolderForJoin = start(); LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); - + if (procHolderForJoin instanceof ProcWithJenkins23271Patch) { return procHolderForJoin.join(); } else { @@ -762,7 +762,7 @@ public abstract class Launcher { *

* When the returned channel is terminated, the process will be killed. * - * @param cmd + * @param cmd * The commands. * @param out * Where the stderr from the launched process will be sent. @@ -774,7 +774,7 @@ public abstract class Launcher { * is inherited (if this is going to be launched from an agent, that * becomes the "current" process), these variables will be also set. */ - public abstract Channel launchChannel(@NonNull String[] cmd, @NonNull OutputStream out, + public abstract Channel launchChannel(@NonNull String[] cmd, @NonNull OutputStream out, @CheckForNull FilePath workDir, @NonNull Map envVars) throws IOException, InterruptedException; /** @@ -831,7 +831,7 @@ public abstract class Launcher { printCommandLine(cmd.toArray(new String[0]),workDir); return; } - + assert mask.length == cmd.size(); final String[] masked = new String[cmd.size()]; for (int i = 0; i < cmd.size(); i++) { @@ -843,14 +843,14 @@ public abstract class Launcher { } printCommandLine(masked, workDir); } - + protected final void maskedPrintCommandLine(@NonNull String[] cmd, @NonNull boolean[] mask, @CheckForNull FilePath workDir) { maskedPrintCommandLine(Arrays.asList(cmd),mask,workDir); } /** * Returns a decorated {@link Launcher} for the given node. - * + * * @param node Node for which this launcher is created. * @return Decorated instance of the Launcher. */ @@ -877,7 +877,7 @@ public abstract class Launcher { public boolean isUnix() { return outer.isUnix(); } - + @Override public Proc launch(ProcStarter starter) throws IOException { starter.commands.addAll(0,Arrays.asList(prefix)); @@ -1111,7 +1111,7 @@ public abstract class Launcher { final OutputStream out = ps.stdout == null || ps.stdoutListener != null ? null : new RemoteOutputStream(new CloseProofOutputStream(ps.stdout)); final OutputStream err = ps.stderr==null ? null : new RemoteOutputStream(new CloseProofOutputStream(ps.stderr)); final InputStream in = ps.stdin == null || ps.stdin == NULL_INPUT_STREAM ? null : new RemoteInputStream(ps.stdin, false); - + final FilePath psPwd = ps.pwd; final String workDir = psPwd==null ? null : psPwd.getRemote(); @@ -1230,14 +1230,14 @@ public abstract class Launcher { } } } - + /** - * A launcher which delegates to a provided inner launcher. + * A launcher which delegates to a provided inner launcher. * Allows subclasses to only implement methods they want to override. - * Originally, this launcher has been implemented in + * Originally, this launcher has been implemented in * * Custom Tools Plugin. - * + * * @author rcampbell * @author Oleg Nenashev, Synopsys Inc. * @since 1.568 @@ -1301,9 +1301,9 @@ public abstract class Launcher { @Override public Proc launch(String[] cmd, String[] env, InputStream in, OutputStream out, FilePath workDir) throws IOException { - return inner.launch(cmd, env, in, out, workDir); + return inner.launch(cmd, env, in, out, workDir); } - + /** * Gets nested launcher. * @return Inner launcher @@ -1311,7 +1311,7 @@ public abstract class Launcher { @NonNull public Launcher getInner() { return inner; - } + } } public static class IOTriplet implements Serializable { @@ -1328,7 +1328,7 @@ public abstract class Launcher { int join() throws InterruptedException, IOException; void kill() throws IOException, InterruptedException; boolean isAlive() throws IOException, InterruptedException; - + @NonNull IOTriplet getIOtriplet(); } @@ -1350,8 +1350,8 @@ public abstract class Launcher { RemoteLaunchCallable(@NonNull List cmd, @CheckForNull boolean[] masks, @CheckForNull String[] env, @CheckForNull InputStream in, boolean reverseStdin, - @CheckForNull OutputStream out, boolean reverseStdout, - @CheckForNull OutputStream err, boolean reverseStderr, + @CheckForNull OutputStream out, boolean reverseStdout, + @CheckForNull OutputStream err, boolean reverseStderr, boolean quiet, @CheckForNull String workDir, @NonNull TaskListener listener, @CheckForNull TaskListener stdoutListener) { this.cmd = new ArrayList<>(cmd); this.masks = masks; @@ -1448,7 +1448,7 @@ public abstract class Launcher { @NonNull private final Map envOverrides; - RemoteChannelLaunchCallable(@NonNull String[] cmd, @NonNull Pipe out, @NonNull OutputStream err, + RemoteChannelLaunchCallable(@NonNull String[] cmd, @NonNull Pipe out, @NonNull OutputStream err, @CheckForNull String workDir, @NonNull Map envOverrides) { this.cmd = cmd; this.out = out; @@ -1501,7 +1501,7 @@ public abstract class Launcher { m.overrideExpandingAll(overrides); return m; } - + /** * Debug option to display full current path instead of just the last token. */ diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index 99313e18c7..395b32bf6f 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -219,7 +219,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas private enum PMConstructor { JENKINS { @Override - @NonNull + @NonNull PluginManager doCreate(@NonNull Class klass, @NonNull Jenkins jenkins) throws ReflectiveOperationException { return klass.getConstructor(Jenkins.class).newInstance(jenkins); @@ -1090,7 +1090,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas } return null; } - + /** * Retrieves input stream for the Manifest url. * The method intelligently handles the case of {@link JarURLConnection} pointing to files within JAR. @@ -1103,11 +1103,11 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas URLConnection uc = url.openConnection(); InputStream in = null; // Magic, which allows to avoid using stream generated for JarURLConnection. - // It prevents getting into JENKINS-37332 due to the file descriptor leak + // It prevents getting into JENKINS-37332 due to the file descriptor leak if (uc instanceof JarURLConnection) { final JarURLConnection jarURLConnection = (JarURLConnection) uc; final String entryName = jarURLConnection.getEntryName(); - + try(JarFile jarFile = jarURLConnection.getJarFile()) { final JarEntry entry = entryName != null && jarFile != null ? jarFile.getJarEntry(entryName) : null; if (entry != null) { @@ -1121,16 +1121,16 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas url); } } - } + } // If input stream is undefined, use the default implementation if (in == null) { in = url.openStream(); } - + return in; } - + /** * Retrieves modification date of the specified file. * The method intelligently handles the case of {@link JarURLConnection} pointing to files within JAR. @@ -1141,7 +1141,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas @NonNull /*package*/ static long getModificationDate(@NonNull URL url) throws IOException { URLConnection uc = url.openConnection(); - + // It prevents file descriptor leak if the URL references a file within JAR // See JENKINS-37332 for more info // The code idea is taken from https://github.com/jknack/handlebars.java/pull/394 @@ -1160,7 +1160,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas } } } - + // Fallbak to the default implementation return uc.getLastModified(); } @@ -1347,7 +1347,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas public static boolean isNonMetaLabel(String label) { return !("adopt-this-plugin".equals(label) || "deprecated".equals(label)); } - + @Restricted(NoExternalUse.class) public HttpResponse doPluginsSearch(@QueryParameter String query, @QueryParameter Integer limit) { List plugins = new ArrayList<>(); @@ -1458,10 +1458,10 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas JSONArray mappedPlugins = new JSONArray(); mappedPlugins.addAll(plugins); - + return hudson.util.HttpResponses.okJSON(mappedPlugins); } - + /** * Get the list of all plugins - available and installed. * @return The list of all plugins - available and installed. @@ -1532,9 +1532,9 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas return new HttpRedirect("./sites"); } - + /** - * Called to progress status beyond installing plugins, e.g. if + * Called to progress status beyond installing plugins, e.g. if * there were failures that prevented installation from naturally proceeding */ @RequirePOST @@ -1651,7 +1651,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas index = n.indexOf('.', index + 1); } } - + if (p == null) { throw new Failure("No such plugin: " + n); } diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index 0e417f3d67..fb555cbaf9 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -1,19 +1,19 @@ /* * The MIT License - * + * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, * Yahoo! Inc., Erik Ramfelt, Tom Huybrechts - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -168,7 +168,7 @@ public class PluginWrapper implements Comparable, ModelObject { * The snapshot of {@code disableFile.exists()} as of the start up. */ private final boolean active; - + private boolean hasCycleDependency = false; private final List dependencies; @@ -384,11 +384,11 @@ public class PluginWrapper implements Comparable, ModelObject { /** * Inject the specified jar file(s) to the plugins classpath. *

Warning: This is advanced usage that you should not be needed in 99.9% of all cases, any jar insertion - * should happen early into the plugins lifecycle to prevent classloading issues in dependent plugins. + * should happen early into the plugins lifecycle to prevent classloading issues in dependent plugins. *

* Rather than use this functionality it is to have co-operative behaviour between any consumer of the libraries and load the classes in a separate {@link ClassLoader}. * you can expose third-party libraries from a dynamic location in various ways, such as: - * + * *