我在eclipse插件中收到此错误。这是代码:

ICompilationUnit testCU = findTestUnit(type);
// add some stuff to testCU
testCU.commitWorkingCopy(false, null);    // error happens here.

最佳答案

我猜您正在使用this interface。这是有问题的方法签名:

void commitWorkingCopy(boolean force, IProgressMonitor monitor) throws JavaModelException;


也许您可以尝试将null强制转换为IProgressMonitor

另一个想法是查看该方法调用返回的类型,并确保它实现正确的接口。也许那是不正确的。

07-26 04:03