Skip to content

Commit

Permalink
[JENKINS-26093] Look up the downstream parameter definitions and show…
Browse files Browse the repository at this point in the history
… their index pages.

Originally-Committed-As: 276eee3b7d552e031b73d440a2faf29d25dbc680
  • Loading branch information
jglick committed Mar 3, 2015
1 parent a1b5def commit a08a617
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -26,6 +26,7 @@

import hudson.Extension;
import hudson.Functions;
import hudson.model.Descriptor;
import hudson.model.RootAction;
import java.io.IOException;
import java.util.Collection;
Expand Down Expand Up @@ -196,9 +197,10 @@ public HttpResponse doGenerateSnippet(StaplerRequest req, @QueryParameter String
throw new IllegalStateException("Jenkins is not running");
}
Class<?> c = j.getPluginManager().uberClassLoader.loadClass(jsonO.getString("stapler-class"));
Descriptor<?> descriptor = j.getDescriptor(c.asSubclass(Step.class));
Object o;
try {
o = req.bindJSON(c, jsonO);
o = descriptor.newInstance(req, jsonO);
} catch (RuntimeException x) { // e.g. IllegalArgumentException
return HttpResponses.plainText(Functions.printThrowable(x));
}
Expand Down

0 comments on commit a08a617

Please sign in to comment.