Skip to content

Commit

Permalink
reduce the public interface for ClientHook
Browse files Browse the repository at this point in the history
  • Loading branch information
vaci committed Dec 28, 2022
1 parent f8b5857 commit dee4303
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 45 deletions.
14 changes: 3 additions & 11 deletions runtime/src/main/java/org/capnproto/Capability.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@
public final class Capability {

public static ClientHook newBrokenCap(String reason) {
return newBrokenClient(reason, false, BROKEN_CAPABILITY_BRAND);
}

public static ClientHook newBrokenCap(Throwable exc) {
return newBrokenClient(exc, false, BROKEN_CAPABILITY_BRAND);
return newBrokenClient(BROKEN_CAPABILITY_BRAND);
}

public static ClientHook newNullCap() {
return newBrokenClient(RpcException.failed("Called null capability"), true, NULL_CAPABILITY_BRAND);
}

private static ClientHook newBrokenClient(String reason, boolean resolved, Object brand) {
return newBrokenClient(RpcException.failed(reason), resolved, brand);
return newBrokenClient(NULL_CAPABILITY_BRAND);
}

private static ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) {
private static ClientHook newBrokenClient(Object brand) {
return new ClientHook() {
@Override
public Object getBrand() {
Expand Down
34 changes: 0 additions & 34 deletions runtime/src/main/java/org/capnproto/RpcException.java

This file was deleted.

0 comments on commit dee4303

Please sign in to comment.