http://gwt-code-reviews.appspot.com/1526803/diff/1/user/src/com/google/web/bindery/event/shared/testing/CountingEventBus.java
File
user/src/com/google/web/bindery/event/shared/testing/CountingEventBus.java
(right):

http://gwt-code-reviews.appspot.com/1526803/diff/1/user/src/com/google/web/bindery/event/shared/testing/CountingEventBus.java#newcode46
user/src/com/google/web/bindery/event/shared/testing/CountingEventBus.java:46:
public <H> HandlerRegistration addHandler(Type<H> type, H handler) {
If we want to count only successful method calls, we should move the
increment() calls to after the wrapped method calls, so the counter
isn't incremented when the wrapped method throws an exception.

In particular, it looks like SimpleEvent bus requires that type is not
null. It might be a good idea to do a null check in this method, so we
don't have to read a lot of other code to figure that out.

http://gwt-code-reviews.appspot.com/1526803/diff/1/user/src/com/google/web/bindery/event/shared/testing/CountingEventBus.java#newcode92
user/src/com/google/web/bindery/event/shared/testing/CountingEventBus.java:92:
* events may not have been passed to any handlers.
Should clarify whether we're only counting successful calls. Also, what
happens if a handler throws an exception?

(It might be nice to have a counter for errors, but I think that's a
separate CL.)

http://gwt-code-reviews.appspot.com/1526803/diff/1/user/src/com/google/web/bindery/event/shared/testing/CountingEventBus.java#newcode118
user/src/com/google/web/bindery/event/shared/testing/CountingEventBus.java:118:
TypeSourcePair(Type<?> type, Object source) {
It looks like type should not be null (at least in SimpleEventBus) but
source can be null. Maybe put a null check and a comment? I had to read
a fair bit of code to figure that out.

http://gwt-code-reviews.appspot.com/1526803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to