Skip to content

Commit

Permalink
[FIXED JENKINS-45895] - JNLPLauncher config.jelly should not display …
Browse files Browse the repository at this point in the history
…Work Dir settings when included from other class
  • Loading branch information
oleg-nenashev committed Aug 2, 2017
1 parent 45aa332 commit 6ed7c7f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions core/src/main/java/hudson/slaves/JNLPLauncher.java
Expand Up @@ -163,6 +163,22 @@ public DescriptorImpl() {
public String getDisplayName() {
return Messages.JNLPLauncher_displayName();
}

/**
* Checks if Work Dir settings should be displayed.
*
* This flag is checked in {@code config.jelly} before displaying the
* {@link JNLPLauncher#workDirSettings} property.
* By default the configuration is displayed only for {@link JNLPLauncher},
* but the implementation can be overridden.
* @return {@code true} if work directories are supported by the launcher type.
* @since TODO
*/
public boolean isWorkDirSupported() {
// This property is included only for JNLPLauncher by default.
// Causes JENKINS-45895 in the case of includes otherwise
return DescriptorImpl.class.equals(getClass());
}
};

/**
Expand Down
Expand Up @@ -24,7 +24,10 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:property title="${%Enable work directory}" field="workDirSettings" />
<!-- This property is included only if used directly. Causes JENKINS-45895 in the case of includes otherwise -->
<j:if test="${descriptor.workDirSupported}">
<f:property title="${%Enable work directory}" field="workDirSettings" />
</j:if>
<f:advanced>
<f:entry title="${%Tunnel connection through}" help="/help/system-config/master-slave/jnlp-tunnel.html">
<f:textbox field="tunnel"/>
Expand Down

0 comments on commit 6ed7c7f

Please sign in to comment.