hunk ./src/jvstm/ReadTransaction.java 29 + static final WriteOnReadException WRITE_ON_READ_EXCEPTION = new WriteOnReadException(); hunk ./src/jvstm/ReadTransaction.java 41 - throw new WriteOnReadException(); + throw WRITE_ON_READ_EXCEPTION; hunk ./src/jvstm/ReadTransaction.java 51 - throw new WriteOnReadException(); + throw WRITE_ON_READ_EXCEPTION; hunk ./src/jvstm/ReadTransaction.java 59 - throw new WriteOnReadException(); + throw WRITE_ON_READ_EXCEPTION; hunk ./src/jvstm/TopLevelTransaction.java 36 + static final CommitException COMMIT_EXCEPTION = new CommitException(); hunk ./src/jvstm/TopLevelTransaction.java 83 - throw new CommitException(); + throw COMMIT_EXCEPTION; hunk ./src/jvstm/WriteOnReadException.java 29 -public class WriteOnReadException extends RuntimeException { +/** + * An instance of WriteOnReadException is thrown by a + * thread whenever a write attempt is made to a VBox within a + * ReadOnlyTransaction. + * + * An application should never catch instances of this class, as the + * purpose of throwing an instance of this class is to make a + * non-local exit from the currently running transaction, and restart + * it with a new type of transaction that is able to deal with writes. + * This is done by the JVSTM runtime and should not be masked by the + * application code in anyway. + * + * The class WriteOnReadException is specifically a + * subclass of Error rather than Exception, + * even though it is a "normal occurrence", because many applications + * catch all occurrences of Exception and then discard + * the exception. + * + */ +public class WriteOnReadException extends Error {