As this image shows,我可以从字符串和其他MetaClasses中获取MetaMethod,但IDEA说它无法解析" getMetaMethod"对于Collection或List MetaClasses,它返回null。
Collection MetaClass与其他Object MetaClasses不同吗?
编辑:这是代码
def listToString = List.metaClass.getMetaMethod("toString", null)
def collectionToString = Collection.metaClass.getMetaMethod("toString", null)
def stringToString = String.metaClass.getMetaMethod("toString", null)
def objectToString = Object.metaClass.getMetaMethod("toString", null)
def integerToString = Integer.metaClass.getMetaMethod("toString", null)
println listToString
println collectionToString
println stringToString
println objectToString
println integerToString