File tree Expand file tree Collapse file tree 3 files changed +17
-11
lines changed
main/java/org/scijava/task
test/java/org/scijava/task Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public class DefaultTask implements Task {
9292 * reported.
9393 */
9494 public DefaultTask (final ThreadService threadService ,
95- final EventService eventService )
95+ final EventService eventService )
9696 {
9797 this .threadService = threadService ;
9898 this .eventService = eventService ;
@@ -123,7 +123,7 @@ public void start() {
123123 // - Synchronous
124124 @ Override
125125 public void finish () {
126- isDone = true ;
126+ isDone = true ;
127127 fireTaskEvent ();
128128 }
129129
@@ -176,12 +176,12 @@ public boolean isCanceled() {
176176 public void cancel (final String reason ) {
177177 canceled = true ;
178178 cancelReason = reason ;
179- if (cancelCallBack != null ) cancelCallBack .run ();
179+ if (cancelCallBack != null ) cancelCallBack .run ();
180180 fireTaskEvent ();
181181 }
182182
183183 void defaultCancelCallback () {
184- if (future != null ) {
184+ if (future != null ) {
185185 isDone = future .cancel (true );
186186 }
187187 }
@@ -231,9 +231,11 @@ private synchronized void initFuture(final Runnable r) {
231231 try {
232232 fireTaskEvent (); // Triggers an event just before the task is executed
233233 r .run ();
234- } finally {
234+ }
235+ finally {
235236 isDone = true ;
236- fireTaskEvent (); // Triggers an event just after the task has successfully completed or failed
237+ fireTaskEvent (); // Triggers an event just after the task has
238+ // successfully completed or failed
237239 }
238240 });
239241 }
Original file line number Diff line number Diff line change @@ -137,15 +137,18 @@ default void finish() {}
137137 * If the task is cancelled (external call to {@link Task#cancel(String)}),
138138 * the input runnable argument should be executed by task implementors.
139139 *
140- * @param runnable : should be executed if this task is cancelled through {@link Task#cancel(String)}
140+ * @param runnable : should be executed if this task is cancelled through
141+ * {@link Task#cancel(String)}
141142 */
142143 default void setCancelCallBack (Runnable runnable ) {}
143144
144145 /**
145- * Returns the current cancel callback runnable,
146- * This can be used to concatenate callbacks in order,
147- * for instance, to ask for a user confirmation before cancelling the task
146+ * Returns the current cancel callback runnable, This can be used to
147+ * concatenate callbacks in order, for instance, to ask for a user
148+ * confirmation before cancelling the task
148149 */
149- default Runnable getCancelCallBack () { return () -> {}; }
150+ default Runnable getCancelCallBack () {
151+ return () -> {};
152+ }
150153
151154}
Original file line number Diff line number Diff line change 2626 * POSSIBILITY OF SUCH DAMAGE.
2727 * #L%
2828 */
29+
2930package org .scijava .task ;
3031
3132import static org .junit .Assert .assertEquals ;
You can’t perform that action at this time.
0 commit comments