Bump odlparent dependency to 2.0.0
[yangtools.git] / yang / yang-data-util / src / main / java / org / opendaylight / yangtools / yang / data / util / codec / SharedCodecCache.java
index 2b694ecfbe85900b753e18bb4a139e512db1d39b..026ed9fa2a26681e78db8ec9e6fe1456bbbff506 100644 (file)
@@ -44,7 +44,9 @@ public final class SharedCodecCache<T> extends CodecCache<T> {
         try {
             return complexCodecs.get(schema, () -> codec);
         } catch (ExecutionException e) {
-            throw Throwables.propagate(e.getCause());
+            final Throwable cause = e.getCause();
+            Throwables.throwIfUnchecked(cause);
+            throw new RuntimeException(e);
         }
     }
 
@@ -53,7 +55,9 @@ public final class SharedCodecCache<T> extends CodecCache<T> {
         try {
             return simpleCodecs.get(type, () -> codec);
         } catch (ExecutionException e) {
-            throw Throwables.propagate(e.getCause());
+            final Throwable cause = e.getCause();
+            Throwables.throwIfUnchecked(cause);
+            throw new RuntimeException(e);
         }
     }
 }