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

alibaba / jetcache / #444

21 May 2026 07:54AM UTC coverage: 89.292% (+0.6%) from 88.701%
#444

push

areyouok
chore: remove Spring XML namespace support

4778 of 5351 relevant lines covered (89.29%)

0.89 hits per line

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

95.0
/jetcache-core/src/main/java/com/alicp/jetcache/support/KryoValueDecoder.java
1
package com.alicp.jetcache.support;
2

3
import com.esotericsoftware.kryo.Kryo;
4
import com.esotericsoftware.kryo.io.Input;
5

6
import java.io.ByteArrayInputStream;
7

8
/**
9
 * Created on 2016/10/4.
10
 *
11
 * Since 2.8.0 the com.esotericsoftware:kryo should be 5+, kryo4 is not supported.
12
 *
13
 * @author huangli
14
 */
15
public class KryoValueDecoder extends AbstractValueDecoder {
16

17
    public static final KryoValueDecoder INSTANCE = new KryoValueDecoder(true);
1✔
18

19
    public KryoValueDecoder(boolean useIdentityNumber) {
20
        super(useIdentityNumber);
1✔
21
    }
1✔
22

23
    @Override
24
    public Object doApply(byte[] buffer) {
25
        ByteArrayInputStream in;
26
        if (useIdentityNumber) {
1✔
27
            in = new ByteArrayInputStream(buffer, 4, buffer.length - 4);
×
28
        } else {
29
            in = new ByteArrayInputStream(buffer);
1✔
30
        }
31
        Input input = new Input(in);
1✔
32
        KryoValueEncoder.KryoCache kryoCache = null;
1✔
33
        try {
34
            kryoCache =  KryoValueEncoder.kryoCacheObjectPool.borrowObject();
1✔
35
            Kryo kryo = kryoCache.getKryo();
1✔
36
            ClassLoader classLoader = KryoValueDecoder.class.getClassLoader();
1✔
37
            Thread t = Thread.currentThread();
1✔
38
            if (t != null) {
1✔
39
                ClassLoader ctxClassLoader = t.getContextClassLoader();
1✔
40
                if (ctxClassLoader != null) {
1✔
41
                    classLoader = ctxClassLoader;
1✔
42
                }
43
            }
44
            kryo.setClassLoader(classLoader);
1✔
45
            return kryo.readClassAndObject(input);
1✔
46
        }finally {
47
            if(kryoCache != null){
1✔
48
                KryoValueEncoder.kryoCacheObjectPool.returnObject(kryoCache);
1✔
49
            }
50
        }
51
    }
52
}
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