Skip to content

Commit 0b4b1a2

Browse files
author
Stefan Hahmann
committed
Make DummyDetectorOp static. Remove InterruptedException from ApposeProcess.cancel().
1 parent e001f39 commit 0b4b1a2

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/main/java/org/mastodon/mamut/detection/DeepLearningDetector.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,12 @@ public void cancel( final String reason )
313313
{
314314
// this is a workaround to avoid a null pointer exception during the cancel operation
315315
detector = new DummyDetectorOp();
316-
try
317-
{
318-
if ( apposeProcess != null )
319-
apposeProcess.cancel();
320-
}
321-
catch ( InterruptedException e )
322-
{
323-
logger.info( "Interrupted while cancelling detector: {}", e.getMessage() );
324-
}
316+
if ( apposeProcess != null )
317+
apposeProcess.cancel();
325318
super.cancel( reason );
326319
}
327320

328-
private class DummyDetectorOp extends AbstractDetectorOp
321+
private static class DummyDetectorOp extends AbstractDetectorOp
329322
{
330323
@Override
331324
public void mutate1( final DetectionCreatorFactory arg, final List< SourceAndConverter< ? > > in )

src/main/java/org/mastodon/mamut/util/ApposeProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ protected Service.Task runScript() throws IOException
188188
return currentTask;
189189
}
190190

191-
public void cancel() throws InterruptedException
191+
public void cancel()
192192
{
193193
pythonWorker.kill();
194194
}

0 commit comments

Comments
 (0)