You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2021/08/20 13:00:29 UTC

[commons-math] 01/02: Sonar fix: restore thread interrupted state

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit 09dd29e56d8ca8f508a29006be5523794ea6c4e9
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Fri Aug 20 13:38:10 2021 +0100

    Sonar fix: restore thread interrupted state
---
 .../commons/math4/examples/sofm/tsp/TravellingSalesmanSolver.java       | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/commons-math-examples/examples-sofm/tsp/src/main/java/org/apache/commons/math4/examples/sofm/tsp/TravellingSalesmanSolver.java b/commons-math-examples/examples-sofm/tsp/src/main/java/org/apache/commons/math4/examples/sofm/tsp/TravellingSalesmanSolver.java
index 006bc0b..478310d 100644
--- a/commons-math-examples/examples-sofm/tsp/src/main/java/org/apache/commons/math4/examples/sofm/tsp/TravellingSalesmanSolver.java
+++ b/commons-math-examples/examples-sofm/tsp/src/main/java/org/apache/commons/math4/examples/sofm/tsp/TravellingSalesmanSolver.java
@@ -124,6 +124,8 @@ public final class TravellingSalesmanSolver {
                 f.get();
             }
         } catch (InterruptedException | ExecutionException e) {
+            // Restore interrupted state...
+            Thread.currentThread().interrupt();
             throw new RuntimeException(e);
         }
         // Terminate all threads.