# HG changeset patch # Parent e1f88e87dfa5860ffce43ca335e9d43124ab7c83 diff --git a/xml.axi/src/org/netbeans/modules/xml/axi/impl/ModelAccessImpl.java b/xml.axi/src/org/netbeans/modules/xml/axi/impl/ModelAccessImpl.java --- a/xml.axi/src/org/netbeans/modules/xml/axi/impl/ModelAccessImpl.java +++ b/xml.axi/src/org/netbeans/modules/xml/axi/impl/ModelAccessImpl.java @@ -114,7 +114,7 @@ SchemaGeneratorFactory sgf = SchemaGeneratorFactory.getDefault(); sgf.updateSchema(model.getSchemaModel(), model.getSchemaDesignPattern()); } catch (Exception ex) { - throw new IllegalArgumentException("Exception during flush: ",ex); //NOI18N + throw new IllegalStateException("Exception during flush: ",ex); //NOI18N } finally { model.getPropertyChangeListener().clearEvents(); } diff --git a/xml.xam/src/org/netbeans/modules/xml/xam/AbstractModel.java b/xml.xam/src/org/netbeans/modules/xml/xam/AbstractModel.java --- a/xml.xam/src/org/netbeans/modules/xml/xam/AbstractModel.java +++ b/xml.xam/src/org/netbeans/modules/xml/xam/AbstractModel.java @@ -343,8 +343,17 @@ return transaction != null; } + /** + * Ends the transaction and commits changes to the document. + * The operation may throw {@link IllegalStateException} if it is not possible to + * flush changes, because e.g. file is read-only, deleted or the document is changed + * in an incompatible way during the transaction. + * + * @throws IllegalStateException when the backing file/document is read-only or the document + * changed in a way that prevent application of changes. + */ @Override - public synchronized void endTransaction() { + public synchronized void endTransaction() throws IllegalStateException { endTransaction(false); }