提交 7e183a98 编写于 作者: K kohsuke

[FIXED HUDSON-6311] reverted the problematic change and instead introduced the...

[FIXED HUDSON-6311] reverted the problematic change and instead introduced the ideal signature in a new name.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@30287 71c3de6d-444a-0410-be80-ed276b4c234a
上级 d05c3146
...@@ -346,7 +346,7 @@ THE SOFTWARE. ...@@ -346,7 +346,7 @@ THE SOFTWARE.
<dependency> <dependency>
<groupId>org.kohsuke.stapler</groupId> <groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler-jelly</artifactId> <artifactId>stapler-jelly</artifactId>
<version>1.139</version> <version>1.140-SNAPSHOT</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>commons-jelly</groupId> <groupId>commons-jelly</groupId>
......
...@@ -546,8 +546,24 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs ...@@ -546,8 +546,24 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
// default is no-op // default is no-op
} }
protected final boolean performAllBuildStep(BuildListener listener, Map<?,? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException { /**
return performAllBuildStep(listener,buildSteps.values(),phase); * @deprecated as of 1.356
* Use {@link #performAllBuildSteps(BuildListener, Map, boolean)}
*/
protected final void performAllBuildStep(BuildListener listener, Map<?,? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException {
performAllBuildSteps(listener,buildSteps.values(),phase);
}
protected final boolean performAllBuildSteps(BuildListener listener, Map<?,? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException {
return performAllBuildSteps(listener,buildSteps.values(),phase);
}
/**
* @deprecated as of 1.356
* Use {@link #performAllBuildSteps(BuildListener, Iterable, boolean)}
*/
protected final void performAllBuildStep(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException {
performAllBuildSteps(listener,buildSteps,phase);
} }
/** /**
...@@ -556,7 +572,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs ...@@ -556,7 +572,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
* @param phase * @param phase
* true for the post build processing, and false for the final "run after finished" execution. * true for the post build processing, and false for the final "run after finished" execution.
*/ */
protected final boolean performAllBuildStep(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException { protected final boolean performAllBuildSteps(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException {
boolean r = true; boolean r = true;
for (BuildStep bs : buildSteps) { for (BuildStep bs : buildSteps) {
if ((bs instanceof Publisher && ((Publisher)bs).needsToRunAfterFinalized()) ^ phase) if ((bs instanceof Publisher && ((Publisher)bs).needsToRunAfterFinalized()) ^ phase)
......
...@@ -155,17 +155,17 @@ public abstract class Build <P extends Project<P,B>,B extends Build<P,B>> ...@@ -155,17 +155,17 @@ public abstract class Build <P extends Project<P,B>,B extends Build<P,B>>
} }
public void post2(BuildListener listener) throws IOException, InterruptedException { public void post2(BuildListener listener) throws IOException, InterruptedException {
if (!performAllBuildStep(listener, project.getPublishers(), true)) if (!performAllBuildSteps(listener, project.getPublishers(), true))
setResult(FAILURE); setResult(FAILURE);
if (!performAllBuildStep(listener, project.getProperties(), true)) if (!performAllBuildSteps(listener, project.getProperties(), true))
setResult(FAILURE); setResult(FAILURE);
} }
@Override @Override
public void cleanUp(BuildListener listener) throws Exception { public void cleanUp(BuildListener listener) throws Exception {
// at this point it's too late to mark the build as a failure, so ignore return value. // at this point it's too late to mark the build as a failure, so ignore return value.
performAllBuildStep(listener, project.getPublishers(), false); performAllBuildSteps(listener, project.getPublishers(), false);
performAllBuildStep(listener, project.getProperties(), false); performAllBuildSteps(listener, project.getProperties(), false);
BuildTrigger.execute(Build.this, listener); BuildTrigger.execute(Build.this, listener);
} }
......
...@@ -595,9 +595,9 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven ...@@ -595,9 +595,9 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
b.save(); b.save();
// at this point the result is all set, so ignore the return value // at this point the result is all set, so ignore the return value
if (!performAllBuildStep(listener, project.getPublishers(), true)) if (!performAllBuildSteps(listener, project.getPublishers(), true))
setResult(FAILURE); setResult(FAILURE);
if (!performAllBuildStep(listener, project.getProperties(), true)) if (!performAllBuildSteps(listener, project.getProperties(), true))
setResult(FAILURE); setResult(FAILURE);
// aggregate all module fingerprints to us, // aggregate all module fingerprints to us,
...@@ -625,8 +625,8 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven ...@@ -625,8 +625,8 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
} }
// too late to set the build result at this point. so ignore failures. // too late to set the build result at this point. so ignore failures.
performAllBuildStep(listener, project.getPublishers(), false); performAllBuildSteps(listener, project.getPublishers(), false);
performAllBuildStep(listener, project.getProperties(), false); performAllBuildSteps(listener, project.getProperties(), false);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册