Fix java7 compilation warnings and add cast to ClassLoader in groovy code to avoid ambigious overloaded methods that exist in java 7.

RB=209350
R=si-dev,kparikh,dhoa
A=kparikh,sihde