Eclipse? 右键项目 ->Properties->Java Compiler->Error/Warning->Inexact type mach for vararg argument 设为 Ignore
参数类型不够精确,把第一个调用中的null换成new Class[0],第二个调用中的null换成new Object[0]就可以了如: Method getMethod=from.getClass().getMethod(getName, new Class[0]);Object value=getMethod.invoke(from, new Object[0]);
设为 Ignore
Method getMethod=from.getClass().getMethod(getName, new Class[0]);Object value=getMethod.invoke(from, new Object[0]);