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

hazendaz / jmockit1 / 875

24 May 2026 05:41PM UTC coverage: 75.471% (-0.03%) from 75.496%
875

Pull #512

github

web-flow
Finalize modernizer updates and checked exception behavior

Agent-Logs-Url: https://github.com/hazendaz/jmockit1/sessions/ed08e1be-d91d-4d00-ab35-e5062b25acc0

Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com>
Pull Request #512: Modernize flagged collection/reflection API usages in `main` module (Java 21 build path)

6026 of 8488 branches covered (70.99%)

Branch coverage included in aggregate %.

25 of 34 new or added lines in 15 files covered. (73.53%)

5 existing lines in 1 file now uncovered.

12659 of 16270 relevant lines covered (77.81%)

0.78 hits per line

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

50.0
/main/src/main/java/mockit/internal/reflection/ThrowOfCheckedException.java
1
/*
2
 * MIT License
3
 * Copyright (c) 2006-2025 JMockit developers
4
 * See LICENSE file for full license text.
5
 */
6
package mockit.internal.reflection;
7

8
import edu.umd.cs.findbugs.annotations.NonNull;
9

10
import java.lang.reflect.InvocationTargetException;
11

12
@SuppressWarnings("UtilityClassWithoutPrivateConstructor")
13
final class ThrowOfCheckedException {
14
    private static Exception exceptionToThrow;
15

16
    ThrowOfCheckedException() throws Exception {
1✔
17
        throw exceptionToThrow;
1✔
18
    }
19

20
    static synchronized void doThrow(@NonNull Exception checkedException) {
21
        exceptionToThrow = checkedException;
1✔
22
        try {
NEW
23
            ThrowOfCheckedException.class.getDeclaredConstructor().newInstance();
×
24
        } catch (InvocationTargetException e) {
1✔
NEW
25
            rethrow(e.getCause());
×
NEW
26
        } catch (ReflectiveOperationException ignore) {
×
27
        }
×
28
    }
×
29

30
    @SuppressWarnings("unchecked")
31
    private static <T extends Throwable> void rethrow(Throwable cause) throws T {
32
        throw (T) cause;
1✔
33
    }
34
}
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