欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ambiguous method overloading for method ****** 异常的解决办法

程序员文章站 2022-03-08 16:09:39
...

Ambiguous method overloading for method ****** 异常

前言:关于该异常,我是在*上(https://*.com/questions/33410033/groovy-ambiguous-method-overload)找到解决方案的,大家也可以去看看专业人士说的,本人小白,说的比较通俗,大佬勿怪

异常如下:

Caused by: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method cn.hutool.core.collection.CollectionUtil#isNotEmpty.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
        [interface java.lang.Iterable]
        [interface java.util.Collection]
        [interface java.util.Enumeration]
        [interface java.util.Iterator]
        [interface java.util.Map]

其实就是CollectionUtil.isNotEmpty方法的重载,导致不知道调用哪一个方法了,所以检查一下你传入的参数是否为null 值,就这么简单

相关标签: java