Skip to content
Permalink
Browse files

[FIXED JENKINS-38037] Single-arg check for executable symbols fix

Use the DescribableModel for symbols related to a meta-step when
determining whether they should be parsed as having a single required
argument.
  • Loading branch information...
abayer committed Sep 7, 2016
1 parent f8c08e9 commit a06779a2b831adc8042fa76be7f1f2747a8cb91b
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/main/java/org/jenkinsci/plugins/workflow/cps/DSL.java
@@ -241,8 +241,10 @@ protected Object invokeDescribable(String symbol, Object _args) {

boolean singleArgumentOnly = false;
if (metaStep != null) {
DescribableModel<?> metaModel = new DescribableModel(metaStep.clazz);
singleArgumentOnly = metaModel.hasSingleRequiredParameter() && metaModel.getParameters().size() == 1;
Descriptor symbolDescriptor = SymbolLookup.get().findDescriptor(metaStep.getMetaStepArgumentType(), symbol);
DescribableModel<?> symbolModel = new DescribableModel(symbolDescriptor.clazz);

singleArgumentOnly = symbolModel.hasSingleRequiredParameter() && symbolModel.getParameters().size() == 1;
}

// The only time a closure is valid is when the resulting Describable is immediately executed via a meta-step

0 comments on commit a06779a

Please sign in to comment.
You can’t perform that action at this time.