In general, don't use instanceof for classes coming from different
classloaders.
You can use string comparisons between classnames (theClass.getName()).

Cheers
Le 17 févr. 2016 3:08 PM, "Rinaldo DiGiorgio" <digitalrina...@gmail.com> a
écrit :

> Hi,
>
>  I want to extract all the scm actions from the build. I use the following
> groovy code
>
> build.allActions.each { item ->
> actions = item
>   println "ACTIONS: ${actions.class}"
>         if ( actions instanceof
> org.jenkinsci.plugins.workflow.steps.scm.MultiSCMRevisionState) {
>
> ..
>
> The above produces
>
> java.lang.IllegalAccessError: tried to access class 
> org.jenkinsci.plugins.workflow.steps.scm.MultiSCMRevisionState from class 
> Script1$_run_closure1
>
>
> if I replace with hudson.model.ParametersAction I do not get an exception.
>
>
> Rinaldo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/c3626d49-ecf2-450d-8f97-9ddf19155e11%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/c3626d49-ecf2-450d-8f97-9ddf19155e11%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS6ROue9RfY8tMEhXpS%3D8s_Jvu8zXdcZiHm%2Bz3HdW-LSjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to