summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-25 02:32:51 (EST)
committer Winston Prakash2011-12-01 20:47:33 (EST)
commitc7148b77db95e10883b304aad8061881d02cbf8b (patch)
tree7ed1132a27e67a29bb302e5e99d6837e012622fa
parent79d96c5cd3b85416643db0a592f8af1f141f43cf (diff)
downloadorg.eclipse.hudson.core-c7148b77db95e10883b304aad8061881d02cbf8b.zip
org.eclipse.hudson.core-c7148b77db95e10883b304aad8061881d02cbf8b.tar.gz
org.eclipse.hudson.core-c7148b77db95e10883b304aad8061881d02cbf8b.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);
}