Skip to content

Commit

Permalink
Merge pull request #2723 from abayer/jenkins-37590-mk2
Browse files Browse the repository at this point in the history
[FIXED JENKINS-37590] Return a null property if no parameters
  • Loading branch information
daniel-beck authored Feb 9, 2017
2 parents ee4afc3 + 0254e02 commit 6d51a5f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ public ParameterDefinition getParameterDefinition(String name) {
@Extension
@Symbol("parameters")
public static class DescriptorImpl extends OptionalJobPropertyDescriptor {
@Override
public ParametersDefinitionProperty newInstance(StaplerRequest req, JSONObject formData) throws FormException {
ParametersDefinitionProperty prop = (ParametersDefinitionProperty)super.newInstance(req, formData);
if (prop != null && prop.parameterDefinitions.isEmpty()) {
return null;
}
return prop;
}

@Override
public boolean isApplicable(Class<? extends Job> jobType) {
return ParameterizedJobMixIn.ParameterizedJob.class.isAssignableFrom(jobType);
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/resources/hudson/model/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -386,5 +386,3 @@ Jenkins.IsRestarting=Jenkins is restarting

User.IllegalUsername="{0}" is prohibited as a username for security reasons.
User.IllegalFullname="{0}" is prohibited as a full name for security reasons.

Hudson.NoParamsSpecified=No Parameters are specified for this parameterized build
1 change: 0 additions & 1 deletion core/src/main/resources/jenkins/model/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Hudson.NotUsesUTF8ToDecodeURL=\
See <a href="http://wiki.jenkins-ci.org/display/JENKINS/Containers">Containers</a> and \
<a href="http://wiki.jenkins-ci.org/display/JENKINS/Tomcat#Tomcat-i18n">Tomcat i18n</a> for more details.
Hudson.NodeDescription=the master Jenkins node
Hudson.NoParamsSpecified=No Parameters are specified for this parameterized build

CLI.restart.shortDescription=Restart Jenkins.
CLI.safe-restart.shortDescription=Safely restart Jenkins.
Expand Down

0 comments on commit 6d51a5f

Please sign in to comment.