Commit Graph
13449 Commits
Author SHA1 Message Date
Basil Crow 2bae452ede Replace identical catch blocks with multi-catch 2020-12-11 21:34:22 -08:00
Basil Crow ba4c184daf Replace equals() expressions with Objects#equals() where possible 2020-12-11 21:34:22 -08:00
Basil Crow 88a5bafe16 Use Java 5 for-each loops where possible 2020-12-11 21:34:22 -08:00
Basil Crow 5d66c1a36e Remove unnecessary calls to Throwable#initCause() 2020-12-11 21:34:22 -08:00
Basil Crow 04f68995ce Remove unnecessary try/catch statement 2020-12-11 21:34:22 -08:00
Basil Crow 81bbfea719 Remove redundant close() statements 2020-12-11 21:34:22 -08:00
Basil Crow 2278d3ae27 Remove unnecessary interface modifiers 2020-12-11 20:50:51 -08:00
Basil Crow ddf216d3f7 Remove redundant "extends Object" 2020-12-11 20:50:24 -08:00
Basil Crow ef252ef956 Use Java-style arrays rather than C-style arrays 2020-12-11 20:49:47 -08:00
Raihaan Shouhellandres0nance 4db7028e2e Avoid calling task.getCauseOfBlockage() twice (#5103)
Co-authored-by: res0nance <res0nance@users.noreply.github.com>
2020-12-11 16:27:28 +00:00
Tim Jacomb 09307ea116 JENKINS-64196 Move PluginManager available page to client side (#5051)
* Move PluginManager available to client side

* Fix in IE

* Address feedback from ux-sig demo

* Add handlebars module

* Handlebars plugin manager

* Update core/src/main/java/hudson/model/UpdateCenter.java

* Remove import

* Fix input

* Remove debug

* Use rest client

* Fix bug

* Move properties to right location

* Cleanup

* Use lodash debounce

* Revert properties change

* Fmt

* Rank exact matches at the top

* Set locale

* Spotbugs

* ignore case in nicer way

* Sorting improvements
2020-12-08 07:29:21 +00:00
Rahul Reddy 1188566b66 Replace() optimization (#5095)
* Update MaskingClassLoader.java

Using the correct replace method
Modified the replace() with Character parameter for optimization

* Update LineEndingConversion.java

Using the correct replace method
Modified the replace(String, String) to replace(char, char) for optimization

* Update Icon.java

Using the correct replace method
Modified the replace() with Character parameter for optimization
2020-12-04 21:14:25 +08:00
Tim JacombandJesse Glick ec1fabc35f Inline icon-set lib (#5072)
* Inline icon-set lib

* Add @since 2.0

Co-authored-by: Jesse Glick <jglick@cloudbees.com>

* Downgrade iconset to 1.0.5 version

* Fix javadoc

* Missed one javadoc error

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
2020-12-01 07:24:42 +00:00
Daniel BeckandDaniel Beck c29640b16f Mark some more administrative monitors as security-related (#5079)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2020-11-29 09:19:35 +00:00
Jesse Glick 1577d66b08 Deprecate FileSystemProvisioner (#5048) 2020-11-29 09:19:16 +00:00
418fb5b565 Hacktoberfest - ParametersDefinition add equals and hashCode (#5014)
Co-authored-by: Zbynek Konecny <zbynek1729@gmail.com>
Co-authored-by: Ilya Gulyaev <ilya.gulyaev@nordigy.ru>
Co-authored-by: Raihaan Shouhell <raihaanhimself@gmail.com>
2020-11-26 09:01:11 +00:00
44c59a6f5c Load admin monitors popup content via ajax (#5063)
* Admin monitors popup is now loaded through an API

* Fixes form submission inside the popup

- Wraps it in an l:ajax template so that proper variables are set
- Applies the csrf crumbs to the forms after the popup is constructed

* Handle authorization and empty state

* Apply suggestions from code review

Co-authored-by: Tim Jacomb <timjacomb1+github@gmail.com>

* Fix JS error where there were monitors of only one kind

* Revert changes to indentation of inline JS

* Clarify ESC keyCode with a comment

* Update core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/resources.js

Co-authored-by: Tim Jacomb <timjacomb1+github@gmail.com>

* Multiple small adjustments

- Remove unused imports
- Remove non-necessary call for the response that are set in the getView
- Keep the previous improvement about limiting the number of call to getMonitorList()

Co-authored-by: Tim Jacomb <timjacomb1+github@gmail.com>
Co-authored-by: Wadeck Follonier <wadeck.follonier@gmail.com>
2020-11-26 09:38:43 +01:00
15cfddf2a7 JENKINS-1877 Add ability to specify shut down reason (#4274)
Co-authored-by: Oleg Nenashev <o.v.nenashev@gmail.com>
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
Co-authored-by: Tim Jacomb <t.jacomb@kainos.com>
Co-authored-by: Ilya Zasimov <austry@yandex-team.ru>
2020-11-17 09:44:16 +00:00
Wadeck FollonierandFélix Queiruga bd59971eac [JENKINS-63977] Separate security / non-security admin monitors (#5015)
Co-authored-by: Félix Queiruga <felix.queiruga@gmail.com>
2020-11-17 09:43:37 +00:00
Josh Soref 6c6d787f26 [JENKINS-41891] Resource root url cleanup (#4294) 2020-11-09 22:15:01 +00:00
Oleg Nenashev 7657ae3f6e Merge pull request #5008 from aHenryJard/JENKINS-62446_casc
[JENKINS-62446] adding CasC compatibility to Global tool > Global Maven
2020-11-09 10:40:19 +01:00
Jesse GlickandBasil Crow 77f24bfb9a [JEP-228] Unforking XStream (#4944)
* Unforking XStream

* Some overrides missing from MapperDelegate

* [XSTR-762] writeReplace & readResolve must be accessible to be used from subclasses

* DomElement.click overloads changed incompatibly

* Giving up on ToolInstallation being Serializable.
Fixing MavenInstallation accordingly.
AntInstallation was already fixed: https://github.com/jenkinsci/ant-plugin/commit/c957dca4cd7789e3918e90ae020687aeaeea998e

* Relaxing message assertion in RobustReflectionConverter.randomExceptionsReported

* Picking up https://github.com/jenkinsci/matrix-auth-plugin/pull/89 caught via JobTest

* https://github.com/jenkinsci/jenkins-test-harness/pull/243 released

* Another case forgotten in 0e5aeec4cc

* XStream has SecurityMapper, but we have our own system already, so suppress warning

* GetMavenVersion was also serializing its outer class

* Trying to make ToolInstallation serializable compatible

* Avoid throwing IOException from PersistedList.inModified for common cases covered by https://github.com/jenkinsci/jenkins-test-harness/pull/243

* Found a way to avoid looking up XStream.converterRegistry by reflection

* XStream2Test.crashXstream now throwing ConversionException, not ForbiddenClassException

* Noting which version of the parent POM has https://github.com/jenkinsci/jenkins-test-harness/pull/243

* Refreshed Javadoc for XStream2

* The simplest solution to JENKINS-19561 seems to be to stop using autodetectAnnotations

* Fixing some deprecations in Robust*Converter

* Display OldDataMonitor errors from RobustReflectionConverter during functional tests

* Stray digit in test name

* Added XStream2AnnotationTest to clearly document incompatibility

* Picking up release of https://github.com/jenkinsci/matrix-auth-plugin/pull/89

Co-authored-by: Basil Crow <me@basilcrow.com>

Co-authored-by: Basil Crow <me@basilcrow.com>
2020-11-06 15:03:23 -06:00
a9ca5ef3d4 [JEP-227] Replace Acegi Security with Spring Security & upgrade Spring Framework (#4848)
Replacing Acegi Security with Spring Security

Co-authored-by: Tim Jacomb <timjacomb1+github@gmail.com>
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
2020-11-06 11:30:25 -07:00
Oleg Nenashev 748e8b2b2d Merge pull request #5028 from Wadeck/JENKINS-60563_consistent_hash
[JENKINS-60563] Replace MD5 with SHA-256 in ConsistentHash
2020-11-06 12:00:07 +01:00
Jesse Glick 04c46dcfac Simplified IdentityRootAction.getFingerprint 2020-11-03 16:28:40 -05:00
Wadeck FollonierandJesse Glick 9c256ad830 Restriction mistake on TokenUuidAndPlainValue (#5041)
* Restriction mistake on TokenUuidAndPlainValue

* Update core/src/main/java/jenkins/security/apitoken/TokenUuidAndPlainValue.java

Co-authored-by: Jesse Glick <jglick@cloudbees.com>

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
2020-11-03 07:41:01 +01:00
Oleg Nenashev d03b8cfdff Merge pull request #5039 from jglick/UnbufferedBase64InputStream
Deprecating UnbufferedBase64InputStream
2020-11-02 12:03:25 +01:00
Raihaan Shouhellandres0nance 1a0a4809f1 [JENKINS-63899] Fix renaming items with non-latin characters and spaces (#5037)
* URLencode item names in url during rename

* Fix redirects with spaces

Co-authored-by: res0nance <res0nance@users.noreply.github.com>
2020-11-01 10:47:27 +08:00
Jesse Glick b40f70e3d8 XMLUtils should parse via InputStream not Reader (#5026) 2020-11-01 10:46:55 +08:00
Raihaan Shouhell 0dd54dc5ed Merge pull request #5027 from gulyaev13/charsets-replacement
Hacktoberfest - Use StandardCharsets except deprecated Charsets from Apache Commons
2020-11-01 10:46:18 +08:00
Jesse Glick ed3a3e05af Deprecating UnbufferedBase64InputStream 2020-10-30 13:54:20 -04:00
Raihaan Shouhell e7e7edc8aa Merge pull request #5035 from jtnord/JENKINS-64039
[JENKINS-64039] improve CaseInsensitive.equals(String, String) performance
2020-10-29 10:36:35 +08:00
Raihaan Shouhell cb9d4821c3 Merge pull request #5029 from Wadeck/Queue_cleanup
Queue (mainly) style consistency
2020-10-29 10:36:09 +08:00
Ilya Gulyaev 72d750e8bb Remove JDK class StandardCharsets from classpath 2020-10-28 23:40:19 +03:00
Tim Jacomb f4942b3bc4 Merge pull request #5022 from darinpope/trim-admin-address
Hacktoberfest: trim the adminAddress before saving
2020-10-26 20:25:10 +00:00
James Nord 2cd33a184f [JENKINS-64039] improve CaseInsensitive.equals(String, String) performance
The CaseInsensitive IdStrategy would always do a full string comparison
even when all that was required was an equivallence check.

updated the javadoc to clarify performance implications for subclasses
and fix the performance of the CaseInsensitive strategy
2020-10-26 17:34:24 +00:00
Oleg Nenashev 7b952de6c6 Merge pull request #5010 from jeffret-b/jenkinsAgentJnlp
[JENKINS-35452] A step towards removing more 'slave' terminology.
2020-10-26 13:48:53 +01:00
Oleg Nenashev 6e14a7ecec Merge pull request #5013 from oleg-nenashev/bug/JENKINS-63868
[JENKINS-63868] - Prevent the Build History Widget from exploding when user have Discover permissions without Read for folders
2020-10-26 10:49:15 +01:00
Wadeck Follonier 3c957df2c0 Use import for Permission. 2020-10-24 20:34:07 +02:00
Wadeck Follonier 3320cf6a44 Queue (mainly) style consistency
- Removal of null check, while annotation + ecosystem search proves it's never occurring
- Small code style
- Cleanup of tab vs spaces
2020-10-24 18:36:19 +02:00
Wadeck Follonier 30f6514935 [JENKINS-60563] Replace MD5 with SHA-256 in ConsistentHash
- Also update outdated link
- Reformat some of the code
- Adjust the tests
- Ignore the performance test
- Correct typos
2020-10-24 18:05:24 +02:00
Ilya Gulyaev d40399f309 Use StandardCharsets except deprecated Charsets from Apache Commons 2020-10-24 01:08:41 +03:00
Darin Pope 0ed2cc8b9b trim the adminAddress before saving
Signed-off-by: Darin Pope <darin@planetpope.com>
2020-10-21 14:29:57 -04:00
Jeff Thompson e0990b4b6c Add tests for downloading JNLP file at new and obsoleted names. 2020-10-19 14:47:36 -06:00
gulyaev13andIlya Gulyaev 642940f594 Hacktoberfest - TcpSlaveAgentListener optimization (#5012)
* TcpSlaveAgentListener.ConnectionHandler.run: Move allocation of output Writer to error method

* TcpSlaveAgentListener.ConnectionHandler.error: Replace PrintWriter to DataOutputStream

* TcpSlaveAgentListener.ConnectionHandler.respondHello: Replace OutputStreamWriter by DataOutputStream to avoid allocation of big buffer

* TcpSlaveAgentListener.ConnectionHandler.run: Replace Charsets to StandardCharsets

* TcpSlaveAgentListener.ConnectionHandler: Fix encoding of response

* TcpSlaveAgentListener: Remove unused imports

Co-authored-by: Ilya Gulyaev <ilya.gulyaev@nordigy.ru>
2020-10-19 19:38:19 +02:00
gulyaev13andIlya Gulyaev f2b3cce5aa Hacktoberfest - Optimize allocations in LogRotator and RunList (#5011)
* RunList.subList: Reduce allocations in internal ArrayList

* LogRotator.perform: Remove copy of already new instance from subList

* LogRotator.perform: Change List to RunList for strict new List instance in builds.subList

* LogRotator: Remove unused imports

Co-authored-by: Ilya Gulyaev <ilya.gulyaev@nordigy.ru>
2020-10-19 19:37:49 +02:00
Oleg Nenashev 7ccf1ba040 [JENKINS-63868] - Prevent the Build History Widget from exploding when user have Discover permissions without Read for folders 2020-10-17 16:06:15 +02:00
Tim Jacomb da1780f975 Merge pull request #4961 from StefanSpieker/spotbugs 2020-10-17 08:47:33 +01:00
Tim Jacomb 65010aea57 Merge pull request #4981 from res0nance/tied-jobs-count
Simplify code for tied jobs count
2020-10-17 08:47:15 +01:00
Peter Jonsson 711ef4e79e Prevent resource leak in FileFingerprintStorage (#4992) 2020-10-17 08:46:34 +01:00