From: Robert Varga Date: Fri, 4 May 2018 13:00:10 +0000 (+0200) Subject: Throw ISE when the thread is interrupted X-Git-Tag: v2.0.5~31 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=6e93b710a0434fb2d5ccddfcaad9d64768cb68ee;p=yangtools.git Throw ISE when the thread is interrupted We really are failing, throw an IllegalStateException rather than a RuntimeException. Change-Id: I9a77ff1d537f4836eabbcebf364a070156848949 Signed-off-by: Robert Varga --- diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/YangTextSchemaContextResolver.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/YangTextSchemaContextResolver.java index eccacf5eed..8b36b9ea90 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/YangTextSchemaContextResolver.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/YangTextSchemaContextResolver.java @@ -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) {