Commit Graph
96 Commits
Author SHA1 Message Date
Stephen Connolly f0cd7ae8ff [JENKINS-42934] Avoid using new FileInputStream / new FileOutputStream 2017-03-20 12:50:46 +00:00
Oleg Nenashev 579a88d6e7 Merge branch 'JENKINS-32820' of https://github.com/atcarmo/jenkins into bug/JENKINS-32820
Conflicts:
	core/src/main/java/hudson/WebAppMain.java
	core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java
	core/src/main/java/hudson/lifecycle/UnixLifecycle.java
2017-02-12 13:50:52 +03:00
Josh Soref 496703d0fe Spelling fixes in changelogs, Javadoc, logs and UI (#2718)
* spelling: abstract

* spelling: about

* spelling: absolute

* spelling: across

* spelling: activity

* spelling: actually

* spelling: addition

* spelling: allocating

* spelling: ambiguous

* spelling: analyzes

* spelling: analysis

* spelling: another

* spelling: appear

* spelling: arbitrary

* spelling: artifact

* spelling: assignment

* spelling: associated

* spelling: augment

* spelling: authentication

* spelling: automatically

* spelling: available

* spelling: availability

* spelling: because

* spelling: background

* spelling: beginning

* spelling: boolean

* spelling: browsers

* spelling: building

* spelling: calculation

* spelling: channel

* spelling: column

* spelling: concatenation

* spelling: connect

* spelling: contribute

* spelling: convert

* spelling: copied

* spelling: couldn't

* spelling: scrambled

* spelling: creates-a

* spelling: curr-entry

* spelling: customize

* spelling: diagnostic

* spelling: contain

* spelling: default

* spelling: delimiter

* spelling: descriptor

* spelling: disambiguates

* spelling: different

* spelling: diligently

* spelling: disabled

* spelling: discovered

* spelling: display

* spelling: doesn't

* spelling: dollar

* spelling: downstream

* spelling: dynamically

* spelling: preemptively

* spelling: encrypt

* spelling: erroneous

* spelling: examine

* spelling: existence

* spelling: value

* spelling: february

* spelling: handling

* spelling: hostname

* spelling: convenient

* spelling: identify

* spelling: implementation

* spelling: incorrect

* spelling: individual

* spelling: initialization

* spelling: initialized

* spelling: inputstream

* spelling: instantiated

* spelling: instantiation

* spelling: intended

* spelling: interpreted

* spelling: interrupted

* spelling: invocations

* spelling: kern

* spelling: localization

* spelling: logger

* spelling: malfunctioning

* spelling: methods

* spelling: monitor

* spelling: mutator

* spelling: multiple

* spelling: object

* spelling: configured

* spelling: optionally

* spelling: option

* spelling: overridden

* spelling: parameterized

* spelling: parent

* spelling: permissions

* spelling: plugin

* spelling: potentially

* spelling: preferable

* spelling: problems like

* spelling: programmatically

* spelling: property

* spelling: reallocate

* spelling: recommended

* spelling: redirected

* spelling: registered

* spelling: reliable

* spelling: remember

* spelling: recurrence

* spelling: repeatable

* spelling: repeated

* spelling: resource

* spelling: retrieve

* spelling: returned

* spelling: revision

* spelling: sandwich

* spelling: separator

* spelling: serialization

* spelling: settings

* spelling: shadow

* spelling: should

* spelling: someone

* spelling: source

* spelling: specified

* spelling: style

* spelling: subversion

* spelling: sufficient

* spelling: supplementary

* spelling: suppressing

* spelling: synchronization

* spelling: synchronized

* spelling: this

* spelling: transitioning

* spelling: termination

* spelling: trying

* spelling: truncatable

* spelling: unknown

* spelling: undeployed

* spelling: unnecessary

* spelling: unparseable

* spelling: update

* spelling: upper

* spelling: verify

* spelling: visible

* spelling: warning

* spelling: we're

* spelling: whitespace

* spelling: wide

* spelling: with

* spelling: workspace

* spelling: yielding

* spelling: to

* spelling: by

* spelling: the

* spelling: hours
2017-02-12 13:38:30 +03:00
Oliver Gondža 7f6f495f86 Avoid deprecated findbugs annotations (#2144)
* Avoid deprecated findbugs annotations

* One more forgotten annotation
2016-10-15 12:53:56 -07:00
Yoann Dubreuil 27d9b73ef4 [JENKINS-35184] Servlet API dependent bits in a inner-class (#2551)
* [JENKINS-35184] Servlet API dependent bits in a inner-class

This is in order to avoid loading ServletContextListener class
from slaves classloader.

* [JENKINS-35184] Don't use SystemProperties while initializing remote agents

This rolls back the previous commit and introduces a new way to construct
RingBufferLogHandler which avoids relying on SystemProperties to get the
default size.

* [JENKINS-35184] Mark SystemProperties as OnMaster only class

Adding `OnMaster` annotation does not prevent the class from being
loaded on remote agent but it gives a hint that this class should not
be used on a remote agent.

* [JENKINS-35184] Set SLAVE_LOG_HANDLER at the very beginning

In the previous code cleaning existing log handlers, SLAVE_LOG_HANDLER
is always null, as static fields are scoped by classloader.
2016-09-21 10:39:52 +02:00
Stephen Connolly 0203504a2c [FIXED JENKINS-36494] Switch to a try with resources form of impersonation 2016-07-07 11:46:45 +01:00
evernat 65f2a4a406 [JENKINS-34755] fix read of 'SystemProperties' values before init of the context (#2347)
* fix read of 'SystemProperties' values before init of the context

* fix constructor and test

* revert help-spec_fr.html

* revert help-spec_fr.html

* revert help-spec_fr.html
2016-05-15 16:31:23 +02:00
Oleg Nenashev ce8922bd74 Merge branch 'master' into JENKINS-34755
Conflicts:
	core/src/main/java/hudson/Util.java
	core/src/main/java/hudson/WebAppMain.java
	core/src/main/java/hudson/model/Item.java
	core/src/main/java/hudson/model/Queue.java
	core/src/main/java/hudson/model/UpdateCenter.java
	core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java
	core/src/main/java/hudson/slaves/NodeProvisioner.java
	core/src/main/java/jenkins/model/Jenkins.java
	core/src/main/java/jenkins/slaves/NioChannelSelector.java
	core/src/main/java/jenkins/util/xml/XMLUtils.java
2016-05-12 12:05:24 +02:00
Kohsuke Kawaguchi f238ade13e Merge pull request #2177 from jenkinsci/2nd-reactor
Don't go through init sequence twice
2016-05-02 08:49:32 -07:00
Kohsuke Kawaguchi 808c44c8e3 Treat any interruption during boot as a fatal failure 2016-04-26 17:53:41 -07:00
Sam Van Oort 543b947e79 Fix [JENKINS-34281] by running shutdown as system user
Replicates the key bit of dad9b04422
But does not include the likely-unneeded ACL.SYSTEM change before System.exit(0)
2016-04-20 18:00:10 -04:00
Baptiste Mathus 8b3e4f43a2 Multi-catch refactoring when applicable 2016-04-12 10:17:42 +02:00
Daniel Beck 869f66cc07 Merge branch 'master' of github.com:jenkinsci/jenkins into 2.0
Conflicts:
	changelog.html
	cli/pom.xml
	core/pom.xml
	core/src/main/java/hudson/ProxyConfiguration.java
	core/src/main/java/jenkins/model/Jenkins.java
	core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java
	core/src/main/resources/hudson/model/Messages_da.properties
	pom.xml
	test/pom.xml
	war/pom.xml
2016-03-16 19:00:40 +01:00
Stephen Connolly 373bd8390c Merge remote-tracking branch 'jenkins/master' into alt-pr-2090 2016-03-09 12:31:28 +00:00
Stephen Connolly f68f5fb24f [FIXED JENKINS-33414] Added an API to allow identification of the Jenkins JVM
- Fix the ProxyConfiguration code to not require Jenkins class to be loaded in remote JVMs
2016-03-08 23:05:00 +00:00
Stephen Connolly 96150d3a46 Jenkins.getInstance() will be @Nonnull in Jenkins 2.0+
- Code that is running from a plugin and on the master's JVM is guaranteed to never get null from this method (any cases where you do get null are bugs in core)
- Code that is running from a plugin and on a remote JVM should never be allowed to load the Jenkins class in their classloader, so should never use Jenkins.getInstance()... we are annotating the method with @Nullable so that such code can have some evolution time
- Code that is running in core and on one of two special paths should use the Jenkins.getInstanceOrNull() method so that the UI can be presented to users before the singleton has been instantiated / after the singleton has been destroyed
- The remaining 95% of uses in core (and 100% of uses in plugins) can safely assume that the instance is never null
2016-03-08 21:15:43 +00:00
Stephen Connolly d1dfbd2baf Revert "Jenkins.getInstance() should be non-null"
This reverts commit bb7c8fcedb.

Closes #2090, I'll redo this as a PR... though if that PR is subject to multiple rounds of review before being merged then I will take that of evidence of the exact problem that committing directly was supposed to resolve... namely exponentially multiplying the effort required to make actual improvements to the code base.
2016-03-08 21:09:28 +00:00
Stephen Connolly bb7c8fcedb Jenkins.getInstance() should be non-null
- It is never too late to do the right thing.
- The vast majority of usages of `Jenkins.getInstance()` in core currently assume that its return value is non-null
- This commit changes those that are written to correctly check for non-null values will call `Jenkins.getInstanceOrNull()`
- We deprecate the `Jenkins.getActiveInstance()` madness
- I checked with @kohsuke who said not to bother with a PR and just commit this strongly opinionated change direct to master as a PR will just degrade into a bikeshedding.
2016-03-07 22:08:36 +00:00
Kohsuke Kawaguchi f286bc27bd With servlet 3.0 this is a better place to set this config 2016-02-27 10:40:15 -08:00
Kohsuke Kawaguchi 8713646a47 [JENKINS-23378] Servlet 3.1
Start declaring servlet 3.1 dependency
2016-02-25 08:03:49 -08:00
atcarmo 6bb2be8225 The cleanUp() call was in the wrong position. I've put it in the beginning of the method. 2016-02-10 14:38:52 +00:00
atcarmo 1c94716002 CleanUp() call during restart() is now surrounded but try/catch, which allows the restart to continue if the cleanUp() method fails. 2016-02-10 12:53:39 +00:00
Jesse Glick 54374fc2b6 If the initialization thread is interrupted by contextDestroyed, make that clear.
Otherwise get a meaningless error:
java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:502)
    at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:267)
    at jenkins.InitReactorRunner.run(InitReactorRunner.java:44)
    at jenkins.model.Jenkins.executeReactor(Jenkins.java:915)
    at jenkins.model.Jenkins.<init>(Jenkins.java:814)
    at hudson.model.Hudson.<init>(Hudson.java:83)
    at hudson.model.Hudson.<init>(Hudson.java:79)
    at hudson.WebAppMain$3.run(WebAppMain.java:225)
2015-12-09 13:54:08 -05:00
Johannes Ernst 9303136c9d Incorporated pull request feedback:
* moved to jenkins.util.SystemProperties
* consistent naming getString/getInteger/getBoolean
* improved code formatting
Improved JavaDoc
2015-11-18 18:26:41 +00:00
Johannes Ernst 709fe5b9aa Allow setting of system properties from context.xml in addition to setting from command-line.
Accomplished by centralizing calls to System.getProperty(String) and related into new file SystemProperties.java.
There, we first check for existence of system property; if not, we look for property in context.xml
This is done for "application" properties (like hudson.DNSMultiCast.disabled) but not for java properties (like user.name)
2015-11-17 01:38:51 +00:00
Kohsuke Kawaguchi 582128b9ac [FIXED JENKINS-25019]
A truly conforming servlet 3.0 container does not allow us to set "secure cookie" flag beyond ServletContextListener.onInitialized().
If we see that, don't scare the users.
2014-10-16 19:23:23 -07:00
Kohsuke Kawaguchi 3b0e6ac02a [JENKINS-20609] test case 2013-11-16 12:56:28 -08:00
Kohsuke Kawaguchi 0c5338dff2 expose additional variables 2013-11-16 11:09:07 -08:00
Kohsuke Kawaguchi 729d41cfe8 [FIXED JENKINS-20609]
Implemented the hook
2013-11-16 10:24:21 -08:00
Jesse Glick 010d9e9067 [FIXED JENKINS-18959] /log/all should not show FINE messages from custom loggers. 2013-07-26 17:20:32 -04:00
Kohsuke Kawaguchi 6badbb3227 Added the error handling screen
This page gets displayed when we throw an unhandled exception.
2013-06-24 10:49:46 -07:00
Jesse Glick e66a94868a [JENKINS-16952] contextDestroyed needs to be changed to match. 2013-06-10 12:48:31 -04:00
Jesse Glick 3a0126f780 [FIXED JENKINS-16952] Not all log messages were being captured at /log/all. 2013-02-25 14:13:01 -05:00
Jesse Glick 769692cd80 Unused imports. 2012-09-05 13:05:33 -04:00
Kohsuke Kawaguchi 8f39483a81 opened up for reuse 2012-03-13 20:31:24 -07:00
Tom Huybrechts cb1248e36b we shouldn't try to agressively load changesets, since they are now lazily loaded
Conflicts:

	core/src/main/java/hudson/WebAppMain.java
2012-01-07 14:31:28 +01:00
Kohsuke Kawaguchi 9522cecfe3 FindBugs bug cleanup 2011-08-23 23:16:53 -07:00
Kohsuke Kawaguchi a4dc8db261 added a logging message that indicates we are done with the boot. 2011-08-09 13:19:20 -07:00
Kohsuke Kawaguchi eea84e5f10 this is meant only for when the bootup fails 2011-07-18 18:26:30 +01:00
Kohsuke Kawaguchi d850715eee Fixed the problem where contextDestroyed() during initialization wasn't
honored correctly.
2011-07-17 08:47:40 +01:00
Kohsuke Kawaguchi 022ab2bac3 also adding Jenkins 2011-07-17 08:47:39 +01:00
Kohsuke Kawaguchi dd7fd2ec65 Jenkins 2011-06-08 18:33:18 -07:00
Nigel Magnay dbe586ce92 Merge remote branch 'origin/master' into momo
* origin/master: (28 commits)
  Need to run install during prepare, or else the release:perform fails miserably.
  Enabled more convenient access to the XSTREAM field
  added a method to help plugins rename classes and still keep backward compatibility
  Rely on released versions
  Test files accidentally crept in.
  modified to use the type-safe tag lib interface.
  Hooking the taglib interface generation.
  [JENKINS-9326] add integration tests with eclipse tycho relocation
  experimenting with the taglib interface generator
  fixed NPE
  Converted a few more pages into Groovy to test the behaviour. Allow global.jelly to be written in Groovy.
  Jenkins
  auto-completes instance and descriptor
  Support global.groovy as well as config.groovy
  A few more Jelly files switched to Groovy as a test
  Looks like a dead code.
  added DSLD for Eclipse
  1.166 shipped
  not specifying the file extension so that different pieces can be implemented by different view technologies
  replaced i18n by '_' since it shows up a lot.
  ...

Conflicts:
	core/src/main/java/hudson/model/Hudson.java
2011-06-07 09:42:28 +01:00
Kohsuke Kawaguchi ca9c4e06aa Jenkins 2011-06-06 12:42:07 -07:00
Nigel Magnay 5679d019ec Move hudson.model.Jenkins to be jenkins.model.Jenkins - part II
Just import changes, from hudson.model.Jenkins -> jenkins.model.Jenkins,
and Javadoc comments.

Signed-off-by: Nigel Magnay <nigel.magnay@gmail.com>
2011-05-29 11:06:28 +01:00
Nigel Magnay 70c1065814 Stage 1 : Create hudson.model.Jenkins, make Hudson derive from Jenkins.
Signed-off-by: Nigel Magnay <nigel.magnay@gmail.com>
2011-05-29 11:00:58 +01:00
Kohsuke Kawaguchi d4db356c1e expose this to plugins 2011-03-01 12:07:25 -08:00
Brian Atkinson 1917efdc33 Clean up unused imports 2011-02-16 19:48:44 -06:00
Jerome Lacoste 42c0bdb703 JENKINS-8658 cleanup. Inner class can be static 2011-02-03 05:38:50 +01:00
Jerome Lacoste 4f857bccb7 JENKINS-8658 let getHomeDir gather information about where it finds its location. Useful for troubleshooting. 2011-02-03 04:47:07 +01:00