MCPcopy Create free account
hub / github.com/cinit/TMoe / getIteCauseOrSelf

Method getIteCauseOrSelf

app/src/main/java/cc/ioctl/tmoe/util/IoUtils.java:132–141  ·  view source on GitHub ↗
(@NonNull Throwable t)

Source from the content-addressed store, hash-verified

130 }
131
132 @NonNull
133 public static Throwable getIteCauseOrSelf(@NonNull Throwable t) {
134 Objects.requireNonNull(t, "t == null");
135 Throwable cause;
136 if (t instanceof InvocationTargetException && (cause = t.getCause()) != null) {
137 return cause;
138 } else {
139 return t;
140 }
141 }
142
143 @SuppressWarnings("unchecked")
144 private static <T extends Throwable> void unsafeThrowImpl(@NonNull Throwable t) throws T {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected