mWorkingCopy = null;
throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
"Typesystem not available!", null));
}
DocumentUimaImpl document = mWorkingCopy.get();
if (reload || document == null) {
InputStream in = mDocumentFile.getContents();
DocumentFormat format;
if (getResource().getFileExtension().equalsIgnoreCase("xcas")) {
format = DocumentFormat.XCAS;
} else if (getResource().getFileExtension().equalsIgnoreCase("xmi")) {
format = DocumentFormat.XMI;
} else {
throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
"Unkown file extension!", null));
}
// TODO: check if this is correct this way
CAS cas = project.getTypesystemElement().getCAS();
document = new DocumentUimaImpl(cas, in, format);
mWorkingCopy = new SoftReference<DocumentUimaImpl>(document);
}
return document;