Commit Graph
77 Commits
Author SHA1 Message Date
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
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
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
Kohsuke Kawaguchi 3a1447ea9a Updating the URL. 2011-01-30 23:44:52 -08:00
Kohsuke Kawaguchi 8ea876faa4 Honor $JENKINS_HOME.
Honor $JENKINS_HOME (just like we used to do $HUDSON_HOME)
We still fall back to $HUDSON_HOME every step of the way
for maximum backward compatibility.

I wasn't initially planning to do this for the first version,
but working on native packages made me think we should deliver this.
2011-01-30 16:25:58 -08:00
Kohsuke Kawaguchi 4e620598f3 Revert "Removed unused import."
This reverts commit becb2768bd.

Conflicts:

	core/src/main/java/hudson/init/InitializerFinder.java
	core/src/main/java/hudson/matrix/AxisList.java

While looking at PollingResult I noticed that import statements used in
javadoc are removed.
2011-01-06 13:07:51 -08:00
sogabe becb2768bd Removed unused import.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34177 71c3de6d-444a-0410-be80-ed276b4c234a
2010-08-27 18:30:35 +00:00
mindless bc62545c33 just use LOGGER instead of local logger var
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@28442 71c3de6d-444a-0410-be80-ed276b4c234a
2010-03-09 02:12:50 +00:00
kohsuke cf22345820 [FIXED HUDSON-4820] Fallback gracefully if JNA is not available.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@24103 71c3de6d-444a-0410-be80-ed276b4c234a
2009-11-25 23:21:17 +00:00
kohsuke 5f7c8023a7 Gracefully detect the double loading of JNA instead of failing later with NoClassDefFoundError.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23864 71c3de6d-444a-0410-be80-ed276b4c234a
2009-11-19 22:24:43 +00:00
mindless 9fed9823f5 Add @Override annotations, remove unused imports,
add some copyright headers, some tab->ws


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21654 71c3de6d-444a-0410-be80-ed276b4c234a
2009-09-14 18:08:34 +00:00
kohsuke 1447affed5 fixed a compilation error
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19072 71c3de6d-444a-0410-be80-ed276b4c234a
2009-06-19 20:54:39 +00:00
kohsuke 6815e73ca7 introduced a new scheme to the form field validation, that makes the check feel more like a function.
Using it in a few places to begin with

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16459 71c3de6d-444a-0410-be80-ed276b4c234a
2009-03-22 18:56:36 +00:00
kohsuke 72242fcddf Merged revisions 16380-16381,16433,16435,16438 via svnmerge from
https://www.dev.java.net/svn/hudson/branches/rc

........
  r16380 | kohsuke | 2009-03-19 17:10:38 -0700 (Thu, 19 Mar 2009) | 1 line
  
  PeriodicWork change broke the tests, because the timer registration wasn't kicking in
........
  r16381 | kohsuke | 2009-03-19 17:33:14 -0700 (Thu, 19 Mar 2009) | 1 line
  
  fixed a test so that it's no longer timing sensitive
........
  r16433 | kohsuke | 2009-03-20 18:35:55 -0700 (Fri, 20 Mar 2009) | 1 line
  
  [maven-release-plugin] prepare release hudson-1_293
........
  r16435 | kohsuke | 2009-03-20 18:36:21 -0700 (Fri, 20 Mar 2009) | 1 line
  
  [maven-release-plugin] prepare for next development iteration
........
  r16438 | kohsuke | 2009-03-20 19:10:29 -0700 (Fri, 20 Mar 2009) | 1 line
  
  updated changelog as a part of the release
........


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16441 71c3de6d-444a-0410-be80-ed276b4c234a
2009-03-21 02:14:25 +00:00
kohsuke 5cf28bc2eb Proactively work around bug 6276483 by removing SunPKCS11-Solaris security provider.
See http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6276483
and http://hudson.gotdns.com/wiki/display/HUDSON/Solaris+Issue+6276483

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15292 71c3de6d-444a-0410-be80-ed276b4c234a
2009-02-13 17:25:14 +00:00
kohsuke 1a1d0d74d5 license header clean up
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15081 71c3de6d-444a-0410-be80-ed276b4c234a
2009-02-06 20:05:24 +00:00
kohsuke a06e8a05c1 - introduced adjuncts from stapler
- fixed the feature envy problem in the version computation

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14052 71c3de6d-444a-0410-be80-ed276b4c234a
2008-12-31 19:46:02 +00:00
kohsuke ce015a9c85 [FIXED HUDSON-2770] resurrected the awtProblem as boolean.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13837 71c3de6d-444a-0410-be80-ed276b4c234a
2008-12-24 18:11:44 +00:00
kohsuke bf096266b9 If AWT doesn't work, Hudson reports an error now.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13812 71c3de6d-444a-0410-be80-ed276b4c234a
2008-12-23 03:10:41 +00:00
kohsuke a9a6d17e55 unused imports
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11598 71c3de6d-444a-0410-be80-ed276b4c234a
2008-08-18 21:04:29 +00:00
kohsuke 770a2badbd this class is not meant for sub-classing
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11303 71c3de6d-444a-0410-be80-ed276b4c234a
2008-08-06 21:14:41 +00:00
kohsuke b355a8c741 no need to have the initialization code in a separate place.
This should fix the unit test failures in twitter4j I'm seeing at:

-------------------------------------------------------------------------------
Test set: hudson.plugins.twitter.ShouldIncludeURLTest
-------------------------------------------------------------------------------
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.389 sec <<< FAILURE!
testTrueInDescriptor(hudson.plugins.twitter.ShouldIncludeURLTest)  Time elapsed: 0.358 sec  <<< ERROR!
java.lang.ExceptionInInitializerError
	at hudson.plugins.twitter.ShouldIncludeURLTest.setUp(ShouldIncludeURLTest.java:41)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
	at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
	at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
	at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
	at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
	at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
	at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
	at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
	at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
	at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.lang.NullPointerException
	at hudson.model.Queue$MaintainTask.<init>(Queue.java:928)
	at hudson.model.Queue.<init>(Queue.java:195)
	at hudson.model.Hudson.<init>(Hudson.java:144)
	at hudson.plugins.twitter.HudsonUtil.<clinit>(HudsonUtil.java:32)
	... 25 more


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10993 71c3de6d-444a-0410-be80-ed276b4c234a
2008-07-24 15:59:29 +00:00