use of org.nustaq.serialization.FSTClazzInfoRegistry in project redisson by redisson.
the class FstCodec method copy.
private static FSTConfiguration copy(ClassLoader classLoader, FstCodec codec) {
FSTConfiguration def = codec.config.deriveConfiguration();
def.setClassLoader(classLoader);
def.setCoderSpecific(codec.config.getCoderSpecific());
def.setCrossPlatform(codec.config.isCrossPlatform());
def.setForceClzInit(codec.config.isForceClzInit());
def.setForceSerializable(codec.config.isForceSerializable());
def.setInstantiator(codec.config.getInstantiator(null));
def.setJsonFieldNames(codec.config.getJsonFieldNames());
def.setLastResortResolver(codec.config.getLastResortResolver());
def.setName(codec.config.getName());
def.setPreferSpeed(codec.config.isPreferSpeed());
def.setStructMode(codec.config.isStructMode());
def.setShareReferences(codec.config.isShareReferences());
def.setStreamCoderFactory(codec.config.getStreamCoderFactory());
def.setVerifier(codec.config.getVerifier());
try {
Field serializationInfoRegistryField = FSTConfiguration.class.getDeclaredField("serializationInfoRegistry");
serializationInfoRegistryField.setAccessible(true);
FSTClazzInfoRegistry registry = (FSTClazzInfoRegistry) serializationInfoRegistryField.get(codec.config);
serializationInfoRegistryField.set(def, registry);
} catch (Exception e) {
throw new IllegalStateException(e);
}
return def;
}
Aggregations