* [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.
* 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
- 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
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.
- 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.
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)
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)
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.
* 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