aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-25 02:32:51 (EST)
committerWinston Prakash2011-12-01 20:47:33 (EST)
commit933e807d16ee302fae29dde40a31718a1fa7063f (patch)
tree2ec863e43b2577cf0c00d17d099eba7361a13c70
parent77f5cde29f1b660472c42c62309e649019b5581b (diff)
downloadorg.eclipse.hudson.core-933e807d16ee302fae29dde40a31718a1fa7063f.zip
org.eclipse.hudson.core-933e807d16ee302fae29dde40a31718a1fa7063f.tar.gz
org.eclipse.hudson.core-933e807d16ee302fae29dde40a31718a1fa7063f.tar.bz2
Improve cascading functionality. Avoid redundant project saving while workin with describableList.
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/matrix/MatrixProject.java7
-rw-r--r--hudson-core/src/main/java/hudson/model/BaseBuildableProject.java1
-rw-r--r--hudson-core/src/main/java/hudson/model/Job.java2
-rw-r--r--hudson-core/src/main/java/hudson/util/DescribableListUtil.java2
4 files changed, 4 insertions, 8 deletions
diff --git a/hudson-core/src/main/java/hudson/matrix/MatrixProject.java b/hudson-core/src/main/java/hudson/matrix/MatrixProject.java
index de2d8fd..e2d81ce 100644
--- a/hudson-core/src/main/java/hudson/matrix/MatrixProject.java
+++ b/hudson-core/src/main/java/hudson/matrix/MatrixProject.java
@@ -655,13 +655,6 @@ public class MatrixProject extends BaseBuildableProject<MatrixProject, MatrixBui
this.cascadingProject = cascadingProject;
}
- /**
- * @inheritDoc
- */
- protected void setAllowSave(Boolean allowSave) {
- super.setAllowSave(allowSave);
- }
-
@Override
public void setCascadingProjectName(String cascadingProjectName) {
super.setCascadingProjectName(cascadingProjectName);
diff --git a/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java b/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
index bc7fb8f..f6dd8c4 100644
--- a/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
+++ b/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
@@ -187,6 +187,7 @@ public abstract class BaseBuildableProject<P extends BaseBuildableProject<P,B>,B
public void addPublisher(Publisher publisher) throws IOException {
CascadingUtil.getExternalProjectProperty(this,
publisher.getDescriptor().getJsonSafeClassName()).setValue(publisher);
+ save();
}
/**
diff --git a/hudson-core/src/main/java/hudson/model/Job.java b/hudson-core/src/main/java/hudson/model/Job.java
index 4f3fdc0..dedf882 100644
--- a/hudson-core/src/main/java/hudson/model/Job.java
+++ b/hudson-core/src/main/java/hudson/model/Job.java
@@ -202,7 +202,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
*
* @param allowSave allow save.
*/
- protected void setAllowSave(Boolean allowSave) {
+ public void setAllowSave(Boolean allowSave) {
if (null == this.allowSave) {
initAllowSave();
}
diff --git a/hudson-core/src/main/java/hudson/util/DescribableListUtil.java b/hudson-core/src/main/java/hudson/util/DescribableListUtil.java
index 86b3781..7174cd7 100644
--- a/hudson-core/src/main/java/hudson/util/DescribableListUtil.java
+++ b/hudson-core/src/main/java/hudson/util/DescribableListUtil.java
@@ -162,7 +162,9 @@ public final class DescribableListUtil {
}
}
try {
+ owner.setAllowSave(false);
result.addAll(describableList);
+ owner.setAllowSave(true);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to add list of describable elements", e);
}