Missing import.
Newer versions of the compiler plugin do a better job of reporting errors.
7c801e1f7a9c84c28317e04daf902c8483708760 by @kohsuke was incorrect: missing cast.
Switched from Groovy to Java to diagnose and verify fix, but in fact switching back does not work;
there is *another* missing cast in the code generated by the buggy Groovy stub compiler.
Since there seems to be no particular reason for this to be written in Groovy in the first place, leaving as Java.