Forbids interrupted exception shown

This commit is contained in:
huangyuhui
2018-02-02 14:25:21 +08:00
parent 2efb5d7f8f
commit 55e7b8901a
3 changed files with 9 additions and 5 deletions

View File

@@ -95,7 +95,9 @@ public final class GetTask extends TaskResult<String> {
while ((len = input.read(buf)) != -1) {
baos.write(buf, 0, len);
read += len;
updateProgress(read, size);
if (size >= 0)
updateProgress(read, size);
if (Thread.currentThread().isInterrupted())
return;

View File

@@ -184,7 +184,6 @@ public final class TaskExecutor {
}
} catch (InterruptedException e) {
if (task.getSignificance().shouldLog()) {
lastException = e;
Logging.LOG.log(Level.FINE, "Task aborted: " + task.getName());
task.onDone().fireEvent(new TaskEvent(this, task, true));
taskListeners.forEach(it -> it.onFailed(task, e));