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.

cacheAnnotated(Cache)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 2
ccs 0
cts 0
cp 0
crap 2
rs 10
1 1
package io.mcarle.sciurus.cache;
2
3
import io.mcarle.sciurus.Sciurus;
4
import io.mcarle.sciurus.annotation.Cache;
5
import org.aspectj.lang.ProceedingJoinPoint;
6
import org.aspectj.lang.annotation.Around;
7
import org.aspectj.lang.annotation.Aspect;
8
import org.aspectj.lang.annotation.Pointcut;
9
10
@Aspect
11 1
public class CacheAspect {
12
13
    /**
14
     * Matches any execution of any method returning a serializable result
15
     */
16
    @Pointcut("execution((java.io.Serializable+ || byte || short || int || long || float || double || char || boolean) *(..))")
17
    void anyMethodReturningSerializable() {
18
    }
19
20
    /**
21
     * Matches any execution of any method with at least one non serializable parameter
22
     */
23
    @Pointcut("execution(* *(.., !(java.io.Serializable+ || byte || short || int || long || float || double || char || boolean), ..))")
24
    void anyMethodWithMinimumOneNonSerializableParameter() {
25
    }
26
27
    /**
28
     * Matches any method, which is annotated with {@link Cache}
29
     */
30
    @Pointcut("@annotation(cache)")
31
    void cacheAnnotated(Cache cache) {
32
    }
33
34
    @Around(value = "anyMethodReturningSerializable() && !anyMethodWithMinimumOneNonSerializableParameter() && cacheAnnotated(cache)", argNames = "joinPoint,cache")
35
    public Object startedAndExecutionOfAnyMethodAnnotatedWithCache(
36
            ProceedingJoinPoint joinPoint,
37
            Cache cache
38
    ) throws Throwable {
39 1
        if (Sciurus.isCacheStarted()) {
40 1
            return CacheAspectHandler.executeAndCache(joinPoint, cache);
41
        } else {
42 1
            return joinPoint.proceed();
43
        }
44
    }
45
}
46