We are just wrapping exceptions in these cases, switch to wrapping
with IllegalStateException to keep sonar happy.
Change-Id: I571f444b9d97dd9d9129b6e18f7e91e72b30d842
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
fda572130077da8029e12bb770b0b8c8fb7890d0)
14 files changed:
return (InstanceIdentifier<?>) handle.invokeExact(obj);
} catch (final Throwable e) {
Throwables.throwIfUnchecked(e);
return (InstanceIdentifier<?>) handle.invokeExact(obj);
} catch (final Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
schemaPromise.get(FutureSchema.this.duration, FutureSchema.this.unit);
return true;
} catch (final InterruptedException | ExecutionException e) {
schemaPromise.get(FutureSchema.this.duration, FutureSchema.this.unit);
return true;
} catch (final InterruptedException | ExecutionException e) {
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
} catch (final TimeoutException e) {
return false;
} finally {
} catch (final TimeoutException e) {
return false;
} finally {
return null;
} catch (final Throwable e) {
Throwables.throwIfUnchecked(e);
return null;
} catch (final Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
invoker.invokeExact(impl, input);
} catch (final Throwable e) {
Throwables.throwIfUnchecked(e);
invoker.invokeExact(impl, input);
} catch (final Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
return (ListenableFuture<RpcResult<?>>) handle.invokeExact(impl,input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
return (ListenableFuture<RpcResult<?>>) handle.invokeExact(impl,input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
}
}
}
\ No newline at end of file
}
}
}
\ No newline at end of file
return (ListenableFuture<RpcResult<?>>) handle.invokeExact(impl);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
return (ListenableFuture<RpcResult<?>>) handle.invokeExact(impl);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
}
}
}
\ No newline at end of file
}
}
}
\ No newline at end of file
subtreeRoot.eventStreamSerializer().serialize(data, writer);
return writer.build();
} catch (final IOException e) {
subtreeRoot.eventStreamSerializer().serialize(data, writer);
return writer.build();
} catch (final IOException e) {
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
}
}
}
\ No newline at end of file
}
}
}
\ No newline at end of file
return (D) proxyConstructor.invokeExact((InvocationHandler)new LazyDataObject<>(this, node));
} catch (final Throwable e) {
Throwables.throwIfUnchecked(e);
return (D) proxyConstructor.invokeExact((InvocationHandler)new LazyDataObject<>(this, node));
} catch (final Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
this.valueType = requireNonNull(valueType);
}
this.valueType = requireNonNull(valueType);
}
- static Callable<EncapsulatedValueCodec> loader(final Class<?> typeClz, TypeDefinition<?> typeDef) {
+ static Callable<EncapsulatedValueCodec> loader(final Class<?> typeClz, final TypeDefinition<?> typeDef) {
return () -> {
final Method m;
if (typeDef instanceof BooleanTypeDefinition || typeDef instanceof EmptyTypeDefinition) {
return () -> {
final Method m;
if (typeDef instanceof BooleanTypeDefinition || typeDef instanceof EmptyTypeDefinition) {
return constructor.invokeExact(input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
return constructor.invokeExact(input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
return getter.invokeExact(input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
return getter.invokeExact(input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
}
}
}
\ No newline at end of file
}
}
}
\ No newline at end of file
identifier = deserializeIdentifier(input.getKeyValues());
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
identifier = deserializeIdentifier(input.getKeyValues());
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException("Failed to deserialize " + input, e);
}
return IdentifiableItem.of((Class) identifiable, (Identifier) identifier);
}
return IdentifiableItem.of((Class) identifiable, (Identifier) identifier);
try {
return MethodHandles.publicLookup().unreflectConstructor(constr);
} catch (IllegalAccessException e) {
try {
return MethodHandles.publicLookup().unreflectConstructor(constr);
} catch (IllegalAccessException e) {
- throw new IllegalArgumentException("Cannot access constructor " + constr + " in class " + clazz, e);
+ throw new IllegalStateException("Cannot access constructor " + constr + " in class " + clazz, e);
return getter.invokeExact(input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
return getter.invokeExact(input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
value = getter.invokeExact(obj);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
value = getter.invokeExact(obj);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
}
Preconditions.checkArgument(value != null,
}
Preconditions.checkArgument(value != null,
return ret;
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
return ret;
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException("Failed to instantiate object with value " + string, e);
dataTree.validate(modification);
} catch (final DataValidationFailedException e) {
LOG.error("Validation failed for built modification", e);
dataTree.validate(modification);
} catch (final DataValidationFailedException e) {
LOG.error("Validation failed for built modification", e);
- throw new RuntimeException("Notification validation failed", e);
+ throw new IllegalStateException("Notification validation failed", e);
}
// strip nodes we do not need since this listener doesn't have to be registered at the root of the DataTree
}
// strip nodes we do not need since this listener doesn't have to be registered at the root of the DataTree