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

alibaba / jetcache / #447

23 May 2026 01:52AM UTC coverage: 88.921% (-0.4%) from 89.31%
#447

push

areyouok
feat: allow customize DecodeFilter for kryo decoder

54 of 59 new or added lines in 8 files covered. (91.53%)

24 existing lines in 8 files now uncovered.

4976 of 5596 relevant lines covered (88.92%)

0.89 hits per line

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

70.0
/jetcache-core/src/main/java/com/alicp/jetcache/support/KryoClassResolverUtil.java
1
package com.alicp.jetcache.support;
2

NEW
3
final class KryoClassResolverUtil {
×
4

5
    private static final String[] PRIMITIVE_TYPE_NAMES = {
1✔
6
            "boolean", "byte", "char", "short", "int", "long", "float", "double", "void"
7
    };
8

9
    static void checkAllowed(Class<?> type, DecodeFilter decodeFilter) {
10
        if (type != null && !type.isPrimitive()) {
1✔
11
            checkAllowed(type.getName(), decodeFilter);
1✔
12
        }
13
    }
1✔
14

15
    static void checkAllowed(String className, DecodeFilter decodeFilter) {
16
        if (isPrimitiveTypeName(className)) {
1✔
17
            return;
×
18
        }
19
        if (decodeFilter.isEnabled() && !decodeFilter.isAllowed(className)) {
1✔
20
            DecodeFilter.logBlocked(className);
1✔
21
            throw new DecodeFilterException(className);
1✔
22
        }
23
    }
1✔
24

25
    static Class<?> loadClass(String className, ClassLoader primary, ClassLoader fallback) throws ClassNotFoundException {
26
        try {
27
            return Class.forName(className, false, primary);
1✔
28
        } catch (ClassNotFoundException e) {
×
29
            return Class.forName(className, false, fallback);
×
30
        }
31
    }
32

33
    private static boolean isPrimitiveTypeName(String className) {
34
        if (className == null) {
1✔
35
            return false;
×
36
        }
37
        for (String primitiveTypeName : PRIMITIVE_TYPE_NAMES) {
1✔
38
            if (primitiveTypeName.equals(className)) {
1✔
39
                return true;
×
40
            }
41
        }
42
        return false;
1✔
43
    }
44
}
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