1
我在eclipse插件中发现了这个错误。这里是代码:指定元素类型不支持的操作
ICompilationUnit testCU = findTestUnit(type);
// add some stuff to testCU
testCU.commitWorkingCopy(false, null); // error happens here.
我在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
。
另一个想法是看通过该方法调用返回的类型,并确保它实现了正确的接口。也许这是不正确的。
我没有得到'NullPointerException'。 – fastcodejava 2010-09-28 02:06:33