- Use @CheckReturnValue annotation in static code analysis
to ensure that all users of the RPC do check the Future RpcResult
for errors - even if there is no Output.
Change-Id: I7b4e5f0d7ca81db154a39325490a46bfcf8820a4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
final ContainerSchemaNode input = rpc.getInput();
final ContainerSchemaNode output = rpc.getOutput();
+ // Do not refer to annotation class, as it may not be available at runtime
+ method.addAnnotation("javax.annotation", "CheckReturnValue");
+
//in case of implicit RPC input (StatementSource.CONTEXT),
// stay compatible (no input argument generated)
if (input != null && isExplicitStatement(input)) {