Author: [email protected]
Date: Fri May 15 09:50:06 2009
New Revision: 5390
Modified:
changes/jat/findbugs/user/test/com/google/gwt/user/client/CommandExecutorTest.java
Log:
Simplify findbugs fix per Miguel's recommendation
Modified:
changes/jat/findbugs/user/test/com/google/gwt/user/client/CommandExecutorTest.java
==============================================================================
---
changes/jat/findbugs/user/test/com/google/gwt/user/client/CommandExecutorTest.java
(original)
+++
changes/jat/findbugs/user/test/com/google/gwt/user/client/CommandExecutorTest.java
Fri May 15 09:50:06 2009
@@ -97,22 +97,16 @@
UncaughtExceptionHandler ueh1 = new UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
-
- if (e instanceof CommandCanceledException) {
- CommandCanceledException cce = (CommandCanceledException) e;
- if (cce.getCommand() != c1) {
- fail("CommandCanceledException did not contain the correct
failed command");
- }
- } else if (e instanceof IncrementalCommandCanceledException) {
- IncrementalCommandCanceledException icce =
(IncrementalCommandCanceledException) e;
- if (icce.getCommand() != c1) {
- fail("IncrementalCommandCanceledException did not contain the
correct failed command");
- }
- } else {
+ if (!(e instanceof CommandCanceledException)) {
originalUEH.onUncaughtException(e);
return;
}
+ CommandCanceledException cce = (CommandCanceledException) e;
+ if (cce.getCommand() != c1) {
+ fail("CommandCanceledException did not contain the correct
failed command");
+ }
+
// Submit some more work and do another dispatch
ce.submit(new IncrementalCommand() {
public boolean execute() {
@@ -211,19 +205,14 @@
UncaughtExceptionHandler ueh1 = new UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
- if (e instanceof CommandCanceledException) {
- CommandCanceledException cce = (CommandCanceledException) e;
- if (cce.getCommand() != ic) {
- fail("CommandCanceledException did not contain the correct
failed command");
- }
- } else if (e instanceof IncrementalCommandCanceledException) {
- IncrementalCommandCanceledException icce =
(IncrementalCommandCanceledException) e;
- if (icce.getCommand() != ic) {
- fail("IncrementalCommandCanceledException did not contain the
correct failed command");
- }
- } else {
+ if (!(e instanceof IncrementalCommandCanceledException)) {
originalUEH.onUncaughtException(e);
return;
+ }
+
+ IncrementalCommandCanceledException icce =
(IncrementalCommandCanceledException) e;
+ if (icce.getCommand() != ic) {
+ fail("IncrementalCommandCanceledException did not contain the
correct failed command");
}
}
};
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---