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

trydofor / professional-wings / #78

21 Jun 2024 08:47AM UTC coverage: 62.919% (+0.005%) from 62.914%
#78

push

trydofor
✨ check TinyTasker uniq propkey #260

36 of 60 new or added lines in 5 files covered. (60.0%)

1 existing line in 1 file now uncovered.

12059 of 19166 relevant lines covered (62.92%)

0.63 hits per line

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

76.92
/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/schedule/exec/ExecHolder.java
1
package pro.fessional.wings.tiny.task.schedule.exec;
2

3
import org.apache.commons.lang3.StringUtils;
4
import org.jetbrains.annotations.Contract;
5
import org.jetbrains.annotations.NotNull;
6

7
import java.util.concurrent.ConcurrentHashMap;
8
import java.util.function.Function;
9

10
/**
11
 * @author trydofor
12
 * @since 2022-12-16
13
 */
14
public class ExecHolder {
×
15

16
    private static final ConcurrentHashMap<String, NoticeExec<?>> Notice = new ConcurrentHashMap<>();
1✔
17
    private static final ConcurrentHashMap<String, TaskerExec> Tasker = new ConcurrentHashMap<>();
1✔
18

19
    @NotNull
20
    public static NoticeExec<?> getNotice(@NotNull String bean, @NotNull Function<String, NoticeExec<?>> exec) {
21
        return Notice.computeIfAbsent(bean, exec);
1✔
22
    }
23

24
    @Contract("_,true->!null")
25
    public static NoticeExec<?> getNotice(String bean, boolean nonnull) {
26
        final NoticeExec<?> exec = StringUtils.isEmpty(bean) ? null : Notice.get(bean);
1✔
27
        if (nonnull && exec == null) {
1✔
NEW
28
            throw new IllegalStateException("notice not found, bean=" + bean);
×
29
        }
30
        return exec;
1✔
31
    }
32

33
    @NotNull
34
    public static TaskerExec getTasker(@NotNull String prop, @NotNull Function<String, TaskerExec> exec) {
35
        return Tasker.computeIfAbsent(prop, exec);
1✔
36
    }
37

38
    @Contract("_,true->!null")
39
    public static TaskerExec getTasker(String prop, boolean nonnull) {
40
        final TaskerExec exec = StringUtils.isEmpty(prop) ? null : Tasker.get(prop);
1✔
41
        if (nonnull && exec == null) {
1✔
NEW
42
            throw new IllegalStateException("tasker not found, prop=" + prop);
×
43
        }
44
        return exec;
1✔
45
    }
46
}
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