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

Cognifide / AEM-Rules-for-SonarQube / #808

29 Oct 2024 11:10AM UTC coverage: 93.816% (-0.1%) from 93.925%
#808

push

tomasz-strzelecki-wttech
Update tests with dependencies

625 of 758 branches covered (82.45%)

4 of 7 new or added lines in 5 files covered. (57.14%)

1608 of 1714 relevant lines covered (93.82%)

0.94 hits per line

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

25.0
/src/main/java/com/vml/aemrules/utils/Throwables.java
1
/*-
2
 * #%L
3
 * AEM Rules for SonarQube
4
 * %%
5
 * Copyright (C) 2015-2024 VML
6
 * %%
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 *      http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 * #L%
19
 */
20
package com.vml.aemrules.utils;
21

22
public final class Throwables {
23

24
    private Throwables() {
25
        // intentionally empty
26
    }
27

28
    public static Throwable getRootCause(Throwable throwable) {
29
        Throwable cause;
30
        while ((cause = throwable.getCause()) != null) {
1✔
31
            throwable = cause;
1✔
32
        }
33

34
        return throwable;
1✔
35
    }
36

37
    public static RuntimeException propagate(Throwable throwable) {
38
        throwIfUnchecked(throwable);
×
NEW
39
        throw new AemRulesTestRuntimeException(throwable);
×
40
    }
41

42
    public static void throwIfUnchecked(Throwable throwable) {
43
        if (throwable instanceof RuntimeException) {
×
44
            throw (RuntimeException) throwable;
×
45
        }
46
        if (throwable instanceof Error) {
×
47
            throw (Error) throwable;
×
48
        }
49
    }
×
50

51
    private static class AemRulesTestRuntimeException extends RuntimeException {
52
        public AemRulesTestRuntimeException(Throwable throwable) {
NEW
53
            super(throwable);
×
NEW
54
        }
×
55
    }
56
}
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