• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

leeonky / test-charm-java / 218

15 Apr 2025 02:45PM UTC coverage: 74.045% (-0.04%) from 74.088%
218

push

circleci

leeonky
Introduce adaptiveList

20 of 21 new or added lines in 3 files covered. (95.24%)

34 existing lines in 11 files now uncovered.

7968 of 10761 relevant lines covered (74.05%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.68
/bean-util/src/main/java/com/github/leeonky/util/Sneaky.java
1
package com.github.leeonky.util;
2

3
import java.lang.reflect.InvocationTargetException;
4

5
public class Sneaky {
×
6
    public static <T> T get(ThrowingSupplier<T> supplier) {
7
        try {
8
            return supplier.get();
1✔
9
        } catch (Throwable e) {
1✔
10
            return sneakyThrow(e);
×
11
        }
12
    }
13

14
    public static void run(ThrowingRunnable runnable) {
15
        get(() -> {
1✔
16
            runnable.run();
1✔
17
            return null;
1✔
18
        });
19
    }
1✔
20

21
    public static <T> T execute(ThrowingSupplier<T> supplier) {
22
        try {
23
            return supplier.get();
1✔
24
        } catch (InvocationTargetException e) {
1✔
25
            return sneakyThrow(e.getTargetException());
×
26
        } catch (Throwable e) {
1✔
27
            return sneakyThrow(e);
×
28
        }
29
    }
30

31
    public static void executeVoid(ThrowingRunnable runnable) {
32
        execute(() -> {
1✔
33
            runnable.run();
1✔
34
            return null;
1✔
35
        });
36
    }
1✔
37

38
    @SuppressWarnings("unchecked")
39
    public static <E extends Throwable, T> T sneakyThrow(Throwable throwable) throws E {
40
        throw (E) throwable;
1✔
41
    }
42

43
    @SuppressWarnings("unchecked")
44
    public static <T, R> R cast(T input) {
UNCOV
45
        return (R) input;
×
46
    }
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc