Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hudson-core/src/main/java/hudson/model/BaseBuildableProject.java16
-rw-r--r--hudson-core/src/main/java/hudson/model/Job.java1
2 files changed, 9 insertions, 8 deletions
diff --git a/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java b/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
index 3f0dbed4..0cdb3c5c 100644
--- a/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
+++ b/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
@@ -352,31 +352,31 @@ public abstract class BaseBuildableProject<P extends BaseBuildableProject<P, B>,
}
protected void convertPublishersProperties() {
- if (null != publishers) {
+ if ((null != publishers) && !publishers.isEmpty()) {
putAllProjectProperties(DescribableListUtil.convertToProjectProperties(publishers, this), false);
- publishers = null;
}
+ publishers = null;
}
protected void convertBuildWrappersProperties() {
- if (null != buildWrappers) {
+ if ((null != buildWrappers) && !buildWrappers.isEmpty() ) {
putAllProjectProperties(DescribableListUtil.convertToProjectProperties(buildWrappers, this), false);
- buildWrappers = null;
}
+ buildWrappers = null;
}
protected void convertBuildersProperties() {
- if (null != builders && null == getProperty(BUILDERS_PROPERTY_NAME)) {
+ if ((null != builders) && !builders.isEmpty() && (null == getProperty(BUILDERS_PROPERTY_NAME))) {
putAllProjectProperties(DescribableListUtil.convertToProjectProperties(builders, this), false);
- builders = null;
}
+ builders = null;
}
protected void convertBuildersProjectProperty() {
- if (null != builders && null == getProperty(BUILDERS_PROPERTY_NAME)) {
+ if ((null != builders) && !builders.isEmpty() && (null == getProperty(BUILDERS_PROPERTY_NAME))) {
setBuilders(builders);
- builders = null;
}
+ builders = null;
}
}
diff --git a/hudson-core/src/main/java/hudson/model/Job.java b/hudson-core/src/main/java/hudson/model/Job.java
index f05b8420..89f8c772 100644
--- a/hudson-core/src/main/java/hudson/model/Job.java
+++ b/hudson-core/src/main/java/hudson/model/Job.java
@@ -216,6 +216,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
//Bug Fix: 406889 - Non overriden job properties or properties with no values should not be written to config.xml
private Object writeReplace() throws ObjectStreamException, IOException {
+
persistableJobProperties.clear();
for (String key : jobProperties.keySet()) {
persistableJobProperties.put(key, jobProperties.get(key));

Back to the top