diff --git a/pw_rpc/java/main/dev/pigweed/pw_rpc/Client.java b/pw_rpc/java/main/dev/pigweed/pw_rpc/Client.java index 95be4cf3c7..f1383ffdbe 100644 --- a/pw_rpc/java/main/dev/pigweed/pw_rpc/Client.java +++ b/pw_rpc/java/main/dev/pigweed/pw_rpc/Client.java @@ -134,12 +134,12 @@ public MethodClient method(int channelId, Method serviceMethod) { return method(channelId, serviceMethod.service().id(), serviceMethod.id()); } catch (IllegalArgumentException e) { // Rethrow the exception with the service and method name instead of the ID. - throw new IllegalArgumentException("Unknown RPC " + serviceMethod.fullName()); + throw new IllegalArgumentException("Unknown RPC " + serviceMethod.fullName(), e); } } /** Returns a MethodClient with the provided service and method IDs. */ - public synchronized MethodClient method(int channelId, int serviceId, int methodId) { + synchronized MethodClient method(int channelId, int serviceId, int methodId) { Channel channel = channels.get(channelId); if (channel == null) { throw new IllegalArgumentException("Unknown channel ID " + channelId); diff --git a/pw_rpc/java/main/dev/pigweed/pw_rpc/Method.java b/pw_rpc/java/main/dev/pigweed/pw_rpc/Method.java index e32d9550ed..ff80cbb616 100644 --- a/pw_rpc/java/main/dev/pigweed/pw_rpc/Method.java +++ b/pw_rpc/java/main/dev/pigweed/pw_rpc/Method.java @@ -41,7 +41,7 @@ public abstract class Method { public abstract Class response(); - public final int id() { + final int id() { return Ids.calculate(name()); } diff --git a/pw_rpc/java/main/dev/pigweed/pw_rpc/Service.java b/pw_rpc/java/main/dev/pigweed/pw_rpc/Service.java index 311ff6f100..eeffd2af8d 100644 --- a/pw_rpc/java/main/dev/pigweed/pw_rpc/Service.java +++ b/pw_rpc/java/main/dev/pigweed/pw_rpc/Service.java @@ -38,7 +38,7 @@ public String name() { return name; } - public int id() { + int id() { return id; }