Commit a71ebdf
committed
Fix a bug with Cancelable#cancel(String)
The various implementations of this method (which are all copy-pasted
from one another, due to Java's single inheritance limitations) all
suffered from the same bug: calling `cancel(null)` would not actually
cancel the operation. Actually, this was the intended design (so you
could potentially "uncancel" an operation), but I decided that:
1. Uncanceling is not something anyone should need to do;
2. It violates the PoLA for `cancel(null)` not to cancel things;
3. The ModuleRunner calls `cancel(e.getMessage())` from a caught
ModuleException, which wouldn't actually cancel the module execution
if the exception had a null message, which it did thanks to the
AbstractInputHarvester doing `throw new ModuleCanceledException()`.1 parent 9c19ffc commit a71ebdf
File tree
5 files changed
+6
-5
lines changed- src/main/java/org/scijava
- command
- module/process
- ui
5 files changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
0 commit comments