vazexqi / CodingSpectator

Watches and analyzes code edits in the Eclipse IDE non-invasively
http://codingspectator.cs.illinois.edu
Other
20 stars 14 forks source link

Make the Submitter tolerate the failures of SubmitterListeners #282

Closed reprogrammer closed 13 years ago

reprogrammer commented 13 years ago

Two kinds of failures could happen during a submission:

  1. A SubmitterListener may throw a Throwable in any of its methods.
  2. Submitter.submit may throw a Throwable while performing SVN operations.

The failure of a SubmitterListener should not prevent the Submitter from uploading others' data. Moreover, Submitter will pass the same boolean value to SubmitterListener.postSubmit(boolean) of all SubmitterListeners. That is, if a SubmitterListner fails in SubmitterListener.preLock() and Submitter succeeds to perform its SVN operations, the Submitter will pass true to SubmitterListener.postSubmit(boolean) of all SubmitterListeners including the faulty one. In other words, the boolean flag passed to SubmitterListener.postSubmit(boolean) just indicates the success of Submitter in performing its SVN operations.

Consequently, the clients should keep protect against their failures. That is, clients are responsible for remembering their failures in one step for future steps. In other words, the SubmitterListeners should be aware that if it fails in one method, the Submitter may still invoke the next methods on it.