Throw ISE when the thread is interrupted 97/71797/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 4 May 2018 13:00:10 +0000 (15:00 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 4 May 2018 13:04:49 +0000 (15:04 +0200)
We really are failing, throw an IllegalStateException rather than
a RuntimeException.

Change-Id: I9a77ff1d537f4836eabbcebf364a070156848949
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/YangTextSchemaContextResolver.java

index eccacf5eed9873482509cc6f9bb1e53cfcdf9b25..8b36b9ea90531a11d575eacf3f18f80b7cd2eeb5 100644 (file)
@@ -237,7 +237,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
                     sc = Optional.of(f.get());
                     break;
                 } catch (final InterruptedException e) {
-                    throw new RuntimeException("Interrupted while assembling schema context", e);
+                    throw new IllegalStateException("Interrupted while assembling schema context", e);
                 } catch (final ExecutionException e) {
                     LOG.info("Failed to fully assemble schema context for {}", sources, e);
                     final Throwable cause = e.getCause();
@@ -303,7 +303,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
         try {
             return future.get();
         } catch (final InterruptedException e) {
-            throw new RuntimeException("Interrupted while waiting for SchemaContext assembly", e);
+            throw new IllegalStateException("Interrupted while waiting for SchemaContext assembly", e);
         } catch (final ExecutionException e) {
             final Throwable cause = e.getCause();
             if (cause instanceof SchemaResolutionException) {