GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

getWaitingThreads()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
1
package io.mcarle.sciurus.lock;
2
3
import io.mcarle.sciurus.ExecutionIdentifier;
4
import io.mcarle.sciurus.annotation.Lock;
5
import org.aspectj.lang.ProceedingJoinPoint;
6
7
import java.util.ArrayList;
8
import java.util.Collections;
9
import java.util.List;
10
11
public class Execution {
12
    private final ExecutionIdentifier id;
13
    private final Object lock;
14
    private final ThreadLocal<Boolean> activator;
15
    private final List<Long> waitingThreads;
16
    private ProceedingJoinPoint joinPoint;
17
18 1
    Execution(ProceedingJoinPoint joinPoint, Lock lock) {
19 1
        this.joinPoint = joinPoint;
20 1
        this.lock = new Object();
21 1
        this.activator = new ThreadLocal<>();
22 1
        this.activator.set(Boolean.FALSE);
23 1
        this.waitingThreads = Collections.synchronizedList(new ArrayList<>());
24 1
        this.waitingThreads.add(Thread.currentThread().getId());
25 1
        List<Object> tmp = new ArrayList<>();
26 1
        for (int i : lock.on()) {
27 1
            tmp.add(joinPoint.getArgs()[i]);
28
        }
29 1
        this.id = new ExecutionIdentifier(joinPoint.getSignature().toString(), tmp.toArray());
30 1
    }
31
32
    public void setJoinPointAndActivate(ProceedingJoinPoint joinPoint) {
33 1
        this.joinPoint = joinPoint;
34 1
        this.activator.set(Boolean.TRUE);
35 1
    }
36
37
    public ExecutionIdentifier getId() {
38 1
        return id;
39
    }
40
41
    public Object getLock() {
42 1
        return lock;
43
    }
44
45
    public ThreadLocal<Boolean> getActivator() {
46 1
        return activator;
47
    }
48
49
    public List<Long> getWaitingThreads() {
50 1
        return waitingThreads;
51
    }
52
53
    public ProceedingJoinPoint getJoinPoint() {
54 1
        return joinPoint;
55
    }
56
57
    @Override
58
    public String toString() {
59 1
        return "ID: " + id + " - Waiting: " + waitingThreads + " - Active? " + (activator.get() != null);
60
    }
61
}
62