GROOVY-6662: correct chaching for static method invocation