In addition to cluttering the namespace, unused imports generate
compiler warnings, introducing noise and obscuring more important
compiler warnings. This change removes them.
This launcher Allows subclasses to only implement methods they want to override.
Originally, this launcher has been implemented in Custom Tools Plugin, but there are many duplicates in other plugins => it would be useful to have it in Jenkins core.
Resolves https://issues.jenkins-ci.org/browse/JENKINS-19454
Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>
(Should this field be made a [LinkedHash]Map<String,String> or even EnvVars?
It is protected in a final class, so effectively package-private, thus not a b/w compat issue.)
This allows us to pass in a proper Launcher that handles all the environment variables without asking individual user to fill in a proper environment variables
I added a mode where one can launch a child process without the built-in pumping support, making it trivial to read until EOF in the distributed environments.
This concludes the fix.
Exception:
Stacktrace:
java.lang.NullPointerException: out is null
at hudson.util.StreamCopyThread.(StreamCopyThread.java:44)
at hudson.util.StreamCopyThread.(StreamCopyThread.java:51)
at hudson.Proc$LocalProc.(Proc.java:150)
at hudson.Proc$LocalProc.(Proc.java:121)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:633)
at hudson.Launcher$ProcStarter.start(Launcher.java:268)
at hudson.Launcher$ProcStarter.join(Launcher.java:275)
at hudson.plugins.script_realm.ScriptSecurityRealm.authenticate(ScriptSecurityRealm.java:62)
at hudson.security.AbstractPasswordBasedSecurityRealm$Authenticator.retrieveUser(AbstractPasswordBasedSecurityRealm.java:137)
at org.acegisecurity.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:119)
at org.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:195)
at org.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:45)
at org.acegisecurity.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:71)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:252)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
at java.lang.Thread.run(Thread.java:637)
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29867 71c3de6d-444a-0410-be80-ed276b4c234a