Operation not supported for specified element type
I am getting this error in an eclipse plugin. Here is t开发者_JAVA技巧he code :
ICompilationUnit testCU = findTestUnit(type);
// add some stuff to testCU
testCU.commitWorkingCopy(false, null); // error happens here.
I'll guess that you're using this interface. Here's the method signature in question:
void commitWorkingCopy(boolean force, IProgressMonitor monitor) throws JavaModelException;
Perhaps you can try casting that null to IProgressMonitor.
Another idea would be to look at the type returned by that method call and make sure that it implements the right interface. Perhaps that is not correct.
加载中,请稍侯......
精彩评论