Skip to content

Commit

Permalink
Always throw an exception, to keep IDEs happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
broneill committed Dec 28, 2024
1 parent 2804f48 commit ab2bc7c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/cojen/dirmi/core/CoreUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,11 @@ public static <T extends Throwable> T remoteException(SocketAddress remoteAddres
* not. Use as follows: {@code throw rethrow(e)}
*/
public static RuntimeException rethrow(Throwable e) {
CoreUtils.<RuntimeException>castAndThrow(e);
return null;
throw CoreUtils.<RuntimeException>castAndThrow(e);
}

@SuppressWarnings("unchecked")
private static <T extends Throwable> void castAndThrow(Throwable e) throws T {
private static <T extends Throwable> RuntimeException castAndThrow(Throwable e) throws T {
throw (T) e;
}

Expand Down

0 comments on commit ab2bc7c

Please sign in to comment.