On Wed, Oct 26, 2016 at 6:54 PM, Stephen Connolly
<[email protected]> wrote:
> That's the one you want (it does the lookups for you)

Do not call that directly. Use
`SCMTriggerItem.asSCMTriggerItem(job).getSCMs()` plus a null check.


Anyway for the stated use case

> Compute the warnings in a build and map these warnings to corresponding SCM 
> changes

`getScm()` was not what you wanted to begin with. You want

Run<?, ?> run = …;
@SuppressWarnings("unchecked") List<ChangeLogSet<? extends
ChangeLogSet.Entry>> changeSets =
  run.getClass().getMethod("getChangeSets").invoke(run);

which will work equally well on `AbstractBuild` or `WorkflowRun`. A
core interface to abstract the two is pending.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0RezxRsRzJuoAHfNROe1nisrQse%2BHB%3DOEqMnwtn9AW%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to